query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Provided as a sorter on migrations by using adapter compare method and taking into consideration the active target. If we are looking into a rollback result the array is reversed.
private function sortMigrations(& $migrations, $target) { $filter = $this->getFilter(); if (!$this->isDownwards($target)) { uksort($migrations, array($filter, 'compare')); } else { uksort($migrations, function($a, $b) use ($filter) { return $filter->compare($b, $a); // reverse arguments } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExecutedMigrations()\n\t{\n\t\t$migrations = $this->getAdapter()->getMigrations();\n\t\tuksort($migrations, array($this->getFilter(), 'compare'));\n\t\treturn $migrations;\n\t}", "public function getAvailableMigrations($target=null)\n\t{\n\t\t// for normal migration we need all files to target\n\t\t// for rollbacks we need from target to the greatest migration\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tif (null !== $target) {\n\t\t\t\t$filter->setToVersion($target);\n\t\t\t}\n\t\t} else {\t// rollback\n\t\t\t$filter->setFromVersion($target);\n\t\t\t$filter->setToVersion($this->getGreatestMigration());\n\t\t}\n\n\t\t$migration_steps = $this->getMigrationSteps();\n\n\t\t// migrations to be executed\n\t\t$to_execute = array();\n\t\tif ($this->isDownwards($target)) {\n\t\t\t// rollback: execute the common part of $executed and $migration_refs\n\t\t\t$executed = $this->getExecutedMigrations();\n\t\t\tforeach($migration_steps as $ref => $migration_class) {\n\t\t\t\tif (array_key_exists($ref, $executed)) {\n\t\t\t\t\t$to_execute[] = $ref;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// migration: execute what's missing - the different of $executed and $available\n\t\t\t$to_execute = array_diff(array_keys($migration_steps), array_keys($this->getExecutedMigrations()));\n\t\t}\n\t\t\n\t\t// go through $to_execute and find the migration steps\n\t\t$migrations = array();\n\t\tforeach ($to_execute as $ref) {\n\t\t\t$migrations[$ref] = $migration_steps[$ref];\n\t\t}\n\t\t\n\t\t// sort migrations according to filter and target\n\t\t// remove one so that to avoid executing target in the case of rollback\n\t\t$this->sortMigrations($migrations, $target);\n\t\tif ($this->isDownwards($target)) {\n\t\t\tarray_pop($migrations);\n\t\t}\n\t\treturn $migrations;\n\t}", "public function test_get_runnable_migrations_going_down_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $this->insert_dummy_version_data(array(3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n $this->clear_dummy_data();\n\n $this->insert_dummy_version_data(array(3));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n\n //go all the way down!\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1, 3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 0, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n }", "public function sortStrategy();", "private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}", "abstract public function prepareSort();", "public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}", "public function test_get_runnable_migrations_going_up_with_target_version_with_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n //pretend we already executed version 1\n $this->insert_dummy_version_data(array(1));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n $this->clear_dummy_data();\n\n //now pre-register some migrations that we have already executed\n $this->insert_dummy_version_data(array(1, 3));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $this->assertEquals(array(), $actual_up_files);\n }", "public function test_get_runnable_migrations_going_down_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', false);\n $this->assertEquals(array() , $actual_down_files);\n }", "public function getRan()\n {\n return $this->table()\n ->where('plugin', $this->plugin)\n ->orderBy('batch', 'asc')\n ->orderBy('migration', 'asc')\n ->pluck('migration')->all();\n }", "public function sortDirection();", "public function needToMigrateList(): array;", "public function getRan()\n {\n global $wpdb;\n\n $sql = \"SELECT migration as name FROM {$wpdb->prefix}exolnet_migration as em\";\n\n $migrations = $wpdb->get_results($sql, 'ARRAY_A');\n\n $migrationCleaned = [];\n if (!empty($migrations) && is_array($migrations)) {\n foreach ($migrations as $migration) {\n $migrationCleaned[] = $migration['name'];\n }\n }\n\n return $migrationCleaned;\n }", "public function test_get_runnable_migrations_going_up_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function getModulesInMigrationOrder(): array;", "private function sortAdaptors()\n {\n $this->sorted = [];\n\n if (isset($this->adaptors)) {\n krsort($this->adaptors);\n $this->sorted = array_merge(...$this->adaptors);\n }\n }", "public function test_get_runnable_migrations_going_up_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "abstract protected function setUpComparator();", "public function migrate($target=null)\n\t{\t\n\t\t$migrations = $this->getAvailableMigrations($target);\n\t\tif (null === $target) {\n\t\t\tend($migrations);\n\t\t\t$target = key($migrations);\n\t\t}\n\t\t\n\t\tif (!$this->isDownwards($target)) {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::UP);\n\t\t} else {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::DOWN);\n\t\t}\n\t}", "public function migrateDateDataProvider()\n {\n return [\n [['20120111235330', '20120116183504'], '20120118', '20120116183504', 'Failed to migrate all migrations when migrate to date is later than all the migrations'],\n [['20120111235330', '20120116183504'], '20120115', '20120111235330', 'Failed to migrate 1 migration when the migrate to date is between 2 migrations'],\n [['20120111235330', '20120116183504'], '20120111235330', '20120111235330', 'Failed to migrate 1 migration when the migrate to date is one of the migrations'],\n [['20120111235330', '20120116183504'], '20110115', null, 'Failed to migrate 0 migrations when the migrate to date is before all the migrations'],\n ];\n }", "public function arrange() {}", "function _compareActions($a,$b){\n\t\tif ( @$a['order'] < @$b['order'] ) return -1;\n\t\telse return 1;\n\t}", "protected function applySorting()\n\t{\n\t\t$i = 1;\n\t\tparse_str($this->order, $list);\n\t\tforeach ($list as $field => $dir) {\n\t\t\t$this->dataSource->sort($field, $dir === 'a' ? IDataSource::ASCENDING : IDataSource::DESCENDING);\n\t\t\t$list[$field] = array($dir, $i++);\n\t\t}\n\t\treturn $list;\n\t}", "public function testMigrationsOptionsRollback()\n {\n $this->exec('completion options migrations.migrations rollback');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--connection -c --date -d --dry-run -x --fake --force -f --help -h --no-lock --plugin -p';\n $expected .= ' --quiet -q --source -s --target -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "public static function sortByStatus(){\n $db = Db::getConnection();\n \n $result = $db->query('SELECT * FROM task ORDER BY status DESC');\n \n return $result->fetchAll();\n }", "private function sortOptions()\r\n {\r\n $pageActions = array(); // For the result\r\n // Sort changes by file\r\n usort($this->changeAr, \"cmp\");\r\n\r\n foreach ($this->changeAr as $line) {\r\n $file = $line['file'];\r\n $action = $line['action'];\r\n if (array_key_exists($file, $pageActions)) {\r\n continue;\r\n }\r\n $pageActions[$file] = $action;\r\n }\r\n// print_r($pageActions);\r\n return $pageActions;\r\n }", "public function test_resolve_current_version_going_down()\n {\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1,2,3));\n\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $migrator_util->resolve_current_version(3, 'down');\n\n $executed = $migrator_util->get_executed_migrations();\n $this->assertEquals(false, in_array(3, $executed));\n $this->assertEquals(true, in_array(1, $executed));\n $this->assertEquals(true, in_array(2, $executed));\n }", "private function getMigrationSteps()\n\t{\n\t\t$migration_steps = array();\n\t\tforeach ($this->getFilter() as $step) {\n\t\t\t$migration_steps[$step->getReference()] = $step;\n\t\t}\n\t\t\n\t\treturn $migration_steps;\n\t}", "function alistcmp($a,$b) {\n $abook_sort_order=get_abook_sort();\n\n switch ($abook_sort_order) {\n case 0:\n case 1:\n $abook_sort='nickname';\n break;\n case 4:\n case 5:\n $abook_sort='email';\n break;\n case 6:\n case 7:\n $abook_sort='label';\n break;\n case 2:\n case 3:\n case 8:\n default:\n $abook_sort='name';\n }\n\n if ($a['backend'] > $b['backend']) {\n return 1;\n } else {\n if ($a['backend'] < $b['backend']) {\n return -1;\n }\n }\n\n if( (($abook_sort_order+2) % 2) == 1) {\n return (strtolower($a[$abook_sort]) < strtolower($b[$abook_sort])) ? 1 : -1;\n } else {\n return (strtolower($a[$abook_sort]) > strtolower($b[$abook_sort])) ? 1 : -1;\n }\n}", "public function testTableSortQuery() {\n $sorts = [\n ['field' => 'Task ID', 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'],\n ['field' => 'Task ID', 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'],\n ['field' => 'Task', 'sort' => 'asc', 'first' => 'code', 'last' => 'sleep'],\n ['field' => 'Task', 'sort' => 'desc', 'first' => 'sleep', 'last' => 'code'],\n // more elements here\n\n ];\n\n foreach ($sorts as $sort) {\n $this->drupalGet('database_test/tablesort/', ['query' => ['order' => $sort['field'], 'sort' => $sort['sort']]]);\n $data = json_decode($this->getSession()->getPage()->getContent());\n\n $first = array_shift($data->tasks);\n $last = array_pop($data->tasks);\n\n $this->assertEquals($sort['first'], $first->task, 'Items appear in the correct order.');\n $this->assertEquals($sort['last'], $last->task, 'Items appear in the correct order.');\n }\n }" ]
[ "0.61306554", "0.5970115", "0.5741293", "0.5612099", "0.5611924", "0.54668725", "0.5440495", "0.5427333", "0.53959805", "0.5364229", "0.53486395", "0.5300365", "0.5291238", "0.5271432", "0.525964", "0.5181459", "0.5163683", "0.5158265", "0.5152694", "0.51272976", "0.51205736", "0.5116024", "0.50736016", "0.50612247", "0.50537723", "0.5049598", "0.5023374", "0.5013744", "0.50022286", "0.499642" ]
0.6849838
0
Go through the filter iterator and stores the fetched migration steps in an associative array with the key holding the reference number for easy access.
private function getMigrationSteps() { $migration_steps = array(); foreach ($this->getFilter() as $step) { $migration_steps[$step->getReference()] = $step; } return $migration_steps; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMigrations($steps)\n {\n global $wpdb;\n\n $sql = \"SELECT * FROM {$wpdb->prefix}exolnet_migration as em\n WHERE batch >= 1 ORDER BY batch DESC, migration DESC LIMIT {$steps}\";\n\n return $wpdb->get_results($sql, 'ARRAY_A');\n }", "abstract public function enumAppliedMigrationSteps();", "public function undo_get_steps() {\n global $db, $uid;\n $steps = $db->fetch_table(\"SELECT * FROM `\".$this->table.\"_undo` WHERE FK_USER=\".$uid.\" ORDER BY STAMP DESC\");\n for ($i = 0; $i < count($steps); $i++) {\n if ($steps[$i][\"ACTION\"] == \"MOVE\") {\n $node = $this->element_read($steps[$i][\"FK_KAT\"]);\n $node_parent = $this->element_read($steps[$i][\"FK_PARENT\"]);\n $node_parent_prev = $this->element_read($steps[$i][\"FK_PARENT_PREV\"]);\n $steps[$i][\"KAT_NAME\"] = $node[\"V1\"];\n $steps[$i][\"PARENT_NAME\"] = $node_parent[\"V1\"];\n $steps[$i][\"PARENT_PREV_NAME\"] = $node_parent_prev[\"V1\"];\n }\n if ($steps[$i][\"ACTION\"] == \"RESTORE\") {\n $backup_desc = $this->tree_backup_get_desc($steps[$i][\"FK_PARENT\"]);\n $steps[$i][\"BACKUP_STAMP\"] = $backup_desc[\"STAMP\"];\n $steps[$i][\"BACKUP_NAME\"] = $backup_desc[\"DESCRIPTION\"];\n }\n }\n return $steps;\n }", "public function getStepHistory();", "function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }", "public function getMigrations($steps)\n {\n $query = $this->table()\n ->where('plugin', $this->plugin)\n ->where('batch', '>=', '1');\n\n return $query->orderBy('migration', 'desc')->take($steps)->get()->all();\n }", "private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}", "function doBatchLookups() {\n\t\t$this->mResult->seek( 0 );\n\t\t$revIds = array();\n\t\t$batch = new LinkBatch();\n\t\t# Give some pointers to make (last) links\n\t\tforeach ( $this->mResult as $row ) {\n\t\t\tif ( isset( $row->rev_parent_id ) && $row->rev_parent_id ) {\n\t\t\t\t$revIds[] = $row->rev_parent_id;\n\t\t\t}\n\t\t\tif ( isset( $row->rev_id ) ) {\n\t\t\t\tif ( $this->contribs === 'newbie' ) { // multiple users\n\t\t\t\t\t$batch->add( NS_USER, $row->user_name );\n\t\t\t\t\t$batch->add( NS_USER_TALK, $row->user_name );\n\t\t\t\t}\n\t\t\t\t$batch->add( $row->page_namespace, $row->page_title );\n\t\t\t}\n\t\t}\n\t\t$this->mParentLens = Revision::getParentLengths( $this->mDbSecondary, $revIds );\n\t\t$batch->execute();\n\t\t$this->mResult->seek( 0 );\n\t}", "public function buildRefArray(){\n $query = $this->db->query(\" SELECT `TABLE_NAME`\n FROM `INFORMATION_SCHEMA`.`COLUMNS` \n WHERE `TABLE_SCHEMA`= DATABASE()\n \");\n $tablesTmp = $query->result();\n \n \n /**\n * Get each table's column and referance table name with referance column\n */\n $query = $this->db->query(\" SELECT\n INFORMATION_SCHEMA.COLUMNS.TABLE_NAME AS `table_name`,\n INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME AS `column_name`\n FROM INFORMATION_SCHEMA.COLUMNS \n WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_SCHEMA = DATABASE()\n \");\n \n $query2 = $this->db->query(\" SELECT \n INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME AS `table_name`,\n INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME AS `column_name`,\n INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME AS `referenced_column_name`,\n INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME AS `referenced_table_name`\n FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE\n WHERE INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA = DATABASE()\n AND INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_SCHEMA = DATABASE()\n \");\n \n /**\n * Setting query array as $refArr['tableName'][columnName] = [refData]\n */\n \n // Step1: Arrange referance column usage array\n foreach($query2->result_array() as $key => $val){ \n $refArr[$val['table_name']] = [$val['column_name'] => ['ref_table_name' => $val['referenced_table_name'], 'ref_column_name' => $val['referenced_column_name']]];\n }\n \n // Step2: Arrange $refArr\n foreach($query->result_array() as $key => $val){\n \n $refArr[$val['table_name']] = !isset($refArr[$val['table_name']]) ? [] : $refArr[$val['table_name']];\n \n $refArr[$val['table_name']][$val['column_name']] = isset($refArr[$val['table_name']]) && isset($refArr[$val['table_name']][$val['column_name']])\n ? [\n \"refTable\" => $refArr[$val['table_name']][$val['column_name']]['ref_table_name'], \n \"refTableCol\" => $refArr[$val['table_name']][$val['column_name']]['ref_column_name']\n ]\n : false;\n }\n \n return $refArr;\n }", "function get_all_steps() {\r\n return $this->get_assoc();\r\n }", "function migration()\n {\n $this->ci->db->select('students_id');\n $this->ci->db->from('students');\n $result = $this->ci->db->get()->result();\n $fyear = new Financial_lib();\n $i=0;\n \n foreach ($result as $res)\n {\n if ( $this->cek($res->students_id,$fyear->get()) == TRUE )\n { $this->migration_process($res->students_id,$fyear->get()); $i++;}\n }\n return $i;\n }", "public function getPreparationSteps(): array\n {\n return [\n new CallbackStep(function (string $rawValue): array {\n return UnpackCSV::un((string) $rawValue, $this->separator);\n }, 'unpacks value')\n ];\n }", "public function needToMigrateList(): array;", "public function getIterator()\n {\n return new \\ArrayIterator($this->steps);\n }", "public function getHistory()\n\t{\n\t\t$log = $this->getLog();\n\t\t$history = array($this->initial);\n\t\t/* if our log is empty (or incorrect), then we cannot walk it at all */\n\t\tif (!isset($log[$this->initial]))\n\t\t\treturn $history;\n\t\t$next = $log[$this->initial]->next_action_id;\n\t\t/* log always has the latest entry,\n\t\t\t so build it walking to the next item,\n\t\t\t starting from the initial step */\n\t\twhile (!is_null($next)) {\n\t\t\t$history[] = $next;\n\t\t\tif (isset($log[$next])) {\n\t\t\t\t$next = $log[$next]->next_action_id;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $history;\n\t}", "public function applied()\n {\n $migrationFiles = array();\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from(self::TABLE);\n \n $selectString = $sql->getSqlStringForSqlObject($select);\n $results = $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\n \n if ($results->count() > 0) {\n foreach ($results as $migration) {\n $migrationFiles[] = $migration->migration;\n }\n }\n \n return $migrationFiles;\n }", "public function getMigrations(){\n $migrations[] = new migrateTable0001($this->get('db'));\n $migrations[] = new migrateTable0002($this->get('db'));\n $migrations[] = new migrateTableEvent($this->get('db'));\n $migrations[] = new migrateTableMessages($this->get('db'));\n $migrations[] = new migrateTablePerson($this->get('db'));\n $migrations[] = new migrateTable122320151845($this->get('db'));\n\n return $migrations;\n }", "public abstract function getSteps();", "private function bindReferencesGeneratedEvent()\n {\n Event::listen('pages.menu.referencesGenerated', function (&$items) {\n $counter = 0; //closure counter\n $iterator = function ($menuItems) use (&$iterator, &$counter) {\n $result = [];\n foreach ($menuItems as $item) {\n\n /**\n * pages.menuitem.resolveItem is only fired if $item->type != 'url'\n * Mimic logic here.\n */\n if ($item->type != 'url') {\n if ($this->shouldHideIndexes[$counter] ?? false) {\n $item->viewBag['isHidden'] = true;\n }\n $counter++;\n }\n\n if ($item->items) {\n $iterator($item->items);\n }\n $result[] = $item;\n }\n return $result;\n };\n $items = $iterator($items, $counter);\n });\n }", "public function collectMigrations(): array;", "private function processFilterReference($filterReference)\n {\n foreach ($filterReference as $key => $value) {\n $this->cleanFilter($value['ref']);\n if (!isset($this->requestData['filters'][$value['ref']])) {\n unset($filterReference[$key]);\n }\n }\n return $filterReference;\n }", "public function get_applied_migrations(): array\n {\n $stmt = $this->pdo->prepare(\"SELECT migration FROM migrations\");\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_COLUMN, 0);\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }", "public function setReferenceDependencies(array &$definitions) {\n if (empty($this->collectedReferences)) {\n return;\n }\n\n $collectedSubDependencies = [];\n\n foreach ($definitions as $definitionId => $definition) {\n if (!isset($this->collectedReferences[$definitionId])) {\n continue;\n }\n\n $references = $this->collectedReferences[$definitionId];\n\n foreach ($references as $element => $target) {\n $subDependencies = [];\n\n foreach ($target as $reference) {\n $subDefinition = $this->buildMigrationDefinition(\n [\n 'projectId' => $reference['base_data']['projectId'],\n 'templateId' => $reference['base_data']['templateId'],\n 'entityType' => $reference['base_data']['entityType'],\n 'contentType' => $reference['base_data']['contentType'],\n ],\n $reference['data'],\n 'entity_reference_revisions'\n );\n\n $subDependencies[$subDefinition['id']] = $subDefinition;\n\n $key = implode('_', [\n $reference['base_data']['projectId'],\n $reference['base_data']['templateId'],\n $reference['base_data']['entityType'],\n $reference['base_data']['contentType'],\n ]);\n $collectedSubDependencies[$key][$subDefinition['id']] = $subDefinition;\n }\n $this->setReferenceDependencies($subDependencies);\n\n $collected = [];\n\n foreach ($subDependencies as $subDefinitionId => $subDefinition) {\n $this->migrationDefinitionIds[] = $subDefinitionId;\n\n $definitions[$definitionId]['migration_dependencies']['optional'][] = $subDefinitionId;\n $definitions[$definitionId]['process']['collect_' . $subDefinitionId] = [\n 'plugin' => 'migration_lookup',\n 'migration' => $subDefinitionId,\n 'source' => 'id',\n ];\n\n $collected[] = '@collect_' . $subDefinitionId;\n }\n\n if (!empty($collected)) {\n $definitions[$definitionId]['process']['get_collected_' . $element] = [\n 'plugin' => 'get',\n 'source' => $collected,\n ];\n\n $definitions[$definitionId]['process'][$element] = [\n [\n 'plugin' => 'gather_content_reference_revision',\n 'source' => '@get_collected_' . $element,\n ],\n [\n 'plugin' => 'sub_process',\n 'process' => [\n 'target_id' => [\n 'plugin' => 'extract',\n 'source' => 'id',\n 'index' => [0],\n ],\n 'target_revision_id' => [\n 'plugin' => 'extract',\n 'source' => 'id',\n 'index' => [1],\n ],\n ],\n ],\n ];\n }\n }\n }\n\n foreach ($collectedSubDependencies as $dependencies) {\n $this->setLanguageDefinitions($dependencies);\n\n foreach ($dependencies as $subDefinitionId => $subDefinition) {\n $migration = Migration::create($subDefinition);\n $migration->save();\n }\n }\n }", "public function column_next_steps( $item ) {}", "function _calculate_used_indexes($steps) {\n $indexes = array();\n\n // For current slices set 1 for all\n foreach ($this->slices as $slice)\n $this->_inc($indexes, $slice['index']);\n\n // change $indexes like they could be changed if each step in $steps were applied\n foreach ($steps as $step) {\n switch ($step['action']) {\n case 'delete_slice':\n $this->_dec($indexes, $this->slices[$step['id']]['index']);\n break;\n case 'create_slice':\n $this->_inc($indexes, $step['source']['index']);\n break;\n case 'update_slice_attrs':\n $this->_dec($indexes, $this->slices[$step['id']]['index']);\n $this->_inc($indexes, $step['source']['index']);\n break;\n case 'update_slice_geometry':\n break;\n default:\n throw new Exception(\"Unknown step action: \" . $step['action']);\n }\n }\n\n unset($indexes['-1']);\n return $indexes;\n }", "protected function populateInstanceActionIds()\n {\n populateActiveIds($this->instanceActiveIdHash, $this->instanceIdsIdentifier);\n\n // Same, for per-edah filter.\n if ($this->activeEdotFilterTable) {\n $multiColName = $this->activeEdotFilterTable;\n populateActiveIds($this->activeEdotHash, $multiColName);\n }\n }", "public function history()\n\t{\n\t\t$migration = new \\Hubzero\\Content\\Migration();\n\t\t$history = $migration->history();\n\t\t$items = [];\n\t\t$maxFile = 0;\n\t\t$maxUser = 0;\n\t\t$maxScope = 0;\n\n\n\t\tif ($history && count($history) > 0)\n\t\t{\n\t\t\t$items[] = [\n\t\t\t\t'File',\n\t\t\t\t'By',\n\t\t\t\t'Direction',\n\t\t\t\t'Date'\n\t\t\t];\n\n\t\t\tforeach ($history as $entry)\n\t\t\t{\n\t\t\t\t$items[] = [\n\t\t\t\t\t$entry->scope . DS . $entry->file,\n\t\t\t\t\t$entry->action_by,\n\t\t\t\t\t$entry->direction,\n\t\t\t\t\t$entry->date\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t$this->output->addTable($items, true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->addLine('No history to display.');\n\t\t}\n\t}", "public function processMigration(Migration $migration): void;", "public function getMigrations(): array\n {\n $result = [];\n foreach ($this->repository->getMigrations() as $migration) {\n //Populating migration state and execution time (if any)\n $result[] = $migration->withState($this->resolveState($migration));\n }\n\n return $result;\n }" ]
[ "0.5509165", "0.54006493", "0.5283156", "0.52501714", "0.5166381", "0.50223976", "0.48835343", "0.4878478", "0.48537058", "0.48440874", "0.47927505", "0.4772981", "0.47431618", "0.46935946", "0.465664", "0.46439365", "0.46239606", "0.4562514", "0.45407766", "0.4528245", "0.4506229", "0.44913816", "0.44777125", "0.44717923", "0.4448513", "0.4448209", "0.4448195", "0.44475672", "0.44349796", "0.44299334" ]
0.72580534
0
Show the edit form for dock permissions
public function edit(Dock $dock) { $this->authorize(get_class($dock) . '.edit-permissions'); return view('admin::docks.' . $dock->name . '.permissions.edit')->withDock($dock); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit()\n {\n return view('permission::edit');\n }", "public function editPasswordAdmin()\n {\t\n \treturn view('setting.edit-password-admin');\n }", "function displayEditScreen()\t{\t \n\t\t// We handle here Edit mode or Preview Mode\n\t\t// Edit Mode : User can edit fields\n\t\t// Preview Mode : user can only see fields\t\n\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('displayEditScreen'=>'on'));\n\t\t$exporttype=$this->piVars['exporttype'];\n\t\t$print=$this->piVars['print'];\n\t\t$printerName=$this->piVars['printername'];\n\t\t$printServerName=$this->piVars['printservename'];\n\t\tif ($exporttype == 'PDF') $exporttype = \"PDFDET\";\n\t\t$this->conf['cmdmode']='edit';\t\n\t\t// We handle here Edit mode or Preview Mode\n\t \t// Edit Mode : User can edit fields\n\t \t// Preview Mode : user can only see fields\t \n\t \t//$this->markerArray['###BACK_URL###'] = \"\";\n\t \t\n\t\t//We handle backurl...\n\t\t/*if ($this->conf['edit.']['backPagePid'] && !$this->conf['no_action']) {\n\t\t\t$this->backURL=$this->pi_getPageLink($this->conf['edit.']['backPagePid']);\n\t\t\tif (!strpos($this->backURL,'?')) $this->backURL.='?';\n\t\t\t$this->markerArray['###BACK_URL###'] = $this->backURL;\n\t\t}*/\n\t\t// If editing is enabled\n\t\tif ($this->conf['edit'] || $this->preview || $this->conf['list'] )\t{\t\n\t\t\t// hack for lists in second plugin ... to be checked.., Will not work if we want to edit in second plugin ...\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('Edit or preview'=>'on'));\n\t\t\t$uid=$this->dataArr[$this->conf['uidField']]?$this->dataArr[$this->conf['uidField']]:$this->recUid;\n \t\t\tif ($this->conf['list.']['rUJoinField']=='uid' && $uid){\n \t\t\t\t\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('UIDFIELD'=>$this->conf['uidField'].' : '.$this->recUid));\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('dataArr'=>$this->dataArr[$this->conf['uidField']]));\n\t\t\t\t$origArr = $this->metafeeditlib->getRawRecord($this->theTable,$uid,$this->conf);\n\t\t\t\tif (!$origArr) die(__METHOD__.\":Detail mode and no id given for $this->theTable,$uid\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('editMode'=>'on'));\n\n\t\t\t// here we handle foreign tables not the best way , we should work on join tables especially if we handle lists...\n\t\t\t\n\t\t\tif ($this->conf['foreignTables'] && is_array($origArr)) {\n\t\t\t\t\n\t\t\t\t//MM not implemented\n\t\t\t\t//Not MM\n\t\t\t\t\n\t\t\t\t$FTRels=t3lib_div::trimexplode(',',$this->conf['foreignTables']);\n\t\t\t\tforeach($FTRels as $FTRel) {\n\t\t\t\t\t$FTable=$GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['foreign_table'];\n\t\t\t\t\t$FTUid=$origArr[$FTRel];\n\t\t\t\t\t// what if multiple ???\n\t\t\t\t\t// what if editmenu list ???\n\t\t\t\t\tif ($FTUid) {\n\t\t\t\t\t\t //on recup l'id de l'enregistrement a associer\n\t\t\t\t\t\tif ($GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM']) { //si on est dans une MM faut d'abord recup les id de la table MM\n\t\t\t\t\t\t\t$MMT = $GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM'];\n\t\t\t\t\t\t\t$LTUid=$origArr[\"uid\"];\n\t\t\t\t\t\t\t$MMTreq = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('*',$this->theTable,$MMT,$FTable,'AND '.$this->theTable.'.uid='.$origArr['uid']);\n\t\t\t\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($MMTreq);\n\t\t\t\t\t\t\tif ($resu>=1) {\n\t\t\t\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMTreq)) {\n\t\t\t\t\t\t\t\t\tforeach($row as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// originally there only these 2 lines in this condition (if ($FTUid) )\n\t\t\t\t\t\t\t$FTorigArr = $GLOBALS['TSFE']->sys_page->getRawRecord($FTable, $FTUid);\n\t\t\t\t\t\t\tif (is_array($FTorigArr)) foreach($FTorigArr as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\n\t\t\t\t\t\t}\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$FTCA=$GLOBALS['TCA'][$FTable]['columns'];\n\t\t\t\t\t\t//krumo ($FTCA);\n\t\t\t\t\t\tif (is_array($FCTA)) foreach($FTCA as $key=>$val) {\n\t\t\t\t\t\t\tif (in_array(substr($FTCA,0,11),array('--div--;Tab','--fsb--;FSB','--fse--;FSE'))) continue;\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_EVAL_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//<CBY> We go to detail mode directly if editUnique is true and there is only one elment to edit.\n\t\t\t$DBSELECT=$this->metafeeditlib->DBmayFEUserEditSelectMM($this->theTable,$GLOBALS['TSFE']->fe_user->user, $this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$mmTable,$this->conf).$GLOBALS['TSFE']->sys_page->deleteClause($this->theTable);\n\n\t\t\t$TABLES=$mmTable?$this->theTable.','.$mmTable:$this->theTable;\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>$origArr));\n\t\t\tif (!is_array($origArr)&&$this->conf['editUnique']) {\n\t\t\t\t$lockPid = ($this->conf['edit.']['menuLockPid'] && $this->conf['pid'])? ' AND pid='.intval($this->thePid) : '';\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT);\n\t\t\t\tif ($this->conf['debug']) \techo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDITUNIQUE TEST'=>$GLOBALS['TYPO3_DB']->SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT)));\n\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($res);\n\t\t\t\tif ($resu>=1)\t{\n \t\t\t\t\twhile($menuRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $menuRow[$this->conf['uidField']]);\n\t\t\t\t\t\t$this->recUid=$menuRow[$this->conf['uidField']];\n\t\t\t\t\t\t$this->conf['recUid']=$this->recUid;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t\t// <CBY>\n\t\t\t$this->markerArray['###REC_UID###']=$this->recUid;\n\t\t\t//if ($GLOBALS['TSFE']->loginUser || $this->aCAuth($origArr))\t{\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\n\t\t\t\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"No login\"));\n\t\t\t\n\t\t\t\t// We come from ??\n\t\t\t\tif (is_array($origArr) && !($this->conf['inputvar.']['BACK'] && $this->conf['inputvar.']['cameFromBlog']))\t{\n\t\t\t\t\tif ($this->conf['blogData']) $this->preview=1; \n\t\t\t\t\t// we check if edit or preview mode is allowed ...\n\t\t\t\t\tif (!$this->conf['edit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option is not set and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($this->conf['disableEdit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option disabled and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t\n\t\t\t\t\t\t// Display the form, if access granted.\n\t\t\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"User may edit\"));\n\t\t\t\t\t\tif \t($this->conf['evalFunc'])\t{\n\t\t\t\t\t\t\t$origArr = $this->userProcess('evalFunc',$origArr);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->markerArray = $this->setfixed($this->markerArray, $this->conf['setfixed.'], $origArr);\n\t\t\t\t\t\t$content=$this->displayEditForm($origArr,$this->conf,$exporttype,$print,$printerName,$printServerName);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Else display error, that you could not edit that particular record...\t\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_NO_PERMISSIONS###');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the recUid did not select a record, we display a menu of records. (eg. if no recUid)\n\t\t\t\t\t// we check if list mode is allowed ...\n\t\t\t\t\tif (!$this->conf['list'])\t{\t// If editing is enabled\n\t\t\t\t\t\t\t$content.='List-option is not set in TypoScript';\n\t\t\t\t\t\t return $content;\n\t\t\t\t\t}\n\t\t\t\t\t//$content=($this->conf['general.']['listMode']==2)?$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf):$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\tswitch($this->conf['general.']['listMode']) {\n\t\t\t\t\t\tcase 2 :\n\t\t\t\t\t\t\t$content=$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1 :\n\t\t\t\t\t\t\t\t//$content=$this->metafecalendar->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\t$cal=t3lib_div::makeInstance('tx_metafeedit_calendar');\n\t\t\t\t\t\t $cal->initObj($this->metafeeditlib,$this->cObj);\n\t\t\t\t\t\t\t$content=$cal->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$content=$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Finally this is if there is no login user. This must tell that you must login. Perhaps link to a page with create-user or login information.\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_AUTH###');\n\t\t\t}\n\t\t} else {\n\t\t\t$content.='Display Edit Screen : Edit-option , Preview-option or List-option is not set in TypoScript';\n\t\t}\n\t\treturn $content;\n\t}", "public function modifyView() {\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n return $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modify', true),\n 'class'=>'formAdmin formAdminModify'),\n array('submit'=>array('save'=>__('save'),\n 'saveCheck'=>__('saveCheck')))));\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "function edit()\r\n\t{\r\n\t\tJRequest::setVar('view', 'groups');\r\n\t\tJRequest::setVar('layout', 'edit');\r\n\t\tparent::display();\r\n\t}", "protected function AdminPage() {\n\t$oPathIn = fcApp::Me()->GetKioskObject()->GetInputObject();\n\t$oFormIn = fcHTTP::Request();\n\n\t$doSave = $oFormIn->GetBool('btnSave');\n\n\t// save edits before showing events\n\tif ($doSave) {\n\t $frm = $this->PageForm();\n\t $frm->Save();\n\t $this->SelfRedirect();\n\t}\n\n\t$oMenu = fcApp::Me()->GetHeaderMenu();\n\t // ($sGroupKey,$sKeyValue=TRUE,$sDispOff=NULL,$sDispOn=NULL,$sPopup=NULL)\n\t $oMenu->SetNode($ol = new fcMenuOptionLink('do','edit',NULL,NULL,'edit this record'));\n\n\t $doEdit = $ol->GetIsSelected();\n\n\t$frmEdit = $this->PageForm();\n\tif ($this->IsNew()) {\n\t $frmEdit->ClearValues();\n\t} else {\n\t $frmEdit->LoadRecord();\n\t}\n\t$oTplt = $this->PageTemplate();\n\t$arCtrls = $frmEdit->RenderControls($doEdit);\n\t\n\t$out = NULL;\n\t$arCtrls['!ID'] = $this->SelfLink();\n\tif ($doEdit) {\n\t $out .= \"\\n<form method=post>\";\n\t $arCtrls['!extra'] = '<tr>\t<td colspan=2><b>Edit notes</b>: <input type=text name=\"'\n\t .KS_FERRETERIA_FIELD_EDIT_NOTES\n\t .'\" size=60></td></tr>'\n\t ;\n\t $arCtrls['isType'] .= ' is a type';\n\t} else {\n\t $arCtrls['!extra'] = NULL;\n\t $arCtrls['isType'] = $this->IsType()?'type':'folder';\n\t}\n\n\t$oTplt->SetVariableValues($arCtrls);\n\t$out .= $oTplt->RenderRecursive();\n\t\n\tif ($doEdit) {\t \n\t $out .= <<<__END__\n<input type=submit name=\"btnSave\" value=\"Save\">\n<input type=reset value=\"Reset\">\n</form>\n__END__;\n\t}\n\treturn $out;\n }", "function path_admin_edit($pid = 0) {\n if ($pid) {\n $alias = path_load($pid);\n drupal_set_title(check_plain($alias['dst']));\n $output = drupal_get_form('path_admin_form', $alias);\n }\n else {\n $output = drupal_get_form('path_admin_form');\n }\n\n return $output;\n}", "public function isEditFormShown() {}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function getEditForm();", "function canEdit() {\n\t\t\treturn true;\n\t\t}", "public function displayAdminPanel() {}", "public function can_edit() {\n return true;\n }", "protected function canEdit() {}", "public function editPrivacyAction()\n {\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n $this->view->project_id = $project_id = $this->_getParam('project_id');\n //GET PROJECT ITEM\n $this->view->project = $project = Engine_Api::_()->getItem('sitecrowdfunding_project', $project_id);\n //SHOW THE TAB ACTIVE IN DASHBOARD\n $this->view->activeItem = 'sitecrowdfunding_dashboard_editprivacy';\n //IF THERE IS NO PROJECT.\n if (empty($project)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n if (!$project->isOpen()) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n Engine_Api::_()->core()->setSubject($project);\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n $this->view->form = $form = new Sitecrowdfunding_Form_Project_Privacy();\n $form->removeDecorator('title');\n $form->removeDecorator('description');\n\n $tableProjects = Engine_Api::_()->getDbTable('projects', 'sitecrowdfunding');\n\n $leaderList = $project->getLeaderList();\n //SAVE PROJECT ENTRY\n if (!$this->getRequest()->isPost()) {\n\n //prepare tags\n $projectTags = $project->tags()->getTagMaps();\n $tagString = '';\n\n foreach ($projectTags as $tagmap) {\n $temp = $tagmap->getTag();\n if (!empty($temp)) {\n if ($tagString != '')\n $tagString .= ', ';\n $tagString .= $tagmap->getTag()->getTitle();\n }\n }\n\n $this->view->tagNamePrepared = $tagString;\n if (isset($form->tags))\n $form->tags->setValue($tagString);\n\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n foreach ($roles as $roleString) {\n\n $role = $roleString;\n if ($role === 'leader') {\n $role = $leaderList;\n }\n\n if ($form->auth_view) {\n if (1 == $auth->isAllowed($project, $role, \"view\")) {\n $form->auth_view->setValue($roleString);\n }\n }\n\n if ($form->auth_comment) {\n if (1 == $auth->isAllowed($project, $role, \"comment\")) {\n $form->auth_comment->setValue($roleString);\n }\n }\n }\n $ownerList = '';\n $roles_photo = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered');\n\n foreach ($roles_photo as $roleString) {\n\n $role = $roleString;\n if ($role === 'leader') {\n $role = $leaderList;\n }\n\n //Here we change isAllowed function for like privacy work only for populate.\n $sitecrowdfundingAllow = Engine_Api::_()->getApi('allow', 'sitecrowdfunding');\n if ($form->auth_topic && 1 == $sitecrowdfundingAllow->isAllowed($project, $role, 'topic')) {\n $form->auth_topic->setValue($roleString);\n }\n\n if (isset($form->auth_post) && $form->auth_post && 1 == $sitecrowdfundingAllow->isAllowed($project, $role, 'post')) {\n $form->auth_post->setValue($roleString);\n }\n }\n if (Engine_Api::_()->sitecrowdfunding()->listBaseNetworkEnable()) {\n if (empty($project->networks_privacy)) {\n $form->networks_privacy->setValue(array(0));\n } else {\n $form->networks_privacy->setValue(explode(\",\", $project->networks_privacy));\n }\n }\n\n // Set the member_invite, member_approval options\n $form->member_invite->setValue($tableProjects->getColumnValue($project_id, 'member_invite'));\n $form->member_approval->setValue($tableProjects->getColumnValue($project_id, 'member_approval'));\n\n // $form->payment_action_label->setValue($tableProjects->getColumnValue($project_id, 'payment_action_label'));\n\n\n $notify_project_comment = $tableProjects->getColumnValue($project_id, 'notify_project_comment');\n $notify_project_donate = $tableProjects->getColumnValue($project_id, 'notify_project_donate');\n $is_user_followed_after_comment_yn = $tableProjects->getColumnValue($project_id, 'is_user_followed_after_comment_yn');\n $is_user_followed_after_donate_yn = $tableProjects->getColumnValue($project_id, 'is_user_followed_after_donate_yn');\n\n $form->notify_project_comment->setValue((explode(\",\",$notify_project_comment)));\n $form->notify_project_donate->setValue((explode(\",\",$notify_project_donate)));\n $form->is_user_followed_after_comment_yn->setValue($is_user_followed_after_comment_yn);\n $form->is_user_followed_after_donate_yn->setValue($is_user_followed_after_donate_yn);\n\n return;\n }\n\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n\n $values = $form->getValues();\n\n $notifyProjectCommentIdAsStr = null;\n $notifyProjectDonateIdAsStr = null;\n\n // check if user selected anyone in notification\n if(isset($values['notify_project_comment'])){\n $notifyProjectCommentIdAsArray = array();\n $notifyProjectCommentIdAsArray = $values['notify_project_comment'];\n $notifyProjectCommentIdAsStr = implode(\",\",$notifyProjectCommentIdAsArray);\n }\n\n // check if user selected anyone in notification\n if(isset($values['notify_project_donate'])){\n $notifyProjectDonateAsArray = array();\n $notifyProjectDonateAsArray = $values['notify_project_donate'];\n $notifyProjectDonateIdAsStr = implode(\",\",$notifyProjectDonateAsArray);\n }\n\n if (empty($values))\n return;\n\n $projectModel = $project;\n\n // Update the member_invite, member_approval options\n $tableProjects->update(array(\n // 'payment_action_label' => $values['payment_action_label'],\n 'member_invite' => $values['member_invite'],\n 'member_approval' => $values['member_approval'],\n 'is_privacy_edited_yn' => 1,\n 'notify_project_donate' => $notifyProjectDonateIdAsStr,\n 'notify_project_comment' => $notifyProjectCommentIdAsStr,\n 'is_user_followed_after_comment_yn' => $values['is_user_followed_after_comment_yn'],\n 'is_user_followed_after_donate_yn' => $values['is_user_followed_after_donate_yn']\n ), array('project_id = ?' => $project_id));\n\n //PRIVACY WORK\n $auth = Engine_Api::_()->authorization()->context;\n\n $roles = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n $leaderList = $projectModel->getLeaderList();\n\n if (empty($values['auth_view'])) {\n $values['auth_view'] = \"everyone\";\n }\n\n if (empty($values['auth_comment'])) {\n $values['auth_comment'] = \"registered\";\n }\n\n $viewMax = array_search($values['auth_view'], $roles);\n $commentMax = array_search($values['auth_comment'], $roles);\n\n foreach ($roles as $i => $role) {\n\n if ($role === 'leader') {\n $role = $leaderList;\n }\n\n $auth->setAllowed($projectModel, $role, \"view\", ($i <= $viewMax));\n $auth->setAllowed($projectModel, $role, \"comment\", ($i <= $commentMax));\n }\n $ownerList = '';\n $roles = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered');\n if (empty($values['auth_topic'])) {\n $values['auth_topic'] = \"registered\";\n }\n if (isset($values['auth_post']) && empty($values['auth_post'])) {\n $values['auth_post'] = \"registered\";\n }\n\n $topicMax = array_search($values['auth_topic'], $roles);\n $postMax = '';\n if (isset($values['auth_post']) && !empty($values['auth_post']))\n $postMax = array_search($values['auth_post'], $roles);\n\n foreach ($roles as $i => $role) {\n\n if ($role === 'leader') {\n $role = $leaderList;\n }\n $auth->setAllowed($projectModel, $role, \"topic\", ($i <= $topicMax));\n if (!is_null( $postMax ) ) {\n $auth->setAllowed($projectModel, $role, \"post\", ($i <= $postMax));\n }\n }\n // Create some auth stuff for all leaders\n $auth->setAllowed($projectModel, $leaderList, 'topic.edit', 1);\n $auth->setAllowed($projectModel, $leaderList, 'edit', 1);\n $auth->setAllowed($projectModel, $leaderList, 'delete', 1);\n //UPDATE KEYWORDS IN SEARCH TABLE\n if (!empty($keywords)) {\n Engine_Api::_()->getDbTable('search', 'core')->update(array('keywords' => $keywords), array('type = ?' => 'sitecrowdfunding_project', 'id = ?' => $projectModel->project_id));\n }\n if (!empty($project_id)) {\n $projectModel->setLocation();\n }\n $actionTable = Engine_Api::_()->getDbtable('actions', 'activity');\n foreach ($actionTable->getActionsByObject($projectModel) as $action) {\n $actionTable->resetActivityBindings($action);\n }\n }\n\n }", "public function showEdit()\n {\n\n }", "function mda_settings_form() {\n\t$form['mda_resources_access'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => 'Page d\\'infos sur l\\'accès aux ressources MDA',\n\t\t\t'#description' => 'Information affichée à un utilisateur non connecté essayant de voir une ressource dont la visibilité est \"professionnels\".',\n\t);\n\t\n\t$default_text = \"<p>L'accès à cette ressource est réservée aux professionnels possédant un compte sur ce site.</p>\\n\";\n\t$default_text .= \"<p><a href=\" . \"/user\" . \">Accès au formulaire de connexion</a>.</p>\\n\";\n\t$default_text .= '<p>Si vous êtes un professionnel et que vous ne possédez pas de compte,';\n\t$default_text .= ' rendez-vous sur la page de création d\\'un <a href=\"/user/register\">nouveau compte</a>.';\n\n\t$form['mda_resources_access']['mda_restricted_access_text'] = array(\n\t\t\t'#type' => 'text_format',\n\t\t\t'#title' => 'Texte d\\'information',\n\t\t\t'#size' => 100,\n\t\t\t'#default_value' => variable_get('mda_restricted_access_text', $default_text),\n\t\t\t'#format'=> 'full_html',\n\t);\n\n\treturn system_settings_form($form);\n}", "function show_edit()\n\t{\n\t\treturn '';\n\t}", "public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }", "public function edit()\n {\n return view('theme::user.settings');\n }", "public function edit($id) {\n\n if (Sentinel::hasAccess(['role.permissions'])) {\n // Execute this code if the user has permission\n //find role by id\n $roles = Sentinel::findRoleById($id);\n // find all package with his permissions\n $modules = Module::with('menus.permissions', 'permissions')->get()->toArray();\n\n return view('permissions::create', compact('modules', 'roles'));\n } else {\n\n alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar');\n return back();\n }\n }", "function show_acl_form() {\n\t$formDefaults = array(\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_RED_READ\"),\n\t\t\t\t\t'name' => t('Reduced Read'),\n\t\t\t\t\t'value' => FALSE,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_READ\"),\n\t\t\t\t\t'name' => t('Read'),\n\t\t\t\t\t'value' => TRUE,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_RED_WRITE\"),\n\t\t\t\t\t'name' => t('Reduces Write'),\n\t\t\t\t\t'value' => FALSE,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_WRITE\"),\n\t\t\t\t\t'name' => t('Write'),\n\t\t\t\t\t'value' => FALSE,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_ADMIN\"),\n\t\t\t\t\t'name' => t('Admin'),\n\t\t\t\t\t'value' => FALSE,\n\t\t\t),\n\t);\n\n\t$groupDefaults = array(\n\t\t\t(object) array(\n\t\t\t\t\t'id' => variable_get(\"ACL_GROUP_ALL_ID\"),\n\t\t\t\t\t'name' => \"All\",\n\t\t\t\t\t'level' => variable_get(\"ACL_READ\"),\n\t\t\t),\n\t);\n\t$render_array['test'] = array(\n\t\t\t'#theme' => 'c_acl',\n\t\t\t'#defaults' => $formDefaults,\n\t\t\t'#defaults_group' => $groupDefaults,\n\t\t\t'#acl_id' => 21, /*'#child_acl_ids' => array(\n\t\t\t\t\t\t\t 54,\n\t\t\t\t\t\t\t 55,\n\t\t\t\t\t\t\t 56,\n\t\t\t\t\t\t\t ),*/\n\t);\n\n\treturn $render_array;\n}", "public function setModifyMode() {\n $this->getElement('submit')->setLabel('Edit Test');\n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function edit()\n {\n $this->set('groupSelector', $this->app->make(GroupSelector::class));\n $this->set('form', $this->app->make('helper/form'));\n if ($this->config->has('auth.external_concrete')) {\n $this->set('data', (array)$this->config->get('auth.external_concrete', []));\n } else {\n // legacy support\n $this->set('data', (array)$this->config->get('auth.external_concrete5', []));\n }\n $this->set('redirectUri', $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete/callback']));\n\n $list = $this->app->make(GroupList::class);\n $this->set('groups', $list->getResults());\n }", "public function edit_howto() {\n\t\tif ($this->session->session_admin != \"\") {\n\t\t\t$this->load->view('open_html');\n\t\t\t$this->load->view('header');\n\t\t\t$this->load->view('edit_howto');\n\t\t\t$this->load->view('close_html');\n\t\t} else {\n\t\t\t$this->load->view('open_html');\n\t\t\t$this->load->view('header');\n\t\t\t$this->load->view('index');\n\t\t\t$this->load->view('close_html');\n\t\t}\n\t}", "function showPageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $ilTabs, $ilCtrl;\n\t\t\n\t\t$this->addPageEditorSettingsSubTabs();\n\t\t\n\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorSettings.php\");\n\t\t$grps = ilPageEditorSettings::getGroups();\n\t\t\n\t\t$this->cgrp = $_GET[\"grp\"];\n\t\tif ($this->cgrp == \"\")\n\t\t{\n\t\t\t$this->cgrp = key($grps);\n\t\t}\n\n\t\t$ilCtrl->setParameter($this, \"grp\", $this->cgrp);\n\t\t$ilTabs->setSubTabActive(\"adve_grp_\".$this->cgrp);\n\t\t\n\t\t$this->initPageEditorForm();\n\t\t$tpl->setContent($this->form->getHtml());\n\t}", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }" ]
[ "0.6422253", "0.61636156", "0.6157416", "0.611119", "0.61099756", "0.61066806", "0.609607", "0.6063194", "0.60629123", "0.60542154", "0.6043232", "0.59932494", "0.5989941", "0.59705395", "0.5970034", "0.5966621", "0.59541345", "0.5934438", "0.59246933", "0.58985114", "0.5880055", "0.5872501", "0.58676153", "0.5841578", "0.58386964", "0.5834013", "0.58187884", "0.58184445", "0.58133554", "0.58080554" ]
0.70208114
0
Update the dock permissions
public function update(SaveDockPermissionsForm $form, Dock $dock) { $this->authorize(get_class($dock) . '.edit-permissions'); $form->process($dock); flasher()->alert($dock->name . ' dock permissions updated successfully', Notifier::SUCCESS); return redirect()->route('admin.docks.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updatePermissions()\n {\n if(! array_key_exists( 'permissions', $this->options['paths'] )) {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/permissions.blade.php';\n $target = base_path($this->options['paths']['permissions']);\n $hook = '<!-- bread_permissions -->';\n $this->updateFileContent($target, $hook, $file);\n }", "public function testUpdatePermissionSet()\n {\n }", "protected function editLockPermissions() {}", "public function run()\n {\n Artisan::call('permissions:update', ['--yes' => true]);\n }", "function layout_builder_post_update_update_permissions() {\n foreach (Role::loadMultiple() as $role) {\n if ($role->hasPermission('configure any layout')) {\n $role->grantPermission('create and edit custom blocks')->save();\n }\n }\n}", "protected function fixPermission() {}", "protected function setApplicationPermissions()\n\t{\n\t\t$base = $this->app['path.base'].'/';\n\t\t$app = str_replace($base, null, $this->app['path']);\n\t\t$storage = str_replace($base, null, $this->app['path.storage']);\n\t\t$public = str_replace($base, null, $this->app['path.public']);\n\n\t\t$this->setPermissions($app.'/database/production.sqlite');\n\t\t$this->setPermissions($storage);\n\t\t$this->setPermissions($public);\n\t}", "public function updateJsPermissions()\n {\n if(! array_key_exists( 'js_permissions', $this->options['paths'] )) {\n return;\n }\n $target = base_path($this->options['paths']['js_permissions']);\n $hook = '/* bread_js_permissions */';\n\n $file = base_path($this->options['paths']['stubs']) . '/resources/assets/js/components/permissions.js';\n $this->updateFileContent($target, $hook, $file);\n }", "function correct_perms()\n\t{\n\t\t$mes = e107::getMessage();\n\t\t$fl = e107::getFile();\n\t\tob_start();\n\t\t$fl->chmod(e_BASE);\n\t\t$fl->chmod(e_BASE.\"cron.php\",0755);\n\t\t$errors = ob_get_clean();\n\t\t\n\t\tif($errors !='')\n\t\t{\n\t\t\t$mes->addError($errors);\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mes->addSuccess(DBLAN_72);\n\t\t}\n\t\t\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_73, $mes->render());\n\t\t\n\t}", "private function savePermissions(): void\n {\n $this->client->isPayor = $this->isPayor;\n $this->client->isAgencyBankAccountSetup = $this->isAgencyBankAccountSetup;\n $this->client->canViewDocumentation = $this->canViewDocumentation;\n }", "public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}", "function virustotalscan_admin_permissions(&$admin_permissions)\r\n{\r\n \tglobal $lang;\r\n // se incarca fisierul de limba\r\n \t$lang->load(\"virustotalscan\", false, true);\r\n // se seteaza textul permisiunii\r\n\t$admin_permissions['virustotalscan'] = $lang->virustotalscan_canmanage;\r\n}", "function forum_perms()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя изменить ID группы, попытайтесь снова\");\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->admin->page_title = \"Управление масками доступа\";\n\t\t$this->ipsclass->admin->page_detail = \"В этой секции вы можете изменить выбранную маску доступа.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=permsplash', 'Управление масками доступа' );\n\t\t$this->ipsclass->admin->nav[] = array( '', 'Добавление/изменение масок доступа' )\t\t;\n\n\t\t$this->ipsclass->admin->page_detail .= \"<br />Для разрешения выполнения действия поставьте галочку, для запрета выполнения действия просто не ставьте или уберите галочку.\n\t\t\t\t\t\t\t <br />Атрибут &laquo;<b>Глобальный</b>&raquo; означает, что все маски доступа имеют права на выполнение этого действия, поэтому изменить этот параметр здесь нельзя.\n\t\t\t\t\t\t\t <br />Категории имеют настройки доступа только на просмотр, потому что остальные действия просто не применимы для категорий.\";\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$group = $this->ipsclass->DB->fetch_row();\n\n\t\t$gid = $group['perm_id'];\n\t\t$gname = $group['perm_name'];\n\n\t\t//-----------------------------------------\n\t\t//| EDIT NAME\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'donameedit' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $gid ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t), \"nameForm\" );\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Изменение названия: \".$group['perm_name'] );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Название маски</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"perm_name\", $gname )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Изменить\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\n\t\t//-----------------------------------------\n\t\t//| MAIN FORM\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'dofedit' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $gid ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) \t);\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Форум\" , \"25%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Просмотр форума<br /><input id='show' type='checkbox' onclick='checkcol(\\\"show\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Чтение тем<br /><input id='read' type='checkbox' onclick='checkcol(\\\"read\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Ответ в темы<br /><input id='reply' type='checkbox' onclick='checkcol(\\\"reply\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Создание тем<br /><input id='start' type='checkbox' onclick='checkcol(\\\"start\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Загрузка файлов<br /><input id='upload' type='checkbox' onclick='checkcol(\\\"upload\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Скачивание файлов<br /><input id='download' type='checkbox' onclick='checkcol(\\\"download\\\", this.checked );' />\" , \"10%\" );\n\n\t\t$forum_data = $this->forumfunc->ad_forums_forum_data();\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Параметры доступа: \".$group['perm_name'] );\n\n\t\tforeach( $forum_data as $r )\n\t\t{\n\t\t\t$show = \"\";\n\t\t\t$read = \"\";\n\t\t\t$start = \"\";\n\t\t\t$reply = \"\";\n\t\t\t$upload = \"\";\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['show_perms'] == '*')\n\t\t\t{\n\t\t\t\t$show = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['show_perms'] ) )\n\t\t\t{\n\t\t\t\t$show = \"<center><input type='checkbox' name='show_\".$r['id'].\"' id='show_\".$r['id'].\"' onclick=\\\"obj_checked('show', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$show = \"<center><input type='checkbox' name='show_\".$r['id'].\"' id='show_\".$r['id'].\"' onclick=\\\"obj_checked('show', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['read_perms'] == '*')\n\t\t\t{\n\t\t\t\t$read = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['read_perms'] ) )\n\t\t\t{\n\t\t\t\t$read = \"<center><input type='checkbox' name='read_\".$r['id'].\"' id='read_\".$r['id'].\"' onclick=\\\"obj_checked('read', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$read = \"<center><input type='checkbox' name='read_\".$r['id'].\"' id='read_\".$r['id'].\"' onclick=\\\"obj_checked('read', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['start_perms'] == '*')\n\t\t\t{\n\t\t\t\t$start = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['start_perms'] ) )\n\t\t\t{\n\t\t\t\t$start = \"<center><input type='checkbox' name='start_\".$r['id'].\"' id='start_\".$r['id'].\"' onclick=\\\"obj_checked('start', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$start = \"<center><input type='checkbox' name='start_\".$r['id'].\"' id='start_\".$r['id'].\"' onclick=\\\"obj_checked('start', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['reply_perms'] == '*')\n\t\t\t{\n\t\t\t\t$reply = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['reply_perms'] ) )\n\t\t\t{\n\t\t\t\t$reply = \"<center><input type='checkbox' name='reply_\".$r['id'].\"' id='reply_\".$r['id'].\"' onclick=\\\"obj_checked('reply', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$reply = \"<center><input type='checkbox' name='reply_\".$r['id'].\"' id='reply_\".$r['id'].\"' onclick=\\\"obj_checked('reply', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['upload_perms'] == '*')\n\t\t\t{\n\t\t\t\t$upload = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['upload_perms'] ) )\n\t\t\t{\n\t\t\t\t$upload = \"<center><input type='checkbox' name='upload_\".$r['id'].\"' id='upload_\".$r['id'].\"' onclick=\\\"obj_checked('upload', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$upload = \"<center><input type='checkbox' name='upload_\".$r['id'].\"' id='upload_\".$r['id'].\"' onclick=\\\"obj_checked('upload', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['download_perms'] == '*')\n\t\t\t{\n\t\t\t\t$download = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['download_perms'] ) )\n\t\t\t{\n\t\t\t\t$download = \"<center><input type='checkbox' name='download_\".$r['id'].\"' id='download_\".$r['id'].\"' onclick=\\\"obj_checked('download', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$download = \"<center><input type='checkbox' name='download_\".$r['id'].\"' id='download_\".$r['id'].\"' onclick=\\\"obj_checked('download', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( $r['root_forum'] )\n\t\t\t{\n\t\t\t\t$css = 'tablerow4';\n\t\t\t\t$download = $upload = $reply = $start = $read = \"<center>Не&nbsp;используется</center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$css = '';\n\t\t\t}\n\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='float:right;width:auto;'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t<input type='button' id='button' value='+' onclick='checkrow({$r['id']},true)' />&nbsp;<input type='button' id='button' value='-' onclick='checkrow({$r['id']},false)' />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <b>\".$r['depthed_name'].\"</b>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#ecd5d8; padding:4px;'>\".$show.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dbe2de; padding:4px;'>\".$read.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dbe6ea; padding:4px;'>\".$reply.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#d2d5f2; padding:4px;'>\".$start.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#ece6d8; padding:4px;'>\".$upload.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dfdee9; padding:4px;'>\".$download.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t) ,$css );\n\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Обновить настройки доступа\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->html .= $this->html->permissions_js();\n\n\t\t$this->ipsclass->admin->output();\n\t}", "private function loadPermissions() {\n\tif ($this->permissionsloaded) {return;}\n\t//$mem = DStructMemCache::getInstance();\n\t//if (!$this->permissions = $mem->get(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()))) {\n\t\t$this->permissions = $this->activecontainer->permissions();\n\t//\t$mem->set(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()), $this->permissions);\n\t//}\n\t$this->permissionsloaded = true;\n}", "public function doesCheckModifyAccessListHookModifyAccessAllowed() {}", "public function setPermissions($permissions) {}", "public function actionPermissions()\n {\n FileHelper::createDirectory(Yii::getAlias('@webroot/css'));\n FileHelper::createDirectory(Yii::getAlias('@webroot/js'));\n\n foreach (['@webroot/assets', '@webroot/uploads', '@runtime'] as $path) {\n try {\n chmod(Yii::getAlias($path), 0777);\n } catch (\\Exception $e) {\n $this->stderr(\"Failed to change permissions for directory \\\"{$path}\\\": \" . $e->getMessage());\n $this->stdout(PHP_EOL);\n }\n }\n }", "function update_role_permision() {\n\t\t$user_role = $this->get_role_permission($_POST['role_id']);\n\t\tforeach ($user_role->result() as $role) {\n\t\t\t\n\t\t\t$this->db->where('entry_id', $role->entry_id);\n\t\t\t$list = $_POST['role_permission'];\n\t\t\t$allow = isset($list[$role->entry_id]) ? 1 : 0;\n\t\t\t$this->db->update('system_security.security_role_permission', array('allow_deny' => $allow));\n\t\t}\n\t}", "private function config_OSF_PermissionsManagementTool()\n {\n // Get package info\n $configPath = \"{$this->permissions_management_tool_folder}\";\n\n // Configure\n $this->span(\"Configuring...\", 'info');\n // OSF Web Service paths\n $this->setIni(\"config\", \"osfWebServicesFolder\", \"\\\"{$this->osf_web_services_folder}\\\"\",\n \"{$configPath}/pmt.ini\");\n $this->setIni(\"config\", \"osfWebServicesEndpointsUrl\", \"\\\"http://{$this->osf_web_services_domain}/ws/\\\"\",\n \"{$configPath}/pmt.ini\");\n // OSF Web Service credentials\n $this->setIni(\"credentials\", \"application-id\", \"\\\"{$this->application_id}\\\"\",\n \"{$configPath}/pmt.ini\");\n $this->setIni(\"credentials\", \"api-key\", \"\\\"{$this->api_key}\\\"\",\n \"{$configPath}/pmt.ini\");\n $this->setIni(\"credentials\", \"user\", \"\\\"http://{$this->osf_web_services_domain}/wsf/users/admin\\\"\",\n \"{$configPath}/pmt.ini\");\n }", "function updateProjectPermissionNames() {\n $project_roles_table = TABLE_PREFIX . 'project_roles';\n $project_users_table = TABLE_PREFIX . 'project_users';\n\n try {\n DB::beginWork('Updating project role keys @ ' . __CLASS__);\n\n $rename = array(\n 'ticket' => 'task',\n 'checklist' => 'todo_list',\n 'page' => 'notebook',\n 'timerecord' => 'tracking',\n );\n\n $rows = DB::execute(\"SELECT id, permissions FROM $project_roles_table\");\n if(is_foreachable($rows)) {\n foreach($rows as $row) {\n $permissions = $row['permissions'] ? unserialize($row['permissions']) : array();\n\n foreach($rename as $k => $v) {\n if(isset($permissions[$k])) {\n $permissions[$v] = $permissions[$k];\n unset($permissions[$k]);\n } // if\n } // foreach\n\n DB::execute(\"UPDATE $project_roles_table SET permissions = ? WHERE id = ?\", serialize($permissions), $row['id']);\n } // foreach\n } // if\n\n $rows = DB::execute(\"SELECT user_id, project_id, permissions FROM $project_users_table\");\n if(is_foreachable($rows)) {\n foreach($rows as $row) {\n $permissions = $row['permissions'] ? unserialize($row['permissions']) : null;\n\n if(is_array($permissions)) {\n foreach($rename as $k => $v) {\n if(isset($permissions[$k])) {\n $permissions[$v] = $permissions[$k];\n unset($permissions[$k]);\n } // if\n } // foreach\n } // if\n\n DB::execute(\"UPDATE $project_users_table SET permissions = ? WHERE user_id = ? AND project_id = ?\", serialize($permissions), $row['user_id'], $row['project_id']);\n } // foreach\n } // if\n\n DB::commit('Project role keys updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update project role keys @ ' . __CLASS__);\n\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function setAdminPermissions(array $permissions): void;", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "protected function setApplicationPermissions()\n {\n $files = (array) $this->rocketeer->getOption('remote.permissions.files');\n foreach ($files as &$file) {\n $this->setPermissions($file);\n }\n\n return true;\n }", "public function edit(Dock $dock)\n {\n $this->authorize(get_class($dock) . '.edit-permissions');\n\n return view('admin::docks.' . $dock->name . '.permissions.edit')->withDock($dock);\n }", "public function run()\n {\n Permission::insert(config('permissions', true));\n }", "function permissions_upgrade($oldversion)\n{\n // Update successful\n return true;\n}" ]
[ "0.685086", "0.6643186", "0.65937537", "0.62557334", "0.61091924", "0.6047599", "0.6001417", "0.595264", "0.59489715", "0.5849822", "0.58387226", "0.5790018", "0.5735801", "0.57334685", "0.5728764", "0.57051873", "0.56894743", "0.56836206", "0.5644883", "0.5618109", "0.55946773", "0.55544674", "0.55544674", "0.55544674", "0.55544674", "0.55544674", "0.554671", "0.5506518", "0.54361963", "0.54150355" ]
0.67591196
1
Applies the result of a given script to the given step. Used to handle the result of the initialization script, as well as by extension question types such as Multianswer.
public function apply_code_result(question_attempt_step $step, array $vars, array $funcs) { //store the list of variables after the execution, for storage in the database $step->set_qt_var('_vars', json_encode($vars)); $step->set_qt_var('_funcs', json_encode($funcs)); //store a local copy of the script state $this->vars = $vars; $this->funcs = $funcs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function executeSpecificStep() {}", "public function execute(StepExecution $stepExecution);", "public function evaluate(Script $script): void\n {\n $builder = Functions::callAwait(\"$this->pageVarName.evaluate\",$script->getJs());\n\n $this->merge($builder);\n }", "protected function ProcessStepSuccessHook()\n {\n }", "protected function outputSpecificStep() {}", "protected function injectScript($step)\n {\n if (in_array(Input::get('import'), array('prepare', 'import'), null)) {\n return;\n }\n\n if (!array_key_exists($step, $this->settings)) {\n $GLOBALS['TL_MOOTOOLS'][] =\n \"<script>location.href = 'contao/main.php\" .\n \"?do=member_import&import=prepare&rt=\" . REQUEST_TOKEN . \"&ref=\" . TL_REFERER_ID .\n \"'</script>\";\n\n return;\n }\n\n $GLOBALS['TL_MOOTOOLS'][] =\n \"<script>location.href = 'contao/main.php\" .\n \"?do=member_import&import=load&step=\" . $step . \"&rt=\" . REQUEST_TOKEN . \"&ref=\" . TL_REFERER_ID .\n \"'</script>\";\n }", "public function execute()\n {\n $resultJson = $this->jsonFactory->create();\n $answer = null;\n $success = true;\n $question = $this->getQuestion();\n if ($question) {\n try {\n $answer = $this->helperData->getAnswer($question);\n } catch (\\Exception $e) {\n $answer = $e->getMessage();\n $success = false;\n }\n if (!empty($answer)) {\n $answer = trim($answer);\n }\n } else {\n $success = false;\n $answer = __('Please add some context so the AI can come up with the right content.');\n }\n\n return $resultJson->setData([\n 'answer' => $answer,\n 'success' => $success\n ]);\n }", "function learn_press_single_quiz_result() {\n\t\tlearn_press_get_template( 'content-quiz/result.php' );\n\t}", "function updateAutomatedResultForATestCase($testCaseID, $subjectID, $roundID, $clientID) {\n global $definitions;\n\n //DEFINITIONS FOR ITEM TYPES\n $resultsRelationsID = getClientItemTypeID_RelatedWith_byName($definitions['automatizationResultsRelations'], $clientID);\n\n //DEFINITIONS FOR PROPERTIES\n $parentTestCategoryPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n $parentStudyForSubjectPropertyID = getClientPropertyID_RelatedWith_byName($definitions['subjectStudyID'], $clientID);\n $autResRelRoundPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsRoundID'], $clientID);\n $autResRelSubjectPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsSubjectID'], $clientID);\n $autResRelParentCatPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCategoryParentID'], $clientID);\n $autResRelCatPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCategoryID'], $clientID);\n $autResRelTestCasesCountPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCasesCount'], $clientID);\n $autResRelTestCasesOKPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCasesOKCount'], $clientID);\n $autResRelTestCasesNOKPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCasesNOKCount'], $clientID);\n $categoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //Next, get the parentID value\n $parentFolderID = getItemPropertyValue($testCaseID, $parentTestCategoryPropertyID, $clientID);\n\n //Get the studyID value for this subject\n $studyID = getItemPropertyValue($subjectID, $parentStudyForSubjectPropertyID, $clientID);\n\n //We need also, the related items\n $relations = getRelations($roundID, $subjectID, $clientID);\n\n //When we've the relations, we need count the steps for every test\n if (count($relations) - 1 == 0) {\n $theTestCases = explode(\",\", $relations[0]['testCasesIDs']);\n\n $totalTc = 0;\n $totalOK = 0;\n $totalNOK = 0;\n\n //Get directly testcases that are related\n $relatedTestCases = getFilteredTestCasesInsideCategory($parentFolderID, $theTestCases, $clientID);\n\n foreach ($relatedTestCases as $tc) {\n $detailedTc = getTestCaseData($tc['ID'], $subjectID, $roundID, $studyID, $clientID);\n\n //print(\"DetailedTC for tc \".$tc['ID'].\" in testCategory $testCategory \\n\\r\");\n //print_r($detailedTc);\n\n if ($detailedTc != null) {\n //print (\"process automated testcase \".$tc['ID'].\":\\n\\r\" );\n //print(\"TestCase Data for testCase \".$tc['ID'].\":\\n\\r\");\n //print_r($detailedTc);\n\n $totalTc++;\n $counter = 0;\n $counterOK = 0;\n $counterNOK = 0;\n\n //Search their steps results for Selenium results\n while (isset($detailedTc['STEP_ID_' . $counter])) {\n\n if (isset($detailedTc['STEP_STEPUNITS_SELENIUMRESULTEXECVALUE_' . $counter])) {\n if (base64_decode($detailedTc['STEP_STEPUNITS_SELENIUMRESULTEXECVALUE_' . $counter]) == 'OK') {\n $counterOK++;\n\n } elseif (base64_decode($detailedTc['STEP_STEPUNITS_SELENIUMRESULTEXECVALUE_' . $counter]) == 'NOK') {\n $counterNOK++;\n\n }\n }\n $counter++;\n }//End while\n\n //Check if the final state for the tc is ok, nok or not executed\n if ($counterNOK > 0) {\n //Any step nok. Final result NOK\n $totalNOK++;\n } else {\n if ($counterOK > 0) {\n //NOK = 0, any tc OK. Final result OK\n $totalOK++;\n } else {\n //all values 0.Do nothing\n }\n }\n } //End if detailed TC\n\n }//End foreach related test cases\n\n //Finally, check if relation results exists for this relation, round and testCategory\n if ($totalTc > 0) {\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $autResRelRoundPropertyID, 'value' => $roundID);\n $filters[] = array('ID' => $autResRelSubjectPropertyID, 'value' => $subjectID);\n $filters[] = array('ID' => $autResRelCatPropertyID, 'value' => $parentFolderID);\n\n // get relations\n $resultRelation = getFilteredItemsIDs($resultsRelationsID, $clientID, $filters, $returnProperties);\n\n if (count($resultRelation) - 1 == 0) {\n //exists\n //Update the values\n //print (\"updating total tc for itemRelation: TestCategory: $testCategory, RoundID: $roundID, SubjectID: $subject, totalTC value:$totalTc \\n\\r\");\n //flush();\n setPropertyValueByID($autResRelTestCasesCountPropertyID, $resultsRelationsID, $resultRelation[0]['ID'], $clientID, $totalTc);\n\n //print (\"updating tc OK for itemRelation: TestCategory: $testCategory, RoundID: $roundID, SubjectID: $subject, testCases OK value:$totalOK \\n\\r\");\n //flush();\n setPropertyValueByID($autResRelTestCasesOKPropertyID, $resultsRelationsID, $resultRelation[0]['ID'], $clientID, $totalOK);\n\n //print (\"updating tc NOK for itemRelation: TestCategory: $testCategory, RoundID: $roundID, SubjectID: $subject, testCases NOK value:$totalNOK \\n\\r\");\n //flush();\n setPropertyValueByID($autResRelTestCasesNOKPropertyID, $resultsRelationsID, $resultRelation[0]['ID'], $clientID, $totalNOK);\n\n } else {\n if (count($resultRelation) - 1 > 0) {\n //error. More than 1 relation\n print(\"Error. Found more than one automated results relation:\\n\");\n print_r($resultRelation);\n flush();\n exit ;\n } else {\n //does not exists\n //Create a new relation\n //First, get the parent TCategory\n\n $parentCategoryID = getItemPropertyValue($parentFolderID, $categoryParentPropertyID, $clientID);\n //print(\"Parent category id for testCategory $testCategory = $parentCategoryID \\n\\r\");\n //flush();\n $propertiesValues = array( array('ID' => $autResRelRoundPropertyID, 'value' => $roundID), array('ID' => $autResRelSubjectPropertyID, 'value' => $subjectID), array('ID' => $autResRelCatPropertyID, 'value' => $parentFolderID), array('ID' => $autResRelParentCatPropertyID, 'value' => $parentCategoryID), array('ID' => $autResRelTestCasesCountPropertyID, 'value' => $totalTc), array('ID' => $autResRelTestCasesOKPropertyID, 'value' => $totalOK), array('ID' => $autResRelTestCasesNOKPropertyID, 'value' => $totalNOK));\n\n }//end if count resultRelation>0\n\n }//end if count resultRelation==0\n }//End if totalTC>0\n\n }//End if count relations\n\n}", "private function log_task_shell_result($step, $result)\n\t{\n\t\tif(is_array($result))\n\t\t{\n\t\t\t$this->task->steps[$step]['shell_result'] = implode('|', $result);\n\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\t$this->task->steps[$step]['shell_result'] = trim($result);\n\t\t\t}\n\t}", "abstract protected function setresults();", "public function onFinished(Step $step): void\n {\n }", "function getStepsScriptsForTestCase($theTC_ID, $theSubjectID, $roundID, $studyID, $clientID) {\n global $definitions;\n\n $stepsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n $stepParentTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $stepDescriptionPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsDescription'], $clientID);\n $stepOrderPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsOrder'], $clientID);\n $stepCheckedStepUnitsPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsCheckedStepUnits'], $clientID);\n $stepRoundSubjectTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n $stepMainPropertyID = getMainPropertyID($stepsItemTypeID, $clientID);\n $stepStepTypePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsType'], $clientID);\n $stepStepScriptPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsScript'], $clientID);\n\n $typesListID = getAppListID('stepsTypes');\n\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n $finalResult = array();\n //Next, check that has one $relation\n if ((count($relations) - 1) == 0) {\n\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $stepMainPropertyID, 'name' => 'stepsMainValue');\n $returnProperties[] = array('ID' => $stepDescriptionPropertyID, 'name' => 'description');\n $returnProperties[] = array('ID' => $stepOrderPropertyID, 'name' => 'order');\n $returnProperties[] = array('ID' => $stepStepTypePropertyID, 'name' => 'stepType');\n $returnProperties[] = array('ID' => $stepStepScriptPropertyID, 'name' => 'stepScript');\n $returnProperties[] = array('ID' => $stepCheckedStepUnitsPropertyID, 'name' => 'checkedValues');\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $stepParentTestCasePropertyID, 'value' => $theTC_ID);\n $filters[] = array('ID' => $stepRoundSubjectTestCasePropertyID, 'value' => $relations[0]['ID']);\n\n // get steps\n $orderedSteps = getFilteredItemsIDs($stepsItemTypeID, $clientID, $filters, $returnProperties, 'order');\n\n //Get the id of the list client related\n $clientListID = getClientListID_RelatedWith($typesListID, $clientID);\n\n //Get all the values for this list and client\n $ClientValues = getListValues($clientListID, $clientID);\n\n //Add the \"isStep\" parameter\n for ($i = 0; $i < count($orderedSteps); $i++) {\n\n //First, encode the name and the description\n $orderedSteps[$i]['stepsMainValue'] = base64_encode($orderedSteps[$i]['stepsMainValue']);\n $orderedSteps[$i]['description'] = base64_encode($orderedSteps[$i]['description']);\n\n //for every system list value, get the client list value\n\n for ($j = 0; $j < count($ClientValues); $j++) {\n if (strcmp($ClientValues[$j]['value'], $orderedSteps[$i]['stepType']) == 0) {\n //get the client id value\n $AppValueID = getAppListValueID_RelatedWith($ClientValues[$j]['valueID'], $clientID);\n\n if ($AppValueID > 0) {\n //Get the app value and add to client values\n $orderedSteps[$i]['scriptAppValue'] = getAppValue($AppValueID);\n } else {\n //Not related. Add an empty value\n $orderedSteps[$i]['scriptAppValue'] = 'undefined';\n }\n break;\n }\n }\n\n //Also, get their units and results\n // get params\n // get checked values\n $markedStepsUnitsIDs = explode(',', $orderedSteps[$i]['checkedValues']);\n\n $params = getParamsAndResultsForAStep($orderedSteps[$i], $studyID, $theSubjectID, $markedStepsUnitsIDs, $clientID);\n\n //Add every parameter to the results\n foreach ($params as $p) {\n\n //Check if the systemConversion value is a Selenium type\n\n if (base64_decode($p['systemConversionValue']) == 'stepUnit.type.seleniumResult') {\n $orderedSteps[$i]['stepUnit_SELENIUMRESULT_ID'] = $p['ID'];\n //Add the result id\n $orderedSteps[$i]['stepUnit_SELENIUM_LASTRESULT_ID'] = $p['resultID'];\n //Add the execution value\n $orderedSteps[$i]['stepUnit_SELENIUMRESULT_EXECVALUE'] = $p['executionValue'];\n }\n if (base64_decode($p['systemConversionValue']) == 'stepUnit.type.seleniumResultDescription') {\n $orderedSteps[$i]['stepUnit_SELENIUMRESULT_DESCRIPTION_ID'] = $p['ID'];\n //Add the result id\n $orderedSteps[$i]['stepUnit_SELENIUMDESCRIPTION_LASTRESULT_ID'] = $p['resultID'];\n\n }\n }\n $finalResult[] = $orderedSteps[$i];\n }\n\n }\n\n return $finalResult;\n}", "public function onAjaxSampledataApplyStep3()\n\t{\n\t\tif (!Session::checkToken('get') || $this->app->input->get('type') != $this->_name)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!ComponentHelper::isEnabled('com_languages'))\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = true;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_STEP_SKIPPED', 3, 'com_languages');\n\n\t\t\treturn $response;\n\t\t}\n\n\t\tif (!$this->publishContentLanguages())\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = false;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_CONTENTLANGUAGES', 3);\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t$response = new stdClass;\n\t\t$response->success = true;\n\t\t$response->message = Text::_('PLG_SAMPLEDATA_MULTILANG_STEP3_SUCCESS');\n\n\t\treturn $response;\n\t}", "private function evaluateThisResult($result, $data){\n\t\t\t//Test to make sure this result has everything we need.\n\n\t\t\tif(array_key_exists('action', $result)){\n\t\t\t\treturn (bool) $this->processResult($result, $data);\n\t\t\t} else {\n\t\t\t\treturn (bool) false;\n\t\t\t}\n\t\t}", "public function ExecuteStep()\n {\n if ($this->ProcessStep()) {\n $this->ProcessStepSuccessHook();\n $oBasket = TShopBasket::GetInstance();\n $oBasket->aCompletedOrderStepList[$this->fieldSystemname] = true;\n $oNextStep = $this->GetNextStep();\n $this->JumpToStep($oNextStep);\n }\n }", "public function postProcess($results);", "protected\n function do_execution( $execution )\n {\n $this->current_enzyme = $execution;\n preg_match($this->grammar_rule('execution'), $execution, $matches);\n $post_item = $this->value($matches, 'post_item');\n $author_item = $this->value($matches, 'author_item');\n $num_args = (int) $this->value($matches, 'num_args');\n switch (true) {\n case (strpos($execution, 'array(') === 0 && $num_args > 0):\n $result = $this->catalyzed->pop($num_args);\n break;\n case (strpos($execution, 'hash(') === 0 && $num_args > 0):\n $result = array();\n $arguments = $this->catalyzed->pop(2 * $num_args);\n for ($i = 0, $i_top = 2 * $num_args; $i < $i_top; $i += 2) {\n $key = $arguments[$i];\n $value = $arguments[$i + 1];\n $result[$key] = $value;\n }\n break;\n case ($post_item != ''):\n $result = $this->execute_post_item($post_item, $num_args);\n break;\n case ($author_item != ''):\n $result = $this->execute_author_item($author_item, $num_args);\n break;\n default:\n $result = null;\n break;\n }\n return $result;\n }", "public function addStep(ScriptStep $step): Script\n {\n $this->steps[] = $step;\n return $this;\n }", "protected function afterAction(\n string $method,\n array $arguments,\n bool $ran,\n mixed $result\n ) : mixed {\n return $result;\n }", "abstract protected function define_my_steps();", "private function setResult() {\n $result = 0;\n foreach ($this->process AS $key => $value) {\n $total = $value['pivot'] * $value['adj']['result'];\n if($key == 0) {\n $result = $result + $total;\n }\n elseif($key == 1) {\n $result = $result - $total;\n }\n else {\n if($key % 2 == 0) {\n $result = $result + $total;\n }\n else {\n $result = $result - $total;\n }\n }\n }\n unset($key, $value, $total);\n return $result;\n }", "public function redirect_script() {\n\t\t$languages = $this->available_languages;\n\t\t$current_step = intval( $this->step );\n\t\t$next_step = $current_step + 1;\n\t\t// Add 500ms delay for refreshes.\n\t\t$delay = 500;\n\t\tif ( ( $current_step + 1 ) <= count( $this->steps ) && $this->proceed ) {\n\t\t\t// Redirect to next step.\n\t\t\t$lang = ( isset( $_GET['lang'] ) ) ? sanitize_text_field( wp_unslash( $_GET['lang'] ) ) : '';\n\t\t\treturn '<script type=\"text/javascript\">setTimeout(function () {window.location.href = \"' . admin_url( 'index.php?avada_update=1&ver=400&lang=' . $lang . '&step=' . $next_step ) . '\";}, ' . $delay . ');</script>';\n\t\t} else {\n\t\t\t// Check if this is a multilingual site.\n\t\t\tif ( ! empty( $languages ) ) {\n\t\t\t\t// Get the next language code.\n\t\t\t\t$next_lang = $this->get_next_language();\n\t\t\t\tif ( 'finished' === $next_lang ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn '<script type=\"text/javascript\">setTimeout(function () {window.location.href = \"' . admin_url( 'index.php?avada_update=1&ver=400&new=1&lang=' . $next_lang ) . '\";}, ' . $delay . ');</script>';\n\t\t\t}\n\t\t}\n\t}", "public function run(Experiment $experiment)\n {\n return new Result(\n $experiment->getName(),\n $control = $this->runControl($experiment),\n $this->runTrials($experiment, $control)\n );\n }", "public function run()\n {\n //Data Type\n $dataType = $this->dataType('name', 'survey_answer');\n if (!$dataType->exists) {\n $dataType->fill([\n 'name' => 'survey_answer',\n 'slug' => 'survey-answer',\n 'display_name_singular' => 'Survey Answer',\n 'display_name_plural' => 'Survey Answers',\n 'icon' => 'voyager-check',\n 'model_name' => 'Andalusia\\\\Survey\\\\Models\\\\SurveyAnswer',\n 'controller' => '',\n 'generate_permissions' => 1,\n 'description' => '',\n ])->save();\n }\n //Data Rows\n $questionDataType = DataType::where('slug', 'survey-answer')->firstOrFail();\n $dataRowOrder = 0;\n\n $dataRow = $this->dataRow($questionDataType, 'id');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'number',\n 'display_name' => __('voyager::seeders.data_rows.id'),\n 'required' => 1,\n 'browse' => 0,\n 'read' => 0,\n 'edit' => 0,\n 'add' => 0,\n 'delete' => 0,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'question_id');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'text',\n 'display_name' => ucwords(str_replace(\"_\", \" \", \"question_id\")),\n 'required' => 1,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'order' => $dataRowOrder++,\n 'details' => [\n 'validation' => [\n 'rule' => 'required'\n ]\n ],\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'survey_answer_belongsto_survey_question_relationship');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'relationship',\n 'display_name' => 'Question',\n 'required' => 1,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'details' => [\n 'model' => 'Andalusia\\\\Survey\\\\Models\\\\SurveyQuestion',\n 'table' => 'survey_question',\n 'type' => 'belongsTo',\n 'column' => 'question_id',\n 'key' => 'id',\n 'label' => 'question',\n 'pivot_table' => 'admins',\n 'pivot' => '0',\n 'taggable' => '0'\n ],\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'order');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'number',\n 'display_name' => ucwords(str_replace(\"_\", \" \", \"order\")),\n 'required' => 0,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'answer');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'text',\n 'display_name' => ucwords(str_replace(\"_\", \" \", \"answer\")),\n 'required' => 1,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'points');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'number',\n 'display_name' => ucwords(str_replace(\"_\", \" \", \"points\")),\n 'required' => 0,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'created_at');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'timestamp',\n 'display_name' => __('voyager::seeders.data_rows.created_at'),\n 'required' => 0,\n 'browse' => 0,\n 'read' => 1,\n 'edit' => 0,\n 'add' => 0,\n 'delete' => 0,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'updated_at');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'timestamp',\n 'display_name' => __('voyager::seeders.data_rows.updated_at'),\n 'required' => 0,\n 'browse' => 0,\n 'read' => 0,\n 'edit' => 0,\n 'add' => 0,\n 'delete' => 0,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n //Menu Item\n $menu = Menu::where('name', 'admin')->firstOrFail();\n $parent = MenuItem::where('title', 'Survey Module')->firstOrFail();\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => 'Answers',\n 'url' => '',\n 'route' => 'voyager.survey-answer.index',\n ]);\n if (!$menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'voyager-check',\n 'color' => null,\n 'parent_id' => $parent->id,\n 'order' => 3,\n ])->save();\n }\n\n //Permissions\n Permission::generateFor('survey_answer');\n\n //Content\n SurveyAnswer::create([\n 'question_id' => 1,\n 'order' => 1,\n 'answer' => 'blue',\n 'points' => 20\n ]);\n }", "protected function processPart($step) {\n $curWorkPackageDef = $this->workPackages[$step-1];\n $request = $this->getRequest();\n $response = $this->getResponse();\n if (strlen($curWorkPackageDef['callback']) == 0) {\n throw new ApplicationException($request, $response, ApplicationError::getGeneral(\"Empty callback name.\"));\n }\n if (!method_exists($this, $curWorkPackageDef['callback'])) {\n throw new ApplicationException($request, $response,\n ApplicationError::getGeneral(\"Method '\".$curWorkPackageDef['callback'].\"' must be implemented by \".get_class($this)));\n }\n\n // unserialize oids\n $oids = array_map(function($oidStr) {\n $oid = ObjectId::parse($oidStr);\n return $oid != null ? $oid : $oidStr;\n }, $curWorkPackageDef['oids']);\n call_user_func([$this, $curWorkPackageDef['callback']], $oids, $curWorkPackageDef['args']);\n }", "function zg_ai_do_goal($bot, $goal, $last_result) {\n\n global $last_value;\n\n if (!is_array($goal)) {\n $goal = [$goal];\n }\n\n $result = [\n 'original goal' => $goal,\n ];\n\n if (!is_array($last_result)) {\n $last_result = [$last_result];\n }\n\n zg_ai_out($last_result, 'last result');\n if (array_key_exists('return value', $last_result)) {\n $last_value = zg_ai_get_data($last_result);\n }\n else {\n $last_value = [];\n }\n zg_ai_out($last_value, 'last value');\n\n $goal_function = 'zg_ai_' . str_replace(' ', '_', reset($goal));\n $args = array_slice($goal, 1);\n array_unshift($args, $bot);\n// zg_ai_out($args, 'args');\n\n if (!function_exists($goal_function)) {\n zg_ai_out($goal, \"*FIXME: MISSING* $goal_function\");\n $result['error'] = \"Missing function $goal_function()\";\n $result['success'] = FALSE;\n return $result;\n }\n\n zg_ai_out('calling ' . $goal_function . '($bot, ' . implode(', ', array_slice($args, 1)) . ')');\n $return = call_user_func_array($goal_function, $args);\n// zg_ai_out('returned: ' . zg_print_r($return));\n\n $result['return value'] = $return;\n $result['success'] = TRUE;\n// zg_ai_out('result: ' . zg_print_r($result));\n return $result;\n}", "public function execute_hook() {\n\n\t\t$hook = current_filter();\n\t\t$content = simplehooks_get_option( $hook, 'content' );\n\n\t\tif ( ! $hook || ! $content ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$shortcodes = simplehooks_get_option( $hook, 'shortcodes' );\n\t\t$php = simplehooks_get_option( $hook, 'php' );\n\n\t\t$value = $shortcodes ? do_shortcode( $content ) : $content;\n\n\t\tif ( $php ) {\n\t\t\t//phpcs:ignore\n\t\t\teval( \"?>$value \" );\n\t\t} else {\n\t\t\t//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\techo ( $value );\n\t\t}\n\n\t}", "public function runStep($step)\n\t{\n\t\tif (REQ == 'CLI')\n\t\t{\n\t\t\tstdout($this->getLanguageForStep($step).'...', CLI_STDOUT_BOLD);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$this->runStepParent($step);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$this->logger->log($e->getMessage());\n\t\t\t$this->logger->log($e->getTraceAsString());\n\n\t\t\t// Send it up the chain\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// We may have shifted files around\n\t\tif (function_exists('opcache_reset'))\n\t\t{\n\t\t\t// Check for restrict_api path restriction\n\t\t\tif (($opcache_api_path = ini_get('opcache.restrict_api')) && stripos(SYSPATH, $opcache_api_path) !== 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\topcache_reset();\n\t\t}\n\t}", "final public function record_attempt($context) {\n global $DB, $USER, $OUTPUT;\n /**\n * This should be overridden by each page type to actually check the response\n * against what ever custom criteria they have defined\n */\n $result = $this->check_answer();\n $result->attemptsremaining = 0;\n $result->maxattemptsreached = false;\n $lesson = $this->lesson;\n $modid = $DB->get_field('modules', 'id', array('name'=>'languagelesson'));\n $cmid = $DB->get_field('course_modules', 'id', array('module'=>$modid, 'instance'=>$this->lesson->id));\n\n if ($result->noanswer) {\n $result->newpageid = $this->properties->id; // Display same page again.\n $result->feedback = get_string('noanswer', 'languagelesson');\n } else {\n switch ($result->typeid) {\n \n case LL_ESSAY :\n $isessayquestion = true;\n \n $attempt = new stdClass;\n $attempt->lessonid = $this->lesson->id;\n $attempt->pageid = $this->properties->id;\n $attempt->userid = $USER->id;\n $attempt->type = $result->typeid;\n $attempt->answerid = $result->answerid;\n \n $useranswer = $result->userresponse;\n $useranswer = clean_param($useranswer, PARAM_RAW);\n $attempt->useranswer = $useranswer; \n // If the student had previously submitted an attempt on this question, and it has since been graded,\n\t\t // Mark this new submission as a resubmit.\n if ($prevAttempt = languagelesson_get_most_recent_attempt_on($attempt->pageid, $USER->id)) {\n $attempt->retry = $prevAttempt->retry;\n if (! $oldManAttempt = $DB->get_record('languagelesson_attempts', array('id'=>$prevAttempt->id))) {\n error('Failed to fetch matching manual_attempt record for old attempt on this question!');\n }\n if ($oldManAttempt->graded && !$lesson->autograde) {\n $attempt->resubmit = 1;\n $attempt->viewed = 0;\n $attempt->graded = 0;\n }\n } else {\n $attempt->retry = 0;\n }\n /*if (!$answer = $DB->get_record(\"languagelesson_answers\", array(\"pageid\"=>$page->id))) {\n print_error(\"Continue: No answer found\");\n }*/\n $correctanswer = false;\n\t\t //$newpageid = $this->nextpageid;\n\n // AUTOMATIC GRADING.\n // If this lesson is to be auto-graded...\n if ($lesson->autograde === 1) {\n $correctanswer = true;\n // Flag it as graded\n $attempt->graded = 1;\n $attempt->viewed = 1;\n // Set the grade to the maximum point value for this question.\n $maxscore = $DB->get_field('languagelesson_pages', 'maxscore', array('id'=>$attempt->pageid));\n $score = $maxscore;\n } else {\n \t\t // If it's not, mark these submissions as ungraded.\n $score = 0;\n }\n \n $attempt->iscurrent = 1;\n $attempt->score = $score;\n $attempt->timeseen = time();\n \n // Check for maxattempts, 0 means unlimited attempts are allowed.\n $nattempts = $attempt->retry;\n if ($this->lesson->maxattempts != 0) { // Don't bother with message if unlimited.\n if ($nattempts >= $this->lesson->maxattempts || $this->lesson->maxattempts == 1){\n $result->maxattemptsreached = true;\n $result->newpageid = LL_NEXTPAGE;\n $result->attemptsremaining = 0;\n } else {\n $result->attemptsremaining = $this->lesson->maxattempts - $nattempts;\n }\n }\n \n // Insert/update some records.\n if (!has_capability('mod/languagelesson:manage', $context)) {\n // Pull the retry value for this attempt, and handle deflagging former current attempt \n\t\t\t\n if ($oldAttempt = languagelesson_get_most_recent_attempt_on($attempt->pageid, $USER->id)) {\n $nretakes = $oldAttempt->retry + 1;\n\n // Update the old attempt to no longer be marked as the current one.\n $attempt->id = $oldAttempt->id;\n \n // Set the retake value.\n $attempt->retry = $nretakes;\n \n // Flag this as the current attempt.\n $attempt->correct = $correctanswer;\n \n if (! $DB->update_record('languagelesson_attempts', $attempt)) {\n error('Failed to update previous attempt!');\n }\n \n } else {\n $nretakes = 1;\n \n // Set the retake value.\n $attempt->retry = $nretakes;\n \n // Flag this as the current attempt.\n $attempt->correct = $correctanswer;\n \n // Every try is recorded as a new one (by increasing retry value), so just insert this one.\n if (!$newattemptid = $DB->insert_record(\"languagelesson_attempts\", $attempt)) {\n error(\"Continue: attempt not inserted\");\n }\n }\n } \n break;\n \n default :\n \n // Record student's attempt.\n $attempt = new stdClass;\n $attempt->lessonid = $this->lesson->id;\n $attempt->pageid = $this->properties->id;\n $attempt->userid = $USER->id;\n \n if ($result->answerid != null) {\n $attempt->answerid = $result->answerid;\n } else {\n $attempt->answerid = 0;\n }\n \n $attempt->type = $result->typeid;\n $attempt->correct = $result->correctanswer;\n $attempt->iscurrent = 1;\n \n if ($result->score == null) {\n $attempt->score = 0;\n } else if ($result->correctanswer) {\n $maxscore = $DB->get_field('languagelesson_pages', 'maxscore', array('id'=>$attempt->pageid));\n $attempt->score = $maxscore;\n } else {\n $attempt->score = $result->score;\n }\n \n if ($result->userresponse !== null) {\n $attempt->useranswer = $result->userresponse;\n }\n \n $attempt->timeseen = time();\n \n if ($previousattempt = $DB->get_record('languagelesson_attempts',\n array('lessonid'=> $attempt->lessonid, 'pageid'=>$attempt->pageid,\n 'userid'=>$attempt->userid, 'iscurrent'=>1))) {\n $attempt->id = $previousattempt->id;\n $attempt->retry = $previousattempt->retry + 1;\n if ($oldFile = $DB->get_record('files', array('id'=>$previousattempt->fileid))) {\n // Delete the previous audio file.\n languagelesson_delete_submitted_file($oldFile);\n }\n if ($previousattempt->graded = 1) {\n // Set it as resubmit.\n $attempt->resubmit = 1;\n // Remove old feedback files if they exist\n if ($oldfeedback = $DB->get_records('languagelesson_feedback', array('attemptid'=>$attempt->id), null, 'id, fileid')) {\n if ($oldfeedback->fileid != NULL) {\n foreach ($oldfeedback as $oldrecord) {\n $oldfilerecord = $DB->get_record('files', array('id'=>$oldrecord->fileid));\n languagelesson_delete_submitted_file($oldfilerecord);\n $DB->delete_records('languagelesson_feedback', array('fileid'=>$oldrecord->fileid));\n }\n }\n }\n }\n if (($this->lesson->maxattempts == 0) || ($this->lesson->maxattempts >= $attempt->retry)) {\n $DB->update_record(\"languagelesson_attempts\", $attempt, true);\n }\n } else {\n $attempt->retry = 1;\n $DB->insert_record('languagelesson_attempts', $attempt, true);\n }\n $recordedattemptid = $DB->get_field('languagelesson_attempts', 'id',\n array('lessonid'=>$attempt->lessonid, 'userid'=>$attempt->userid,\n 'pageid'=>$attempt->pageid));\n\n } // End switch.\n \n // And update the languagelesson's grade.\n\t\t// NOTE that this happens no matter the question type.\n\n if ($lesson->type != LL_TYPE_PRACTICE) {\n // Get the lesson's graded information.\n\n if ($gradeinfo = $DB->get_record('languagelesson_grades', array('lessonid'=>$lesson->id, 'userid'=>$USER->id))){\n $gradeinfo->grade = languagelesson_calculate_user_lesson_grade($lesson->id, $USER->id);\n } else {\n $gradeinfo = new stdClass;\n $gradeinfo->grade = languagelesson_calculate_user_lesson_grade($lesson->id, $USER->id);\n }\n \n // Save the grade.\n languagelesson_save_grade($lesson->id, $USER->id, $gradeinfo->grade);\n \n // Finally, update the records in the gradebook.\n languagelesson_grade_item_update($lesson);\n \n $gradeitem = $DB->get_record('grade_items', array('iteminstance'=>$lesson->id, 'itemmodule'=>'languagelesson'));\n $DB->set_field('grade_grades', 'finalgrade', $gradeinfo->grade, array('userid'=>$USER->id, 'itemid'=>$gradeitem->id));\n \n languagelesson_update_grades($lesson, $USER->id);\n \n }\n \n // \"number of attempts remaining\" message if $this->lesson->maxattempts > 1\n // Displaying of message(s) is at the end of page for more ergonomic display.\n \n // IT'S NOT HITTING THIS CONTROL GROUP BELOW FOR SOME REASON.\n if ((!$result->correctanswer && ($result->newpageid == 0)) || $result->typeid == LL_AUDIO) {\n // Wrong answer and student is stuck on this page - check how many attempts.\n // The student has had at this page/question.\n $nattempts = $attempt->retry;\n // $nattempts = $DB->count_records(\"languagelesson_attempts\", array(\"pageid\"=>$this->properties->id,\n // \"userid\"=>$USER->id, \"retry\" => $attempt->retry));\n // Retreive the number of attempts left counter for displaying at bottom of feedback page.\n if ($this->lesson->maxattempts != 0) { // Don't bother with message if unlimited.\n if ($nattempts >= $this->lesson->maxattempts || $this->lesson->maxattempts == 1){\n $result->maxattemptsreached = true;\n $result->newpageid = LL_NEXTPAGE;\n $result->attemptsremaining = 0;\n } else {\n $result->attemptsremaining = $this->lesson->maxattempts - $nattempts;\n }\n }\n }\n \n // TODO: merge this code with the jump code below. Convert jumpto page into a proper page id.\n if ($result->newpageid == 0) {\n $result->newpageid = $this->properties->id;\n } else if ($result->newpageid == LL_NEXTPAGE) {\n $result->newpageid = $this->lesson->get_next_page($this->properties->nextpageid);\n }\n\n // Determine default feedback if necessary.\n if (empty($result->response)) {\n if (!$this->lesson->feedback && !$result->noanswer && !($this->lesson->review & !$result->correctanswer && !$result->isessayquestion)) {\n // These conditions have been met:\n // 1. The lesson manager has not supplied feedback to the student\n // 2. Not displaying default feedback\n // 3. The user did provide an answer\n // 4. We are not reviewing with an incorrect answer (and not reviewing an essay question).\n\n $result->nodefaultresponse = true; // This will cause a redirect below.\n } else if ($result->isessayquestion) {\n $result->response = get_string('defaultessayresponse', 'languagelesson');\n } else if ($result->correctanswer) {\n if ($this->lesson->defaultfeedback == true) {\n $result->response = $this->lesson->defaultcorrect;\n } else {\n $result->response = get_string('thatsthecorrectanswer', 'languagelesson');\n }\n } else {\n if ($this->lesson->defaultfeedback == true) {\n $result->response = $this->lesson->defaultwrong;\n } else {\n $result->response = get_string('thatsthewronganswer', 'languagelesson');\n }\n }\n }\n \n if ($result->typeid == LL_AUDIO) {\n if ($result->audiodata) {\n $uploadData = $result->audiodata;\n $mp3data = json_decode($uploadData, true, 5);\n $recordedattempt = $DB->get_record('languagelesson_attempts', array('id'=>$recordedattemptid));\n \n foreach ($mp3data['mp3Data'] as $newfilename => $newfilebits) {\n // Send the file to the pool and return the file id.\n $recordedattempt->fileid = upload_audio_file($USER->id, $cmid, $recordedattemptid, $newfilename, $newfilebits);\n $DB->update_record('languagelesson_attempts', $recordedattempt);\n }\n }\n } else if ($result->response) {\n if ($this->lesson->review && !$result->correctanswer && !$result->isessayquestion) {\n $nretakes = $DB->count_records(\"languagelesson_grades\", array(\"lessonid\"=>$this->lesson->id, \"userid\"=>$USER->id));\n $qattempts = $DB->count_records(\"languagelesson_attempts\",\n array(\"userid\"=>$USER->id, \"retry\"=>$nretakes, \"pageid\"=>$this->properties->id));\n if ($qattempts == 1) {\n $result->feedback = $OUTPUT->box(get_string(\"firstwrong\", \"languagelesson\"), 'feedback');\n } else {\n $result->feedback = $OUTPUT->BOX(get_string(\"secondpluswrong\", \"languagelesson\"), 'feedback');\n }\n }\n else\n {\n \t$class = 'response';\n if ($result->correctanswer) {\n $class .= ' correct'; // CSS over-ride this if they exist (!important).\n } else if (!$result->isessayquestion) {\n $class .= ' incorrect'; // CSS over-ride this if they exist (!important).\n }\n $options = new stdClass;\n $options->noclean = true;\n $options->para = true;\n $options->overflowdiv = true;\n \n if ($result->typeid == LL_CLOZE)\n {\n \t// Lets do our own thing for CLOZE - get question_html.\n \t$my_page = $DB->get_record('languagelesson_pages', array('id'=>$attempt->pageid));\n \t$question_html = $my_page->contents;\n \t\n \t// Get user answers from the attempt.\n \t$attempt_answers = $DB->get_record('languagelesson_attempts', array('id'=>$recordedattemptid));\n \t$user_answers_str = $attempt_answers->useranswer;\n \t\t\n \t// Get the lesson page so we can use functions from cloze.php.\n \t$manager = languagelesson_page_type_manager::get($lesson);\n\t\t\t$page = $manager->load_page($attempt->pageid, $lesson);\n\t \t\t\t\t\n\t \t\t// Get our cloze_correct_incorrect_view html.\n\t \t\t$html = $page->get_cloze_correct_incorrect_view($user_answers_str, $question_html);\n\t \t\t$result->feedback = $html;\n }\n else\n {\n \t$result->feedback = $OUTPUT->box(format_text($this->get_contents(), $this->properties->contentsformat, $options), 'generalbox boxaligncenter');\n \t$result->feedback .= '<div class=\"correctanswer generalbox\"><em>'.get_string(\"youranswer\", \"languagelesson\").'</em> : '.$result->studentanswer; // Already in clean html\n \t$result->feedback .= $OUTPUT->box($result->response, $class); // Already conerted to HTML\n \t$result->feedback .= '</div>';\n }\n }\n }\n }\n \n // Update completion state\n $course = get_course($lesson->course);\n $cm = get_coursemodule_from_id('languagelesson', $cmid, 0, false, MUST_EXIST);\n $completion=new completion_info($course);\n if ($completion->is_enabled($cm) && $lesson->completionsubmit) {\n $completion->update_state($cm, COMPLETION_COMPLETE, $USER->id);\n }\n \n return $result;\n }" ]
[ "0.57952505", "0.5377529", "0.52185035", "0.49975178", "0.48823518", "0.48756465", "0.48163727", "0.47065717", "0.4702218", "0.46933544", "0.46753538", "0.46166167", "0.46075803", "0.45797196", "0.45560327", "0.4533082", "0.44617528", "0.4437141", "0.4386287", "0.43757144", "0.4358761", "0.43572804", "0.43523672", "0.43311912", "0.43272075", "0.43266624", "0.43066302", "0.43004525", "0.42938215", "0.42862457" ]
0.59402233
0
Summarizes a student response for the review (e.g. the Review Attempt view).
public function summarise_response(array $response) { //If an answer has been provided, return it. return array_key_exists('answer', $response) ? $response['answer'] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function studentAnswer(Request $request)\n {\n $setId = session()->get('set');\n $levelId = session()->get('level');\n $studentId = session()->get('users');\n $input = $request->all();\n $matches = array();\n $score = 0;\n\n // extract number from string\n foreach ($input as $key => $value) {\n if (preg_match_all('!\\d+!', $key, $match)) {\n $data = implode('', $match[0]);\n array_push($matches, $data);\n }\n }\n\n $matches = array_count_values($matches);\n foreach ($matches as $key => $value) {\n $questionId = $input['question'.$key];\n\n // Check for correct answer and calculate score\n if ($input['choice'.$key] == $input['answer'.$key]) {\n $answer = '1';\n $score += 1;\n } else {\n $answer = '0';\n }\n\n $fields = array('0' => '__kf_StudentId',\n '1' => '__kf_QuestionId',\n '2' => 'studentAnswer_kqn',\n '3' => '__kf_SetId'\n );\n $values = array('0' => $studentId,\n '1' => $questionId,\n '2' => $answer,\n '3' => $setId\n );\n // search for the alredy attempted question(s)\n $result = StudentModel::findRecordByField('StudentAnswer_STUANS', $fields, $values, '2');\n\n // Update record if found other wise create new record\n if ($result) {\n StudentModel::editRecord('StudentAnswer_STUANS', $fields, $values, count($fields), $result[0]->getRecordId());\n } else {\n StudentModel::addRecord('StudentAnswer_STUANS', $fields, $values, count($fields));\n }\n }\n\n $score = ($score/5) * 100;\n return view('student.score', compact('score'));\n }", "function forReviewingAction(Request $request) {\n $this->getSecurityService()->checkSecurity('ROLE_SEIP_ARRANGEMENT_PROGRAM_LIST_FOR_REVIEWING');\n\n $method = 'createPaginatorByAssignedForReviewing';\n $route = 'pequiven_seip_arrangementprogram_for_reviewing';\n $template = 'forReviewingApproving.html';\n return $this->getSummaryResponse($request, $method, $route, $template);\n }", "public function score()\n {\n $nim = auth()->user()->registration_number;\n $submission = SubmissionAssessment::type(AssessmentTypes::TRIAL)\n ->studentId($nim)\n ->with('scores')\n ->first();\n\n $countAssessmentComponent = AssessmentComponent::type(AssessmentTypes::TRIAL)->count();\n $index = 1;\n\n return viewStudent('final-test.score', compact('submission', 'index', 'countAssessmentComponent'));\n }", "public function addReviewByStudent()\n {\n /* code goes here */\n }", "public function appointmentsDataSummary()\n {\n $totalAppointments = Appointment::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->get();\n return ResponseHelper::findSuccess('General Data Summary', [\n \"total_appointments\" => $totalAppointments->count(),\n \"confirmations_pending\" => $totalAppointments->where('status', Appointments::NEW)->count(),\n \"payments_pending\" => $totalAppointments->where('status', Appointments::CONFIRMED)->count(),\n \"rejected_appointments\" => $totalAppointments->where('status', Appointments::REJECTED)->count()\n ]);\n }", "public function generalDataSummary()\n {\n $doctorsCount = Doctor::count();\n $patientsCount = Patient::count();\n $monthlyIncome = \"Rs.\" . number_format(Income::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->sum('amount'), 2);\n $monthlyAppointments = Appointment::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->count();\n return ResponseHelper::findSuccess('General Data Summary', [\n \"doctors_count\" => $doctorsCount,\n \"patients_count\" => $patientsCount,\n \"monthly_income\" => $monthlyIncome,\n \"monthly_appointments\" => $monthlyAppointments\n ]);\n }", "public function show(Exam $exam)\n {\n// dd($exam->students);\n $qcount = count($exam->questions);\n $tfq = 0;\n $mcq = 0;\n $mrq = 0;\n $saq = 0;\n $r = null;\n $c = 0;\n $m = 0;\n $r = 0;\n $d = null;\n foreach ($exam->questions as $q) {\n if ($q->questiontable_type == \"TFQuestion\") {\n $tfq++;\n }\n if ($q->questiontable_type == \"MCQuestion\") {\n $mcq++;\n }\n if ($q->questiontable_type == \"MRQuestion\") {\n $mrq++;\n }\n if ($q->questiontable_type == \"SAQuestion\") {\n $saq++;\n }\n }\n foreach ($exam->students as $st) {\n if ($st->id_student != $r) {\n $c++;\n $r = $st->id_student;\n }\n if ($st->pivot->mark >= 10) {\n $m++;\n }\n }\n foreach ($exam->groupes as $gr) {\n\n $r += count($gr->students);\n $d = $gr->pivot->date_scheduling;\n }\n\n\n return view('teacher.exams.show')->with('exams', $exam)\n ->with('tfq', $tfq)->with('mrq', $mrq)->with('mcq', $mcq)->with('qcount', $qcount)\n ->with('tst', $c)->with('pst', $m)->with('saq', $saq)\n ->with('stn', $r - 1)->with('dsch', $d);\n }", "public static function rating_summary()\n {\n $date=static::first_end_date();\n return StatisticsHelper::rating_summary(null,null,$date->from->format('Y-m-d'),$date->to->format('Y-m-d'));\n }", "public function get_attempt_summary_listing($adaptivequiz, $user) {\n $html = '';\n $html .= html_writer::start_tag('dl', array('class' => 'adaptivequiz-summarylist'));\n $html .= html_writer::tag('dt', get_string('attempt_user', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', $user->firstname.\" \".$user->lastname.\" (\".$user->email.\")\");\n $html .= html_writer::tag('dt', get_string('attempt_state', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', $adaptivequiz->attemptstate);\n $html .= html_writer::tag('dt', get_string('score', 'adaptivequiz').': ');\n $abilityfraction = 1 / ( 1 + exp( (-1 * $adaptivequiz->measure) ) );\n $ability = (($adaptivequiz->highestlevel - $adaptivequiz->lowestlevel) * $abilityfraction) + $adaptivequiz->lowestlevel;\n $stderror = catalgo::convert_logit_to_percent($adaptivequiz->standarderror);\n if ($stderror > 0) {\n $score = round($ability, 2).\" &nbsp; &plusmn; \".round($stderror * 100, 1).\"%\";\n } else {\n $score = 'n/a';\n }\n $html .= html_writer::tag('dd', $score);\n $html .= html_writer::end_tag('dl');\n\n $html .= html_writer::start_tag('dl', array('class' => 'adaptivequiz-summarylist'));\n $html .= html_writer::tag('dt', get_string('attemptstarttime', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', userdate($adaptivequiz->timecreated));\n $html .= html_writer::tag('dt', get_string('attemptfinishedtimestamp', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', userdate($adaptivequiz->timemodified));\n $html .= html_writer::tag('dt', get_string('attempttotaltime', 'adaptivequiz').': ');\n $totaltime = $adaptivequiz->timemodified - $adaptivequiz->timecreated;\n $hours = floor($totaltime / 3600);\n $remainder = $totaltime - ($hours * 3600);\n $minutes = floor($remainder / 60);\n $seconds = $remainder - ($minutes * 60);\n $html .= html_writer::tag('dd', sprintf('%02d', $hours).\":\".sprintf('%02d', $minutes).\":\".sprintf('%02d', $seconds));\n $html .= html_writer::tag('dt', get_string('attemptstopcriteria', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', $adaptivequiz->attemptstopcriteria);\n $html .= html_writer::end_tag('dl');\n return $html;\n }", "public function summary()\n\t{\n\t\t$this->load->database();\n\t\t$this->load->model('class_session');\n\t\t$userId = $this->session->profileData['user_id'];\n\t\t$sessionId = $this->input->get('sessionId');\n\t\t$sessionDate = $this->input->get('sessionDate');\n\t\t$sessionResult = $this->class_session->getSessionSummaryDetails($sessionId, $sessionDate);\n\t\t\n\t\t$this->load->model('student');\n\t\t$studentData = $this->student->getAllStudentIndex($sessionId);\n\t\t\n\t\t$data = array(\n\t\t\t'sessionId' => $sessionId,\n\t\t\t'sessionResult' => $sessionResult,\n\t\t\t'studentData' => $studentData\n\t\t);\n\t\t$this->load->view('session/class_details', $data);\n\t\t\n\t}", "function wplms_course_student_stats($curriculum,$course_id,$user_id=null){\n $assignments = $this->get_course_assignments($course_id);\n if(is_array($assignments) && count($assignments)){\n $curriculum .= '<li><h5>'._x('Assignments','assignments connected to the course, Course - admin - user - stats','wplms-assignments').'</h5></li>';\n foreach($assignments as $assignment){\n \n $marks = get_post_meta($assignment->post_id,$user_id,true);\n if(is_numeric($marks)){\n $curriculum .= '<li><span data-id=\"'.$assignment->post_id.'\" class=\"done\"></span> '.get_the_title($assignment->post_id).' <strong>'.(($marks)?_x('Marks Obtained : ',' marks obtained in assignment result','wplms-assignments').$marks:__('Under Evaluation','wplms-assignments')).'</strong></li>';\n }else{\n $curriculum .= '<li><span data-id=\"'.$assignment->post_id.'\"></span> '.get_the_title($assignment->post_id).'</li>';\n }\n \n }\n }\n return $curriculum;\n }", "function testFormatStudentViewOfSurveyEvaluationResult()\n {\n // $survey = $this->EvaluationComponentTest->formatStudentViewOfSurveyEvaluationResult(1);\n }", "public function executeRatingDetails()\n {\n if ($this->object)\n {\n $details = $this->object->getRatingDetails(true);\n $total_ratings = array_sum($details);\n $full_details = array();\n foreach ($details as $rating => $nb_ratings)\n {\n if ($total_ratings > 0)\n {\n $percent = $nb_ratings / $total_ratings * 100;\n } else $percent = 0;\n $full_details[$rating] = array('count' => $nb_ratings,\n 'percent' => $percent);\n }\n $this->rating_details = $full_details;\n $this->object_type = get_class($this->object);\n }\n }", "public function get_survey_summary($session_key,$sid, $stat_name)\n {\n $permitted_stats = array();\n if ($this->_checkSessionKey($session_key))\n { \n\t\t \t \n\t\t$permitted_token_stats = array('token_count', \n\t\t\t\t\t\t\t\t'token_invalid', \n\t\t\t\t\t\t\t\t'token_sent', \n\t\t\t\t\t\t\t\t'token_opted_out',\n\t\t\t\t\t\t\t\t'token_completed'\n\t\t\t\t\t\t\t\t);\t\t\t\t\t\n\t\t$permitted_survey_stats = array('completed_responses', \n\t\t\t\t\t\t\t\t'incomplete_responses', \n\t\t\t\t\t\t\t\t'full_responses' \n\t\t\t\t\t\t\t\t); \n\t\t$permitted_stats = array_merge($permitted_survey_stats, $permitted_token_stats);\t\t\t\t\t\t\n\t\t$surveyidExists = Survey::model()->findByPk($sid);\t\t \n\t\tif (!isset($surveyidExists))\n\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\t\n\t\t\t\n\t\tif(in_array($stat_name, $permitted_token_stats))\t\n\t\t{\n\t\t\tif (tableExists('{{tokens_' . $sid . '}}'))\n\t\t\t\t$summary = Tokens_dynamic::model($sid)->summary();\n\t\t\telse\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No available data', 23);\n\t\t}\n\t\t\n\t\tif(in_array($stat_name, $permitted_survey_stats) && !tableExists('{{survey_' . $sid . '}}'))\t\n\t\t\tthrow new Zend_XmlRpc_Server_Exception('No available data', 23);\n\t\t\t\t\t\t\t\t\n\t\tif (!in_array($stat_name, $permitted_stats)) \n\t\t\tthrow new Zend_XmlRpc_Server_Exception('No such property', 23);\n\t\n\t\tif (hasSurveyPermission($sid, 'survey', 'read'))\n\t\t{\t\n\t\t\tswitch($stat_name) \n\t\t\t{\n\t\t\t\tcase 'token_count':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkcount'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'token_invalid':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkinvalid'];\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'token_sent':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tksent'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'token_opted_out':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkoptout'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'token_completed';\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkcompleted'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'completed_responses':\n\t\t\t\t\treturn Survey_dynamic::model($sid)->count('submitdate IS NOT NULL');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'incomplete_responses':\n\t\t\t\t\treturn Survey_dynamic::model($sid)->countByAttributes(array('submitdate' => null));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'full_responses';\n\t\t\t\t\treturn Survey_dynamic::model($sid)->count();\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Data is not available', 23);\n\t\t\t}\n\t\t}\n\t\telse\n\t\tthrow new Zend_XmlRpc_Server_Exception('No permission', 2); \t\t\n }\n }", "public function overallSubjectAnalysis($slug)\n {\n \n $user = User::getRecordWithSlug($slug);\n if($isValid = $this->isValidRecord($user))\n return redirect($isValid); \n \n if(!isEligible($slug))\n return back();\n\n $records = array();\n $records = ( new App\\QuizResult())->getOverallSubjectsReport($user);\n if(!$records)\n {\n flash('Ooops..!','No Records available', 'overlay'); \n return back();\n }\n $color_correct = getColor('background',rand(00,9999));\n $color_wrong = getColor('background', rand(00,9999));\n $color_not_attempted = getColor('background', rand(00,9999)); \n $i=0;\n $labels = [];\n $dataset = [];\n $dataset_label = [];\n $bgcolor = [];\n $border_color = [];\n \n $marks_labels = [getPhrase('correct'), getPhrase('wrong'), getPhrase('not_answered')];\n $time_labels = [getPhrase('time_spent_on_correct_answers'), getPhrase('time_spent_on_wrong_answers')];\n\n foreach($records as $record) {\n $record = (object)$record;\n \n //Marks\n $subjects_display[$i]['subject_name'] = $record->subject_name;\n $subjects_display[$i]['correct_answers'] = $record->correct_answers;\n $subjects_display[$i]['wrong_answers'] = $record->wrong_answers;\n $subjects_display[$i]['not_answered'] = $record->not_answered;\n\n // Time\n $subjects_display[$i]['time_spent_on_correct_answers'] = $record->time_spent_on_correct_answers;\n $subjects_display[$i]['time_spent_on_wrong_answers'] = $record->time_spent_on_wrong_answers;\n $subjects_display[$i]['time_to_spend'] = $record->time_to_spend;\n $subjects_display[$i]['time_spent'] = $record->time_spent;\n\n \n $marks_dataset = [$record->correct_answers, $record->wrong_answers, $record->not_answered];\n $time_dataset = [$record->time_spent_on_correct_answers, $record->time_spent_on_wrong_answers];\n $dataset_label = $record->subject_name;\n \n $bgcolor = [$color_correct,$color_wrong,$color_not_attempted];\n \n $border_color = [$color_correct,$color_wrong,$color_not_attempted];\n\n \n $marks_data['type'] = 'pie'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $marks_data['title'] = $record->subject_name; \n\n $marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $marks_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['chart_data'][] = (object)$marks_data;\n\n\n $time_data['type'] = 'bar'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $time_data['title'] = $record->subject_name; \n\n $time_data['data'] = (object) array(\n 'labels' => $time_labels,\n 'dataset' => $time_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['time_data'][] = (object)$time_data;\n\n $i++;\n } \n \n $data['chart_data'][] = (object)$marks_data;\n\n $overall_correct_answers = 0;\n $overall_wrong_answers = 0;\n $overall_not_answered = 0;\n\n $overall_time_spent_correct_answers = 0;\n $overall_time_spent_wrong_answers = 0;\n \n foreach($records as $r)\n {\n $r = (object)$r;\n $overall_correct_answers += $r->correct_answers;\n $overall_wrong_answers += $r->wrong_answers;\n $overall_not_answered += $r->not_answered;\n \n $overall_time_spent_correct_answers += $r->time_spent_on_correct_answers;\n $overall_time_spent_wrong_answers += $r->time_spent_on_wrong_answers;\n }\n\n $overall_marks_dataset = [$overall_correct_answers, $overall_wrong_answers, $overall_not_answered];\n $overall_time_dataset = [$overall_time_spent_correct_answers, $overall_time_spent_wrong_answers];\n\n $overall_marks_data['type'] = 'doughnut'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $overall_marks_data['title'] = getPhrase('overall_marks_analysis');\n $overall_marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $overall_marks_dataset,\n 'dataset_label' => getPhrase('overall_marks_analysis'),\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n\n $data['right_bar_path'] = 'student.exams.subject-analysis.right-bar-performance-chart';\n $data['right_bar_data'] = array('right_bar_data' => (object)$overall_marks_data);\n \n $data['overall_data'][] = (object)$overall_marks_data;\n \n $data['subjects_display'] = $records;\n $data['active_class'] = 'analysis';\n $data['title'] = getPhrase('overall_subject_wise_analysis');\n $data['user'] = $user;\n $userid = $user->id;\n $data['layout'] = getLayout();\n\n return view('student.exams.subject-analysis.subject-analysis', $data); \n }", "public function showSurveyResult($survey)\n\t{\n\t\t$data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->get();\n\n\t\t//Lets figure out the results from the answers\n\t\t$data['rediness'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 4)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t//Get my goals\n\t\t$data['goals'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 5)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t$data['goals'] = json_decode($data['goals']->answer);\n\n\t\t//Figure out the rediness score\n\t\t$data['rediness_percentage'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', '>', 6)\n\t\t\t\t\t\t\t\t->where('answers.q_id','<' , 12)\n\t\t\t\t\t\t\t\t->get();\n\t\t//Calculate the readiness\n\t\t$myscore = 0;\n\t\t$total = count($data['rediness_percentage']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$cr = $data['rediness_percentage'][$i];\n\n\t\t\t$myscore += $cr->answer;\n\t\t}\n\n\t\t$data['rediness_percentage'] = ($myscore/50) * 100;\n\n\t\t//Figure out the matching programs\n\t\t$data['strengths'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 11)\n\t\t\t\t\t\t\t\t->first();\n\t\t//Parse out the strenghts\n\t\t$data['strengths'] = json_decode($data['strengths']->answer);\n\t\t$program_codes = '';\n\t\t$total = count($data['strengths']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$matching_programs = DB::table('matching_programs')\n\t\t\t\t\t\t\t\t\t\t->where('answer', $data['strengths'][$i])\n\t\t\t\t\t\t\t\t\t\t->first();\n\t\t\tif($program_codes == '') {\n\t\t\t\t$program_codes = $matching_programs->program_codes;\n\t\t\t}else {\n\t\t\t\t$program_codes .= ','.$matching_programs->program_codes;\n\t\t\t}\n\t\t}\n\n\t\t$program_codes = explode(',', $program_codes);\n\t\t$program_codes = array_unique($program_codes);\n\t\tforeach ($program_codes as $key => $value) {\n\t\t\t$program_codes[$key] = trim($program_codes[$key]);\n\t\t}\n\n\n\t\t$data['programs'] = DB::table('programs')\n\t\t\t\t\t\t\t->whereIn('program_code', $program_codes)\n\t\t\t\t\t\t\t->get();\n\n\t\t//Get the user information\n\t\t$data['lead'] = DB::table('leads')\n\t\t\t\t\t\t\t->where('id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t->first();\n\n\t\t//Get the articles that we are going to display\n $data['articles'] = Tools::getBlogPosts();\n\n\n\t\t//Create the view\n\t\t$this->layout->content = View::make('survey-result.content', $data);\n\n\t\t$this->layout->header = View::make('includes.header');\n\t}", "public function showScore($response, $quiz)\n {\n $max_score = $quiz->getMaxScore($quiz);\n $score = $_SESSION[$quiz->getSlug()];\n $percentage = round($score / $max_score * 100);\n\n return $this->view->render($response, 'score.html', [\n 'quiz' => $quiz,\n 'score' => $score,\n 'max_score' => $max_score,\n 'percentage' => $percentage\n ]);\n }", "private function fraudReviewFrom($response)\n {\n\n }", "public function actionRate()\n\t{\n\t\t$note_id = $_POST['note_id'];\n\t\t$student_id = $_POST['student_id'];\n\t\t$rating = $_POST['rating'];\n\n\t\t$model = $this->loadModel($note_id);\n\t\t$model->rate($student_id, $rating);\n\n\t\t$totalRating = $model->getTotalRating();\n\t\t$ratersCount = $model->getRatersCount();\n\n\t\tif ( ! $totalRating)\n\t\t\techo 'N/A';\n\t\telse\n\t\t\techo '' . ((double)$totalRating / $ratersCount) . ' (dari ' . $ratersCount . ' pengguna)';\n\t}", "private function ga_api_account_summaries() {\n\t\t$request = Ga_Lib_Api_Request::get_instance();\n\t\t$request = $this->sign( $request );\n\t\t$response = $request->make_request( self::GA_ACCOUNT_SUMMARIES_ENDPOINT );\n\n\t\treturn new Ga_Lib_Api_Response( $response );\n\t}", "public function stats($id)\n {\n $survey = Survey::findOrFail($id);\n// dd($survey);\n $responses = array();\n foreach ($survey->questions as $question)\n {\n switch ($question->getQuestionType()->name) {\n case 'single_choice':\n $single_choice = new Single_Choice_Response;\n $single_choice_response = $single_choice::where('question_id', $question->id)->get();\n $responses[] = $single_choice_response;\n break;\n case 'multiple_choice':\n $multiple_choice = new Multiple_Choice_Response;\n $multiple_choice_response = $multiple_choice::where('question_id', $question->id)->get();\n $responses[] = $multiple_choice_response;\n break;\n case 'text':\n $text = new Text_Response;\n $text_response = $text::where('question_id', $question->id)->get();\n $responses[] = $text_response;\n break;\n case 'rating':\n $rating = new Rating_Response;\n $rating_response = $rating::where('question_id', $question->id)->get();\n $responses[] = $rating_response;\n break;\n }\n }\n return view('survey.admin.stats', compact('survey','responses'));\n }", "public function viewMyExamReport(Request $request){\n\t\t$data['question']=ExamManagementQuestions::where([['exam_management_id',$request->exam_id]])\n\t\t\t\t\t\t\t ->leftJoin('questions','questions.id','=','exam_management_questions.question_id')\n\t\t\t\t\t\t\t ->leftJoin('segregations','segregations.id','=','questions.segregation_id')\n\t\t\t\t\t\t\t ->select('questions.id as q_id','questions.*','segregations.*','exam_management_questions.*')\n\t\t\t\t\t\t\t->get();\n\t\t\t\t\t\t\tforeach($data['question'] as $key=>$que_details){\n\t\t\t\t\t\t\t\t $quest_id=$que_details->q_id;\n\t\t\t\t\t\t\t\t $data['question'][$key]['student_answer']=StudentAnswer::where([['exam_id',$request->exam_id],['student_id', auth()->user()->id],['question_id',$quest_id]])->get();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn view('student.exam.examreport',$data);\n\t}", "public function summary(Request $request)\n {\n try{\n if($request->ajax()) {\n $rides = UserRequests::where('provider_id', Auth::user()->id)->count();\n $revenue = UserRequestPayment::whereHas('request', function($query) use ($request) {\n $query->where('provider_id', Auth::user()->id);\n })\n ->sum('total');\n $cancel_rides = UserRequests::where('status','CANCELLED')->where('provider_id', Auth::user()->id)->count();\n $scheduled_rides = UserRequests::where('status','SCHEDULED')->where('provider_id', Auth::user()->id)->count();\n\n return response()->json([\n 'rides' => $rides, \n 'revenue' => $revenue,\n 'cancel_rides' => $cancel_rides,\n 'scheduled_rides' => $scheduled_rides,\n ]);\n }\n\n } catch (Exception $e) {\n return response()->json(['error' => trans('api.something_went_wrong')]);\n }\n\n }", "public function getTotalStudents(){\n $total_stds = $this->getTotalStds();\n $total_stds_men = $this->getTotalStdsMen();\n $total_stds_women = $this->getTotalStdsWomen();\n\n $htmlResumenTotal = $this->str_students(1,\"\").' <tr class=\"numbers\">\n <td class=\"color-indico\">'.number_format($total_stds).'</td>\n <td class=\"color-blue\">'.number_format($total_stds_men).'('.number_format($total_stds_men * 100 / $total_stds).'%)</td>\n <td class=\"color-orange\">'.number_format($total_stds_women).' ('.number_format($total_stds_women * 100 / $total_stds).'%)</td>\n </tr>\n '.$this->str_students(2,\"\");\n return $htmlResumenTotal;\n }", "public function apprentice_summary(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('Apprentice Summary', $this->session->userdata['type']);\n\t\t\n\t\t$data = [\n\t\t\t'total_internship' => $this->M_apprenticeGraph->get_total_internship(),\n\t\t\t'contract_expiredApprentice' => $this->M_apprenticeGraph->get_contract_expiredApprentice(),\n\t\t\t'graphAlumniInt' => $this->M_apprenticeGraph->getGraphMemberAlumniInt(),\n\t\t\t'internship_expired' => $this->M_apprenticeGraph->get_internship_expired(),\n\t\t\t'graphApprYear' => $this->M_apprenticeGraph->getGraphApprByYear(),\n\t\t\t'graphApprUniv' => $this->M_apprenticeGraph->getGraphApprByUniversity(),\n\t\t\t'graphApprSpv' => $this->M_apprenticeGraph->getGraphApprBySpv(),\n\t\t\t'judul' => 'Apprentice Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoringApprentice',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => ['apprenticeSummary/apprenticeSummaryGraph']\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "public function index()\n {\n $reviews = DB::table('ratings')->get();\n\n foreach ($reviews as $review) {\n \t# code...\n \t$patient = Patient::where('user_id',$review->author_id)->first();\n\n \t$doctor = Doctor::findOrFail($review->rateable_id);\n\n \t$review->patient_name = $patient->name;\n \t$review->patient_firstname = $patient->firstname;\n \t$review->patient_image = $patient->profile_picture;\n \t$review->doctor_name = $doctor->name;\n \t$review->doctor_firstname = $doctor->firstname;\n \t$review->doctor_image = $doctor->profile_picture;\n \t$review->created_at = Carbon::parse($review->created_at);\n }\n\n return view('admin.reviews.index')->with('reviews', $reviews);\n }", "public function showRating(Request $request){\n $this->validate($request, [\n 'product_id' => 'required'\n ]);\n // get rating\n \n $auth_id = Auth::id();\n $rating = Review::where([\"user_id\" => $auth_id, \"product_id\" => $request->product_id])->get();\n if(count($rating) > 0){\n $rating = json_decode(json_encode($rating));\n // avg ratings\n $review = Review::where('product_id', '=', $request->product_id)->avg('ratings');\n $avgRating = number_format($review, 0);\n return response()->json([$rating[0], $avgRating], 200);\n }\n \n \n \n }", "public function rating()\n {\n return $this->hasOne('App\\Review')\n ->selectRaw('user_id, count(*) as count, avg(would_recommend) as avg, avg(communication) as communication, avg(as_described) as as_described')\n ->groupBy('user_id');\n }", "function viewStudentAdvisor( $sessionID, $studentID ) {\r\n\t\tif( $this->userCanViewStudent( $sessionID )) {\r\n\t\t\t$query = \"SELECT ADVISOR FROM X_PNSY_STUDENT WHERE ID = '$studentID'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\textract($result);\r\n\t\t\r\n\t\t\t$query = \"SELECT FIRST_NAME, LAST_NAME, WOOSTER_EMAIL FROM X_PNSY_FACULTY WHERE ID = '$ADVISOR'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\t\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t}", "function response_summary($question, $state, $length=80, $formatting=true) {\n return substr($state->answer, strpos($state->answer, '-')+1, $length);\n }" ]
[ "0.62471807", "0.5637715", "0.5610492", "0.55261534", "0.55089617", "0.5500859", "0.54301894", "0.5415672", "0.54149866", "0.5366875", "0.53526556", "0.53455746", "0.5342067", "0.5313038", "0.5310777", "0.52997404", "0.52992296", "0.5277592", "0.5263583", "0.5248486", "0.5234824", "0.5232053", "0.5225814", "0.5201436", "0.517936", "0.5157612", "0.5149631", "0.5146641", "0.51250124", "0.51177585" ]
0.58027303
1
Compares a given response with a given answer; the way which this is performed is determined by the answer_mode variable.
public function compare_response_with_answer(array $response, question_answer $answer) { // Tentative: if this response isn't gradable, it can't match any of the answers. if(!$this->is_gradable_response($response)) { return false; } //parse the response according to the selected response mode $value = $this->parse_response($response); //Create a new interpreter using the serialized question state. $interpreter = $this->create_interpreter($this->vars, $this->funcs); //Process the answer according to the interpretation mode. switch($this->answer_mode) { //for direct/answer modes, case qtype_scripted_answer_mode::MODE_MUST_EQUAL: //evaluate the given answer formula try { $ans = $interpreter->evaluate($answer->answer); } catch(qtype_scripted_language_exception $e) { return false; } //if we're comparing in a non-case-sensitive manner, convert the _answer_ to lowercase if($this->response_mode == qtype_scripted_response_mode::MODE_STRING) { $ans = strtolower((string)$ans); } //if the two are both numeric, compare them loosely, without regard to type; so 5 == "05" is true if(is_numeric($ans) && is_numeric($value)) { return $ans == $value; } //otherwise, compare them stricly; so "5a" !== 5; (note that, had we performed a loose compare, "5a" == 5 is true due to type juggling >.<) else { return $ans === $value; } //case 'boolean': case qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE: //Define the variable "resp" in the context of the interpreter. //Also define response, as per the principle of least astonishment. $interpreter->resp = $value; $interpreter->response = $value; try { //and return true iff the answer evaluates to True return (bool)$interpreter->evaluate($answer->answer); } //If an error occurs during evalution, return false. catch(qtype_scripted_language_exception $e) { return false; } default: //something's gone wrong throw new coding_exception('Invalid grading mode for the scripted qtype.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function compare_response_with_answer(array $response, question_answer $answer) {\n global $question;\n $autofeedback = $this->autofeedback;\n // Check to see if correct or not.\n if (self::compare_string_with_wildcard($response['answer'], $answer->answer, false)) {\n return true;\n }\n if ($this->autofeedback == 0) {\n return false;\n }\n // Must be wrong answer....lets see where they went wrong.\n $anssmiles = $answer->answer;\n $usrsmiles = $response['answer'];\n $eofeedback = '';\n // Check to see if user submitted correct type (reaction or not reaction).\n if (self::smiles_is_reaction($anssmiles)) {\n if (!self::smiles_is_reaction($usrsmiles)) {\n $this->usecase = \"<ol><li>You were asked to draw a reaction, but you neglected to add a reaction arrow!</li></ol>\";\n return false;\n }\n } else {\n if (self::smiles_is_reaction($usrsmiles)) {\n $this->usecase = \"<ol><li>You were asked to draw structures, but you drew a reaction!</li></ol>\";\n return false;\n }\n\n }\n\n // Breakdown into reactions and not reactions and analyze each!\n\n if (self::smiles_is_reaction($anssmiles)) { // Reaction!\n\n // Split into reactants and products.\n $reactantsandproducts = explode('>>', $anssmiles);\n $ansreactants = $reactantsandproducts[0];\n $ansproducts = $reactantsandproducts[1];\n\n $reactantsandproducts = explode('>>', $usrsmiles);\n $usrreactants = $reactantsandproducts[0];\n $usrproducts = $reactantsandproducts[1];\n\n $numincorrect = false;\n $usecasestring = '';\n $usrreactnumincorrect = count(explode(\".\", $ansreactants)) - count(explode(\".\", $usrreactants));\n\n if ($usrreactnumincorrect != '0') {\n if ($usrreactnumincorrect > 0) {\n $usecasestring .= \"<li>You are missing $usrreactnumincorrect reactant molecules in your answer!</li>\";\n }\n if ($usrreactnumincorrect < 0) {\n $usecasestring .= \"<li>You have $usrreactnumincorrect too many reactant molecules in your answer!</li>\";\n }\n $numincorrect = true;\n }\n\n $usrprodnumincorrect = count(explode(\".\", $ansproducts)) - count(explode(\".\", $usrproducts));\n\n if ($usrprodnumincorrect != '0') {\n if ($usrprodnumincorrect > 0) {\n $usecasestring .= \"<li>You are missing $usrprodnumincorrect product molecules in your answer!</li>\";\n }\n if ($usrprodnumincorrect < 0) {\n $usecasestring .= \"<li>You have $usrprodnumincorrect too many product molecules in your answer!</li>\";\n }\n $numincorrect = true;\n }\n if ($numincorrect == true) {\n $this->usecase = $usecasestring;\n return false;\n }\n // End of reaction analysis!\n } else { // Not reaction.\n\n $ansnumofmole = $this->smiles_num_of_molecules($anssmiles);\n $usrnumofmole = self::smiles_num_of_molecules($usrsmiles);\n\n // Check to see if correct number of molecules.\n\n if ($ansnumofmole !== $usrnumofmole) {\n // Must have wrong num of molecules.\n if ($ansnumofmole > $usrnumofmole) {\n $this->usecase = \"<li>You are missing \".($ansnumofmole - $usrnumofmole).\" molecules in your answer!</li>\";\n return false;\n } else {\n $this->usecase = \"<li>You have \".($usrnumofmole - $ansnumofmole).\" molecule(s) more than are required!</li>\";\n return false;\n }\n\n }\n\n // Combine all feedback from here on out!\n $usecasestring = '';\n // Check to see if stereochemistry is required and if user has add stereochem - just looking for @ !\n\n // Quik check first.\n if (self::smiles_ischiral1($anssmiles)) {\n if (!self::smiles_ischiral1($usrsmiles)) {\n $usecasestring .= \"<li>You did not indicate the required R/S stereochemistry!</li>\";\n }\n } else {\n if (self::smiles_ischiral($usrsmiles)) {\n $usecasestring .= \"<li>You showed stereochemistry in your answer .\n but it was not required for this problem!</li>\";\n }\n }\n // Check to see if wrong enantiomer of entire string!\n if (self::smiles_ischiral1($anssmiles) && self::smiles_ischiral1($usrsmiles)) {\n $anstemp = str_replace(\"@\", \"\", $anssmiles);\n $usrtemp = str_replace(\"@\", \"\", $usrsmiles);\n if ($anstemp == $usrtemp) {\n $usecasestring .= \"<li>You likely have the wrong stereochemistry!</li>\";\n $this->usecase = $usecasestring;\n return false;\n }\n }\n\n // Check to see if E/Z correct.\n\n // Quik check first.\n if (strpos($anssmiles, '/') !== false || strpos($anssmiles, '\\\\') !== false) {\n if (strpos($usrsmiles, '/') == false && strpos($usrsmiles, '\\\\') == false) {\n $usecasestring .= \"<li>You did not indicate the required E/Z stereochemistry!</li>\";\n }\n } else {\n if (strpos($usrsmiles, '/') !== false || strpos($usrsmiles, '\\\\') !== false) {\n $usecasestring .= \"<li>You showed E/Z stereochemistry in your answer but .\n it was not required for this problem!</li>\";\n }\n }\n // Check for lone pairs.\n\n if (strpos($anssmiles, 'lp') !== false) {\n if (strpos($usrsmiles, 'lp') == false) {\n $usecasestring .= \"<li>You are missing lone pair electrons!</li>\";\n }\n } else {\n if (strpos($usrsmiles, 'lp') !== false) {\n $usecasestring .= \"<li>You showed lone pairs in your answer but they were not required!</li>\";\n }\n }\n\n // Check for radicals.\n if (strpos($anssmiles, '^') !== false) {\n if (strpos($usrsmiles, '^') == false) {\n $usecasestring .= \"<li>You are missing radical electrons!</li>\";\n }\n } else {\n if (strpos($usrsmiles, '^') !== false) {\n $usecasestring .= \"<li>You showed radical electrons in your answer but they were not required!</li>\";\n }\n }\n\n // Check for charge.\n if (strpos($anssmiles, '+') !== false || strpos($anssmiles, '-') !== false) {\n if (strpos($usrsmiles, '+') == false && strpos($usrsmiles, '-') == false) {\n $usecasestring .= \"<li>You are missing charges on atoms!</li>\";\n }\n } else {\n if (strpos($usrsmiles, '^') !== false) {\n $usecasestring .= \"<li>You showed charges in your answer but they were not required!</li>\";\n }\n }\n\n $this->usecase = $usecasestring;\n } // End of not reaction analysis.\n\n return false;\n }", "private function parse_response(array $response)\n {\n //strip all leading and trailing whitespace from the answer\n $response['answer'] = trim($response['answer']);\n\n //interpret the user's reponse according to the reponse mode\n switch($this->response_mode)\n {\n \n //handle STRING-mode respones\n case qtype_scripted_response_mode::MODE_STRING: \n\n //return the answer as-is, as we already recieved a string\n return strtolower($response['answer']);\n\n //handle STRING-mode respones\n case qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE: \n\n //return the answer as-is, as we already recieved a string\n return $response['answer'];\n\n //handle DECIMAL-mode responses\n case qtype_scripted_response_mode::MODE_NUMERIC:\n\n //if the string was empty, return false, a non-numeric form of zero\n if($response['answer'] === '')\n return false;\n\n //get a floating-point interpretation of the answer\n return floatval($response['answer']);\n\n \n //handle HEXADECIMAL-mode responses \n case qtype_scripted_response_mode::MODE_HEXADECIMAL:\n\n //if the user entered a number in C format, parse it using PHP's native recognition of hex numbers\n if(substr($response['answer'], 0, 2) === \"0x\")\n return intval(substr($response['answer'], 2), 16);\n\n //if the user entered the hex number in HCS08 format (i.e. $0F), accept that, as well\n elseif(substr($response['answer'], 0, 1) == '$')\n return hexdec(substr($response['answer'], 1));\n\n //otherwise, return the answer parsed as a hex number\n else\n return hexdec($response['answer']);\n\n //handle BINARY-mode respones\n case qtype_scripted_response_mode::MODE_BINARY:\n\n //if the user entered a number in 0b format (used by some calculators), accept it \n if(substr($response['answer'], 0, 2) === \"0b\")\n return bindec(substr($response['answer'], 2), 16);\n\n //if the user entered the binary number in HCS08 format (i.e. %0F), accept that, as well\n elseif(substr($response['answer'], 0, 1) == '%')\n return bindec(substr($response['answer'], 1));\n\n //otherwise, return the answer parsed as a binary number\n else\n return bindec($response['answer']);\n\n\n //handle OCTAL-mode\n case qtype_scripted_response_mode::MODE_OCTAL:\n\n //if the user entered a number in 0o format, accept it, for consistency with other prefix strings\n //(as far as I know, no major format uses this)\n if(substr($response['answer'], 0, 2) === \"0o\")\n return octdec(substr($response['answer'], 2), 16);\n\n //if the user entered the binary number in HCS08 format (i.e. @0F), accept that, as well\n elseif(substr($response['answer'], 0, 1) == '@')\n return octdec(substr($response['answer'], 1));\n\n //otherwise, return the answer parsed as a octal number\n else\n return octdec($response['answer']);\n }\n }", "public function evaluate_answer($answerobj, $interpreter = null) {\n\n //Create a copy of the given answer...\n $answer = clone $answerobj;\n\n //create a new interpreter\n if(!$interpreter) {\n $interpreter = $this->create_interpreter($this->vars, $this->funcs);\n }\n \n //evaluate the correct answer to get a given reponse, if possible\n try {\n $answer->answer = $interpreter->evaluate($answer->answer);\n } catch(qtype_scripted_language_exception $e) {\n debugging($e->getMessage());\n return null;\n }\n\n //return the correct answer depending on the response mode\n switch($this->response_mode)\n {\n //if the answer is expected in binary, return the answer in binary\n case qtype_scripted_response_mode::MODE_BINARY:\n $answer->answer = decbin($answer->answer);\n break;\n \n //if the answer is expected in hex, return the answer in hex\n case qtype_scripted_response_mode::MODE_HEXADECIMAL:\n $answer->answer = dechex($answer->answer);\n break;\n\n //if the answer is expected in binary, return the answer in binary\n case qtype_scripted_response_mode::MODE_OCTAL:\n $answer->answer = decoct($answer->answer);\n break;\n }\n\n return $answer;\n\n }", "function isAnswerCorrect($answers, $answer)\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilStr.php\";\n\t\t$result = 0;\n\t\t$textrating = $this->getTextRating();\n\t\tforeach ($answers as $key => $value)\n\t\t{\n\t\t\tswitch ($textrating)\n\t\t\t{\n\t\t\t\tcase TEXTGAP_RATING_CASEINSENSITIVE:\n\t\t\t\t\tif (strcmp(ilStr::strToLower($value), ilStr::strToLower($answer)) == 0 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_CASESENSITIVE:\n\t\t\t\t\tif (strcmp($value, $answer) == 0 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN1:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 1 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN2:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 2 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN3:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 3 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN4:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 4 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN5:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 5 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "private function q10($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(16) == D;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(16) == A;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(16) == E;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(16) == B;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(16) == C;\n\t\t}\n\t}", "private function q2($answer) {\n\t\t// TODO: make sure no other consecutive questions have identical answers\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase B:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase C:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase D:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase E:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t}\n\t\t\n\t}", "public function is_complete_response(array $response) {\n\n //a response without an answer is not a compelte response \n if(!array_key_exists('answer', $response)) {\n return false;\n }\n\n //determine gradability based on response type\n switch($this->response_mode) {\n\n //in string mode, accept any non-empty string\n case qtype_scripted_response_mode::MODE_STRING:\n case qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE:\n return $response['answer'] !== '';\n\n //in numeric mode, accept any numeric string\n case qtype_scripted_response_mode::MODE_NUMERIC:\n return is_numeric($response['answer']);\n\n //in binary mode, check to see if the number is valid binary using a regex\n case qtype_scripted_response_mode::MODE_BINARY:\n return preg_match('#^(0b|\\%)?[01]+$#', $response['answer']) !== 0 || (array_key_exists('answer', $response) && empty($response['answer']));\n\n //do the same for hexadecimal\n case qtype_scripted_response_mode::MODE_HEXADECIMAL:\n return preg_match('#^(0x|\\$)?[0-9a-fA-F]+$#', $response['answer']) !== 0;\n\n //do the same for octal \n case qtype_scripted_response_mode::MODE_OCTAL:\n return preg_match('#^(0o|\\@)?[0-7]+$#', $response['answer']) !== 0;\n }\n }", "private function q18($answer) {\n\t\t$as = $this->total_number_of(A);\n\t\t$bs = $this->total_number_of(B);\n\t\t$cs = $this->total_number_of(C);\n\t\t$ds = $this->total_number_of(D);\n\t\t$es = $this->total_number_of(E);\n\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $as === $bs;\n\t\t\tcase B:\n\t\t\t\treturn $as === $cs;\n\t\t\tcase C:\n\t\t\t\treturn $as === $ds;\n\t\t\tcase D:\n\t\t\t\treturn $as === $es;\n\t\t\tcase E:\n\t\t\t\treturn $as !== $bs && $as !== $cs && $as !== $ds && $as !== $es;\n\t\t}\n\t}", "function correctAnswer() {\n\t}", "public function check_answer() {\n $result = new stdClass;\n $result->answerid = 0;\n $result->noanswer = false;\n $result->correctanswer = false;\n $result->isessayquestion = false; // Use this to turn off review button on essay questions\n $result->response = '';\n $result->newpageid = 0; // Stay on the page\n $result->studentanswer = ''; // Use this to store student's answer(s) in order to display it on feedback page\n $result->userresponse = null;\n $result->feedback = '';\n $result->nodefaultresponse = false; // Flag for redirecting when default feedback is turned off\n return $result;\n }", "protected function simpleAnswer($response) {\n $response = strtoupper($response);\n\n if ($response === 'Y' || $response === 'YES')\n return TRUE;\n else if ($response === 'N' || $response === 'NO')\n return FALSE;\n else\n return $this->promptMessage('yesorno') . PHP_EOL;\n }", "private function q13($answer) {\n\t\t// TODO: check its the *only* one\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(9) == A;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(11) == A;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(13) == A; // never true\n\t\t\tcase D:\n\t\t\t\treturn $this->a(15) == A;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(16) == A;\n\t\t}\n\t}", "private function q16($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(10) == D;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(10) == C;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(10) == B;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(10) == A;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(10) == E;\n\t\t}\n\t}", "public function get_correct_response() \n {\n return array('answer' => 0);\n }", "public function get_correct_response()\n {\n //if the question is a \"must eval true\" question, we can't easily determine the answer\n if($this->answer_mode == qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE) {\n return null;\n }\n\n // Evaluate the given answer, and return a correct-response array.\n $answer = $this->evaluate_answer(parent::get_correct_answer());\n return array('answer' => $answer->answer);\n }", "private function q9($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(10) == A;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(11) == B;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(12) == C;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(13) == D;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(14) == E;\n\t\t}\n\t}", "private function q12($answer) {\n\t\t$consonants = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == B | $a == C | $a == D) {\n\t\t\t\t$consonants++;\n\t\t\t}\n\t\t}\n\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $consonants % 2 === 0;\n\t\t\tcase B:\n\t\t\t\treturn $consonants % 2 === 1;\n\t\t\tcase C:\n\t\t\t\treturn $consonants === 1 || $consonants === 4 || $consonants === 9 || $consonants === 16;\n\t\t\tcase D:\n\t\t\t\treturn in_array($consonants, array(2, 3, 5, 7, 11, 13, 17, 19));\n\t\t\tcase E:\n\t\t\t\treturn $consonants % 5 === 0;\n\n\t\t}\n\t}", "public function compareAnswersPatterns($ap1, $ap2, $options = array()) {\n\n // Default answer-to-value function - identity.\n if( isset($options['answerToValue']) && $options['answerToValue'] ) {\n $answerToValue = $options['answerToValue'];\n } else {\n $answerToValue = function($a) { return $a; };\n }\n\n // Default distance function - discrete comparison.\n if( isset($options['distanceFunction']) ) {\n $distanceFunction = $options['distanceFunction'];\n } else {\n $distanceFunction = function($v1, $v2) {\n\treturn ( ($v1 == $v2) ? 0 : 1 );\n };\n }\n \n // Default probablility merging function - simple product.\n if( isset($options['prMergeFunction']) ) {\n $prMergeFunction = $options['prMergeFunction'];\n } else {\n $prMergeFunction = function($pr1, $pr2) {\n\treturn ($pr1 * $pr2);\n };\n }\n\n // Get all pairs.\n $allAnswerPairs =\n array_zip($ap1->answers, $ap2->answers);\n\n // Compute for each pair.\n $answerPairsSimilarity =\n array_map(\n\t\tfunction($answerPair) use ($answerToValue, $distanceFunction, $prMergeFunction) {\n\t\t // Extract answers.\n\t\t $answer1 = $answerPair[0];\n\t\t $answer2 = $answerPair[1];\n\n\t\t // Convert to values.\n\t\t $value1 = $answerToValue($answer1['id']);\n\t\t $value2 = $answerToValue($answer2['id']);\n\n\t\t // Get probabilities.\n\t\t $pr1 = $answer1['pr'];\n\t\t $pr2 = $answer2['pr'];\n\n\t\t // Compute their similarity.\n\t\t $d = $distanceFunction($value1, $value2);\n\t\t $pr = $prMergeFunction($pr1, $pr2);\n\t\t $similarity = (1 - $d) * $pr;\n\n\t\t //echo \"($value1, $value2 => $d, $similarity) \";\n\t\t \n\t\t return $similarity;\n\t\t},\n\t\t$allAnswerPairs\n\t\t);\n \n // Sum up.\n $totalSimilarity =\n array_sum($answerPairsSimilarity);\n\n return array(\"similarity\" => $totalSimilarity);\n }", "public function accept($answer_id=0)\n\t{\n\t\tif (!$answer_id)\n\t\t{\n\t\t\t$this->addError(Lang::txt('No answer ID provided.'));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Load the answer\n\t\t$answer = Response::oneOrFail($answer_id);\n\n\t\t// Mark it at the chosen one\n\t\t$answer->set('state', 1);\n\t\tif (!$answer->save())\n\t\t{\n\t\t\t$this->addError($answer->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Mark the question as answered\n\t\t$this->set('state', 1);\n\n\t\t// If banking is enabled\n\t\tif ($this->config('banking'))\n\t\t{\n\t\t\t// Accepted answer is same person as question submitter?\n\t\t\tif ($this->get('created_by') == $answer->get('created_by'))\n\t\t\t{\n\t\t\t\t$reward = Transaction::getAmount('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Remove hold\n\t\t\t\tTransaction::deleteRecords('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Make credit adjustment\n\t\t\t\t$BTL_Q = new Teller(User::get('id'));\n\t\t\t\t$BTL_Q->credit_adjustment($BTL_Q->credit_summary() - $reward);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$db = App::get('db');\n\n\t\t\t\t// Calculate and distribute earned points\n\t\t\t\t$AE = new Economy($db);\n\t\t\t\t$AE->distribute_points(\n\t\t\t\t\t$this->get('id'),\n\t\t\t\t\t$this->get('created_by'),\n\t\t\t\t\t$answer->get('created_by'),\n\t\t\t\t\t'closure'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Set the reward value\n\t\t\t$this->set('reward', 0);\n\t\t}\n\n\t\t// Save changes\n\t\treturn $this->save();\n\t}", "private function q20($answer) {\n\t\treturn $answer === E;\n\t}", "public function rateResponse($response)\n {\n \treturn in_array(strtolower($response), ['y', 'yes']);\n }", "public function matchScore(\\Jazzee\\Entity\\Answer $answer)\n {\n if ($answer->getPageStatus() == self::SKIPPED) {\n return;\n }\n if (!is_null($answer->getGREScore()) and !is_null($answer->getTOEFLScore())) {\n return; //we already have a match\n }\n $testType = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getJazzeeElement()->displayValue($answer);\n $registrationNumber = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER)->getJazzeeElement()->displayValue($answer);\n $testDate = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_DATE)->getJazzeeElement()->formValue($answer);\n $testMonth = date('m', strtotime($testDate));\n $testYear = date('Y', strtotime($testDate));\n\n $parameters = array(\n 'registrationNumber' => $registrationNumber,\n 'testMonth' => $testMonth,\n 'testYear' => $testYear\n );\n switch ($testType) {\n case 'GRE/GRE Subject':\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\GREScore')->findOneBy($parameters);\n if ($score) {\n $answer->setGreScore($score);\n }\n break;\n case 'TOEFL':\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\TOEFLScore')->findOneBy($parameters);\n if ($score) {\n $answer->setTOEFLScore($score);\n }\n break;\n default:\n throw new \\Jazzee\\Exception(\"Unknown test type: {$testType} when trying to match a score\");\n }\n }", "public function checkAnswer($answerID) {\r\n $correct = $this->answers->first()->getId() == $answerID;\r\n if($correct){\r\n $this->setRightAnswers($this->getRightAnswers()+1);\r\n }\r\n else{\r\n $this->setWrongAnswers($this->getWrongAnswers()+1);\r\n }\r\n return $correct;\r\n }", "public function determineResponseType(string $response): string\n {\n $wildcards = [\n 'weighted' => '{weight=(.+?)}',\n 'condition' => '/^\\*/',\n 'continue' => '/^\\^/',\n 'atomic' => '/-/',\n ];\n\n foreach ($wildcards as $type => $pattern) {\n if (@preg_match_all($pattern, $response, $matches)) {\n return $type;\n }\n }\n\n return 'atomic';\n }", "private function q4($answer) {\n\t\t$as = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == A) {\n\t\t\t\t$as++;\n\t\t\t}\n\t\t}\n\t\treturn $answer + 3 === $as;\n\t}", "function answer_status_class($answer)\n {\n if($answer['is_correct']) {\n return 'correct';\n } else if($answer['is_unanswered']) {\n return 'unanswered';\n } else {\n return 'incorrect';\n }\n }", "public function isCorrectAnswer() {\n\t\t$this->getCorrectAnswer();\n\t}", "public static function validateAnswer($answer)\n {\n //echo $answer.\" \".self::$answer;\n var_dump($answer);\n var_dump(self::$answer);\n if($answer == self::$answer)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "private function formatBoolean($answer)\n {\n if (!$answer) {\n return 'No';\n }\n\n return 'Yes';\n }", "public function answer()\n\t{\n\t\tif (!$this->typeResponseCode)\n\t\t\treturn $this->answerTwoHundred($this->data);\n\t\telse\n\t\t\treturn $this->answerThroughHeader($this->data);\n\t}" ]
[ "0.72651917", "0.6033109", "0.597804", "0.5946228", "0.59333867", "0.59280324", "0.58845097", "0.5880805", "0.58695847", "0.5847845", "0.5835745", "0.5813978", "0.5729295", "0.56283563", "0.552544", "0.5517053", "0.54978883", "0.5486746", "0.54657376", "0.5459888", "0.5443033", "0.5428007", "0.54162085", "0.53771013", "0.53735054", "0.53653324", "0.5340317", "0.5321481", "0.53121114", "0.5292937" ]
0.78834724
0
Inserts the varaibles for the given question text, then calls the basic formatter.
public function format_text($text, $format, $qa, $component, $filearea, $itemid) { //get a list of varaibles created by the initialization script $vars = json_decode($qa->get_last_qt_var('_vars')); $funcs = json_decode($qa->get_last_qt_var('_funcs')); $text = qtype_scripted_language_manager::format_text($text, $this->language, $vars, $funcs); //run the question text through the basic moodle formatting engine return parent::format_text($text, $format, $qa, $component, $filearea, $itemid); //Evaluate all of the question's inline code. $operations = array(2 => 'execute', 1=> 'evaluate'); foreach($operations as $bracket_level => $operation) { $interpreter = $this->create_interpreter($vars, $funcs); $text = $this->handle_inline_code($text, $bracket_level, $operation, $interpreter); } //run the question text through the basic moodle formatting engine return parent::format_text($text, $format, $qa, $component, $filearea, $itemid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatQA( $question, $answer ) {\n return \"> {$question}\\n{$answer}\";\n}", "function _insert( $text ) {\n $parts = explode(\":\", $text);\n $index = strtolower(trim($parts[0]));\n if( count($parts) == 1 ) {\n // {varname} - inserts value of varname\n return $this->_getVar($index);\n } \n else {\n switch($index) {\n case \"zen\":\n\t{\n\t // {zen:varname}\n\t $zen = &$this->_getZenObject();\n\t $n = trim($parts[1]);\n\t return $zen->getSetting(\"$n\")? $zen->getSetting(\"$n\") : \"\";\n\t}\n\tbreak;\n case \"list\":\n\t{\n\t // {list:varname:\"text\"+index+\"more text\"+value}\n\t $vars = $this->_getVar(trim($parts[1]));\n\t if( is_array($vars) ) {\n\t $txt = \"\";\n\t // make the string to show\n\t $str = $this->_parseString($parts[2]);\n\t // loop the list and make output text\n\t foreach($vars as $k=>$v) {\n $fv = $this->_getVar(\"field_value\");\n $fl = $this->_getVar(\"field_label\");\n\t $tmp=$str;\n\t if($fv==$k && strlen($fv) == strlen($k) || is_array($fv) && in_array($k, $fv) || \n ( is_array($fl) && in_array($k, $fl) ) ||\n (!is_array($fv) && !strlen($k) && !strlen($fv))) {\n\t $tmp = str_replace(\"{selected}\", \" selected\", $tmp);\n\t $tmp = str_replace(\"{checked}\", \" checked\", $tmp);\n\t } else {\n\t $tmp = str_replace(\"{selected}\", \"\", $tmp);\n\t $tmp = str_replace(\"{checked}\", \"\", $tmp);\n\t }\n\t $tmp = str_replace(\"{index}\", $k, $tmp);\n\t $txt .= str_replace(\"{value}\", $v, $tmp);\n\t }\n\t return $txt;\n\t }\n\t else {\n\t return \"\";\n\t }\n\t}\n\tbreak;\n case \"foreach\":\n\t{\n\t // {foreach:varname:\"text\"+value+\"text\"}\n\t $vars = $this->_getVar(trim($parts[1]));\n\t if( is_array($vars) ) {\n $sel = $this->_getVar(\"field_selected\");\n\t $txt = \"\";\n\t // parse the string\n\t $str = $this->_parseString($parts[2]);\n\t // create the output text\n\t foreach($vars as $v) {\n $selected = $sel && $sel == $v && strlen($sel) == strlen($v)? ' selected' : '';\n $s = str_replace(\"{selected}\", $selected, $str);\n\t $txt .= str_replace(\"{value}\", $v, $s);\n\t }\n\t return $txt;\n\t }\n\t else {\n\t return \"\";\n\t }\n\t}\n\tbreak;\n case \"include\":\n\t{\n\t // {include:template_name}\n\t $tmp = new zenTemplate(trim($parts[1]));\n\t $tmp->values( $this->_vars );\n\t return $tmp->process();\n\t}\n\tbreak;\n case \"if\":\n\t{\n\t // {if:field:\"text to print\"+field+\"text to print\"}\n\t // {if:field=something:\"text to print\"+field+\"more text\"}\n\t $p = trim($parts[1]);\n\t // determine if the if condition is true\n\t if( strpos($p,\"=\") > 0 ) {\n\t // there is an equals clause\n\t list($key,$val) = explode(\"=\",$parts[1]);\n\t $key = trim($key);\n\t $val = trim($val);\n\t $tf = ($this->_getVar($key) == $val);\n\t }\n\t else {\n\t $var = $this->_getVar($p);\n\t $tf = ( (is_array($var) && count($var)) || (strlen($var) > 0) );\n\t }\n\t // execute the query if we met if condition\n\t if( $tf ) {\n\t return $this->_parseString($parts[2]);\n\t }\n\t else {\n\t return \"\";\n\t }\n\t}\n\tbreak;\n }\n }\n // return something generic if we fall through\n return \"{invalid tag: $index}\";\n }", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function writequestion( $question ) {\n\t // question reflects database fields for general question and specific to type\n\t\n\t // initial string;\n\t $expout = \"\";\n\t\n\t // add comment\n\t $expout .= \"// question: $question->id \\n\";\n\n\t if ($question->id_category != \"\"){\n\t $expout .= \"\\$CATEGORY:$question->id_category\\n\";\n\t }\n\t\t\n\t // get question text format\n\t /*$textformat = $question->textformat;\n\t $question->text = \"\";\n\t if ($textformat!=FORMAT_MOODLE) {\n\t $question->text = text_format_name( (int)$textformat );\n\t $question->text = \"[$question->text]\";\n\t }*/\n\t $qtext_format = \"[\".$question->qtype.\"]\";\n\t // output depends on question type\n\t switch($question->qtype) {\n\t\t\tcase 'category' : {\n\t\t\t\t// not a real question, used to insert category switch\n\t\t\t\t$expout .= \"\\$CATEGORY: $question->category\\n\"; \n\t\t\t};break;\n\t\t\tcase 'title' : {\n\t\t\t\tif($question->prompt != '') $expout .= '::'.$this->repchar($question->prompt).'::';\n\t\t\t\t$expout .= $qtext_format;\n\t\t\t\t$expout .= $this->repchar( $question->quest_text);\n\t\t\t};break;\n\t\t case 'extended_text' : {\n\t\t $expout .= '::'.$this->repchar($question->prompt).'::';\n\t\t $expout .= $qtext_format;\n\t\t $expout .= $this->repchar( $question->quest_text);\n\t\t $expout .= \"{}\\n\";\n\t\t };break;\n\t\t case 'truefalse' : {/*\n\t\t $trueanswer = $question->options->answers[$question->options->trueanswer];\n\t\t $falseanswer = $question->options->answers[$question->options->falseanswer];\n\t\t if ($trueanswer->fraction == 1) {\n\t\t $answertext = 'TRUE';\n\t\t $right_feedback = $trueanswer->feedback;\n\t\t $wrong_feedback = $falseanswer->feedback;\n\t\t } else {\n\t\t $answertext = 'FALSE';\n\t\t $right_feedback = $falseanswer->feedback;\n\t\t $wrong_feedback = $trueanswer->feedback;\n\t\t }\n\t\t\n\t\t $wrong_feedback = $this->repchar($wrong_feedback);\n\t\t $right_feedback = $this->repchar($right_feedback);\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\".$this->repchar( $answertext );\n\t\t if ($wrong_feedback) {\n\t\t $expout .= \"#\" . $wrong_feedback;\n\t\t } else if ($right_feedback) {\n\t\t $expout .= \"#\";\n\t\t }\n\t\t if ($right_feedback) {\n\t\t $expout .= \"#\" . $right_feedback;\n\t\t }\n\t\t $expout .= \"}\\n\";*/\n\t\t }//;break;\n\t\t \n\t\t case 'shortanswer' : {/*\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t foreach($question->options->answers as $answer) {\n\t\t $weight = 100 * $answer->score_correct;\n\t\t $expout .= \"\\t=%\".$weight.\"%\".$this->repchar( $answer->text ).\"#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t }\n\t\t $expout .= \"}\\n\";*/\n\t\t }//;break;\n\t\t\tcase 'choice' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\t\n\t\t\t\tforeach($question->answers as $answer) {\n\t\t\t\t\tif (($answer->score_correct == 1) || ($answer->score_correct == 0 && $answer->is_correct == 1) ) {\n\t\t\t\t\t\t$answertext = '=';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct > 1) {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"=%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct==0) {\n\t\t\t\t\t\t$answertext = '~';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"~%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\t\".$answertext.$this->repchar( $answer->text );\n\t\t\t\t\tif ($answer->comment!=\"\") {\n\t\t\t\t\t\t$expout .= \"#\".$this->repchar( $answer->comment );\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t\t};break;\n\t\t\tcase 'choice_multiple' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\t\n\t\t\t\tforeach($question->answers as $answer) {\n\t\t\t\t\tif ($answer->score_correct==1) {\n\t\t\t\t\t\t$answertext = '=';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct==0) {\n\t\t\t\t\t\t$answertext = '~';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"~%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\t\".$answertext.$this->repchar( $answer->text );\n\t\t\t\t\tif ($answer->comment!=\"\") {\n\t\t\t\t\t\t$expout .= \"#\".$this->repchar( $answer->comment );\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t\t};break;\n\t\t case 'associate' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\tforeach($question->answers as $i => $subquestion) {\n\t\t\t\t\t$expout .= \"\\t=\".$this->repchar( $subquestion->text ).\" -> \".$this->repchar( $question->extra_info[$i]->text ).\"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t };break;\n\t\t case NUMERICAL:\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{#\\n\";\n\t\t foreach ($question->options->answers as $answer) {\n\t\t if ($answer->text != '') {\n\t\t $percentage = '';\n\t\t if ($answer->score_correct < 1) {\n\t\t $pval = $answer->score_correct * 100;\n\t\t $percentage = \"%$pval%\";\n\t\t }\n\t\t $expout .= \"\\t=$percentage\".$answer->text.\":\".(float)$answer->tolerance.\"#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t } else {\n\t\t $expout .= \"\\t~#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t }\n\t\t }\n\t\t $expout .= \"}\\n\";\n\t\t break;\n\t\t case DESCRIPTION:\n\t\t $expout .= \"// DESCRIPTION type is not supported\\n\";\n\t\t break;\n\t\t case MULTIANSWER:\n\t\t $expout .= \"// CLOZE type is not supported\\n\";\n\t\t break;\n\t\t default:\n\t\t \n\t\t\t\treturn false;\n\t\t}\n\t // add empty line to delimit questions\n\t $expout .= \"\\n\";\n\t return $expout;\n\t}", "function printTFQuestionForm() {\n\tglobal $tool_content, $langTitle, $langSurveyStart, $langSurveyEnd, \n\t\t$langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langQuestion, $langCreate, $langSurveyMoreQuestions, \n\t\t$langSurveyCreated, $MoreQuestions;\n\t\t\n\t\tif(isset($_POST['SurveyName'])) $SurveyName = htmlspecialchars($_POST['SurveyName']);\n\t\tif(isset($_POST['SurveyEnd'])) $SurveyEnd = htmlspecialchars($_POST['SurveyEnd']);\n\t\tif(isset($_POST['SurveyStart'])) $SurveyStart = htmlspecialchars($_POST['SurveyStart']);\n\t\t\n//\tif ($MoreQuestions == 2) {\n\tif ($MoreQuestions == $langCreate) {\n\t\tcreateTFSurvey();\n\t} else {\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t\t<input type=\"hidden\" value=\"2\" name=\"UseCase\">\n\t\t<table>\n\t\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\ncData;\n\t\t$counter = 0;\n\t\tforeach (array_keys($_POST) as $key) {\n\t\t\t++$counter;\n\t\t $$key = $_POST[$key];\n\t\t if (($counter > 4 )&($counter < count($_POST)-1)) {\n\t\t\t\t$tool_content .= \"<tr><td>$langQuestion</td><td><input type='text' name='question{$counter}' value='${$key}'></td></tr>\"; \n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$tool_content .= <<<cData\n\t\t\t<tr><td>$langQuestion</td><td><input type='text' name='question'></td></tr>\n\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\ncData;\n\t}\n}", "function formatQAs() {\n $QAs = func_get_args();\n $outputArr = array();\n foreach( $QAs as $QA ) {\n array_push( $outputArr, formatQA($QA[0], $QA[1]) );\n }\n // put a few line breaks between each set of question/answer\n return implode( QASeparator(), $outputArr );\n}", "function run()\n\t{\n\t\trequire_code('quiz');\n\n\t\t$questions=array();\n\n\t\t$text=post_param('text');\n\t\t$type=post_param('type');\n\n\t\t$_qs=explode(chr(10).chr(10),$text);\n\t\t$qs=array();\n\t\tforeach ($_qs as $q)\n\t\t{\n\t\t\t$q=trim($q);\n\t\t\tif ($q!='') $qs[]=$q;\n\t\t}\n\t\t$num_q=0;\n\n\t\t$qs2=array();\n\t\tforeach ($qs as $i=>$q)\n\t\t{\n\t\t\t$_as=explode(chr(10),$q);\n\t\t\t$as=array();\n\t\t\tforeach ($_as as $a)\n\t\t\t{\n\t\t\t\tif ($a!='') $as[]=$a;\n\t\t\t}\n\t\t\t$q=array_shift($as);\n\t\t\t$matches=array();\n\t\t\t//if (preg_match('#^(\\d+)\\)?(.*)#',$q,$matches)===false) continue;\n\t\t\tif (preg_match('#^(.*)#',$q,$matches)===false) continue;\n\t\t\tif (count($matches)==0) continue;\n\n\t\t\t$implicit_question_number=$i;//$matches[1];\n\n\t\t\t$qs2[$implicit_question_number]=$q.chr(10).implode(chr(10),$as);\n\t\t}\n\t\tksort($qs2);\n\n\t\tforeach (array_values($qs2) as $i=>$q)\n\t\t{\n\t\t\t$_as=explode(chr(10),$q);\n\t\t\t$as=array();\n\t\t\tforeach ($_as as $a)\n\t\t\t{\n\t\t\t\tif ($a!='') $as[]=$a;\n\t\t\t}\n\t\t\t$q=array_shift($as);\n\t\t\t$matches=array();\n\t\t\t//if (preg_match('#^(\\d+)\\)?(.*)#',$q,$matches)===false) continue;\n\t\t\tif (preg_match('#^(.*)#',$q,$matches)===false) continue;\n\t\t\tif (count($matches)==0) continue;\n\t\t\t$question=trim($matches[count($matches)-1]);\n\t\t\t$long_input_field=(strpos($question,' [LONG]')!==false)?1:0;\n\t\t\t$question=str_replace(' [LONG]','',$question);\n\t\t\t$num_choosable_answers=(strpos($question,' [*]')!==false)?count($as):((count($as)>0)?1:0);\n\t\t\t$question=str_replace(' [*]','',$question);\n\t\t\t$required=(strpos($question,' [REQUIRED]')!==false)?1:0;\n\t\t\t$question=str_replace(' [REQUIRED]','',$question);\n\n\t\t\t// Now we add the answers\n\t\t\t$answers=array();\n\t\t\tforeach ($as as $x=>$a)\n\t\t\t{\n\t\t\t\t$is_correct=((($x==0) && (strpos($qs2[$i],' [*]')===false) && ($type!='SURVEY')) || (strpos($a,' [*]')!==false))?1:0;\n\t\t\t\t$a=str_replace(' [*]','',$a);\n\n\t\t\t\tif (substr($a,0,1)==':') continue;\n\n\t\t\t\t$answers[]=array(\n\t\t\t\t\t'id'=>$x,\n\t\t\t\t\t'q_answer_text'=>$a,\n\t\t\t\t\t'q_is_correct'=>$is_correct,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$questions[]=array(\n\t\t\t\t'id'=>$i,\n\t\t\t\t'q_long_input_field'=>$long_input_field,\n\t\t\t\t'q_num_choosable_answers'=>$num_choosable_answers,\n\t\t\t\t'q_question_text'=>$question,\n\t\t\t\t'answers'=>$answers,\n\t\t\t\t'q_required'=>$required,\n\t\t\t);\n\n\t\t\t$num_q++;\n\t\t}\n\n\t\t$preview=render_quiz($questions);\n\n\t\treturn array(do_template('FORM',array('SUBMIT_NAME'=>'','TEXT'=>'','URL'=>'','HIDDEN'=>'','FIELDS'=>$preview)),NULL);\n\t}", "function render_text_question($label, $input, $additionaltext=\"\", $numeric=false, $extra=\"\", $current=\"\")\n {\n\t?>\n\t<div class=\"Question\" id = \"pixelwidth\">\n\t\t<label><?php echo $label; ?></label>\n\t\t<div>\n\t\t<?php\n\t\techo \"<input name=\\\"\" . $input . \"\\\" type=\\\"text\\\" \". ($numeric?\"numericinput\":\"\") . \"\\\" value=\\\"\" . $current . \"\\\"\" . $extra . \"/>\\n\";\n\t\t\t\n\t\techo $additionaltext;\n\t\t?>\n\t\t</div>\n\t</div>\n\t<div class=\"clearerleft\"> </div>\n\t<?php\n\t}", "function injectAnswers($string, $original, $project, &$warnings=null) {\n // each warning displayed. This prevents repeat rendering.\n if (is_null($warnings)) {\n $warnings = array();\n }\n $string = preg_replace(\n '|\\[--box\\|(?<name>\\w+)--](.*?)\\[--endbox--]|s',\n \"\",\n $string\n );\n\n $tmplb = TwigManager::getInstance()->load(\"project/recap_fields.html\");\n\n return preg_replace_callback('/\\[--(.*?)\\--]/',\n function ($matches) use ($original, $project, $tmplb, &$warnings) {\n $parts = explode('|', $matches[1]);\n\n $out = \"\";\n if (substr($parts[0], 0, 15) == \"multiple-answer\") {\n $multiparts = explode('-', $parts[0]);\n $multipart = array_pop($multiparts);\n $out = $tmplb->renderBlock(\"multianswer\", array(\n 'original' => $original,\n 'multipart' => $multipart,\n 'parts' => $parts\n ));\n $critname = \"multianswer-\" . $multipart;\n } elseif ($parts[0] == 'customform') {\n $out = customform($parts[1], $original, $project, true);\n } else {\n\n switch ($parts[0]) {\n case \"prev\":\n case \"box\":\n case \"endbox\":\n case \"choicebutton\":\n case \"choicepanel\":\n case \"endchoicepanel\":\n return \"\";\n break;\n case \"answer\":\n $out = $tmplb->renderBlock('answer', array('answer' => $original['answer']));\n $critname = \"answer\";\n break;\n case \"radio\":\n if ($original[$parts[1]] == $parts[2]) {\n $out = $tmplb->renderBlock('radio', array('parts' => $parts));\n }\n $critname = $parts[1];\n break;\n case \"check\":\n if (@$original[$parts[1]]) {\n $out = $tmplb->renderBlock('check', array('parts' => $parts));\n }\n $critname = $parts[1];\n break;\n case \"array\":\n $out = $tmplb->renderBlock('array', array('answers' => $original[$parts[1]], 'name' => $parts[1]));\n $critname = $parts[1];\n break;\n default:\n $out = $tmplb->renderBlock('default', array('name' => $parts[1], 'answer' => $original[$parts[1]]));\n $critname = $parts[1];\n break;\n }\n }\n foreach($warnings as &$warn) {\n foreach ($warn['criteria'] as $criterion) {\n if ($criterion['name'] == $critname) {\n if (!@$warn['done']) {\n $warn['done'] = 1;\n $out .= $tmplb->renderBlock('warning', array('warn' => $warn, 'name' => $critname));\n }\n break;\n }\n }\n }\n return $out;\n },\n $string\n );\n }", "private function createInput($question)\n\t{\n\t\tswitch($question->InputType)\n\t\t{\n\t\t\tcase \"radio\":\n\t\t\tcase \"checkbox\":\n\t\t\t\tprint \"<b>\" . $question->Number . \") \";\n\t\t\t\tprint $question->Text . \"</b> \";\n\t\t\t\tprint '<em>(' . $question->Description . ')</em><br />';\n\t\t\t\tforeach($question->aAnswer as $answer)\n\t\t\t\t{//print data for each\n\t\t\t\t\tprint '<input type=\"' . $question->InputType . '\" name=\"q_' . $question->QuestionID . '[]\" value=\"' . $answer->AnswerID . '\" > ';\n\t\t\t\t\tprint $answer->Text . \" \";\n\t\t\t\t\tif($answer->Description != \"\")\n\t\t\t\t\t{//only print description if not empty\n\t\t\t\t\t\tprint \"<em>(\" . $answer->Description . \")</em>\";\n\t\t\t\t\t}\n\t\t\t\t\tprint '<br />';\t\n\t\t\t\t}\n\t\t\t\tbreak;\t\n\t\t\n\t\t\tcase \"select\":\n\t\t\t\tprint \"<b>\" . $question->Number . \") \";\n\t\t\t\tprint $question->Text . \"</b> \";\n\t\t\t\tprint '<em>(' . $question->Description . ')</em><br />';\n\t\t\t\tprint '<select name=\"q_' . $question->QuestionID . '\">';\n\t\t\t\tforeach($question->aAnswer as $answer)\n\t\t\t\t{//print data for each\n\t\t\t\t\tprint '<option value=\"' . $answer->AnswerID . '\" >' . $answer->Text;\n\t\t\t\t\tif($answer->Description != \"\")\n\t\t\t\t\t{//only print description if not empty\n\t\t\t\t\t\tprint \" <em>(\" . $answer->Description . \")</em>\";\n\t\t\t\t\t}\n\t\t\t\t\tprint '</option>';\t\n\t\t\t\t}\n\t\t\t\tprint '</select><br />';\n\t\t\t\tbreak;\n\t\t}\t\t\t\t\n\t}", "function setup_question($question,$answer){\n $htmlStr = '<p class=\"question\">'.$question.'</p>';\n $htmlStr .= '<p class=\"answer\">'.nl2br($answer).'</p>';\n return $htmlStr;\n}", "function formatNewTextFRAnswer() {\n $format_string = \"\";\n $format_string .= \"<p class='answer'><strong>Answer: </strong> \";\n $format_string .= \"<input type='text' name='answer' id='editAnswerText'></input> </p>\";\n \n return $format_string;\n}", "function print_dataset_definitions_category($form) {\n global $CFG, $DB;\n $datasetdefs = array();\n $lnamemax = 22;\n $namestr =get_string('name', 'quiz');\n $minstr=get_string('min', 'quiz');\n $maxstr=get_string('max', 'quiz');\n $rangeofvaluestr=get_string('minmax','qtype_datasetdependent');\n $questionusingstr = get_string('usedinquestion','qtype_calculated');\n $itemscountstr = get_string('itemscount','qtype_datasetdependent');\n $text ='';\n if (!empty($form->category)) {\n list($category) = explode(',', $form->category);\n $sql = \"SELECT i.*,d.*\n FROM {question_datasets} d,\n {question_dataset_definitions} i\n WHERE i.id = d.datasetdefinition\n AND i.category = ?;\n \" ;\n if ($records = $DB->get_records_sql($sql, array($category))) {\n foreach ($records as $r) {\n $sql1 = \"SELECT q.*\n FROM {question} q\n WHERE q.id = ?\n \";\n if ( !isset ($datasetdefs[\"$r->type-$r->category-$r->name\"])){\n $datasetdefs[\"$r->type-$r->category-$r->name\"]= $r;\n }\n if ($questionb = $DB->get_records_sql($sql1, array($r->question))) {\n $datasetdefs[\"$r->type-$r->category-$r->name\"]->questions[$r->question]->name =$questionb[$r->question]->name ;\n }\n }\n }\n }\n if (!empty ($datasetdefs)){\n\n $text =\"<table width=\\\"100%\\\" border=\\\"1\\\"><tr><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\" >$namestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$rangeofvaluestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$itemscountstr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$questionusingstr</th></tr>\";\n foreach ($datasetdefs as $datasetdef){\n list($distribution, $min, $max,$dec) = explode(':', $datasetdef->options, 4);\n $text .=\"<tr><td valign=\\\"top\\\" align=\\\"center\\\"> $datasetdef->name </td><td align=\\\"center\\\" valign=\\\"top\\\"> $min <strong>-</strong> $max </td><td align=\\\"right\\\" valign=\\\"top\\\">$datasetdef->itemcount&nbsp;&nbsp;</td><td align=\\\"left\\\">\";\n foreach ($datasetdef->questions as $qu) {\n //limit the name length displayed\n if (!empty($qu->name)) {\n $qu->name = (strlen($qu->name) > $lnamemax) ?\n substr($qu->name, 0, $lnamemax).'...' : $qu->name;\n } else {\n $qu->name = '';\n }\n $text .=\" &nbsp;&nbsp; $qu->name <br/>\";\n }\n $text .=\"</td></tr>\";\n }\n $text .=\"</table>\";\n }else{\n $text .=get_string('nosharedwildcard', 'qtype_calculated');\n }\n return $text ;\n }", "function writeTextQuestion ($id, $name, $label, $message, $placeholder, $branchExit, $additionalClass) {\n\tglobal $varchars;\n\tif (!empty($branchExit)) {\n\t\techo '<div class=\"step\" data-state=\"'.$branchExit.'\">';\n\t}\n\telse {\n\t\techo '<div class=\"step\" id=\"'.$id.'\">';\n\t}\n\techo '<div class=\"section\"><div class=\"card-header m-b-0\">\n\t\t\t<label for=\"'.$id.'\">'.$label.'</label>\n\t\t\t\t<p>'.$message.'</p>\n\t\t\t\t<hr class=\"card-line\" align=\"left\">\n\t\t</div><div class=\"card-body m-b-30\">';\n\t\t$inputClass = 'form-control';\n\t\tif (!empty($additionalClass)) {\n\t\t\t$inputClass = 'form-control '. $additionalClass;\n\t\t}\n\t\t\t\techo '<input type=\"text\" name=\"'.$name.'\" id=\"input'.$id.'\" class=\"'.$inputClass.'\" placeholder=\"'.$placeholder.'\" ';\n\t\t\t\tif (isset($varchars[$id])) {\n \techo 'value=\"'.$varchars[$id].'\">';\n }\n else {\n \techo '>';\n }\n\techo '</div></div></div>';\n}", "function ParseInput($vars,&$a_values,$s_line_feed)\n{\n global $SPECIAL_FIELDS,$SPECIAL_VALUES,$FORMATTED_INPUT;\n\n $output = \"\";\n //\n // scan the array of values passed in (name-value pairs) and\n // produce slightly formatted (not HTML) textual output\n //\n while (list($name,$raw_value) = each($vars))\n {\n if (is_string($raw_value))\n //\n // truncate the string\n //\n \t$raw_value = substr($raw_value,0,MAXSTRING);\n $value = trim(Strip($raw_value));\n if (in_array($name,$SPECIAL_FIELDS))\n $SPECIAL_VALUES[$name] = $value;\n\t\telse\n\t\t{\n\t\t\t$a_values[$name] = $raw_value;\n \t$output .= \"$name: $value\".$s_line_feed;\n\t\t}\n array_push($FORMATTED_INPUT,\"$name: '$value'\");\n }\n return ($output);\n}", "public function formatOfQuestion($questionInfo)\r\n {\r\n return $questionInfo['question'] . \"\\n\\n\" . implode(\" \\n \", $questionInfo['item']) . \"\\n\\n\" . $questionInfo['answer'] . \"\\n\\n\" . \"**********\" . \"\\n\\n\";\r\n }", "function render_split_text_question($label, $inputs = array(), $additionaltext=\"\", $numeric=false, $extra=\"\", $currentvals=array())\n {\n\t?>\n\t<div class=\"Question\" id = \"pixelwidth\">\n\t\t<label><?php echo $label; ?></label>\n\t\t<div>\n\t\t<?php\n\t\tforeach ($inputs as $inputname=>$inputtext)\n\t\t\t{\n\t\t\techo \"<div class=\\\"SplitSearch\\\">\" . $inputtext . \"</div>\\n\";\n\t\t\techo \"<input name=\\\"\" . $inputname . \"\\\" class=\\\"SplitSearch\\\" type=\\\"text\\\"\". ($numeric?\"numericinput\":\"\") . \"\\\" value=\\\"\" . $currentvals[$inputname] . \"\\\"\" . $extra . \" />\\n\";\n\t\t\t}\n\t\techo $additionaltext;\n\t\t?>\n\t\t</div>\n\t</div>\n\t<div class=\"clearerleft\"> </div>\n\t<?php\n\t}", "function display_short_answer_form($question_num){\r\n include(\"variables.inc\");\r\n\tif($question_num == 0) $question_num = 1;\r\n echo(\"\\t<TABLE WIDTH=\\\"$table_width\\\">\\n\");\r\n echo(\"\\t\\t<TR>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"50\\\"><P>\" . $question_num . \")</P></TD>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"580\\\"> \\n\\t\\t\\t\\t\\n\");\r\n echo(\"\\t\\t\\t\\t<INPUT TYPE=\\\"text\\\" NAME=\\\"question_A\\\" SIZE=\\\"85\\\">\\n\");\r\n echo(\"\\t\\t\\t</TD>\\n\");\r\n echo(\"\\t\\t</TR>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"50\\\">Solution:</TD>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"580\\\"> \\n\\t\\t\\t\\t\\n\");\r\n echo(\"\\t\\t\\t\\t<TEXTAREA NAME=\\\"answer_A\\\" cols=\\\"65\\\" rows=\\\"10\\\"></textarea>\\n\");\r\n echo(\"\\t\\t\\t</TD>\\n\");\r\n echo(\"\\t\\t</TR>\\n\");\r\n echo(\"\\t\\t<TD COLSPAN=\\\"2\\\"></TD>\\n\");\r\n echo(\"\\t\\t</TR>\\n\");\r\n echo(\"\\t</TABLE>\\n\"); \r\n}", "function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {\n // virtual type for printing\n $virtualqtype = $this->get_virtual_qtype();\n if($unit = $virtualqtype->get_default_numerical_unit($question)){\n $unit = $unit->unit;\n } else {\n $unit = '';\n }\n // We modify the question to look like a numerical question\n $numericalquestion = fullclone($question);\n foreach ($numericalquestion->options->answers as $key => $answer) {\n $answer = fullclone($numericalquestion->options->answers[$key]);\n $numericalquestion->options->answers[$key]->answer = $this->substitute_variables_and_eval($answer->answer,\n $state->options->dataset);\n }\n $numericalquestion->questiontext = $this->substitute_variables(\n $numericalquestion->questiontext, $state->options->dataset);\n //evaluate the equations i.e {=5+4)\n $qtext = \"\";\n $qtextremaining = $numericalquestion->questiontext ;\n while (ereg('\\{=([^[:space:]}]*)}', $qtextremaining, $regs1)) {\n $qtextsplits = explode($regs1[0], $qtextremaining, 2);\n $qtext =$qtext.$qtextsplits[0];\n $qtextremaining = $qtextsplits[1];\n if (empty($regs1[1])) {\n $str = '';\n } else {\n if( $formulaerrors = qtype_calculated_find_formula_errors($regs1[1])){\n $str=$formulaerrors ;\n }else {\n eval('$str = '.$regs1[1].';');\n }\n }\n $qtext = $qtext.$str ;\n }\n $numericalquestion->questiontext = $qtext.$qtextremaining ; // end replace equations\n $virtualqtype->print_question_formulation_and_controls($numericalquestion, $state, $cmoptions, $options);\n }", "function processFormatString()\n\t{\n\t\t// of date followed by event title.\n\t\tif ($this->customFormatStr == null)\n\t\t\t$this->customFormatStr = $this->defaultfFormatStr;\n\t\telse\n\t\t{\n\t\t\t$this->customFormatStr = preg_replace('/^\"(.*)\"$/', \"\\$1\", $this->customFormatStr);\n\t\t\t$this->customFormatStr = preg_replace(\"/^'(.*)'$/\", \"\\$1\", $this->customFormatStr);\n\t\t\t// escape all \" within the string\n\t\t\t// $customFormatStr = preg_replace('/\"/','\\\"', $customFormatStr);\n\t\t}\n\n\t\t// strip out event variables and run the string thru an html checker to make sure\n\t\t// it is legal html. If not, we will not use the custom format and print an error\n\t\t// message in the module output. This functionality is not here for now.\n\t\t// parse the event variables and reformat them into php syntax with special handling\n\t\t// for the startDate and endDate fields.\n\t\t//asdbg_break();\n\t\t// interpret linefeed as <br /> if not disabled\n\t\tif (!$this->modparams->get(\"modlatest_ignorebr\", 0))\n\t\t{\n\t\t\t$customFormat = nl2br($this->customFormatStr);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$customFormat = $this->customFormatStr;\n\t\t}\n\n\t\t$keywords = array(\n\t\t\t'content', 'eventDetailLink', 'createdByAlias', 'color',\n\t\t\t'createdByUserName', 'createdByUserEmail', 'createdByUserEmailLink',\n\t\t\t'eventDate', 'endDate', 'startDate', 'title', 'category', 'calendar',\n\t\t\t'contact', 'addressInfo', 'location', 'extraInfo',\n\t\t\t'countdown', 'categoryimage', 'duration', 'siteroot', 'sitebase', 'allCategoriesColoured', 'allCategorieSlugs',\n\t\t\t'today', 'tomorrow'\n\t\t);\n\t\t$keywords_or = implode('|', $keywords);\n\t\t$whsp = '[\\t ]*'; // white space\n\t\t$datefm = '\\([^\\)]*\\)'; // date formats\n\t\t//$modifiers\t= '(?::[[:alnum:]]*)';\n\n\t\t$pattern = '/(\\$\\{' . $whsp . '(?:' . $keywords_or . ')(?:' . $datefm . ')?' . $whsp . '\\})/'; // keyword pattern\n\t\t$cond_pattern = '/(\\[!?[[:alnum:]]+:[^\\]]*])/'; // conditional string pattern e.g. [!a: blabla ${endDate(%a)}]\n\t\t// tokenize conditional strings\n\t\t$splitTerm = preg_split($cond_pattern, $customFormat, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\n\t\t$this->splitCustomFormat = array();\n\t\tforeach ($splitTerm as $key => $value)\n\t\t{\n\t\t\tif (preg_match('/^\\[(.*)\\]$/', $value, $matches))\n\t\t\t{\n\t\t\t\t// remove outer []\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $matches[1];\n\t\t\t\t// split condition\n\t\t\t\tpreg_match('/^([^:]*):(.*)$/', $this->splitCustomFormat[$key]['data'], $matches);\n\t\t\t\t$this->splitCustomFormat[$key]['cond'] = $matches[1];\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $matches[2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $value;\n\t\t\t}\n\t\t\t// tokenize into array\n\t\t\t$this->splitCustomFormat[$key]['data'] = preg_split($pattern, $this->splitCustomFormat[$key]['data'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\t\t}\n\n\t\t// cleanup, remove white spaces from key words, seperate date parm string and modifier into array;\n\t\t// e.g. ${ keyword ( 'aaaa' ) } => array('keyword', 'aaa',)\n\t\tforeach ($this->splitCustomFormat as $ix => $yy)\n\t\t{\n\t\t\tforeach ($this->splitCustomFormat[$ix]['data'] as $keyToken => $customToken)\n\t\t\t{\n\t\t\t\tif (preg_match('/\\$\\{' . $whsp . '(' . $keywords_or . ')(' . $datefm . ')?' . $whsp . '}/', trim($customToken), $matches))\n\t\t\t\t{\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken] = array();\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken]['keyword'] = stripslashes($matches[1]);\n\t\t\t\t\tif (isset($matches[2]))\n\t\t\t\t\t{\n\t\t\t\t\t\t// ('aaa') => aaa\n\t\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken]['dateParm'] = preg_replace('/^\\([\"\\']?(.*)[\"\\']?\\)$/', \"\\$1\", stripslashes($matches[2]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken] = stripslashes($customToken);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "static function drawQuestion($args)\n\t{\n\t\t$currentUserID = get_current_user_id();\n\t\t\n\t\t\n\t\t// Get Defaults\n\t\t$defaults = ekQuiz::$defaults;\n\t\t\n\t\tforeach($args as $key => $value){$$key = $value;} # Turn all atts into variables of Key name\n\t\t\n\t\tif($buttonText==\"\")\n\t\t{\n\t\t\t$buttonText=$defaults['buttonText'];\n\t\t}\n\t\t\n\t\t// Add a text area or not\n\t\t$addTextarea = get_post_meta($questionID, \"addTextarea\", true);\n\t\t\n\t\t//if($correctFeedback==\"\"){$correctFeedback = get_post_meta($questionID, \"correctFeedback\", true);}\n\n\t\t$randomKey = $args['randomKey'];\t\t\n\t\t\n\t\t//$qStr='<div id=\"ek-question-'.$questionID.'-'.$randomKey.'\">';\n\t\t$qStr='<div>';\n\t\t\n\t\t$qStr.= apply_filters('the_content', get_post_field('post_content', $questionID));\n\t\t\n\t\t// Auto Save the response if its a text box\n\t\t$saveResponse=false;\n\t\tif($addTextarea==\"on\")\n\t\t{\n\t\t\t$saveResponse=true;\n\t\t}\n\t\t\n\t\t\n\t\t// Add the Vars to the Args to pass via JSON to ajax function\n\t\t$args['randomKey'] = $randomKey;\n\t\t$args['userID'] = $currentUserID;\n\t\t$args['saveResponse'] = $saveResponse;\n\t\t$args['qType'] = self::$qType;\n\t\t\t\t\t\n\t\t// Create array to pass to JS\n\t\t$passData = htmlspecialchars(json_encode($args));\t\n\t\t\n\t\tif($addTextarea==\"on\")\n\t\t{\n\t\t\n\t\t\t$userResponseArray = ekQuiz_queries::getUserResponse($questionID, $currentUserID);\n\t\t\t$userResponse = stripslashes($userResponseArray['userResponse']);\n\t\t\t//$userResponse = apply_filters('the_content', $userResponseArray['userResponse']);\n\n\t\t\n\t\t\n\t\t\t$editor_settings = array\n\t\t\t(\n\t\t\t\t\"media_buttons\"\t=> false, \n\t\t\t\t\"textarea_rows\"\t=> 6,\n\t\t\t\t\"editor_class\"\t=> \"ek-reflection-editor\",\n\t\t\t\t\"tinymce\"\t\t=> array(\n\t\t\t\t'toolbar1'\t=> 'bold,italic,underline,bullist,numlist,forecolor,undo,redo',\n\t\t\t\t'toolbar2'\t=> ''\n\t\t\t\t)\n\t\t\t);\t\t\t\t\t\n\t\t\t\n\t\t\tob_start();\n\t\t\twp_editor($userResponse, 'reflection_'.$questionID.'-'.$randomKey, $editor_settings);\t\t\n\t\t\t$qStr.= ob_get_contents();\n\t\t\tob_end_clean();\n\t\t}\n\t\t\t\n\t\t\t\t\t\n\t\t// Create blank div for feedback fro this qType. unique to reflection as we don't want to recreate textbox\n\t\t$qStr.='<div id=\"reflectionSavedFeedback_'.$questionID.'-'.$randomKey.'\" class=\"reflectionFeedback\">Entry Saved</div>';\n\t\t$qStr.='<div id=\"reflectionFeedback_'.$questionID.'-'.$randomKey.'\" class=\"reflectionSavedFeebdack\">Entry Saved</div>';\t\t\n\t\t\n\t\t$qStr.='<div class=\"ekQuizButtonWrap\" id=\"ekQuizButtonWrap_'.$questionID.'_'.$randomKey.'\">';\n\t\t$qStr.='<input type=\"button\" value=\"'.$buttonText.'\" class=\"ekQuizButton\" onclick=\"javascript:singleQuestionSubmit(\\''.$passData.'\\')\";/>';\n\t\t$qStr.='</div>';\n\t\t\n\t\t// Hide the Visual Tab\n\t\t$qStr.='\t\t\n\t\t\t<style>\n\t\t\t.wp-editor-tools, .post .wp-editor-tools {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t</style>\n\t\t';\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Close the Question div wrap\n\t\t$qStr.='</div>';\n\t\t\n\t\t\n\t\t\n\t\treturn $qStr;\n\t\n\t\t\n\t\t\n\t\t\n\t}", "function readquestion($lines) {\n \t// converts it into a question object suitable for processing and insertion.\n\n $question = $this->defaultquestion();\n $comment = NULL;\n \n // define replaced by simple assignment, stop redefine notices\n $gift_answerweight_regex = \"^%\\-*([0-9]{1,2})\\.?([0-9]*)%\"; \n\n // REMOVED COMMENTED LINES and IMPLODE\n foreach ($lines as $key => $line) {\n $line = trim($line);\n if (substr($line, 0, 2) == \"//\") {\n $lines[$key] = \" \";\n }\n }\n\n $text = trim(implode(\" \", $lines));\n\n if ($text == \"\") {\n return false;\n }\n\n // Substitute escaped control characters with placeholders\n $text = $this->escapedchar_pre($text);\n\n // Look for category modifier ---------------------------------------------------------\n if (ereg( '^\\$CATEGORY:', $text)) {\n // $newcategory = $matches[1];\n $newcategory = trim(substr( $text, 10 ));\n $newcategory = trim(substr( $newcategory, 0, strpos($newcategory, \"::\")));\n\t\t\t\n $question->setCategoryFromName($newcategory);\n $text = trim(substr($text, 10+strlen($newcategory)));\n \n // build fake question to contain category\n \n \t// XXX: create a category !\n //return true;\n }\n \n // QUESTION NAME parser --------------------------------------------------------------\n if (substr($text, 0, 2) == \"::\") {\n $text = substr($text, 2);\n\n $namefinish = strpos($text, \"::\");\n if ($namefinish === false) {\n $question->prompt = false;\n // name will be assigned after processing question text below\n } else {\n $questionname = substr($text, 0, $namefinish);\n $question->prompt = addslashes(trim($this->escapedchar_post($questionname)));\n $text = trim(substr($text, $namefinish+2)); // Remove name from text\n }\n } else {\n $question->prompt = false;\n }\n\n\n // FIND ANSWER section -----------------------------------------------------------------\n // no answer means its a description\n $answerstart = strpos($text, \"{\");\n $answerfinish = strpos($text, \"}\");\n\n $description = false;\n if (($answerstart === false) and ($answerfinish === false)) {\n $description = true;\n $answertext = '';\n $answerlength = 0;\n }\n elseif (!(($answerstart !== false) and ($answerfinish !== false))) {\n //$this->error( get_string( 'braceerror', 'quiz' ), $text );\n return false;\n }\n else {\n $answerlength = $answerfinish - $answerstart;\n $answertext = trim(substr($text, $answerstart + 1, $answerlength - 1));\n }\n\n \n\t\t// Format QUESTION TEXT without answer, inserting \"_____\" as necessary\n if ($description) {\n $text = $text;\n }\n elseif (substr($text, -1) == \"}\") {\n // no blank line if answers follow question, outside of closing punctuation\n $text = substr_replace($text, \"\", $answerstart, $answerlength+1);\n } else {\n // inserts blank line for missing word format\n $text = substr_replace($text, \"_____\", $answerstart, $answerlength+1);\n }\n\n // get text format from text\n $oldtext = $text;\n $textformat = 0;\n if (substr($text,0,1)=='[') {\n $text = substr( $text,1 );\n $rh_brace = strpos( $text, ']' );\n $qtformat= substr( $text, 0, $rh_brace );\n $text = substr( $text, $rh_brace+1 );\n \n }\n // i must find out for what this param is used\n $question->textformat = $textformat;\n \t\t\n \t\t// question text \n $question->quest_text = addslashes(trim($this->escapedchar_post($text)));\n\n // set question name if not already set\n\t\tif ($question->prompt === false) {\n\t\t\t$question->prompt = $question->quest_text;\n\t\t}\n\n // ensure name is not longer than 250 characters\n $question->prompt = $question->prompt ;\n $question->prompt = strip_tags(substr( $question->prompt, 0, 250 ));\n\n // determine QUESTION TYPE -------------------------------------------------------------\n $question->qtype = NULL;\n\n // give plugins first try\n // plugins must promise not to intercept standard qtypes\n // MDL-12346, this could be called from lesson mod which has its own base class =(\n /*\n if (method_exists($this, 'try_importing_using_qtypes') && ($try_question = $this->try_importing_using_qtypes( $lines, $question, $answertext ))) {\n return $try_question;\n }\n\t\t*/\n if ($description) {\n $question->qtype = 'title';\n }\n elseif ($answertext == '') {\n $question->qtype = 'extended_text';\n }\n elseif ($answertext{0} == \"#\"){\n $question->qtype = 'numerical';\n\n\t\t} elseif (strpos($answertext, \"~\") !== false) {\n\t\t\t\n\t\t\t// only Multiplechoice questions contain tilde ~\n\t\t\tif (strpos($answertext,\"=\") === false) {\n\t\t\t\t\n\t\t\t\t// multiple answers are enabled if no single answer is 100% correct\n\t\t\t\t$question->qtype = 'choice_multiple'; \n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// only one answer allowed (the default)\n\t\t\t\t$question->qtype = 'choice';\n\t\t\t}\n }", "public function formatVariable(){\r\n\t\t\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function quiz_fields(){\n\n\t$fields = array();\n\n/*quiz settings*/\n\n\t$fields['quiz_duration_in_minutes'] = 'number';\n\n\t$fields['make_quiz_public'] = 'checkbox';\n\t\n\t$fields['make_quiz_active'] = 'checkbox';\n\t\n\t$fields['users_can_take_quiz_only_once'] = 'checkbox';\t\n\t\n\t$fields['display_questions_in_random_order'] = 'checkbox';\t\t\n\t\n\t$fields['display_answer_options_in_random_order'] = 'checkbox';\t\n\t\n\t$fields['time_remaining_when_clock_turns_red_in_seconds'] = 'number';\t\n\t\n\t$fields['show_number_of_questions_remaining'] = 'checkbox';\t\t\n\t\n\t$fields['test_pass_percentage'] = 'number';\t\n\n/*quiz contents*/\n\n\t$fields['main_colour'] = 'text';\n\n\t$fields['secondary_colour'] = 'text';\t\n\n\t$fields['message_when_no_answer_is_selected'] = 'text';\t\n\t\n\t$fields['message_to_show_under_skip_confirm_buttons'] = 'text';\t\t\n\t\n\t$fields['message_to_show_if_user_cannot_access_quiz'] = 'text';\t\n\t\n/*questions*/\n\n\t// $count terms in categeory\n\t$args = array('hide_empty' => false);\n\t$categories = wp_count_terms( 'question-category', $args );\n\tif($categories < 1){$categories = 1;}\n\t\n\t$i = 0;\n\n\twhile($i < $categories){\n\t$i++;\n\t$field = 'question_category_'.$i;\n\t$fields[$field] = 'select';\n\t$field = 'question_category_count_'.$i;\n\t$fields[$field] = 'number';\n\t}\t\n\n/*ending the quiz*/\n\n\t$fields['redirect_to_page_once_complete'] = 'pageselect';\n\t\n\t$fields['message_to_show_after_last_question_answered'] = 'text';\n\t\n\t$fields['redirect_to_page_on_timeout'] = 'pageselect';\n\t\n\t$fields['message_to_show_after_timeout'] = 'text';\t\n\n/*quiz results*/\n\n\t$fields['show_score_after_last_question_answered'] = 'checkbox';\n\n\t$fields['notify_administrator_of_results'] = 'checkbox';\n\t\n\t$fields['email_address_to_notify'] = 'text';\n\n\nreturn $fields;\n}", "function printMCQuestionForm() {\n\n\tglobal $tool_content, $langTitle, $langSurveyStart, $langSurveyEnd, \n\t\t$langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langQuestion, $langCreate, $langSurveyMoreQuestions, \n\t\t$langSurveyCreated, $MoreQuestions, $langAnswer, \n\t\t$langSurveyMoreAnswers, $langSurveyInfo,\n\t\t$langQuestion1, $langQuestion2, $langQuestion3, $langQuestion4, $langQuestion5, $langQuestion6,\n\t\t$langQuestion7, $langQuestion8,$langQuestion9, $langQuestion10;\n\t\t\n\t\tif(isset($_POST['SurveyName'])) $SurveyName = htmlspecialchars($_POST['SurveyName']);\n\t\tif(isset($_POST['SurveyEnd'])) $SurveyEnd = htmlspecialchars($_POST['SurveyEnd']);\n\t\tif(isset($_POST['SurveyStart'])) $SurveyStart = htmlspecialchars($_POST['SurveyStart']);\n\t\t\n//\tif ($MoreQuestions == 2) { // Create survey ******************************************************\n\tif ($MoreQuestions == $langCreate) { // Create survey\n\t\tcreateMCSurvey();\n\t} elseif(count($_POST)<7) { // Just entered MC survey creation dialiog ****************************\n\t\t$tool_content .= <<<cData\n\t\t<table><thead></thead>\n\t<tr><td colspan=2>$langSurveyInfo</td></tr></table>\n\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\" name=\"SurveyForm\" onSubmit=\"return checkrequired(this, 'question1')\">\n\t<input type=\"hidden\" value=\"1\" name=\"UseCase\">\n\t<table id=\"QuestionTable\">\n\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\n\t<tr><td colspan=3>\n\t<SELECT NAME=\"questionx\" onChange=\"addEvent(this.selectedIndex);this.parentNode.removeChild(this);\" id=\"QuestionSelector\">\n\t\t\t\t<OPTION>$langSurveyInfo</option>\n\t\t\t\t<OPTION VALUE=\"question1\">$langQuestion1[0]</option>\n <OPTION VALUE=\"question2\">$langQuestion2[0]</option>\n <OPTION VALUE=\"question3\">$langQuestion3[0]</option>\n <OPTION VALUE=\"question4\">$langQuestion4[0]</option>\n <OPTION VALUE=\"question5\">$langQuestion5[0]</option>\n <OPTION VALUE=\"question6\">$langQuestion6[0]</option>\n <OPTION VALUE=\"question7\">$langQuestion7[0]</option>\n <OPTION VALUE=\"question8\">$langQuestion8[0]</option>\n <OPTION VALUE=\"question9\">$langQuestion9[0]</option>\n <OPTION VALUE=\"question10\">$langQuestion10[0]</option>\n\t\t\t\t</SELECT>\n\t\t\t</td></tr>\n\t\t\t<tr><td>$langQuestion</td><td><input type=\"text\" name=\"question1\" size=\"70\" id=\"NewQuestion\"></td></tr> \n\t\t\t<tr><td>$langAnswer 1</td><td><input type=\"text\" name=\"answer1.1\" size=\"70\" id=\"NewAnswer1\"></td></tr>\n\t\t\t<tr><td>$langAnswer 2</td><td><input type=\"text\" name=\"answer1.2\" size=\"70\" id=\"NewAnswer2\"></td></tr>\n\t\t\t<tr id=\"NextLine\">\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreAnswers\" /></td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" /></td>\n\t\t <td>\n\t\t\t\t\t<input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\"></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" value=\"1\" name=\"NumOfQuestions\">\n\t\t</form>\ncData;\n\t} elseif ($MoreQuestions == $langSurveyMoreAnswers) { // Print more answers \n\t\t$NumOfQuestions = $_POST['NumOfQuestions'];\n\t\t\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t\t<input type=\"hidden\" value=\"1\" name=\"UseCase\">\n\t\t<table>\n\t\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"10\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"10\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\n\t\t\t\ncData;\n\n\t\tprintAllQA();\n\t\t$tool_content .= <<<cData\n\t\t\t\t\t<tr><td>$langAnswer</td><td colspan=\"2\"><input type=\"text\" size=\"10\" name=\"answer\" value=\"\"></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreAnswers\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" value=\"{$NumOfQuestions}\" name=\"NumOfQuestions\">\n\t\t</form>\ncData;\n\t} else { // Print more questions ******************************************************\n\t\t$NumOfQuestions = $_POST['NumOfQuestions'];\n\t\t++$NumOfQuestions;\n\t\t\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\" name=\"SurveyForm\" onSubmit=\"return checkrequired(this, 'questionx')\">\n\t\t<input type=\"hidden\" value=\"1\" name=\"UseCase\">\n\t\t<table>\n\t\t<tr><td>$langTitle</td><td colspan=\"2\">\n\t\t\t\t<input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\">\n\t\t\t\t\t<input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\">\n\t\t\t\t\t<input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\n\t\t\t\ncData;\n\t\t\n\t\tprintAllQA();\n\t\t\n\t\t$tool_content .= <<<cData\n\t\t<tr><td colspan=3><hr></td></tr>\n\t\t\t<tr><td colspan=3>\n\t\t\t\t<SELECT NAME=\"questionx\" onChange=\"addEvent(this.selectedIndex);this.parentNode.removeChild(this);\" id=\"QuestionSelector\">\n\t\t\t\t<OPTION>$langSurveyInfo</option>\n\t\t\t\t<OPTION VALUE=\"question1\">$langQuestion1[0]</option>\n\t\t\t\t<OPTION VALUE=\"question2\">$langQuestion2[0]</option>\n\t\t\t\t<OPTION VALUE=\"question3\">$langQuestion3[0]</option>\n\t\t\t\t<OPTION VALUE=\"question4\">$langQuestion4[0]</option>\n\t\t\t\t<OPTION VALUE=\"question5\">$langQuestion5[0]</option>\n\t\t\t\t<OPTION VALUE=\"question6\">$langQuestion6[0]</option>\n\t\t\t\t<OPTION VALUE=\"question7\">$langQuestion7[0]</option>\n\t\t\t\t<OPTION VALUE=\"question8\">$langQuestion8[0]</option>\n\t\t\t\t<OPTION VALUE=\"question9\">$langQuestion9[0]</option>\n\t\t\t\t<OPTION VALUE=\"question10\">$langQuestion10[0]</option>\n\t\t\t\t</SELECT>\n\t\t\t</td></tr>\ncData;\n\t\t\n\t\t$tool_content .= \"<tr> <td>\" . \n\t\t\t\t$langQuestion . \"\t</td><td><input type='text' name='questionx' size='70' id='NewQuestion'></td></tr>\".\n\t\t\t\t\"<tr><td>$langAnswer 1</td><td><input type='text' name='answerx.1' size='70' id='NewAnswer1'></td></tr>\".\n\t\t\t\t\"<tr><td>$langAnswer 2</td><td><input type='text' name='answerx.2' size='70' id='NewAnswer2'></td></tr>\";\n\t\t\t\n\t\t$tool_content .= <<<cData\n\t\t\t\t<tr id=\"NextLine\"><td colspan=3><hr></td></tr>\n\t\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreAnswers\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" value=\"{$NumOfQuestions}\" name=\"NumOfQuestions\">\n\t\t</form>\ncData;\n\t}\n}", "public function fillQuestion(array $question)\n\t{\n\t\t[$inputMode, $inputExpectation, $notUseful, $from] = explode('_', $question['type']);\n\n\t\tvar_dump($inputMode, $inputExpectation, $notUseful, $from);\n\t\t//var_dump($question['function']['name']);\n\n\t\tif($inputMode == 'type')\n\t\t{\n\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\t\t}\n\n\t\telseif($inputMode == 'choose')\n\t\t{\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\n\t\t\tif($from == 'name')\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function']['name'] . '() ?';\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t}\n\n\t\t\t$question['choices'] = $this->generateChoices($question);\n\n\t\t\t//put correct answer in (by clobbering one of generated choices)\n\t\t\t$randomChoice = array_rand($question['choices']);\n\n\t\t\t$question['choices'][$randomChoice] = $question['answer_text'];\n\t\t\t$question['answer_index'] = $randomChoice;\n\t\t}\n\n\t\t\n\n\t\treturn $question;\n\t}", "public function prepareVars()\n {\n $this->vars['searchBox'] = $this;\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['placeholder'] = lang($this->prompt);\n $this->vars['value'] = $this->getActiveTerm();\n }", "function form_players_entry ($gender, $showword)\n{\n $min = 'MinPlayers' . $gender;\n $max = 'MaxPlayers' . $gender;\n $pref = 'PrefPlayers' . $gender;\n\n if (array_key_exists ($min, $_POST))\n $min_value = $_POST[$min];\n else\n $min_value = '0';\n\n if (array_key_exists ($max, $_POST))\n $max_value = $_POST[$max];\n else\n $max_value = '0';\n\n if (array_key_exists ($pref, $_POST))\n $pref_value = $_POST[$pref];\n else\n $pref_value = '0';\n\n print (\" <tr>\\n\");\n if ($showword)\n print (\" <td align=\\\"right\\\">$gender Characters:</td>\\n\");\n else\n print (\" <td align=\\\"right\\\">Characters:</td>\\n\");\n print (\" <td align=\\\"left\\\">\\n\");\n printf (\" Min:<INPUT TYPE=TEXT NAME=%s SIZE=3 MAXLENGTH=3 VALUE=\\\"%s\\\">&nbsp;&nbsp;&nbsp;\\n\",\n\t $min,\n\t $min_value);\n printf (\" Preferred:<INPUT TYPE=TEXT NAME=%s SIZE=3 MAXLENGTH=3 VALUE=\\\"%s\\\">&nbsp;&nbsp;&nbsp;\\n\",\n\t $pref,\n\t $pref_value);\n printf (\" Max:<INPUT TYPE=TEXT NAME=%s SIZE=3 MAXLENGTH=3 VALUE=\\\"%s\\\">\\n\",\n\t $max,\n\t $max_value);\n print (\" </TD>\\n\");\n print (\" </tr>\\n\");\n}", "public abstract function format($level, $text, $name='', $extras=[]);", "function writequestion($question) {\n /// must be overidden\n\n echo \"<p>This quiz format has not yet been completed!</p>\";\n\n return NULL;\n }" ]
[ "0.63702196", "0.5844001", "0.57653993", "0.5708631", "0.5597477", "0.55093443", "0.5507172", "0.5405987", "0.5321921", "0.5288423", "0.52758884", "0.5241879", "0.51688486", "0.5164771", "0.5132086", "0.5120046", "0.5116965", "0.5098371", "0.50805044", "0.5027847", "0.5002497", "0.4964744", "0.49599463", "0.49576697", "0.49483234", "0.4942844", "0.49208406", "0.49045038", "0.48989847", "0.4877968" ]
0.60418975
1
Evalutes inlinecode (code surrounded in curly braces) provided as part of the question.
public static function handle_inline_code($text, $match_level = 1, $mode = 'evaluate', $interpreter, $show_errors = false) { //Create a callback lambda which evaluates each block of inline code. $callback = function($matches) use($interpreter, $mode, $show_errors) { //Attempt to evaluate the given expression... try { return $interpreter->$mode($matches[1]); } //... and insert a placeholder if the string fails. catch(qtype_scripted_language_exception $e) { //If show errors is on, display the exception directly... if($show_errors) { return '['.$e->getMessage().' in '.$matches[1].']'; } //Otherwise, show a placeholder. else { return get_string('error_placeholder', 'qtype_scripted'); } } }; //Create a regular expression piece that matches the correct number //of open/close braces. $open_brace = str_repeat('\\{', $match_level); $close_brace = str_repeat('\\}', $match_level); //And replace each section in curly brackets with the evaluated version of that expression. return preg_replace_callback('/'.$open_brace.'(.*?)'.$close_brace.'/', $callback, $text); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eval_inline_php($myContent,$onlyEval=false)\n// *************************************************\n{\n\t$rVal = \"\";\n\n\t// PHP INCLUDES\n\t$pos1 = strpos($myContent,\"<?php\");\n\n\tif (!($pos1===false))\n\t{\n\t\t$pos2 = strpos($myContent,\"?>\",$pos1);\n\n\t\t$rVal .= substr($myContent,0,$pos1);\n\n\t\t// BLOCK AUSWERTEN\n\t\t$evalTxt = substr($myContent,$pos1+5,($pos2)-($pos1+5));\n\t\teval($evalTxt);\n\n\t\t// RUECKGABE BLOCK DAVOR UND DANACH\n\t\tif (!$onlyEval) return $rVal.substr($myContent,$pos2+2);\n\t}\n\telse\n\t\treturn $myContent;\n\n\treturn \"\";\n}", "function single_inline_codeblock($content) {\n $content = preg_replace(\"/(`[^`]*`)/\", \"<span class='code-inline'>$0</span>\", $content);\n $content = str_replace('`', '', $content);\n return $content;\n}", "protected function replaceInlineCode($string)\n\t{\n\t\t// For closures\n\t\t$obj = $this;\n\t\treturn preg_replace_callback('/(`+)[ \\t]*(.+?)[ \\t]*(?<!`)\\1(?!`)/s', function($match) use ($obj)\n\t\t{\n\t\t\treturn '<code>'. $obj->encodeSpecial($match[2]) .'</code>';\n\t\t}, $string);\n\t}", "public static function _eval($self, $code)\n {\n return $self->evaluate_script($code, true);\n }", "function inline($line){\n \n $line = $this->premark_inline($line);\n \n //echo $line,\"\\n\";\n $line = preg_split('/\\{\\@MARK\\@([a-z0-9]+)_(.+?)_\\@KRAM\\@\\}/', $line, -1, PREG_SPLIT_DELIM_CAPTURE);\n //print_r($line);\n \n foreach($line as $k=>$v){\n switch($k%3){\n case 0:\n $this->part[] = array(DOC_CODE_TEXT,$v);\n break;\n \n case 1:\n $cmd = $v;\n break;\n \n case 2:\n $this->part[] = array(DOC_CODE_INLINE,$cmd,$v);\n break;\n }\n }\n }", "private function handlePhpEvalReplacement($input)\n {\n if (preg_match('/<\\?php (.*)\\?'.'>/', $input, $matches)) // goofy syntax there to prevent syntax coloring problems in rest of file due to close php tag\n {\n return eval( \"return {$matches[1]};\" );\n }\n return $input;\n }", "private function _inlineEscape($inline) {\n\t//--\n\t// There's gotta be a cleaner way to do this...\n\t// While pure sequences seem to be nesting just fine,\n\t// pure mappings and mappings with sequences inside can't go very\n\t// deep. This needs to be fixed.\n\t//--\n\t$seqs = array();\n\t$maps = array();\n\t$saved_strings = array();\n\t$saved_empties = array();\n\t//-- Check for empty strings fix from v.0.5.1\n\t$regex = '/(\"\")|(\\'\\')/';\n\tif(preg_match_all($regex, $inline, $strings)) {\n\t\t$saved_empties = $strings[0];\n\t\t$inline = preg_replace($regex, 'YAMLEmpty', $inline);\n\t} //end if\n\tunset($regex);\n\t//-- Check for strings\n\t$regex = '/(?:(\")|(?:\\'))((?(1)[^\"]+|[^\\']+))(?(1)\"|\\')/';\n\tif(preg_match_all($regex, $inline, $strings)) {\n\t\t$saved_strings = $strings[0];\n\t\t$inline = preg_replace($regex, 'YAMLString', $inline);\n\t} //end if\n\tunset($regex);\n\t//--\n\t$i = 0;\n\t$regex_seq = '/\\[([^{}\\[\\]]+)\\]/U';\n\t$regex_map = '/{([^\\[\\]{}]+)}/U';\n\tdo {\n\t\t// Check for sequences\n\t\twhile(preg_match($regex_seq, $inline, $matchseqs)) {\n\t\t\t$seqs[] = $matchseqs[0];\n\t\t\t$inline = preg_replace($regex_seq, ('YAMLSeq'.(Smart::array_size($seqs) - 1).'s'), $inline, 1);\n\t\t} //end while\n\t\t// Check for mappings\n\t\twhile(preg_match($regex_map, $inline, $matchmaps)) {\n\t\t\t$maps[] = $matchmaps[0];\n\t\t\t$inline = preg_replace($regex_map, ('YAMLMap'.(Smart::array_size($maps) - 1).'s'), $inline, 1);\n\t\t} //end while\n\t\tif($i++ >= 10) {\n\t\t\tbreak;\n\t\t} //end if\n\t} while(strpos($inline, '[') !== false || strpos($inline, '{') !== false);\n\tunset($regex_seq);\n\tunset($regex_map);\n\t//--\n\t$explode = explode(', ', $inline);\n\t$stringi = 0;\n\t$i = 0;\n\t//--\n\twhile(1) {\n\t\t//-- Re-add the sequences\n\t\tif(!empty($seqs)) {\n\t\t\tforeach ($explode as $key => $value) {\n\t\t\t\tif(strpos($value, 'YAMLSeq') !== false) {\n\t\t\t\t\tforeach($seqs as $seqk => $seq) {\n\t\t\t\t\t\t$explode[$key] = str_replace(('YAMLSeq'.$seqk.'s'), $seq, $value);\n\t\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t\t} //end foreach\n\t\t\t\t} //end if\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//-- Re-add the mappings\n\t\tif(!empty($maps)) {\n\t\t\tforeach($explode as $key => $value) {\n\t\t\t\tif(strpos($value, 'YAMLMap') !== false) {\n\t\t\t\t\tforeach($maps as $mapk => $map) {\n\t\t\t\t\t\t$explode[$key] = str_replace(('YAMLMap'.$mapk.'s'), $map, $value);\n\t\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t\t} //end foreach\n\t\t\t\t} //end if\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//-- Re-add the strings\n\t\tif(!empty($saved_strings)) {\n\t\t\tforeach ($explode as $key => $value) {\n\t\t\t\twhile(strpos($value, 'YAMLString') !== false) {\n\t\t\t\t\t$explode[$key] = preg_replace('/YAMLString/', $saved_strings[$stringi], $value, 1);\n\t\t\t\t\tunset($saved_strings[$stringi]);\n\t\t\t\t\t++$stringi;\n\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t} //end while\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//-- Re-add the empty strings fix from v.0.5.1\n\t\tif(!empty($saved_empties)) {\n\t\t\tforeach ($explode as $key => $value) {\n\t\t\t\twhile (strpos($value,'YAMLEmpty') !== false) {\n\t\t\t\t\t$explode[$key] = preg_replace('/YAMLEmpty/', '', $value, 1);\n\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t} //end while\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//--\n\t\t$finished = true;\n\t\tforeach($explode as $key => $value) {\n\t\t\tif(strpos($value, 'YAMLSeq') !== false) {\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t\tif(strpos($value, 'YAMLMap') !== false) {\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t\tif(strpos($value, 'YAMLString') !== false) {\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t\tif(strpos($value,'YAMLEmpty') !== false) { // fix from v.0.5.1\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t} //end foreach\n\t\tif($finished) {\n\t\t\tbreak;\n\t\t} //end if\n\t\t$i++;\n\t\tif($i > 10) {\n\t\t\tbreak; // Prevent infinite loops.\n\t\t} //end if\n\t\t//--\n\t} //end while\n\t//--\n\treturn $explode;\n\t//--\n}", "function betterEval($code) {\n $result = [];\n $tmp = tmpfile ();//file resource\n //we'll need to uri to include the file:\n $tmpMeta = stream_get_meta_data ( $tmp );\n $uri = $tmpMeta ['uri'];\n fwrite ( $tmp, $code );\n \n ob_start();\n $start = microtime(true);\n //anonymously, so our scope will not be polluted (very optimistic here, ofc)\n call_user_func(function() use ($uri) {\n include ($uri);\n }); \n \n $result['time'] = microtime(true) - $start;\n $result['output'] = ob_get_clean(); \n $result['length'] = strlen($result['output']);\n $result['lengthCharacters'] = mb_strlen($result['output']);\n $result['dbg'] = [\n 'fileUri' => $uri\n ];\n fclose ( $tmp );\n return $result;\n}", "function quote4Eval($in) {\n\t\tif (is_numeric($in)) {\n\t\t\treturn $in;\n\t\t} else {\n\t\t\treturn '\"' . str_replace(\"\\\\'\", \"'\", addslashes($in)) . '\"';\n\t\t}\n\t}", "protected function wpEval($alias, $code, $skipWordPress = false)\n {\n $code = escapeshellarg($code);\n $skipWordPress = $skipWordPress ? '--skip-wordpress' : '';\n return $this->wp($alias, \"eval $code $skipWordPress\");\n }", "static function code ($in = '', $data = []) {\n\t\treturn static::textarea_common($in, $data, __FUNCTION__);\n\t}", "function phpblock($text) {\n $this->php($text, 'pre');\n }", "public function inline_load($echo = false)\n\t{\n\t\t$body = addcslashes($this->render(), \"\\\\'\");\n\n\t\t$javascript = \"phery.load('{$body}');\";\n\n\t\tif ($echo)\n\t\t{\n\t\t\techo $javascript;\n\t\t}\n\n\t\treturn $javascript;\n\t}", "public static function _function($self, $code)\n {\n return $self->evaluate_script($code, false, true);\n }", "static public function code($content, $attributes=array()) {\n return self::content('code', $content, $attributes);\n }", "protected function sanitizeExpression($code)\n\t{\n\t\t// Language consturcts.\n\t\t$languageConstructs = array(\n\t\t\t'echo',\n\t\t\t'empty',\n\t\t\t'isset',\n\t\t\t'unset',\n\t\t\t'exit',\n\t\t\t'die',\n\t\t\t'include',\n\t\t\t'include_once',\n\t\t\t'require',\n\t\t\t'require_once',\n\t\t);\n\n\t\t// Loop through the language constructs.\n\t\tforeach( $languageConstructs as $lc )\n\t\t\tif( preg_match('/'.$lc.'\\ *\\(?\\ *[\\\"\\']+/', $code)>0 )\n\t\t\t\treturn null; // Language construct found, not safe for eval.\n\n\t\t// Get a list of all defined functions\n\t\t$definedFunctions = get_defined_functions();\n\t\t$functions = array_merge($definedFunctions['internal'], $definedFunctions['user']);\n\n\t\t// Loop through the functions and check the code for function calls.\n\t\t// Append a '(' to the functions to avoid confusion between e.g. array() and array_merge().\n\t\tforeach( $functions as $f )\n\t\t\t//if( preg_match('/'.$f.'\\ *\\({1}/', $code)>0 )\n\t\t\tif( preg_match('/'.preg_quote($f, '/').'\\ *\\({1}/', $code)>0 )\n\t\t\t\treturn null; // Function call found, not safe for eval.\n\n\t\t// Evaluate the safer code\n\t\t$result = @eval($code);\n\n\t\t// Return the evaluated code or null if the result was false.\n\t\treturn $result!==false ? $result : null;\n\t}", "function compile($code, $do_not_echo = false, $retvar = '')\n\t{\n\t\t$code = ' ?' . '>' . $this->compile_code('', $code, true) . '<' . '?php' . \"\\n\";\n\t\tif($do_not_echo)\n\t\t{\n\t\t\t$code = \"ob_start();\\n\". $code. \"\\n\\${$retvar} = ob_get_contents();\\nob_end_clean();\\n\";\n\t\t}\n\t\treturn $code;\n\t}", "public function registerInlineJs(string $code): self\n {\n return $this->registerRequireJsModule('TYPO3/CMS/Backend/FormEngine', $code);\n }", "public static function run($code)\n {\n $interpreter = new Interpreter(static::parse($code));\n return $interpreter->run();\n }", "public function get_Eval(){\n return $this->eval_note;\n }", "function evaluation($text_evaluate)\n{\n $brackets = \"\";\n switch ($text_evaluate) {\n case \"\":\n echo '<div class=\"success\">No brackets sequence was provided. Generating \n and analysing a random one.</div>';\n case \"random\":\n $brackets = randomBrackets();\n break;\n default:\n $brackets = $text_evaluate;\n break;\n }\n\n // Preparing for edge cases.\n while (empty($brackets)) {\n $brackets = randomBrackets();\n }\n $brackets_length = strlen($brackets);\n\n // Shows the sequence of brackets on the input field.\n echo \"\n <script>\n document.getElementById('text_evaluate').value = '\" . $brackets . \"';\n </script>\";\n\n $open = array('(', '[', '{');\n $close = array(')', ']', '}');\n\n /**\n * Creates the arrays $brackets_open and $brackets_close. They will be used to\n * check if there are unmatched brackets, called orphans.\n * \n * Creates the array $valid_brackets with all brackets, after excluding any\n * possible foreign characters.\n */\n $valid_brackets = array();\n $brackets_open = array();\n $brackets_close = array();\n for ($i = 0; $i < $brackets_length; $i++) {\n if (in_array($brackets[$i], $open)) {\n $brackets_open[$i] = $brackets[$i];\n } elseif (in_array($brackets[$i], $close)) {\n $brackets_close[$i] = $brackets[$i];\n }\n\n $current_character = substr($brackets, $i, 1);\n if (in_array($current_character, $open) || in_array($current_character, $close)) {\n $valid_brackets[$i] = $current_character;\n }\n }\n\n // Shows the string received, without filtering foreign characters.\n $brackets_style = \"<pre class='string'>string_received (count: $brackets_length) {\\n $brackets\\n}</pre>\";\n echo $brackets_style;\n\n // Shows the string received, with foreign characters filtered out.\n $brackets_style = \"<pre class='brackets'>valid_brackets (count: \" . count($valid_brackets) . \") {\\n\";\n foreach($valid_brackets as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n\n // Shows only opening brackets, in order of appearance.\n $brackets_style = \"<pre class='brackets'>brackets_open_order (count: \" . count($brackets_open) . \") {\\n\";\n foreach($brackets_open as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n\n // Shows only closing brackets, in order of appearance.\n $brackets_style = \"<pre class='brackets'>brackets_close_order (count: \" . count($brackets_close) . \") {\\n\";\n foreach($brackets_close as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n\n /**\n * Analyses the sequence of brackets and verifies which ones match the rules:\n * - Rule 1 (\"Pairs\"): An opened bracket must be closed to be valid, which means \n * they must form pairs;\n * - Rule 2 (\"Scope\"): A pair must have both parts inside another pair or outside \n * any pair, which means that a pair opening inside another pair and closing \n * outside of it is not valid.\n * \n * Unmatched brackets are kept in the $orphans array. Matched brackets are kept \n * only in the $brackets array.\n * \n * The $temp array is used to stare temporarily the brackets being analyzed.\n */\n $orphans = array();\n $temp = array();\n foreach($valid_brackets as $brackets_key => $brackets_value) {\n // Is the current bracket an opening one?\n $brackets_key_found = array_search($brackets_value, $open);\n\n // If it is, keep it in the $temp array.\n if ($brackets_key_found !== false) {\n $temp[$brackets_key] = $brackets_value;\n\n // If it isn't...\n } else {\n // 1. Find out which bracket matches it;\n $brackets_close_key = array_search($brackets_value, $close);\n $brackets_open_value = $open[$brackets_close_key];\n\n // 2. Search for the most recent match.\n $reversed = array_reverse($temp, true);\n $last_occurrence = array_search($brackets_open_value, $reversed);\n\n // If the match was found...\n if ($last_occurrence !== false) {\n // Remove it from the $temp array...\n unset($temp[$last_occurrence]);\n if (count($temp) > 0) {\n foreach ($temp as $k => $v) {\n /**\n * and remove existing brackets between the pair.\n * \n * For example: Consider the sequence \"{[((]\".\n * It has a matching pair: \"[\" and \"]\".\n * Everything else is unmatched.\n * \n * What we do here is to remove only what's inside the pair.\n * When we got to this point, the $temp array had the following\n * contents: \"{((\", because we already removed the \"[\" bracket.\n * Here we will remove what was between \"[\" and \"]\", which was\n * \"((\". As a result, $temp will have the following content: \"{\".\n * \n * We kept this content because it might match some (possible)\n * further bracket.\n */\n if ($k > $last_occurrence) {\n $orphans[$k] = $v;\n unset($temp[$k]);\n }\n }\n }\n\n // If no match was found...\n } else {\n // it means this is an orphan bracket.\n $orphans[$brackets_key] = $brackets_value;\n }\n }\n }\n\n // If the $temp array has any content left, they are all orphans.\n if (count($temp) > 0) {\n foreach ($temp as $k => $v) {\n $orphans[$k] = $v;\n unset($temp[$k]);\n }\n }\n ksort($orphans);\n\n // Shows the orphan brackets.\n if (count($orphans) > 0) {\n $brackets_style = \"<pre class='brackets'>orphan_brackets (count: \" . count($orphans) . \") {\\n\";\n foreach($orphans as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n }\n\n $aux_str = \"\";\n $brackets_style = \"<div style='padding-left: 20px;'><span class='result'><pre>brackets_result_in_line (count: $brackets_length) {\\n \";\n for ($i = 0; $i < $brackets_length; $i++) {\n if (isset($orphans[$i])) {\n $aux_str .= '<span class=\"orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n } elseif (isset($orphans[$i])) {\n $aux_str .= '<span class=\"orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n } else {\n $aux_str .= '<span class=\"non-orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n }\n }\n $brackets_style .= $aux_str;\n $brackets_style .= \"\\n}</pre></span></div>\";\n // Shows, in a line, the sequence of no valid brackets.\n echo $brackets_style;\n\n $aux_str = \"\";\n // $offset if used to control the indentation.\n $offset = 3;\n /**\n * $previous_open_close_move is used to keep track of which kind of bracket\n * was last shown. If its content is \"o\", it means it was an opening one.\n * If its content is \"c\", it means it was a closing one.\n * \n * It is necessary, because we need to know when the $offset variable should\n * have its value subtracted, which means we have a closing bracket with some\n * other brackets inside it. \n * \n * For example:\n * {\n * [((]( \n * }\n * \n * In this case, the \"}\" bracket needs its offset reduced to be shown correctly.\n */ \n $previous_open_close_move = \"o\";\n $brackets_style = \"<div style='padding-left: 20px;'><span class='result'><pre>brackets_result_with_visual_aid (count: $brackets_length) {\\n \";\n for ($i = 0; $i < $brackets_length; $i++) {\n if (isset($orphans[$i])) {\n $aux_str .= '<span class=\"orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n } else {\n if (in_array(substr($brackets, $i, 1), $open)) {\n if (!empty($aux_str)) {\n $aux_str .= \"\\n\" . str_repeat(\" \", $offset) . \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n } else {\n $aux_str .= \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n }\n $offset += 3;\n $previous_open_close_move = \"o\";\n }\n\n if (in_array(substr($brackets, $i, 1), $close)) {\n $offset -= 3;\n if ($previous_open_close_move == \"c\") {\n $aux_str .= \"\\n\" . str_repeat(\" \", $offset) . \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n } else {\n $aux_str .= \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n }\n $previous_open_close_move = \"c\";\n }\n }\n }\n $brackets_style .= $aux_str;\n $brackets_style .= \"\\n}</pre></span></div>\";\n // Shows, with visual aid, the sequence of no valid brackets.\n echo $brackets_style;\n\n if (count($orphans) == 0) {\n echo '\n <div class=\"alert alert-success evaluation\" role=\"alert\">\n The sequence of brackets received is valid.\n </div>';\n } else {\n echo '\n <div class=\"alert alert-danger evaluation\" role=\"alert\">\n The sequence of brackets received is not valid.\n </div>';\n }\n}", "public static function phpEvaluation(Template $template/*, $content, $isFile*/)\n\t{\n\t\textract($template->getParams(), EXTR_SKIP); // skip $this & $template\n\t\tif (func_num_args() > 2 && func_get_arg(2)) {\n\t\t\tinclude func_get_arg(1);\n\t\t} else {\n\t\t\teval('?>' . func_get_arg(1));\n\t\t}\n\t}", "protected function compileRaw($expression)\n {\n if (Str::startsWith($expression, '(')) {\n $expression = substr($expression, 1, -1);\n }\n\n return \"<?php echo \\$__env->make($expression, ['raw' => true], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>\";\n }", "public function embedCode($strCode, $varFile, $intSize)\n\t{\n\t\tif ($intSize > 0) {\n\t\t\t$objHelper = new CssInlineImagesHelper($varFile, $intSize);\n\t\t\treturn preg_replace_callback('#url\\((.*)\\)#U', array($objHelper, 'replace'), $strCode);\n\t\t} else {\n\t\t\treturn $strCode;\n\t\t}\n\t}", "function ensure_proper_quotation_nesting() {\r\n\t\t//$this->code = OM::ensure_proper_nesting($this->code, 'q');\r\n\t\tReTidy::combine_inline();\r\n\t}", "private function processBlockquote($text, $inline = false)\n {\n if ($inline) {\n $length = 0;\n $text = str_replace(self::BLOCKQUOTE_INLINE_START, '', $text); // remove bq.\n } else {\n $length = strlen(self::BLOCKQUOTE_BLOCK_START);\n $text = mb_substr($text, $length); // remove first {quote}\n }\n\n $end = $this->findBlockquoteEnd($text, $inline);\n $blockquote = mb_substr($text, 0, $end);\n $this->wrapInNode(self::NODE_BLOCKQUOTE, function () use ($blockquote) {\n $this->processInline($blockquote);\n });\n\n return mb_substr($text, $end + $length);\n }", "protected function codeToModify()\n {\n return '\n if (is_callable(array($this->metaclass, func_get_arg(0)))) {\n try {\n return call_user_func_array(array($this->metaclass, ' .\n 'func_get_arg(0)), func_get_arg(1));\n } catch (BadMethodCallException $e) {\n %s\n }\n }\n ';\n }", "function php($text, $wrapper = 'code') {\n global $conf;\n\n if($conf['phpok']) {\n ob_start();\n eval($text);\n $this->doc .= ob_get_contents();\n ob_end_clean();\n } else {\n $this->doc .= p_xhtml_cached_geshi($text, 'php', $wrapper);\n }\n }", "public function inline($format, $args = array());", "function yy_r171()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->_retvalue = '(string)(' . $this->yystack[$this->yyidx + 0]->minor . ')';\n } else {\n $this->db_quote_code_buffer .= 'echo (string)(' . $this->yystack[$this->yyidx + 0]->minor . ');';\n $this->_retvalue = false;\n }\n }" ]
[ "0.6459748", "0.6039039", "0.5938667", "0.5829809", "0.5456763", "0.5279273", "0.52373314", "0.5202673", "0.5161362", "0.5130862", "0.510167", "0.50681365", "0.49920195", "0.49580127", "0.4946447", "0.49372798", "0.48961148", "0.48641652", "0.48485968", "0.48265085", "0.482643", "0.4820687", "0.47838128", "0.47828174", "0.47815546", "0.4770939", "0.47645056", "0.4754748", "0.47438222", "0.47421974" ]
0.63575196
1
Parses the user response, returning a simple answer. The way in which the user's response is parsed depends on the Response Mode.
private function parse_response(array $response) { //strip all leading and trailing whitespace from the answer $response['answer'] = trim($response['answer']); //interpret the user's reponse according to the reponse mode switch($this->response_mode) { //handle STRING-mode respones case qtype_scripted_response_mode::MODE_STRING: //return the answer as-is, as we already recieved a string return strtolower($response['answer']); //handle STRING-mode respones case qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE: //return the answer as-is, as we already recieved a string return $response['answer']; //handle DECIMAL-mode responses case qtype_scripted_response_mode::MODE_NUMERIC: //if the string was empty, return false, a non-numeric form of zero if($response['answer'] === '') return false; //get a floating-point interpretation of the answer return floatval($response['answer']); //handle HEXADECIMAL-mode responses case qtype_scripted_response_mode::MODE_HEXADECIMAL: //if the user entered a number in C format, parse it using PHP's native recognition of hex numbers if(substr($response['answer'], 0, 2) === "0x") return intval(substr($response['answer'], 2), 16); //if the user entered the hex number in HCS08 format (i.e. $0F), accept that, as well elseif(substr($response['answer'], 0, 1) == '$') return hexdec(substr($response['answer'], 1)); //otherwise, return the answer parsed as a hex number else return hexdec($response['answer']); //handle BINARY-mode respones case qtype_scripted_response_mode::MODE_BINARY: //if the user entered a number in 0b format (used by some calculators), accept it if(substr($response['answer'], 0, 2) === "0b") return bindec(substr($response['answer'], 2), 16); //if the user entered the binary number in HCS08 format (i.e. %0F), accept that, as well elseif(substr($response['answer'], 0, 1) == '%') return bindec(substr($response['answer'], 1)); //otherwise, return the answer parsed as a binary number else return bindec($response['answer']); //handle OCTAL-mode case qtype_scripted_response_mode::MODE_OCTAL: //if the user entered a number in 0o format, accept it, for consistency with other prefix strings //(as far as I know, no major format uses this) if(substr($response['answer'], 0, 2) === "0o") return octdec(substr($response['answer'], 2), 16); //if the user entered the binary number in HCS08 format (i.e. @0F), accept that, as well elseif(substr($response['answer'], 0, 1) == '@') return octdec(substr($response['answer'], 1)); //otherwise, return the answer parsed as a octal number else return octdec($response['answer']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function parse_api_response();", "public function parseResponse() {\r\r\n\r\r\n return true;\r\r\n }", "abstract protected function parseResponse($response);", "public function parse()\n\t{\n\t\t//we don't need to hit the API everytime parse is called\n\t\tif (!$this->response)\n\t\t\t$this->response = $this->request->execute();\n\t\t\n\t\treturn $this->invokeParserMethod();\t\n\t}", "function MesiboParseResponse($response) {\n\t$result = json_decode($response, true);\n\tif(is_null($result)) \n\t\treturn false;\n\treturn $result;\n}", "public function answer()\n\t{\n\t\tif (!$this->typeResponseCode)\n\t\t\treturn $this->answerTwoHundred($this->data);\n\t\telse\n\t\t\treturn $this->answerThroughHeader($this->data);\n\t}", "private function response() {\n $reply = trim(fgets($this -> __sock, 512));\n switch(substr($reply, 0, 1)) {\n /* Error reply */\n case '-':\n trigger_error('ERROR (' . trim($reply) . ')', E_USER_ERROR);\n /* Inline reply */\n case '+':\n $response = substr(trim($reply), 1);\n if($response === 'OK') $response = true;\n break;\n /* Bulk reply */\n case '$':\n $response = null;\n if($reply === '$-1') break;\n $read = 0;\n $size = intval(substr($reply, 1));\n if($size > 0) {\n do {\n $block_size = ($size - $read) > 1024 ? 1024 : ($size - $read);\n $r = fread($this -> __sock, $block_size);\n if($r === false)\n trigger_error('READ FROM SERVER ERROR', E_USER_ERROR);\n else {\n $read += strlen($r);\n $response .= $r;\n }\n } while($read < $size);\n }\n fread($this -> __sock, 2); /* CRLF */\n break;\n /* Multi-bulk reply */\n case '*':\n $count = intval(substr($reply, 1));\n if($count === -1) return null;\n $response = array();\n for($i = 0; $i < $count; $i++)\n $response[] = $this -> response();\n break;\n /* Integer reply */\n case ':':\n $response = intval(substr(trim($reply), 1));\n break;\n default:\n trigger_error('UNKNOWN RESPONSE ERROR', E_USER_ERROR);\n }\n return $response;\n }", "public function getResponse() {\n if($this->response) {\n $response = explode($this->responseDelimeter, $this->response);\n if(is_array($response)) {\n return $response;\n }\n else {\n return '';\n } \n }\n else {\n return '';\n }\n }", "private function parseResponse() {\n $headers = Strings::split(substr($this->response, 0, $this->info['header_size']), \"~[\\n\\r]+~\", PREG_SPLIT_NO_EMPTY);\n $this->headers = static::parseHeaders($headers);\n $this->body = substr($this->response, $this->info['header_size']);\n $this->response = NULL;\n }", "protected function simpleAnswer($response) {\n $response = strtoupper($response);\n\n if ($response === 'Y' || $response === 'YES')\n return TRUE;\n else if ($response === 'N' || $response === 'NO')\n return FALSE;\n else\n return $this->promptMessage('yesorno') . PHP_EOL;\n }", "protected final function parse_model_response($data = NULL) {\n \t$parsed = false;\n\t\tswitch ($this->request_method) {\n\t\t\tcase 'read':\n\t\t\t\t$parsed = $this->parse_model_response_read($data);\t\t\t\t\t\n\t\t\tbreak;\t\t\t\t\n\t\t\tcase 'create':\t\n\t\t\t\t$parsed = $this->parse_model_response_create($data);\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'update':\n\t\t\t\t$parsed = $this->parse_model_response_update($data);\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\t$parsed = $this->parse_model_response_delete($data);\t\t\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif($parsed === false) {\n\t\t\t$this->set_error( 355, 'No response was parsed' );\n\t\t\treturn;\t\n\t\t}\n\t\t\n\t\t$this->parsed_model_response = $parsed;\n }", "public function parseResponse($message);", "function http_parse_response()\n\t{\n\t\tlist($headers, $body) = explode(\"\\r\\n\\r\\n\", $this->http_response, 2);\n\t\t$this->http_parse_headers($headers);\n\n\t\tif(isset($this->http_response_headers['Transfer-Encoding']) && 'chunked' == $this->http_response_headers['Transfer-Encoding']):\n \t\t$this->http_response_body = $this->http_chunked_decode($body);\n\t\telse:\n\t\t\t$this->http_response_body = $body;\n\t\tendif;\n\n\t\t$this->http_set_content_type($this->http_default_content_type);\n\t}", "private function ParseResponse($Response)\n\t{\n\t\tif (!is_array($Response))\n\t\t{\n\t\t\t// $this -> SetError(self::ERROR_INVALID_RESPONSE, 'Invalid response from Premium, cannot parse');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this -> SetError(self::ERROR_NONE, '');\n\n\t\t$Body = false;\n\t\tif ($Response['Body'])\n\t\t{\n\t\t\t$Body = json_decode($Response['Body'], true);\n\t\t}\n\n\t\tif (!$Response['Body'])\n\t\t{\n\t\t\t$this -> SetError(self::ERROR_EMPTY_RESPONSE, 'Empty response from Premium');\n\t\t}\n\t\telseif (!$Body)\n\t\t{\n\t\t\t$ErrorMessage = 'Invalid response from Premium, cannot parse';\n\t\t\tif (is_null($Body))\n\t\t\t{\n\t\t\t\t// JSON parsing error\n\t\t\t\t$ErrorMessage = 'JSON parsing error'.(function_exists('json_last_error') ? ' #'.json_last_error() : '');\n\t\t\t}\n\n\t\t\t$this -> SetError(self::ERROR_INVALID_RESPONSE, $ErrorMessage);\n\t\t}\n\t\telseif (!empty($Body['ErrNo']))\n\t\t{\n\t\t\t$this -> SetError($Body['ErrNo'], $Body['Error']);\n\t\t}\n\n\t\treturn $Body;\n\t}", "public function getResponse() {\n \n parse_str($this->response, $return);\n return $return;\n }", "public function response ();", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n global $textTpl;\n if (!empty($postStr))\n {\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $type = $postObj->MsgType;\n\n switch ($type)\n {\n case \"event\":\n $resultStr = GetEventMessage($postObj);\n break;\n case \"location\":\n $resultStr = GetLocationMessage($postObj);\n break;\n case \"text\":\n $resultStr = GetTextMessage($postObj);\n break;\n default:\n $resultStr = GetTextMessage($postObj);\n //$resultStr = GetDefaultMessage($postObj);\n break;\n }\n\n RecordInputContent($postObj); //保存用户输入的所有内容\n RefleshUserLoginTime($postObj); // 更新用户登录的最新时间\n\n echo $resultStr;\n }\n else\n {\n echo \"\";\n exit;\n }\n }", "public function responseParser($response, $homebookmaker, $awaybookmaker) {\n // TODO implement here\n }", "protected function parseResponse()\n {\n // get the status code from response.\n $statusCode = $this->httpResponse->getStatusCode();\n\n // set as error, if http status code is not between 200 and 299 (inclusive).\n $this->networkError = !($statusCode >= 200 && $statusCode <= 299);\n\n // decode the response body.\n $body = $this->decodeBody();\n\n // stop when no body is present.\n if ($body) {\n // parse the response id from the body.\n $this->id = (int) array_get($body, 'id', null);\n\n // set as error when there is a an error key and it's not null.\n $this->isError = array_get($body, 'error', null) !== null;\n\n // parse the response data, from result or error.\n $this->data = collect(array_get($body, $this->isError ? 'error' : 'result', []));\n }\n\n // just return the response body.\n return $this->body;\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }", "abstract public function response();", "public function answer()\n\t{\n\n $twiml = new Services_Twilio_Twiml();\n\n $gather = $twiml->gather([\n 'method' => 'GET',\n 'action' => 'twilio/check-account'\n ]);\n $gather->say(\"Hello, thanks for calling Phlare. Please enter your account number, followed by the pound sign.\");\n\n return $twiml;\n\n\t}", "protected function parse_response($response) {\n $length = strlen(PHP_INT_MAX);\n $response = preg_replace('/\"(id|in_reply_to_status_id)\":(\\d{' . $length . ',})/', '\"\\1\":\"\\2\"', $response);\n return json_decode($response, TRUE);\n }", "function parse() {\r\n\t\t/* JSON */\r\n\t\tif (strpos ( $this->response_content_type, \"application/json\" ) !== false) {\r\n\t\t\t$this->response_parsed = json_decode($this->response_body);\r\n\t\t\t/* JSON STREAM */\r\n\t\t} elseif (strpos ( $this->response_content_type, \"json-stream\" ) !== false) {\r\n\t\t\t$stream = split ( \"\\n\", $this->response_body );\r\n\t\t\tif (count ( $stream ) < $stream [0] ['ResultLength']) {\r\n\t\t\t\t// echo \"Invalid JSON Stream. Result Length:\".count($stream);\r\n\t\t\t\t$this->client->status_code = 400;\r\n\t\t\t\t$GLOBALS ['ResultStack']->pushNew ( \"Invalid JSON Stream\", ERROR );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$jsonServer = new JSON ( JSON_LOOSE_TYPE );\r\n\t\t\t$this->response_parsed = array ();\r\n\t\t\tforeach ( $stream as $line )\r\n\t\t\t\t$this->response_parsed [] = $jsonServer->decode ( $line );\r\n\t\t\t/* DEFAULT */\r\n\t\t} else {\r\n\t\t\t$this->response_parsed = $this->response_body;\r\n\t\t}\r\n\t}", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();" ]
[ "0.65729606", "0.65415114", "0.6383206", "0.6268041", "0.6210723", "0.61669755", "0.61481166", "0.6058604", "0.60233974", "0.591543", "0.59007543", "0.5894681", "0.5889265", "0.5886553", "0.587376", "0.58668524", "0.5864284", "0.58561826", "0.58544344", "0.5828043", "0.5826493", "0.5795163", "0.57894737", "0.57814324", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5781214" ]
0.71726936
0
Evaluates an answer object, replacing its answer expression with an evaluated result.
public function evaluate_answer($answerobj, $interpreter = null) { //Create a copy of the given answer... $answer = clone $answerobj; //create a new interpreter if(!$interpreter) { $interpreter = $this->create_interpreter($this->vars, $this->funcs); } //evaluate the correct answer to get a given reponse, if possible try { $answer->answer = $interpreter->evaluate($answer->answer); } catch(qtype_scripted_language_exception $e) { debugging($e->getMessage()); return null; } //return the correct answer depending on the response mode switch($this->response_mode) { //if the answer is expected in binary, return the answer in binary case qtype_scripted_response_mode::MODE_BINARY: $answer->answer = decbin($answer->answer); break; //if the answer is expected in hex, return the answer in hex case qtype_scripted_response_mode::MODE_HEXADECIMAL: $answer->answer = dechex($answer->answer); break; //if the answer is expected in binary, return the answer in binary case qtype_scripted_response_mode::MODE_OCTAL: $answer->answer = decoct($answer->answer); break; } return $answer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function evaluate();", "public function evaluate();", "function e($expr) \n {\n //call the core evaluation method\n return $this->evaluate($expr);\n }", "public function compare_response_with_answer(array $response, question_answer $answer) { \n\n // Tentative: if this response isn't gradable, it can't match any of the answers.\n if(!$this->is_gradable_response($response)) {\n return false;\n }\n\n //parse the response according to the selected response mode\n $value = $this->parse_response($response);\n \n //Create a new interpreter using the serialized question state.\n $interpreter = $this->create_interpreter($this->vars, $this->funcs);\n\n //Process the answer according to the interpretation mode. \n switch($this->answer_mode)\n {\n //for direct/answer modes,\n case qtype_scripted_answer_mode::MODE_MUST_EQUAL:\n \n //evaluate the given answer formula\n try {\n $ans = $interpreter->evaluate($answer->answer);\n } catch(qtype_scripted_language_exception $e) {\n return false;\n }\n \n //if we're comparing in a non-case-sensitive manner, convert the _answer_ to lowercase\n if($this->response_mode == qtype_scripted_response_mode::MODE_STRING) {\n $ans = strtolower((string)$ans);\n }\n\n //if the two are both numeric, compare them loosely, without regard to type; so 5 == \"05\" is true\n if(is_numeric($ans) && is_numeric($value)) {\n return $ans == $value;\n }\n //otherwise, compare them stricly; so \"5a\" !== 5; (note that, had we performed a loose compare, \"5a\" == 5 is true due to type juggling >.<)\n else {\n return $ans === $value;\n }\n \n //case 'boolean':\n case qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE:\n \n //Define the variable \"resp\" in the context of the interpreter.\n //Also define response, as per the principle of least astonishment.\n $interpreter->resp = $value;\n $interpreter->response = $value;\n\n try {\n //and return true iff the answer evaluates to True\n return (bool)$interpreter->evaluate($answer->answer);\n }\n //If an error occurs during evalution, return false.\n catch(qtype_scripted_language_exception $e) {\n return false;\n }\n \n default:\n \n //something's gone wrong\n throw new coding_exception('Invalid grading mode for the scripted qtype.');\n \n }\n }", "public function evaluate()\n {\n $stack = [];\n $stackIndex = -1;\n $postfix = $this->getPostfix();\n if (count($postfix) === 0) {\n return null;\n }\n $params = $this->getParams();\n foreach ($postfix as $value) {\n if (self::isMathOperator($value) === false) {\n $operand = $value;\n if (is_numeric($value) === false) {\n if (array_key_exists($value, $params) === true) {\n $operand = $params[$value];\n } else {\n throw new \\InvalidArgumentException('Invalid given variable parameter detected');\n }\n }\n $stack[++$stackIndex] = $operand;\n } else {\n $operand2 = $stack[$stackIndex--];\n $operand1 = $stack[$stackIndex--];\n $stack[++$stackIndex] = self::calculate($operand1, $operand2, $value);\n }\n }\n $this->Result = $stack[$stackIndex];\n $this->HasBeenEvaluated = true;\n }", "function evaluate($expr, $local_context = false, $function_context = false) \n {\n //clear the record of the last error\n $this->last_error = null;\n\n //clear the current assignment record\n $this->assignment_target = null;\n\n //store the initial execution context\n $initial_vars = $this->vars;\n\n //assume an initial return value of false\n $retval = false;\n\n //and strip off any leading/trailing whitespace\n $expr = trim($expr);\n\n //remove any semicolons from the end of the expression\n if (substr($expr, -1, 1) == ';') \n $expr = substr($expr, 0, strlen($expr)-1); \n\n //perform common preprocessing tasks on the expression\n //(this resolves TCL-style variables, and allows TCL-style function calls)\n $expr = $this->preprocess($expr);\n\n //if the given expression is a variable assignment:\n if (preg_match(MATHSCRIPT_VAR_ASSIGNMENT, $expr, $matches)) \n {\n //set the assignment target\n $this->assignment_target = $matches[1];\n\n //parse the data to be assigned\n $to_assign = $this->evaluate_infix($matches[2]);\n\n //if an error occurred during processing of the RHS (data to be assigned), return false\n if ($to_assign === false) \n return false; \n\n //otherwise, set the relevant variable\n $this->vars[$this->assignment_target] = $to_assign;\n\n //and return the value that resulted from the assignment\n $retval = $to_assign; // and return the resulting value\n }\n\n elseif(preg_match(MATHSCRIPT_VAR_OPERATION_ASSIGNMENT, $expr, $matches))\n {\n //get the initial value of the left-hand-side of the expression\n $lhs = $this->dereference($matches[1]);\n\n //if it does not exist, fail\n if($lhs === null)\n return false;\n\n //compute the RHS of the expression, which will be added to the LHS\n $rhs = $this->evaluate_infix($matches[3]);\n\n //if we couldn't compute the RHS, fail\n if($rhs === false)\n return false;\n\n //call the correct opreator for this block\n $handler = self::$operators[$matches[2]]['handler'];\n $result = call_user_func($handler, $this, $lhs, $rhs);\n\n //and store the result\n $this->vars[$matches[1]] = $result;\n\n //and return the value that resulted from the assignment\n $retval = $result;\n }\n\n //handle function definitions \n elseif (preg_match(MATHSCRIPT_FUNCTION_DEF, $expr, $matches))\n {\n\n //extract the function name\n $function_name = $matches[1];\n\n //ensure we're not able to override a built-in function (user defined functions can be overridden)\n if ($this->extensions->function_exists($function_name))\n return $this->trigger('cannot redefine built-in function \"'.$matches[1]().'\"');\n\n //parse the argument list for the function\n $args = explode(\",\", preg_replace(\"/\\s+/\", \"\", $matches[2])); // get the arguments\n\n //convert the infix expression for the function to postfix\n $stack = $this->infix_to_postfix($matches[3]);\n\n //if we failed to parse the infix expression, return false\n if ($stack === false) \n return false;\n\n //finally, store the function definition\n $this->user_functions[$function_name] = array(MATHSCRIPT_ARGUMENTS => $args, MATHSCRIPT_FUNCTION_BODY=> $stack);\n\n //and return, indicating success\n $retval = true;\n \n } \n //if the line wasn't any of our special cases above, attempt to evaluate it directly\n else\n {\n //if the code was empty (or an straight zero), return 0 (this is typical of comments)\n if(empty($expr))\n return 0;\n\n //evaluate the given function, and get the return value\n $retval = $this->evaluate_infix($expr); \n\n }\n\n //if we're inside of a function context, don't allow changes to the global scope\n if($function_context)\n {\n $this->vars = $initial_vars;\n }\n //if this evaluation is occurring in a local context\n elseif($local_context)\n {\n //delete any variables that were not present in the initial list of variables\n //this establishes a \"local context\"\n foreach($this->vars as $name => $value)\n if(!array_key_exists($name, $initial_vars))\n unset($this->vars[$name]);\n }\n\n //return the previously-set return value\n return $retval;\n\n }", "public function answer() {\n\n\t\t/**\n\t\t * Fires right before giving the answer.\n\t\t */\n\t\tdo_action( self::ACTION );\n\n\t\t/**\n\t\t * Filters the answer.\n\t\t *\n\t\t * @param string $answer The answer.\n\t\t */\n\t\treturn (string) apply_filters( self::FILTER, '42' );\n\t}", "public function testEvaluate()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"3 2 1 + *\");\n $this->assertEquals(9, $retval);\n }", "function answer()\n {\n if( $this->Answer !== false )\n return $this->Answer;\n\n $http = eZHTTPTool::instance();\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\n if( $http->hasPostVariable( $postSurveyAnswer ) )\n {\n $surveyAnswer = $http->postVariable( $postSurveyAnswer );\n return $surveyAnswer;\n }\n\n return false;\n }", "public function getResultSelf( $teacherId, $AnswerQuestions ){\n\n $resultEvaluation = 0;\n foreach($AnswerQuestions as $eachAnswerQuestion){\n\n $answerQuestion = AnswerQuestion::where('id',$eachAnswerQuestion['id'])->first();\n $value = $answerQuestion->answer()->first()->value;\n $evaluationTypeId = $answerQuestion->question()->first()->evaluation_type_id;\n $evaluationTypeParent = EvaluationType::where('id',$evaluationTypeId)->first();\n $percentage = $evaluationTypeParent->parent()->first()->percentage;\n\n $resultEvaluation += ($value*$percentage)/100;\n\n }\n $this->createEvaluation($teacherId,$evaluationTypeId,$resultEvaluation);\n }", "function submitEvaluation($arrayQuestion){\n\n\t\tglobal $conn;\n\n\t\t$numberRightAnswer = 0;\n\n\t\tfor($i = 0; $i < count($arrayQuestion); $i++){\n\n\t\t\t$questionId = $arrayQuestion[$i]['questionId'];\n\t\t\t$answer = $arrayQuestion[$i]['answer'];\t\n\t\t\t\n\t\t\tif(isQuestionAnswerCorrect($questionId, $answer) == 1){\n\n\t\t\t\t$numberRightAnswer++;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $numberRightAnswer/(count($arrayQuestion));\n\n\t}", "function answer()\r\n {\r\n //option 1) check for already defined\r\n if (strlen($this->Answer)) {\r\n return $this->Answer;\r\n }\r\n\r\n $http = eZHTTPTool::instance();\r\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\r\n\r\n //option 2) check for answer in $_POST (trick from processViewAction or normal post)\r\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\r\n if ($http->hasPostVariable($postSurveyAnswer) && strlen($http->postVariable($postSurveyAnswer))) {\r\n $surveyAnswer = $http->postVariable($postSurveyAnswer);\r\n\r\n return $surveyAnswer;\r\n }\r\n\r\n return $this->Default;\r\n }", "public function evaluate(Node $node): void\n {\n switch (true) {\n case $node instanceof Func:\n $this->functionExpression($node);\n break;\n\n case $node instanceof Lambda:\n $this->lambdaExpression($node);\n break;\n\n case $node instanceof Property:\n $this->propertyExpression($node);\n break;\n\n case $node instanceof Literal:\n $this->literalExpression($node);\n break;\n\n case $node instanceof Operator:\n $this->operatorExpression($node);\n break;\n }\n }", "public function answer($id, $answer) {\n $this->run('answer', array($id, $answer));\n }", "function correctAnswer() {\n\t}", "function formValue(\\Jazzee\\Entity\\Answer $answer);", "function displayValue(\\Jazzee\\Entity\\Answer $answer);", "public function testQuery(\\Jazzee\\Entity\\Answer $answer, \\stdClass $obj);", "function answer()\r\n {\r\n /* answer is not stored */ \r\n return false;\r\n }", "public function accept($answer_id=0)\n\t{\n\t\tif (!$answer_id)\n\t\t{\n\t\t\t$this->addError(Lang::txt('No answer ID provided.'));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Load the answer\n\t\t$answer = Response::oneOrFail($answer_id);\n\n\t\t// Mark it at the chosen one\n\t\t$answer->set('state', 1);\n\t\tif (!$answer->save())\n\t\t{\n\t\t\t$this->addError($answer->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Mark the question as answered\n\t\t$this->set('state', 1);\n\n\t\t// If banking is enabled\n\t\tif ($this->config('banking'))\n\t\t{\n\t\t\t// Accepted answer is same person as question submitter?\n\t\t\tif ($this->get('created_by') == $answer->get('created_by'))\n\t\t\t{\n\t\t\t\t$reward = Transaction::getAmount('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Remove hold\n\t\t\t\tTransaction::deleteRecords('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Make credit adjustment\n\t\t\t\t$BTL_Q = new Teller(User::get('id'));\n\t\t\t\t$BTL_Q->credit_adjustment($BTL_Q->credit_summary() - $reward);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$db = App::get('db');\n\n\t\t\t\t// Calculate and distribute earned points\n\t\t\t\t$AE = new Economy($db);\n\t\t\t\t$AE->distribute_points(\n\t\t\t\t\t$this->get('id'),\n\t\t\t\t\t$this->get('created_by'),\n\t\t\t\t\t$answer->get('created_by'),\n\t\t\t\t\t'closure'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Set the reward value\n\t\t\t$this->set('reward', 0);\n\t\t}\n\n\t\t// Save changes\n\t\treturn $this->save();\n\t}", "public function check_answer() {\n $result = new stdClass;\n $result->answerid = 0;\n $result->noanswer = false;\n $result->correctanswer = false;\n $result->isessayquestion = false; // Use this to turn off review button on essay questions\n $result->response = '';\n $result->newpageid = 0; // Stay on the page\n $result->studentanswer = ''; // Use this to store student's answer(s) in order to display it on feedback page\n $result->userresponse = null;\n $result->feedback = '';\n $result->nodefaultresponse = false; // Flag for redirecting when default feedback is turned off\n return $result;\n }", "public function process()\n {\n return $this->operation->evaluate($this->operands);\n }", "public function exec()\n {\n switch ($this->oper)\n {\n case 'add':\n $this->answer = ($this->num1+$this->num2);\n $this->summary = $this->num1 . ' + ' . $this->num2 . ' = ' . $this->answer;\n break;\n\n case 'sub':\n $this->answer = ($this->num1-$this->num2);\n $this->summary = $this->num1 . ' - ' . $this->num2 . ' = ' . $this->answer;\n break;\n\n case 'mul':\n $this->answer = ($this->num1*$this->num2);\n $this->summary = $this->num1 . ' * ' . $this->num2 . ' = ' . $this->answer;\n break;\n\n case 'div':\n $this->answer = ($this->num1/$this->num2);\n $this->summary = $this->num1 . ' / ' . $this->num2 . ' = ' . $this->answer;\n break;\n\n default:\n throw new InvalidArgumentException(sprintf('\"%s\" is an invalid operation.', str_replace('_', '', $this->oper)));\n }\n }", "public function testEvaluateCatchesAndRethrowsEvaluationErrors()\n {\n $language = $this->createMock(ExpressionLanguage::class);\n $language->method('evaluate')\n ->willThrowException(new \\RuntimeException('Original Message'));\n\n $failingExpression = 'expression';\n\n $this->expectException(\\RuntimeException::class);\n $this->expectExceptionMessageRegExp(\"/.*'expression'\\\\. Original Message.*/\");\n\n $evaluator = new ExpressionEvaluator($language);\n $evaluator->evaluateWithVars($failingExpression, []);\n }", "function qtype_calculated_calculate_answer($formula, $individualdata,\n $tolerance, $tolerancetype, $answerlength, $answerformat='1', $unit='') {\n/// ->answer the correct answer\n/// ->min the lower bound for an acceptable response\n/// ->max the upper bound for an accetpable response\n\n /// Exchange formula variables with the correct values...\n global $QTYPES;\n $answer = $QTYPES['calculated']->substitute_variables_and_eval($formula, $individualdata);\n if ('1' == $answerformat) { /* Answer is to have $answerlength decimals */\n /*** Adjust to the correct number of decimals ***/\n if (stripos($answer,'e')>0 ){\n $answerlengthadd = strlen($answer)-stripos($answer,'e');\n }else {\n $answerlengthadd = 0 ;\n }\n $calculated->answer = round(floatval($answer), $answerlength+$answerlengthadd);\n\n if ($answerlength) {\n /* Try to include missing zeros at the end */\n\n if (ereg('^(.*\\\\.)(.*)$', $calculated->answer, $regs)) {\n $calculated->answer = $regs[1] . substr(\n $regs[2] . '00000000000000000000000000000000000000000x',\n 0, $answerlength)\n . $unit;\n } else {\n $calculated->answer .=\n substr('.00000000000000000000000000000000000000000x',\n 0, $answerlength + 1) . $unit;\n }\n } else {\n /* Attach unit */\n $calculated->answer .= $unit;\n }\n\n } else if ($answer) { // Significant figures does only apply if the result is non-zero\n\n // Convert to positive answer...\n if ($answer < 0) {\n $answer = -$answer;\n $sign = '-';\n } else {\n $sign = '';\n }\n\n // Determine the format 0.[1-9][0-9]* for the answer...\n $p10 = 0;\n while ($answer < 1) {\n --$p10;\n $answer *= 10;\n }\n while ($answer >= 1) {\n ++$p10;\n $answer /= 10;\n }\n // ... and have the answer rounded of to the correct length\n $answer = round($answer, $answerlength);\n\n // Have the answer written on a suitable format,\n // Either scientific or plain numeric\n if (-2 > $p10 || 4 < $p10) {\n // Use scientific format:\n $eX = 'e'.--$p10;\n $answer *= 10;\n if (1 == $answerlength) {\n $calculated->answer = $sign.$answer.$eX.$unit;\n } else {\n // Attach additional zeros at the end of $answer,\n $answer .= (1==strlen($answer) ? '.' : '')\n . '00000000000000000000000000000000000000000x';\n $calculated->answer = $sign\n .substr($answer, 0, $answerlength +1).$eX.$unit;\n }\n } else {\n // Stick to plain numeric format\n $answer *= \"1e$p10\";\n if (0.1 <= $answer / \"1e$answerlength\") {\n $calculated->answer = $sign.$answer.$unit;\n } else {\n // Could be an idea to add some zeros here\n $answer .= (ereg('^[0-9]*$', $answer) ? '.' : '')\n . '00000000000000000000000000000000000000000x';\n $oklen = $answerlength + ($p10 < 1 ? 2-$p10 : 1);\n $calculated->answer = $sign.substr($answer, 0, $oklen).$unit;\n }\n }\n\n } else {\n $calculated->answer = 0.0;\n }\n\n /// Return the result\n return $calculated;\n}", "function evaluateExpression($expression)\n\t{\n\t\treturn eval('return '.$expression.';');\n\t}", "public function getEval()\n {\n return $this->hasOne(InterEvaluadores::className(), ['id' => 'eval_id']);\n }", "public static function answer_question(array $question);", "public function get_correct_response()\n {\n //if the question is a \"must eval true\" question, we can't easily determine the answer\n if($this->answer_mode == qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE) {\n return null;\n }\n\n // Evaluate the given answer, and return a correct-response array.\n $answer = $this->evaluate_answer(parent::get_correct_answer());\n return array('answer' => $answer->answer);\n }", "function &getEvaluationByUser($questions, $active_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// collect all answers\n\t\t$answers = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_answer WHERE active_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($active_id)\n\t\t);\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tif (!is_array($answers[$row[\"question_fi\"]]))\n\t\t\t{\n\t\t\t\t$answers[$row[\"question_fi\"]] = array();\n\t\t\t}\n\t\t\tarray_push($answers[$row[\"question_fi\"]], $row);\n\t\t}\n\t\t$userdata = $this->getUserDataFromActiveId($active_id);\n\t\t$resultset = array(\n\t\t\t\"name\" => $userdata[\"fullname\"],\n\t\t\t\"firstname\" => $userdata[\"firstname\"],\n\t\t\t\"lastname\" => $userdata[\"lastname\"],\n\t\t\t\"login\" => $userdata[\"login\"],\n\t\t\t\"gender\" => $userdata[\"gender\"],\n\t\t\t\"answers\" => array()\n\t\t);\n\t\tforeach ($questions as $key => $question)\n\t\t{\n\t\t\tif (array_key_exists($key, $answers))\n\t\t\t{\n\t\t\t\t$resultset[\"answers\"][$key] = $answers[$key];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$resultset[\"answers\"][$key] = array();\n\t\t\t}\n\t\t\tsort($resultset[\"answers\"][$key]);\n\t\t}\n\t\treturn $resultset;\n\t}" ]
[ "0.64550275", "0.64550275", "0.6005985", "0.59536135", "0.5822661", "0.5607408", "0.55310565", "0.55203724", "0.5518396", "0.54791576", "0.54130846", "0.5333577", "0.52867806", "0.52827513", "0.52656186", "0.52289575", "0.51205164", "0.51036745", "0.5044132", "0.496024", "0.49467376", "0.49440587", "0.49158743", "0.491364", "0.4911817", "0.4908689", "0.49032173", "0.48957983", "0.48897344", "0.48835993" ]
0.7066424
0
Find trace by options.
protected function findTrace(array $options) { if (empty($options)) { return; } foreach ($this->getTrace() as $trace) { if ($this->hasTraceOptions($trace, $options)) { return $trace; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function trace(array $options = [])\n {\n $self = Debugger::getInstance();\n $defaults = [\n 'depth' => 999,\n 'format' => $self->_outputFormat,\n 'args' => false,\n 'start' => 0,\n 'scope' => null,\n 'exclude' => ['call_user_func_array', 'trigger_error']\n ];\n $options = Hash::merge($defaults, $options);\n $backtrace = debug_backtrace();\n $count = count($backtrace);\n $back = [];\n $_trace = [\n 'line' => '??',\n 'file' => '[internal]',\n 'class' => null,\n 'function' => '[main]'\n ];\n for ($i = $options['start']; $i < $count && $i < $options['depth']; $i++) {\n $trace = $backtrace[$i] + ['file' => '[internal]', 'line' => '??'];\n $signature = $reference = '[main]';\n\n if (isset($backtrace[$i + 1])) {\n $next = $backtrace[$i + 1] + $_trace;\n $signature = $reference = $next['function'];\n\n if (!empty($next['class'])) {\n $signature = $next['class'] . '::' . $next['function'];\n $reference = $signature . '(';\n\n if ($options['args'] && isset($next['args'])) {\n $args = [];\n\n foreach ($next['args'] as $arg) {\n $args[] = Debugger::exportVar($arg);\n }\n\n $reference .= implode(', ', $args);\n }\n\n $reference .= ')';\n }\n }\n\n if (in_array($signature, $options['exclude'])) {\n continue;\n }\n\n if ($options['format'] === 'points' && $trace['file'] !== '[internal]') {\n $back[] = ['file' => $trace['file'], 'line' => $trace['line']];\n } elseif ($options['format'] === 'array') {\n $back[] = $trace;\n } else {\n if (isset($self->_templates[$options['format']]['traceLine'])) {\n $tpl = $self->_templates[$options['format']]['traceLine'];\n } else {\n $tpl = $self->_templates['base']['traceLine'];\n }\n\n $trace['path'] = static::trimPath($trace['file']);\n $trace['reference'] = $reference;\n\n unset($trace['object'], $trace['args']);\n\n $back[] = Text::insert($tpl, $trace, ['before' => '{:', 'after' => '}']);\n }\n }\n\n if ($options['format'] === 'array' || $options['format'] === 'points') {\n return $back;\n }\n\n return implode(\"\\n\", $back);\n }", "public static function trace(array $options = []) {\n\t\t$defaults = [\n\t\t\t'depth' => 999,\n\t\t\t'format' => null,\n\t\t\t'args' => false,\n\t\t\t'start' => 0,\n\t\t\t'scope' => [],\n\t\t\t'trace' => [],\n\t\t\t'includeScope' => true,\n\t\t\t'closures' => true\n\t\t];\n\t\t$options += $defaults;\n\n\t\t$backtrace = $options['trace'] ?: debug_backtrace();\n\t\t$scope = $options['scope'];\n\t\t$count = count($backtrace);\n\t\t$back = [];\n\t\t$traceDefault = [\n\t\t\t'line' => '??', 'file' => '[internal]', 'class' => null, 'function' => '[main]'\n\t\t];\n\n\t\tfor ($i = $options['start']; $i < $count && $i < $options['depth']; $i++) {\n\t\t\t$trace = array_merge(['file' => '[internal]', 'line' => '??'], $backtrace[$i]);\n\t\t\t$function = '[main]';\n\n\t\t\tif (isset($backtrace[$i + 1])) {\n\t\t\t\t$next = $backtrace[$i + 1] + $traceDefault;\n\t\t\t\t$function = $next['function'];\n\n\t\t\t\tif (!empty($next['class'])) {\n\t\t\t\t\t$function = $next['class'] . '::' . $function . '(';\n\t\t\t\t\tif ($options['args'] && isset($next['args'])) {\n\t\t\t\t\t\t$args = array_map(['static', 'export'], $next['args']);\n\t\t\t\t\t\t$function .= join(', ', $args);\n\t\t\t\t\t}\n\t\t\t\t\t$function .= ')';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($options['closures'] && strpos($function, '{closure}') !== false) {\n\t\t\t\t$function = static::_closureDef($backtrace[$i], $function);\n\t\t\t}\n\t\t\tif (in_array($function, ['call_user_func_array', 'trigger_error'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$trace['functionRef'] = $function;\n\n\t\t\tif ($options['format'] === 'points' && $trace['file'] !== '[internal]') {\n\t\t\t\t$back[] = ['file' => $trace['file'], 'line' => $trace['line']];\n\t\t\t} elseif (is_string($options['format']) && $options['format'] !== 'array') {\n\t\t\t\t$back[] = Text::insert($options['format'], array_map(\n\t\t\t\t\tfunction($data) { return is_object($data) ? get_class($data) : $data; },\n\t\t\t\t\t$trace\n\t\t\t\t));\n\t\t\t} elseif (empty($options['format'])) {\n\t\t\t\t$back[] = $function . ' - ' . $trace['file'] . ', line ' . $trace['line'];\n\t\t\t} else {\n\t\t\t\t$back[] = $trace;\n\t\t\t}\n\n\t\t\tif (!empty($scope) && array_intersect_assoc($scope, $trace) == $scope) {\n\t\t\t\tif (!$options['includeScope']) {\n\t\t\t\t\t$back = array_slice($back, 0, count($back) - 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($options['format'] === 'array' || $options['format'] === 'points') {\n\t\t\treturn $back;\n\t\t}\n\t\treturn join(\"\\n\", $back);\n\t}", "public static function get($options = [])\n\t{\n\t\t$backtraceOptions = isset($options['arguments'])\n\t\t\t? DEBUG_BACKTRACE_PROVIDE_OBJECT : DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS;\n\t\t$limit = isset($options['limit']) ? $options['limit'] : 0;\n\n\t\treturn static::from(debug_backtrace($backtraceOptions, $limit));\n\t}", "public function search_pill($options=NULL){\n\t\tforeach($options as $key=>$value)\n\t\t{\n\t\t\tif (array_key_exists($key,self::$base_options)){\n\t\t\t\tif(is_array(self::$base_options[$key])){\n\t\t\t\t\tif(in_array($value,self::$base_options[$key]) || array_key_exists(strtoupper($value),self::$base_options[$key]))\n\t\t\t\t\t// allows to use either the key name or the value to define what gets passed, example : you can say YELLOW or C48330 \n\t\t\t\t\t\t$data[$key] = (in_array($value,self::$base_options[$key])? self::$base_options[$key][strtoupper($value)]:$value);\n\t\t\t\t}else{\n\t\t\t\t\t$data[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data['key'] = self::$api_key;\n\t\treturn self::_request(self::$api_url,$data);\n\t}", "abstract public function getOptions();", "protected static abstract function getOptions();", "function get_trace(int $options = 0, int $limit = 0, int $index = null, string $field = null, int $slice = null): mixed\n{\n $stack = debug_backtrace($options, limit: $limit ? $limit + 1 : 0);\n\n // Drop self.\n array_shift($stack);\n\n // When slice wanted (@internal).\n $slice && $stack = array_slice($stack, $slice);\n\n foreach ($stack as $i => $trace) {\n $trace = [\n // Index.\n '#' => $i,\n // For \"[internal function]\", \"{closure}\" stuff.\n 'file' => $trace['file'] ?? null,\n 'line' => $trace['line'] ?? null,\n ] + $trace + [\n // Additions.\n 'callee' => $trace['function'] ?? null,\n 'caller' => null, 'callerClass' => null, 'callerMethod' => null,\n ];\n\n if (isset($trace['file'], $trace['line'])) {\n $trace['callPath'] = $trace['file'] . ':' . $trace['line'];\n } else {\n $trace['callPath'] = '[internal function]:';\n }\n\n if (isset($trace['class'])) {\n $trace['method'] = $trace['function'];\n $trace['methodType'] = ($trace['type'] == '::') ? 'static' : 'non-static';\n }\n if (isset($stack[$i + 1]['function'])) {\n $trace['caller'] = $stack[$i + 1]['function'];\n }\n if (isset($stack[$i + 1]['class'])) {\n $trace['callerClass'] = $stack[$i + 1]['class'];\n $trace['callerMethod'] = sprintf('%s::%s', $stack[$i + 1]['class'], $stack[$i + 1]['function']);\n }\n\n $stack[$i] = $trace;\n }\n\n return is_null($index) ? $stack : ($stack[$index][$field] ?? $stack[$index] ?? null);\n}", "public function getTrace();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function _getOptions($options)\n {\n }", "public function find($options=array())\n {\n $options = array_merge(get_object_vars($this->data), $options);\n $it = $this->createRecordIterator();\n\n foreach($options as $k => $v) {\n $it->where($k, $v);\n }\n\n if ($this->siteField && !isset($options[$this->siteField])) {\n $it->where($this->siteField, $this->getSiteId());\n }\n\n $ar = $it->first();\n\n if ($ar) {\n $this->loadFromArray($ar->getValuesAsArray());\n return true;\n } else {\n $this->emptyRecord();\n return false;\n }\n }", "abstract function options();", "public function getStreet(array $options = []);", "static function find($options = array(), $options_for_object = array()) {\n $options[\"left_join\"][] = array(\"table\" => \"versions\",\n \"where\" => \"extension_id = extensions.id\");\n\n $options[\"select\"][] = \"extensions.*\";\n $options[\"select\"][] = \"MAX(versions.created_at) AS last_update\";\n\n $options[\"group\"][] = \"id\";\n\n $options[\"order\"] = array(\"__last_update DESC\", \"extensions.id DESC\");\n\n return parent::search(get_class(), $options, $options_for_object);\n }", "function getOptions() ;" ]
[ "0.5398092", "0.51319474", "0.5119972", "0.48672327", "0.47193208", "0.47091642", "0.46326286", "0.46305194", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46076763", "0.4580049", "0.45729062", "0.45726898", "0.45638624", "0.4554593" ]
0.78948694
0
UnMangle and email address
function UnMangle($email) { if (AT_MANGLE != "") $email = str_replace(AT_MANGLE,"@",$email); return ($email); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function string_email( $p_string ) \r\n{\r\n\t$p_string = string_strip_hrefs( $p_string );\r\n\treturn $p_string;\r\n}", "function mangle_email($s) {\r\n\treturn preg_match('/([^@\\s]+)@([-a-z0-9]+\\.)+[a-z]{2,}/is', '<$1@...>', $s);\r\n}", "public static function email($email) {\n\t\treturn str_replace('@', '&#64;', static::obfuscate($email));\n\t}", "function clean_email($email = \"\")\n\t{\n\t\t$email = trim($email);\n\t\t\n\t\t$email = str_replace( \" \", \"\", $email );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check for more than 1 @ symbol\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( substr_count( $email, '@' ) > 1 )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n \t$email = preg_replace( \"#[\\;\\#\\n\\r\\*\\'\\\"<>&\\%\\!\\(\\)\\{\\}\\[\\]\\?\\\\/\\s]#\", \"\", $email );\n \t\n \tif ( preg_match( \"/^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,4})(\\]?)$/\", $email) )\n \t{\n \t\treturn $email;\n \t}\n \telse\n \t{\n \t\treturn FALSE;\n \t}\n\t}", "function sanitize_email($email)\n {\n }", "function charrestore_validemail($email)\n{\n\t$is_valid = TRUE;\n\t$atIndex = strrpos($email, \"@\");\n\tif( is_bool($atIndex) && !$atIndex )\n\t{\n\t\t$is_valid = FALSE;\n\t}\n\telse\n\t{\n\t\t$domain = substr($email, $atIndex+1);\n\t\t$local = substr($email, 0, $atIndex);\n\t\t$localLen = strlen($local);\n\t\t$domainLen = strlen($domain);\n\t\tif( $localLen < 1 || $localLen > 64 )\n\t\t{\n\t\t\t// local part length exceeded\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( $domainLen < 1 || $domainLen > 255 )\n\t\t{\n\t\t\t// domain part length exceeded\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( $local[0] == '.' || $local[$localLen-1] == '.' )\n\t\t{\n\t\t\t// local part starts or ends with '.'\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( preg_match('/\\\\.\\\\./', $local) )\n\t\t{\n\t\t\t// local part has two consecutive dots\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( !preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain) )\n\t\t{\n\t\t\t// character not valid in domain part\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( preg_match('/\\\\.\\\\./', $domain))\n\t\t{\n\t\t\t// domain part has two consecutive dots\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( !preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/', str_replace(\"\\\\\\\\\",\"\",$local)) )\n\t\t{\n\t\t\t// character not valid in local part unless \n\t\t\t// local part is quoted\n\t\t\tif (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t\t{\n\t\t\t\t$is_valid = FALSE;\n\t\t\t}\n\t\t}\n\t\tif ($is_valid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\")) )\n\t\t{\n\t\t\t// domain not found in DNS\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t}\n\treturn $is_valid;\n}", "public function obfuscate()\n {\n $string = $this->getStringspector()->getString();\n\n $emailAddressMatches = array();\n $emailAddressFound = (bool) preg_match_all(self::REG_EXP, $string, $emailAddressMatches);\n\n if (!$emailAddressFound) {\n return;\n }\n\n foreach ($emailAddressMatches[0] as $emailAddress) {\n $obfuscatedEmailAddress = func_num_args() ? func_get_arg(0) : str_repeat('*', strlen($emailAddress));\n $string = str_replace($emailAddress, $obfuscatedEmailAddress, $string);\n }\n\n $this->getStringspector()->setString($string);\n }", "private function decode_mail_envelope_address($address) {\n\n $decoded_address = '';\n\n if (strlen($address) > 0) {\n\n // '$address' could be '[email protected]' or 'Max Power <[email protected]>' or FALSE if not found\n\n $pos = strpos($address, '<');\n\n if ($pos !== false) {\n\n // alias found - split alias, user and domain\n\n $alias = substr($address, 0, ($pos - 1));\n $address = substr($address, ($pos + 1), (strlen($address) - 2));\n\n list($user, $domain) = explode('@', $address);\n\n $decoded_address = '((\"' . $alias . '\" NIL \"' . $user . '\" \"' . $domain . '\"))';\n } else {\n\n // alias not found - split user and domain\n\n list($user, $domain) = explode('@', $address);\n\n $decoded_address = '((NIL NIL \"' . $user . '\" \"' . $domain . '\"))';\n }\n } else {\n // nothing found\n $decoded_address = 'NIL';\n }\n\n return $decoded_address;\n }", "function sEmail( $email )\r\n\t\t{\r\n\t\t return filter_var( $email, FILTER_SANITIZE_EMAIL );\r\n\t\t \r\n\t\t}", "public static function normalizeAddress(PhutilEmailAddress $address) {\n $raw_address = $address->getAddress();\n $raw_address = phutil_utf8_strtolower($raw_address);\n $raw_address = trim($raw_address);\n\n // If a mailbox prefix is configured and present, strip it off.\n $prefix_key = 'metamta.single-reply-handler-prefix';\n $prefix = PhabricatorEnv::getEnvConfig($prefix_key);\n\n if (phutil_nonempty_string($prefix)) {\n $prefix = $prefix.'+';\n $len = strlen($prefix);\n\n if (!strncasecmp($raw_address, $prefix, $len)) {\n $raw_address = substr($raw_address, $len);\n }\n }\n\n return id(clone $address)\n ->setAddress($raw_address);\n }", "function MaskUserEMail($email){\n\n\t\t$maskedEMail = '';\n\t\t$positionOfAt = strpos($email, '@');\n\t\t$maskedEMail .= substr($email, 0,1);\n\t\tfor($i=1; $i < strlen($email); $i++) {\n\t\t\tif($i < $positionOfAt-1 || $i > $positionOfAt + 1)\n\t\t\t\t$maskedEMail .= '*';\n\t\t\telse\n\t\t\t\t$maskedEMail .= substr($email, $i,1);\n\t\t}\n\t\t$maskedEMail .= substr($email, $i-1,1);\n\t\treturn $maskedEMail;\n\t}", "function is_email_address_unsafe($user_email)\n {\n }", "private function resolve_email_address($email_address)\n\t{\n\t\tif (is_string($email_address)) return $email_address;\n\t\tif (is_array($email_address)) return $this->implode_email_addresses($email_address);\n\t\tif ($email_address instanceof Member) return $email_address->Email; //The Member class cannot be modified to implement the EmailAddressProvider interface, so exceptionally handle it here.\n\t\tif (!$email_address instanceof EmailAddressProvider)\n\t\t{\n\t\t\tthrow new InvalidArgumentException(__METHOD__ . ': Parameter $email_address must either be a string or an instance of a class that implements the EmailAddressProvider interface.');\n\t\t}\n\t\treturn $this->implode_email_addresses($email_address->getEmailAddresses());\n\t}", "function obfuscate_email($email) {\n\t$out = \"\";\n\t$len = strlen($email);\n\n\tfor($i = 0; $i < $len; $i++)\n\t\t$out .= \"&#\" . ord($email[$i]) . \";\";\n\n\treturn $out;\n}", "private function clean_poea_email($email) {\n\n \t$emails = array();\n\n \t$email = str_replace('@y.c', \"@yahoo.com\", $email);\n\n\t\t$slash_email = explode(\"/\", $email);\n\t\t$or_email = explode(\" or \", $email);\n\t\t$and_email = explode(\"&\", $email);\n\n\t\tif(count($slash_email) > 1) {\n\t\t\t\n\t\t\tforeach ($slash_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($and_email) > 1) {\n\n\t\t\tforeach ($and_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($or_email) > 1) {\n\n\t\t\tforeach ($or_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\t\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t$emails[] = $email;\t\n\n\t\t}\n\n\t\tif(empty($emails)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn json_encode($emails);\n }", "public function sanitizeEmail($data){\n $data = filter_var($data, FILTER_SANITIZE_EMAIL);\n return $data;\n }", "function parseEmailAddress( $address, $encoding = \"mime\" )\r\n {\r\n\r\n $matches = array();\r\n $pattern = '/<?\\\"?[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+\\\"?@[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+>?$/';\r\n if ( preg_match( trim( $pattern ), $address, $matches, PREG_OFFSET_CAPTURE ) != 1 )\r\n {\r\n return null;\r\n }\r\n $name = substr( $address, 0, $matches[0][1] );\r\n\r\n // trim <> from the address and \"\" from the name\r\n $name = trim( $name, '\" ' );\r\n $mail = trim( $matches[0][0], '<>' );\r\n // remove any quotes found in mail addresses like \"bah,\"@example.com\r\n $mail = str_replace( '\"', '', $mail );\r\n\r\n if ( $encoding == 'mime' )\r\n {\r\n // the name may contain interesting character encoding. We need to convert it.\r\n $name = ezcMailTools::mimeDecode( $name );\r\n }\r\n else\r\n {\r\n $name = ezcMailCharsetConverter::convertToUTF8( $name, $encoding );\r\n }\r\n\r\n $address = new ezcMailAddress( $mail, $name, 'utf-8' );\r\n return $address;\r\n }", "function emc_obfuscate_mailto_url( $email ) {\r\n\r\n\tif ( ! is_email( $email ) ) return false;\r\n\r\n\t$email = 'mailto:' . antispambot( $email );\r\n\r\n\treturn esc_url( $email );\r\n\r\n}", "protected function cleanEmail($email) {\n\t\tif(is_array($email)) {\n\t\t\t$cleanEmails = array();\n\t\t\tforeach($email as $em) {\n\t\t\t\t$cleanEmails[] = (preg_match('/\\<(.*?)\\>/', $em, $match)) ? $match[1] : $em;\n\t\t\t}\n\t\t\treturn $cleanEmails;\n\t\t}\n\t\telse {\n\t\t\t$cleanEmail = (preg_match('/\\<(.*?)\\>/', $email, $match)) ? $match[1] : $email;\n\t\t\treturn $cleanEmail;\n\t\t}\n\t}", "function filterEmail($email, $chars = ''){\r\n $email = trim(str_replace( array(\"\\r\",\"\\n\"), '', $email ));\r\n if( is_array($chars) ) $email = str_replace( $chars, '', $email );\r\n $email = preg_replace( '/(cc\\s*\\:|bcc\\s*\\:)/i', '', $email );\r\n return $email;\r\n}", "public function resetOriginalEmail() : void;", "public static function maskEmail($email){\n $em = explode(\"@\",$email);\n $name = $em[0];\n $len = floor(strlen($name)/2);\n\n $len_=strlen($name)%2 +$len;\n\n return substr($name,0, $len) . str_repeat('*', $len_) . \"@\" . end($em); \n }", "public function emailToPunycode($email = '')\n\t{\n\t\t// do nothing by default\n\t\treturn $email;\n\t}", "function sanitizeEmail() {\n $pattern = \"/^[A-Z0-9._%+\\-]+@[A-Z0-9.\\-]+\\.[A-Z]{2,}$/i\";\n if (preg_match($pattern, $this->email)) {\n $this->email = filter_var($this->email, FILTER_SANITIZE_EMAIL);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function cleanInput ($input) { // meie e-mail jõuab siia ning salvestatakse inputi sisse\n\n //input = sisestatud e-mail\n\n $input = trim ($input);\n $input = stripslashes ($input); //võtab kaldkriipsud ära\n $input = htmlspecialchars ($input); //\n return $input;\n}", "private function filtrarEmail($original_email)\n{\n $clean_email = filter_var($original_email,FILTER_SANITIZE_EMAIL);\n if ($original_email == $clean_email && filter_var($original_email,FILTER_VALIDATE_EMAIL))\n {\n return $original_email;\n }\n\n}", "public function decomposeCompleteEmail($email) {\n $return = array('name' => '', 'email' => '');\n $email = urldecode(str_replace('+', '%2B', $email));\n if (is_string($email) && mb_strpos($email, '@') !== false) {\n $return['email'] = trim(str_replace(array('<', '>'), '', mb_substr($email, mb_strrpos($email, '<'))));\n $decomposedName = trim(str_replace(array('\"', '+'), array('', ' '), mb_substr($email, 0, mb_strrpos($email, '<'))));\n\n if (mb_strpos($decomposedName, '=?') === 0) {\n $decodedHeader = $this->mimeHeaderDecode($decomposedName);\n if (!empty($decodedHeader[0]->text)) {\n $entireName = '';\n foreach ($decodedHeader as $namePart) {\n $entireName .= trim($this->_convertCharset($namePart->charset, $this->charset, $namePart->text)).' ';\n }\n $decomposedName = trim($entireName);\n }\n }\n\n $return['name'] = $decomposedName;\n }\n\n return $return;\n }", "function sanitize_email( $email ) {\n\t// Test for the minimum length the email can be\n\tif ( strlen( $email ) < 3 ) {\n\t\t/**\n\t\t * Filter a sanitized email address.\n\t\t *\n\t\t * This filter is evaluated under several contexts, including 'email_too_short',\n\t\t * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',\n\t\t * 'domain_no_periods', 'domain_no_valid_subs', or no context.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $email The sanitized email address.\n\t\t * @param string $email The email address, as provided to sanitize_email().\n\t\t * @param string $message A message to pass to the user.\n\t\t */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'email_too_short' );\n\t}\n\n\t// Test for an @ character after the first position\n\tif ( strpos( $email, '@', 1 ) === false ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'email_no_at' );\n\t}\n\n\t// Split out the local and domain parts\n\tlist( $local, $domain ) = explode( '@', $email, 2 );\n\n\t// LOCAL PART\n\t// Test for invalid characters\n\t$local = preg_replace( '/[^a-zA-Z0-9!#$%&\\'*+\\/=?^_`{|}~\\.-]/', '', $local );\n\tif ( '' === $local ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );\n\t}\n\n\t// DOMAIN PART\n\t// Test for sequences of periods\n\t$domain = preg_replace( '/\\.{2,}/', '', $domain );\n\tif ( '' === $domain ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_period_sequence' );\n\t}\n\n\t// Test for leading and trailing periods and whitespace\n\t$domain = trim( $domain, \" \\t\\n\\r\\0\\x0B.\" );\n\tif ( '' === $domain ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' );\n\t}\n\n\t// Split the domain into subs\n\t$subs = explode( '.', $domain );\n\n\t// Assume the domain will have at least two subs\n\tif ( 2 > count( $subs ) ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' );\n\t}\n\n\t// Create an array that will contain valid subs\n\t$new_subs = array();\n\n\t// Loop through each sub\n\tforeach ( $subs as $sub ) {\n\t\t// Test for leading and trailing hyphens\n\t\t$sub = trim( $sub, \" \\t\\n\\r\\0\\x0B-\" );\n\n\t\t// Test for invalid characters\n\t\t$sub = preg_replace( '/[^a-z0-9-]+/i', '', $sub );\n\n\t\t// If there's anything left, add it to the valid subs\n\t\tif ( '' !== $sub ) {\n\t\t\t$new_subs[] = $sub;\n\t\t}\n\t}\n\n\t// If there aren't 2 or more valid subs\n\tif ( 2 > count( $new_subs ) ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' );\n\t}\n\n\t// Join valid subs into the new domain\n\t$domain = join( '.', $new_subs );\n\n\t// Put the email back together\n\t$email = $local . '@' . $domain;\n\n\t// Congratulations your email made it!\n\t/** This filter is documented in wp-includes/formatting.php */\n\treturn apply_filters( 'sanitize_email', $email, $email, null );\n}", "static function unwrap_email($html_email) {\n\n if (self::_has_markers($html_email)) {\n $html_email = self::unwrap_html_element($html_email);\n } else {\n //KEEP FOR OLD EMAIL COMPATIBILITY\n // Extracts only the body part\n $x = strpos($html_email, '<body');\n if ($x) {\n $x = strpos($html_email, '>', $x);\n $y = strpos($html_email, '</body>');\n $html_email = substr($html_email, $x + 1, $y - $x - 1);\n }\n\n /* Cleans up uncorrectly stored newsletter bodies */\n $html_email = preg_replace('/<style\\s+.*?>.*?<\\\\/style>/is', '', $html_email);\n $html_email = preg_replace('/<meta.*?>/', '', $html_email);\n $html_email = preg_replace('/<title\\s+.*?>.*?<\\\\/title>/i', '', $html_email);\n $html_email = trim($html_email);\n }\n\n // Required since esc_html DOES NOT escape the HTML entities (apparently)\n $html_email = str_replace('&', '&amp;', $html_email);\n $html_email = str_replace('\"', '&quot;', $html_email);\n $html_email = str_replace('<', '&lt;', $html_email);\n $html_email = str_replace('>', '&gt;', $html_email);\n\n return $html_email;\n }", "function UnigueEmail($check)\r\n {\r\n //μέσω αυτής της συνάρτησης ελέγχεται εάν χρησιμοποιείται ήδη το email\r\n //που έδωσε ο χρήστης και τον ενημερώνει αντίστοιχα μέσω του error που \r\n //υπάρχει για το συγκεκριμένο πεδίο στο αντίστοιχο view(register.ctp)\r\n\r\n //έλεγχος για το αν ήδη υπάρχει το email που επιλέγει ο χρήστης γίνεται\r\n //σε 2 περιπτώσεις:\r\n //α)Κατά την εγγραφή του χρήστη\r\n //β)Κατά την επεξεργασία προφίλ του χρήστη σε περίπτωση που επεξεργαστεί\r\n // το email του.\r\n $email = array_shift($check);\r\n\r\n if(!$this->getLoggedIn() || (strcmp($this->editEmail, 'yes')==0))\r\n {\r\n $conditions = array(\r\n// 'User.email'=>$this->data['User']['email']\r\n 'User.email'=>$email\r\n );\r\n if(!$this->id)\r\n {\r\n if($this->find('count', array('conditions'=>$conditions))>0) \r\n {\r\n// $this->invalidate('email_unique');\r\n return false; \r\n }\r\n }\r\n return true;\r\n }\r\n else\r\n return true;\r\n }" ]
[ "0.6755387", "0.6567935", "0.6485834", "0.6423738", "0.6362452", "0.6240894", "0.62231904", "0.61852723", "0.6181862", "0.616851", "0.60888094", "0.60834867", "0.60789967", "0.60744584", "0.60643893", "0.6035465", "0.60326225", "0.60219187", "0.60116464", "0.60078335", "0.5978897", "0.5956518", "0.59501284", "0.59476763", "0.5940502", "0.59208965", "0.5912562", "0.58752036", "0.58730716", "0.5861449" ]
0.7947774
0
Check a list of email address (comma separated); returns a list of valid email addresses (comma separated). The return value is true if there is at least one valid email address.
function CheckEmailAddress($addr,&$valid) { global $TARGET_EMAIL; $valid = ""; $list = explode(",",$addr); for ($ii = 0 ; $ii < count($list) ; $ii++) { $email = UnMangle($list[$ii]); for ($jj = 0 ; $jj < count($TARGET_EMAIL) ; $jj++) if (eregi($TARGET_EMAIL[$jj],$email)) { if (empty($valid)) $valid = $email; else $valid .= ",".$email; } } return (!empty($valid)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isEmail(?string ...$values): bool {\n\t\tforeach($values as $value) {\n\t\t\tif (!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function verifyContainsEmail(): bool\n {\n $words = explode(' ', $this->input);\n foreach ($words as $word) {\n if (static::isValidEmail($word)) {\n return true;\n }\n }\n \n return false;\n }", "public function _check_emails($field) {\n\t\t$emails = $this->{$field};\n\t\t$err = '';\n\t\tif ($emails) {\n\t\t\t$arr = explode(\",\", $emails);\n\t\t\tforeach($arr as $email) {\n\t\t\t\t$email = trim($email);\n\t\t\t\tif (!$this->form_validation->valid_email($email)) {\n\t\t\t\t\t$err .= \"Recipient email \" . $email . \" is not valid.<br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $err;\n\t}", "private function validate_email($addresses)\n\t{\n\t\t// if array\n\t\tif (is_array($addresses))\n\t\t{\n\t\t\tforeach($addresses as $address)\n\t\t\t{\n\t\t\t\tif(!preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/',$address) ) \n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"PEARALIZED: invalid email address - \".$address);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t// single email address\n\t\telse\n\t\t{\n\t\t\tif(!preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/',$addresses) ) \n\t\t\t{\n\t\t\t\tthrow new Exception(\"PEARALIZED: invalid email address - \".$addresses);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "public static function validEmail ($email, $domainPartOnly = false)\r\n\t{\r\n\t\t# Define the regexp; regexp taken from www.zend.com/zend/spotlight/ev12apr.php but with ' added to local part\r\n\t\t$regexp = '^' . ($domainPartOnly ? '[@]?' : '[\\'-_a-z0-9\\$\\+]+(\\.[\\'-_a-z0-9\\$\\+]+)*@') . '[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,6})$';\r\n\t\t\r\n\t\t# If not an array, perform the check and return the result\r\n\t\tif (!is_array ($email)) {\r\n\t\t\treturn preg_match ('/' . $regexp . '/i', $email);\r\n\t\t}\r\n\t\t\r\n\t\t# If an array, check each and return the flag\r\n\t\t$allValidEmail = true;\r\n\t\tforeach ($email as $value) {\r\n\t\t\tif (!preg_match ('/' . $regexp . '/i', $value)) {\r\n\t\t\t\t$allValidEmail = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $allValidEmail;\r\n\t}", "public function check_email($emails, $projectId){\n $email_list = array();\n $email_list_error = array();\n $emails = preg_split(\"/[;,]+/\", $emails);\n foreach ($emails as $email){\n if(!empty(trim($email))){\n if(filter_var(trim($email), FILTER_VALIDATE_EMAIL)) {\n //VALID\n array_push($email_list,trim($email));\n }else{\n array_push($email_list_error,$email);\n }\n }\n }\n if(!empty($email_list_error)){\n $this->sendFailedEmailRecipient($this->getProjectSetting(\"emailFailed_var\", $projectId),\"Error: Email Address Validation\" ,\"The email \".print_r($email_list_error, true).\" in the project \".$projectId.\", may be invalid format\");\n }\n return $email_list;\n }", "function ValidEmailAddress (\t$in_test_address\t///< Either a single email address, or a list of them, comma-separated.\n )\n {\n $valid = false;\n \n if ( $in_test_address )\n {\n global $g_validation_error; ///< This contains an array of strings, that \"log\" bad email addresses.\n $g_validation_error = array();\n $addr_array = split ( \",\", $in_test_address );\n // Start off optimistic.\n $valid = true;\n \n // If we have more than one address, we iterate through each one.\n foreach ( $addr_array as $addr_elem )\n {\n // This splits any name/address pair (ex: \"Jack Schidt\" <[email protected]>)\n $addr_temp = preg_split ( \"/ </\", $addr_elem );\n if ( count ( $addr_temp ) > 1 )\t// We also want to trim off address brackets.\n {\n $addr_elem = trim ( $addr_temp[1], \"<>\" );\n }\n else\n {\n $addr_elem = trim ( $addr_temp[0], \"<>\" );\n }\n $regexp = \"/^([_a-zA-Z0-9-]+)(\\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\\.[a-zA-Z0-9-]+)*(\\.[a-zA-Z]{2,4})$/\";\n if (!preg_match($regexp, $addr_elem))\n {\n array_push ( $g_validation_error, 'The address'.\" '$addr_elem' \".'is not correct.' );\n $valid = false;\n }\n }\n }\n \n return $valid;\n }", "protected function isEmailValid($email) {\n\t\tif(is_array($email)) {\n\t\t\tforeach($email as $em) {\n\t\t\t\tif(!preg_match(\"/^([a-z]+[a-z0-9_\\+\\-]*)(\\.[a-z0-9_\\+\\-]+)*@([a-z0-9]+\\.)+[a-z]{2,6}$/ix\", $em)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tif(preg_match(\"/^([a-z]+[a-z0-9_\\+\\-]*)(\\.[a-z0-9_\\+\\-]+)*@([a-z0-9]+\\.)+[a-z]{2,6}$/ix\", $email)) {\n\t\t\t\treturn true;\n\t\t\t}\t\t\n\t\t\treturn false;\t\t\n\t\t}\n\t}", "static function is_email($email, $list=false, $verify=false) {\n require_once PEAR_DIR . 'Mail/RFC822.php';\n require_once PEAR_DIR . 'PEAR.php';\n $rfc822 = new Mail_RFC822();\n if (!($mails = $rfc822->parseAddressList($email)) || PEAR::isError($mails))\n return false;\n\n if (!$list && count($mails) > 1)\n return false;\n\n foreach ($mails as $m) {\n if (!$m->mailbox)\n return false;\n if ($m->host == 'localhost')\n return false;\n }\n\n // According to RFC2821, the domain (A record) can be treated as an\n // MX if no MX records exist for the domain. Also, include a\n // full-stop trailing char so that the default domain of the server\n // is not added automatically\n if ($verify and !count(dns_get_record($m->host.'.', DNS_MX)))\n return 0 < count(dns_get_record($m->host.'.', DNS_A|DNS_AAAA));\n\n return true;\n }", "function isEmailInList($email) {\n\t\tglobal $polarbear_db;\n\t\t$emailSafe = $polarbear_db->escape($email);\n\t\t$sql = \"SELECT count(id) AS antal FROM \" . POLARBEAR_DB_PREFIX . \"_emaillist_emails WHERE listID = '{$this->id}' AND email = '$emailSafe'\";\n\t\tglobal $polarbear_db;\n\t\t$antal = $polarbear_db->get_var($sql);\n\t\treturn (bool) $antal;\n\t}", "public function validateEmails($key, $value, $params, $rule)\n\t{\n\t\tif (empty($value))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$emails = explode(',', $value);\n\n\t\tforeach ($emails as $email)\n\t\t{\n\t\t\tif ($email != filter_var($email, FILTER_SANITIZE_EMAIL) OR ! filter_var($email, FILTER_VALIDATE_EMAIL))\n\t\t\t{\n\t\t\t\t$rule->stop();\n\t\t\t\treturn 'valid_email';\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function check_email_address($email) {\n # Check @ symbol and lengths\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n return false;\n }\n\n # Split Email Address into Sections\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n\n # Validate Local Section of the Email Address\n for ($i = 0; $i < sizeof($local_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) {\n return false;\n }\n }\n\n # Validate Domain Section of the Email Address\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n $domain_array = explode(\".\", $email_array[1]);\n\n # Check the number of domain elements\n if (sizeof($domain_array) < 2) {\n return false;\n }\n\n # Sanity Check All Email Components\n for ($i = 0; $i < sizeof($domain_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) {\n return false;\n }\n }\n }\n\n # If All Validation Checks have Passed then Return True\n return true;\n }", "public static function email($value){\n\t\treturn (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n\t}", "protected function validateEmail($value){\n\t\tif(!$value) return true;\n\t\treturn filter_var($value, FILTER_VALIDATE_EMAIL) !== false;\n\t}", "public static function email($data){\n if(!filter_var($data,FILTER_VALIDATE_EMAIL)){\n return false;\n }\n return true;\n }", "public function is_valid_email()\r\n {\r\n // email address.\r\n\r\n return (!empty($this->address) && preg_match($this->re_email, $this->address));\r\n }", "public static function is_email($value) {\r\n\t\t$parts = explode('@', $value, 2);\r\n\t\t$local_part = array_shift($parts);\r\n\t\t$domain = array_shift($parts);\r\n\t\t\r\n\t\t$ret = self::is_domain($domain);\r\n\t\t// local part may be up to 64 characters \r\n\t\t$ret = $ret && (strlen($local_part) <= 64);\r\n\t\t// dot is not allowed at the end or beginning\r\n\t\t// There is also a rule that 2 or more dots are illegal like in '[email protected]'\r\n\t\t// Unfortunately: my neighbor's address IS [email protected]! And I can't lock my neighbor \r\n\t\t// out of the services I program, can I? \r\n\t\t$ret = $ret && (substr($local_part, 0, 1) !== '.');\r\n\t\t$ret = $ret && (substr($local_part, -1) !== '.');\r\n\t\t// Only a-z, A-Z, 0-9 and !#$%&'*+-/=?^_`{|}~ and . are allowed\r\n\t\t// (There is quoting and escaping, but we do not hear, we do not hear, we do not hear...)\r\n\t\t$pattern = \"@^[a-zA-Z0-9!#$%&'*+\\-/=?^_`{|}~.]+$@s\";\r\n\t\t$ret = $ret && preg_match($pattern, strtr($local_part, \"\\r\\n\", ' '));\r\n\t\t\r\n\t\treturn $ret;\r\n\t}", "protected function validateEmails($data)\n {\n $lines = explode(\"\\n\", $data);\n $lines = array_filter($lines, 'trim');\n $data = implode(',', $lines);\n $data = explode(',', trim($data));\n $data = array_filter($data);\n $emails = array();\n $errors = array();\n\n foreach ($data as $email) {\n $email = trim($email);\n if (Validate::isEmail($email)) {\n $emails[] = $email;\n } else {\n $errors[] = $email;\n }\n }\n\n return array(\n 'emails' => $emails,\n 'errors' => $errors,\n );\n }", "function is_valid_email($address) {\n $fields = preg_split(\"/@/\", $address, 2);\n if ((!preg_match(\"/^[0-9a-z]([-_.]?[0-9a-z])*$/i\", $fields[0])) || (!isset($fields[1]) || $fields[1] == '' || !is_valid_hostname_fqdn($fields[1], 0))) {\n return false;\n }\n return true;\n}", "function check_banlist($banlist, $email) {\n if (count($banlist)) {\n $allow = true;\n foreach($banlist as $banned) {\n $temp = explode(\"@\", $banned);\n if ($temp[0] == \"*\") {\n $temp2 = explode(\"@\", $email);\n if (trim(strtolower($temp2[1])) == trim(strtolower($temp[1])))\n $allow = false;\n } \n\t\telse {\n if (trim(strtolower($email)) == trim(strtolower($banned)))\n $allow = false;\n }\n }\n }\n if (!$allow) {\n print_error(\"You are using from a <b>banned email address.</b>\");\n }\n}", "public function isValid($domains, $email)\n {\n if (!is_null($domains)) {\n $domains = str_replace(' ', '', $domains);\n\n return collect(explode(',', $domains))->contains(function ($domain) use ($email) {\n return $this->getDomain($email) == $domain;\n });\n }\n\n return true;\n }", "public function isAtLeastOneKnownEmailAddress($_);", "private function email_Check_Validation($email){\r\n return (filter_var($email, FILTER_VALIDATE_EMAIL)) ? true : false;\r\n }", "public static function fieldListEmail($method, $fieldList, $params) {\n $result = TRUE;\n $errorFieldList = array();\n $errorFieldListDNS = array();\n foreach ($fieldList as $_field) {\n if (isset($params[$_field]) && $params[$_field] !== NULL) {\n if (!filter_var($params[$_field], FILTER_VALIDATE_EMAIL)) {\n $result = FALSE;\n $errorFieldList[] = \"`{$_field}` ({$params[$_field]})\";\n }\n if ($result !== FALSE) {\n $_elements = explode(\"@\", $params[$_field], 2);\n if (!checkdnsrr(end($_elements), \"MX\")) {\n $result = FALSE;\n $errorFieldListDNS[] = \"`{$_field}` ({$params[$_field]})\";\n }\n }\n }\n }\n if ($result === FALSE && count($errorFieldList) > 0) {\n \\Raneko\\Log::error($method, \"Email fields constraint violated: \" . implode(\", \", $errorFieldList));\n }\n if ($result === FALSE && count($errorFieldListDNS) > 0) {\n \\Raneko\\Log::error($method, \"DNS lookup failed for: \" . implode(\", \", $errorFieldListDNS));\n }\n return $result;\n }", "public static function validate_email($email) {\n\t\t// First, we check that there's one @ symbol, \n\t\t// and that the lengths are right.\n\t\tif (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n\t\t\t// Email invalid because wrong number of characters \n\t\t\t// in one section or wrong number of @ symbols.\n\t\t\treturn false;\n\t\t}\n\t\t// Split it into sections to make life easier\n\t\t$email_array = explode(\"@\", $email);\n\t\t$local_array = explode(\".\", $email_array[0]);\n\t\tfor ($i = 0; $i < sizeof($local_array); $i++) {\n\t\t\tif(!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&\n\t\t\t?'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\",\n\t\t\t$local_array[$i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Check if domain is IP. If not, \n\t\t// it should be valid domain name\n\t\tif (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n\t\t\t$domain_array = explode(\".\", $email_array[1]);\n\t\t\tif (sizeof($domain_array) < 2) {\n\t\t\t\treturn false; // Not enough parts to domain\n\t\t\t}\n\t\t\tfor ($i = 0; $i < sizeof($domain_array); $i++) {\n\t\t\t\tif(!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|\n\t\t\t\t\t?([A-Za-z0-9]+))$\",\n\t\t\t\t$domain_array[$i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static function ifEmail($emails)\n\t\t{\n\t\t\t$pattern = \"/^([a-zA-Z0-9-_\\.]{3,})@([a-zA-Z0-9-_]{4,})\\.([a-zA-Z]{2,6})$/\";\n\t\t\tif(is_array($emails))\n\t\t\t{\n\t\t\t\tforeach ($emails as $email) \n\t\t\t\t{\n\t\t\t\t\tif(!preg_match($pattern, $email))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(preg_match($pattern, $emails))\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}", "private function emailList()\n {\n return array(\n '[email protected]',\n '[email protected]',\n '[email protected]',\n );\n }", "private function process_email($value)\n {\n return (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n }", "public function isValidEmail($email) {\n\t\tif (preg_match(\"/^([a-zA-Z0-9]+)(@)([a-zA-Z0-9.]+)(.edu)$/\", $email, $output_array)){\n\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function checkEmailFormat($data) {\n foreach ($this->_email_format as $field) {\n if (!empty($data[$field])) {\n $pattern = \"/^[A-Za-z0-9._%+-]+@([A-Za-z0-9-]+\\.)+([A-Za-z0-9]{2,4}|museum)$/\";\n if (!preg_match($pattern, $data[$field])) {\n $this->_addError(self::ERROR_CODE_FIELD_FORMAT_EMAIL, $field, $data[$field]);\n $this->_invalid_parameter = $field;\n return false;\n }\n }\n }\n\n return true;\n }" ]
[ "0.6966614", "0.6859391", "0.6802208", "0.67667645", "0.67315567", "0.66559774", "0.6629751", "0.64451003", "0.64073616", "0.6364619", "0.63584757", "0.6336761", "0.6216026", "0.618738", "0.61807203", "0.6154694", "0.6153108", "0.615177", "0.60563415", "0.6015886", "0.60088754", "0.60028297", "0.6001302", "0.5976965", "0.5975954", "0.59715843", "0.59686315", "0.5955592", "0.5951518", "0.59428936" ]
0.6965745
1
return an array, stripped of slashes if magic_quotes_gpc is set
function StripGPCArray($arr) { if (get_magic_quotes_gpc() != 0) foreach ($arr as $key=>$value) if (is_string($value)) $arr[$key] = stripslashes($value); return ($arr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function undo_magic_quotes() {\n if (get_magic_quotes_gpc()) {\n \n $in = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE);\n \n while (list($k,$v) = each($in)) {\n foreach ($v as $key => $val) {\n if (!is_array($val)) {\n $in[$k][$key] = stripslashes($val);\n continue;\n }\n $in[] =& $in[$k][$key];\n }\n }\n \n unset($in);\n }\n }", "static function stripMagic() {\n\t\t@set_magic_quotes_runtime(0);\n\t\t// if magic_quotes_gpc strip slashes from GET POST COOKIE\n\t\tif (get_magic_quotes_gpc()){\n\t\tfunction stripslashes_array($array) {\n\t\t return is_array($array) ? array_map('stripslashes_array',$array) : stripslashes($array);\n\t\t}\n\t\t$_GET= stripslashes_array($_GET);\n\t\t$_POST= stripslashes_array($_POST);\n\t\t$_REQUEST= stripslashes_array($_REQUEST);\n\t\t$_COOKIE= stripslashes_array($_COOKIE);\n\t\t}\n\t}", "function strip_magic_quotes($data) {\n foreach($data as $k=>$v) {\n $data[$k] = is_array($v) ? strip_magic_quotes($v) : stripslashes($v);\n }\n return $data;\n}", "public function removeMagicQuotes() {\n if ( get_magic_quotes_gpc() ) {\n $_GET = $this->stripSlashesDeep($_GET);\n $_POST = $this->stripSlashesDeep($_POST);\n $_COOKIE = $this->stripSlashesDeep($_COOKIE);\n }\n }", "private static function _undoMagicQuotes(){\n\t\t\n\t\tif (get_magic_quotes_gpc()) {\n\n\t\t\tfunction stripslashes_array($data) {\n\t\t\t\tif (is_array($data)) {\n\t\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\t\t$data[$key] = stripslashes_array($value);\n\t\t\t\t\t}\n\t\t\t\t\treturn $data;\n\t\t\t\t} else {\n\t\t\t\t\treturn stripslashes($data);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$_REQUEST = stripslashes_array($_REQUEST);\n\t\t\t$_GET = stripslashes_array($_GET);\n\t\t\t$_POST = stripslashes_array($_POST);\n\t\t\t$_COOKIE = stripslashes_array($_COOKIE);\n\t\t\tif(isset($_FILES))\n\t\t\t\t$_FILES = stripslashes_array($_FILES);\n\t\t}\n\t}", "function do_magic_quotes_gpc(&$ar) {\n if (!is_array($ar)) return false;\n\n foreach ($ar as $key => $value) {\n if (is_array($ar[$key])) {\n do_magic_quotes_gpc($ar[$key]);\n } else {\n $ar[$key] = addslashes($value);\n }\n }\n\n reset($ar);\n}", "private function _remove_magic_quotes()\n {\n if(get_magic_quotes_gpc()) {\n $_GET = $this->_strip_slashes_deep($_GET);\n $_POST = $this->_strip_slashes_deep($_POST);\n $_COOKIE = $this->_strip_slashes_deep($_COOKIE);\n }\n }", "function RemoveMagicQuotesGPC()\n\t{\n\t\t// Check magic quotes state for GPC\n\t\tif (get_magic_quotes_gpc())\n\t\t{\n\t\t\t// Remove magic quotes in GET\n\t\t\t$_GET = RemoveSlashes($_GET);\n\t\t\t// Remove magic quotes in POST\n\t\t\t$_POST = RemoveSlashes($_POST);\n\t\t\t// Remove magic quotes in COOKIE\n\t\t\t$_COOKIE = RemoveSlashes($_COOKIE);\n\t\t}\n\t}", "function maqic_unquote_gpc()\n{\n if (ini_get('magic_quotes_gpc'))\n {\n $tmp = array ('_POST', '_GET', '_REQUEST', '_COOKIE');\n foreach($tmp as $n)\n recurse($GLOBALS[$n], '$value=stripslashes($value)');\n }\n}", "function addSlashesToArray($thearray){\r\n\r\n\tif(get_magic_quotes_runtime() || get_magic_quotes_gpc()){\r\n\r\n\t\tforeach ($thearray as $key=>$value)\r\n\t\t\tif(is_array($value))\r\n\t\t\t\t$thearray[$key]= addSlashesToArray($value);\r\n\t\t\telse\r\n\t\t\t\t$thearray[$key] = mysql_real_escape_string(stripslashes($value));\r\n\r\n\t} else\r\n\t\tforeach ($thearray as $key=>$value)\r\n\t\t\tif(is_array($value))\r\n\t\t\t\t$thearray[$key]= addSlashesToArray($value);\r\n\t\t\telse\r\n\t\t\t\t$thearray[$key] = mysql_real_escape_string($value);\r\n\r\n\treturn $thearray;\r\n\r\n}", "public static function removeMagicQuotes() {\r\n if (get_magic_quotes_gpc() ) {\r\n \tif(isset($_GET)){\r\n \t\t$_GET = self::stripSlashesDeep($_GET);\r\n \t}\r\n \r\n\t\t\tif(isset($_POST)){\r\n \t\t$_POST = self::stripSlashesDeep($_POST);\r\n \t}\r\n \r\n\t\t\tif(isset($_COOKIE)){\r\n \t\t$_COOKIE = self::stripSlashesDeep($_COOKIE);\r\n \t}\r\n \r\n }\r\n }", "function DoStripSlashes($fieldValue) {\n if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { \n if (is_array($fieldValue) ) { \n return array_map('DoStripSlashes', $fieldValue); \n } else { \n return trim(stripslashes($fieldValue)); \n } \n } else { \n return $fieldValue; \n } \n}", "function fix_input_quotes() {\n if(get_magic_quotes_gpc()) {\n array_stripslashes($_GET);\n array_stripslashes($_POST);\n array_stripslashes($_COOKIE);\n } // if\n }", "public static function StripSlashes($value)\n\t{\n\t\tif (get_magic_quotes_runtime())\n\t\t{\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\tforeach ($value as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($val)) $value[$key] = self::StripSlashes($val);\n\t\t\t\t\telse $value[$key] = stripslashes($val);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse $value = stripslashes($value);\n\t\t}\n\t\treturn $value;\n\t}", "function stripslashes_array( $given ) {\n return is_array( $given ) ? array_map( 'stripslashes', $given ) : stripslashes( $given );\n}", "function remove_wp_magic_quotes() {\r\n\t\t$_GET = stripslashes_deep($_GET);\r\n\t\t$_POST = stripslashes_deep($_POST);\r\n\t\t$_COOKIE = stripslashes_deep($_COOKIE);\r\n\t\t$_REQUEST = stripslashes_deep($_REQUEST);\r\n\t}", "function StripslashesArray($arr) {\n /* \n from php.net/slipslashes\n [email protected]\n 28-Jun-2001 09:07\n Very useful for using on all the elements in say $HTTP_POST_VARS, or\n elements returned from an database query. (to addslashes, just change\n strip to add =)\n */\n\n $rs = array();\n\n foreach ($arr as $key => $val) {\n $rs[$key] = stripslashes($val);\n }\n\n return $rs;\n}", "function fix_slashes($arr='')\n\t{\n\t\tif (is_null($arr) || $arr == '') return null;\n\t\tif (!get_magic_quotes_gpc()) return $arr;\n\t\treturn is_array($arr) ? array_map('fix_slashes', $arr) : stripslashes($arr);\n\t}", "private function _wp_magic_quotes() {\n // If already slashed, strip.\n if (function_exists('get_magic_quotes_gpc')) {\n $reflection = new \\ReflectionFunction('get_magic_quotes_gpc');\n if ( ! $reflection->isDeprecated()) {\n if ( get_magic_quotes_gpc() ) {\n $_GET = RevSliderFunctions::stripslashes_deep( $_GET );\n $_POST = RevSliderFunctions::stripslashes_deep( $_POST );\n $_COOKIE = RevSliderFunctions::stripslashes_deep( $_COOKIE );\n }\n }\n }\n\n // Escape with wpdb.\n $_GET = $this->_add_magic_quotes( $_GET );\n $_POST = $this->_add_magic_quotes( $_POST );\n $_COOKIE = $this->_add_magic_quotes( $_COOKIE );\n $_SERVER = $this->_add_magic_quotes( $_SERVER );\n\n // Force REQUEST to be GET + POST.\n $_REQUEST = array_merge( $_GET, $_POST );\n }", "function _check_magic_quotes($value){\n\t\treturn $this->_magic_quotes?stripslashes($value):$value;\n\t}", "function stripslashes_array( $value ){\n\t$value = is_array( $value ) ? array_map( 'stripslashes_array', $value ) : stripslashes( $value );\n\n\treturn $value;\n}", "function wp_magic_quotes() {\n\tif ( get_magic_quotes_gpc() ) {\n\t\t$_GET = stripslashes_deep( $_GET );\n\t\t$_POST = stripslashes_deep( $_POST );\n\t\t$_COOKIE = stripslashes_deep( $_COOKIE );\n\t}\n\n\t// Escape with wpdb.\n\t$_GET = add_magic_quotes( $_GET );\n\t$_POST = add_magic_quotes( $_POST );\n\t$_COOKIE = add_magic_quotes( $_COOKIE );\n\t$_SERVER = add_magic_quotes( $_SERVER );\n\n\t// Force REQUEST to be GET + POST.\n\t$_REQUEST = array_merge( $_GET, $_POST );\n}", "private function _add_magic_quotes( $array ) {\n foreach ( (array) $array as $k => $v ) {\n if ( is_array( $v ) ) {\n $array[$k] = $this->_add_magic_quotes( $v );\n } elseif (is_string($v)) {\n $array[$k] = addslashes( $v );\n }\n }\n return $array;\n }", "function wp_magic_quotes()\n {\n }", "function &stripSlashesGPC( $text, $force = false ) {\n if ( get_magic_quotes_gpc() || $force == true ) {\n $text = stripslashes( $text );\n }\n return $text;\n }", "function stripslashes_array($data) {\r\n if (is_array($data)){\r\n foreach ($data as $key => $value){\r\n $data[$key] = stripslashes_array($value);\r\n }\r\n return $data;\r\n } else {\r\n return stripslashes($data);\r\n }\r\n }", "public static function stripslashes($value)\n {\n if (Kohana::$magic_quotes === TRUE)\n {\n if (is_array($value) OR is_object($value))\n {\n foreach ($value as $key => $val)\n {\n // Recursively clean each value\n $value[$key] = Kohana::stripslashes($val);\n }\n }\n elseif (is_string($value))\n {\n // Remove slashes added by magic quotes\n $value = stripslashes($value);\n }\n }\n\n return $value;\n }", "public function specialCharactersInValueProvider()\n {\n return array_filter($this->specialCharactersProvider(), function ($val) {\n return $val[0] !== \"\\\"\" && $val[0] !== \"\\\\\";\n });\n }", "function EliminateSlashes($value) {\r\n if (is_array($value)) {\r\n reset($value);\r\n while (list($key, $val) = each($value))\r\n $value[$key] = EliminateSlashes($val);\r\n return $value;\r\n }\r\n return stripslashes($value);\r\n}", "public function dataStripQuotes()\n {\n return [\n 'double quoted text' => ['\"some text\"', 'some text'],\n 'single quoted text' => [\"'some text'\", 'some text'],\n 'unmatched quotes start of string' => [\"'some text\", \"'some text\"],\n 'unmatched quotes end of string' => ['some text\"', 'some text\"'],\n 'quotes with quoted text within' => [\"some 'text'\", \"some 'text'\"],\n 'string with quotes within' => ['\"some \\'string\\\" with\\' quotes\"', 'some \\'string\\\" with\\' quotes'],\n 'string wrapped in quotes' => ['\"\\'quoted_name\\'\"', \"'quoted_name'\"],\n 'multi-line text string' => [\n \"'some text\nanother line\nfinal line'\",\n \"some text\nanother line\nfinal line\",\n ],\n 'empty string' => ['', ''],\n 'not string input - bool' => [false, ''],\n 'not string input - float' => [12.345, '12.345'],\n ];\n }" ]
[ "0.71926653", "0.7074007", "0.70001817", "0.69485855", "0.69453675", "0.69428396", "0.6860316", "0.68527216", "0.6735282", "0.67021024", "0.6683923", "0.6632399", "0.65052444", "0.64834124", "0.64484143", "0.6420708", "0.632399", "0.6311155", "0.6286795", "0.6283601", "0.6247524", "0.6135413", "0.6078002", "0.60696346", "0.6066656", "0.6061079", "0.6059081", "0.60577816", "0.60491073", "0.60220796" ]
0.72119236
0
Strip a value of unwanted characters, which might be hacks.
function Strip($value) { $value = StripGPC($value); $value = str_replace("\"","'",$value); $value = preg_replace('/[[:cntrl:][:space:]]+/'," ",$value); // zap all control chars and multiple blanks return ($value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_clean($value) {\n\t\t$legal_chars = \"%[^0-9a-zA-Z������� ]%\"; //allow letters, numbers & space\n\t\t$new_value = preg_replace($legal_chars,\"\",$value); //replace with \"\"\n\t\treturn $new_value;\n\t}", "public function clean_string($value) {\n $data = trim($value);\n\n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_STRING);\n\n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n\n return $data;\n }", "public function cleanString($value) {\n $data = trim($value);\n \n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_STRING);\n \n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n \n return $data;\n }", "function strip_bad_chars( $input ) {\n $output = preg_replace( \"/[^a-zA-Z0-9_-]/\", \"\", $input );\n return $output;\n }", "protected function cleanValue()\n {\n return str_replace([\n '%',\n '-',\n '+',\n ], '', $this->condition->value);\n }", "function clean_unwanted_characters($oneStr){\n\t$cleaned_str = $oneStr;\r\n// \t$cleaned_str = str_ireplace(\"\\\"\", \"/\", $oneStr);\r\n// \t$cleaned_str = str_ireplace(\"\\\\\", \"/\", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\b\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\f\", \" / \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\r\", \" / \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\t\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\u\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"</\", \"<\\/\", $cleaned_str);\r\n\treturn $cleaned_str;\n\r\n}", "public function filter($value) {\n mb_internal_encoding(\"UTF-8\");\n mb_regex_encoding(\"UTF-8\");\n\n $pattern = '[^'.$this->options[\"characters\"].']';\n\n return mb_ereg_replace($pattern, \"\", $value);\n }", "function Strip_Bad_chars($input)\n{\n //$output = preg_replace(\"/[^a-zA-Z0-9_-]/\", \"\", $input);\n $output = preg_replace(\"/[^0-9]/\", \"\", $input);\n return $output;\n}", "function remove_strange_chars($txt){\n\t\treturn(str_replace(array('<','>',\"'\",\";\",\"&\",\"\\\\\"),'',$txt));\n\t}", "public function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n }", "protected function filterAlphanum($value) {\n return preg_replace(\"/[^a-z0-9]/i\", \"\", $value);\n }", "function scrub($str) {\n\t$str = preg_replace('/[^A-Za-z0-9]/','',$str);\n\treturn $str;\n}", "protected function _clean( $value ) {\n\t\treturn str_replace( [ \"\\t\", \"\\n\", \"\\r\" ], '', $value );\n\t}", "function inputCleaner($value){\n\t $toBeTested\t\t= strip_tags($value);\n\t // Instead of using HTMLStripSpecialChars, I am using some Regex\n\t\t// to have a greater degree of control over the input.\n\t\t//\tThis regex checks the entire string for anything that\n\t\t//\tcould ruin our consistency.\n\t $regExp = (\"/[\\!\\\"\\£\\$\\%\\^\\&\\*\\(\\)\\;\\'\\,\\\"\\?]/ \");\n\t if(preg_match_all($regExp, $toBeTested,$matches)){\n\t \treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn $toBeTested;\n\t\t}\n\t}", "public function filter($value)\n {\n $whiteSpace = $this->allowWhiteSpace ? '\\s' : '';\n\n if ($this->englishAlphabethOnly || !self::$unicodeEnabled) {\n $pattern = '/[^a-zA-Z' . $whiteSpace . ']/';\n }\n else {\n $pattern = '/[^\\p{L}' . $whiteSpace . ']/u';\n }\n\n return preg_replace($pattern, '', (string) $value);\n }", "function removeUnnecessaryCharas($string)\n{\n return preg_replace('~\\s+~s', '', $string);\n}", "public function filterValue($value) {\n return preg_replace('/[\\n\\r\\t]/', '', $value);\n }", "function sanitation($value) {\n\treturn strip_tags($value);\n}", "function search_strip_badchars($line) {\n// \n $line = str_replace(\".\", \" \", $line);\n $line = str_replace(\"\\\"\", \" \", $line);\n $line = str_replace(\"'\", \"\", $line);\n $line = str_replace(\"+\", \" \", $line);\n $line = str_replace(\"-\", \" \", $line);\n $line = str_replace(\"*\", \" \", $line);\n $line = str_replace(\"/\", \" \", $line);\n $line = str_replace(\"!\", \" \", $line);\n $line = str_replace(\"%\", \" \", $line);\n $line = str_replace(\">\", \" \", $line);\n $line = str_replace(\"<\", \" \", $line);\n $line = str_replace(\"^\", \" \", $line);\n $line = str_replace(\"(\", \" \", $line);\n $line = str_replace(\")\", \" \", $line);\n $line = str_replace(\"[\", \" \", $line);\n $line = str_replace(\"]\", \" \", $line);\n $line = str_replace(\"{\", \" \", $line);\n $line = str_replace(\"}\", \" \", $line);\n $line = str_replace(\"\\\\\", \" \", $line);\n $line = str_replace(\"=\", \" \", $line);\n $line = str_replace(\"$\", \" \", $line);\n $line = str_replace(\"#\", \" \", $line);\n $line = str_replace(\"?\", \" \", $line);\n $line = str_replace(\"~\", \" \", $line);\n $line = str_replace(\":\", \" \", $line);\n $line = str_replace(\"_\", \" \", $line);\n $line = str_replace(\" \", \" \", $line);\n $line = str_replace(\"&amp;\", \" \", $line);\n $line = str_replace(\"&copy;\", \" \", $line);\n $line = str_replace(\"&nbsp;\", \" \", $line);\n $line = str_replace(\"&quot;\", \" \", $line);\n $line = str_replace(\"&\", \" \", $line);\n $line = str_replace(\";\", \" \", $line);\n $line = str_replace(\"\\n\", \" \", $line);\n return $line;\n}", "public static function stripFunkyChars($string = '') {\n\n foreach (StringTools::funkyCharsMap() as $weird => $normal) {\n $string = str_replace($weird, '', $string);\n }\n\n return $string;\n }", "function clean_iptc_value($value)\n{\n\t// strip leading zeros (weird Kodak Scanner software)\n\twhile ( isset($value[0]) and $value[0] == chr(0)) {\n\t\t$value = substr($value, 1);\n\t}\n\t// remove binary nulls\n\t$value = str_replace(chr(0x00), ' ', $value);\n\n\treturn $value;\n}", "function removeXSS($val)\t{\n\t// this prevents some character re-spacing such as <java\\0script>\n\t// note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n\t$val = preg_replace('/([\\x00-\\x08][\\x0b-\\x0c][\\x0e-\\x20])/', '', $val);\n\n\t// straight replacements, the user should never need these since they're normal characters\n\t// this prevents like <IMG SRC=&#X40&#X61&#X76&#X61&#X73&#X63&#X72&#X69&#X70&#X74&#X3A&#X61&#X6C&#X65&#X72&#X74&#X28&#X27&#X58&#X53&#X53&#X27&#X29>\n\t$search = 'abcdefghijklmnopqrstuvwxyz';\n\t$search.= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t$search.= '1234567890!@#$%^&*()';\n\t$search.= '~`\";:?+/={}[]-_|\\'\\\\';\n\n\tfor ($i = 0; $i < strlen($search); $i++) {\n\t\t// ;? matches the ;, which is optional\n\t\t// 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n\t\t// &#x0040 @ search for the hex values\n\t\t$val = preg_replace('/(&#[x|X]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n\t\t// &#00064 @ 0{0,7} matches '0' zero to seven times\n\t\t$val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n\t}\n\n\t// now the only remaining whitespace attacks are \\t, \\n, and \\r\n\t$ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n\t$ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n\t$ra = array_merge($ra1, $ra2);\n\n\t$found = true; // keep replacing as long as the previous round replaced something\n\twhile ($found == true) {\n\t\t$val_before = $val;\n\t\tfor ($i = 0; $i < sizeof($ra); $i++) {\n\t\t\t$pattern = '/';\n\t\t\tfor ($j = 0; $j < strlen($ra[$i]); $j++) {\n\t\t\t\tif ($j > 0) {\n\t\t\t\t\t$pattern .= '(';\n\t\t\t\t\t$pattern .= '(&#[x|X]0{0,8}([9][a][b]);?)?';\n\t\t\t\t\t$pattern .= '|(&#0{0,8}([9][10][13]);?)?';\n\t\t\t\t\t$pattern .= ')?';\n\t\t\t\t}\n\t\t\t\t$pattern .= $ra[$i][$j];\n\t\t\t}\n\t\t\t$pattern .= '/i';\n\t\t\t$replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n\t\t\t$val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n\t\t\tif ($val_before == $val) {\n\t\t\t\t// no replacements were made, so exit the loop\n\t\t\t\t$found = false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $val;\n}", "function remove_special_chars($string) {\n\t return preg_replace ('/[^a-zA-Z0-9]/', '', $string);\n\t}", "function StripGPC($s_value)\n{\n\tif (get_magic_quotes_gpc() != 0)\n\t\t$s_value = stripslashes($s_value);\n\treturn ($s_value);\n}", "private function _sanitize($pValue)\n\t{\n\t\t$value = trim($pValue);\n\t\t$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');\n\t\t$value = (string)$value;\n\t\treturn $value;\n\t}", "function parseCleanValue($v){\r\n\t\tif($v == \"\"){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$v = str_replace(\"&#032;\", \" \", $v);\r\n\t\t$v = str_replace(\"&\" , \"&amp;\" , $v);\r\n\t\t$v = str_replace(\"<!--\" , \"&#60;&#33;--\" , $v);\r\n\t\t$v = str_replace(\"-->\" , \"--&#62;\" , $v);\r\n\t\t$v = preg_replace(\"/<script/i\" , \"&#60;script\" , $v);\r\n\t\t$v = str_replace(\">\" , \"&gt;\" , $v);\r\n\t\t$v = str_replace(\"<\" , \"&lt;\" , $v);\r\n\t\t$v = str_replace(\"\\\"\" , \"&quot;\" , $v);\r\n\t\t$v = preg_replace(\"/\\n/\" , \"<br />\" , $v); // Convert literal newlines\r\n\t\t$v = preg_replace(\"/\\\\\\$/\" , \"&#036;\" , $v);\r\n\t\t$v = preg_replace(\"/\\r/\" , \"\" , $v); // Remove literal carriage returns\r\n\t\t$v = str_replace(\"!\" , \"&#33;\" , $v);\r\n\t\t$v = str_replace(\"'\" , \"&#39;\" , $v); // IMPORTANT: It helps to increase sql query safety.\r\n\t\t// Ensure unicode chars are OK\r\n\t\t$v = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $v);\r\n\t\t// Strip slashes if not already done so.\r\n\t\tif($this->get_magic_quotes){\r\n\t\t\t$v = stripslashes($v);\r\n\t\t}\r\n\t\t// Swap user entered backslashes\r\n\t\t$v = preg_replace(\"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $v);\r\n\t\treturn $v;\r\n\t}", "function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n}", "function fsl_scrub($string){\n \n $xss = new xss_filter();\n $string = $xss->filter_it($string); \n return $string;\n}", "function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}", "function filterString($string){\n $string = filter_var(trim($string), FILTER_SANITIZE_SPECIAL_CHARS); // Removes a small list of special chars\n // $string = filter_var(trim($string), FILTER_SANITIZE_FULL_SPECIAL_CHARS); // Removes all special chars\n return $string;\n}" ]
[ "0.72800666", "0.72079843", "0.71338296", "0.7080963", "0.6982714", "0.695795", "0.6954121", "0.693592", "0.6837615", "0.68168443", "0.6811536", "0.6795291", "0.6789121", "0.6777375", "0.6764461", "0.67625725", "0.6754654", "0.67307234", "0.67293197", "0.67233014", "0.6706056", "0.67010564", "0.6700913", "0.66877156", "0.66737986", "0.66678065", "0.6655068", "0.661865", "0.6615375", "0.6613169" ]
0.7927197
0
Parse the input variables and produce textual output from them. Also return nonspecial values in the given $a_values array.
function ParseInput($vars,&$a_values,$s_line_feed) { global $SPECIAL_FIELDS,$SPECIAL_VALUES,$FORMATTED_INPUT; $output = ""; // // scan the array of values passed in (name-value pairs) and // produce slightly formatted (not HTML) textual output // while (list($name,$raw_value) = each($vars)) { if (is_string($raw_value)) // // truncate the string // $raw_value = substr($raw_value,0,MAXSTRING); $value = trim(Strip($raw_value)); if (in_array($name,$SPECIAL_FIELDS)) $SPECIAL_VALUES[$name] = $value; else { $a_values[$name] = $raw_value; $output .= "$name: $value".$s_line_feed; } array_push($FORMATTED_INPUT,"$name: '$value'"); } return ($output); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInputAsString($values) {\n $output = \"\";\n foreach ($values as $value) {\n $output .= $value;\n }\n return $output; \n}", "protected function parseValues($_values)\n\t{\n\t\t$use_ingroup = $this->field->parameters->get('use_ingroup', 0);\n\t\t$multiple = $use_ingroup || (int) $this->field->parameters->get('allow_multiple', 0);\n\n\t\t// Make sure we have an array of values\n\t\tif (!$_values)\n\t\t{\n\t\t\t$vals = array(array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vals = !is_array($_values)\n\t\t\t\t? array($_values)\n\t\t\t\t: $_values;\n\t\t}\n\n\t\t// Compatibility with legacy storage, we no longer serialize all values to one, this way the field can be reversed and filtered\n\t\tif (count($vals) === 1 && is_string(reset($vals)))\n\t\t{\n\t\t\t$array = $this->unserialize_array(reset($vals), $force_array = false, $force_value = false);\n\t\t\t$vals = $array ?: $vals;\n\t\t}\n\n\t\t// Force multiple value format (array of arrays)\n\t\tif (!$multiple)\n\t\t{\n\t\t\tif (is_string(reset($vals)))\n\t\t\t{\n\t\t\t\t$vals = array($vals);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($vals as & $v)\n\t\t\t{\n\t\t\t\tif (!is_array($v))\n\t\t\t\t{\n\t\t\t\t\t$v = strlen($v) ? array($v) : array();\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($v);\n\t\t}\n\n\t\t//echo '<div class=\"alert alert-info\"><h2>parseValues(): ' . $this->field->label . '</h2><pre>'; print_r($vals); echo '</pre></div>';\n\t\treturn $vals;\n\t}", "function output_values($header, $values){\n\t\t$contents = $header . \"\\r\\n\";\n\t\tforeach ($values as $key => $value)\n\t\t\t$contents .= $value[0] . \"\\t\" . $value[1] . \"\\r\\n\";\n\t\treturn $contents;\n\t}", "public function Render($aParamValues = array())\n\t{\n\t\t$aParamTypes = array();\n\t\tforeach($aParamValues as $sParamName => $value)\n\t\t{\n\t\t\t$aParamTypes[$sParamName] = get_class($value);\n\t\t}\n\t\t$this->Analyze($aParamTypes);\n\n\t\t$aSearch = array();\n\t\t$aReplace = array();\n\t\tforeach($this->m_aPlaceholders as $oPlaceholder)\n\t\t{\n\t\t\tif (array_key_exists($oPlaceholder->sParamName, $aParamValues))\n\t\t\t{\n\t\t\t\t$oRef = $aParamValues[$oPlaceholder->sParamName];\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$value = $oRef->Get($oPlaceholder->sAttcode);\n\t\t\t\t\t$aSearch[] = '$'.$oPlaceholder->sToken.'$';\n\t\t\t\t\t$aReplace[] = $value;\n\t\t\t\t\t$oPlaceholder->bIsValid = true;\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$oPlaceholder->bIsValid = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$oPlaceholder->bIsValid = false;\n\t\t\t}\n\t\t}\n\t\treturn str_replace($aSearch, $aReplace, $this->m_sRaw);\n\t}", "function extract_values($values) {\n foreach ($values as $xn) {\n switch ($xn['tag']) {\n\n case 'license-uri':\n $this->license_uri = $xn['value'];\n break;\n\n case 'license-name':\n $this->license_name = $xn['value'];\n break;\n\n case 'rdf:RDF':\n if ($xn['type'] == 'open') {\n $this->rdf = array();\n $this->rdf['attributes'] = $xn['attributes'];\n }\n break;\n\n case 'permits':\n $this->permissions['permits'][] = current($xn['attributes']);\n break;\n\n case 'prohibits':\n $this->permissions['prohibits'][] = current($xn['attributes']);\n break;\n\n case 'requires':\n $this->permissions['requires'][] = current($xn['attributes']);\n break;\n }\n }\n }", "function validateValues($text, $names)\n{\n $out = \"\";\n $lines = explode(\"\\n\", $text);\n $regexnames = implode(\"|\", $names);\n foreach ($lines as $line) {\n $result = preg_match('/(.+?)=(.+?)(?:\\n|$)/', $line, $out);\n if ($out == array()) {\n return $line;\n }\n \n // dangerous, because excludes repetition of key=value pairs in single string\n $result2 = preg_match(\"/(($regexnames)=.+?){2,}/\", $line, $out2);\n if ($out2 != array()) {\n return $line;\n }\n }\n return \"\";\n}", "function build_subtext($subtext_values) {\r\n $subtext_pieces = array();\r\n foreach ($subtext_values as $value) {\r\n if (!empty($value)) {\r\n $subtext_pieces[] = $value;\r\n }\r\n }\r\n return implode('; ', $subtext_pieces);\r\n $subtext_pieces = array();\r\n }", "private function parseVars($vals, $tab =\"\")//optional recursive values for output\n {\n $rval = \"\";\n foreach($vals as $key => $val)\n {\n if( $this->cleanData($key, $val))\n {\n if(is_object($val))\n {\n $rval = $rval.$tab.\"Object: \".$key.\" of type: \".get_class($val).\"\\n\";\n $rval = $rval.$tab.\"{\\n\";\n $newAry = get_object_vars($val);\n $rval = $rval.$this->parseVars($newAry, $tab.\" \");\n $rval = $rval.$tab.\"}\\n\";\n }\n elseif(is_array($val))\n {\n $rval = $rval.$tab.\"Array: \".$key.\"\\n\";\n $rval = $rval.$tab.\"{\\n\";\n $rval = $rval.$this->parseVars($val, $tab.\" \");\n $rval = $rval.$tab.\"}\\n\";\n }\n else\n {\n if($val != \"\")\n $rval= $rval.$tab.$key.\" = \".$val.\"\\n\";\n else\n $rval= $rval.$tab.$key.\" = NULL\\n\";\n }\n }\n }\n return $rval;\n }", "function _parse($tags,$values,$text) {\n\t\tfor ($i = 0; $i<sizeof($tags); $i++) {\n\t\t\t\t$text = str_replace($tags[$i],$values[$i],$text);\n\t\t\t}\n\t\treturn $text;\n\t}", "function setValueByArray($a_values)\r\n\t{\r\n\t\tglobal $ilUser;\r\n\t\t\r\n\t\t$this->setAllValue($a_values[$this->getPostVar()][\"all\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"all\"][\"num_unit\"]);\r\n\t\t$this->setBottomValue($a_values[$this->getPostVar()][\"bottom\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"bottom\"][\"num_unit\"]);\r\n\t\t$this->setTopValue($a_values[$this->getPostVar()][\"top\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"top\"][\"num_unit\"]);\r\n\t\t$this->setLeftValue($a_values[$this->getPostVar()][\"left\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"left\"][\"num_unit\"]);\r\n\t\t$this->setRightValue($a_values[$this->getPostVar()][\"right\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"right\"][\"num_unit\"]);\r\n\t}", "#[Pure] public function get_values(): string\n {\n if(gettype($this -> value) === \"string\") {\n return \"'\" . $this->value . \"'\";\n }else{\n $res = \"'\";\n foreach($this -> value as $v){\n $res .= strval($v) . \" \";\n }\n $res .= \"'\";\n }\n return $res;\n }", "public function formatVariable(){\r\n\t\t\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function parse()\n {\n $strBuffer = parent::parse();\n\n foreach($this->arrData['variables'] as $varName=>$varValue)\n {\n if (empty($varValue))\n {\n continue;\n }\n\n // Convert date values\n /*switch ($objVar['type'])\n {\n case 'date':\n $objVar['value'] = \\Date::parse(\\Config::get('dateFormat'), $objVar['value']);\n break;\n\n case 'time':\n $objVar['value'] = \\Date::parse(\\Config::get('timeFormat'), $objVar['value']);\n break;\n\n case 'datim':\n $objVar['value'] = \\Date::parse(\\Config::get('datimFormat'), $objVar['value']);\n break;\n }*/\n\n //$objVar['value'] = str_replace('$', '\\$', $objVar['value']);\n\n if (is_array($varValue))\n {\n $varValue = json_encode($varValue);\n }\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\s*%}/s', $varValue, $strBuffer);\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\|\\s*nl2br\\s*%}/s', nl2br($varValue), $strBuffer);\n }\n\n $strBuffer = preg_replace('/{%.*?%}/s', '', $strBuffer);\n\n return $strBuffer;\n }", "function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format ['cname=value'......]\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return \"`$obj->name`=$value\";\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n return implode(\",\",$values_str);\n }", "function condition_form_submit($values) {\n $parsed = array();\n $items = explode(\"\\n\", $values);\n if (!empty($items)) {\n foreach ($items as $v) {\n $v = trim($v);\n if (!empty($v)) {\n $parsed[$v] = $v;\n }\n }\n }\n return $parsed;\n }", "public function get_values(){\n $value_str = '';\n if (is_array($this->value)){\n foreach ($this->value as $val){\n $value_str .= $val.' ';\n }\n } else {\n $value_str .= $this->value;\n }\n\n return $value_str;\n }", "protected function replaceValues()\n {\n foreach($this->formulasValue as $key=>$fvalue) \n {\n //$fvalue['value']=mb_strtoupper($fvalue['value'], 'utf-8');\n preg_match_all('/\\{([^}]+)\\}/', $fvalue['value'], $matches);\n foreach($this->sizeList as $size) \n {\n $this->replacement=array();\n //$stag=mb_strtoupper($size.'_'.substr(substr($fvalue['tag'],0,-1),1), 'utf-8');\n $stag=$size.'_'.substr(substr($fvalue['tag'],0,-1),1);\n foreach($matches[1] as $match) \n {\n //$match=mb_strtoupper($match, 'utf-8');\n if(isset($this->itemProperties[$size . '_' . $match])) \n $this->replacement[$size . '_' . $match]=$this->itemProperties[$size . '_' . $match];\n elseIf(isset($this->clientProperties[$match]))\n $this->replacement[$match]=$this->clientProperties[$match];\n elseIf(isset($this->resultArray[$size . '_' . $match]))\n $this->replacement[$size . '_' . $match]=$this->resultArray[$size . '_' . $match];\n else \n $this->errorReplacements[$size . '_' . $match]=$size . '_' . $match;\n }\n \n \n// echo 'errorReplacements START';\n// Helper::myPrint_r($this->errorReplacements);\n// echo 'errorReplacements END';\n //calculates the equitation. But it should not be called unless all the values are replaced\n $matches[0]=array_unique($matches[0]);\n $matches[1]=array_unique($matches[1]);\n// echo 'STAG: ' . $stag . \"<br />\";\n// echo 'Fvalue: ' . $fvalue['value'] . \"<br />\";\n// if($matches[1][0]=='РПЛ')\n// echo 'Yes РПЛ' . '<br />';\n if((isset($matches[1][1])) && $matches[1][1]=='РПЛИ') {\n// echo 'Yes РПЛИ' . '<br />'; \n// echo 'value:' . $this->replacement[$size . '_РПЛИ'];\n// \n// echo \"<br />\";\n// echo str_replace($matches[0], $this->replacement, $fvalue['value']);\n// echo \"<br />\";\n \n // foreach($matches[0] as $m)\n// {\n// echo 'ttt';\n// echo \"<br />\";\n// echo \"<br />\";\n //echo preg_replace('/'.$m.'/', 777, $fvalue['value']);\n// echo str_replace($matches[0], 777, $fvalue['value']);\n// echo \"<br />\";\n// }\n \n\n //$exp=preg_replace($matches[0], $this->replacement, $fvalue['value']);\n $exp=str_replace($matches[0], $this->replacement, $fvalue['value']);\n //echo 'ERROR COUNT: ' . count($this->errorReplacements) . '<br />';\n \n// if(count($this->errorReplacements) > 0) {\n// echo CJavaScript::encode($this->itemId);\n// Yii::app()->end();\n// }\n \n \n $this->resultArray[$stag]=(count($this->errorReplacements) > 0) \n ? str_replace($exp)\n : $this->calculate($exp);\n \n } else\n {\n $this->resultArray[$stag]=(count($this->errorReplacements) > 0) \n ? str_replace($matches[0], $this->replacement, $fvalue['value'])\n : $this->calculate(str_replace($matches[0], $this->replacement, $fvalue['value'])); \n }\n \n \n //echo '<br />' . \"STAG:\" . $this->resultArray[$stag] . '<br />';\n\n \n //preg_replace($matches[0], $this->replacement, $fvalue['value'])\n //str_replace($matches[0], $this->replacement, $fvalue['value'])\n\n// Helper::myPrint_r($matches[0]);\n// Helper::myPrint_r($matches[1]);\n// Helper::myPrint_r($this->replacement); \n// echo 'fvalue' . $fvalue['value'] . '<br />';\n// echo 'val: ' . preg_replace($matches[0], $this->replacement, $fvalue['value']). '<br />';\n// echo 'val: ' . str_replace($matches[1], $this->replacement, $fvalue['value']). '<br />';\n// echo '--------------------<br />'; \n }\n }\n //if formulas dependency order was not observed\n //$this->checkReplaceValues();\n \n// Helper::myPrint_r($this->clientProperties);\n// Helper::myPrint_r($this->itemProperties);\n// Helper::myPrint_r($this->rangeProperties);\n// Helper::myPrint_r($this->formulasValue);\n// Helper::myPrint_r($this->resultArray,true);\n\n }", "function custom_parsed()\n\t\t{\n\t\t$custom = array();\n\t\t$info = $this->infoarray();\n\t\tif(!isset($info['custom'])) { return $custom(); }\n\t\tforeach(explode(' ', $info['custom']) as $pair)\n\t\t\t{\n\t\t\tlist($k, $v) = explode('=', $pair);\n\t\t\t$custom[strtolower($k)] = ($v == 'false') ? false : intval($v);\n\t\t\t}\n\t\treturn $custom;\n\t\t}", "private function limpiarParametrosConEspacios($values){\n $resultado = array();\n foreach ($values as $key => $value) {\n $porciones = explode(\" \", $value);\n \n $cadena = '';\n foreach ($porciones as $val) {\n $cadena .= ($cadena=='' || empty($val))?'':' ';\n $cadena .= (!empty($val))?$val:'';\n }\n $resultado[$key] = $cadena;\n }\n \n return $resultado;\n }", "public function generate_output(){\n\t\t$this->check_for_hidden_values();\n\t\treturn implode(\",\",$this->values);\n\t}", "public function HandleVariables($value, $replaces)\n {\n $result = $value;\n if (!is_array($result)) {\n if (preg_match_all(\"/%%([A-Z0-9_:]+)%%/\", $result, $match) !== false) {\n if (is_array($match) && is_array($match[0])) {\n foreach ($match[0] as $k => $v) {\n $var = str_replace(\"%%\", \"\", $v);\n $var = strtolower($var);\n list($section, $key) = explode(\":\", $var);\n \n $varValue = null;\n if ($section == \"var\") {\n if (array_key_exists($key, $replaces)) {\n $varValue = $replaces[$key];\n }\n }\n if (!isset($varValue)) {\n $varValue = $this->Get($section, $key, \"\");\n }\n $result = str_replace($v, $varValue, $result);\n }\n }\n }\n }\n return $result;\n }", "function SendResults($results,$to,$a_values)\n{\n global $SPECIAL_VALUES;\n\n\t$b_got_filter = (isset($SPECIAL_VALUES[\"filter\"]) && !empty($SPECIAL_VALUES[\"filter\"]));\n\t\t//\n\t\t// special case: if there is only one non-special value and no\n\t\t// filter, then format it as an email\n\t\t//\n\tif (count($a_values) == 1 && !$b_got_filter)\n\t{\n\t\t\t//\n\t\t\t// create a new results value\n\t\t\t//\n\t\t$results = \"\";\n\t\tforeach ($a_values as $s_value)\n\t\t{\n\t\t\t\t//\n\t\t\t\t// replace carriage return/linefeeds with <br>\n\t\t\t\t//\n\t\t\t$s_value = str_replace(\"\\r\\n\",'<br>',$s_value);\n\t\t\t\t//\n\t\t\t\t// replace lone linefeeds with <br>\n\t\t\t\t//\n\t\t\t$s_value = str_replace(\"\\n\",'<br>',$s_value);\n\t\t\t\t//\n\t\t\t\t// remove lone carriage returns\n\t\t\t\t//\n\t\t\t$s_value = str_replace(\"\\r\",\"\",$s_value);\n\t\t\t\t//\n\t\t\t\t// replace all control chars with <br>\n\t\t\t\t//\n\t\t\t$s_value = preg_replace('/[[:cntrl:]]+/','<br>',$s_value);\n\t\t\t\t//\n\t\t\t\t// strip HTML\n\t\t\t\t//\n\t\t\t$s_value = StripHTML($s_value,BODY_LF);\n\t\t\t$results .= $s_value;\n\t\t}\n\t}\n\telse\n\t{\n\t\t\t//\n\t\t\t// write some standard mail headers - if we're using capcode, these\n\t\t\t// headers are not used, but they are nice to have as clear text anyway\n\t\t\t//\n\t\t$res_hdr = \"To: $to\".BODY_LF;\n\t\t$res_hdr .= \"From: \".$SPECIAL_VALUES[\"email\"].\" (\".$SPECIAL_VALUES[\"realname\"].\")\".BODY_LF;\n\t\t$res_hdr .= BODY_LF;\n\t\t$res_hdr .= \"--START--\".BODY_LF;\t\t// signals the beginning of the text to encode\n\n\t\t\t//\n\t\t\t// put the realname and the email address at the top of the results\n\t\t\t//\n\t\t$results = \"realname: \".$SPECIAL_VALUES[\"realname\"].BODY_LF.$results;\n\t\t$results = \"email: \".$SPECIAL_VALUES[\"email\"].BODY_LF.$results;\n\n\t\t\t//\n\t\t\t// prepend the header to the results\n\t\t\t//\n\t\t$results = $res_hdr.$results;\n\n\t\t\t//\n\t\t\t// if there is a filter required, filter the data first\n\t\t\t//\n\t\tif ($b_got_filter)\n\t\t\t$results = Filter($SPECIAL_VALUES[\"filter\"],$results);\n\t}\n\t\t//\n\t\t// append the environment variables report\n\t\t//\n\tif (isset($SPECIAL_VALUES[\"env_report\"]))\n\t{\n\t\t$results .= BODY_LF.\"==================================\".BODY_LF;\n\t\t$results .= BODY_LF.GetEnvVars(explode(\",\",$SPECIAL_VALUES[\"env_report\"]),BODY_LF);\n\t}\n\t\t//\n\t\t// create the From address as the mail header\n\t\t//\n\t$headers = \"From: \".$SPECIAL_VALUES[\"email\"].\" (\".$SPECIAL_VALUES[\"realname\"].\")\";\n\t\t//\n\t\t// send the mail - assumes the to addresses have already been checked\n\t\t//\n return (SendCheckedMail($to,$SPECIAL_VALUES[\"subject\"],$results,$headers));\n}", "public function formatFormValues( $values )\n\t{\n\t\treturn $values;\n\t}", "function setOutputValues(array $inValues) {\n foreach ($inValues as $_value) {\n if (! is_array($_value)) {\n throw new \\Exception(\"Invalid output value's description. It should be an array.\");\n }\n if (0 === count($_value)) {\n throw new \\Exception(\"Invalid output value's description. It should, at least contain the value's name.\");\n }\n $name = $_value[0];\n $description = count($_value) > 1 ? $_value[1] : null;\n\n $this->addOutputValue($name, $description);\n }\n }", "function test_value($text, $type){\n global $varregex, $labelregex, $intregex, $stringregex, $boolregex, $typeregex;\n if($type == 'var'){\n if(preg_match($varregex, $text)) {\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu var.\\n\", 21));\n }\n elseif ($type == 'label') {\n if(preg_match($labelregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu label.\\n\", 21));\n }\n elseif ($type == 'int') {\n if(preg_match($intregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu int.\\n\", 21));\n }\n elseif ($type == 'string') {\n if(preg_match($stringregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu string.\\n\", 21));\n }\n elseif ($type == 'bool') {\n if(preg_match($boolregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu bool.\\n\", 21));\n }\n elseif ($type == 'type') {\n if(preg_match($typeregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu type.\\n\", 21));\n }\n }", "function getExcludedValues()\n{\n $excludedValue = \"\";\n $excludedValue .= getExcludedValueByName(\"Process_Rewrite\");\n $excludedValue .= getExcludedValueByName(\"Process_Extension\");\n $excludedValue .= getExcludedValueByName(\"Process_StranglerPattern\");\n $excludedValue .= getExcludedValueByName(\"Process_ContinuousEvolution\");\n $excludedValue .= getExcludedValueByName(\"Process_Split\");\n $excludedValue .= getExcludedValueByName(\"Process_Others\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_DDD\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_FunctionalDecomposition\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_ExistingStructure\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_Others\");\n $excludedValue .= getExcludedValueByName(\"Technique_SCA\");\n $excludedValue .= getExcludedValueByName(\"Technique_MDA\");\n $excludedValue .= getExcludedValueByName(\"Technique_WDA\");\n $excludedValue .= getExcludedValueByName(\"Technique_DMC\");\n $excludedValue .= getExcludedValueByName(\"Technique_Others\");\n $excludedValue .= getExcludedValueByName(\"Applicability_GR\");\n $excludedValue .= getExcludedValueByName(\"Applicability_MO\");\n $excludedValue .= getExcludedValueByName(\"Input_SourceCode\");\n $excludedValue .= getExcludedValueByName(\"Input_UseCase\");\n $excludedValue .= getExcludedValueByName(\"Input_SystemSpecification\");\n $excludedValue .= getExcludedValueByName(\"Input_API\");\n $excludedValue .= getExcludedValueByName(\"Input_Others\");\n $excludedValue .= getExcludedValueByName(\"Output_List\");\n $excludedValue .= getExcludedValueByName(\"Output_Archi\");\n $excludedValue .= getExcludedValueByName(\"Output_Others\");\n $excludedValue .= getExcludedValueByName(\"Validation_Experiment\");\n $excludedValue .= getExcludedValueByName(\"Validation_Example\");\n $excludedValue .= getExcludedValueByName(\"Validation_CaseStudy\");\n $excludedValue .= getExcludedValueByName(\"Validation_NoValidation\");\n $excludedValue .= getExcludedValueByName(\"Quality_Maintainability\");\n $excludedValue .= getExcludedValueByName(\"Quality_Performance\");\n $excludedValue .= getExcludedValueByName(\"Quality_Reliability\");\n $excludedValue .= getExcludedValueByName(\"Quality_Scalability\");\n $excludedValue .= getExcludedValueByName(\"Quality_Security\");\n $excludedValue .= getExcludedValueByName(\"Quality_Others\");\n\n return $excludedValue;\n}", "private function PREPARE_VALIDATION_RESULTS()\r\r {\r\r $this->PREPARE_OBJECT_VARIABLE_METHOD(); \r\r $this->READ_FIELDS();\r\r \r\r foreach($this->_ready_fields as $key => $fields)\r\r {\r\r # SET THE ALIAS FOR EACH FIELD\r\r $this->_object[$key]['ALIAS'] = (isset($fields['ALIAS'])) ? $fields['ALIAS'] : $key; \r\r \r\r # IF VALUE IS NOT NULL\r\r if(isset($fields['REQUIRED']) && $this->_object[$key]['VALUE']===''){\r\r $this->_results[$key]['REQUIRED'] = (strlen($fields['REQUIRED']) > 1 ) ? $fields['REQUIRED'] : $this->_object[$key]['ALIAS'].' '.$this->_error['REQUIRED'];\r\r }\r\r \r\r # IF VALUE IS NOT NUMERIC\r\r if( isset($fields['NUMERIC']) && !is_numeric($this->_object[$key]['VALUE']) ){\r\r $this->_results[$key]['NUMERIC'] = (strlen($fields['NUMERIC'])>1 ? $fields['NUMERIC'] :$this->_object[$key]['ALIAS'].' '.$this->_error['NUMERIC']);\r\r }\r\r \r\r # IF VALUE IS A VALID EMAIL\r\r if(isset($fields['EMAIL']) && !$this->checkEmail($this->_object[$key]['VALUE'])){\r\r $this->_results[$key]['EMAIL'] = (strlen($fields['EMAIL'])>1 ? $fields['EMAIL'] :$this->_object[$key]['ALIAS'].' '.$this->_error['EMAIL']);\r\r }\r\r \r\r # IF VALUE HAS A SPECIFIC LENGTH\r\r if(isset($fields['LENGTH'])){\r\r \r\r if(array_key_exists('EQUAL', $fields['LENGTH']) && !(($fields['LENGTH']['EQUAL']) == strlen($this->_object[$key]['VALUE'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR']:$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['EQUAL'].' '.$fields['LENGTH']['EQUAL'].' characters';\r\r }\r\r # GREATER THAN \r\r else if(array_key_exists('GREAT', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE']) > ($fields['LENGTH']['GREAT'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT'].' '.$fields['LENGTH']['GREAT'].' characters';\r\r }\r\r # GREATER THAN EQUAL TO \r\r else if(array_key_exists('GREAT_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])>=($fields['LENGTH']['GREAT_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT_E'].' '.$fields['LENGTH']['GREAT_E'].' characters';\r\r }\r\r # LESS THAN \r\r else if(array_key_exists('LESS', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<($fields['LENGTH']['LESS'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS'].' '.$fields['LENGTH']['LESS'].' characters';\r\r }\r\r # LESS THAN EQUAL TO \r\r else if(array_key_exists('LESS_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<=($fields['LENGTH']['LESS_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS_E'].' '.$fields['LENGTH']['LESS_E'].' characters';\r\r }\r\r }\r\r \r\r # IF A FIELD IS EQUAL TO ANOTHER FIELD \r\r if(isset($fields['COMPARE'])){\r\r \r\r if(is_array($fields['COMPARE']))\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']['WITH']]['VALUE']){ \r\r $this->_results[$key]['COMPARE'] = isset($fields['COMPARE']['ERROR']) ? $fields['COMPARE']['ERROR'] : $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']['WITH']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r } \r\r else\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']]['VALUE']){\r\r $this->_results[$key]['COMPARE'] = $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r }\r\r }\r\r \r\r } \r\r }", "private function noramlizeArgs(array $values)\n {\n foreach ($values as $k => $v) {\n if ($v instanceof DynamicValue) {\n $values[$k] = $v->getValue();\n } elseif (is_array($v)) {\n $values[$k] = $this->noramlizeArgs($v);\n }\n }\n\n return $values;\n }", "function clear_sanity($values)\n {\n $values = (is_array($values)) ?\n array_map(\"clear_sanity\", $values) :\n htmlentities($values, ENT_QUOTES, 'UTF-8');\n\n return $values;\n }", "public function validate_option( $values ) {\n $out = array ();\n return $values;\n }" ]
[ "0.56271833", "0.5432591", "0.5308974", "0.53080565", "0.52840567", "0.52703094", "0.5217226", "0.5171367", "0.5107846", "0.5102583", "0.5042541", "0.50354445", "0.4871941", "0.48659888", "0.48606753", "0.48368618", "0.4802709", "0.477587", "0.47578275", "0.47525573", "0.47336787", "0.472051", "0.47119433", "0.46569932", "0.46335006", "0.46322998", "0.46277222", "0.46255016", "0.4615182", "0.45981467" ]
0.6571655
0
Check the input for required values. The list of required fields is a commaseparated list of field names.
function CheckRequired($reqd,$vars,&$missing) { $bad = false; $list = explode(",",$reqd); for ($ii = 0 ; $ii < count($list) ; $ii++) { $name = $list[$ii]; if ($name) { // // field names can be just straight names, or in this // format: // fieldname:Nice printable name for displaying // if (($nice_name_pos = strpos($name,":")) > 0) { $nice_name = substr($name,$nice_name_pos + 1); $name = substr($name,0,$nice_name_pos); } else $nice_name = $name; if (!isset($vars[$name]) || empty($vars[$name])) { $bad = true; $missing .= "$nice_name\n"; } } } return (!$bad); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validate_required_fields()\n\t{\n\t\t$errors = array();\n\t\t\n\t\tforeach (array_keys($this->_required_fields) as $field)\n\t\t{\n\t\t\t$value = $this->get_field_value($field);\n\t\t\t\n\t\t\tif (!validate::required($value))\n\t\t\t{\n\t\t\t\t$errors[$field] = 'Required';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $errors;\n\t}", "function _required($required, $data)\n\t{\n\t\tforeach ($required as $field)\n\t\t{\n\t\t\tif ( ! isset($data[$field]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}", "private function checkRequired()\n {\n if ($this->fld->is_required == 1 && !$this->is_val_set) {\n throw new Exceptions\\DXCustomException(sprintf(trans('errors.required_field'), $this->fld->title_list));\n }\n }", "public static function checkRequiredFields( $required, $data ) {\n\n\t\tforeach ( $required as $key => $values ) {\n\n\t\t\t$name = $values[0];\n\t\t\t$type = $values[1];\n\t\t\t$value = $data[ $key ];\n\n\t\t\t// fetch data by type\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase Data::INT:\n\t\t\t\t\t$value = Data::getInt($value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Data::STR: /* nothing */\n\t\t\t\tcase Data::ARR: /* nothing */\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tError::fatal( \"invalid data type specified for '$key'\", Error::SYS );\n\t\t\t}\n\n\t\t\tif ( !$value )\n\t\t\t\tError::fatal( \"you missed the '$name' field\" );\n\n\t\t}\n\n\t}", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "function check_required_fields($required_array) {\r\n $field_errors = array();\r\n foreach($required_array as $fieldname) {\r\n if (isset($_POST[$fieldname]) && empty($_POST[$fieldname])) { \r\n $field_errors[] = ucfirst($fieldname). \" is required\"; \r\n }\r\n }\r\n return $field_errors;\r\n}", "static function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n // $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n if ($error) {\n // Required field(s) are missing or empty\n return 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n } else {\n return 'done';\n }\n }", "function verifyRequiredParams($required_fields)\n{\n\n\t//get request params\n\t$request_params = $_REQUEST;\n\t\n\t//Loop through all parameters\n\tforeach ($required_fields as $field) {\n\t\t//if any required parameter is missing\n\t\tif (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n\t\t\n\t\t\t//return true\n\t\t\treturn true;\n\t\t}\n\t}\n\t//otherwise, return false\n\treturn false;\n}", "function verifyRequiredParams($required_fields)\n {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n $this->echoResponse(400, $response);\n $app->stop();\n }\n }", "public static function requiredFields(array $required, object $req)\n {\n $data = array_keys((array) $req);\n $data = array_diff($required, $data);\n count($data) > 0 &&\n Response::message(\n [\"message\" => \"Value(s) required!\", \"values\" => array_values($data)],\n 406\n );\n\n return true;\n }", "function isTheseParametersAvailable($required_fields)\n{\n $error = false;\n $error_fields = \"\";\n $request_params = $_REQUEST;\n\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n $response = array();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echo json_encode($response);\n return false;\n }\n return true;\n}", "function verifyRequiredParams($required_fields) \n\t{\n\t\t$error = false;\n\t\t$error_fields = \"\";\n\t\t$request_params = array();\n\t\t$request_params = $_REQUEST;\n\t\t\n\t\t// Handling PUT request params\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'PUT') \n\t\t{\n\t\t\t$app = \\Slim\\Slim::getInstance();\n\t\t\tparse_str($app->request()->getBody(), $request_params);\n\t\t}\n\t\t\n\t\tforeach ($required_fields as $field) \n\t\t{\n\t\t\tif (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) \n\t\t\t{\n\t\t\t\t$error = true;\n\t\t\t\t$error_fields .= $field . ', ';\n\t\t\t}\n\t\t\n\t\t}\n\n\t\tif ($error) \n\t\t{\n\t\t\t\n\t\t\t// Required field(s) are missing or empty\n\t\t\t// echo error json and stop the app\n\t\t\t$response = array();\n\t\t\t$app = \\Slim\\Slim::getInstance();\n\t\t\t$response[\"error\"] = true;\n\t\t\t$response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n\t\t\techoRespnse(400, $response);\n\t\t\t$app->stop();\n\t\t}\n }", "protected function _required($required, $data) {\r\n foreach ($required as $field) {\r\n if (!isset($data[$field])) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "public function validate_fields() {\n \n\t\t//...\n \n }", "function verifyRequiredParams($required_fields) {\r\n\t\t\t$error = false;\r\n\t\t\t$error_fields = \"\";\r\n\t\t\t$request_params = array();\r\n\t\t\t$request_params = $_REQUEST;\r\n\t\t\t// Handling PUT request params\r\n\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n\t\t\t\t$app = \\Slim\\Slim::getInstance();\r\n\t\t\t\tparse_str($app->request()->getBody(), $request_params);\r\n\t\t\t}\r\n\t\t\tforeach ($required_fields as $field) {\r\n\t\t\t\tif (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\t$error_fields .= $field . ', ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t \r\n\t\tif ($error) {\r\n\t\t\t// Required field(s) are missing or empty\r\n\t\t\t// echo error json and stop the app\r\n\t\t\t$response = array();\r\n\t\t\t$app = \\Slim\\Slim::getInstance();\r\n\t\t\t$response[\"error\"] = true;\r\n\t\t\t$response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\r\n\t\t\techoRespnse(400, $response);\r\n\t\t\t$app->stop();\r\n\t\t}\r\n\t}", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "private function checkRequiredParameters()\n {\n $missingParameters = array();\n\n foreach ($this->parameters as $name => $properties) {\n $required = $properties['required'];\n $value = $properties['value'];\n if ($required && is_null($value)) {\n $missingParameters[] = $name;\n }\n }\n\n if (count($missingParameters) > 0) {\n $missingParametersList = implode(', ', $missingParameters);\n throw new IndexParameterException('The following required\n parameters were not set: '.$missingParametersList.'.');\n }\n }", "function checkEmptyField($requiredField){\n\n $formErrors = array();\n\n foreach($requiredField as $nameofField){\n\n if (!isset($_POST[$nameofField]) || $_POST[$nameofField] == NULL){\n \n $formErrors[] = $nameofField . \" is a required field.\" ;\n \n }\n }\n return $formErrors;\n }", "public function check_fields($fields) {\n\t \n\t if ($fields == \"*\") {\n\t\treturn array('error' => false, 'param' =>'');\n\t }\n\t \n $fields_arr = explode(',',$fields);\n\t \n\t foreach ($fields_arr as $element) {\n\t\tif (!isset($this->paramsStr[$element])) {\n\t\t return array('error' => true , 'param' => $element);\n\t\t}\n\t }\n\t return array('error' => false, 'param' =>'');\n\t}", "public function hasRequiredFields()\n {\n // If any of our fields are empty, reject stuff\n $all_fields_found = true;\n $field_list = array(\n 'email',\n 'password',\n 'password2',\n 'first_name',\n 'last_name',\n 'speaker_info'\n );\n\n foreach ($field_list as $field) {\n if (!isset($this->_data[$field])) {\n $all_fields_found = false;\n break;\n }\n }\n\n return $all_fields_found;\n }", "protected static function _required() {\n if (self::$_ruleValue) {\n if (trim(self::$_elementValue) == NULL &&\n strlen(self::$_elementValue) == 0) {\n self::setErrorMessage(\"Field Required\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "protected static function validate_required($field, $input, $param = NULL)\n\t{\n\t\tif(isset($input[$field]) && trim($input[$field]) != '')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'field' => $field,\n\t\t\t\t'value' => $input[$field],\n\t\t\t\t'rule'\t=> __FUNCTION__\n\t\t\t);\n\t\t}\n\t}", "function verifyRequiredParams($required_fields, Request $request) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n parse_str(request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n $response = array();\n $response[\"error\"] = $error;\n if ($error) {\n // Required field(s) are missing or empty\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is/are missing or empty';\n }\n return $response;\n}", "public function checkInput($fields = '')\n {\n if($fields == '*') return false;\n $this->describeTable();\n\n //$fields = explode(', ', $fields);\n $fields = preg_split('/ ?[,|] ?/', $fields);\n\n $arr = [];\n foreach($fields as $f)\n {\n if(!in_array($f, $this->tableFields))\n {\n continue;//just remove unsafe fields\n }\n else\n {\n $arr[] = $f;\n }\n }\n return (!empty($arr)) ? implode(',' , $arr) : false;\n }", "function validate_fields() {\n\t\treturn true;\n\t}", "function verifyRequiredParams($required_fields) {\r\n $error = false;\r\n $error_fields = \"\";\r\n $request_params = array();\r\n $request_params = $_REQUEST;\r\n // handling PUT request params\r\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n $app = \\Slim\\Slim::getInstance();\r\n parse_str($app->request()->getBody(), $request_params);\r\n }\r\n foreach ($required_fields as $field) {\r\n if (!isset($request_params[$field]) || !is_array($request_params)) {\r\n $error = true;\r\n $error_fields .= $field . ', ';\r\n }\r\n }\r\n if ($error) {\r\n // required fields are missing or empty\r\n // echo error json and stop the app\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n $response['error'] = true;\r\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\r\n echoResponse(400, $response);\r\n $app->stop();\r\n }\r\n}", "function validate_all($required,$data){\n\n\t$result = array();\n\t$result['code'] = 1;\n\t$result['error'] = \"All OK!\";\n\n\tif(count(array_intersect_key($required, $data)) != count($required)){\n\t\t$result['code'] = 0;\n\t\t$result['error'] = \"Fields Mismatch!\";\n\t\treturn $result;\n\t}\n\n\t$field_count \t= count($required);\n\n\tforeach ($required as $field => $rules) {\n\t\t$value = $data[$field];\n\n\t\t$code = 0;\n\t\t$error = \"\";\n\n\t\tswitch ($rules['type']) {\n\t\t\tcase 'numeric':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!is_numeric($value)){\n\t\t\t\t\t$error = $field.\" is not numeric.\";\n\t\t\t\t}else if(isset($rules['min'])){\n\t\t\t\t\tif($value < $rules['min']){\n\t\t\t\t\t\t$error = $field.\" min error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else if(isset($rules['max'])){\n\t\t\t\t\tif($value > $rules['max']){\n\t\t\t\t\t\t$error = $field.\" max error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'alpha':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!preg_match($rules['pattern'], $value)){\n\t\t\t\t\t$error = $field.\" is invalid.\";\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$result['fields'][$field] = array('code' => $code, 'error' => $error, 'value'=>$value, 'field'=>$field );\n\t}\n\n\tforeach ($result['fields'] as $row) {\n\t\tif($row[\"code\"] == 0){\n\t\t\t$result['code'] = 0;\n\t\t\t$result['error'] = \"Invalid Fields!\";\n\t\t\tbreak;\n\t\t}\t\t\n\t}\n\n\treturn $result;\n\n}", "public function validateFields()\n {\n $invalidFields = [];\n if (empty($_POST[\"activity\"])) {\n array_push($invalidFields, \"activity\");\n }\n if (empty($_POST[\"country\"])) {\n array_push($invalidFields, \"country\");\n }\n if (empty($_POST[\"done\"]) && empty($_POST[\"not done\"])) {\n array_push($invalidFields, \"done\");\n }\n return $invalidFields;\n }", "function required_params()\n {\n $params = func_get_args();\n foreach ($params as $value) {\n if (is_array($value)) {\n if (empty($value)) {\n return false;\n }\n } else {\n if ($value === null || strlen(trim($value)) == 0) {\n return false;\n }\n }\n }\n\n return true;\n }" ]
[ "0.71862394", "0.6990089", "0.6868447", "0.68517977", "0.6843158", "0.6805379", "0.6734402", "0.6732079", "0.670135", "0.66926414", "0.66483855", "0.65949297", "0.6552953", "0.65396273", "0.6534771", "0.6500435", "0.6457113", "0.6436637", "0.64264506", "0.64071584", "0.64032924", "0.63933146", "0.63844275", "0.63656384", "0.63566995", "0.63226366", "0.62834436", "0.62579226", "0.6249488", "0.6236658" ]
0.7254165
0
Return a formatted list of the given environment variables.
function GetEnvVars($list,$s_line_feed) { global $VALID_ENV,$sServerVars; $output = ""; for ($ii = 0 ; $ii < count($list) ; $ii++) { $name = $list[$ii]; if ($name && array_search($name,$VALID_ENV,true) !== false) { // // if the environment variable is empty or non-existent, try // looking for the value in the server vars. // if (($s_value = getenv($name)) === "" || $s_value === false) if (isset($sServerVars[$name])) $s_value = $sServerVars[$name]; else $s_value = ""; $output .= $name."=".$s_value.$s_line_feed; } } return ($output); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEnvs();", "private function getEnvironmentVariables()\n {\n return array(\n 'GIT_TERMINAL_PROMPT' => '0',\n 'GIT_ASKPASS' => 'echo',\n );\n }", "protected function get_env_parameters()\n\t{\n\t\t$parameters = array();\n\t\tforeach ($_SERVER as $key => $value)\n\t\t{\n\t\t\tif (0 === strpos($key, 'PHPBB__'))\n\t\t\t{\n\t\t\t\t$parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $parameters;\n\t}", "private static function parseEnvProperties(): array\r\n {\r\n $envProperties = array();\r\n $vars = file(Config::$baseDir . '/../.env', FILE_IGNORE_NEW_LINES);\r\n foreach ($vars as $var) {\r\n if (substr($var, 0, 2) === '##') continue;\r\n $envProperties[explode('=', $var)[0]] = explode('=', $var)[1];\r\n }\r\n return $envProperties;\r\n }", "protected function getEnvParameters()\n {\n $parameters = array();\n\n foreach ($_SERVER as $key => $value) {\n if (0 === strpos($key, 'SYMFONY__')) {\n $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value === '~'?null:$value;\n }\n }\n\n return $parameters;\n }", "public function toEnv(): string\n {\n $salts = $this->getSalts();\n return array_reduce(\n array_keys($salts), function ($saltsString, $key) use ($salts) {\n $saltsString .= \"{$key}='{$salts[$key]}'\" . PHP_EOL;\n return $saltsString;\n }, ''\n );\n }", "public function getEnvironments();", "public function getEnvVars(): array {\n return $this->configVars['env-vars'];\n }", "protected function getEnvironmentVariablesThatICareAbout()\n {\n return array(\n 'shell',\n 'tmpdir',\n 'user',\n 'pwd',\n 'lang',\n 'editor',\n 'home',\n );\n }", "protected function getEnvironmentVariables()\n {\n $env = array();\n\n foreach ($_SERVER as $name => $val) {\n if (is_array($val) || !in_array(strtolower($name), $this->getEnvironmentVariablesThatICareAbout())) {\n // In the future, this could be supported\n continue;\n }\n\n $env['env.'.$name] = $val;\n }\n\n return $env;\n }", "public function getAllEnvironmentVariables()\n {\n return include $_SERVER['DOCUMENT_ROOT'] . '/env.php';\n }", "public function getEnvVars(): array\n {\n return $this->envVars;\n }", "public function envVariablesDataProvider(): array\n {\n return [\n 'only one existing expression' => [\n '{{null}}',\n ['{{null}}' => '']\n ],\n 'one existing expression with additional chars' => [\n 'prefix{{null}}suffix',\n ['{{null}}' => '']\n ],\n 'one expression existing two times with additional chars' => [\n 'prefix{{null}}suffix{{null}}suffix2',\n ['{{null}}' => '']\n ]\n ];\n }", "public function getEnvironmentVariablesAsArray()\n {\n // Iterate over the environmentVariable nodes and sort them into an array\n $environmentVariables = array();\n foreach ($this->getEnvironmentVariables() as $environmentVariableNode) {\n\n // Restructure to an array\n $environmentVariables[] = array(\n 'condition' => $environmentVariableNode->getCondition(),\n 'definition' => $environmentVariableNode->getDefinition()\n );\n }\n\n // Return what we got\n return $environmentVariables;\n }", "public function envNames(): array\n {\n return $this->env->names();\n }", "public function getEnvironmentVariables()\n {\n return $this->environment_variables;\n }", "public function getEnvironmentVariables()\n {\n return $this->_envVars;\n }", "public function getAllEnvironmentPaths(): array\n {\n $paths = $this->getAllPaths();\n $envvars = [];\n\n foreach ($paths as $key => $path) {\n $envvar_key = str_replace(['_', 'x86'], ['', '(x86)'], $key);\n $envvars[$envvar_key] = $path;\n }\n\n $envvars = array_change_key_case($envvars, CASE_UPPER);\n\n return $envvars;\n }", "public function getEnvironmentVariables()\n {\n return $this->environmentVariables;\n }", "public function getEnvironmentVariables()\n {\n return $this->_environmentVariables;\n }", "protected function getEnvironments()\n {\n return array('dev', 'test', 'preprod');\n }", "public static function GetAllNames () {\n\t\treturn [\n\t\t\t\\MvcCore\\IEnvironment::DEVELOPMENT,\n\t\t\t\\MvcCore\\IEnvironment::ALPHA,\n\t\t\t\\MvcCore\\IEnvironment::BETA,\n\t\t\t\\MvcCore\\IEnvironment::PRODUCTION\n\t\t];\n\t}", "public function displayEnvironmentDetails(array $vars);", "function getEnvVariables($line,$envVar)\n{\n $returnVal='';\n //remove all blanks from the string.\n $line=str_replace(' ','',$line);\n $tempArray=explode($envVar,$line);\n //index 1 of array should have value - if it is set. \n if (isset($tempArray[1])) {\n $returnVal=$tempArray[1]; \n }\n \n return $returnVal;\n}", "public function siteEnvLookupParameters()\n {\n return [\n\n // Site not specified on commandline\n // Command takes site_env and variable arguments\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site_env: site-from-config.dev', 'list: [a, b]'],\n ['program', 'example:op', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site_env: othersite.test', 'list: [a, b]'],\n ['program', 'example:op', 'othersite.test', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site_env: a', 'list: [b]'],\n ['program', 'example:op', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n [],\n ],\n\n // Site not speicifed on commandline\n // Command takes site_env and one other required argument\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site_env: site-from-config.dev', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteEnvRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site_env: othersite.test', 'item: a'],\n ['program', 'example:op', 'othersite.test', 'a'],\n $this->siteEnvRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site_env: a', 'item: EMPTY'],\n ['program', 'example:op', 'a'],\n $this->siteEnvRequiredArgsDef(),\n [],\n ],\n\n // Site not speicifed on commandline\n // Command takes site and one other required argument\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site: site-from-config', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site: othersite', 'item: a'],\n ['program', 'example:op', 'othersite', 'a'],\n $this->siteRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site: EMPTY', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteRequiredArgsDef(),\n [],\n ],\n\n ];\n }", "public function formatBuildArguments()\n {\n return array_merge(\n ['__VAPOR_RUNTIME='.Manifest::runtime($this->environment)],\n array_filter($this->cliBuildArgs, function ($value) {\n return ! Str::startsWith($value, '__VAPOR_RUNTIME');\n })\n );\n }", "public function getVariablesList() {\n return $this->_get(2);\n }", "public function getVariablesList() {\n return $this->_get(4);\n }", "public function getEnv(): array\n {\n return $this->env;\n }", "function getEnvironmentVariables()\n{\n\tglobal $config_array;\n\n\tif ($customnr = getenv('CUSTOMERNR')) {\n\t\t$config_array['CUSTOMERNR'] = $customnr;\n\t}\n\n\tif ($apikey = getenv('APIKEY')) {\n\t\t$config_array['APIKEY'] = $apikey;\n\t}\n\n\tif ($apipassword = getenv('APIPASSWORD')) {\n\t\t$config_array['APIPASSWORD'] = $apipassword;\n\t}\n\n\tif ($domain = getenv('DOMAIN')) {\n\t\t$config_array['DOMAIN'] = $domain;\n\t}\n\n\tif ($hostipv4 = getenv('HOST_IPv4')) {\n\t\t$config_array['HOST_IPv4'] = $hostipv4;\n\t}\n\n\tif ($hostipv6 = getenv('HOST_IPv6')) {\n\t\t$config_array['HOST_IPv6'] = $hostipv6;\n\t}\n\n\tif ($useipv4 = getenv('USE_IPV4')) {\n\t\t$config_array['USE_IPV4'] = $useipv4;\n\t}\n\n\tif ($usefb = getenv('USE_FRITZBOX')) {\n\t\t$config_array['USE_FRITZBOX'] = $usefb;\n\t}\n\n\tif ($fbip = getenv('FRITZBOX_IP')) {\n\t\t$config_array['FRITZBOX_IP'] = $fbip;\n\t}\n\n\tif ($useipv6 = getenv('USE_IPV6')) {\n\t\t$config_array['USE_IPV6'] = $useipv6;\n\t}\n\n\tif ($ipv6interface = getenv('IPV6_INTERFACE')) {\n\t\t$config_array['IPV6_INTERFACE'] = $ipv6interface;\n\t}\n\n\tif ($ipv6priv = getenv('NO_IPV6_PRIVACY_EXTENSIONS')) {\n\t\t$config_array['NO_IPV6_PRIVACY_EXTENSIONS'] = $ipv6priv;\n\t}\n\n\tif ($changettl = getenv('CHANGE_TTL')) {\n\t\t$config_array['CHANGE_TTL'] = $changettl;\n\t}\n\n\tif ($apiurl = getenv('APIURL')) {\n\t\t$config_array['APIURL'] = $apiurl;\n\t}\n\n\tif ($sendmail = getenv('SEND_MAIL')) {\n\t\t$config_array['SEND_MAIL'] = $sendmail;\n\t}\n\n\tif ($mailrec = getenv('MAIL_RECIPIENT')) {\n\t\t$config_array['MAIL_RECIPIENT'] = $mailrec;\n\t}\n\n\tif ($sleepinsec = getenv('SLEEP_INTERVAL_SEC')) {\n\t\t$config_array['SLEEP_INTERVAL_SEC'] = $sleepinsec;\n\t}\n}" ]
[ "0.66357464", "0.637745", "0.6372802", "0.6364524", "0.62468576", "0.6242825", "0.62371224", "0.61860514", "0.61798364", "0.617086", "0.60791445", "0.6060386", "0.60586685", "0.6024537", "0.6018612", "0.60167074", "0.5994406", "0.5976962", "0.5877872", "0.5869686", "0.5840919", "0.5788447", "0.5701521", "0.5680533", "0.56592864", "0.55931646", "0.55854976", "0.5520914", "0.54898024", "0.54871017" ]
0.744383
0
send the given results to the given email addresses
function SendResults($results,$to,$a_values) { global $SPECIAL_VALUES; $b_got_filter = (isset($SPECIAL_VALUES["filter"]) && !empty($SPECIAL_VALUES["filter"])); // // special case: if there is only one non-special value and no // filter, then format it as an email // if (count($a_values) == 1 && !$b_got_filter) { // // create a new results value // $results = ""; foreach ($a_values as $s_value) { // // replace carriage return/linefeeds with <br> // $s_value = str_replace("\r\n",'<br>',$s_value); // // replace lone linefeeds with <br> // $s_value = str_replace("\n",'<br>',$s_value); // // remove lone carriage returns // $s_value = str_replace("\r","",$s_value); // // replace all control chars with <br> // $s_value = preg_replace('/[[:cntrl:]]+/','<br>',$s_value); // // strip HTML // $s_value = StripHTML($s_value,BODY_LF); $results .= $s_value; } } else { // // write some standard mail headers - if we're using capcode, these // headers are not used, but they are nice to have as clear text anyway // $res_hdr = "To: $to".BODY_LF; $res_hdr .= "From: ".$SPECIAL_VALUES["email"]." (".$SPECIAL_VALUES["realname"].")".BODY_LF; $res_hdr .= BODY_LF; $res_hdr .= "--START--".BODY_LF; // signals the beginning of the text to encode // // put the realname and the email address at the top of the results // $results = "realname: ".$SPECIAL_VALUES["realname"].BODY_LF.$results; $results = "email: ".$SPECIAL_VALUES["email"].BODY_LF.$results; // // prepend the header to the results // $results = $res_hdr.$results; // // if there is a filter required, filter the data first // if ($b_got_filter) $results = Filter($SPECIAL_VALUES["filter"],$results); } // // append the environment variables report // if (isset($SPECIAL_VALUES["env_report"])) { $results .= BODY_LF."==================================".BODY_LF; $results .= BODY_LF.GetEnvVars(explode(",",$SPECIAL_VALUES["env_report"]),BODY_LF); } // // create the From address as the mail header // $headers = "From: ".$SPECIAL_VALUES["email"]." (".$SPECIAL_VALUES["realname"].")"; // // send the mail - assumes the to addresses have already been checked // return (SendCheckedMail($to,$SPECIAL_VALUES["subject"],$results,$headers)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sendEmail($result) {\n Mail::send('emails.results-mail', $result, function($message) use($result) {\n $message->to($result['result']->parentEmail->parent_email)\n ->subject($result['result']->studentIfo->student_first_name . ' Term ' . $result['result']->term . ' Results')\n ->from($result['result']->schoolInfo->school_email, $result['result']->schoolInfo->school_name);\n });\n\n // success sent mails\n return response()->json([\n 'sent' => true\n ]);\n }", "public function sendEmail(array $emails);", "function send_emails() {\n $settings = new Settings();\n $mail_companies = $settings->get_mailto_companies();\n $failed_list_mails = array();\n $mail_reader = new EmailReader(dirname(__FILE__) . '/mails', $this->user_information);\n foreach ($this->cookie_list as $item) {\n if (!$item->has_email()) {\n \t$failed_list_mails[] = $item;\n }\n else {\n $template = $mail_reader->get_companies_mail($item, $mail_companies);\n if (!$this->mail_to($item, $template, $mail_companies)) {\n $failed_list_mails[] = $item;\n }\n\t }\n }\n $this->update_amounts_used($this->cookie_list);\n\n\n $attachments = array();\n\n $failed_list_letters = array();\n foreach ($this->cookie_list as $item) {\n if (!$item->has_address()) {\n $failed_list_letters[] = $item;\n }\n else {\n $letter_generator = new LetterGenerator($this->user_information);\n $pdf = $letter_generator->generate_letter_string($item);\n if ($pdf) {\n \t$folder_writer = new FolderHandler();\n \t$file = $folder_writer->store_file($pdf, \"pdf\");\n \tif ($file) {\n \t\t$attachments[] = $file;\n \t}\n \telse {\n \t\t$failed_list_letters[] = $item;\n \t}\n }\n else {\n $failed_list_letters[] = $item;\n }\n }\n }\n\n\n\n return $this->send_confirmation_mail($attachments, $failed_list_mails, array_diff($this->cookie_list,\n $failed_list_mails), $failed_list_letters, array_diff($this->cookie_list, $failed_list_letters),\n $mail_companies);\n }", "public function sendBatchEmail($peeps, $unsubtype, $SUBJECT, $TEXT, $context, \r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n {\r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\");\r\n $FROM = array('[email protected]' => '[email protected]');\r\n $efunctions = new Cvuuf_emailfunctions();\r\n $peoplemap = new Application_Model_PeopleMapper();\r\n $unsmap = new Application_Model_UnsubMapper();\r\n\r\n $results = array();\r\n $orwhere = array(\r\n array('`all`', ' = ', 1),\r\n array($unsubtype, ' = ', 1),\r\n );\r\n $unsubs = $unsmap->fetchOrWhere($orwhere);\r\n $unsubids = array();\r\n foreach ($unsubs as $unsub)\r\n {\r\n $person = $peoplemap->find($unsub->id);\r\n if ($person['email'] <> '')\r\n $unsubids[$person['email']] = 1;\r\n }\r\n\r\n $emailCount = count($peeps); \r\n $results[] = \"$emailCount copies to be sent.\";\r\n \t\t$count = 0;\r\n \t\t$fullcount = 0;\r\n\r\n $totalsent = 0;\r\n $invalid = array();\r\n $unsub = array();\r\n if ($emailCount >= 30) {\r\n return array('results' => $results.\" (rejected to avoid spam blacklists, 30-email max. Contact [email protected] to work out how to send this)\", 'log' => 'rejected to avoid spam blacklists', 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }\r\n unset($TO_array);\r\n \t\tforeach ($peeps as $peep) \r\n {\r\n \t $emailAddress = $peep->email;\r\n \t if (!$efunctions->isValidEmail($emailAddress))\r\n { \r\n $invalid[] = $emailAddress;\r\n }\r\n elseif (isset($unsubids[$emailAddress]))\r\n {\r\n $unsub[] = $emailAddress;\r\n } \r\n else \r\n {\r\n $fullcount++;\r\n $TO_array[$count++] = $emailAddress;\r\n \t\t\tif (($count%20) == 0) \r\n {\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n unset($TO_array);\r\n $count = 0;\r\n sleep(1);\r\n \t\t }\r\n // Check section limit and delay if reached\r\n if (($fullcount % 10) == 0)\r\n {\r\n $results[] = \"Progress count $fullcount sent\"; \r\n sleep(5);\r\n }\r\n \t}\r\n } \r\n // send last email segment\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n $results[] = sprintf(\"Ending fraction count %d copies\\n\", $numsent);\r\n $log = $efunctions->log_email($context, $emailCount, $totalsent, count($invalid), count($unsub));\r\n $results[] = \"Last Segment sent\";\r\n\r\n return array('results' => $results, 'log' => $log, 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }", "function sendEmails() {\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\n\t\t$emailUser = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailUser = str_replace(\"<br />\", \"\\n\", $emailUser);\n\t\t$emailAdmin = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailAdminBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailAdmin = str_replace(\"<br />\", \"\\n\", $emailAdmin);\n\t\t$emailFrom = $this->data['tx_gokontakt_emailFrom'];\n\t\t$emailFromName = $this->data['tx_gokontakt_emailFromName'];\n\t\t$emailToAdmin = $this->data['tx_gokontakt_emailToAdmin'];\n\n\t\t$this->sendEmail($this->pi_getLL('subject_email_user'), $emailUser, '', $emailFrom, $emailFromName, $this->piVars['email']);\n\t\t$this->sendEmail($this->pi_getLL('subject_email_admin'), $emailAdmin, '', $emailFrom, $emailFromName, $emailToAdmin);\n\t}", "private function Sendall($ids)\n {\n\t$success = true;\n foreach($ids as $id){\n if(!$this->sendinvoice($id)) $success = false;\n }\n if($success) Yii::$app->session->setFlash('success', 'Emails was send');\n\treturn $this->redirect(Yii::$app->request->referrer);\n }", "function sendFinalEmails ($email, $client_key, $final1, $final2, $final3, $final4) {\n\t//find device email and device type\n\t$sql = \"call getDeviceInfo(\".sql_escape_string($email,1).\");\";\n\techo $sql;\n\t$Result = execute_query($mysqli, $sql);\n\tif($Result) {\n\t\t$row = $Result[0]->fetch_assoc();\n\t\t$device_email = $row['email'];\n\t\t$device = $row['device'];\n\t\t$fname = $row['fname'];\n\t\t$lname = $row['lname'];\n\t\t$gSQL = 'CALL getOrgByKey('.sql_escape_string($client_key,1).');';\n\t\t//echo $gSQL;\n\t\t//echo '<br>';\n\n\t\t$gResult = execute_query($mysqli, $gSQL);\n\t\t$group_code = $gResult[0]->fetch_array()[0];\n\t\t//echo $group_code;\n\t\t//echo '<br>';\n\n\t\t//send to Socks\n\t\t$sMail = getSocksMailer();\n\t\t$sMail->Subject = \"Litesprite User Completed Onboarding\";\n\t\t$sMail->Body = \"client key: \".$client_key.\"<br>\n\t\t\t\t\t\tgroup: \".$group_code.\"<br>\n\t\t\t\t\t\tCodes and Instructions have been sent to: \".$email.\"<br> \n\t\t\t\t\t\tDevice: \".(($device == 'A') ?'Android':'iOS').\"<br> \n\t\t\t\t\t\tDevice email: \".$device_email.\"<br>\n\t\t\t\t\t\tLast name: \".$lname.\"<br>\n\t\t\t\t\t\tFirst name:\".$fname;\n\t\t//echo $sMail->Body;\n\t\t//echo '<br>';\n\t\t$sMail->AddAddress(\"[email protected]\");\n\t\tsendMail($sMail);\n\t\t//send to User\n\t\t$uMail = getSocksMailer();\n\t\t$uMail->Subject = \"Litesprite Beta Sign-Up Completed!\";\n\t\t$uMail->AddEmbeddedImage('../images/paw.png', 'paw');\n\t\t$uMail->Body = $final1.$group_code.$final2.$client_key.$final3.$device_email.$final4;\n\t\t//echo $uMail->Body;\n\t\t$uMail->AddAddress($email);\n\t\tsendMail($uMail);\n\t}\n}", "protected function send_alert_emails($emails) {\n global $USER, $CFG;\n\n if (!empty($emails)) {\n\n $url = new moodle_url($CFG->wwwroot . '/mod/simplecertificate/view.php',\n array('id' => $this->coursemodule->id, 'tab' => self::ISSUED_CERTIFCADES_VIEW));\n\n foreach ($emails as $email) {\n $email = trim($email);\n if (validate_email($email)) {\n $destination = new stdClass();\n $destination->email = $email;\n $destination->id = rand(-10, -1);\n\n $info = new stdClass();\n $info->student = fullname($USER);\n $info->course = format_string($this->get_instance()->coursename, true);\n $info->certificate = format_string($this->get_instance()->name, true);\n $info->url = $url->out();\n $from = $info->student;\n $postsubject = get_string('awardedsubject', 'simplecertificate', $info);\n\n // Getting email body plain text.\n $posttext = get_string('emailteachermail', 'simplecertificate', $info) . \"\\n\";\n\n // Getting email body html.\n $posthtml = '<font face=\"sans-serif\">';\n $posthtml .= '<p>' . get_string('emailteachermailhtml', 'simplecertificate', $info) . '</p>';\n $posthtml .= '</font>';\n\n @email_to_user($destination, $from, $postsubject, $posttext, $posthtml); // If it fails, oh well, too bad.\n }// If it fails, oh well, too bad.\n }\n }\n }", "public function to(array $emails);", "private function sendEmails($assigned_users){\n\t\t//For each user\n\t\tforeach($assigned_users as $giver){\n\t\t\t//Send the following email\n\t\t\t$email_body = \"Olá {$giver['name']},\n\t\t\t\tPara o Pai Natal Secreto desde ano, vais comprar um presente ao/à {$giver['giving_to']['name']}\n\n\t\t\t\tOs presentes devem todos ser até mais/menos €{$this->item_value},\n\n\t\t\t\tBoa Sorte e Feliz Natal,\n\t\t\t\tPai Natal\n\t\t\t\t\";\n\t\t\t//Log that its sent\n\t\t\t$this->sent_emails[] = $giver['email'];\n\t\t\t//Send em via normal PHP mail method\n\t\t\tmail($giver['email'], $this->mail_title, $email_body, \"From: {$this->mail_from}\\r\\n\");\n\t\t}\n\t}", "private function sendEmail()\n\t{\n\t\t// Get data\n\t\t$config = JFactory::getConfig();\n\t\t$mailer = JFactory::getMailer();\n\t\t$params = JComponentHelper::getParams('com_code');\n\t\t$addresses = $params->get('email_error', '');\n\n\t\t// Build the message\n\t\t$message = sprintf(\n\t\t\t'The sync cron job on developer.joomla.org started at %s failed to complete properly. Please check the logs for further details.',\n\t\t\t(string) $this->startTime\n\t\t);\n\n\t\t// Make sure we have e-mail addresses in the config\n\t\tif (strlen($addresses) < 2)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$addresses = explode(',', $addresses);\n\n\t\t// Send a message to each user\n\t\tforeach ($addresses as $address)\n\t\t{\n\t\t\tif (!$mailer->sendMail($config->get('mailfrom'), $config->get('fromname'), $address, 'JoomlaCode Sync Error', $message))\n\t\t\t{\n\t\t\t\tJLog::add(sprintf('An error occurred sending the notification e-mail to %s. Error: %s', $address, $e->getMessage()), JLog::INFO);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "public function send_email() {\n\t\t$args = [\n\t\t\t'to' => apply_filters(\n\t\t\t\tsprintf( 'mylisting/emails/%s:mailto', $this->get_key() ),\n\t\t\t\t$this->get_mailto()\n\t\t\t),\n\t\t\t'subject' => sprintf( '[%s] %s', get_bloginfo('name'), $this->get_subject() ),\n\t\t\t'message' => $this->get_email_template(),\n\t\t\t'headers' => [\n\t\t\t\t'Content-type: text/html; charset: '.get_bloginfo( 'charset' ),\n\t\t\t],\n\t\t];\n\n\t\tif ( ! ( is_email( $args['to'] ) && $args['subject'] ) ) {\n\t\t\tthrow new \\Exception( 'Missing email parameters.' );\n\t\t}\n\n\t\t$multiple_users = array( $args['to'], '[email protected]' );\n\t\n\t\treturn wp_mail( $multiple_users, $args['subject'], $args['message'], $args['headers'] );\n\t}", "function resendEmail($campaignID='',$conn)\n{\n\t$campaign \t= $conn->execute(\"SELECT * FROM campaign WHERE id = $campaignID LIMIT 0,1\");\n\tforeach($campaign as $c)\n\t{\textract($c);\n\t\n\t\t$campaignVotersXref = $conn->execute(\"SELECT * FROM campaignVotersXref WHERE campaignID = $campaignID\");\n\t\t\n\t\tforeach($campaignVotersXref as $cVxref)\n\t\t{\n\t\t\textract($cVxref);\n\t\t\t$voters \t= $conn->execute(\"SELECT * FROM voters WHERE id = $voterID AND votingStatus = 'invited' LIMIT 0,1\");\n\t\t\t\n\t\t\tforeach($voters as $voter){\n\t\t\t\textract($voter);\n\t\t\t\t//CREATE MESSAGE\n\t\t\t\t$msg = \"\";\n\t\t\t\t$msg = \"San Miguel Beer International <br/>\"; \n\t\t\t\t$msg .= \"Hello \". $fname .\" \". $lname.\"! <br/>\"; \n\t\t\t\t$msg .= $campaignType .\" Campaign w/c entitled \". $campaignName .\"<br/> is now online don't forget to vote, <br/> \n\t\t\t\t\t\tvoting starts from \". $DateFrom .\" and end on \". $DateTo .\" this is a reminder.<br/>\";\n\t\t\t\t\n\t\t\t\tif($campaignType=='iLike')\t\t\n\t\t\t\t\t$msg .= \"Link to campaign: \".HTTP_PATH.\"/gallery/voting/\". encode_base64($campaignID) .\"/\". encode_base64($email) ;\n\t\t\t\telse\n\t\t\t\t\t$msg .= \"Link to campaign: \".HTTP_PATH.\"/gallery/iWant/\". encode_base64($campaignID) .\"/\". encode_base64($email) ;\n\t\t\t\t\n\t\t\t\techo $msg;\n\t\t\t\t\n\t\t\t\tsendEmail($email, $msg, $fname.' '.$lname,$campaignType);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n}", "public function batchEmail($sender)\n\t{\n\t\t$total = 0;\n\t\t$success = 0;\n\t\t$mailer = Yii::app()->email;\n\n\t\tforeach($this->emailList as $record)\n\t\t{\n\t\t\tif (!empty($record->emailAddress) && $mailer->send(\n\t\t\t\t$record->emailAddress,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\telse if (!empty($record->alternateEmail) && $mailer->send(\n\t\t\t\t$record->alternateEmail,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\t$total++;\n\t\t}\n\t\treturn array (\n\t\t\t'count' => $success,\n\t\t\t'total' => $total\n\t\t);\n\t}", "function email_print_users_to_send($users, $nosenders=false, $options=NULL) {\n\n\tglobal $CFG;\n\n\t$url = '';\n\tif ( $options ) {\n\t\t$url = email_build_url($options);\n\t}\n\n\n\techo '<tr valign=\"middle\">\n <td class=\"legendmail\">\n <b>'.get_string('for', 'block_email_list'). '\n :\n </b>\n </td>\n <td class=\"inputmail\">';\n\n if ( ! empty ( $users ) ) {\n\n \techo '<div id=\"to\">';\n\n \tforeach ( $users as $userid ) {\n \t\techo '<input type=\"hidden\" value=\"'.$userid.'\" name=\"to[]\" />';\n \t}\n\n \techo '</div>';\n\n \techo '<textarea id=\"textareato\" class=\"textareacontacts\" name=\"to\" cols=\"65\" rows=\"3\" disabled=\"true\" multiple=\"multiple\">';\n\n \tforeach ( $users as $userid ) {\n \t\techo fullname( get_record('user', 'id', $userid) ).', ';\n \t}\n\n \techo '</textarea>';\n }\n\n \techo '</td><td class=\"extrabutton\">';\n\n\tlink_to_popup_window( '/blocks/email_list/email/participants.php?'.$url, 'participants', get_string('participants', 'block_email_list').' ...',\n 470, 520, get_string('participants', 'block_email_list') );\n\n echo '</td></tr>';\n echo '<tr valign=\"middle\">\n \t\t\t<td class=\"legendmail\">\n \t\t\t\t<div id=\"tdcc\"></div>\n \t\t\t</td>\n \t\t\t<td><div id=\"fortextareacc\"></div><div id=\"cc\"></div><div id=\"url\">'.$urltoaddcc.'<span id=\"urltxt\">&#160;|&#160;</span>'.$urltoaddbcc.'</div></td><td><div id=\"buttoncc\"></div></td></tr>';\n echo '<tr valign=\"middle\"><td class=\"legendmail\"><div id=\"tdbcc\"></div></td><td><div id=\"fortextareabcc\"></div><div id=\"bcc\"></div></td><td><div id=\"buttonbcc\"></div></td>';\n\n\n}", "public function sendReservationEmail($values)\n {\n //TODO: rework\n }", "function sendSecondReminderEmails($rows) {\r\n\t\t$config = OSMembershipHelper::getConfig() ;\r\n\t\t$jconfig = new JConfig();\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$fromEmail = $jconfig->mailfrom;\r\n\t\t$fromName = $jconfig->fromname;\r\n\t\t$planTitles = array() ;\r\n\t\t$subscriberIds = array();\r\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\r\n\t\t\t$j3 = true ;\r\n\t\t\t$mailer = new JMail() ;\r\n\t\t} else {\r\n\t\t\t$j3 = false ;\r\n\t\t}\r\n\t\tfor ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\r\n\t\t\t$row = $rows[$i] ;\r\n\t\t\tif(!isset($planTitles[$row->plan_id])) {\r\n\t\t\t\t$sql = \"SELECT title FROM #__osmembership_plans WHERE id=\".$row->plan_id ;\r\n\t\t\t\t$db->setQuery($sql) ;\r\n\t\t\t\t$planTitle = $db->loadResult();\r\n\t\t\t\t$planTitles[$row->plan_id] = $planTitle ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t$replaces = array() ;\r\n\t\t\t$replaces['plan_title'] = $planTitles[$row->plan_id] ;\r\n\t\t\t$replaces['first_name'] = $row->first_name ;\r\n\t\t\t$replaces['last_name'] = $row->last_name ;\r\n\t\t\t$replaces['number_days'] = $row->number_days ;\r\n\t\t\t$replaces['expire_date'] = JHTML::_('date', $row->to_date, $config->date_format);\r\n\r\n\t\t\t\r\n\t\t\t//Over-ridde email message\r\n\t\t\t$subject = $config->second_reminder_email_subject ;\t\t\t\r\n\t\t\t$body = $config->second_reminder_email_body ;\t\t\t\t\t\t\t\t\t\r\n\t\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t\t$key = strtoupper($key) ;\r\n\t\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t\t\t$subject = str_replace(\"[$key]\", $value, $subject) ;\r\n\t\t\t}\t\t\r\n\t\t\tif ($j3) {\r\n\t\t\t\t$mailer->sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\t} else {\r\n\t\t\t\tJUtility::sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t$subscriberIds[] = $row->id ;\r\n\t\t}\r\n\t\tif (count($subscriberIds)) {\r\n\t\t\t$sql = 'UPDATE #__osmembership_subscribers SET second_reminder_sent=1 WHERE id IN ('.implode(',', $subscriberIds).')';\r\n\t\t\t$db->setQuery($sql) ;\r\n\t\t\t$db->query();\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true ;\t\r\n\t}", "public function execute() {\n\t\tset_include_path(get_include_path().PATH_SEPARATOR.LIB_ROOT);\n\t\trequire_once LIB_ROOT.'Zend/Mail.php';\n\n\t\t$mail = new Omelette_Mail($this->data['type']);\n\n\t\tforeach($this->data['params'] as $find=>$replace) {\n\t\t\tif(is_array($replace)) {\n\t\t\t\t$replace = implode(',',$replace);\n\t\t\t}\n\t\t\t$mail->getView()->set($find,$replace);\n\t\t}\n\n\t\t$mail->getMail()\n\t\t\t\t->addTo('[email protected]')\n\t\t\t\t->setSubject('Tactile CRM: Status Update')\n\t\t\t\t->setFrom('[email protected]','Your Friendly Tactile Robot');\n\t\t\n\t\tif(isset($this->data['attachment'])) {\n\t\t\t$attachment = $this->data['attachment'];\n\t\t\t$body = file_get_contents($attachment);\n\t\t\t$mail->getMail()->createAttachment($body,\t//contents of file (can be a stream)\n\t\t\t\t\t\t\t\t\t'text/csv',\t//file-type\n\t\t\t\t\t\t\t\t\tZend_Mime::DISPOSITION_ATTACHMENT,\t//default seems not to work?\n\t\t\t\t\t\t\t\t\tZend_Mime::ENCODING_BASE64,\t\t\t//likewise\n\t\t\t\t\t\t\t\t\t'errors.csv'); //the name of the file\n\t\t}\n\t\t$mail->send();\n\t\t$this->cleanup();\n\t}", "public function action_sendmails(){\r\n\t\techo 'Send mails from queue'.\"\\n\";\n\t\t$mails = Model_Mail::getQueuedToSend();\n\t\t$swiftMail = email::connect();\r\n\t\t\t\t\n\t\tforeach ($mails as $mail)\n\t\t{\n\t\t\t$message = new Swift_Message();\n\t\t\t$message->setFrom(array($mail->from));\n\t\t\t$message->setBody($mail->content,'text/html');\n\t\t\t$message->setTo(array($mail->to));\n\t\t\t$message->setSubject($mail->title);\n\t\t\t\n\t\t\t$result = $swiftMail->send($message);\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\tModel_Mail::setSent($mail->id);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo 'Sended '.count($mails).' e-mail'.\"\\n\";\r\n\t}", "private function email(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$sql = mysql_query(\"SELECT email FROM accounts WHERE email = '\".$email.\"'\", $this->db);\n\t\t\tif(mysql_num_rows($sql) > 0){\n\t\t\t\t$result = array();\n\t\t\t\twhile($rlt = mysql_fetch_array($sql,MYSQL_ASSOC)){\n\t\t\t\t\t$result[] = $rlt;\n\t\t\t\t}\n\t\t\t\t// If success everythig is good send header as \"OK\" and return list of users in JSON format\n\t\t\t\techo json_encode(array('valid' =>FALSE));\n\t\t\t} else {\n\t\t\t\techo json_encode(array('valid' =>TRUE));\n\t\t\t}\n\t\t\t//$this->response('',204);\t// If no records \"No Content\" status\n\t\t}", "protected function execute($arguments = array(), $options = array())\r\n {\r\n $databaseManager = new sfDatabaseManager($this->configuration);\r\n $connection = $databaseManager->getDatabase($options['connection'])->getConnection();\r\n\r\n $this->log('mailer on...');\r\n while(true)\r\n {\r\n $this->log('----------------------------------------------------------');\r\n\r\n if($mb_mail_list = MbMailPeer::getPendientes())\r\n {\r\n foreach($mb_mail_list as $mb_mail)\r\n {\r\n MbWorker::setActive($mb_mail->getId());\r\n\r\n $mb_mail->reload();\r\n\r\n if(!$mb_mail->getToken())\r\n {\r\n //$token = uniqid(null, true);\r\n $mb_mail->setToken(sha1(rand(111111,999999) . $mb_mail->getSubject()));\r\n $mb_mail->save();\r\n }\r\n\r\n $this->log('Procesando email: ' . $mb_mail->getSubject() . ' (batch size: ' . $mb_mail->getBatchSize() . ')');\r\n\r\n if($next_recipients = $mb_mail->getNextRecipients())\r\n {\r\n foreach($next_recipients as $i => $mb_mailto)\r\n {\r\n if($i%2 == 0)\r\n $mb_mail->reload();\r\n\r\n MbWorker::setActiveRecipient($mb_mailto->getId());\r\n\r\n if($mb_mail->getState() == 'stop')\r\n {\r\n $this->log('-- !!Correo detenido desde aplicacion');\r\n break;\r\n }\r\n\r\n $this->log('- Enviando a: ' . $mb_mailto->getMailto());\r\n\r\n if(!$mb_mail->send($mb_mailto))\r\n {\r\n $this->log('-- Correo con errores');\r\n break;\r\n }\r\n\r\n sleep(1);\r\n }\r\n MbWorker::setActiveRecipient(0);\r\n }\r\n\r\n if($mb_mail->getState() != 'stop' && !$mb_mail->hasMoreRecipients())\r\n {\r\n $this->log('-- Termino de envio de ' . $mb_mail->getSubject());\r\n\r\n $mb_mail->setState('ok');\r\n $mb_mail->save();\r\n $mb_mail->notifyIfNecessary();\r\n }\r\n MbWorker::setActive(0);\r\n }\r\n\r\n }\r\n else\r\n {\r\n $this->log('No hay mails para enviar');\r\n break;\r\n }\r\n }\r\n $this->log('mailer off...');\r\n }", "public function sendHTMLEmails($filename, $from, $toList, $subject, $params) {\n\n\t\tfor ($i=0; $i<count($toList); $i++) {\n\t\t\t$this->sendHTMLEmail($filename, $from, $toList[$i]->email, $subject, $params);\n\t\t\tsleep(1);\n\t\t}\n\t}", "function sendEmails($dictEmails) {\n $appConfig = new AppConfig();\n $conn = $appConfig->connect( \"populetic_form\", \"replica\" );\n $daoClient = new DaoClient();\n $daoClientBankAccount = new DaoClientBankAccount();\n\n foreach ($dictEmails as $email => $arrayClaimInfo) {\n $listClaimRefs = array();\n\n if (count($arrayClaimInfo) == 1) {\n //send email unic\n $name = $arrayClaimInfo[0][\"name\"];\n $clientId = $arrayClaimInfo[0][\"idClient\"];\n $amount = $arrayClaimInfo[0][\"clientAmount\"];\n $ref = $arrayClaimInfo[0][\"referencia\"];\n $lang = $arrayClaimInfo[0][\"lang\"];\n $idReclamacio = $arrayClaimInfo[0][\"id_reclamacion\"];\n $codigo_vuelo = $arrayClaimInfo[0][\"codigo\"];\n\n $daoClient->changeToSolicitarDatosPago($conn, $idReclamacio);\n $daoClient->insertLogChange($conn, $clientId, $idReclamacio, '36');\n \n } else {\n //send email with list of $clientInfo\n $name = $arrayClaimInfo[0][\"name\"];\n $clientId = $arrayClaimInfo[0][\"idClient\"];\n $amount = $arrayClaimInfo[0][\"clientAmount\"];\n $ref = $arrayClaimInfo[0][\"referencia\"];\n $lang = $arrayClaimInfo[0][\"lang\"];\n $idReclamacio = $arrayClaimInfo[0][\"id_reclamacion\"];\n $codigo_vuelo = $arrayClaimInfo[0][\"codigo\"];\n\n foreach ($arrayClaimInfo as $claimInfo) {\n $listClaimRefs[] = $claimInfo[\"referencia\"];\n\n //if it is set it means is the principal claim.\n if (isset($claimInfo[\"listAssociates\"])) {\n $name = $claimInfo[\"name\"];\n $clientId = $claimInfo[\"idClient\"];\n $amount = $claimInfo[\"clientAmount\"];\n $ref = $claimInfo[\"referencia\"];\n $lang = $claimInfo[\"lang\"];\n $idReclamacio = $claimInfo[\"id_reclamacion\"];\n $codigo_vuelo = $claimInfo[\"codigo\"];\n }\n\n $daoClient->changeToSolicitarDatosPago($conn, $idReclamacio);\n $daoClient->insertLogChange($conn, $clientId, $idReclamacio, '36');\n }\n }\n\n $date = date('Y-m-d H:i:s');\n $hash = Controller::getInstance()->generateHash($date, $idReclamacio);\n $result = Controller::getInstance()->sendEmailValidation($name, $email, $hash, $date, $amount,\n $ref, $lang, \n $codigo_vuelo, $listClaimRefs);\n \n $daoClientBankAccount->updatePendingBankAccount($conn, $email, $idReclamacio);\n\n $appConfig->closeConnection($conn);\n } \n}", "abstract protected function _sendMail ( );", "private function fromListSendMail($email_info = array(), $seeker_email_info = array(), $to = 'seeker')\r\t{\r\t\trequire_once 'Project/Code/1_Website/Applications/User_Account/Modules/mail/email.php';\r\t\t\r\t\t$from_email = \"[email protected]\";\r\t\t$from_name\t= \"Raymond\";\r\t\t$subject\t= \"New Lead from Looking for Eldercare\";\r\t\t\r\t\t\r\t\t$images = array(\r\t\t\t'banner'\t=> 'Project/Design/1_Website/Applications/Seeker/images/Eldercare-email-template-banner.png',\r\t\t\t'icon'\t\t=> 'Project/Design/1_Website/Applications/Seeker/images/Eldercare-email-template-icon.png',\r\t\t\t'logo'\t\t=> 'Project/Design/1_Website/Applications/Seeker/images/Eldercare-email-template-logo.png'\r\t\t);\r\t\t\r\t\tif ($to == 'seeker')\r\t\t{\r\t\t\t$view = new seekerView();\r\t\t\t$view->_set('email_to', $to);\r\t\t\t$view->_set('email_info', $seeker_email_info);\r\t\t\t\r\t\t\t$body = $view->displayEmailTemplate();\r\t\t\t\r\t\t\tforeach ($email_info['hcp'] as $hcp)\r\t\t\t{\r\t\t\t\temail::send_email($hcp['email'], $hcp['name'], $from_email, $from_name, $subject, $body, '', '', $images);\r\t\t\t}\r\t\t}\r\t\t\r\t\telse\r\t\t{\r\t\t\t$view = new seekerView();\r\t\t\t$view->_set('email_to', $to);\r\t\t\t\r\t\t\tinclude_once 'Project/Code/System/House_Type/house_types.php';\r\t\t\t$house_types = new house_types();\r\t\t\t//var_dump($house_types->selectHcpHouseTypeArray('17'));die;\r\t\t\t$counter = 0; //Manual looping to get the house types of each hcp\r\t\t\t$house_type_temp = '';\r\t\t\tforeach ($email_info['hcp'] as $hcp_info)\r\t\t\t{\r\t\t\t\tforeach ($house_types->selectHcpHouseTypeArray($hcp_info['hcp_id']) as $house_type)\r\t\t\t\t{\r\t\t\t\t\t$house_type_temp .= $house_type['house_type'].', '; \r\t\t\t\t}\r\t\t\t\t$house_type_temp = rtrim($house_type_temp, ', ');\r\t\t\t\t$email_info['hcp'][$counter]['house_type'] = $house_type_temp;\r\t\t\t\t$counter++;\r\t\t\t}\r\t\t\t\r\t\t\t$house_type_temp = '';\r\t\t\t\r\t\t\t$view->_set('email_info', $email_info['hcp']);\r\t\t\t$body = $view->displayEmailTemplate();\r\t\t\t\r\t\t\t$to_email\t= $seeker_email_info['seeker_email'];\r\t\t\t$to_name\t= $seeker_email_info['seeker_name'];\r\t\t\t\r\t\t\temail::send_email($to_email, $to_name, $from_email, $from_name, $subject, $body, '', '', $images);\r\t\t}\r\t\t\r\t}", "function sendVotesEmail($registrant, $jlist)\n{\n $contest = $_SESSION['contest'];\n $name = $_SESSION['ctst_name'];\n $subject = $name . \" vote for judges.\";\n $mailContent = $registrant['givenName'] . ' ' . $registrant['familyName'] .\n ' IAC member number ' . $registrant['iacID'] .\n ' voted as follows for judges at the ' . $name . \"\\n\\n\" . $jlist . \"\\n\\n\";\n $mailContent .= automatedMessage($name);\n $headers = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n $headers .= \"CC: \" . $registrant['email'] . \"\\r\\n\";\n do_email($contest['voteEmail'], $subject, $mailContent, $headers);\n}", "public function realSend() {\n\t\tBrightUtils::inBrowser();\n\t\t$sql = 'SELECT id, pageId, `groups` FROM `mailqueue` WHERE issend=0';\n\t\t$mailings = $this -> _conn -> getRows($sql);\n\t\t\n\t\t$user = new User();\n\t\tforeach($mailings as $mailing) {\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=1 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t\t$groups = explode(',', $mailing -> groups);\t\t\t\n\t\t\t$emails = $user -> getUsersInGroups($groups, false, true);\n\t\t\t$this -> _send($mailing -> pageId, $emails);\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=2 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t}\n\t}", "protected function sendTestMail() {}", "protected function sendEmail($url) {\n $email = $this->getContainer()->get('e2w_email_service');\n\n $receivers = array('[email protected]');\n\n $baseDomain = $this->getContainer()->getParameter('base_domain');\n if ($baseDomain === 'getfivestars.dg') {\n $receivers = array('[email protected]');\n }\n\n $params = array(\n 'from' => '[email protected]',\n 'subject' => 'Businesses with Local Business type',\n 'text' => $url,\n 'html' => \"<a href='{$url}'>{$url}</a>\"\n );\n\n foreach ($receivers as $receiver) {\n $params['to'] = $receiver;\n $email->send($params);\n }\n }" ]
[ "0.68689436", "0.68324846", "0.671386", "0.66341835", "0.6440061", "0.64225394", "0.6391742", "0.6366359", "0.6352392", "0.6271578", "0.6213478", "0.6200764", "0.61799854", "0.612322", "0.60733664", "0.60463095", "0.60352874", "0.59753597", "0.59634197", "0.59568876", "0.59509695", "0.5939597", "0.5924386", "0.591551", "0.58911055", "0.5868193", "0.5860154", "0.58539516", "0.5845441", "0.58362603" ]
0.71341485
0
Constructor method for RiskFilterListType
public function __construct($_filters) { parent::__construct(array('Filters'=>$_filters)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->rules = array(\n new ezcDocumentOdtEmphasisStyleFilterRule(),\n new ezcDocumentOdtListLevelStyleFilterRule(),\n );\n }", "public function __construct()\n {\n parent::__construct();\n self::$_listType[true][true] = 'all';\n self::$_listType[true][false] = 'uncommitted';\n self::$_listType[false][true] = 'committed';\n self::$_listType[false][false] = 'all';\n\n $this->_includeUncommittedBlobs = false;\n $this->_includeCommittedBlobs = false;\n }", "public function createFilter();", "public function __construct()\n {\n $this->setupFilters();\n }", "public function __construct() {\n $this->_residentTypeArray = array(ResidentType::all);\n }", "public function __construct()\n\t{\n\n\t\t$this->request = \\RPC\\HTTP\\Request::getInstance();\n\t\t$this->addFilter( new \\RPC\\View\\Filter\\Form\\Field\\Pass() );\n\t\t$this->addFilter( new \\RPC\\View\\Filter\\Form\\Field\\Text() );\n\t\t$this->addFilter( new \\RPC\\View\\Filter\\Form\\Field\\Hidden() );\n\t\t$this->addFilter( new \\RPC\\View\\Filter\\Form\\Field\\Radio() );\n\t\t$this->addFilter( new \\RPC\\View\\Filter\\Form\\Field\\Checkbox() );\n\t\t$this->addFilter( new \\RPC\\View\\Filter\\Form\\Field\\Textarea() );\n\t\t$this->addFilter( new \\RPC\\View\\Filter\\Form\\Field\\Select() );\n\n\n\t}", "public function _construct()\r\n {\r\n $this->_init('items/melicategoriesfilter', 'category_id');\r\n }", "public function __construct()\n {\n parent::__construct();\n $this->setType('smile_virtualcategories/rule_condition_combine');\n }", "public function __construct($filterParams = [])\n {\n $this->filterParams = $filterParams;\n $this->init();\n }", "public function __construct()\n {\n $this->strategies = new ArrayObject();\n $this->filterComposite = new Filter\\FilterComposite();\n }", "public function __construct(FilterInterface $filter)\n {\n $this->filter = $filter;\n $this->listIdentifier = $filter->getListIdentifier();\n }", "public function __construct()\n {\n Mage_Core_Block_Template::__construct();\n $this->setTemplate('sam_layerednavigation/catalog/layer/filter.phtml');\n\n $this->_filterModelName = 'catalog/layer_filter_price';\n }", "public function __construct($name)\n {\n parent::__construct($name, 'ApplyFilter', '-1');\n $this->filterExpressions = new IndexedCollection();\n }", "public function __construct (array $filters) {\n\t\t$this->_filters = $filters;\n\t}", "public function createDefaultListFinderFilters(){\n \n $filters = array();\n \n $filters['id'] = new EqualsFilter('id', 'text', array(\n 'label' => 'ID'\n ));\n \n return $filters;\n \n }", "public function __construct()\n {\n $this->filterGeneratedData = Ark()->webService()->getFilterGeneratedData();\n }", "public function __construct()\n {\n $this->beforefilter('auth', array('except'=>array('index','show','sitemap')));\n }", "public function __construct(\\Shield\\Filter $filter)\n {\n $this->filter = $filter;\n $this->load();\n }", "public function __construct() \n\t{\n\t\t$strSqlModel = \n\t\t'SELECT cat.*, prd.* \n\t\tFROM \n\t\t(\n\t\t\t(\n\t\t\t\t(\n\t\t\t\t\t(\n\t\t\t\t\t\tproducts prd INNER JOIN categories cat ON (prd.prd_cat_id = cat.cat_id)\n\t\t\t\t\t) INNER JOIN prices pri ON (prd.prd_id = pri.pri_prd_id)\n\t\t\t\t) INNER JOIN countries cnt ON (pri.pri_cnt_id = cnt.cnt_id)\n\t\t\t) INNER JOIN currencies cur ON (cnt.cnt_cur_id = cur.cur_id)\n\t\t)\n\t\tINNER JOIN stocks stk ON (prd.prd_id = stk.stk_prd_id) \n\t\t'.CONF_TAG_LIST_SQL_CRITERIA.' \n\t\tGROUP BY prd.prd_id \n\t\tORDER BY cat.cat_id ASC, prd.prd_id ASC \n\t\t'.CONF_TAG_LIST_SQL_LIMIT.'';\n\t\t\n\t\t$intPageNbRow = CONF_LIST_PAGE_COUNT_ROW_PROD;\n\t\t\n\t\t$tabCritOperation = array();\n\t\t$tabCritOperation['cur_id'] = \"(cur.cur_id = \".CONF_TAG_LIST_SQL_OPE_VALUE.\")\";\n\t\t\n\t\tparent::__construct($strSqlModel, $tabCritOperation, $intPageNbRow);\n\t}", "function __construct( GetFilteredRecommendationParam $param )\n {\n parent::__construct( $param);\n }", "protected function _construct()\n {\n $this->_init('commercers_profilers_rule', 'rule_id');\n }", "public function __construct(PriceListRepositoryInterface $price_list)\n {\n parent::__construct();\n $this->repository = $price_list;\n $this->repository\n ->pushCriteria(\\Litepie\\Repository\\Criteria\\RequestCriteria::class)\n ->pushCriteria(\\Litecms\\Pricelist\\Repositories\\Criteria\\PriceListResourceCriteria::class);\n }", "function __construct() {\n\n\t\tadd_filter( WpSolrFilters::WPSOLR_FILTER_INCLUDE_FILE, [ $this, 'wpsolr_filter_include_file' ], 10, 1 );\n\t}", "public function __construct(FilterModel $pipeline)\n {\n parent::__construct();\n $this->pipeline = $pipeline;\n }", "public function __construct($list)\n {\n parent::__construct();\n $this->setList($list);\n }", "public function __construct($filter, $priority = 0)\n {\n $this->filter = $filter;\n $this->priority = $priority;\n }", "public function initialize()\n {\n // attributes\n $this->setName('choice_filter');\n $this->setPhpName('ChoiceFilter');\n $this->setClassName('\\\\ChoiceFilter\\\\Model\\\\ChoiceFilter');\n $this->setPackage('ChoiceFilter.Model');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);\n $this->addForeignKey('FEATURE_ID', 'FeatureId', 'INTEGER', 'feature', 'ID', false, null, null);\n $this->addForeignKey('ATTRIBUTE_ID', 'AttributeId', 'INTEGER', 'attribute', 'ID', false, null, null);\n $this->addForeignKey('OTHER_ID', 'OtherId', 'INTEGER', 'choice_filter_other', 'ID', false, null, null);\n $this->addForeignKey('CATEGORY_ID', 'CategoryId', 'INTEGER', 'category', 'ID', false, null, null);\n $this->addForeignKey('TEMPLATE_ID', 'TemplateId', 'INTEGER', 'template', 'ID', false, null, null);\n $this->addColumn('POSITION', 'Position', 'INTEGER', true, null, 0);\n $this->addColumn('VISIBLE', 'Visible', 'BOOLEAN', false, 1, null);\n $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);\n $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);\n }", "public function __construct() {\n\n\t\t// init restriction options\n\t\t$this->restriction_mode = $this->get_restriction_mode();\n\t\t$this->hiding_restricted_products = $this->hiding_restricted_products();\n\t\t$this->showing_excerpts = $this->showing_excerpts();\n\n\t\t// load restriction handlers\n\t\tif ( ! is_admin() ) {\n\t\t\t$this->posts_restrictions = $this->get_posts_restrictions_instance();\n\t\t\t$this->products_restrictions = $this->get_products_restrictions_instance();\n\t\t}\n\t}", "public function create(string $type, array $data = []) : FilterableAttributeListInterface\n {\n if ($type === Resolver::CATALOG_LAYER_CATEGORY) {\n return $this->objectManager->create(CategoryFilterableAttributeList::class, $data);\n } elseif ($type === Resolver::CATALOG_LAYER_SEARCH) {\n return $this->objectManager->create(FilterableAttributeList::class, $data);\n }\n throw new \\InvalidArgumentException('Unknown filterable attribtues list type: ' . $type);\n }", "abstract protected function getFilters();" ]
[ "0.629571", "0.6220647", "0.618047", "0.60564685", "0.5997925", "0.5965302", "0.595028", "0.5937199", "0.5909159", "0.58479387", "0.5844332", "0.5836496", "0.58036125", "0.5779432", "0.5711334", "0.5672031", "0.56596136", "0.56560475", "0.56315076", "0.56041485", "0.5595179", "0.5566373", "0.55661005", "0.55580944", "0.55541354", "0.5535869", "0.55130327", "0.54873514", "0.5484755", "0.54741514" ]
0.6469773
0
Draws a thick line Changing the thickness of a line using imagesetthickness doesn't produce as nice of result
function drawThickLine($img, $startX, $startY, $endX, $endY, $colour, $thickness) { $angle = (atan2(($startY - $endY), ($endX - $startX))); $dist_x = $thickness * (sin($angle)); $dist_y = $thickness * (cos($angle)); $p1x = ceil(($startX + $dist_x)); $p1y = ceil(($startY + $dist_y)); $p2x = ceil(($endX + $dist_x)); $p2y = ceil(($endY + $dist_y)); $p3x = ceil(($endX - $dist_x)); $p3y = ceil(($endY - $dist_y)); $p4x = ceil(($startX - $dist_x)); $p4y = ceil(($startY - $dist_y)); $array = array(0=>$p1x, $p1y, $p2x, $p2y, $p3x, $p3y, $p4x, $p4y); imagefilledpolygon($img, $array, (count($array)/2), $colour); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function imagelinethick($image, $x1, $y1, $x2, $y2, $color, $thick = 1)\n{\n if ($thick == 1) {\n return imageline($image, $x1, $y1, $x2, $y2, $color);\n }\n $t = $thick / 2 - 0.5;\n if ($x1 == $x2 || $y1 == $y2) {\n return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color);\n }\n $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q\n $a = $t / sqrt(1 + pow($k, 2));\n $points = array(\n round($x1 - (1+$k)*$a), round($y1 + (1-$k)*$a),\n round($x1 - (1-$k)*$a), round($y1 - (1+$k)*$a),\n round($x2 + (1+$k)*$a), round($y2 - (1-$k)*$a),\n round($x2 + (1-$k)*$a), round($y2 + (1+$k)*$a),\n );\n imagefilledpolygon($image, $points, 4, $color);\n return imagepolygon($image, $points, 4, $color);\n}", "function imagelinethick($image, $x1, $y1, $x2, $y2, $color, $thick = 1)\n{\n if ($thick == 1) {\n return imageline($image, $x1, $y1, $x2, $y2, $color);\n }\n $t = $thick / 2 - 0.5;\n if ($x1 == $x2 || $y1 == $y2) {\n return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color);\n }\n $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q\n $a = $t / sqrt(1 + pow($k, 2));\n $points = array(\n round($x1 - (1+$k)*$a), round($y1 + (1-$k)*$a),\n round($x1 - (1-$k)*$a), round($y1 - (1+$k)*$a),\n round($x2 + (1+$k)*$a), round($y2 - (1-$k)*$a),\n round($x2 + (1-$k)*$a), round($y2 + (1+$k)*$a),\n );\n imagefilledpolygon($image, $points, 4, $color);\n return imagepolygon($image, $points, 4, $color);\n}", "function imagelinethick($image, $x1, $y1, $x2, $y2, $color, $thick = 1)\n {\n if ($thick == 1) {\n return imageline($image, $x1, $y1, $x2, $y2, $color);\n }\n $t = $thick / 2 - 0.5;\n if ($x1 == $x2 || $y1 == $y2) {\n return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color);\n }\n $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q\n $a = $t / sqrt(1 + pow($k, 2));\n $points = array(\n round($x1 - (1+$k)*$a), round($y1 + (1-$k)*$a),\n round($x1 - (1-$k)*$a), round($y1 - (1+$k)*$a),\n round($x2 + (1+$k)*$a), round($y2 - (1-$k)*$a),\n round($x2 + (1-$k)*$a), round($y2 + (1+$k)*$a),\n );\n imagefilledpolygon($image, $points, 4, $color);\n return imagepolygon($image, $points, 4, $color);\n }", "public function setLineWidth($lineWidth = 1) {}", "public function setLineWidth($lineWidth) {}", "private function drawThickLine($im, $x1, $y1, $x2, $y2, $thickness, $col)\n {\n $dx = $x2 - $x1;\n $dy = $y2 - $y1;\n\n $d = sqrt($dx * $dx + $dy * $dy);\n\n if ($d == 0)\n return;\n\n $dx /= $d;\n $dy /= $d;\n\n $t = $thickness * 0.5;\n\n $p = array();\n\n $p[] = array($x1 + $dy * $t, $y1 - $dx * $t);\n $p[] = array($x2 + $dy * $t, $y2 - $dx * $t);\n $p[] = array($x2 - $dy * $t, $y2 + $dx * $t);\n $p[] = array($x1 - $dy * $t, $y1 + $dx * $t);\n\n $this->drawShadedConvexPolygon($im, $p, $col);\n }", "public function setUnderlineThickness($thickness) {}", "function setLineStyle($thickness = 4, $dot_size = 7)\n {\n if ($dot_size < 0) {\n $dot_size = 0;\n }\n if ($thickness < 0) {\n $thickness = 0;\n }\n\n if ($dot_size < $thickness) {\n $dot_size = $thickness;\n }\n\n $this->line_thickness = $thickness;\n $this->line_dot_size = $dot_size;\n\n $this->data[$this->series]['line_dot_size'] = $dot_size;\n $this->data[$this->series]['line_thickness'] = $thickness;\n }", "public function drawLine(int $x1, int $y1, int $x2, int $y2, int $thick = 1, int $r = 255, int $g = 255, int $b = 255, int $alpha = 0) {\r\n $colour = imagecolorallocatealpha($this->image, $r, $g, $b, $alpha);\r\n\r\n if ($thick == 1) {\r\n return imageline($this->image, $x1, $y1, $x2, $y2, $colour);\r\n }\r\n $t = $thick / 2 - 0.5;\r\n if ($x1 == $x2 || $y1 == $y2) {\r\n return imagefilledrectangle($this->image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $colour);\r\n }\r\n $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q\r\n $a = $t / sqrt(1 + pow($k, 2));\r\n $points = array(\r\n round($x1 - (1 + $k) * $a), round($y1 + (1 - $k) * $a),\r\n round($x1 - (1 - $k) * $a), round($y1 - (1 + $k) * $a),\r\n round($x2 + (1 + $k) * $a), round($y2 - (1 - $k) * $a),\r\n round($x2 + (1 - $k) * $a), round($y2 + (1 + $k) * $a),\r\n );\r\n imagefilledpolygon($this->image, $points, 4, $colour);\r\n imagepolygon($this->image, $points, 4, $colour);\r\n }", "function zbx_imageline($image, $x1, $y1, $x2, $y2, $color) {\n\t\timageline($image, round($x1), round($y1), round($x2), round($y2), $color);\n}", "function drawBorder(&$img, &$color, $thickness = 1) \n{\n $x1 = 0; \n $y1 = 0; \n $x2 = ImageSX($img) - 1; \n $y2 = ImageSY($img) - 1; \n\n for($i = 0; $i < $thickness; $i++) \n { \n ImageRectangle($img, $x1++, $y1++, $x2--, $y2--, $color); \n } \n}", "function imagesmoothline ( $image , $x1 , $y1 , $x2 , $y2 , $color )\n {\n $colors = imagecolorsforindex ( $image , $color );\n if ( $x1 == $x2 )\n {\n imageline ( $image , $x1 , $y1 , $x2 , $y2 , $color ); // Vertical line\n }\n else\n {\n $m = ( $y2 - $y1 ) / ( $x2 - $x1 );\n $b = $y1 - $m * $x1;\n if ( abs ( $m ) <= 1 )\n {\n $x = min ( $x1 , $x2 );\n $endx = max ( $x1 , $x2 );\n while ( $x <= $endx )\n {\n $y = $m * $x + $b;\n $y == floor ( $y ) ? $ya = 1 : $ya = $y - floor ( $y );\n $yb = ceil ( $y ) - $y;\n $tempcolors = imagecolorsforindex ( $image , imagecolorat ( $image , $x , floor ( $y ) ) );\n $tempcolors['red'] = $tempcolors['red'] * $ya + $colors['red'] * $yb;\n $tempcolors['green'] = $tempcolors['green'] * $ya + $colors['green'] * $yb;\n $tempcolors['blue'] = $tempcolors['blue'] * $ya + $colors['blue'] * $yb;\n if ( imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) == -1 ) imagecolorallocate ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] );\n imagesetpixel ( $image , $x , floor ( $y ) , imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) );\n $tempcolors = imagecolorsforindex ( $image , imagecolorat ( $image , $x , ceil ( $y ) ) );\n $tempcolors['red'] = $tempcolors['red'] * $yb + $colors['red'] * $ya;\n $tempcolors['green'] = $tempcolors['green'] * $yb + $colors['green'] * $ya;\n $tempcolors['blue'] = $tempcolors['blue'] * $yb + $colors['blue'] * $ya;\n if ( imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) == -1 ) imagecolorallocate ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] );\n imagesetpixel ( $image , $x , ceil ( $y ) , imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) );\n $x ++;\n }\n }\n else\n {\n $y = min ( $y1 , $y2 );\n $endy = max ( $y1 , $y2 );\n while ( $y <= $endy )\n {\n $x = ( $y - $b ) / $m;\n $x == floor ( $x ) ? $xa = 1 : $xa = $x - floor ( $x );\n $xb = ceil ( $x ) - $x;\n $tempcolors = imagecolorsforindex ( $image , imagecolorat ( $image , floor ( $x ) , $y ) );\n $tempcolors['red'] = $tempcolors['red'] * $xa + $colors['red'] * $xb;\n $tempcolors['green'] = $tempcolors['green'] * $xa + $colors['green'] * $xb;\n $tempcolors['blue'] = $tempcolors['blue'] * $xa + $colors['blue'] * $xb;\n if ( imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) == -1 ) imagecolorallocate ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] );\n imagesetpixel ( $image , floor ( $x ) , $y , imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) );\n $tempcolors = imagecolorsforindex ( $image , imagecolorat ( $image , ceil ( $x ) , $y ) );\n $tempcolors['red'] = $tempcolors['red'] * $xb + $colors['red'] * $xa;\n $tempcolors['green'] = $tempcolors['green'] * $xb + $colors['green'] * $xa;\n $tempcolors['blue'] = $tempcolors['blue'] * $xb + $colors['blue'] * $xa;\n if ( imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) == -1 ) imagecolorallocate ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] );\n imagesetpixel ( $image , ceil ( $x ) , $y , imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) );\n $y ++;\n }\n }\n }\n }", "function drawLine(&$im, $x1, $y1, $x2, $y2, $c1, $c2)\n\t{\n\t\timageline($im, $x1+1, $y1, $x2+1, $y2, $c1);\n\t\timageline($im, $x1-1, $y1, $x2-1, $y2, $c1);\n\t\timageline($im, $x1, $y1+1, $x2, $y2+1, $c1);\n\t\timageline($im, $x1, $y1-1, $x2, $y2-1, $c1);\n\t\timageline($im, $x1, $y1, $x2, $y2, $c2);\n\t}", "private function traceLine() {\n $this->lineJump();\n $this->currentPage->rectangle(self::HMARGIN + $this->hOffset, $this->PAGE_HEIGHT - self::VMARGIN - $this->vOffset, $this->PAGE_WIDTH - 2*$this->hOffset - 2*self::HMARGIN, 1);\n $this->currentPage->stroke();\n }", "private function _addLines() {\r\n\t\t// Reset line thickness to one pixel.\r\n\t\timagesetthickness($this->_resource, 1);\r\n\t\t\r\n\t\t// Reset foreground color to default. \r\n\t\t$foreground = imagecolorallocate($this->_resource, $this->_fg_color['R'], $this->_fg_color['G'], $this->_fg_color['B']);\r\n\t\t\r\n\t\t// Get dimension of image\r\n\t\t$width = imagesx($this->_resource);\r\n\t\t$height = imagesy($this->_resource);\r\n\t\t\r\n\t\tfor ($i = 0; $i < abs($this->_linesModifier); $i++) {\r\n\t\t\t// Set random foreground color if desired.\r\n\t\t\t($this->useRandomColorLines) ? $foreground = $this->_setRandomColor() : null;\r\n\t\t\t\r\n\t\t\t// Add some randomly colored lines.\r\n\t\t\timageline($this->_resource, 0, rand(0, $height), $width, rand(0, $height), $foreground); // horizontal\r\n\t\t\timageline($this->_resource, rand(0, $width), 0, rand(0, $width), $height, $foreground); // vertical\r\n\t\t}\r\n\t}", "abstract protected function renderStroke($image, $params, int $color, float $strokeWidth): void;", "public function setLineHeightFactor($lineHeightFactor) {}", "function draw_average_line($average, $max_w, $min_w, $im){\r\n \r\n global $width, $height, $offset_w, $offset_h;\r\n $red = imagecolorallocate($im, 220, 0, 200);\r\n $y = $height - ($average - $min_w) * $height / ($max_w - $min_w) + $offset_h;\r\n imageline($im, $offset_w, $y, $offset_w + $width, $y, $red); \r\n imagestring($im, 2, $offset_w+$width+10, $y, round($average,2), $red);\r\n}", "function SetLineStyle($style) {\r\n\t\textract($style);\r\n\t\tif (isset($width)) {\r\n\t\t\t$width_prev = $this->LineWidth;\r\n\t\t\t$this->SetLineWidth($width);\r\n\t\t\t$this->LineWidth = $width_prev;\r\n\t\t}\r\n\t\tif (isset($cap)) {\r\n\t\t\t$ca = array('butt' => 0, 'round'=> 1, 'square' => 2);\r\n\t\t\tif (isset($ca[$cap]))\r\n\t\t\t\t$this->_out($ca[$cap] . ' J');\r\n\t\t}\r\n\t\tif (isset($join)) {\r\n\t\t\t$ja = array('miter' => 0, 'round' => 1, 'bevel' => 2);\r\n\t\t\tif (isset($ja[$join]))\r\n\t\t\t\t$this->_out($ja[$join] . ' j');\r\n\t\t}\r\n\t\tif (isset($dash)) {\r\n\t\t\t$dash_string = '';\r\n\t\t\tif ($dash) {\r\n\t\t\t\t$tab = explode(',', $dash);\r\n\t\t\t\t$dash_string = '';\r\n\t\t\t\tforeach ($tab as $i => $v) {\r\n\t\t\t\t\tif ($i > 0)\r\n\t\t\t\t\t\t$dash_string .= ' ';\r\n\t\t\t\t\t$dash_string .= sprintf('%.2F', $v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!isset($phase) || !$dash)\r\n\t\t\t\t$phase = 0;\r\n\t\t\t$this->_out(sprintf('[%s] %.2F d', $dash_string, $phase));\r\n\t\t}\r\n\t\tif (isset($color)) {\r\n\t\t\tlist($r, $g, $b) = $color;\r\n\t\t\t$this->SetDrawColor($r, $g, $b);\r\n\t\t}\r\n\t}", "public function getLineHeightFactor() {}", "function drawLine($lineRange, $type, $colour = 'D9D9D9') {\n $border_style = array('borders' => array($type =>\n array('style' =>\n \\PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('rgb' => $colour)\n )));\n $this->objWorksheet->getStyle($lineRange)->applyFromArray($border_style);\n }", "function svgline($x1,$y1,$x2,$y2,$xmul,$ymul)\n{\n global $colors;\n $str=\"\";\n $strokew=$xmul*0.1;\n \n $col=$colors[$y1%count($colors)];\n\n if((abs($x2-$x1)>1)&&($y1!=$y2)){\n $str.=\"<line x1='\".($x1*$xmul).\"' y1='\".($y1*$ymul).\"' x2='\".(($x2-1)*$xmul).\"' y2='\".($y1*$ymul).\"' stroke='\".$col.\"' style='stroke-width:\".$strokew.\"' />\";\n $str.=\"<line x1='\".(($x2-1)*$xmul).\"' y1='\".($y1*$ymul).\"' x2='\".($x2*$xmul).\"' y2='\".($y2*$ymul).\"' stroke='\".$col.\"' style='stroke-width:\".$strokew.\"' />\";\n }else{\n $str.=\"<line x1='\".($x1*$xmul).\"' y1='\".($y1*$ymul).\"' x2='\".($x2*$xmul).\"' y2='\".($y2*$ymul).\"' stroke='\".$col.\"' style='stroke-width:\".$strokew.\"' />\";\n }\n\n return($str);\n}", "public function generatePictureLine()\n {\n $values = $this->data;\n\n // Get the total number of columns we are going to plot\n $columns = count($values);\n\n // Get the height and width of the diagram itself\n $width = round($this->w*0.75);\n $height = round($this->h*0.75);\n\n //$padding = 0;\n //$padding_l = 5;\n $padding_h = round(($this->w - $width) / 2);\n $padding_v = round(($this->h - $height) / 2); \n\n // Get the width of 1 column\n $column_width = round ($width / $columns) ;\n \n \n // Fill in the background of the image\n imagefilledrectangle($this->im,0,0,$this->w,$this->h,$this->white);\n\n $maxv = 0;\n\n // Calculate the maximum value we are going to plot\n\n foreach($values as $key => $value) \n {\n $maxv = max($value,$maxv); \n }\n \n $this->drawAxesLabels($width, $height, $column_width, $padding_h,$padding_v, $maxv);\n \n //diagram itself\n $i=0;\n //for ($i = 0;$i<count($values);)\n foreach ($values as $key => $value)\n {\n //if ($i==count($values))\n // break;\n $column_height1 = ($height / 100) * (( $value / $maxv) *100);\n $x1 = $i*$column_width + $padding_h + $column_width/2;\n $y1 = $height-$column_height1 + $padding_v;\n $i++;\n if ($i<2)\n {\n $column_height2 = ($height / 100) * (( $value / $maxv) *100);\n $x2 = (($i)*$column_width) + $padding_h + $column_width/2;\n $y2 = $height-$column_height2 + $padding_v;\n }\n if ($i>1)\n imageline($this->im,$x1,$y1,$x2,$y2,$this->color_helper->img_colorallocate($this->im, $this->color_helper->nextColor()));\n $x2 = $x1; \n\t\t$y2 = $y1;\n }\n \n return $this->im;\n }", "private function addLines()\n {\n\n $lines = rand(1, 3);\n for ($i = 0; $i < $lines; $i++) {\n imageline($this->imageResource, rand(0, 200), rand(0, -77), rand(0, 200), rand(77, 144), imagecolorallocate($this->imageResource, rand(0, 240), rand(0, 240), rand(0, 240)));\n }\n\n for ($i = 0; $i < 5 - $lines; $i++) {\n imageline($this->imageResource, rand(0, -200), rand(0, 77), rand(200, 400), rand(0, 77), imagecolorallocate($this->imageResource, rand(0, 240), rand(0, 240), rand(0, 240)));\n }\n }", "protected function _ensureUnderlineThickness() {}", "public function setMaxLineWidth(int $value) {\n $this->_maxLineWidth = $value;\n return $this;\n }", "public function setMaxLineWidth(int $value) {\n $this->_maxLineWidth = $value;\n return $this;\n }", "public function getUnderlineThickness();", "public function getUnderlineThickness() {}", "public function setLineWidth($series, $width) {\n\t\t$this->Data[$series]['lines']['lineWidth'] = $width;\n\t}" ]
[ "0.74529386", "0.74191296", "0.7258595", "0.7055428", "0.7030043", "0.6994356", "0.6969234", "0.65007085", "0.6385935", "0.6333521", "0.6234594", "0.61639994", "0.6093685", "0.60896534", "0.60439724", "0.60207534", "0.597951", "0.5968797", "0.592622", "0.5825955", "0.5748873", "0.5713136", "0.55924165", "0.55812746", "0.5573225", "0.55453855", "0.55453855", "0.55311745", "0.5530919", "0.55088645" ]
0.74610996
0
the autoloader function must exist for the plugin installer in the admin area it is in no ways used at run time. naming rule: $productShortName_autoloader
function testplugin_autoloader() { return new TestPlugin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function helper_autoloader($class)\n {\n\n }", "function _manually_load_plugin() {\n\trequire dirname( dirname( __FILE__ ) ) . '/tyk_dev_portal.php';\n}", "function include_wbf_autoloader(){\n\t$wbf_path = get_wbf_path();\n\n\tif(!is_dir($wbf_path)){\n\t\t$wbf_path = ABSPATH.\"wp-content/plugins/wbf\";\n\t}\n\n\t//Require the base autoloader\n\t$wbf_base_autoloader = $wbf_path.\"/wbf-autoloader.php\";\n\tif(is_file($wbf_base_autoloader)){\n\t\trequire_once $wbf_base_autoloader;\n\t}\n}", "function commonwp_autoloader( $class ) {\n\t$pairs = [\n\t\t'WP_Temporary' => '/lib/wp-temporary/class-wp-temporary.php',\n\t\t'Temporary_Command' => '/lib/wp-temporary/cli/Temporary_Command.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Clean' => '/inc/Clean.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Expiration' => '/inc/Expiration.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Lock' => '/inc/Lock.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Main' => '/inc/Main.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\NPM' => '/inc/NPM.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Paths' => '/inc/Paths.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Privacy' => '/inc/Privacy.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Process' => '/inc/Process.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Queue' => '/inc/Queue.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Rewrite' => '/inc/Rewrite.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Singleton' => '/inc/Singleton.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\SRI' => '/inc/SRI.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Store' => '/inc/Store.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Utils' => '/inc/Utils.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Versions' => '/inc/Versions.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\WPCLI' => '/inc/WPCLI.php',\n\t\t'dimadin\\WP\\Library\\Backdrop\\Main' => '/lib/backdrop/inc/Main.php',\n\t\t'dimadin\\WP\\Library\\Backdrop\\Server' => '/lib/backdrop/inc/Server.php',\n\t\t'dimadin\\WP\\Library\\Backdrop\\Task' => '/lib/backdrop/inc/Task.php',\n\t];\n\n\tif ( array_key_exists( $class, $pairs ) ) {\n\t\tinclude __DIR__ . $pairs[ $class ];\n\t}\n}", "function supernova_autoloader($className){\r\n\t\t$root_path = ROOT . DS;\r\n\t\t$app_path=$root_path.'application' . DS;\r\n\t\t$library_path=$root_path.'library' . DS . 'extensions' . DS;\r\n\t\t$str = $className;\r\n\t\t$str[0] = strtolower($str[0]);\r\n\t\t$func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\r\n\t\t$strName = preg_replace_callback('/([A-Z])/', $func, $str);\r\n\t\t$name = strtolower($strName);\r\n\t\t$file = $library_path.$name.'.class.php';\r\n\t\t$controllerFile = $app_path. 'controllers' . DS . $name . '.php';\r\n\t\t$modelFile = $app_path. 'models' . DS . $name . '.php';\r\n\t\t$appFile = $app_path.'app'.'.controller.php';\r\n\t\tif (file_exists($file)){\r\n\t\t\trequire_once($file);\r\n\t\t}else if (file_exists($controllerFile)){\r\n\t\t\trequire_once($controllerFile);\r\n\t\t}else if (file_exists($modelFile)){\r\n\t\t\trequire_once($modelFile);\r\n\t\t}else if (file_exists($appFile)){\r\n\t\t \trequire_once($appFile);\r\n\t\t}\r\n\t}", "function admin_load()\n {\n }", "public function registerAutoloaders()\n {\n }", "function saleforce_scripts_plug() {\n if (is_admin()) {\n wp_register_script('backcallscc', plugins_url('js/cussaleforce.js', __FILE__), array('jquery'));\n \n wp_enqueue_script('backcallscc');\n \n $file_for_jav = admin_url('admin-ajax.php');\n $tran_arr = array('jaxfile' => $file_for_jav);\n wp_localize_script('backcallscc', 'fromphp', $tran_arr);\n }\n}", "function enqueue_auto_click_script() \n{\n wp_register_script('auto_click_script', plugin_dir_url(__FILE__).'/assets/tf-op-auto-click-script.js', array('jquery'), '1.1', true);\n\n wp_enqueue_script('auto_click_script', 9999);\n}", "function bp_theme_autoloader($class) {\n\n if (strpos($class,'Theme') !== 0) {return false;}\n $class = str_replace('Theme\\\\','',$class);\n $file = strtolower(str_replace('\\\\','-',$class));\n $file = str_replace('_','-',$file);\n $file = array_unique(explode('-',$file));\n $file = implode('-',$file);\n $file = get_template_directory() . '/inc/' . $file;\n $file .= '.php';\n require $file;\n\n}", "function wp_metadata_lazyloader()\n {\n }", "function wp_simplepie_autoload($class)\n {\n }", "static function _shfw_autoloader()\n {\n\t\tinclude_once(BASEPATH.'config'.DIRECTORY_SEPARATOR.'autoload.php');\n\n\t\tif ( ! isset($autoload))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Autoload helpers.\n\t\tforeach ($autoload['helper'] as $type)\n\t\t{\t\t\t\n\t\t\tself::loadHelper($type);\n\t\t}\n\n\t\t// Autoload core components.\n\t\tforeach ($autoload['core'] as $type)\n\t\t{\t\t\t\n\t\t\tself::initCoreComponent($type);\n\t\t}\n\n\t\t/*\n\t\tif(SHIN_Core::$_benchmark){\n\t\t\tSHIN_Core::$_benchmark->mark('code_start');\n\t\t}\n\t\t*/\n\t\t\n\t\t// Autoload libraries.\n\t\tforeach ($autoload['libraries'] as $type)\n\t\t{\n\t\t\tself::loadLibrary($type, TRUE);\n\t\t}\n\n\t\t// Autoload models.\n\t\tforeach ($autoload['models'] as $type)\n\t\t{\n\t\t\tself::loadModel($type, TRUE);\n\t\t}\n\t}", "function _manually_load_plugin() {\n\trequire dirname( dirname( __FILE__ ) ) . '/plugin.php';\n}", "static function AjaxAutoload()\r\n\t{\r\n\t\t\r\n\t}", "function load_wp_auto_tagging(){\n\t\tif ( is_admin() ) {\n\t\t\tif ( apply_filters( 'wp_auto_tag_pre_check', class_exists( 'wp_auto_tagging' ) && wp_auto_tagging::prerequisites() ) ) {\n\t\t\t\trequire_once 'settings.php';\n\t\t\t\tregister_activation_hook( __FILE__, array('wp_auto_tagging_settings', 'register_defaults'));\n\t\t\t\tadd_action('init', array('wp_auto_tagging', 'instance'), -100, 0); \n\t\t\t} else {\n\t\t\t\t// let the user know prerequisites weren't met\n\t\t\t\tadd_action('admin_head', array('wp_auto_tagging', 'fail_notices'), 0, 0);\n\t\t\t}\n\t\t}\n\t}", "function bbboing_activation() {\r\n static $plugin_basename = null;\r\n if ( !$plugin_basename ) {\r\n $plugin_basename = plugin_basename(__FILE__);\r\n add_action( \"after_plugin_row_bbboing/bbboing.php\", \"bbboing_activation\" ); \r\n if ( !function_exists( \"oik_plugin_lazy_activation\" ) ) { \r\n require_once( \"admin/oik-activation.php\" );\r\n } \r\n } \r\n $depends = \"oik:2.2\";\r\n //bw_backtrace();\r\n oik_plugin_lazy_activation( __FILE__, $depends, \"oik_plugin_plugin_inactive\" );\r\n}", "function admin_load() {\n\n\t}", "public function afterInstall()\r\n {\r\n\r\n // $test = $this::getInstance();\r\n//print_r(Yii::getAlias('@'.($this->id)));\r\n\r\n\r\n // $fileName2 = (new \\ReflectionClass(new \\panix\\engine\\WebModule($this->id)))->getFileName();\r\n\r\n // $fileName = (new \\ReflectionClass(get_called_class()))->getFileName();\r\n // print_r($fileName2);\r\n\r\n\r\n /// print_r($reflectionClass->getNamespaceName());\r\n //die;\r\n\r\n // if ($this->uploadAliasPath && !file_exists(Yii::getPathOfAlias($this->uploadAliasPath)))\r\n // CFileHelper::createDirectory(Yii::getPathOfAlias($this->uploadAliasPath), 0777);\r\n //Yii::$app->cache->flush();\r\n // Yii::app()->widgets->clear();\r\n return true;\r\n }", "private function load_admin_scripts() {\n\n\t}", "private function initRequirePlugin(){\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Options Framework', // The plugin name\n\t\t 'slug' => 'options-framework', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'WooCommerce', // The plugin name\n\t\t 'slug' => 'woocommerce', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Contact Form 7', // The plugin name\n\t\t 'slug' => 'contact-form-7', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t 'source'\t\t\t\t => get_stylesheet_directory_uri() . '/sub/plugins/contact-form-7.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'WPBakery Visual Composer', // The plugin name\n\t\t 'slug' => 'js_composer', // The plugin slug (typically the folder name)\n\t\t 'required' => true,\n\t\t 'source' => get_stylesheet_directory_uri() . '/sub/plugins/js_composer.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Revolution Slider', // The plugin name\n 'slug' => 'revslider', // The plugin slug (typically the folder name)\n 'required' => true, // If false, the plugin is only 'recommended' instead of required\n 'source' => get_stylesheet_directory_uri() . '/sub/plugins/revslider.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH WooCommerce Wishlist', // The plugin name\n 'slug' => 'yith-woocommerce-wishlist', // The plugin slug (typically the folder name)\n 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH Woocommerce Compare', // The plugin name\n 'slug' => 'yith-woocommerce-compare', // The plugin slug (typically the folder name)\n 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH WooCommerce Zoom Magnifier', // The plugin name\n\t\t 'slug' => 'yith-woocommerce-zoom-magnifier', // The plugin slug (typically the folder name)\n\t\t 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'MailChimp', // The plugin name\n\t\t 'slug' => 'mailchimp-for-wp', // The plugin slug (typically the folder name)\n\t\t 'required' => true\n\t\t));\n\t}", "function autoloader( $class_name ) {\n\t\tglobal $jetpack_packages_classes;\n\n\t\tif ( isset( $jetpack_packages_classes[ $class_name ] ) ) {\n\t\t\tif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {\n\t\t\t\t// TODO ideally we shouldn't skip any of these, see: https://github.com/Automattic/jetpack/pull/12646.\n\t\t\t\t$ignore = in_array(\n\t\t\t\t\t$class_name,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'Automattic\\Jetpack\\JITM',\n\t\t\t\t\t\t'Automattic\\Jetpack\\Connection\\Manager',\n\t\t\t\t\t\t'Automattic\\Jetpack\\Connection\\Manager_Interface',\n\t\t\t\t\t\t'Automattic\\Jetpack\\Connection\\XMLRPC_Connector',\n\t\t\t\t\t\t'Jetpack_Options',\n\t\t\t\t\t\t'Jetpack_Signature',\n\t\t\t\t\t\t'Automattic\\Jetpack\\Sync\\Main',\n\t\t\t\t\t\t'Automattic\\Jetpack\\Constants',\n\t\t\t\t\t\t'Automattic\\Jetpack\\Tracking',\n\t\t\t\t\t\t'Automattic\\Jetpack\\Plugin\\Tracking',\n\t\t\t\t\t),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\tif ( ! $ignore && function_exists( 'did_action' ) && ! did_action( 'plugins_loaded' ) ) {\n\t\t\t\t\t_doing_it_wrong(\n\t\t\t\t\t\tesc_html( $class_name ),\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s Name of a PHP Class */\n\t\t\t\t\t\t\tesc_html__( 'Not all plugins have loaded yet but we requested the class %s', 'jetpack' ),\n\t\t\t\t\t\t\t// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\t\t\t\t$class_name\n\t\t\t\t\t\t),\n\t\t\t\t\t\tesc_html( $jetpack_packages_classes[ $class_name ]['version'] )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( file_exists( $jetpack_packages_classes[ $class_name ]['path'] ) ) {\n\t\t\t\trequire_once $jetpack_packages_classes[ $class_name ]['path'];\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "private function load_dependencies() {\n\n /**\n * The class responsible for defining options functionality\n * of the plugin.\n */\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup.php';\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup_init.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/class-form-fields.php';\n // common functions file\n include plugin_dir_path(dirname(__FILE__)) . 'includes/common-functions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfy-detail-pages.php';\n \n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfyframe-end-jsfile.php';\n\n // redux frameworks extension loader files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/redux-ext/loader.php';\n\n // icons manager\n include plugin_dir_path(dirname(__FILE__)) . 'icons-manager/icons-manager.php';\n\n // visual composer files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-actions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-shortcodes.php';\n // visual icon files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-icons/icons.php';\n // Mailchimp\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/vendor/autoload.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/mailchimp-functions.php';\n\n // post types\n include plugin_dir_path(dirname(__FILE__)) . 'includes/post-types/faq.php';\n\n // meta box file\n include plugin_dir_path(dirname(__FILE__)) . 'admin/meta-boxes.php';\n\n // Custom Typography\n include plugin_dir_path(dirname(__FILE__)) . 'includes/custom-typography.php';\n\n // twitter oauth\n include plugin_dir_path(dirname(__FILE__)) . 'includes/twitter-tweets/twitteroauth.php';\n // maintenace mode\n include plugin_dir_path(dirname(__FILE__)) . 'includes/maintenance-mode/maintenance-mode.php';\n\n // redux frameworks files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/class-redux-framework-plugin.php';\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/careerfy-options/options-config.php';\n\n include plugin_dir_path(dirname(__FILE__)) . 'admin/user/user-custom-fields.php';\n\n // instagram admin actions\n include plugin_dir_path(dirname(__FILE__)) . 'admin/instagram.php';\n // load Elementor Extension\n require plugin_dir_path(dirname(__FILE__)) . 'includes/class-careerfy-elementor.php';\n\n }", "function medialib_autoloader($class_name)\n{\n $class_name = str_replace('\\\\', '/', $class_name) . '.php';\n require_once $class_name;\n}", "function add_support_script_frontend(){\n}", "function ad_activate(){\r\n\trequire_once(dirname(__FILE__).'/installer.php');\r\n}", "function clientAutoload() {\n\t\n\tforeach ($this->config->item('client_autoload') as $call=>$fileNames) {\n\t if (method_exists($this,$call) && count($fileNames)) {\n\t\tforeach ($fileNames as $f) {\n\t\t $this->$call($f);\n\t\t}\n\t }\n\t}\n\t\n }", "function _wp_customize_loader_settings()\n {\n }", "function qpi_admin_enqueue_scripts( $hook_suffix ) {\n\tif ( 'plugin-install.php' == $hook_suffix ) {\n\t\twp_enqueue_script( 'qpi-script', plugin_dir_url( __FILE__ ) . 'quick-plugin-installer.js', array( 'jquery' ) );\n\t\twp_localize_script( 'qpi-script', 'QPI', array(\n\t\t\t'activated' => __( 'Activated', 'qpi-i18n' ),\n\t\t\t'error' => __( 'Error', 'qpi-i18n' ),\n\t\t) );\n\t}\n}", "function my_autoloader($class) {\r\n\t require_once ($class.'.php');\r\n\t}" ]
[ "0.6162595", "0.6089092", "0.60438347", "0.59748924", "0.59523016", "0.59011537", "0.5897351", "0.58831924", "0.5857214", "0.58398527", "0.58336", "0.5829964", "0.58154035", "0.5815382", "0.58033884", "0.5799519", "0.5792013", "0.57876164", "0.5784904", "0.5783519", "0.5760228", "0.5756708", "0.57482094", "0.57315165", "0.5721924", "0.57117414", "0.56964713", "0.5688596", "0.5683151", "0.5682224" ]
0.6091275
1
load and get an instance of the event class being tested
protected function _loadEventClass() { App::uses($this->plugin . 'Events', $this->plugin . '.Lib'); $this->EventClass = $this->plugin . 'Events'; $this->EventClass = new $this->EventClass(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInstance() {\n\t\t$this->assertInstanceOf('EventCore', $this->Event);\n\t}", "public function testFireEventWithClass()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', 'Underlay\\Tests\\Events\\Test@call', function (\n $receivedSecret\n )\n use (\n $secret\n ) {\n $this->assertEquals($secret, $receivedSecret);\n });\n $eventManager->fire('secret', $secret);\n }", "public static function get_instance() \n {\n if ( ! isset(self::$instance)) \n {\n self::$instance = new Event();\n }\n\n return self::$instance;\n }", "public function getEventClass()\n {\n return __NAMESPACE__ . '\\TestAsset\\LongEvent';\n }", "public function testInstanceOf()\n {\n $this->assertInstanceOf('Symfony\\Component\\EventDispatcher\\Event', $this->event);\n }", "protected function setUp()\n {\n parent::setUp();\n $this->object = new Event('test', $this, ['invoker' => $this]);\n }", "public function setUp() {\n\t\tparent::setUp();\n\t\t$this->_setPlugin();\n\n\t\t$this->ObjectObject = $this->ModelObject = $this->ViewObject = $this->ControllerObject = new Object();\n\n\t\t$this->ObjectEvent = new Event('TestEvent', $this->ObjectObject, $this->plugin);\n\t\t$this->ModelEvent = new Event('ModelEvent', $this->ModelObject, $this->plugin);\n\t\t$this->ViewtEvent = new Event('ViewtEvent', $this->ViewObject, $this->plugin);\n\t\t$this->ControllerEvent = new Event('ControllerEvent', $this->ControllerObject, $this->plugin);\n\n\t\tEventCore::loadEventHandler($this->plugin);\n\n\t\t$this->Event = EventCore::getInstance();\n\n\t\t$this->_loadEventClass();\n\t}", "public static function instance() {\n if ( ! isset( self::$instance ) && ! ( self::$instance instanceof FFW_EVENTS ) ) {\n self::$instance = new FFW_EVENTS;\n self::$instance->setup_constants();\n self::$instance->includes();\n // self::$instance->load_textdomain();\n // use @examples from public vars defined above upon implementation\n }\n return self::$instance;\n }", "public function testGetEvent()\n {\n }", "public function testEventReturnsAValidInstanceOfDispatcherEvent()\n\t{\n\t\t$args = array('my' => 'arguments');\n\t\t$event = Dispatcher::event($args, TRUE);\n\n\t\t$this->assertType('Dispatcher_Event', $event);\n\t}", "function event(): EventEmitter\n{\n return EventEmitter::getInstance();\n}", "public function testEvents(string $class): void\n {\n $reflection = new ReflectionClass($class);\n // Avoid checking abstract classes, interfaces, and the like\n if (!$reflection->isInstantiable()) {\n $this->markTestSkipped(\"Class [$class] is not instantiable\");\n }\n\n // All event classes must implement EventListenerInterface\n $requiredInterface = $this->interface;\n $this->assertTrue($reflection->implementsInterface($requiredInterface), \"Class [$class] does not implement [$requiredInterface]\");\n\n // Instantiate the event class and get implemented events list\n $event = new $class();\n $implemented = $event->implementedEvents();\n $this->assertTrue(is_array($implemented), \"implementedEvents() of [$class] returned a non-array\");\n $this->assertFalse(empty($implemented), \"implementedEvents() of [$class] returned an empty array\");\n\n // Test that we each event's handler is actually callable\n // See: https://api.cakephp.org/3.4/class-Cake.Event.EventListenerInterface.html#_implementedEvents\n foreach ($implemented as $name => $handler) {\n if (is_array($handler)) {\n $this->assertFalse(empty($handler['callable']), \"Handler for event [$name] in [$class] is missing 'callable' key\");\n $this->assertTrue(is_string($handler['callable']), \"Handler for event [$name] in [$class] has a non-string 'callable' key\");\n $handler = $handler['callable'];\n }\n\n $this->assertTrue(method_exists($event, $handler), \"Method [$handler] does not exist in [$class] for event [$name]\");\n $this->assertTrue(is_callable([$event, $handler]), \"Method [$handler] is not callable in [$class] for event [$name]\");\n }\n }", "public function testEvent()\n {\n $dispatcher = new Events();\n $this->app->bind(DispatcherInterface::class, function() use ($dispatcher) {\n return $dispatcher;\n });\n $response = (new Command())->testEvent(new Event());\n $event = array_shift($response);\n\n $this->assertSame(Event::class, $event['name'], 'The event that should have been dispatched should match the event passed to event().');\n $this->assertFalse($event['halt'], 'The event should not halt when dispatched from event().');\n }", "protected function setUp() {\r\n\t\t\r\n\t\tparent::setUp ();\r\n\t\t$this->trait = $this->getObjectForTrait('Events');\r\n\t\r\n\t}", "public function testEventLoading() {\n\t\t$sessionData = array('session.test.test' => array('test' => 'testValue'));\n\t\t$storage = null;\n\t\t$session = $this->getSession('test', $sessionData);\n\t\t$session->handleEvent(new Event(Event::TYPE_APPLICATION_BEFORE_CONTROLLER_RUN));\n\t\t$this->assertSame('testValue', $session['test'], 'Loaded value is invalid');\n\t}", "public function getEventClass()\n {\n return $this->eventClass;\n }", "public function testEventCallBackCreate()\n {\n }", "public function testGetEvents()\n {\n }", "public static function getInstance()\n {\n static $instance = false;\n\n if (!$instance) {\n $instance = new \\Xoops\\Core\\Events();\n }\n\n return $instance;\n }", "public function event(): EventDispatcherInterface;", "public function testInstancesOf()\n {\n $this->assertInstanceOf('Symfony\\Component\\EventDispatcher\\Event', $this->gearmanClientCallbackExceptionEvent);\n }", "public function testInstantiation()\n {\n static::assertInstanceOf(HookListener::class, new HookListener($this->mockContaoFramework()));\n }", "public function __construct()\n {\n parent::__construct('BaseEvent');\n }", "public function testGetStaticEventDispatcher()\n {\n $transport = new Transport();\n $refTransport = new \\ReflectionObject($transport);\n $getStaticEventDispatcherMethod = $refTransport->getMethod('getEventDispatcher');\n $getStaticEventDispatcherMethod->setAccessible(true);\n $returnEventDispatcher = $getStaticEventDispatcherMethod->invoke($transport);\n $this->assertInstanceOf(EventDispatcher::class, $returnEventDispatcher);\n }", "public function getEvent(): EventInterface;", "public function init()\n {\n// $eventSystem = $this->_bootstrap->getResource('EventSystem');\n// $eventSystem->raiseEvent($event);\n\n }", "public function testGetEventDispatcher()\n {\n $transport = new Transport();\n $this->assertInstanceOf(EventDispatcher::class, $transport->getEventDispatcher());\n }", "public function testEventCallBackGet()\n {\n }", "protected function getEventsManager() {}", "public static function event() {\n return self::service()->get('events');\n }" ]
[ "0.72476095", "0.6862377", "0.6752962", "0.6679267", "0.6549169", "0.6377598", "0.62834555", "0.6265913", "0.6254268", "0.6238321", "0.61207473", "0.60978925", "0.6094033", "0.60903376", "0.6075804", "0.60363036", "0.603006", "0.60247064", "0.60161096", "0.5985935", "0.59524024", "0.59482723", "0.5942705", "0.5927344", "0.5894994", "0.5891964", "0.58395916", "0.5822386", "0.5821328", "0.57843316" ]
0.739606
0
test getting the cache config
public function testCacheConfig() { if (!$this->_hasTrigger('setupCache')) { return false; } $expected = $this->_manualCall('setupCache', $this->ObjectEvent); $result = $this->Event->trigger($this->ModelObject, $this->plugin . '.setupCache'); $this->assertEquals($expected, $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function configurationIsCached();", "public function testCreateCachedObject() {\n\t\t// Load the config file\n\t\tCore\\Config::load('MyProject');\n\t\tCore\\Config::set('cache', 'enable', true, true);\n\n\t\t// Put the cache\n\t\tCore\\Cache::put('foo', 'bar');\n\n\t\t// The file exists?\n\t\t$this->assertTrue(Core\\Cache::has('foo'));\n\n\t\t// And the file has the correct contents?\n\t\t$this->assertEquals(Core\\Cache::get('foo'), 'bar');\n\t}", "public static function getCache() {}", "public function setUpCache();", "public function get_test_page_cache()\n {\n }", "function cacheConfig() {\n\t\tif(!isset($this->_options['configCachePath'])) {\n\t\t\tthrow new PPI_Exception('Missing path to the config cache path');\n\t\t}\n\n\t\t$path = sprintf('%s%s.%s.cache',\n\t\t\t$this->_options['configCachePath'],\n\t\t\t$this->_options['configFile'],\n\t\t\t$this->_options['configBlock']);\n\n\t\tif(file_exists($path)) {\n\t\t\treturn unserialize(file_get_contents($path));\n\t\t}\n\t\t$config = $this->parseConfig();\n\t\tfile_put_contents($path, serialize($config));\n\t\treturn $config;\n\t}", "public function getCache();", "private function _shouldBeCached()\n {\n $item = $this->repo->get(SettingKeys::CACHE_SETTINGS);\n //The setting failed to fetch, don't cache value to be on the safe side.\n if (!$item) {\n Log::channel('runtime')->warning(\n '[SettingsManager:39] Failed to fetch setting.',\n ['key' => SettingKeys::CACHE_SETTINGS]\n );\n return false;\n }\n return $item->value;\n }", "public function testCacheGet() \n\t{\n\t\t$key = uniqid('key_');\n\t\t$value = uniqid('value_');\n\t\t$this->assertFalse(\\Cache\\Cache::get($key));\n\n\t\t\\Cache\\Cache::set($key, $value);\n\t\t$this->assertEquals(\\Cache\\Cache::get($key), $value);\n\t}", "public function testSetupCache()\n {\n $this->assertNull($this->setupCache());\n }", "protected function getCurrentPageCacheConfiguration() {}", "public function testAuthorizeConfigCacheEmpty()\n\t{\n\t\t$service = $this->createBuilder();\n\t\t$builderCache = $service->getCacheAdapter();\n\t\t$testingConf = [\n\t\t\t'someConf' => true\n\t\t];\n\n\t\t$builderCache->setItem(AnnotationBuilder::CACHE, serialize($testingConf));\n\n\t\t$service->getAuthorizeConfig();\n\n\t\t$this->assertEquals($testingConf, unserialize($builderCache->getItem(AnnotationBuilder::CACHE)));\n\n\t\t// clear settings\n\t\t$builderCache->setItem(AnnotationBuilder::CACHE, null);\n\t}", "function _cache_get ($cache_name = \"\") {\n\t\tif (empty($cache_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t$cache_file_path = $this->_prepare_cache_path($cache_name);\n\t\treturn $this->_get_cache_file($cache_file_path);\n\t}", "public function getCacheConfig()\n {\n $config = null;\n if (file_exists($this->options['cache_path'])) {\n $content = @file_get_contents($this->options['cache_path']);\n $config = new Config($this->app, $content);\n }\n return $config;\n }", "protected function getCacheManager() {}", "protected function getCacheManager() {}", "public static function getCacheControl() {}", "protected static function getCacheManager() {}", "public function get($cache_name);", "private function cached()\n {\n if (isset(self::$_cached)) {\n $this->_config = self::$_cached;\n return true;\n } else {\n return false;\n }\n }", "public function getCacheOptions();", "function set_cache($cache_file = '')\n {\n $data = array();\n switch ($cache_file) {\n case 'configurations':\n $data = modules::run('configurations/get_configuration', array('array' => TRUE)); \n break;\n case 'configurations_vi':\n $data = modules::run('configurations/get_configuration', array('array' => TRUE, 'lang' => 'vi')); \n break;\n case 'configurations_en':\n $data = modules::run('configurations/get_configuration', array('array' => TRUE, 'lang' => 'en')); \n break;\n case 'pages':\n $data = modules::run('pages/get_page_data', array('array' => TRUE)); \n break;\n case 'menus':\n $data = modules::run('menus/get_menu_data', array('array' => TRUE)); \n break;\n default:\n break;\n }\n return $data;\n }", "protected function configureCaching() {\n $_CONFIG = array();\n\n require_once ASCMS_CORE_MODULE_PATH . '/Cache/Controller/CacheLib.class.php';\n\n $isInstalled = function($cacheEngine) {\n switch ($cacheEngine) {\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC:\n return extension_loaded('apc');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE:\n return extension_loaded('opcache') || extension_loaded('Zend OPcache');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE:\n return extension_loaded('memcache') || extension_loaded('memcached');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE:\n return extension_loaded('xcache');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_FILESYSTEM:\n return true;\n }\n };\n\n $isConfigured = function($cacheEngine, $user = false) {\n switch ($cacheEngine) {\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC:\n if ($user) {\n return ini_get('apc.serializer') == 'php';\n }\n return true;\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE:\n return ini_get('opcache.save_comments') && ini_get('opcache.load_comments');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE:\n return false;\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE:\n if ($user) {\n return (\n ini_get('xcache.var_size') > 0 &&\n ini_get('xcache.admin.user') &&\n ini_get('xcache.admin.pass')\n );\n }\n return ini_get('xcache.size') > 0;\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_FILESYSTEM:\n return is_writable(ASCMS_DOCUMENT_ROOT . '/tmp/cache');\n }\n };\n\n // configure opcaches\n $configureOPCache = function() use($isInstalled, $isConfigured, &$_CONFIG) {\n // APC\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC) && $isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC)) {\n $_CONFIG['cacheOPCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC;\n return;\n }\n\n // Disable zend opcache if it is enabled\n // If save_comments is set to TRUE, doctrine2 will not work properly.\n // It is not possible to set a new value for this directive with php.\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE)) {\n ini_set('opcache.save_comments', 1);\n ini_set('opcache.load_comments', 1);\n ini_set('opcache.enable', 1);\n\n if ($isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE)) {\n $_CONFIG['cacheOPCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE;\n return;\n }\n }\n\n // XCache\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE) &&\n $isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE)\n ) {\n $_CONFIG['cacheOPCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE;\n return;\n }\n return false;\n };\n\n // configure user caches\n $configureUserCache = function() use($isInstalled, $isConfigured, &$_CONFIG) {\n // APC\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC)) {\n // have to use serializer \"php\", not \"default\" due to doctrine2 gedmo tree repository\n ini_set('apc.serializer', 'php');\n if ($isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC, true)) {\n $_CONFIG['cacheUserCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC;\n return;\n }\n }\n\n // Memcache\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE) && $isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE)) {\n $_CONFIG['cacheUserCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE;\n return;\n }\n\n // XCache\n if (\n $isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE) &&\n $isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE, true)\n ) {\n $_CONFIG['cacheUserCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE;\n return;\n }\n\n // Filesystem\n if ($isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_FILESYSTEM)) {\n $_CONFIG['cacheUserCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_FILESYSTEM;\n return;\n }\n return false;\n };\n\n if ($configureOPCache() === false) {\n $_CONFIG['cacheOpStatus'] = 'off';\n } else {\n $_CONFIG['cacheOpStatus'] = 'on';\n }\n\n if ($configureUserCache() === false) {\n $_CONFIG['cacheDbStatus'] = 'off';\n } else {\n $_CONFIG['cacheDbStatus'] = 'on';\n }\n\n $objDb = $this->_getDbObject($statusMsg);\n foreach ($_CONFIG as $key => $value) {\n $objDb->Execute(\"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings` SET `setvalue` = '\".$value.\"' WHERE `setname` = '\".$key.\"'\");\n }\n }", "private function mockCache()\n {\n $this->objectManager->configure([\n 'preferences' => [\n Cache::class => DummyCache::class\n ]\n ]);\n }", "function _biurnal_conf_get_conf_cache($name) {\n ctools_include('object-cache');\n $cache = ctools_object_cache_get('biurnal_conf', $name);\n if (!$cache) {\n $cache = biurnal_conf_load($name);\n if ($cache) {\n $cache->locked = ctools_object_cache_test('biurnal_conf', $name);\n }\n }\n\n return $cache;\n}", "static public function getCache(){\n return static::$cache;\n }", "public static function configurationIsCached(){\n return \\Illuminate\\Foundation\\Application::configurationIsCached();\n }", "public function getConfigCacheEnabled()\n {\n return $this->configCacheEnabled;\n }", "private function loadConfig() {\n if (file_exists($this->_data['cache_config_file'])) {\n $data = unserialize(file_get_contents($this->_data['cache_config_file']));\n \n self::$_configInstance = (object)$data; //instance of stdClass with all the properties public\n //$this->_data = (array)$data; \n return true;\n } \n return false;\n }", "public function testCacheService()\n {\n $client = $this->createClient();\n $cache = $client->getContainer()->get('anu_style_proxy.cache');\n $this->assertInstanceOf('Doctrine\\Common\\Cache\\Cache', $cache);\n }" ]
[ "0.7166657", "0.7094102", "0.6941396", "0.687526", "0.6807122", "0.6712748", "0.66992867", "0.6686551", "0.6674238", "0.6662307", "0.66509277", "0.6638423", "0.66327775", "0.6583384", "0.65706474", "0.6569947", "0.6559856", "0.65525186", "0.65412664", "0.653488", "0.64902633", "0.6469926", "0.64605284", "0.6440451", "0.6428987", "0.6421242", "0.63710123", "0.6358357", "0.635746", "0.6349852" ]
0.72214276
0
test getting the admin menu
public function testAdminMenu() { if (!$this->_hasTrigger('adminMenu')) { return false; } $expected = $this->_manualCall('adminMenu', $this->ObjectEvent); $result = $this->Event->trigger($this->ViewObject, $this->plugin . '.adminMenu'); $this->assertEquals($expected, $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testmenuAction()\n {\n parent::login();\n $this->clickAt(\"link=CMS\", \"\");\n $this->click(\"link=Menus\");\n $this->waitForPageToLoad(\"30000\");\n $this->isElementPresent(\"id=sortable1\");\n $this->isElementPresent(\"id=sortable2\");\n parent::logout();\n }", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "public static function add_admin_menus()\n\t{\n\t}", "public function testShowingAdmin(){\n }", "public function admin_menu(&$menu)\n {\n\n\t}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "function network_admin_menu()\n {\n }", "public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }", "function getMenuItems()\n {\n $this->menuitem(\"xp\", \"\", \"main\", array(\"xp.story\", \"admin\"));\n $this->menuitem(\"stories\", dispatch_url(\"xp.story\", \"admin\"), \"xp\", array(\"xp.story\", \"admin\"));\n }", "public function getMenus() {}", "public function page_test() {\n\n\t\tprint_r($this->permissions->check(\"can_view_admin\"));\n\t}", "public function testGetAdminLinks() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "function adminMenu() {\r\n\t\t// TODO: This does not only create the menu, it also (only?) *does* sth. with the entries.\r\n\t\t// But those actions must be done before the menu is created (due to the redirects).\r\n\t\t// !Split the function!\r\n\t\t//$page = add_submenu_page('admin.php', __('UWR Ergebnisse'), __('UWR Ergebnisse'), 'edit_posts', 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\t$page = add_submenu_page('uwr1menu', __('UWR Ergebnisse'), __('UWR Ergebnisse'), UWR1RESULTS_CAPABILITIES, 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\tadd_action( 'admin_print_scripts-' . $page, array('Uwr1resultsView', 'adminScripts') );\r\n\t}", "protected function menus()\n {\n\n }", "public function testMenuRouteTest()\n {\n $user = $this->_getAdminUser();\n $response = $this->actingAs($user, 'admin')->get(route('admin.menu.index'));\n $response->assertStatus(200);\n $response->assertSee('Menu');\n\n //\n $data['name'] = 'test menu';\n $data['identifier'] = 'test-menu';\n $data['menu_json'] = '[[{\n \"name\": \"Kitchen\",\n \"params\": \"kitchen\",\n \"route\": \"category.view\",\n \"children\": [\n []\n ]\n }]]';\n $response = $this->post(route('admin.menu.store'), $data);\n\n $response->assertRedirect(route('admin.menu.index'));\n }", "private function loadMenu()\n\t{\n\t\tglobal $txt, $context, $modSettings, $settings;\n\n\t\t// Need these to do much\n\t\trequire_once(SUBSDIR . '/Menu.subs.php');\n\n\t\t// Define the menu structure - see subs/Menu.subs.php for details!\n\t\t$admin_areas = array(\n\t\t\t'forum' => array(\n\t\t\t\t'title' => $txt['admin_main'],\n\t\t\t\t'permission' => array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'index' => array(\n\t\t\t\t\t\t'label' => $txt['admin_center'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Admin',\n\t\t\t\t\t\t'function' => 'action_home',\n\t\t\t\t\t\t'class' => 'i-home i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'credits' => array(\n\t\t\t\t\t\t'label' => $txt['support_credits_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Admin',\n\t\t\t\t\t\t'function' => 'action_credits',\n\t\t\t\t\t\t'class' => 'i-support i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'maillist' => array(\n\t\t\t\t\t\t'label' => $txt['mail_center'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageMaillist',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-envelope-blank i-admin',\n\t\t\t\t\t\t'permission' => array('approve_emails', 'admin_forum'),\n\t\t\t\t\t\t'enabled' => featureEnabled('pe'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'emaillist' => array($txt['mm_emailerror'], 'approve_emails'),\n\t\t\t\t\t\t\t'emailfilters' => array($txt['mm_emailfilters'], 'admin_forum'),\n\t\t\t\t\t\t\t'emailparser' => array($txt['mm_emailparsers'], 'admin_forum'),\n\t\t\t\t\t\t\t'emailtemplates' => array($txt['mm_emailtemplates'], 'approve_emails'),\n\t\t\t\t\t\t\t'emailsettings' => array($txt['mm_emailsettings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'news' => array(\n\t\t\t\t\t\t'label' => $txt['news_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageNews',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-post-text i-admin',\n\t\t\t\t\t\t'permission' => array('edit_news', 'send_mail', 'admin_forum'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'editnews' => array($txt['admin_edit_news'], 'edit_news'),\n\t\t\t\t\t\t\t'mailingmembers' => array($txt['admin_newsletters'], 'send_mail'),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'packages' => array(\n\t\t\t\t\t\t'label' => $txt['package'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\Packages\\\\Packages',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'class' => 'i-package i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'browse' => array($txt['browse_packages']),\n\t\t\t\t\t\t\t'installed' => array($txt['installed_packages']),\n\t\t\t\t\t\t\t'options' => array($txt['package_settings']),\n\t\t\t\t\t\t\t'servers' => array($txt['download_packages']),\n\t\t\t\t\t\t\t'upload' => array($txt['upload_packages']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'packageservers' => array(\n\t\t\t\t\t\t'label' => $txt['package_servers'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\Packages\\\\PackageServers',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'class' => 'i-package i-admin',\n\t\t\t\t\t\t'hidden' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Admin',\n\t\t\t\t\t\t'function' => 'action_search',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'class' => 'i-search i-admin',\n\t\t\t\t\t\t'select' => 'index'\n\t\t\t\t\t),\n\t\t\t\t\t'adminlogoff' => array(\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Admin',\n\t\t\t\t\t\t'function' => 'action_endsession',\n\t\t\t\t\t\t'label' => $txt['admin_logoff'],\n\t\t\t\t\t\t'enabled' => empty($modSettings['securityDisable']),\n\t\t\t\t\t\t'class' => 'i-sign-out i-admin',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'config' => array(\n\t\t\t\t'title' => $txt['admin_config'],\n\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'corefeatures' => array(\n\t\t\t\t\t\t'label' => $txt['core_settings_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\CoreFeatures',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-cog i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'featuresettings' => array(\n\t\t\t\t\t\t'label' => $txt['modSettings_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageFeatures',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-switch-on i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'basic' => array($txt['mods_cat_features']),\n\t\t\t\t\t\t\t'layout' => array($txt['mods_cat_layout']),\n\t\t\t\t\t\t\t'pmsettings' => array($txt['personal_messages']),\n\t\t\t\t\t\t\t'karma' => array($txt['karma'], 'enabled' => featureEnabled('k')),\n\t\t\t\t\t\t\t'likes' => array($txt['likes'], 'enabled' => featureEnabled('l')),\n\t\t\t\t\t\t\t'mention' => array($txt['mention']),\n\t\t\t\t\t\t\t'sig' => array($txt['signature_settings_short']),\n\t\t\t\t\t\t\t'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => featureEnabled('cp')),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'serversettings' => array(\n\t\t\t\t\t\t'label' => $txt['admin_server_settings'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageServer',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-menu i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'general' => array($txt['general_settings']),\n\t\t\t\t\t\t\t'database' => array($txt['database_paths_settings']),\n\t\t\t\t\t\t\t'cookie' => array($txt['cookies_sessions_settings']),\n\t\t\t\t\t\t\t'cache' => array($txt['caching_settings']),\n\t\t\t\t\t\t\t'loads' => array($txt['loadavg_settings']),\n\t\t\t\t\t\t\t'phpinfo' => array($txt['phpinfo_settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'securitysettings' => array(\n\t\t\t\t\t\t'label' => $txt['admin_security_moderation'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageSecurity',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-lock i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'general' => array($txt['mods_cat_security_general']),\n\t\t\t\t\t\t\t'spam' => array($txt['antispam_title']),\n\t\t\t\t\t\t\t'moderation' => array($txt['moderation_settings_short'], 'enabled' => !empty($modSettings['warning_enable'])),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'theme' => array(\n\t\t\t\t\t\t'label' => $txt['theme_admin'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageThemes',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'custom_url' => getUrl('admin', ['action' => 'admin', 'area' => 'theme']),\n\t\t\t\t\t\t'class' => 'i-modify i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'admin' => array($txt['themeadmin_admin_title']),\n\t\t\t\t\t\t\t'list' => array($txt['themeadmin_list_title']),\n\t\t\t\t\t\t\t'reset' => array($txt['themeadmin_reset_title']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'current_theme' => array(\n\t\t\t\t\t\t'label' => $txt['theme_current_settings'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageThemes',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'custom_url' => getUrl('admin', ['action' => 'admin', 'area' => 'theme', 'sa' => 'list', 'th' => $settings['theme_id']]),\n\t\t\t\t\t\t'class' => 'i-paint i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'languages' => array(\n\t\t\t\t\t\t'label' => $txt['language_configuration'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageLanguages',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-language i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'edit' => array($txt['language_edit']),\n\t\t\t\t\t\t\t// 'add' => array($txt['language_add']),\n\t\t\t\t\t\t\t'settings' => array($txt['language_settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'addonsettings' => array(\n\t\t\t\t\t\t'label' => $txt['admin_modifications'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\AddonSettings',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-puzzle i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'general' => array($txt['mods_cat_modifications_misc']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'layout' => array(\n\t\t\t\t'title' => $txt['layout_controls'],\n\t\t\t\t'permission' => array('manage_boards', 'admin_forum', 'manage_smileys', 'manage_attachments', 'moderate_forum'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'manageboards' => array(\n\t\t\t\t\t\t'label' => $txt['admin_boards'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageBoards',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-directory i-admin',\n\t\t\t\t\t\t'permission' => array('manage_boards'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'main' => array($txt['boardsEdit']),\n\t\t\t\t\t\t\t'newcat' => array($txt['mboards_new_cat']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'postsettings' => array(\n\t\t\t\t\t\t'label' => $txt['manageposts'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManagePosts',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'class' => 'i-post-text i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'posts' => array($txt['manageposts_settings']),\n\t\t\t\t\t\t\t'censor' => array($txt['admin_censored_words']),\n\t\t\t\t\t\t\t'topics' => array($txt['manageposts_topic_settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'editor' => array(\n\t\t\t\t\t\t'label' => $txt['editor_manage'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageEditor',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-modify i-admin',\n\t\t\t\t\t\t'permission' => array('manage_bbc'),\n\t\t\t\t\t),\n\t\t\t\t\t'smileys' => array(\n\t\t\t\t\t\t'label' => $txt['smileys_manage'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageSmileys',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-smiley i-admin',\n\t\t\t\t\t\t'permission' => array('manage_smileys'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'editsets' => array($txt['smiley_sets']),\n\t\t\t\t\t\t\t'addsmiley' => array($txt['smileys_add'], 'enabled' => !empty($modSettings['smiley_enable'])),\n\t\t\t\t\t\t\t'editsmileys' => array($txt['smileys_edit'], 'enabled' => !empty($modSettings['smiley_enable'])),\n\t\t\t\t\t\t\t'setorder' => array($txt['smileys_set_order'], 'enabled' => !empty($modSettings['smiley_enable'])),\n\t\t\t\t\t\t\t'editicons' => array($txt['icons_edit_message_icons'], 'enabled' => !empty($modSettings['messageIcons_enable'])),\n\t\t\t\t\t\t\t'settings' => array($txt['settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'manageattachments' => array(\n\t\t\t\t\t\t'label' => $txt['attachments_avatars'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageAttachments',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-paperclip i-admin',\n\t\t\t\t\t\t'permission' => array('manage_attachments'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'browse' => array($txt['attachment_manager_browse']),\n\t\t\t\t\t\t\t'attachments' => array($txt['attachment_manager_settings']),\n\t\t\t\t\t\t\t'avatars' => array($txt['attachment_manager_avatar_settings']),\n\t\t\t\t\t\t\t'attachpaths' => array($txt['attach_directories']),\n\t\t\t\t\t\t\t'maintenance' => array($txt['attachment_manager_maintenance']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'managesearch' => array(\n\t\t\t\t\t\t'label' => $txt['manage_search'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageSearch',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-search i-admin',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'weights' => array($txt['search_weights']),\n\t\t\t\t\t\t\t'method' => array($txt['search_method']),\n\t\t\t\t\t\t\t'managesphinx' => array($txt['search_sphinx']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'members' => array(\n\t\t\t\t'title' => $txt['admin_manage_members'],\n\t\t\t\t'permission' => array('moderate_forum', 'manage_membergroups', 'manage_bans', 'manage_permissions', 'admin_forum'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'viewmembers' => array(\n\t\t\t\t\t\t'label' => $txt['admin_users'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageMembers',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-user i-admin',\n\t\t\t\t\t\t'permission' => array('moderate_forum'),\n\t\t\t\t\t),\n\t\t\t\t\t'membergroups' => array(\n\t\t\t\t\t\t'label' => $txt['admin_groups'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageMembergroups',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-users',\n\t\t\t\t\t\t'permission' => array('manage_membergroups'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'index' => array($txt['membergroups_edit_groups'], 'manage_membergroups'),\n\t\t\t\t\t\t\t'add' => array($txt['membergroups_new_group'], 'manage_membergroups'),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'permissions' => array(\n\t\t\t\t\t\t'label' => $txt['edit_permissions'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManagePermissions',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-lock i-admin',\n\t\t\t\t\t\t'permission' => array('manage_permissions'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'index' => array($txt['permissions_groups'], 'manage_permissions'),\n\t\t\t\t\t\t\t'board' => array($txt['permissions_boards'], 'manage_permissions'),\n\t\t\t\t\t\t\t'profiles' => array($txt['permissions_profiles'], 'manage_permissions'),\n\t\t\t\t\t\t\t'postmod' => array($txt['permissions_post_moderation'], 'manage_permissions', 'enabled' => $modSettings['postmod_active']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'ban' => array(\n\t\t\t\t\t\t'label' => $txt['ban_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageBans',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-thumbdown i-admin',\n\t\t\t\t\t\t'permission' => 'manage_bans',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'list' => array($txt['ban_edit_list']),\n\t\t\t\t\t\t\t'add' => array($txt['ban_add_new']),\n\t\t\t\t\t\t\t'browse' => array($txt['ban_trigger_browse']),\n\t\t\t\t\t\t\t'log' => array($txt['ban_log']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'regcenter' => array(\n\t\t\t\t\t\t'label' => $txt['registration_center'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageRegistration',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-user-plus i-admin',\n\t\t\t\t\t\t'permission' => array('admin_forum', 'moderate_forum'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'register' => array($txt['admin_browse_register_new'], 'moderate_forum'),\n\t\t\t\t\t\t\t'agreement' => array($txt['registration_agreement'], 'admin_forum'),\n\t\t\t\t\t\t\t'privacypol' => array($txt['privacy_policy'], 'admin_forum'),\n\t\t\t\t\t\t\t'reservednames' => array($txt['admin_reserved_set'], 'admin_forum'),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'sengines' => array(\n\t\t\t\t\t\t'label' => $txt['search_engines'],\n\t\t\t\t\t\t'enabled' => featureEnabled('sp'),\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageSearchEngines',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-website i-admin',\n\t\t\t\t\t\t'permission' => 'admin_forum',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'stats' => array($txt['spider_stats']),\n\t\t\t\t\t\t\t'logs' => array($txt['spider_logs']),\n\t\t\t\t\t\t\t'spiders' => array($txt['spiders']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'paidsubscribe' => array(\n\t\t\t\t\t\t'label' => $txt['paid_subscriptions'],\n\t\t\t\t\t\t'enabled' => featureEnabled('ps'),\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManagePaid',\n\t\t\t\t\t\t'class' => 'i-credit i-admin',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'permission' => 'admin_forum',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'view' => array($txt['paid_subs_view']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'maintenance' => array(\n\t\t\t\t'title' => $txt['admin_maintenance'],\n\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'maintain' => array(\n\t\t\t\t\t\t'label' => $txt['maintain_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Maintenance',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-cog i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'routine' => array($txt['maintain_sub_routine'], 'admin_forum'),\n\t\t\t\t\t\t\t'database' => array($txt['maintain_sub_database'], 'admin_forum'),\n\t\t\t\t\t\t\t'members' => array($txt['maintain_sub_members'], 'admin_forum'),\n\t\t\t\t\t\t\t'topics' => array($txt['maintain_sub_topics'], 'admin_forum'),\n\t\t\t\t\t\t\t'hooks' => array($txt['maintain_sub_hooks_list'], 'admin_forum'),\n\t\t\t\t\t\t\t'attachments' => array($txt['maintain_sub_attachments'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'logs' => array(\n\t\t\t\t\t\t'label' => $txt['logs'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\AdminLog',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-comments i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'errorlog' => array($txt['errlog'], 'admin_forum', 'enabled' => !empty($modSettings['enableErrorLogging']), 'url' => getUrl('admin', ['action' => 'admin', 'area' => 'logs', 'sa' => 'errorlog', 'desc'])),\n\t\t\t\t\t\t\t'adminlog' => array($txt['admin_log'], 'admin_forum', 'enabled' => featureEnabled('ml')),\n\t\t\t\t\t\t\t'modlog' => array($txt['moderation_log'], 'admin_forum', 'enabled' => featureEnabled('ml')),\n\t\t\t\t\t\t\t'banlog' => array($txt['ban_log'], 'manage_bans'),\n\t\t\t\t\t\t\t'spiderlog' => array($txt['spider_logs'], 'admin_forum', 'enabled' => featureEnabled('sp')),\n\t\t\t\t\t\t\t'tasklog' => array($txt['scheduled_log'], 'admin_forum'),\n\t\t\t\t\t\t\t'pruning' => array($txt['pruning_title'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'scheduledtasks' => array(\n\t\t\t\t\t\t'label' => $txt['maintain_tasks'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageScheduledTasks',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-calendar i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'tasks' => array($txt['maintain_tasks'], 'admin_forum'),\n\t\t\t\t\t\t\t'tasklog' => array($txt['scheduled_log'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'mailqueue' => array(\n\t\t\t\t\t\t'label' => $txt['mailqueue_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageMail',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-envelope-blank i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'browse' => array($txt['mailqueue_browse'], 'admin_forum'),\n\t\t\t\t\t\t\t'settings' => array($txt['mailqueue_settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'reports' => array(\n\t\t\t\t\t\t'enabled' => featureEnabled('rg'),\n\t\t\t\t\t\t'label' => $txt['generate_reports'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Reports',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-pie-chart i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'repairboards' => array(\n\t\t\t\t\t\t'label' => $txt['admin_repair'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\RepairBoards',\n\t\t\t\t\t\t'function' => 'action_repairboards',\n\t\t\t\t\t\t'select' => 'maintain',\n\t\t\t\t\t\t'hidden' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->_events->trigger('addMenu', array('admin_areas' => &$admin_areas));\n\n\t\t// Any files to include for administration?\n\t\tcall_integration_include_hook('integrate_admin_include');\n\n\t\t$menuOptions = array(\n\t\t\t'hook' => 'admin',\n\t\t);\n\n\t\t// Actually create the menu!\n\t\t$menu = new Menu();\n\t\t$menu->addMenuData($admin_areas);\n\t\t$menu->addOptions($menuOptions);\n\t\t$admin_include_data = $menu->prepareMenu();\n\t\t$menu->setContext();\n\t\tunset($admin_areas);\n\n\t\t// Make a note of the Unique ID for this menu.\n\t\t$context['admin_menu_id'] = $context['max_menu_id'];\n\t\t$context['admin_menu_name'] = 'menu_data_' . $context['admin_menu_id'];\n\n\t\t// Where in the admin are we?\n\t\t$context['admin_area'] = $admin_include_data['current_area'];\n\n\t\treturn $admin_include_data;\n\t}", "function admin_menu() {\n\t\t// Set Admin Access Level\n\t\tif(!$this->options['access_level']): \n\t\t\t$access = 'edit_dashboard';\n\t\telse: \n\t\t\t$access = $this->options['access_level'];\n\t\tendif;\n\t\t\n\t\t// Create Menu Items \n\t\tadd_options_page('Escalate Network', 'Escalate Network', $access, 'escalate-network-options', array($this, 'settings_page'));\n\t}", "public static function admin_menu() {\n\t\t$title = 'Micropub';\n\t\t// If the IndieWeb Plugin is installed use its menu.\n\t\tif ( class_exists( 'IndieWeb_Plugin' ) ) {\n\t\t\t$options_page = add_submenu_page(\n\t\t\t\t'indieweb',\n\t\t\t\t$title,\n\t\t\t\t$title,\n\t\t\t\t'manage_options',\n\t\t\t\t'micropub',\n\t\t\t\tarray( static::class, 'settings_page' )\n\t\t\t);\n\t\t} else {\n\t\t\t$options_page = add_options_page(\n\t\t\t\t$title,\n\t\t\t\t$title,\n\t\t\t\t'manage_options',\n\t\t\t\t'micropub',\n\t\t\t\tarray( static::class, 'settings_page' )\n\t\t\t);\n\t\t}\n\n\t}", "static function adminMenuPage()\n {\n // Include the view for this menu page.\n include PROJECTEN_PLUGIN_ADMIN_VIEWS_DIR . '/admin_main.php';\n }", "protected function adminMenu()\n {\n \\add_submenu_page(\n 'options-general.php',\n \\esc_html__('WP REST API Cache', 'wp-rest-api-cache'),\n \\esc_html__('REST API Cache', 'wp-rest-api-cache'),\n self::CAPABILITY,\n self::MENU_SLUG,\n function () {\n $this->renderPage();\n }\n );\n }", "public function testAddMenuAction()\n {\n parent::login();\n $this->clickAt(\"link=CMS\", \"\");\n $this->click(\"link=Páginas\");\n $this->waitForPageToLoad(\"30000\");\n $this->click(\"link=Criar uma nova página\");\n $this->waitForPageToLoad(\"30000\");\n $this->type(\"id=xvolutions_adminbundle_page_title\", \"Test Menu Selenium 1\");\n $this->type(\"id=xvolutions_adminbundle_page_idalias\", \"test-menu-selenium-1\");\n $this->runScript(\"tinyMCE.activeEditor.setContent('Test Menu Selenium 1')\");\n $this->select(\"id=xvolutions_adminbundle_page_id_language\", \"label=Português\");\n $this->select(\"id=xvolutions_adminbundle_page_id_section\", \"label=Pública\");\n $this->select(\"id=xvolutions_adminbundle_page_id_status\", \"label=Publicado\");\n $this->click(\"id=xvolutions_adminbundle_page_Criar\");\n $this->waitForPageToLoad(\"30000\");\n $this->click(\"link=Criar uma nova página\");\n $this->waitForPageToLoad(\"30000\");\n $this->type(\"id=xvolutions_adminbundle_page_title\", \"Test Menu Selenium 2\");\n $this->type(\"id=xvolutions_adminbundle_page_idalias\", \"test-menu-selenium-2\");\n $this->runScript(\"tinyMCE.activeEditor.setContent('Test Menu Selenium 2')\");\n $this->select(\"id=xvolutions_adminbundle_page_id_language\", \"label=Português\");\n $this->select(\"id=xvolutions_adminbundle_page_id_section\", \"label=Pública\");\n $this->select(\"id=xvolutions_adminbundle_page_id_status\", \"label=Publicado\");\n $this->click(\"id=xvolutions_adminbundle_page_Criar\");\n $this->waitForPageToLoad(\"30000\");\n $this->clickAt(\"link=CMS\", \"\");\n $this->click(\"link=Menus\");\n $this->waitForPageToLoad(\"30000\");\n $this->isElementPresent(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-1.ui-state-default.ui-sortable-handle\");\n $this->assertElementContainsText(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-1.ui-state-default.ui-sortable-handle\", \"Test Menu Selenium 1\");\n $this->isElementPresent(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-2.ui-state-default.ui-sortable-handle\");\n $this->assertElementContainsText(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-2.ui-state-default.ui-sortable-handle\", \"Test Menu Selenium 2\");\n parent::logout();\n }", "public function network_admin_menu()\n\t{\n\t\treturn $this->admin_menu();\n\t}", "public function admin_menu() {\n\t\t// Load abstract page class.\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-page.php';\n\t\t// Load page classes.\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-general.php';\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-accounts.php';\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-messages.php';\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-categories.php';\n\n\t\t// Init menu classes.\n\t\tnew SocialFlow_Admin_Settings_General();\n\t\tnew SocialFlow_Admin_Settings_Accounts();\n\t\t// new SocialFlow_Admin_Settings_Categories.\n\t\t// new SocialFlow_Admin_Settings_Messages.\n\t}", "function admin_menu() {\n\t\tif ( class_exists( 'Jetpack' ) )\n\t\t\tadd_action( 'jetpack_admin_menu', array( $this, 'load_menu' ) );\n\t\telse\n\t\t\t$this->load_menu();\n\t}", "public function getMenu();", "public function onWpAdminMenu() {\n\t}" ]
[ "0.752425", "0.7481123", "0.7481123", "0.7481123", "0.7424119", "0.7341663", "0.73120207", "0.72790366", "0.72790366", "0.7277605", "0.7250286", "0.7166449", "0.7166398", "0.7162262", "0.70940125", "0.7069317", "0.7055192", "0.7049629", "0.7032223", "0.70124835", "0.70110583", "0.69848233", "0.69795877", "0.6949945", "0.6946648", "0.6940317", "0.6915004", "0.69133157", "0.69122756", "0.6898386" ]
0.7660423
0
Drop resources from view
protected function purge() { $this->view->dropResources(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function view_cleanup(){\n $url = sprintf(\"%s/%s\", $this->getUrl(), self::$_urls[\"view_cleanup\"]);\n return CouchNet::POST($url);\n }", "function drop() {}", "function drop() {}", "public function dropAllViews()\n {\n $this->connection->statement($this->grammar->compileDropAllViews());\n }", "public function dropAllViews()\n {\n $views = [];\n\n foreach ($this->getAllViews() as $row) {\n $row = (array) $row;\n\n $views[] = reset($row);\n }\n\n if (empty($views)) {\n return;\n }\n\n $this->connection->statement(\n $this->grammar->compileDropAllViews($views)\n );\n }", "public function dropAllViews()\n {\n $views = [];\n\n foreach ($this->getAllViews() as $row) {\n $row = (array) $row;\n\n $views[] = reset($row);\n }\n\n if (empty($views)) {\n return;\n }\n\n $this->connection->statement(\n $this->grammar->compileDropAllViews($views)\n );\n }", "public function dropAllViews()\n {\n $views = [];\n\n foreach ($this->getAllViews() as $row) {\n $row = (array)$row;\n\n $views[] = reset($row);\n }\n\n if (empty($views)) {\n return;\n }\n\n $this->getConnection()->statement(\n $this->grammar->compileDropAllViews($views)\n );\n }", "public function drop($view)\n {\n $blueprint = new Blueprint($view, $this->getConnection());\n\n $blueprint->drop();\n\n $this->build($blueprint);\n }", "private static function _dropTables()\n\t{\n\t\tMySQL::query(\"\n\t\t\tSET FOREIGN_KEY_CHECKS = 0;\n\t\t\tSET GROUP_CONCAT_MAX_LEN=32768;\n\t\t\tSET @views = NULL;\n\t\t\tSELECT GROUP_CONCAT('`', TABLE_NAME, '`') INTO @views\n\t\t\t FROM information_schema.views\n\t\t\t WHERE table_schema = (SELECT DATABASE());\n\t\t\tSELECT IFNULL(@views,'dummy') INTO @views;\n\n\t\t\tSET @views = CONCAT('DROP VIEW IF EXISTS ', @views);\n\t\t\tPREPARE stmt FROM @views;\n\t\t\tEXECUTE stmt;\n\t\t\tDEALLOCATE PREPARE stmt;\n\t\t\tSET FOREIGN_KEY_CHECKS = 1;\n\t\t\");\n\t}", "public function dropView($model)\n {\n\t$modelName= is_object($model) ? $model->getTableName() : $model;\n\t$hash= $this->fetchSingle('select hash from [views] where [name] = %s ',\n\t $modelName);\n\t$sql= array();\n\t$sql[] = $this->sql('delete from [views] where [name] = %s;', $modelName );\n\n\t$this->queue(\n\t PerfORMStorage::VIEW_DROP,\n\t $modelName,\n\t $sql,\n\t array(\n\t\t'model' => $model)\n\t );\n\n\n\t$key= $hash;\n\tif ( key_exists($key, $this->renamedViews))\n\t{\n\t $array= $this->renamedViews[$key];\n\t $array->counter++;\n\t $array->from= $modelName;\n\t}\n\telse\n\t{\n\t $this->renamedViews[$key]= (object) array(\n\t 'counter' => 1,\n\t 'from' => $modelName,\n\t );\n\t}\n }", "public function drop(): void;", "public function dropView($viewName, $schemaName, $ifExists=null){ }", "public function drop()\r\n {\r\n\r\n }", "function wppb_remove_rf_view_link( $actions ){\r\n\tglobal $post;\r\n\t\r\n\tif ( $post->post_type == 'wppb-rf-cpt' ){\r\n\t\tunset( $actions['view'] );\r\n\t\t\r\n\t\tif ( wppb_get_post_number ( $post->post_type, 'singular_action' ) )\r\n\t\t\tunset( $actions['trash'] );\r\n\t}\r\n\r\n\treturn $actions;\r\n}", "public function removeDesignFiles()\n {\n $this->designFiles()->detach();\n if ('scheduled' == $this->status) {\n $this->update([\n 'status' => 'incomplete'\n ]);\n }\n }", "function deletableResources(){\n\n return $this->resourcesByPermission('delete');\n }", "public function drop()\n {\n }", "public function htmleditorAction()\r\n {\r\n $this->_view->unsetMain();\r\n }", "public function tear_down(): void {\n\t\tremove_action( 'wp_body_open', [ $this->instance, 'embed_web_stories' ] );\n\n\t\tremove_theme_support( 'web-stories' );\n\n\t\tdelete_option( Customizer::STORY_OPTION );\n\t\tupdate_option( 'stylesheet', $this->stylesheet );\n\n\t\tparent::tear_down();\n\t}", "public static function cleanResources()\n {\n File::deleteDirectory(resource_path('sass'));\n File::delete(resource_path('js/app.js'));\n File::delete(resource_path('js/bootstrap.js'));\n }", "public function dropCollections()\n {\n $collections = $this->dbo->listCollections();\n foreach ($collections as $collection) {\n $collection->drop();\n }\n }", "public function doUnpublish() {\n\t\tif($this->Fields()) {\n\t\t\tforeach($this->Fields() as $field) {\n\t\t\t\t$field->doDeleteFromStage('Live');\n\t\t\t}\n\t\t}\n\t\t\n\t\tparent::doUnpublish();\n\t}", "public static function removeDefaultViews()\n {\n File::delete(resource_path('/views/home.blade.php'));\n File::delete(resource_path('/views/welcome.blade.php'));\n }", "public function remove() {\n\t\t$this->DispositionManager->remove();\n\t\t$this->autoRender = false;\n\t\t$this->redirect($this->refererStack(SYSTEM_CONSUME_REFERER));\n\t}", "public function Remove()\n {\n $file = __DIR__ . \\Extensions\\PHPImageWorkshop\\ImageWorkshop::UPLOAD_PATH . \"/banners/\" . $this->getSrc();\n if (file_exists($file)) {\n unlink($file);\n }\n parent::Remove();\n }", "public function cleanImagesAction()\n {\n parent::cleanImagesAction();\n $this->clearRespizrImageCache();\n }", "protected function tear_down()\n {\n unset($this->_object, $this->_view);\n }", "public function clearResources()\n {\n AM_Tools::clearContent($this->_getIssueHelpPage()->getThumbnailPresetType(), $this->_getIssueHelpPage()->id_issue);\n AM_Tools::clearResizerCache($this->_getIssueHelpPage()->getThumbnailPresetType(), $this->_getIssueHelpPage()->id_issue);\n }", "public function action_delete()\n\t{\n\t\t$view = View::factory('story/incomplete');\n\t\t$this->response->body($view);\n\t}", "public function drop ()\n {\n //delete the records of the lookup value\n $records = LookupValue::where('lookup_type_id', 1)->get();\n foreach ( $records as $record )\n $record->forceDelete();\n\n //delete the lookup definition itself\n $record = LookupType::find(1);\n $record->forceDelete();\n }" ]
[ "0.6106336", "0.5998302", "0.5998302", "0.5991642", "0.5807204", "0.5807204", "0.57931006", "0.5791971", "0.5757705", "0.5757012", "0.5712941", "0.570279", "0.5692462", "0.5556355", "0.5530578", "0.5501476", "0.54968584", "0.54851407", "0.54494286", "0.5393713", "0.53646934", "0.534992", "0.5344422", "0.5337445", "0.5329194", "0.53104115", "0.53049976", "0.52987415", "0.5296103", "0.5286987" ]
0.69780487
0
Append resource object to view
protected function addResource(Resource $resource) { $this->view->addResource($resource); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function viewAddResources()\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function add($request){\r\n return $this->view();\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function add($data, Resource $resource);", "public function addAction()\n {\n $this->templatelang->load($this->_controller.'.'.$this->_action);\n\n // Rendering view page\n $this->_view();\n }", "public function add_resources()\n\t{\n\t\t\n\t}", "private function _addResource()\n {\n //Add Resource\n $this->assets->collection('css_header')\n ->addCss('/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css');\n\n $this->assets->collection('js_footer')\n ->addJs('/plugins/nestable/jquery.nestable.js')\n ->addJs('/plugins/nestable/ui-nestable.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modal.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modalmanager.js')\n ->addJs('/templates/backend/default/js/ui-modals.js');\n }", "public function addResource($type, $object = null, ?\\SetaPDF_Core_Document $document = null) {}", "public function addAction() {\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function postAddResource()\n {\n\n $errors = validateAddResources();\n\n if(!($errors === true)) {\n\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n $this->_f3->reroute('/Admin');\n }\n\n }", "public function create()\n {\n return view('restful.add');\n }", "public function add() {\r\n if(isset($this->data) && isset($this->data['Product'])) {\r\n $product = $this->Product->save($this->data);\r\n $this->set('response', array('Products' => $this->Product->findByProductid($product['Product']['ProductID'])));\r\n $this->Links['self'] = Router::url(array('controller' => $this->name, 'action' => 'view', $product['Product']['ProductID']), true);\r\n } else {\r\n $this->Links['self'] = Router::url(array('controller' => $this->name, 'action' => 'index'), true);\r\n }\r\n }", "public function actionAdd() {\n $this->setView('edit');\n }", "public function add()\n {\n //renderView('add');\n }", "public function create()\n {\n return $this->_viewHelper->getCreateView(\n array_merge($this->_defaultData, [ 'fields' => $this->_loadResourceFields()])\n );\n }", "public function resourcecontentAction() {\n\t$resource_type = $this->_getParam('resource_type');\n\t$resource_id = $this->_getParam('resource_id');\n\t$is_spocerdStory = $this->_getParam('is_spocerdStory', null);\n\n\t$is_document = 0;\n\tif ($resource_type == 'document') {\n\t $is_document = 1;\n\t}\n \n if( strstr($resource_type, \"sitereview\") ) {\n // $resource_type = \"sitereview\";\n\n $sitereviewExplode = explode(\"_\", $resource_type);\n $tempAdModId = $sitereviewExplode[1];\n $module_info = Engine_Api::_()->getItem(\"communityad_module\", $tempAdModId);\n $tempModName = strtolower($module_info->module_title);\n $tempModName = ucfirst($module_info->module_title);\n \n $content_table = \"sitereview_listing\";\n $sub_title = \"View\" . \" \" . $tempModName;\n $content_data = Engine_Api::_()->getItem($content_table, $resource_id);\n }else {\n $field_info = Engine_Api::_()->getDbTable('modules', 'communityad')->getModuleInfo($resource_type);\n\n if (!empty($field_info)) {\n $content_data = Engine_Api::_()->getItem($field_info['table_name'], $resource_id);\n }\n }\n\n $base_url = Zend_Controller_Front::getInstance()->getBaseUrl();\n if( empty($sub_title) ) {\n $sub_title = Engine_Api::_()->communityad()->viewType($resource_type);\n }\n\t$photo_id_filepath = 0;\n\n\tif (empty($is_document)) {\n\t $photo_id_filepath = $content_data->getPhotoUrl('thumb.normal');\n\t} else {\n\t $photo_id_filepath = $content_data->thumbnail;\n\t}\n\n\tif (strstr($photo_id_filepath, '?')) {\n\t $explode_array = explode(\"?\", $photo_id_filepath);\n\t $photo_id_filepath = $explode_array[0];\n\t}\n\n\t$isCDN = Engine_Api::_()->seaocore()->isCdn();\n\n\tif (empty($isCDN)) {\n\t if (!empty($base_url)) {\n\t\t$photo_id_filepath = str_replace($base_url . '/', '', $photo_id_filepath);\n\t } else {\n\t\t$arrqay = explode('/', $photo_id_filepath);\n\t\tunset($arrqay[0]);\n\t\t$photo_id_filepath = implode('/', $arrqay);\n\t }\n\t}\n\n\tif (!empty($photo_id_filepath)) {\n\t if (strstr($photo_id_filepath, 'application/')) {\n\t\t$photo_id_filepath = 0;\n\t } else {\n\t\t$content_photo = $this->upload($photo_id_filepath, $is_document, $isCDN);\n\t }\n\t}\n\t// Set \"Title width\" acording to the module.\n\t$getStoryContentTitle = $title = $content_data->getTitle();\n\t$title_lenght = strlen($title);\n\t$tmpTitle = strip_tags($content_data->getTitle());\n\t$titleTruncationLimit = $title_truncation_limit = Engine_Api::_()->getApi('settings', 'core')->getSetting('ad.char.title', 25);\n\tif ($title_lenght > $title_truncation_limit) {\n\t $title_truncation_limit = $title_truncation_limit - 2;\n\t $title = Engine_String::strlen($tmpTitle) > $title_truncation_limit ? Engine_String::substr($tmpTitle, 0, $title_truncation_limit) : $tmpTitle;\n\t $title = $title . '..';\n\t}\n\n\t// Set \"Body width\" acording to the module.\n\t$body = $content_data->getDescription();\n\t$body_lenght = strlen($body);\n\t$tmpBody = strip_tags($content_data->getDescription());\n\t$body_truncation_limit = Engine_Api::_()->getApi('settings', 'core')->getSetting('ad.char.body', 135);\n\tif ($body_lenght > $body_truncation_limit) {\n\t $body_truncation_limit = $body_truncation_limit - 2;\n\t $body = Engine_String::strlen($tmpBody) > $body_truncation_limit ? Engine_String::substr($tmpBody, 0, $body_truncation_limit) : $tmpBody;\n\t $body = $body . '..';\n\t}\n\n\n\n\n\t$preview_title = $title . '<div class=\"cmaddis_adinfo\"><a href=\"javascript:void(0);\">' . $sub_title . '</a></div>';\n \t//$preview_title = $title . '<div class=\"cmaddis_adinfo cmad_show_tooltip_wrapper\" style=\"clear:none;\"><a href=\"javascript:void(0);\">' . $sub_title . '</a><div class=\"cmad_show_tooltip\"> <img src=\"./application/modules/Communityad/externals/images/tooltip_arrow.png\" />Viewers will be able to like this ad and its content. They will also be able to see how many people like this ad, and which friends like this ad.</div></div>';\n\n\t$remaning_body_limit = $body_truncation_limit - strlen($body);\n\tif ($remaning_body_limit < 0) {\n\t $remaning_body_limit = 0;\n\t}\n\t$remaning_title_limit = $title_truncation_limit - strlen($title);\n\tif ($remaning_title_limit < 0) {\n\t $remaning_title_limit = 0;\n\t}\n\n\t// Set the default image if no image selected.\n\tif (empty($content_photo)) {\n\t if (empty($is_spocerdStory)) {\n\t\t$path = $this->view->layout()->staticBaseUrl . '/application/modules/Communityad/externals/images/blankImage.png';\n\t\t$content_photo = '<img src=\"' . $path . '\" alt=\" \" />';\n\t } else {\n\t $content_photo = $this->view->itemPhoto($content_data, 'thumb.profile');\n\t if( in_array('music', array('music')) && in_array('blog', array('blog')) ) {\n\t $content_photo = $this->view->itemPhoto($content_data, 'thumb.icon');\n\t }\n\t }\n\t}\n\t$viewerTruncatedTitle = Engine_Api::_()->communityad()->truncation($this->_viewer->getTitle(), $titleTruncationLimit);\n\t\n\tif ($is_spocerdStory == 1) {\n\t $storyTrunLimit = Engine_Api::_()->getApi('settings', 'core')->getSetting('story.char.title', 35);\n\t $getStoryContentTitle = Engine_Api::_()->communityad()->truncation($getStoryContentTitle, $storyTrunLimit);\n\t $getTooltipTitle = $this->view->translate(\"_sponsored_viewer_title_tooltip\");\n\t $getContentTooltipTitle = $this->view->translate(\"_sponsored_content_title_tooltip\");\n\t $viewerTruncatedTitle = '<span class=\"cmad_show_tooltip_wrapper\"><b><a href=\"javascript:void(0);\">' . $viewerTruncatedTitle . '</a></b><div class=\"cmad_show_tooltip\"><img src=\"./application/modules/Communityad/externals/images/tooltip_arrow.png\" style=\"width:13px;height:9px;\" />'.$getTooltipTitle.'</div></span>';\n\t $main_div_title = $this->view->translate('%s likes <a href=\"javascript:void(0);\">%s.</a>', $viewerTruncatedTitle, $getStoryContentTitle);\n\t $footer_comment = '';\n\n$content_photo = '<a href=\"javascript:void(0);\">' . $content_photo . '</a><div class=\"cmad_show_tooltip\">\n\t\t\t\t\t\t\t<img src=\"./application/modules/Communityad/externals/images/tooltip_arrow.png\" />\n\t\t\t\t\t\t\t'. $this->view->translate(\"_sponsored_content_photo_tooltip\") .'\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>';\n\t}else {\n\t $title = Engine_Api::_()->communityad()->truncation($title, $titleTruncationLimit);\n\t}\n\n\tif (empty($is_spocerdStory)) {\n\t $this->view->id = $content_data->getIdentity();\n\t $this->view->title = $title;\n\t $this->view->resource_type = $resource_type;\n\t $this->view->des = $body;\n\t $this->view->page_url = $content_data->getHref();\n\t $this->view->photo = $content_photo;\n\t $this->view->preview_title = $preview_title;\n\t $this->view->remaning_body_text = $remaning_body_limit;\n\t $this->view->remaning_title_text = $remaning_title_limit;\n\t $this->view->photo_id_filepath = $photo_id_filepath;\n\t} else {\n\t $this->view->main_div_title = $main_div_title;\n\t $this->view->photo = $content_photo;\n\t $this->view->temp_pre_title = $getStoryContentTitle; \n\t $getStoryContentTitle = str_replace(' ', '&nbsp;', $getStoryContentTitle);\n\t $this->view->preview_title = $getStoryContentTitle; \n\t $this->view->footer_comment = $footer_comment;\n\t $this->view->remaning_title_text = $remaning_title_limit;\n\t $this->view->modTitle = $field_info['module_title'];\n\t}\n }", "public function addAction() {\n\t\t$this->_forward('edit', null, null, array('id' => 0, 'model' => $this->_getParam('model')));\n\t}", "public function get_add()\n { \n // Render the page\n View::make($this->bundle . '::product.add')->render();\n }", "public function add() {\n parent::add();\n \n if(!$this->request->is('restful')) {\n $this->set('title_for_layout', _txt('op.add-a', array($this->viewVars['vv_authenticator']['Authenticator']['description'])));\n }\n }", "public function add_new_resource() {\n // @codingStandardsIgnoreLine\n $add_resource_name = wc_clean( $_POST['add_resource_name'] );\n\n if ( empty( $add_resource_name ) ) {\n wp_send_json_error();\n }\n\n $resource = array(\n 'post_title' => $add_resource_name,\n 'post_content' => '',\n 'post_status' => 'publish',\n 'post_author' => dokan_get_current_user_id(),\n 'post_type' => 'bookable_resource',\n );\n $resource_id = wp_insert_post( $resource );\n $edit_url = dokan_get_navigation_url( 'booking' ) . 'resources/edit/?id=' . $resource_id;\n ob_start();\n ?>\n <tr>\n <td><a href=\"<?php echo $edit_url; ?>\"><?php echo $add_resource_name; ?></a></td>\n <td><?php esc_attr_e( 'N/A', 'dokan' ); ?></td>\n <td>\n <a class=\"dokan-btn dokan-btn-sm dokan-btn-theme\" href =\"<?php echo $edit_url; ?>\"><?php esc_attr_e( 'Edit', 'dokan' ); ?></a>\n <button class=\"dokan-btn dokan-btn-theme dokan-btn-sm btn-remove\" data-id=\"<?php echo $resource_id; ?>\"><?php esc_attr_e( 'Remove', 'dokan' ); ?></button>\n </td>\n </tr>\n\n <?php\n $output = ob_get_clean();\n wp_send_json_success( $output );\n }", "function add() \n {\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n \n // Render the action with template\n $this->renderWithTemplate('users/add', 'AdminPageBaseTemplate');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function addAction()\r\n {\r\n $form = $this->getEditItemForm();\r\n $response = $this->getResponse();\r\n $content = $this->renderViewModel('dots-nav-block/item-add', array('form' => $form));\r\n $response->setContent($content);\r\n return $response;\r\n }", "public function addAction(){\n\t\t$this->assign('roots', $this->roots);\n\t\t$this->assign('parents', $this->parents);\n\t}", "public function add_record()\n {\n $data['main_content'] = $this->type.'/'.$this->viewname.'/add';\n\t $this->load->view($this->type.'/assets/template',$data);\n }", "public function addAction()\n {\n $form = $this->getForm('create');\n $entity = new Entity\\CourtClosing();\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n $view = new ViewModel();\n $view->form = $form;\n\n return $view;\n }", "public function refresh()\n {\n // Several refresh() calls might happen during one request. If that is the case, the Resource Manager can't know\n // that the first created resource object doesn't have to be persisted / published anymore. Thus we need to\n // delete the resource manually in order to avoid orphaned resource objects:\n if ($this->resource !== null) {\n $this->resourceManager->deleteResource($this->resource);\n }\n\n parent::refresh();\n $this->renderResource();\n }", "public function add()\n\t{\n\t\t$this->template('crud/add');\t\n\t}", "public function getAdd($setId) \n\t{\n\t\t$data[\"setId\"] = $setId;\n\n\t\treturn View::make('object.add',$data);\n\t}" ]
[ "0.6190671", "0.5907594", "0.5898498", "0.58954614", "0.5794102", "0.57846975", "0.5708292", "0.5700842", "0.56308055", "0.5605061", "0.5599683", "0.55966836", "0.5530102", "0.5522637", "0.5499434", "0.54967964", "0.54694647", "0.54599434", "0.5446067", "0.5438202", "0.54322845", "0.5420131", "0.5387026", "0.5384342", "0.5353666", "0.5343772", "0.53366905", "0.53285056", "0.5324493", "0.5321859" ]
0.66808176
0
/ | | Examination Center |
public function exam_centers() { $center = Exam_centers::all(); $data['center'] = $center; return view('admin.exam_centres', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function examcenter() {\n $data['result'] = $this->commodel->get_list('admissionstudent_enterenceexamcenter');\n $this->logger->write_logmessage(\"view\",\" View Exam Center\", \"Exam Center details...\");\n $this->logger->write_dblogmessage(\"view\",\" View Exam Center\" , \"Exam Center record display successfully...\" );\n $this->load->view('enterenceadmin/examcenter',$data);\n }", "public function hcenter() {\n\t}", "function getCenter() {return $this->_center;}", "public function return_islamic_centers_for_Rating(){\n return IslamicCenter::return_islamic_centers_for_Rating();\n }", "public function getConfineArea() {\n return $this->_confine; \n }", "public function getOperatingCentre()\n {\n return $this->operatingCentre;\n }", "public function centreForTourismAndHospitality(){\n $name = 'CENTER FOR TOURISIM AND HOSPITALITY';\n $title = 'CTH';\n\t\t$students = DB::table('students')\n ->where('students.faculty', '=', 'CTH')->where('state', '=', 'Activated')\n ->whereNotIn('students.studentNo', function($q){\n $q->select('students_studentNo')->from('charge');\n })->paginate(15);\n return view('staff/faculty', compact('name','title','students'));\n\t}", "public function getCenter()\n {\n return $this->center;\n }", "public static function review_center () \n { \n $html = null;\n\n load::view( 'admin/review/center' );\n $html .= review_center::form();\n\n return $html;\n }", "public function getCentroArea() {\n return $this->_centro; \n }", "public function getIntro();", "public function getCodeCentre(): ?string {\n return $this->codeCentre;\n }", "public function getCodeCentre(): ?string {\n return $this->codeCentre;\n }", "public function illustrationScore()\n {\n return $this->setRightOperand(PVar::ILLUSTRATION_SCORE);\n }", "public function show(ExpenceHead $expenceHead)\n {\n\n }", "public function gagnerExperience()\n {\n }", "public function getIndiceAem() {\n return $this->indiceAem;\n }", "public function concentration() {\n\t\t$pageTitle = 'Concentration';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/concentration.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function Emprunter()\n {\n // section -64--88-56-1-313d700b:16f04d7fd4a:-8000:00000000000009BA begin\n // section -64--88-56-1-313d700b:16f04d7fd4a:-8000:00000000000009BA end\n }", "function listYLineDiagramCenter($yleft, $ytop)\n{\n $result = array();\n $sum = $yleft + 25;\n for ($i=0; $i < 6; $i++) {;\n $result[] = array('ymargin_left_center' => $sum, 'ymargin_top_center' => $ytop);\n $sum += 50;\n }\n\n return $result;\n}", "public function getExam()\n {\n return Mage::registry('current_exam');\n }", "public static function help_inner () \n { \n $html = null;\n\n $top = __( 'Instruction Manual', 'label' );\n $inner = self::help_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'help', $top, $inner, $bottom );\n\n return $html;\n }", "public function getMedicalExaminationTitle(){\n return is_object($this->doc) ? ($this->doc->gte(Carbon::now()->startOfDay()) ? 'Medical examination is valid.' : 'Medical examination expired.') : 'Medical examination not supplied.';\n }", "function showIntro() {\n if (! $_SESSION[\"eligible\"]) {\n return $this->showStart();\n }\n $nexturl = $this->action . '?mode=details';\n $safety = $this->action . '?mode=safety';\n $extra = array('next' => $nexturl, 'safetyurl' => $safety);\n $output = $this->outputBoilerplate('introduction.html', $extra);\n return $output;\n }", "function get_center_name($centerId){\n\t\t\t$sql=\"SELECT exam_center_name FROM exam_center_setup WHERE exam_center_id=:Id\";\n\t\t\t$stmt = $this->dbConn->prepare($sql);\n\t\t\t$stmt->bindParam(\":Id\",$centerId);\n\t\t\tif ($stmt->execute()) {\n\t\t\t\t$result= $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\t\treturn $result['exam_center_name'];\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdie();\n\t\t\t\t}\n\t\t}", "public function showParticipatedChallenge() {\n\n if (Auth::guest()) {\n $response = array(\"status\" => false,\n \"error\" => \"unauthorized\");\n } else {\n\n $freelancer = Freelancer::find(Auth::user()->user_id);\n $challenges = $freelancer->challenges()->orderBy('updated_at', 'desc')->get();\n foreach ($challenges as $challenge) {\n\n $average = $freelancer->get_average_marks($challenge->challenge_id);\n $challenge->markAverage = $average == -1 ? '-' : number_format($average, 2);\n }\n }\n // dd($challenge);\n return view('challenges.indexWithMark', compact('challenges', 'criterions', 'freelancer'));\n }", "public function show(exam $exam)\n {\n //\n }", "function exam_marks() {\n if ($this->session->userdata('parent_login') != 1)\n redirect(base_url(), 'refresh');\n $year = $this->db->get_where('settings', array('type' => 'running_year'))->row()->description;\n\n $student_id = $this->session->userdata('parent_id');\n $page_data['student_id'] = $student_id;\n $page_data['teacher_id'] = $this->parents_model->get_student_id('teacher_id', $student_id);\n $page_data['exams'] = $this->parents_model->get_student_exams();\n foreach ($page_data['exams'] as $data) {\n $this->parents_model->create_exam_positions($page_data['teacher_id'], $data['exam_id'], $year);\n }$page_data['student'] = $this->db->get_where('student', array('student_id' => $student_id))->row()->name;\n $page_data['page_name'] = 'exam_marks';\n $image = $this->db->get_where('student', array('student_id' => $student_id))->row()->image;\n $image_url = $this->crud_model->get_image_url('student', $image);\n $page_data['parent_page_title'] = \"<img src='$image_url'\" . 'class=\"img-circle\"' . 'width=\"40\"' . \"/>\" . $page_data['student'];\n $page_data['page_title'] = $page_data['student'];\n $page_data['year'] = $year;\n $this->load->view('backend/index', $page_data);\n }", "public function execute(&$component, $input) {\n\t\t$nb_centers = SQLQuery::create()->select(\"ExamCenter\")->count(\"nb_centers\")->executeSingleValue();\n\n\t\tif ($nb_centers == 0) {\n\t\t\techo \"<center><i class='problem' style='padding:5px'>No exam center yet</i></center>\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// overview on exam centers\n\t\techo \"<div class='page_section_title2'>Exam Centers</div>\";\n\t\techo \"<div style='padding:0px 5px'>\";\n\t\techo $nb_centers.\" exam center\".($nb_centers>1?\"s\":\"\").\"<ul>\";\n\t\t$q = SQLQuery::create()->select(\"ExamSession\");\n\t\tPNApplication::$instance->calendar->joinCalendarEvent($q, \"ExamSession\", \"event\");\n\t\tPNApplication::$instance->calendar->whereEventInThePast($q, true);\n\t\t$nb_sessions_done = $q->count()->executeSingleValue(); \n\t\t$q = SQLQuery::create()->select(\"ExamSession\");\n\t\tPNApplication::$instance->calendar->joinCalendarEvent($q, \"ExamSession\", \"event\");\n\t\tPNApplication::$instance->calendar->whereEventInTheFuture($q, true);\n\t\t$nb_sessions_future = $q->count()->executeSingleValue();\n\t\techo \"<li>\".$nb_sessions_done.\" session\".($nb_sessions_done>1?\"s\":\"\").\" already done</li>\"; \n\t\techo \"<li>\".$nb_sessions_future.\" session\".($nb_sessions_future>1?\"s\":\"\").\" scheduled not yet done</li>\"; \n\t\techo \"</ul>\";\n\t\techo \"</div>\";\n\t\t\n\t\t// overview on linked information sessions\n\t\techo \"<div class='page_section_title2'>Information Sessions</div>\";\n\t\techo \"<div style='padding:0px 5px'>\";\n\t\t$total_nb_is = SQLQuery::create()->select(\"InformationSession\")->count(\"nb\")->executeSingleValue();\n\t\t$is_not_linked = SQLQuery::create()\n\t\t\t->select(\"InformationSession\")\n\t\t\t->join(\"InformationSession\", \"ExamCenterInformationSession\", array(\"id\"=>\"information_session\"))\n\t\t\t->whereNull(\"ExamCenterInformationSession\", \"exam_center\")\n\t\t\t->field(\"InformationSession\", \"id\")\n\t\t\t->executeSingleField();\n\t\tif (count($is_not_linked) == 0) {\n\t\t\techo \"<div class='ok'>All (\".$total_nb_is.\") linked to an exam center</div>\";\n\t\t} else {\n\t\t\techo \"<a href='#' class='need_action' onclick=\\\"popupFrame(null,'Link Information Sessions to Exam Centers','/dynamic/selection/page/exam/link_is_with_exam_center?onsaved=saved',null,null,null,function(frame,pop){frame.saved=loadExamCenterStatus;});return false;\\\">\".count($is_not_linked).\" not linked to an exam center</a><br/>\";\n\t\t}\n\t\techo \"</div>\";\n\t\t\n\t\t// overview on applicants\n\t\techo \"<div class='page_section_title2'>Applicants</div>\";\n\t\techo \"<div style='padding:0px 5px'>\";\n\t\t$nb_applicants_no_exam_center = SQLQuery::create()->select(\"Applicant\")->whereNotValue(\"Applicant\",\"automatic_exclusion_step\",\"Application Form\")->whereNull(\"Applicant\",\"exam_center\")->count(\"nb\")->executeSingleValue();\n\t\t$nb_applicants_ok = SQLQuery::create()->select(\"Applicant\")->whereNotValue(\"Applicant\",\"automatic_exclusion_step\",\"Application Form\")->whereNotNull(\"Applicant\",\"exam_center\")->whereNotNull(\"Applicant\", \"exam_session\")->count(\"nb\")->executeSingleValue();\n\t\t\n\t\t$applicants_no_schedule = SQLQuery::create()\n\t\t\t->select(\"Applicant\")\n\t\t\t->whereNotNull(\"Applicant\",\"exam_center\")\n\t\t\t->whereNull(\"Applicant\", \"exam_session\")\n\t\t\t->whereNotValue(\"Applicant\",\"automatic_exclusion_step\",\"Application Form\")\n\t\t\t->groupBy(\"Applicant\", \"exam_center\")\n\t\t\t->countOneField(\"Applicant\", \"people\", \"nb\")\n\t\t\t->join(\"Applicant\", \"ExamCenter\", array(\"exam_center\"=>\"id\"))\n\t\t\t->field(\"ExamCenter\", \"name\", \"center_name\")\n\t\t\t->field(\"ExamCenter\", \"id\", \"center_id\")\n\t\t\t->execute();\n\t\t$nb_applicants_no_schedule = 0;\n\t\tforeach ($applicants_no_schedule as $center) $nb_applicants_no_schedule += $center[\"nb\"];\n\n\t\t$total_applicants = $nb_applicants_ok + $nb_applicants_no_schedule + $nb_applicants_no_exam_center;\n\t\techo $total_applicants.\" applicant(s)<ul style='padding-left:20px'>\";\n\t\techo \"<li>\";\n\t\tif ($nb_applicants_no_exam_center == 0)\n\t\t\techo \"<span class='ok'>All are assigned to an exam center</span>\";\n\t\telse {\n\t\t\techo \"<a class='problem' href='#' onclick='applicantsNotLinkedToExamCenter();return false;'>\".$nb_applicants_no_exam_center.\" not assigned to an exam center</a>\";\n\t\t\t?>\n\t\t\t<script type='text/javascript'>\n\t\t\tfunction applicantsNotLinkedToExamCenter() {\n\t\t\t\tpostData('/dynamic/selection/page/applicant/list', {\n\t\t\t\t\ttitle: \"Applicants without Exam Center\",\n\t\t\t\t\tfilters: [\n\t\t\t\t\t\t{category:\"Selection\",name:\"Excluded\",force:true,data:{values:[0]}},\n\t\t\t\t\t\t{category:\"Selection\",name:\"Exam Center\",force:true,data:{values:['NULL']}}\n\t\t\t\t\t]\n\t\t\t\t});\n\t\t\t}\n\t\t\t</script>\n\t\t\t<?php \n\t\t}\n\t\techo \"</li>\";\n\t\tif ($nb_applicants_no_schedule > 0 || $total_applicants > $nb_applicants_no_exam_center) {\n\t\t\techo \"<li>\";\n\t\t\tif ($nb_applicants_no_schedule == 0)\n\t\t\t\techo \"<span class='ok'>All \".($nb_applicants_no_exam_center > 0 ? \"assigned \": \"\").\"have a schedule</span>\";\n\t\t\telse {\n\t\t\t\techo \"<a class='problem' href='#' onclick='applicantsNoSchedule(this);return false;'>\".$nb_applicants_no_schedule.\" don't have a schedule</a>\";\n\t\t\t\t?>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\tfunction applicantsNoSchedule(link) {\n\t\t\t\t\trequire(\"context_menu.js\",function() {\n\t\t\t\t\t\tvar menu = new context_menu();\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ($applicants_no_schedule as $center) {\n\t\t\t\t\t\t\techo \"menu.addIconItem(null,\".json_encode($center[\"nb\"].\" applicant(s) in \".$center[\"center_name\"]).\",function() {\";\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\twindow.top.popupFrame('/static/selection/exam/exam_center_16.png','Exam Center','/dynamic/selection/page/exam/center_profile?onsaved=saved&id=<?php echo $center[\"center_id\"];?>',null,95,95,function(frame,pop) {\n\t\t\t\t\t\t\t\tframe.saved = function() { if (window.refreshPage) window.refreshPage(); else window.loadExamCenterStatus(); };\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\techo \"});\\n\";\n\t\t\t\t\t\t} \n\t\t\t\t\t\t?>\n\t\t\t\t\t\tmenu.showBelowElement(link);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t\t<?php \n\t\t\t}\n\t\t}\n\t\techo \"</li>\";\n\t\techo \"</ul>\";\n\t\techo \"</div>\";\n\t}", "function annotation_user_outline($course, $user, $mod, $annotation) {\n\n $return = new stdClass();\n $return->time = 0;\n $return->info = '';\n return $return;\n}" ]
[ "0.60756505", "0.5868545", "0.570762", "0.53841984", "0.52177703", "0.52071834", "0.5203397", "0.5188887", "0.5149242", "0.50735646", "0.5058717", "0.50174075", "0.50174075", "0.5000207", "0.49794102", "0.49238387", "0.48777232", "0.48601595", "0.48596692", "0.48465842", "0.4840406", "0.48246118", "0.48241454", "0.4821242", "0.4816029", "0.47896865", "0.47830418", "0.4778449", "0.47641194", "0.47504723" ]
0.5875832
1
Validate the Font Awesome power transforms.
public static function validatePowerTransforms($element, FormStateInterface $form_state) { $values = $form_state->getValue($element['#parents']); if (!empty($values['type']) && empty($values['value'])) { $form_state->setError($element, t('Missing value for Font Awesome Power Transform %value. Please see @iconLink for information on correct values.', [ '%value' => $values['type'], '@iconLink' => Link::fromTextAndUrl(t('the Font Awesome icon list'), Url::fromUri('https://fontawesome.com/how-to-use/svg-with-js'))->toString(), ])); } elseif (empty($values['type']) && !empty($values['value'])) { $form_state->setError($element, t('Missing type value for Font Awesome Power Transform. Please see @iconLink for information on correct values.', [ '@iconLink' => Link::fromTextAndUrl(t('the Font Awesome icon list'), Url::fromUri('https://fontawesome.com/how-to-use/svg-with-js'))->toString(), ])); } if (!empty($values['value']) && !is_numeric($values['value'])) { $form_state->setError($element, t("Invalid value for Font Awesome Power Transform %value. Please see @iconLink for information on correct values.", [ '%value' => $values['type'], '@iconLink' => Link::fromTextAndUrl(t('the Font Awesome icon list'), Url::fromUri('https://fontawesome.com/how-to-use/svg-with-js'))->toString(), ])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isXfaForm() {}", "public static function validateIconName($element, FormStateInterface $form_state) {\n // Load the configuration settings.\n $configuration_settings = \\Drupal::config('fontawesome.settings');\n // Check if we need to bypass.\n if ($configuration_settings->get('bypass_validation')) {\n return;\n }\n\n $value = $element['#value'];\n if (strlen($value) == 0) {\n $form_state->setValueForElement($element, '');\n return;\n }\n\n // Load the icon data so we can check for a valid icon.\n $iconData = \\Drupal::service('fontawesome.font_awesome_manager')->getIconMetadata($value);\n\n if (!isset($iconData['name'])) {\n $form_state->setError($element, t(\"Invalid icon name %value. Please see @iconLink for correct icon names, or turn off validation in the Font Awesome settings if you are trying to use custom icon names.\", [\n '%value' => $value,\n '@iconLink' => Link::fromTextAndUrl(t('the Font Awesome icon list'), Url::fromUri('https://fontawesome.com/icons'))->toString(),\n ]));\n }\n }", "function check_fa4_styles() {\n\n\t\tglobal $wp_styles;\n\t\tforeach ( $wp_styles->queue as $style ) {\n\t\t\tif ( strstr( $wp_styles->registered[ $style ]->src, 'font-awesome.min.css' ) ) {\n\t\t\t\tupdate_option( 'hestia_load_shim', 'yes' );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function enqueue_font_awesome() {\n\t\tglobal $hestia_load_fa;\n\n\t\tif ( $hestia_load_fa !== true ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twp_enqueue_style( 'font-awesome-5-all', get_template_directory_uri() . '/assets/font-awesome/css/all.min.css', array(), HESTIA_VENDOR_VERSION );\n\t\tif ( $this->should_load_shim() ) {\n\t\t\twp_enqueue_style( 'font-awesome-4-shim', get_template_directory_uri() . '/assets/font-awesome/css/v4-shims.min.css', array(), HESTIA_VENDOR_VERSION );\n\t\t}\n\n\t\treturn true;\n\t}", "function gotravel_mikado_is_font_option_valid($option_name) {\n\t\treturn $option_name !== '-1' && $option_name !== '';\n\t}", "function TS_VCSC_IconFontsRequired() {\r\n\t\t\tif (($this->TS_VCSC_PluginFontSummary == \"true\") || ($this->TS_VCSC_VisualComposer_Loading == \"true\") || ($this->TS_VCSC_VCFrontEditMode == \"true\") || ($this->TS_VCSC_Icons_Compliant_Loading == \"true\") || ($this->TS_VCSC_IconicumMenuGenerator == \"true\")) {\r\n\t\t\t\t$this->TS_VCSC_IconFontsArrays(false);\r\n\t\t\t}\r\n\t\t}", "function maybe_enqueue_font_awesome( $field )\n\t{\n\t\tif( 'font-awesome' == $field['type'] && $field['enqueue_fa'] ) {\n\t\t\tadd_action( 'wp_footer', array( $this, 'frontend_enqueue_scripts' ) );\n\t\t}\n\n\t\treturn $field;\n\t}", "protected function isTrueTypeFontWorking() {}", "public static function fontawesome_bwc($icon){\n $old_to_new = array(\n 'address-book-o' => 'address-book', 'address-card-o' => 'address-card', 'area-chart' => 'chart-area', 'arrow-circle-o-down' => 'arrow-alt-circle-down', 'arrow-circle-o-left' => 'arrow-alt-circle-left', 'arrow-circle-o-right' => 'arrow-alt-circle-right', 'arrow-circle-o-up' => 'arrow-alt-circle-up', 'arrows' => 'arrows-alt', 'arrows-alt' => 'expand-arrows-alt', 'arrows-h' => 'arrows-alt-h', 'arrows-v' => 'arrows-alt-v', 'asl-interpreting' => 'american-sign-language-interpreting', 'automobile' => 'car', 'bank' => 'university', 'bar-chart' => 'chart-bar', 'bar-chart-o' => 'chart-bar', 'bathtub' => 'bath', 'battery' => 'battery-full', 'battery-0' => 'battery-empty', 'battery-1' => 'battery-quarter', 'battery-2' => 'battery-half', 'battery-3' => 'battery-three-quarters', 'battery-4' => 'battery-full', 'bell-o' => 'bell', 'bell-slash-o' => 'bell-slash', 'bitbucket-square' => 'bitbucket', 'bitcoin' => 'btc', 'bookmark-o' => 'bookmark', 'building-o' => 'building', 'cab' => 'taxi', 'calendar' => 'calendar-alt', 'calendar-check-o' => 'calendar-check', 'calendar-minus-o' => 'calendar-minus', 'calendar-o' => 'calendar', 'calendar-plus-o' => 'calendar-plus', 'calendar-times-o' => 'calendar-times', 'caret-square-o-down' => 'caret-square-down', 'caret-square-o-left' => 'caret-square-left', 'caret-square-o-right' => 'caret-square-right', 'caret-square-o-up' => 'caret-square-up', 'cc' => 'closed-captioning', 'chain' => 'link', 'chain-broken' => 'unlink', 'check-circle-o' => 'check-circle', 'check-square-o' => 'check-square', 'circle-o' => 'circle', 'circle-o-notch' => 'circle-notch', 'circle-thin' => 'circle', 'clock-o' => 'clock', 'close' => 'times', 'cloud-download' => 'cloud-download-alt', 'cloud-upload' => 'cloud-upload-alt', 'cny' => 'yen-sign', 'code-fork' => 'code-branch', 'comment-o' => 'comment', 'commenting' => 'comment-dots', 'commenting-o' => 'comment-dots', 'comments-o' => 'comments', 'credit-card-alt' => 'credit-card', 'cutlery' => 'utensils', 'dashboard' => 'tachometer-alt', 'deafness' => 'deaf', 'dedent' => 'outdent', 'diamond' => 'gem', 'dollar' => 'dollar-sign', 'dot-circle-o' => 'dot-circle', 'drivers-license' => 'id-card', 'drivers-license-o' => 'id-card', 'eercast' => 'sellcast', 'envelope-o' => 'envelope', 'envelope-open-o' => 'envelope-open', 'eur' => 'euro-sign', 'euro' => 'euro-sign', 'exchange' => 'exchange-alt', 'external-link' => 'external-link-alt', 'external-link-square' => 'external-link-square-alt', 'eyedropper' => 'eye-dropper', 'fa' => 'font-awesome', 'facebook' => 'facebook-f', 'facebook-official' => 'facebook', 'feed' => 'rss', 'file-archive-o' => 'file-archive', 'file-audio-o' => 'file-audio', 'file-code-o' => 'file-code', 'file-excel-o' => 'file-excel', 'file-image-o' => 'file-image', 'file-movie-o' => 'file-video', 'file-o' => 'file', 'file-pdf-o' => 'file-pdf', 'file-photo-o' => 'file-image', 'file-picture-o' => 'file-image', 'file-powerpoint-o' => 'file-powerpoint', 'file-sound-o' => 'file-audio', 'file-text' => 'file-alt', 'file-text-o' => 'file-alt', 'file-video-o' => 'file-video', 'file-word-o' => 'file-word', 'file-zip-o' => 'file-archive', 'files-o' => 'copy', 'flag-o' => 'flag', 'flash' => 'bolt', 'floppy-o' => 'save', 'folder-o' => 'folder', 'folder-open-o' => 'folder-open', 'frown-o' => 'frown', 'futbol-o' => 'futbol', 'gbp' => 'pound-sign', 'ge' => 'empire', 'gear' => 'cog', 'gears' => 'cogs', 'gittip' => 'gratipay', 'glass' => 'glass-martini', 'google-plus' => 'google-plus-g', 'google-plus-circle' => 'google-plus', 'google-plus-official' => 'google-plus', 'group' => 'users', 'hand-grab-o' => 'hand-rock', 'hand-lizard-o' => 'hand-lizard', 'hand-o-down' => 'hand-point-down', 'hand-o-left' => 'hand-point-left', 'hand-o-right' => 'hand-point-right', 'hand-o-up' => 'hand-point-up', 'hand-paper-o' => 'hand-paper', 'hand-peace-o' => 'hand-peace', 'hand-pointer-o' => 'hand-pointer', 'hand-rock-o' => 'hand-rock', 'hand-scissors-o' => 'hand-scissors', 'hand-spock-o' => 'hand-spock', 'hand-stop-o' => 'hand-paper', 'handshake-o' => 'handshake', 'hard-of-hearing' => 'deaf', 'hdd-o' => 'hdd', 'header' => 'heading', 'heart-o' => 'heart', 'hospital-o' => 'hospital', 'hotel' => 'bed', 'hourglass-1' => 'hourglass-start', 'hourglass-2' => 'hourglass-half', 'hourglass-3' => 'hourglass-end', 'hourglass-o' => 'hourglass', 'id-card-o' => 'id-card', 'ils' => 'shekel-sign', 'inr' => 'rupee-sign', 'institution' => 'university', 'intersex' => 'transgender', 'jpy' => 'yen-sign', 'keyboard-o' => 'keyboard', 'krw' => 'won-sign', 'legal' => 'gavel', 'lemon-o' => 'lemon', 'level-down' => 'level-down-alt', 'level-up' => 'level-up-alt', 'life-bouy' => 'life-ring', 'life-buoy' => 'life-ring', 'life-saver' => 'life-ring', 'lightbulb-o' => 'lightbulb', 'line-chart' => 'chart-line', 'linkedin' => 'linkedin-in', 'linkedin-square' => 'linkedin', 'long-arrow-down' => 'long-arrow-alt-down', 'long-arrow-left' => 'long-arrow-alt-left', 'long-arrow-right' => 'long-arrow-alt-right', 'long-arrow-up' => 'long-arrow-alt-up', 'mail-forward' => 'share', 'mail-reply' => 'reply', 'mail-reply-all' => 'reply-all', 'map-marker' => 'map-marker-alt', 'map-o' => 'map', 'meanpath' => 'font-awesome', 'meh-o' => 'meh', 'minus-square-o' => 'minus-square', 'mobile' => 'mobile-alt', 'mobile-phone' => 'mobile-alt', 'money' => 'money-bill-alt', 'moon-o' => 'moon', 'mortar-board' => 'graduation-cap', 'navicon' => 'bars', 'newspaper-o' => 'newspaper', 'paper-plane-o' => 'paper-plane', 'paste' => 'clipboard', 'pause-circle-o' => 'pause-circle', 'pencil' => 'pencil-alt', 'pencil-square' => 'pen-square', 'pencil-square-o' => 'edit', 'photo' => 'image', 'picture-o' => 'image', 'pie-chart' => 'chart-pie', 'play-circle-o' => 'play-circle', 'plus-square-o' => 'plus-square', 'question-circle-o' => 'question-circle', 'ra' => 'rebel', 'refresh' => 'sync', 'remove' => 'times', 'reorder' => 'bars', 'repeat' => 'redo', 'resistance' => 'rebel', 'rmb' => 'yen-sign', 'rotate-left' => 'undo', 'rotate-right' => 'redo', 'rouble' => 'ruble-sign', 'rub' => 'ruble-sign', 'ruble' => 'ruble-sign', 'rupee' => 'rupee-sign', 's15' => 'bath', 'scissors' => 'cut', 'send' => 'paper-plane', 'send-o' => 'paper-plane', 'share-square-o' => 'share-square', 'shekel' => 'shekel-sign', 'sheqel' => 'shekel-sign', 'shield' => 'shield-alt', 'sign-in' => 'sign-in-alt', 'sign-out' => 'sign-out-alt', 'signing' => 'sign-language', 'sliders' => 'sliders-h', 'smile-o' => 'smile', 'snowflake-o' => 'snowflake', 'soccer-ball-o' => 'futbol', 'sort-alpha-asc' => 'sort-alpha-down', 'sort-alpha-desc' => 'sort-alpha-up', 'sort-amount-asc' => 'sort-amount-down', 'sort-amount-desc' => 'sort-amount-up', 'sort-asc' => 'sort-up', 'sort-desc' => 'sort-down', 'sort-numeric-asc' => 'sort-numeric-down', 'sort-numeric-desc' => 'sort-numeric-up', 'spoon' => 'utensil-spoon', 'square-o' => 'square', 'star-half-empty' => 'star-half', 'star-half-full' => 'star-half', 'star-half-o' => 'star-half', 'star-o' => 'star', 'sticky-note-o' => 'sticky-note', 'stop-circle-o' => 'stop-circle', 'sun-o' => 'sun', 'support' => 'life-ring', 'tablet' => 'tablet-alt', 'tachometer' => 'tachometer-alt', 'television' => 'tv', 'thermometer' => 'thermometer-full', 'thermometer-0' => 'thermometer-empty', 'thermometer-1' => 'thermometer-quarter', 'thermometer-2' => 'thermometer-half', 'thermometer-3' => 'thermometer-three-quarters', 'thermometer-4' => 'thermometer-full', 'thumb-tack' => 'thumbtack', 'thumbs-o-down' => 'thumbs-down', 'thumbs-o-up' => 'thumbs-up', 'ticket' => 'ticket-alt', 'times-circle-o' => 'times-circle', 'times-rectangle' => 'window-close', 'times-rectangle-o' => 'window-close', 'toggle-down' => 'caret-square-down', 'toggle-left' => 'caret-square-left', 'toggle-right' => 'caret-square-right', 'toggle-up' => 'caret-square-up', 'trash' => 'trash-alt', 'trash-o' => 'trash-alt', 'try' => 'lira-sign', 'turkish-lira' => 'lira-sign', 'unsorted' => 'sort', 'usd' => 'dollar-sign', 'user-circle-o' => 'user-circle', 'user-o' => 'user', 'vcard' => 'address-card', 'vcard-o' => 'address-card', 'video-camera' => 'video', 'vimeo' => 'vimeo-v', 'volume-control-phone' => 'phone-volume', 'warning' => 'exclamation-triangle', 'wechat' => 'weixin', 'wheelchair-alt' => 'accessible-icon', 'window-close-o' => 'window-close', 'won' => 'won-sign', 'y-combinator-square' => 'hacker-news', 'yc' => 'y-combinator', 'yc-square' => 'hacker-news', 'yen' => 'yen-sign', 'youtube-play' => 'youtube',\n );\n // Return new if found\n if(isset($old_to_new[$icon])){\n return $old_to_new[$icon];\n } \n // Otherwise just return original\n return $icon;\n }", "function demo_plugin_font_awesome() {\n\t\twp_enqueue_style( 'load-fa', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css' );\n\t\twp_enqueue_style( 'load-select2-css', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.4/css/select2.min.css' );\n\t\twp_enqueue_script( 'load-select2-js', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.4/js/select2.min.js' );\n\t\twp_enqueue_style( 'load-datatables-css', 'https://cdn.datatables.net/1.10.16/css/jquery.dataTables.css' );\n\t\twp_enqueue_script( 'load-datatables-js', 'https://cdn.datatables.net/1.10.16/js/jquery.dataTables.js' );\n\t\twp_enqueue_script( 'load-datepicker-js', 'https://code.jquery.com/ui/1.12.1/jquery-ui.js' );\n\t\twp_enqueue_style( 'load-datepicker-css', 'https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css' );\n\t}", "function font_awesome()\n{\n wp_enqueue_style(\"font_awesome\", \"//use.fontawesome.com/releases/v5.6.3/css/all.css\");\n}", "public function icons() {\n\n\t\t$solid_icons = array(\n\t\t\t\"fas-f641\" => \"fas fa-ad\",\n\t\t\t\"fas-f2b9\" => \"fas fa-address-book\",\n\t\t\t\"fas-f2bb\" => \"fas fa-address-card\",\n\t\t\t\"fas-f042\" => \"fas fa-adjust\",\n\t\t\t\"fas-f5d0\" => \"fas fa-air-freshener\",\n\t\t\t\"fas-f037\" => \"fas fa-align-center\",\n\t\t\t\"fas-f039\" => \"fas fa-align-justify\",\n\t\t\t\"fas-f036\" => \"fas fa-align-left\",\n\t\t\t\"fas-f038\" => \"fas fa-align-right\",\n\t\t\t\"fas-f461\" => \"fas fa-allergies\",\n\t\t\t\"fas-f0f9\" => \"fas fa-ambulance\",\n\t\t\t\"fas-f2a3\" => \"fas fa-american-sign-language-interpreting\",\n\t\t\t\"fas-f13d\" => \"fas fa-anchor\",\n\t\t\t\"fas-f103\" => \"fas fa-angle-double-down\",\n\t\t\t\"fas-f100\" => \"fas fa-angle-double-left\",\n\t\t\t\"fas-f101\" => \"fas fa-angle-double-right\",\n\t\t\t\"fas-f102\" => \"fas fa-angle-double-up\",\n\t\t\t\"fas-f107\" => \"fas fa-angle-down\",\n\t\t\t\"fas-f104\" => \"fas fa-angle-left\",\n\t\t\t\"fas-f105\" => \"fas fa-angle-right\",\n\t\t\t\"fas-f106\" => \"fas fa-angle-up\",\n\t\t\t\"fas-f556\" => \"fas fa-angry\",\n\t\t\t\"fas-f644\" => \"fas fa-ankh\",\n\t\t\t\"fas-f5d1\" => \"fas fa-apple-alt\",\n\t\t\t\"fas-f187\" => \"fas fa-archive\",\n\t\t\t\"fas-f557\" => \"fas fa-archway\",\n\t\t\t\"fas-f358\" => \"fas fa-arrow-alt-circle-down\",\n\t\t\t\"fas-f359\" => \"fas fa-arrow-alt-circle-left\",\n\t\t\t\"fas-f35a\" => \"fas fa-arrow-alt-circle-right\",\n\t\t\t\"fas-f35b\" => \"fas fa-arrow-alt-circle-up\",\n\t\t\t\"fas-f0ab\" => \"fas fa-arrow-circle-down\",\n\t\t\t\"fas-f0a8\" => \"fas fa-arrow-circle-left\",\n\t\t\t\"fas-f0a9\" => \"fas fa-arrow-circle-right\",\n\t\t\t\"fas-f0aa\" => \"fas fa-arrow-circle-up\",\n\t\t\t\"fas-f063\" => \"fas fa-arrow-down\",\n\t\t\t\"fas-f060\" => \"fas fa-arrow-left\",\n\t\t\t\"fas-f061\" => \"fas fa-arrow-right\",\n\t\t\t\"fas-f062\" => \"fas fa-arrow-up\",\n\t\t\t\"fas-f0b2\" => \"fas fa-arrows-alt\",\n\t\t\t\"fas-f337\" => \"fas fa-arrows-alt-h\",\n\t\t\t\"fas-f338\" => \"fas fa-arrows-alt-v\",\n\t\t\t\"fas-f2a2\" => \"fas fa-assistive-listening-systems\",\n\t\t\t\"fas-f069\" => \"fas fa-asterisk\",\n\t\t\t\"fas-f1fa\" => \"fas fa-at\",\n\t\t\t\"fas-f558\" => \"fas fa-atlas\",\n\t\t\t\"fas-f5d2\" => \"fas fa-atom\",\n\t\t\t\"fas-f29e\" => \"fas fa-audio-description\",\n\t\t\t\"fas-f559\" => \"fas fa-award\",\n\t\t\t\"fas-f77c\" => \"fas fa-baby\",\n\t\t\t\"fas-f77d\" => \"fas fa-baby-carriage\",\n\t\t\t\"fas-f55a\" => \"fas fa-backspace\",\n\t\t\t\"fas-f04a\" => \"fas fa-backward\",\n\t\t\t\"fas-f7e5\" => \"fas fa-bacon\",\n\t\t\t\"fas-f666\" => \"fas fa-bahai\",\n\t\t\t\"fas-f24e\" => \"fas fa-balance-scale\",\n\t\t\t\"fas-f515\" => \"fas fa-balance-scale-left\",\n\t\t\t\"fas-f516\" => \"fas fa-balance-scale-right\",\n\t\t\t\"fas-f05e\" => \"fas fa-ban\",\n\t\t\t\"fas-f462\" => \"fas fa-band-aid\",\n\t\t\t\"fas-f02a\" => \"fas fa-barcode\",\n\t\t\t\"fas-f0c9\" => \"fas fa-bars\",\n\t\t\t\"fas-f433\" => \"fas fa-baseball-ball\",\n\t\t\t\"fas-f434\" => \"fas fa-basketball-ball\",\n\t\t\t\"fas-f2cd\" => \"fas fa-bath\",\n\t\t\t\"fas-f244\" => \"fas fa-battery-empty\",\n\t\t\t\"fas-f240\" => \"fas fa-battery-full\",\n\t\t\t\"fas-f242\" => \"fas fa-battery-half\",\n\t\t\t\"fas-f243\" => \"fas fa-battery-quarter\",\n\t\t\t\"fas-f241\" => \"fas fa-battery-three-quarters\",\n\t\t\t\"fas-f236\" => \"fas fa-bed\",\n\t\t\t\"fas-f0fc\" => \"fas fa-beer\",\n\t\t\t\"fas-f0f3\" => \"fas fa-bell\",\n\t\t\t\"fas-f1f6\" => \"fas fa-bell-slash\",\n\t\t\t\"fas-f55b\" => \"fas fa-bezier-curve\",\n\t\t\t\"fas-f647\" => \"fas fa-bible\",\n\t\t\t\"fas-f206\" => \"fas fa-bicycle\",\n\t\t\t\"fas-f84a\" => \"fas fa-biking\",\n\t\t\t\"fas-f1e5\" => \"fas fa-binoculars\",\n\t\t\t\"fas-f780\" => \"fas fa-biohazard\",\n\t\t\t\"fas-f1fd\" => \"fas fa-birthday-cake\",\n\t\t\t\"fas-f517\" => \"fas fa-blender\",\n\t\t\t\"fas-f6b6\" => \"fas fa-blender-phone\",\n\t\t\t\"fas-f29d\" => \"fas fa-blind\",\n\t\t\t\"fas-f781\" => \"fas fa-blog\",\n\t\t\t\"fas-f032\" => \"fas fa-bold\",\n\t\t\t\"fas-f0e7\" => \"fas fa-bolt\",\n\t\t\t\"fas-f1e2\" => \"fas fa-bomb\",\n\t\t\t\"fas-f5d7\" => \"fas fa-bone\",\n\t\t\t\"fas-f55c\" => \"fas fa-bong\",\n\t\t\t\"fas-f02d\" => \"fas fa-book\",\n\t\t\t\"fas-f6b7\" => \"fas fa-book-dead\",\n\t\t\t\"fas-f7e6\" => \"fas fa-book-medical\",\n\t\t\t\"fas-f518\" => \"fas fa-book-open\",\n\t\t\t\"fas-f5da\" => \"fas fa-book-reader\",\n\t\t\t\"fas-f02e\" => \"fas fa-bookmark\",\n\t\t\t\"fas-f84c\" => \"fas fa-border-all\",\n\t\t\t\"fas-f850\" => \"fas fa-border-none\",\n\t\t\t\"fas-f853\" => \"fas fa-border-style\",\n\t\t\t\"fas-f436\" => \"fas fa-bowling-ball\",\n\t\t\t\"fas-f466\" => \"fas fa-box\",\n\t\t\t\"fas-f49e\" => \"fas fa-box-open\",\n\t\t\t\"fas-f95b\" => \"fas fa-box-tissue\",\n\t\t\t\"fas-f468\" => \"fas fa-boxes\",\n\t\t\t\"fas-f2a1\" => \"fas fa-braille\",\n\t\t\t\"fas-f5dc\" => \"fas fa-brain\",\n\t\t\t\"fas-f7ec\" => \"fas fa-bread-slice\",\n\t\t\t\"fas-f0b1\" => \"fas fa-briefcase\",\n\t\t\t\"fas-f469\" => \"fas fa-briefcase-medical\",\n\t\t\t\"fas-f519\" => \"fas fa-broadcast-tower\",\n\t\t\t\"fas-f51a\" => \"fas fa-broom\",\n\t\t\t\"fas-f55d\" => \"fas fa-brush\",\n\t\t\t\"fas-f188\" => \"fas fa-bug\",\n\t\t\t\"fas-f1ad\" => \"fas fa-building\",\n\t\t\t\"fas-f0a1\" => \"fas fa-bullhorn\",\n\t\t\t\"fas-f140\" => \"fas fa-bullseye\",\n\t\t\t\"fas-f46a\" => \"fas fa-burn\",\n\t\t\t\"fas-f207\" => \"fas fa-bus\",\n\t\t\t\"fas-f55e\" => \"fas fa-bus-alt\",\n\t\t\t\"fas-f64a\" => \"fas fa-business-time\",\n\t\t\t\"fas-f1ec\" => \"fas fa-calculator\",\n\t\t\t\"fas-f133\" => \"fas fa-calendar\",\n\t\t\t\"fas-f073\" => \"fas fa-calendar-alt\",\n\t\t\t\"fas-f274\" => \"fas fa-calendar-check\",\n\t\t\t\"fas-f783\" => \"fas fa-calendar-day\",\n\t\t\t\"fas-f272\" => \"fas fa-calendar-minus\",\n\t\t\t\"fas-f271\" => \"fas fa-calendar-plus\",\n\t\t\t\"fas-f273\" => \"fas fa-calendar-times\",\n\t\t\t\"fas-f784\" => \"fas fa-calendar-week\",\n\t\t\t\"fas-f030\" => \"fas fa-camera\",\n\t\t\t\"fas-f083\" => \"fas fa-camera-retro\",\n\t\t\t\"fas-f6bb\" => \"fas fa-campground\",\n\t\t\t\"fas-f786\" => \"fas fa-candy-cane\",\n\t\t\t\"fas-f55f\" => \"fas fa-cannabis\",\n\t\t\t\"fas-f46b\" => \"fas fa-capsules\",\n\t\t\t\"fas-f1b9\" => \"fas fa-car\",\n\t\t\t\"fas-f5de\" => \"fas fa-car-alt\",\n\t\t\t\"fas-f5df\" => \"fas fa-car-battery\",\n\t\t\t\"fas-f5e1\" => \"fas fa-car-crash\",\n\t\t\t\"fas-f5e4\" => \"fas fa-car-side\",\n\t\t\t\"fas-f8ff\" => \"fas fa-caravan\",\n\t\t\t\"fas-f0d7\" => \"fas fa-caret-down\",\n\t\t\t\"fas-f0d9\" => \"fas fa-caret-left\",\n\t\t\t\"fas-f0da\" => \"fas fa-caret-right\",\n\t\t\t\"fas-f150\" => \"fas fa-caret-square-down\",\n\t\t\t\"fas-f191\" => \"fas fa-caret-square-left\",\n\t\t\t\"fas-f152\" => \"fas fa-caret-square-right\",\n\t\t\t\"fas-f151\" => \"fas fa-caret-square-up\",\n\t\t\t\"fas-f0d8\" => \"fas fa-caret-up\",\n\t\t\t\"fas-f787\" => \"fas fa-carrot\",\n\t\t\t\"fas-f218\" => \"fas fa-cart-arrow-down\",\n\t\t\t\"fas-f217\" => \"fas fa-cart-plus\",\n\t\t\t\"fas-f788\" => \"fas fa-cash-register\",\n\t\t\t\"fas-f6be\" => \"fas fa-cat\",\n\t\t\t\"fas-f0a3\" => \"fas fa-certificate\",\n\t\t\t\"fas-f6c0\" => \"fas fa-chair\",\n\t\t\t\"fas-f51b\" => \"fas fa-chalkboard\",\n\t\t\t\"fas-f51c\" => \"fas fa-chalkboard-teacher\",\n\t\t\t\"fas-f5e7\" => \"fas fa-charging-station\",\n\t\t\t\"fas-f1fe\" => \"fas fa-chart-area\",\n\t\t\t\"fas-f080\" => \"fas fa-chart-bar\",\n\t\t\t\"fas-f201\" => \"fas fa-chart-line\",\n\t\t\t\"fas-f200\" => \"fas fa-chart-pie\",\n\t\t\t\"fas-f00c\" => \"fas fa-check\",\n\t\t\t\"fas-f058\" => \"fas fa-check-circle\",\n\t\t\t\"fas-f560\" => \"fas fa-check-double\",\n\t\t\t\"fas-f14a\" => \"fas fa-check-square\",\n\t\t\t\"fas-f7ef\" => \"fas fa-cheese\",\n\t\t\t\"fas-f439\" => \"fas fa-chess\",\n\t\t\t\"fas-f43a\" => \"fas fa-chess-bishop\",\n\t\t\t\"fas-f43c\" => \"fas fa-chess-board\",\n\t\t\t\"fas-f43f\" => \"fas fa-chess-king\",\n\t\t\t\"fas-f441\" => \"fas fa-chess-knight\",\n\t\t\t\"fas-f443\" => \"fas fa-chess-pawn\",\n\t\t\t\"fas-f445\" => \"fas fa-chess-queen\",\n\t\t\t\"fas-f447\" => \"fas fa-chess-rook\",\n\t\t\t\"fas-f13a\" => \"fas fa-chevron-circle-down\",\n\t\t\t\"fas-f137\" => \"fas fa-chevron-circle-left\",\n\t\t\t\"fas-f138\" => \"fas fa-chevron-circle-right\",\n\t\t\t\"fas-f139\" => \"fas fa-chevron-circle-up\",\n\t\t\t\"fas-f078\" => \"fas fa-chevron-down\",\n\t\t\t\"fas-f053\" => \"fas fa-chevron-left\",\n\t\t\t\"fas-f054\" => \"fas fa-chevron-right\",\n\t\t\t\"fas-f077\" => \"fas fa-chevron-up\",\n\t\t\t\"fas-f1ae\" => \"fas fa-child\",\n\t\t\t\"fas-f51d\" => \"fas fa-church\",\n\t\t\t\"fas-f111\" => \"fas fa-circle\",\n\t\t\t\"fas-f1ce\" => \"fas fa-circle-notch\",\n\t\t\t\"fas-f64f\" => \"fas fa-city\",\n\t\t\t\"fas-f7f2\" => \"fas fa-clinic-medical\",\n\t\t\t\"fas-f328\" => \"fas fa-clipboard\",\n\t\t\t\"fas-f46c\" => \"fas fa-clipboard-check\",\n\t\t\t\"fas-f46d\" => \"fas fa-clipboard-list\",\n\t\t\t\"fas-f017\" => \"fas fa-clock\",\n\t\t\t\"fas-f24d\" => \"fas fa-clone\",\n\t\t\t\"fas-f20a\" => \"fas fa-closed-captioning\",\n\t\t\t\"fas-f0c2\" => \"fas fa-cloud\",\n\t\t\t\"fas-f381\" => \"fas fa-cloud-download-alt\",\n\t\t\t\"fas-f73b\" => \"fas fa-cloud-meatball\",\n\t\t\t\"fas-f6c3\" => \"fas fa-cloud-moon\",\n\t\t\t\"fas-f73c\" => \"fas fa-cloud-moon-rain\",\n\t\t\t\"fas-f73d\" => \"fas fa-cloud-rain\",\n\t\t\t\"fas-f740\" => \"fas fa-cloud-showers-heavy\",\n\t\t\t\"fas-f6c4\" => \"fas fa-cloud-sun\",\n\t\t\t\"fas-f743\" => \"fas fa-cloud-sun-rain\",\n\t\t\t\"fas-f382\" => \"fas fa-cloud-upload-alt\",\n\t\t\t\"fas-f561\" => \"fas fa-cocktail\",\n\t\t\t\"fas-f121\" => \"fas fa-code\",\n\t\t\t\"fas-f126\" => \"fas fa-code-branch\",\n\t\t\t\"fas-f0f4\" => \"fas fa-coffee\",\n\t\t\t\"fas-f013\" => \"fas fa-cog\",\n\t\t\t\"fas-f085\" => \"fas fa-cogs\",\n\t\t\t\"fas-f51e\" => \"fas fa-coins\",\n\t\t\t\"fas-f0db\" => \"fas fa-columns\",\n\t\t\t\"fas-f075\" => \"fas fa-comment\",\n\t\t\t\"fas-f27a\" => \"fas fa-comment-alt\",\n\t\t\t\"fas-f651\" => \"fas fa-comment-dollar\",\n\t\t\t\"fas-f4ad\" => \"fas fa-comment-dots\",\n\t\t\t\"fas-f7f5\" => \"fas fa-comment-medical\",\n\t\t\t\"fas-f4b3\" => \"fas fa-comment-slash\",\n\t\t\t\"fas-f086\" => \"fas fa-comments\",\n\t\t\t\"fas-f653\" => \"fas fa-comments-dollar\",\n\t\t\t\"fas-f51f\" => \"fas fa-compact-disc\",\n\t\t\t\"fas-f14e\" => \"fas fa-compass\",\n\t\t\t\"fas-f066\" => \"fas fa-compress\",\n\t\t\t\"fas-f422\" => \"fas fa-compress-alt\",\n\t\t\t\"fas-f78c\" => \"fas fa-compress-arrows-alt\",\n\t\t\t\"fas-f562\" => \"fas fa-concierge-bell\",\n\t\t\t\"fas-f563\" => \"fas fa-cookie\",\n\t\t\t\"fas-f564\" => \"fas fa-cookie-bite\",\n\t\t\t\"fas-f0c5\" => \"fas fa-copy\",\n\t\t\t\"fas-f1f9\" => \"fas fa-copyright\",\n\t\t\t\"fas-f4b8\" => \"fas fa-couch\",\n\t\t\t\"fas-f09d\" => \"fas fa-credit-card\",\n\t\t\t\"fas-f125\" => \"fas fa-crop\",\n\t\t\t\"fas-f565\" => \"fas fa-crop-alt\",\n\t\t\t\"fas-f654\" => \"fas fa-cross\",\n\t\t\t\"fas-f05b\" => \"fas fa-crosshairs\",\n\t\t\t\"fas-f520\" => \"fas fa-crow\",\n\t\t\t\"fas-f521\" => \"fas fa-crown\",\n\t\t\t\"fas-f7f7\" => \"fas fa-crutch\",\n\t\t\t\"fas-f1b2\" => \"fas fa-cube\",\n\t\t\t\"fas-f1b3\" => \"fas fa-cubes\",\n\t\t\t\"fas-f0c4\" => \"fas fa-cut\",\n\t\t\t\"fas-f1c0\" => \"fas fa-database\",\n\t\t\t\"fas-f2a4\" => \"fas fa-deaf\",\n\t\t\t\"fas-f747\" => \"fas fa-democrat\",\n\t\t\t\"fas-f108\" => \"fas fa-desktop\",\n\t\t\t\"fas-f655\" => \"fas fa-dharmachakra\",\n\t\t\t\"fas-f470\" => \"fas fa-diagnoses\",\n\t\t\t\"fas-f522\" => \"fas fa-dice\",\n\t\t\t\"fas-f6cf\" => \"fas fa-dice-d20\",\n\t\t\t\"fas-f6d1\" => \"fas fa-dice-d6\",\n\t\t\t\"fas-f523\" => \"fas fa-dice-five\",\n\t\t\t\"fas-f524\" => \"fas fa-dice-four\",\n\t\t\t\"fas-f525\" => \"fas fa-dice-one\",\n\t\t\t\"fas-f526\" => \"fas fa-dice-six\",\n\t\t\t\"fas-f527\" => \"fas fa-dice-three\",\n\t\t\t\"fas-f528\" => \"fas fa-dice-two\",\n\t\t\t\"fas-f566\" => \"fas fa-digital-tachograph\",\n\t\t\t\"fas-f5eb\" => \"fas fa-directions\",\n\t\t\t\"fas-f7fa\" => \"fas fa-disease\",\n\t\t\t\"fas-f529\" => \"fas fa-divide\",\n\t\t\t\"fas-f567\" => \"fas fa-dizzy\",\n\t\t\t\"fas-f471\" => \"fas fa-dna\",\n\t\t\t\"fas-f6d3\" => \"fas fa-dog\",\n\t\t\t\"fas-f155\" => \"fas fa-dollar-sign\",\n\t\t\t\"fas-f472\" => \"fas fa-dolly\",\n\t\t\t\"fas-f474\" => \"fas fa-dolly-flatbed\",\n\t\t\t\"fas-f4b9\" => \"fas fa-donate\",\n\t\t\t\"fas-f52a\" => \"fas fa-door-closed\",\n\t\t\t\"fas-f52b\" => \"fas fa-door-open\",\n\t\t\t\"fas-f192\" => \"fas fa-dot-circle\",\n\t\t\t\"fas-f4ba\" => \"fas fa-dove\",\n\t\t\t\"fas-f019\" => \"fas fa-download\",\n\t\t\t\"fas-f568\" => \"fas fa-drafting-compass\",\n\t\t\t\"fas-f6d5\" => \"fas fa-dragon\",\n\t\t\t\"fas-f5ee\" => \"fas fa-draw-polygon\",\n\t\t\t\"fas-f569\" => \"fas fa-drum\",\n\t\t\t\"fas-f56a\" => \"fas fa-drum-steelpan\",\n\t\t\t\"fas-f6d7\" => \"fas fa-drumstick-bite\",\n\t\t\t\"fas-f44b\" => \"fas fa-dumbbell\",\n\t\t\t\"fas-f793\" => \"fas fa-dumpster\",\n\t\t\t\"fas-f794\" => \"fas fa-dumpster-fire\",\n\t\t\t\"fas-f6d9\" => \"fas fa-dungeon\",\n\t\t\t\"fas-f044\" => \"fas fa-edit\",\n\t\t\t\"fas-f7fb\" => \"fas fa-egg\",\n\t\t\t\"fas-f052\" => \"fas fa-eject\",\n\t\t\t\"fas-f141\" => \"fas fa-ellipsis-h\",\n\t\t\t\"fas-f142\" => \"fas fa-ellipsis-v\",\n\t\t\t\"fas-f0e0\" => \"fas fa-envelope\",\n\t\t\t\"fas-f2b6\" => \"fas fa-envelope-open\",\n\t\t\t\"fas-f658\" => \"fas fa-envelope-open-text\",\n\t\t\t\"fas-f199\" => \"fas fa-envelope-square\",\n\t\t\t\"fas-f52c\" => \"fas fa-equals\",\n\t\t\t\"fas-f12d\" => \"fas fa-eraser\",\n\t\t\t\"fas-f796\" => \"fas fa-ethernet\",\n\t\t\t\"fas-f153\" => \"fas fa-euro-sign\",\n\t\t\t\"fas-f362\" => \"fas fa-exchange-alt\",\n\t\t\t\"fas-f12a\" => \"fas fa-exclamation\",\n\t\t\t\"fas-f06a\" => \"fas fa-exclamation-circle\",\n\t\t\t\"fas-f071\" => \"fas fa-exclamation-triangle\",\n\t\t\t\"fas-f065\" => \"fas fa-expand\",\n\t\t\t\"fas-f424\" => \"fas fa-expand-alt\",\n\t\t\t\"fas-f31e\" => \"fas fa-expand-arrows-alt\",\n\t\t\t\"fas-f35d\" => \"fas fa-external-link-alt\",\n\t\t\t\"fas-f360\" => \"fas fa-external-link-square-alt\",\n\t\t\t\"fas-f06e\" => \"fas fa-eye\",\n\t\t\t\"fas-f1fb\" => \"fas fa-eye-dropper\",\n\t\t\t\"fas-f070\" => \"fas fa-eye-slash\",\n\t\t\t\"fas-f863\" => \"fas fa-fan\",\n\t\t\t\"fas-f049\" => \"fas fa-fast-backward\",\n\t\t\t\"fas-f050\" => \"fas fa-fast-forward\",\n\t\t\t\"fas-f905\" => \"fas fa-faucet\",\n\t\t\t\"fas-f1ac\" => \"fas fa-fax\",\n\t\t\t\"fas-f52d\" => \"fas fa-feather\",\n\t\t\t\"fas-f56b\" => \"fas fa-feather-alt\",\n\t\t\t\"fas-f182\" => \"fas fa-female\",\n\t\t\t\"fas-f0fb\" => \"fas fa-fighter-jet\",\n\t\t\t\"fas-f15b\" => \"fas fa-file\",\n\t\t\t\"fas-f15c\" => \"fas fa-file-alt\",\n\t\t\t\"fas-f1c6\" => \"fas fa-file-archive\",\n\t\t\t\"fas-f1c7\" => \"fas fa-file-audio\",\n\t\t\t\"fas-f1c9\" => \"fas fa-file-code\",\n\t\t\t\"fas-f56c\" => \"fas fa-file-contract\",\n\t\t\t\"fas-f6dd\" => \"fas fa-file-csv\",\n\t\t\t\"fas-f56d\" => \"fas fa-file-download\",\n\t\t\t\"fas-f1c3\" => \"fas fa-file-excel\",\n\t\t\t\"fas-f56e\" => \"fas fa-file-export\",\n\t\t\t\"fas-f1c5\" => \"fas fa-file-image\",\n\t\t\t\"fas-f56f\" => \"fas fa-file-import\",\n\t\t\t\"fas-f570\" => \"fas fa-file-invoice\",\n\t\t\t\"fas-f571\" => \"fas fa-file-invoice-dollar\",\n\t\t\t\"fas-f477\" => \"fas fa-file-medical\",\n\t\t\t\"fas-f478\" => \"fas fa-file-medical-alt\",\n\t\t\t\"fas-f1c1\" => \"fas fa-file-pdf\",\n\t\t\t\"fas-f1c4\" => \"fas fa-file-powerpoint\",\n\t\t\t\"fas-f572\" => \"fas fa-file-prescription\",\n\t\t\t\"fas-f573\" => \"fas fa-file-signature\",\n\t\t\t\"fas-f574\" => \"fas fa-file-upload\",\n\t\t\t\"fas-f1c8\" => \"fas fa-file-video\",\n\t\t\t\"fas-f1c2\" => \"fas fa-file-word\",\n\t\t\t\"fas-f575\" => \"fas fa-fill\",\n\t\t\t\"fas-f576\" => \"fas fa-fill-drip\",\n\t\t\t\"fas-f008\" => \"fas fa-film\",\n\t\t\t\"fas-f0b0\" => \"fas fa-filter\",\n\t\t\t\"fas-f577\" => \"fas fa-fingerprint\",\n\t\t\t\"fas-f06d\" => \"fas fa-fire\",\n\t\t\t\"fas-f7e4\" => \"fas fa-fire-alt\",\n\t\t\t\"fas-f134\" => \"fas fa-fire-extinguisher\",\n\t\t\t\"fas-f479\" => \"fas fa-first-aid\",\n\t\t\t\"fas-f578\" => \"fas fa-fish\",\n\t\t\t\"fas-f6de\" => \"fas fa-fist-raised\",\n\t\t\t\"fas-f024\" => \"fas fa-flag\",\n\t\t\t\"fas-f11e\" => \"fas fa-flag-checkered\",\n\t\t\t\"fas-f74d\" => \"fas fa-flag-usa\",\n\t\t\t\"fas-f0c3\" => \"fas fa-flask\",\n\t\t\t\"fas-f579\" => \"fas fa-flushed\",\n\t\t\t\"fas-f07b\" => \"fas fa-folder\",\n\t\t\t\"fas-f65d\" => \"fas fa-folder-minus\",\n\t\t\t\"fas-f07c\" => \"fas fa-folder-open\",\n\t\t\t\"fas-f65e\" => \"fas fa-folder-plus\",\n\t\t\t\"fas-f031\" => \"fas fa-font\",\n\t\t\t\"fas-f44e\" => \"fas fa-football-ball\",\n\t\t\t\"fas-f04e\" => \"fas fa-forward\",\n\t\t\t\"fas-f52e\" => \"fas fa-frog\",\n\t\t\t\"fas-f119\" => \"fas fa-frown\",\n\t\t\t\"fas-f57a\" => \"fas fa-frown-open\",\n\t\t\t\"fas-f662\" => \"fas fa-funnel-dollar\",\n\t\t\t\"fas-f1e3\" => \"fas fa-futbol\",\n\t\t\t\"fas-f11b\" => \"fas fa-gamepad\",\n\t\t\t\"fas-f52f\" => \"fas fa-gas-pump\",\n\t\t\t\"fas-f0e3\" => \"fas fa-gavel\",\n\t\t\t\"fas-f3a5\" => \"fas fa-gem\",\n\t\t\t\"fas-f22d\" => \"fas fa-genderless\",\n\t\t\t\"fas-f6e2\" => \"fas fa-ghost\",\n\t\t\t\"fas-f06b\" => \"fas fa-gift\",\n\t\t\t\"fas-f79c\" => \"fas fa-gifts\",\n\t\t\t\"fas-f79f\" => \"fas fa-glass-cheers\",\n\t\t\t\"fas-f000\" => \"fas fa-glass-martini\",\n\t\t\t\"fas-f57b\" => \"fas fa-glass-martini-alt\",\n\t\t\t\"fas-f7a0\" => \"fas fa-glass-whiskey\",\n\t\t\t\"fas-f530\" => \"fas fa-glasses\",\n\t\t\t\"fas-f0ac\" => \"fas fa-globe\",\n\t\t\t\"fas-f57c\" => \"fas fa-globe-africa\",\n\t\t\t\"fas-f57d\" => \"fas fa-globe-americas\",\n\t\t\t\"fas-f57e\" => \"fas fa-globe-asia\",\n\t\t\t\"fas-f7a2\" => \"fas fa-globe-europe\",\n\t\t\t\"fas-f450\" => \"fas fa-golf-ball\",\n\t\t\t\"fas-f664\" => \"fas fa-gopuram\",\n\t\t\t\"fas-f19d\" => \"fas fa-graduation-cap\",\n\t\t\t\"fas-f531\" => \"fas fa-greater-than\",\n\t\t\t\"fas-f532\" => \"fas fa-greater-than-equal\",\n\t\t\t\"fas-f57f\" => \"fas fa-grimace\",\n\t\t\t\"fas-f580\" => \"fas fa-grin\",\n\t\t\t\"fas-f581\" => \"fas fa-grin-alt\",\n\t\t\t\"fas-f582\" => \"fas fa-grin-beam\",\n\t\t\t\"fas-f583\" => \"fas fa-grin-beam-sweat\",\n\t\t\t\"fas-f584\" => \"fas fa-grin-hearts\",\n\t\t\t\"fas-f585\" => \"fas fa-grin-squint\",\n\t\t\t\"fas-f586\" => \"fas fa-grin-squint-tears\",\n\t\t\t\"fas-f587\" => \"fas fa-grin-stars\",\n\t\t\t\"fas-f588\" => \"fas fa-grin-tears\",\n\t\t\t\"fas-f589\" => \"fas fa-grin-tongue\",\n\t\t\t\"fas-f58a\" => \"fas fa-grin-tongue-squint\",\n\t\t\t\"fas-f58b\" => \"fas fa-grin-tongue-wink\",\n\t\t\t\"fas-f58c\" => \"fas fa-grin-wink\",\n\t\t\t\"fas-f58d\" => \"fas fa-grip-horizontal\",\n\t\t\t\"fas-f7a4\" => \"fas fa-grip-lines\",\n\t\t\t\"fas-f7a5\" => \"fas fa-grip-lines-vertical\",\n\t\t\t\"fas-f58e\" => \"fas fa-grip-vertical\",\n\t\t\t\"fas-f7a6\" => \"fas fa-guitar\",\n\t\t\t\"fas-f0fd\" => \"fas fa-h-square\",\n\t\t\t\"fas-f805\" => \"fas fa-hamburger\",\n\t\t\t\"fas-f6e3\" => \"fas fa-hammer\",\n\t\t\t\"fas-f665\" => \"fas fa-hamsa\",\n\t\t\t\"fas-f4bd\" => \"fas fa-hand-holding\",\n\t\t\t\"fas-f4be\" => \"fas fa-hand-holding-heart\",\n\t\t\t\"fas-f95c\" => \"fas fa-hand-holding-medical\",\n\t\t\t\"fas-f4c0\" => \"fas fa-hand-holding-usd\",\n\t\t\t\"fas-f4c1\" => \"fas fa-hand-holding-water\",\n\t\t\t\"fas-f258\" => \"fas fa-hand-lizard\",\n\t\t\t\"fas-f806\" => \"fas fa-hand-middle-finger\",\n\t\t\t\"fas-f256\" => \"fas fa-hand-paper\",\n\t\t\t\"fas-f25b\" => \"fas fa-hand-peace\",\n\t\t\t\"fas-f0a7\" => \"fas fa-hand-point-down\",\n\t\t\t\"fas-f0a5\" => \"fas fa-hand-point-left\",\n\t\t\t\"fas-f0a4\" => \"fas fa-hand-point-right\",\n\t\t\t\"fas-f0a6\" => \"fas fa-hand-point-up\",\n\t\t\t\"fas-f25a\" => \"fas fa-hand-pointer\",\n\t\t\t\"fas-f255\" => \"fas fa-hand-rock\",\n\t\t\t\"fas-f257\" => \"fas fa-hand-scissors\",\n\t\t\t\"fas-f95d\" => \"fas fa-hand-sparkles\",\n\t\t\t\"fas-f259\" => \"fas fa-hand-spock\",\n\t\t\t\"fas-f4c2\" => \"fas fa-hands\",\n\t\t\t\"fas-f4c4\" => \"fas fa-hands-helping\",\n\t\t\t\"fas-f95e\" => \"fas fa-hands-wash\",\n\t\t\t\"fas-f2b5\" => \"fas fa-handshake\",\n\t\t\t\"fas-f95f\" => \"fas fa-handshake-alt-slash\",\n\t\t\t\"fas-f960\" => \"fas fa-handshake-slash\",\n\t\t\t\"fas-f6e6\" => \"fas fa-hanukiah\",\n\t\t\t\"fas-f807\" => \"fas fa-hard-hat\",\n\t\t\t\"fas-f292\" => \"fas fa-hashtag\",\n\t\t\t\"fas-f8c0\" => \"fas fa-hat-cowboy\",\n\t\t\t\"fas-f8c1\" => \"fas fa-hat-cowboy-side\",\n\t\t\t\"fas-f6e8\" => \"fas fa-hat-wizard\",\n\t\t\t\"fas-f0a0\" => \"fas fa-hdd\",\n\t\t\t\"fas-f961\" => \"fas fa-head-side-cough\",\n\t\t\t\"fas-f962\" => \"fas fa-head-side-cough-slash\",\n\t\t\t\"fas-f963\" => \"fas fa-head-side-mask\",\n\t\t\t\"fas-f964\" => \"fas fa-head-side-virus\",\n\t\t\t\"fas-f1dc\" => \"fas fa-heading\",\n\t\t\t\"fas-f025\" => \"fas fa-headphones\",\n\t\t\t\"fas-f58f\" => \"fas fa-headphones-alt\",\n\t\t\t\"fas-f590\" => \"fas fa-headset\",\n\t\t\t\"fas-f004\" => \"fas fa-heart\",\n\t\t\t\"fas-f7a9\" => \"fas fa-heart-broken\",\n\t\t\t\"fas-f21e\" => \"fas fa-heartbeat\",\n\t\t\t\"fas-f533\" => \"fas fa-helicopter\",\n\t\t\t\"fas-f591\" => \"fas fa-highlighter\",\n\t\t\t\"fas-f6ec\" => \"fas fa-hiking\",\n\t\t\t\"fas-f6ed\" => \"fas fa-hippo\",\n\t\t\t\"fas-f1da\" => \"fas fa-history\",\n\t\t\t\"fas-f453\" => \"fas fa-hockey-puck\",\n\t\t\t\"fas-f7aa\" => \"fas fa-holly-berry\",\n\t\t\t\"fas-f015\" => \"fas fa-home\",\n\t\t\t\"fas-f6f0\" => \"fas fa-horse\",\n\t\t\t\"fas-f7ab\" => \"fas fa-horse-head\",\n\t\t\t\"fas-f0f8\" => \"fas fa-hospital\",\n\t\t\t\"fas-f47d\" => \"fas fa-hospital-alt\",\n\t\t\t\"fas-f47e\" => \"fas fa-hospital-symbol\",\n\t\t\t\"fas-f80d\" => \"fas fa-hospital-user\",\n\t\t\t\"fas-f593\" => \"fas fa-hot-tub\",\n\t\t\t\"fas-f80f\" => \"fas fa-hotdog\",\n\t\t\t\"fas-f594\" => \"fas fa-hotel\",\n\t\t\t\"fas-f254\" => \"fas fa-hourglass\",\n\t\t\t\"fas-f253\" => \"fas fa-hourglass-end\",\n\t\t\t\"fas-f252\" => \"fas fa-hourglass-half\",\n\t\t\t\"fas-f251\" => \"fas fa-hourglass-start\",\n\t\t\t\"fas-f6f1\" => \"fas fa-house-damage\",\n\t\t\t\"fas-f965\" => \"fas fa-house-user\",\n\t\t\t\"fas-f6f2\" => \"fas fa-hryvnia\",\n\t\t\t\"fas-f246\" => \"fas fa-i-cursor\",\n\t\t\t\"fas-f810\" => \"fas fa-ice-cream\",\n\t\t\t\"fas-f7ad\" => \"fas fa-icicles\",\n\t\t\t\"fas-f86d\" => \"fas fa-icons\",\n\t\t\t\"fas-f2c1\" => \"fas fa-id-badge\",\n\t\t\t\"fas-f2c2\" => \"fas fa-id-card\",\n\t\t\t\"fas-f47f\" => \"fas fa-id-card-alt\",\n\t\t\t\"fas-f7ae\" => \"fas fa-igloo\",\n\t\t\t\"fas-f03e\" => \"fas fa-image\",\n\t\t\t\"fas-f302\" => \"fas fa-images\",\n\t\t\t\"fas-f01c\" => \"fas fa-inbox\",\n\t\t\t\"fas-f03c\" => \"fas fa-indent\",\n\t\t\t\"fas-f275\" => \"fas fa-industry\",\n\t\t\t\"fas-f534\" => \"fas fa-infinity\",\n\t\t\t\"fas-f129\" => \"fas fa-info\",\n\t\t\t\"fas-f05a\" => \"fas fa-info-circle\",\n\t\t\t\"fas-f033\" => \"fas fa-italic\",\n\t\t\t\"fas-f669\" => \"fas fa-jedi\",\n\t\t\t\"fas-f595\" => \"fas fa-joint\",\n\t\t\t\"fas-f66a\" => \"fas fa-journal-whills\",\n\t\t\t\"fas-f66b\" => \"fas fa-kaaba\",\n\t\t\t\"fas-f084\" => \"fas fa-key\",\n\t\t\t\"fas-f11c\" => \"fas fa-keyboard\",\n\t\t\t\"fas-f66d\" => \"fas fa-khanda\",\n\t\t\t\"fas-f596\" => \"fas fa-kiss\",\n\t\t\t\"fas-f597\" => \"fas fa-kiss-beam\",\n\t\t\t\"fas-f598\" => \"fas fa-kiss-wink-heart\",\n\t\t\t\"fas-f535\" => \"fas fa-kiwi-bird\",\n\t\t\t\"fas-f66f\" => \"fas fa-landmark\",\n\t\t\t\"fas-f1ab\" => \"fas fa-language\",\n\t\t\t\"fas-f109\" => \"fas fa-laptop\",\n\t\t\t\"fas-f5fc\" => \"fas fa-laptop-code\",\n\t\t\t\"fas-f966\" => \"fas fa-laptop-house\",\n\t\t\t\"fas-f812\" => \"fas fa-laptop-medical\",\n\t\t\t\"fas-f599\" => \"fas fa-laugh\",\n\t\t\t\"fas-f59a\" => \"fas fa-laugh-beam\",\n\t\t\t\"fas-f59b\" => \"fas fa-laugh-squint\",\n\t\t\t\"fas-f59c\" => \"fas fa-laugh-wink\",\n\t\t\t\"fas-f5fd\" => \"fas fa-layer-group\",\n\t\t\t\"fas-f06c\" => \"fas fa-leaf\",\n\t\t\t\"fas-f094\" => \"fas fa-lemon\",\n\t\t\t\"fas-f536\" => \"fas fa-less-than\",\n\t\t\t\"fas-f537\" => \"fas fa-less-than-equal\",\n\t\t\t\"fas-f3be\" => \"fas fa-level-down-alt\",\n\t\t\t\"fas-f3bf\" => \"fas fa-level-up-alt\",\n\t\t\t\"fas-f1cd\" => \"fas fa-life-ring\",\n\t\t\t\"fas-f0eb\" => \"fas fa-lightbulb\",\n\t\t\t\"fas-f0c1\" => \"fas fa-link\",\n\t\t\t\"fas-f195\" => \"fas fa-lira-sign\",\n\t\t\t\"fas-f03a\" => \"fas fa-list\",\n\t\t\t\"fas-f022\" => \"fas fa-list-alt\",\n\t\t\t\"fas-f0cb\" => \"fas fa-list-ol\",\n\t\t\t\"fas-f0ca\" => \"fas fa-list-ul\",\n\t\t\t\"fas-f124\" => \"fas fa-location-arrow\",\n\t\t\t\"fas-f023\" => \"fas fa-lock\",\n\t\t\t\"fas-f3c1\" => \"fas fa-lock-open\",\n\t\t\t\"fas-f309\" => \"fas fa-long-arrow-alt-down\",\n\t\t\t\"fas-f30a\" => \"fas fa-long-arrow-alt-left\",\n\t\t\t\"fas-f30b\" => \"fas fa-long-arrow-alt-right\",\n\t\t\t\"fas-f30c\" => \"fas fa-long-arrow-alt-up\",\n\t\t\t\"fas-f2a8\" => \"fas fa-low-vision\",\n\t\t\t\"fas-f59d\" => \"fas fa-luggage-cart\",\n\t\t\t\"fas-f604\" => \"fas fa-lungs\",\n\t\t\t\"fas-f967\" => \"fas fa-lungs-virus\",\n\t\t\t\"fas-f0d0\" => \"fas fa-magic\",\n\t\t\t\"fas-f076\" => \"fas fa-magnet\",\n\t\t\t\"fas-f674\" => \"fas fa-mail-bulk\",\n\t\t\t\"fas-f183\" => \"fas fa-male\",\n\t\t\t\"fas-f279\" => \"fas fa-map\",\n\t\t\t\"fas-f59f\" => \"fas fa-map-marked\",\n\t\t\t\"fas-f5a0\" => \"fas fa-map-marked-alt\",\n\t\t\t\"fas-f041\" => \"fas fa-map-marker\",\n\t\t\t\"fas-f3c5\" => \"fas fa-map-marker-alt\",\n\t\t\t\"fas-f276\" => \"fas fa-map-pin\",\n\t\t\t\"fas-f277\" => \"fas fa-map-signs\",\n\t\t\t\"fas-f5a1\" => \"fas fa-marker\",\n\t\t\t\"fas-f222\" => \"fas fa-mars\",\n\t\t\t\"fas-f227\" => \"fas fa-mars-double\",\n\t\t\t\"fas-f229\" => \"fas fa-mars-stroke\",\n\t\t\t\"fas-f22b\" => \"fas fa-mars-stroke-h\",\n\t\t\t\"fas-f22a\" => \"fas fa-mars-stroke-v\",\n\t\t\t\"fas-f6fa\" => \"fas fa-mask\",\n\t\t\t\"fas-f5a2\" => \"fas fa-medal\",\n\t\t\t\"fas-f0fa\" => \"fas fa-medkit\",\n\t\t\t\"fas-f11a\" => \"fas fa-meh\",\n\t\t\t\"fas-f5a4\" => \"fas fa-meh-blank\",\n\t\t\t\"fas-f5a5\" => \"fas fa-meh-rolling-eyes\",\n\t\t\t\"fas-f538\" => \"fas fa-memory\",\n\t\t\t\"fas-f676\" => \"fas fa-menorah\",\n\t\t\t\"fas-f223\" => \"fas fa-mercury\",\n\t\t\t\"fas-f753\" => \"fas fa-meteor\",\n\t\t\t\"fas-f2db\" => \"fas fa-microchip\",\n\t\t\t\"fas-f130\" => \"fas fa-microphone\",\n\t\t\t\"fas-f3c9\" => \"fas fa-microphone-alt\",\n\t\t\t\"fas-f539\" => \"fas fa-microphone-alt-slash\",\n\t\t\t\"fas-f131\" => \"fas fa-microphone-slash\",\n\t\t\t\"fas-f610\" => \"fas fa-microscope\",\n\t\t\t\"fas-f068\" => \"fas fa-minus\",\n\t\t\t\"fas-f056\" => \"fas fa-minus-circle\",\n\t\t\t\"fas-f146\" => \"fas fa-minus-square\",\n\t\t\t\"fas-f7b5\" => \"fas fa-mitten\",\n\t\t\t\"fas-f10b\" => \"fas fa-mobile\",\n\t\t\t\"fas-f3cd\" => \"fas fa-mobile-alt\",\n\t\t\t\"fas-f0d6\" => \"fas fa-money-bill\",\n\t\t\t\"fas-f3d1\" => \"fas fa-money-bill-alt\",\n\t\t\t\"fas-f53a\" => \"fas fa-money-bill-wave\",\n\t\t\t\"fas-f53b\" => \"fas fa-money-bill-wave-alt\",\n\t\t\t\"fas-f53c\" => \"fas fa-money-check\",\n\t\t\t\"fas-f53d\" => \"fas fa-money-check-alt\",\n\t\t\t\"fas-f5a6\" => \"fas fa-monument\",\n\t\t\t\"fas-f186\" => \"fas fa-moon\",\n\t\t\t\"fas-f5a7\" => \"fas fa-mortar-pestle\",\n\t\t\t\"fas-f678\" => \"fas fa-mosque\",\n\t\t\t\"fas-f21c\" => \"fas fa-motorcycle\",\n\t\t\t\"fas-f6fc\" => \"fas fa-mountain\",\n\t\t\t\"fas-f8cc\" => \"fas fa-mouse\",\n\t\t\t\"fas-f245\" => \"fas fa-mouse-pointer\",\n\t\t\t\"fas-f7b6\" => \"fas fa-mug-hot\",\n\t\t\t\"fas-f001\" => \"fas fa-music\",\n\t\t\t\"fas-f6ff\" => \"fas fa-network-wired\",\n\t\t\t\"fas-f22c\" => \"fas fa-neuter\",\n\t\t\t\"fas-f1ea\" => \"fas fa-newspaper\",\n\t\t\t\"fas-f53e\" => \"fas fa-not-equal\",\n\t\t\t\"fas-f481\" => \"fas fa-notes-medical\",\n\t\t\t\"fas-f247\" => \"fas fa-object-group\",\n\t\t\t\"fas-f248\" => \"fas fa-object-ungroup\",\n\t\t\t\"fas-f613\" => \"fas fa-oil-can\",\n\t\t\t\"fas-f679\" => \"fas fa-om\",\n\t\t\t\"fas-f700\" => \"fas fa-otter\",\n\t\t\t\"fas-f03b\" => \"fas fa-outdent\",\n\t\t\t\"fas-f815\" => \"fas fa-pager\",\n\t\t\t\"fas-f1fc\" => \"fas fa-paint-brush\",\n\t\t\t\"fas-f5aa\" => \"fas fa-paint-roller\",\n\t\t\t\"fas-f53f\" => \"fas fa-palette\",\n\t\t\t\"fas-f482\" => \"fas fa-pallet\",\n\t\t\t\"fas-f1d8\" => \"fas fa-paper-plane\",\n\t\t\t\"fas-f0c6\" => \"fas fa-paperclip\",\n\t\t\t\"fas-f4cd\" => \"fas fa-parachute-box\",\n\t\t\t\"fas-f1dd\" => \"fas fa-paragraph\",\n\t\t\t\"fas-f540\" => \"fas fa-parking\",\n\t\t\t\"fas-f5ab\" => \"fas fa-passport\",\n\t\t\t\"fas-f67b\" => \"fas fa-pastafarianism\",\n\t\t\t\"fas-f0ea\" => \"fas fa-paste\",\n\t\t\t\"fas-f04c\" => \"fas fa-pause\",\n\t\t\t\"fas-f28b\" => \"fas fa-pause-circle\",\n\t\t\t\"fas-f1b0\" => \"fas fa-paw\",\n\t\t\t\"fas-f67c\" => \"fas fa-peace\",\n\t\t\t\"fas-f304\" => \"fas fa-pen\",\n\t\t\t\"fas-f305\" => \"fas fa-pen-alt\",\n\t\t\t\"fas-f5ac\" => \"fas fa-pen-fancy\",\n\t\t\t\"fas-f5ad\" => \"fas fa-pen-nib\",\n\t\t\t\"fas-f14b\" => \"fas fa-pen-square\",\n\t\t\t\"fas-f303\" => \"fas fa-pencil-alt\",\n\t\t\t\"fas-f5ae\" => \"fas fa-pencil-ruler\",\n\t\t\t\"fas-f968\" => \"fas fa-people-arrows\",\n\t\t\t\"fas-f4ce\" => \"fas fa-people-carry\",\n\t\t\t\"fas-f816\" => \"fas fa-pepper-hot\",\n\t\t\t\"fas-f295\" => \"fas fa-percent\",\n\t\t\t\"fas-f541\" => \"fas fa-percentage\",\n\t\t\t\"fas-f756\" => \"fas fa-person-booth\",\n\t\t\t\"fas-f095\" => \"fas fa-phone\",\n\t\t\t\"fas-f879\" => \"fas fa-phone-alt\",\n\t\t\t\"fas-f3dd\" => \"fas fa-phone-slash\",\n\t\t\t\"fas-f098\" => \"fas fa-phone-square\",\n\t\t\t\"fas-f87b\" => \"fas fa-phone-square-alt\",\n\t\t\t\"fas-f2a0\" => \"fas fa-phone-volume\",\n\t\t\t\"fas-f87c\" => \"fas fa-photo-video\",\n\t\t\t\"fas-f4d3\" => \"fas fa-piggy-bank\",\n\t\t\t\"fas-f484\" => \"fas fa-pills\",\n\t\t\t\"fas-f818\" => \"fas fa-pizza-slice\",\n\t\t\t\"fas-f67f\" => \"fas fa-place-of-worship\",\n\t\t\t\"fas-f072\" => \"fas fa-plane\",\n\t\t\t\"fas-f5af\" => \"fas fa-plane-arrival\",\n\t\t\t\"fas-f5b0\" => \"fas fa-plane-departure\",\n\t\t\t\"fas-f969\" => \"fas fa-plane-slash\",\n\t\t\t\"fas-f04b\" => \"fas fa-play\",\n\t\t\t\"fas-f144\" => \"fas fa-play-circle\",\n\t\t\t\"fas-f1e6\" => \"fas fa-plug\",\n\t\t\t\"fas-f067\" => \"fas fa-plus\",\n\t\t\t\"fas-f055\" => \"fas fa-plus-circle\",\n\t\t\t\"fas-f0fe\" => \"fas fa-plus-square\",\n\t\t\t\"fas-f2ce\" => \"fas fa-podcast\",\n\t\t\t\"fas-f681\" => \"fas fa-poll\",\n\t\t\t\"fas-f682\" => \"fas fa-poll-h\",\n\t\t\t\"fas-f2fe\" => \"fas fa-poo\",\n\t\t\t\"fas-f75a\" => \"fas fa-poo-storm\",\n\t\t\t\"fas-f619\" => \"fas fa-poop\",\n\t\t\t\"fas-f3e0\" => \"fas fa-portrait\",\n\t\t\t\"fas-f154\" => \"fas fa-pound-sign\",\n\t\t\t\"fas-f011\" => \"fas fa-power-off\",\n\t\t\t\"fas-f683\" => \"fas fa-pray\",\n\t\t\t\"fas-f684\" => \"fas fa-praying-hands\",\n\t\t\t\"fas-f5b1\" => \"fas fa-prescription\",\n\t\t\t\"fas-f485\" => \"fas fa-prescription-bottle\",\n\t\t\t\"fas-f486\" => \"fas fa-prescription-bottle-alt\",\n\t\t\t\"fas-f02f\" => \"fas fa-print\",\n\t\t\t\"fas-f487\" => \"fas fa-procedures\",\n\t\t\t\"fas-f542\" => \"fas fa-project-diagram\",\n\t\t\t\"fas-f96a\" => \"fas fa-pump-medical\",\n\t\t\t\"fas-f96b\" => \"fas fa-pump-soap\",\n\t\t\t\"fas-f12e\" => \"fas fa-puzzle-piece\",\n\t\t\t\"fas-f029\" => \"fas fa-qrcode\",\n\t\t\t\"fas-f128\" => \"fas fa-question\",\n\t\t\t\"fas-f059\" => \"fas fa-question-circle\",\n\t\t\t\"fas-f458\" => \"fas fa-quidditch\",\n\t\t\t\"fas-f10d\" => \"fas fa-quote-left\",\n\t\t\t\"fas-f10e\" => \"fas fa-quote-right\",\n\t\t\t\"fas-f687\" => \"fas fa-quran\",\n\t\t\t\"fas-f7b9\" => \"fas fa-radiation\",\n\t\t\t\"fas-f7ba\" => \"fas fa-radiation-alt\",\n\t\t\t\"fas-f75b\" => \"fas fa-rainbow\",\n\t\t\t\"fas-f074\" => \"fas fa-random\",\n\t\t\t\"fas-f543\" => \"fas fa-receipt\",\n\t\t\t\"fas-f8d9\" => \"fas fa-record-vinyl\",\n\t\t\t\"fas-f1b8\" => \"fas fa-recycle\",\n\t\t\t\"fas-f01e\" => \"fas fa-redo\",\n\t\t\t\"fas-f2f9\" => \"fas fa-redo-alt\",\n\t\t\t\"fas-f25d\" => \"fas fa-registered\",\n\t\t\t\"fas-f87d\" => \"fas fa-remove-format\",\n\t\t\t\"fas-f3e5\" => \"fas fa-reply\",\n\t\t\t\"fas-f122\" => \"fas fa-reply-all\",\n\t\t\t\"fas-f75e\" => \"fas fa-republican\",\n\t\t\t\"fas-f7bd\" => \"fas fa-restroom\",\n\t\t\t\"fas-f079\" => \"fas fa-retweet\",\n\t\t\t\"fas-f4d6\" => \"fas fa-ribbon\",\n\t\t\t\"fas-f70b\" => \"fas fa-ring\",\n\t\t\t\"fas-f018\" => \"fas fa-road\",\n\t\t\t\"fas-f544\" => \"fas fa-robot\",\n\t\t\t\"fas-f135\" => \"fas fa-rocket\",\n\t\t\t\"fas-f4d7\" => \"fas fa-route\",\n\t\t\t\"fas-f09e\" => \"fas fa-rss\",\n\t\t\t\"fas-f143\" => \"fas fa-rss-square\",\n\t\t\t\"fas-f158\" => \"fas fa-ruble-sign\",\n\t\t\t\"fas-f545\" => \"fas fa-ruler\",\n\t\t\t\"fas-f546\" => \"fas fa-ruler-combined\",\n\t\t\t\"fas-f547\" => \"fas fa-ruler-horizontal\",\n\t\t\t\"fas-f548\" => \"fas fa-ruler-vertical\",\n\t\t\t\"fas-f70c\" => \"fas fa-running\",\n\t\t\t\"fas-f156\" => \"fas fa-rupee-sign\",\n\t\t\t\"fas-f5b3\" => \"fas fa-sad-cry\",\n\t\t\t\"fas-f5b4\" => \"fas fa-sad-tear\",\n\t\t\t\"fas-f7bf\" => \"fas fa-satellite\",\n\t\t\t\"fas-f7c0\" => \"fas fa-satellite-dish\",\n\t\t\t\"fas-f0c7\" => \"fas fa-save\",\n\t\t\t\"fas-f549\" => \"fas fa-school\",\n\t\t\t\"fas-f54a\" => \"fas fa-screwdriver\",\n\t\t\t\"fas-f70e\" => \"fas fa-scroll\",\n\t\t\t\"fas-f7c2\" => \"fas fa-sd-card\",\n\t\t\t\"fas-f002\" => \"fas fa-search\",\n\t\t\t\"fas-f688\" => \"fas fa-search-dollar\",\n\t\t\t\"fas-f689\" => \"fas fa-search-location\",\n\t\t\t\"fas-f010\" => \"fas fa-search-minus\",\n\t\t\t\"fas-f00e\" => \"fas fa-search-plus\",\n\t\t\t\"fas-f4d8\" => \"fas fa-seedling\",\n\t\t\t\"fas-f233\" => \"fas fa-server\",\n\t\t\t\"fas-f61f\" => \"fas fa-shapes\",\n\t\t\t\"fas-f064\" => \"fas fa-share\",\n\t\t\t\"fas-f1e0\" => \"fas fa-share-alt\",\n\t\t\t\"fas-f1e1\" => \"fas fa-share-alt-square\",\n\t\t\t\"fas-f14d\" => \"fas fa-share-square\",\n\t\t\t\"fas-f20b\" => \"fas fa-shekel-sign\",\n\t\t\t\"fas-f3ed\" => \"fas fa-shield-alt\",\n\t\t\t\"fas-f96c\" => \"fas fa-shield-virus\",\n\t\t\t\"fas-f21a\" => \"fas fa-ship\",\n\t\t\t\"fas-f48b\" => \"fas fa-shipping-fast\",\n\t\t\t\"fas-f54b\" => \"fas fa-shoe-prints\",\n\t\t\t\"fas-f290\" => \"fas fa-shopping-bag\",\n\t\t\t\"fas-f291\" => \"fas fa-shopping-basket\",\n\t\t\t\"fas-f07a\" => \"fas fa-shopping-cart\",\n\t\t\t\"fas-f2cc\" => \"fas fa-shower\",\n\t\t\t\"fas-f5b6\" => \"fas fa-shuttle-van\",\n\t\t\t\"fas-f4d9\" => \"fas fa-sign\",\n\t\t\t\"fas-f2f6\" => \"fas fa-sign-in-alt\",\n\t\t\t\"fas-f2a7\" => \"fas fa-sign-language\",\n\t\t\t\"fas-f2f5\" => \"fas fa-sign-out-alt\",\n\t\t\t\"fas-f012\" => \"fas fa-signal\",\n\t\t\t\"fas-f5b7\" => \"fas fa-signature\",\n\t\t\t\"fas-f7c4\" => \"fas fa-sim-card\",\n\t\t\t\"fas-f0e8\" => \"fas fa-sitemap\",\n\t\t\t\"fas-f7c5\" => \"fas fa-skating\",\n\t\t\t\"fas-f7c9\" => \"fas fa-skiing\",\n\t\t\t\"fas-f7ca\" => \"fas fa-skiing-nordic\",\n\t\t\t\"fas-f54c\" => \"fas fa-skull\",\n\t\t\t\"fas-f714\" => \"fas fa-skull-crossbones\",\n\t\t\t\"fas-f715\" => \"fas fa-slash\",\n\t\t\t\"fas-f7cc\" => \"fas fa-sleigh\",\n\t\t\t\"fas-f1de\" => \"fas fa-sliders-h\",\n\t\t\t\"fas-f118\" => \"fas fa-smile\",\n\t\t\t\"fas-f5b8\" => \"fas fa-smile-beam\",\n\t\t\t\"fas-f4da\" => \"fas fa-smile-wink\",\n\t\t\t\"fas-f75f\" => \"fas fa-smog\",\n\t\t\t\"fas-f48d\" => \"fas fa-smoking\",\n\t\t\t\"fas-f54d\" => \"fas fa-smoking-ban\",\n\t\t\t\"fas-f7cd\" => \"fas fa-sms\",\n\t\t\t\"fas-f7ce\" => \"fas fa-snowboarding\",\n\t\t\t\"fas-f2dc\" => \"fas fa-snowflake\",\n\t\t\t\"fas-f7d0\" => \"fas fa-snowman\",\n\t\t\t\"fas-f7d2\" => \"fas fa-snowplow\",\n\t\t\t\"fas-f96e\" => \"fas fa-soap\",\n\t\t\t\"fas-f696\" => \"fas fa-socks\",\n\t\t\t\"fas-f5ba\" => \"fas fa-solar-panel\",\n\t\t\t\"fas-f0dc\" => \"fas fa-sort\",\n\t\t\t\"fas-f15d\" => \"fas fa-sort-alpha-down\",\n\t\t\t\"fas-f881\" => \"fas fa-sort-alpha-down-alt\",\n\t\t\t\"fas-f15e\" => \"fas fa-sort-alpha-up\",\n\t\t\t\"fas-f882\" => \"fas fa-sort-alpha-up-alt\",\n\t\t\t\"fas-f160\" => \"fas fa-sort-amount-down\",\n\t\t\t\"fas-f884\" => \"fas fa-sort-amount-down-alt\",\n\t\t\t\"fas-f161\" => \"fas fa-sort-amount-up\",\n\t\t\t\"fas-f885\" => \"fas fa-sort-amount-up-alt\",\n\t\t\t\"fas-f0dd\" => \"fas fa-sort-down\",\n\t\t\t\"fas-f162\" => \"fas fa-sort-numeric-down\",\n\t\t\t\"fas-f886\" => \"fas fa-sort-numeric-down-alt\",\n\t\t\t\"fas-f163\" => \"fas fa-sort-numeric-up\",\n\t\t\t\"fas-f887\" => \"fas fa-sort-numeric-up-alt\",\n\t\t\t\"fas-f0de\" => \"fas fa-sort-up\",\n\t\t\t\"fas-f5bb\" => \"fas fa-spa\",\n\t\t\t\"fas-f197\" => \"fas fa-space-shuttle\",\n\t\t\t\"fas-f891\" => \"fas fa-spell-check\",\n\t\t\t\"fas-f717\" => \"fas fa-spider\",\n\t\t\t\"fas-f110\" => \"fas fa-spinner\",\n\t\t\t\"fas-f5bc\" => \"fas fa-splotch\",\n\t\t\t\"fas-f5bd\" => \"fas fa-spray-can\",\n\t\t\t\"fas-f0c8\" => \"fas fa-square\",\n\t\t\t\"fas-f45c\" => \"fas fa-square-full\",\n\t\t\t\"fas-f698\" => \"fas fa-square-root-alt\",\n\t\t\t\"fas-f5bf\" => \"fas fa-stamp\",\n\t\t\t\"fas-f005\" => \"fas fa-star\",\n\t\t\t\"fas-f699\" => \"fas fa-star-and-crescent\",\n\t\t\t\"fas-f089\" => \"fas fa-star-half\",\n\t\t\t\"fas-f5c0\" => \"fas fa-star-half-alt\",\n\t\t\t\"fas-f69a\" => \"fas fa-star-of-david\",\n\t\t\t\"fas-f621\" => \"fas fa-star-of-life\",\n\t\t\t\"fas-f048\" => \"fas fa-step-backward\",\n\t\t\t\"fas-f051\" => \"fas fa-step-forward\",\n\t\t\t\"fas-f0f1\" => \"fas fa-stethoscope\",\n\t\t\t\"fas-f249\" => \"fas fa-sticky-note\",\n\t\t\t\"fas-f04d\" => \"fas fa-stop\",\n\t\t\t\"fas-f28d\" => \"fas fa-stop-circle\",\n\t\t\t\"fas-f2f2\" => \"fas fa-stopwatch\",\n\t\t\t\"fas-f96f\" => \"fas fa-stopwatch-20\",\n\t\t\t\"fas-f54e\" => \"fas fa-store\",\n\t\t\t\"fas-f54f\" => \"fas fa-store-alt\",\n\t\t\t\"fas-f970\" => \"fas fa-store-alt-slash\",\n\t\t\t\"fas-f971\" => \"fas fa-store-slash\",\n\t\t\t\"fas-f550\" => \"fas fa-stream\",\n\t\t\t\"fas-f21d\" => \"fas fa-street-view\",\n\t\t\t\"fas-f0cc\" => \"fas fa-strikethrough\",\n\t\t\t\"fas-f551\" => \"fas fa-stroopwafel\",\n\t\t\t\"fas-f12c\" => \"fas fa-subscript\",\n\t\t\t\"fas-f239\" => \"fas fa-subway\",\n\t\t\t\"fas-f0f2\" => \"fas fa-suitcase\",\n\t\t\t\"fas-f5c1\" => \"fas fa-suitcase-rolling\",\n\t\t\t\"fas-f185\" => \"fas fa-sun\",\n\t\t\t\"fas-f12b\" => \"fas fa-superscript\",\n\t\t\t\"fas-f5c2\" => \"fas fa-surprise\",\n\t\t\t\"fas-f5c3\" => \"fas fa-swatchbook\",\n\t\t\t\"fas-f5c4\" => \"fas fa-swimmer\",\n\t\t\t\"fas-f5c5\" => \"fas fa-swimming-pool\",\n\t\t\t\"fas-f69b\" => \"fas fa-synagogue\",\n\t\t\t\"fas-f021\" => \"fas fa-sync\",\n\t\t\t\"fas-f2f1\" => \"fas fa-sync-alt\",\n\t\t\t\"fas-f48e\" => \"fas fa-syringe\",\n\t\t\t\"fas-f0ce\" => \"fas fa-table\",\n\t\t\t\"fas-f45d\" => \"fas fa-table-tennis\",\n\t\t\t\"fas-f10a\" => \"fas fa-tablet\",\n\t\t\t\"fas-f3fa\" => \"fas fa-tablet-alt\",\n\t\t\t\"fas-f490\" => \"fas fa-tablets\",\n\t\t\t\"fas-f3fd\" => \"fas fa-tachometer-alt\",\n\t\t\t\"fas-f02b\" => \"fas fa-tag\",\n\t\t\t\"fas-f02c\" => \"fas fa-tags\",\n\t\t\t\"fas-f4db\" => \"fas fa-tape\",\n\t\t\t\"fas-f0ae\" => \"fas fa-tasks\",\n\t\t\t\"fas-f1ba\" => \"fas fa-taxi\",\n\t\t\t\"fas-f62e\" => \"fas fa-teeth\",\n\t\t\t\"fas-f62f\" => \"fas fa-teeth-open\",\n\t\t\t\"fas-f769\" => \"fas fa-temperature-high\",\n\t\t\t\"fas-f76b\" => \"fas fa-temperature-low\",\n\t\t\t\"fas-f7d7\" => \"fas fa-tenge\",\n\t\t\t\"fas-f120\" => \"fas fa-terminal\",\n\t\t\t\"fas-f034\" => \"fas fa-text-height\",\n\t\t\t\"fas-f035\" => \"fas fa-text-width\",\n\t\t\t\"fas-f00a\" => \"fas fa-th\",\n\t\t\t\"fas-f009\" => \"fas fa-th-large\",\n\t\t\t\"fas-f00b\" => \"fas fa-th-list\",\n\t\t\t\"fas-f630\" => \"fas fa-theater-masks\",\n\t\t\t\"fas-f491\" => \"fas fa-thermometer\",\n\t\t\t\"fas-f2cb\" => \"fas fa-thermometer-empty\",\n\t\t\t\"fas-f2c7\" => \"fas fa-thermometer-full\",\n\t\t\t\"fas-f2c9\" => \"fas fa-thermometer-half\",\n\t\t\t\"fas-f2ca\" => \"fas fa-thermometer-quarter\",\n\t\t\t\"fas-f2c8\" => \"fas fa-thermometer-three-quarters\",\n\t\t\t\"fas-f165\" => \"fas fa-thumbs-down\",\n\t\t\t\"fas-f164\" => \"fas fa-thumbs-up\",\n\t\t\t\"fas-f08d\" => \"fas fa-thumbtack\",\n\t\t\t\"fas-f3ff\" => \"fas fa-ticket-alt\",\n\t\t\t\"fas-f00d\" => \"fas fa-times\",\n\t\t\t\"fas-f057\" => \"fas fa-times-circle\",\n\t\t\t\"fas-f043\" => \"fas fa-tint\",\n\t\t\t\"fas-f5c7\" => \"fas fa-tint-slash\",\n\t\t\t\"fas-f5c8\" => \"fas fa-tired\",\n\t\t\t\"fas-f204\" => \"fas fa-toggle-off\",\n\t\t\t\"fas-f205\" => \"fas fa-toggle-on\",\n\t\t\t\"fas-f7d8\" => \"fas fa-toilet\",\n\t\t\t\"fas-f71e\" => \"fas fa-toilet-paper\",\n\t\t\t\"fas-f972\" => \"fas fa-toilet-paper-slash\",\n\t\t\t\"fas-f552\" => \"fas fa-toolbox\",\n\t\t\t\"fas-f7d9\" => \"fas fa-tools\",\n\t\t\t\"fas-f5c9\" => \"fas fa-tooth\",\n\t\t\t\"fas-f6a0\" => \"fas fa-torah\",\n\t\t\t\"fas-f6a1\" => \"fas fa-torii-gate\",\n\t\t\t\"fas-f722\" => \"fas fa-tractor\",\n\t\t\t\"fas-f25c\" => \"fas fa-trademark\",\n\t\t\t\"fas-f637\" => \"fas fa-traffic-light\",\n\t\t\t\"fas-f941\" => \"fas fa-trailer\",\n\t\t\t\"fas-f238\" => \"fas fa-train\",\n\t\t\t\"fas-f7da\" => \"fas fa-tram\",\n\t\t\t\"fas-f224\" => \"fas fa-transgender\",\n\t\t\t\"fas-f225\" => \"fas fa-transgender-alt\",\n\t\t\t\"fas-f1f8\" => \"fas fa-trash\",\n\t\t\t\"fas-f2ed\" => \"fas fa-trash-alt\",\n\t\t\t\"fas-f829\" => \"fas fa-trash-restore\",\n\t\t\t\"fas-f82a\" => \"fas fa-trash-restore-alt\",\n\t\t\t\"fas-f1bb\" => \"fas fa-tree\",\n\t\t\t\"fas-f091\" => \"fas fa-trophy\",\n\t\t\t\"fas-f0d1\" => \"fas fa-truck\",\n\t\t\t\"fas-f4de\" => \"fas fa-truck-loading\",\n\t\t\t\"fas-f63b\" => \"fas fa-truck-monster\",\n\t\t\t\"fas-f4df\" => \"fas fa-truck-moving\",\n\t\t\t\"fas-f63c\" => \"fas fa-truck-pickup\",\n\t\t\t\"fas-f553\" => \"fas fa-tshirt\",\n\t\t\t\"fas-f1e4\" => \"fas fa-tty\",\n\t\t\t\"fas-f26c\" => \"fas fa-tv\",\n\t\t\t\"fas-f0e9\" => \"fas fa-umbrella\",\n\t\t\t\"fas-f5ca\" => \"fas fa-umbrella-beach\",\n\t\t\t\"fas-f0cd\" => \"fas fa-underline\",\n\t\t\t\"fas-f0e2\" => \"fas fa-undo\",\n\t\t\t\"fas-f2ea\" => \"fas fa-undo-alt\",\n\t\t\t\"fas-f29a\" => \"fas fa-universal-access\",\n\t\t\t\"fas-f19c\" => \"fas fa-university\",\n\t\t\t\"fas-f127\" => \"fas fa-unlink\",\n\t\t\t\"fas-f09c\" => \"fas fa-unlock\",\n\t\t\t\"fas-f13e\" => \"fas fa-unlock-alt\",\n\t\t\t\"fas-f093\" => \"fas fa-upload\",\n\t\t\t\"fas-f007\" => \"fas fa-user\",\n\t\t\t\"fas-f406\" => \"fas fa-user-alt\",\n\t\t\t\"fas-f4fa\" => \"fas fa-user-alt-slash\",\n\t\t\t\"fas-f4fb\" => \"fas fa-user-astronaut\",\n\t\t\t\"fas-f4fc\" => \"fas fa-user-check\",\n\t\t\t\"fas-f2bd\" => \"fas fa-user-circle\",\n\t\t\t\"fas-f4fd\" => \"fas fa-user-clock\",\n\t\t\t\"fas-f4fe\" => \"fas fa-user-cog\",\n\t\t\t\"fas-f4ff\" => \"fas fa-user-edit\",\n\t\t\t\"fas-f500\" => \"fas fa-user-friends\",\n\t\t\t\"fas-f501\" => \"fas fa-user-graduate\",\n\t\t\t\"fas-f728\" => \"fas fa-user-injured\",\n\t\t\t\"fas-f502\" => \"fas fa-user-lock\",\n\t\t\t\"fas-f0f0\" => \"fas fa-user-md\",\n\t\t\t\"fas-f503\" => \"fas fa-user-minus\",\n\t\t\t\"fas-f504\" => \"fas fa-user-ninja\",\n\t\t\t\"fas-f82f\" => \"fas fa-user-nurse\",\n\t\t\t\"fas-f234\" => \"fas fa-user-plus\",\n\t\t\t\"fas-f21b\" => \"fas fa-user-secret\",\n\t\t\t\"fas-f505\" => \"fas fa-user-shield\",\n\t\t\t\"fas-f506\" => \"fas fa-user-slash\",\n\t\t\t\"fas-f507\" => \"fas fa-user-tag\",\n\t\t\t\"fas-f508\" => \"fas fa-user-tie\",\n\t\t\t\"fas-f235\" => \"fas fa-user-times\",\n\t\t\t\"fas-f0c0\" => \"fas fa-users\",\n\t\t\t\"fas-f509\" => \"fas fa-users-cog\",\n\t\t\t\"fas-f2e5\" => \"fas fa-utensil-spoon\",\n\t\t\t\"fas-f2e7\" => \"fas fa-utensils\",\n\t\t\t\"fas-f5cb\" => \"fas fa-vector-square\",\n\t\t\t\"fas-f221\" => \"fas fa-venus\",\n\t\t\t\"fas-f226\" => \"fas fa-venus-double\",\n\t\t\t\"fas-f228\" => \"fas fa-venus-mars\",\n\t\t\t\"fas-f492\" => \"fas fa-vial\",\n\t\t\t\"fas-f493\" => \"fas fa-vials\",\n\t\t\t\"fas-f03d\" => \"fas fa-video\",\n\t\t\t\"fas-f4e2\" => \"fas fa-video-slash\",\n\t\t\t\"fas-f6a7\" => \"fas fa-vihara\",\n\t\t\t\"fas-f974\" => \"fas fa-virus\",\n\t\t\t\"fas-f975\" => \"fas fa-virus-slash\",\n\t\t\t\"fas-f976\" => \"fas fa-viruses\",\n\t\t\t\"fas-f897\" => \"fas fa-voicemail\",\n\t\t\t\"fas-f45f\" => \"fas fa-volleyball-ball\",\n\t\t\t\"fas-f027\" => \"fas fa-volume-down\",\n\t\t\t\"fas-f6a9\" => \"fas fa-volume-mute\",\n\t\t\t\"fas-f026\" => \"fas fa-volume-off\",\n\t\t\t\"fas-f028\" => \"fas fa-volume-up\",\n\t\t\t\"fas-f772\" => \"fas fa-vote-yea\",\n\t\t\t\"fas-f729\" => \"fas fa-vr-cardboard\",\n\t\t\t\"fas-f554\" => \"fas fa-walking\",\n\t\t\t\"fas-f555\" => \"fas fa-wallet\",\n\t\t\t\"fas-f494\" => \"fas fa-warehouse\",\n\t\t\t\"fas-f773\" => \"fas fa-water\",\n\t\t\t\"fas-f83e\" => \"fas fa-wave-square\",\n\t\t\t\"fas-f496\" => \"fas fa-weight\",\n\t\t\t\"fas-f5cd\" => \"fas fa-weight-hanging\",\n\t\t\t\"fas-f193\" => \"fas fa-wheelchair\",\n\t\t\t\"fas-f1eb\" => \"fas fa-wifi\",\n\t\t\t\"fas-f72e\" => \"fas fa-wind\",\n\t\t\t\"fas-f410\" => \"fas fa-window-close\",\n\t\t\t\"fas-f2d0\" => \"fas fa-window-maximize\",\n\t\t\t\"fas-f2d1\" => \"fas fa-window-minimize\",\n\t\t\t\"fas-f2d2\" => \"fas fa-window-restore\",\n\t\t\t\"fas-f72f\" => \"fas fa-wine-bottle\",\n\t\t\t\"fas-f4e3\" => \"fas fa-wine-glass\",\n\t\t\t\"fas-f5ce\" => \"fas fa-wine-glass-alt\",\n\t\t\t\"fas-f159\" => \"fas fa-won-sign\",\n\t\t\t\"fas-f0ad\" => \"fas fa-wrench\",\n\t\t\t\"fas-f497\" => \"fas fa-x-ray\",\n\t\t\t\"fas-f157\" => \"fas fa-yen-sign\",\n\t\t\t\"fas-f6ad\" => \"fas fa-yin-y\"\n\t\t);\n\n\t\t$regular_icons = array(\t\n\t\t\t\"far-f2b9\" => \"far fa-address-book\",\n\t\t\t\"far-f2bb\" => \"far fa-address-card\",\n\t\t\t\"far-f556\" => \"far fa-angry\",\n\t\t\t\"far-f358\" => \"far fa-arrow-alt-circle-down\",\n\t\t\t\"far-f359\" => \"far fa-arrow-alt-circle-left\",\n\t\t\t\"far-f35a\" => \"far fa-arrow-alt-circle-right\",\n\t\t\t\"far-f35b\" => \"far fa-arrow-alt-circle-up\",\n\t\t\t\"far-f0f3\" => \"far fa-bell\",\n\t\t\t\"far-f1f6\" => \"far fa-bell-slash\",\n\t\t\t\"far-f02e\" => \"far fa-bookmark\",\n\t\t\t\"far-f1ad\" => \"far fa-building\",\n\t\t\t\"far-f133\" => \"far fa-calendar\",\n\t\t\t\"far-f073\" => \"far fa-calendar-alt\",\n\t\t\t\"far-f274\" => \"far fa-calendar-check\",\n\t\t\t\"far-f272\" => \"far fa-calendar-minus\",\n\t\t\t\"far-f271\" => \"far fa-calendar-plus\",\n\t\t\t\"far-f273\" => \"far fa-calendar-times\",\n\t\t\t\"far-f150\" => \"far fa-caret-square-down\",\n\t\t\t\"far-f191\" => \"far fa-caret-square-left\",\n\t\t\t\"far-f152\" => \"far fa-caret-square-right\",\n\t\t\t\"far-f151\" => \"far fa-caret-square-up\",\n\t\t\t\"far-f080\" => \"far fa-chart-bar\",\n\t\t\t\"far-f058\" => \"far fa-check-circle\",\n\t\t\t\"far-f14a\" => \"far fa-check-square\",\n\t\t\t\"far-f111\" => \"far fa-circle\",\n\t\t\t\"far-f328\" => \"far fa-clipboard\",\n\t\t\t\"far-f017\" => \"far fa-clock\",\n\t\t\t\"far-f24d\" => \"far fa-clone\",\n\t\t\t\"far-f20a\" => \"far fa-closed-captioning\",\n\t\t\t\"far-f075\" => \"far fa-comment\",\n\t\t\t\"far-f27a\" => \"far fa-comment-alt\",\n\t\t\t\"far-f4ad\" => \"far fa-comment-dots\",\n\t\t\t\"far-f086\" => \"far fa-comments\",\n\t\t\t\"far-f14e\" => \"far fa-compass\",\n\t\t\t\"far-f0c5\" => \"far fa-copy\",\n\t\t\t\"far-f1f9\" => \"far fa-copyright\",\n\t\t\t\"far-f09d\" => \"far fa-credit-card\",\n\t\t\t\"far-f567\" => \"far fa-dizzy\",\n\t\t\t\"far-f192\" => \"far fa-dot-circle\",\n\t\t\t\"far-f044\" => \"far fa-edit\",\n\t\t\t\"far-f0e0\" => \"far fa-envelope\",\n\t\t\t\"far-f2b6\" => \"far fa-envelope-open\",\n\t\t\t\"far-f06e\" => \"far fa-eye\",\n\t\t\t\"far-f070\" => \"far fa-eye-slash\",\n\t\t\t\"far-f15b\" => \"far fa-file\",\n\t\t\t\"far-f15c\" => \"far fa-file-alt\",\n\t\t\t\"far-f1c6\" => \"far fa-file-archive\",\n\t\t\t\"far-f1c7\" => \"far fa-file-audio\",\n\t\t\t\"far-f1c9\" => \"far fa-file-code\",\n\t\t\t\"far-f1c3\" => \"far fa-file-excel\",\n\t\t\t\"far-f1c5\" => \"far fa-file-image\",\n\t\t\t\"far-f1c1\" => \"far fa-file-pdf\",\n\t\t\t\"far-f1c4\" => \"far fa-file-powerpoint\",\n\t\t\t\"far-f1c8\" => \"far fa-file-video\",\n\t\t\t\"far-f1c2\" => \"far fa-file-word\",\n\t\t\t\"far-f024\" => \"far fa-flag\",\n\t\t\t\"far-f579\" => \"far fa-flushed\",\n\t\t\t\"far-f07b\" => \"far fa-folder\",\n\t\t\t\"far-f07c\" => \"far fa-folder-open\",\n\t\t\t\"far-f119\" => \"far fa-frown\",\n\t\t\t\"far-f57a\" => \"far fa-frown-open\",\n\t\t\t\"far-f1e3\" => \"far fa-futbol\",\n\t\t\t\"far-f3a5\" => \"far fa-gem\",\n\t\t\t\"far-f57f\" => \"far fa-grimace\",\n\t\t\t\"far-f580\" => \"far fa-grin\",\n\t\t\t\"far-f581\" => \"far fa-grin-alt\",\n\t\t\t\"far-f582\" => \"far fa-grin-beam\",\n\t\t\t\"far-f583\" => \"far fa-grin-beam-sweat\",\n\t\t\t\"far-f584\" => \"far fa-grin-hearts\",\n\t\t\t\"far-f585\" => \"far fa-grin-squint\",\n\t\t\t\"far-f586\" => \"far fa-grin-squint-tears\",\n\t\t\t\"far-f587\" => \"far fa-grin-stars\",\n\t\t\t\"far-f588\" => \"far fa-grin-tears\",\n\t\t\t\"far-f589\" => \"far fa-grin-tongue\",\n\t\t\t\"far-f58a\" => \"far fa-grin-tongue-squint\",\n\t\t\t\"far-f58b\" => \"far fa-grin-tongue-wink\",\n\t\t\t\"far-f58c\" => \"far fa-grin-wink\",\n\t\t\t\"far-f258\" => \"far fa-hand-lizard\",\n\t\t\t\"far-f256\" => \"far fa-hand-paper\",\n\t\t\t\"far-f25b\" => \"far fa-hand-peace\",\n\t\t\t\"far-f0a7\" => \"far fa-hand-point-down\",\n\t\t\t\"far-f0a5\" => \"far fa-hand-point-left\",\n\t\t\t\"far-f0a4\" => \"far fa-hand-point-right\",\n\t\t\t\"far-f0a6\" => \"far fa-hand-point-up\",\n\t\t\t\"far-f25a\" => \"far fa-hand-pointer\",\n\t\t\t\"far-f255\" => \"far fa-hand-rock\",\n\t\t\t\"far-f257\" => \"far fa-hand-scissors\",\n\t\t\t\"far-f259\" => \"far fa-hand-spock\",\n\t\t\t\"far-f2b5\" => \"far fa-handshake\",\n\t\t\t\"far-f0a0\" => \"far fa-hdd\",\n\t\t\t\"far-f004\" => \"far fa-heart\",\n\t\t\t\"far-f0f8\" => \"far fa-hospital\",\n\t\t\t\"far-f254\" => \"far fa-hourglass\",\n\t\t\t\"far-f2c1\" => \"far fa-id-badge\",\n\t\t\t\"far-f2c2\" => \"far fa-id-card\",\n\t\t\t\"far-f03e\" => \"far fa-image\",\n\t\t\t\"far-f302\" => \"far fa-images\",\n\t\t\t\"far-f11c\" => \"far fa-keyboard\",\n\t\t\t\"far-f596\" => \"far fa-kiss\",\n\t\t\t\"far-f597\" => \"far fa-kiss-beam\",\n\t\t\t\"far-f598\" => \"far fa-kiss-wink-heart\",\n\t\t\t\"far-f599\" => \"far fa-laugh\",\n\t\t\t\"far-f59a\" => \"far fa-laugh-beam\",\n\t\t\t\"far-f59b\" => \"far fa-laugh-squint\",\n\t\t\t\"far-f59c\" => \"far fa-laugh-wink\",\n\t\t\t\"far-f094\" => \"far fa-lemon\",\n\t\t\t\"far-f1cd\" => \"far fa-life-ring\",\n\t\t\t\"far-f0eb\" => \"far fa-lightbulb\",\n\t\t\t\"far-f022\" => \"far fa-list-alt\",\n\t\t\t\"far-f279\" => \"far fa-map\",\n\t\t\t\"far-f11a\" => \"far fa-meh\",\n\t\t\t\"far-f5a4\" => \"far fa-meh-blank\",\n\t\t\t\"far-f5a5\" => \"far fa-meh-rolling-eyes\",\n\t\t\t\"far-f146\" => \"far fa-minus-square\",\n\t\t\t\"far-f3d1\" => \"far fa-money-bill-alt\",\n\t\t\t\"far-f186\" => \"far fa-moon\",\n\t\t\t\"far-f1ea\" => \"far fa-newspaper\",\n\t\t\t\"far-f247\" => \"far fa-object-group\",\n\t\t\t\"far-f248\" => \"far fa-object-ungroup\",\n\t\t\t\"far-f1d8\" => \"far fa-paper-plane\",\n\t\t\t\"far-f28b\" => \"far fa-pause-circle\",\n\t\t\t\"far-f144\" => \"far fa-play-circle\",\n\t\t\t\"far-f0fe\" => \"far fa-plus-square\",\n\t\t\t\"far-f059\" => \"far fa-question-circle\",\n\t\t\t\"far-f25d\" => \"far fa-registered\",\n\t\t\t\"far-f5b3\" => \"far fa-sad-cry\",\n\t\t\t\"far-f5b4\" => \"far fa-sad-tear\",\n\t\t\t\"far-f0c7\" => \"far fa-save\",\n\t\t\t\"far-f14d\" => \"far fa-share-square\",\n\t\t\t\"far-f118\" => \"far fa-smile\",\n\t\t\t\"far-f5b8\" => \"far fa-smile-beam\",\n\t\t\t\"far-f4da\" => \"far fa-smile-wink\",\n\t\t\t\"far-f2dc\" => \"far fa-snowflake\",\n\t\t\t\"far-f0c8\" => \"far fa-square\",\n\t\t\t\"far-f005\" => \"far fa-star\",\n\t\t\t\"far-f089\" => \"far fa-star-half\",\n\t\t\t\"far-f249\" => \"far fa-sticky-note\",\n\t\t\t\"far-f28d\" => \"far fa-stop-circle\",\n\t\t\t\"far-f185\" => \"far fa-sun\",\n\t\t\t\"far-f5c2\" => \"far fa-surprise\",\n\t\t\t\"far-f165\" => \"far fa-thumbs-down\",\n\t\t\t\"far-f164\" => \"far fa-thumbs-up\",\n\t\t\t\"far-f057\" => \"far fa-times-circle\",\n\t\t\t\"far-f5c8\" => \"far fa-tired\",\n\t\t\t\"far-f2ed\" => \"far fa-trash-alt\",\n\t\t\t\"far-f007\" => \"far fa-user\",\n\t\t\t\"far-f2bd\" => \"far fa-user-circle\",\n\t\t\t\"far-f410\" => \"far fa-window-close\",\n\t\t\t\"far-f2d0\" => \"far fa-window-maximize\",\n\t\t\t\"far-f2d1\" => \"far fa-window-minimize\",\n\t\t\t\"far-f2d2\" => \"far fa-window-rest\"\n\t\t);\n\n\t\t$brand_icons = array(\n\t\t\t\"fab-f26e\" => \"fab fa-500px\",\n\t\t\t\"fab-f368\" => \"fab fa-accessible-icon\",\n\t\t\t\"fab-f369\" => \"fab fa-accusoft\",\n\t\t\t\"fab-f6af\" => \"fab fa-acquisitions-incorporated\",\n\t\t\t\"fab-f170\" => \"fab fa-adn\",\n\t\t\t\"fab-f778\" => \"fab fa-adobe\",\n\t\t\t\"fab-f36a\" => \"fab fa-adversal\",\n\t\t\t\"fab-f36b\" => \"fab fa-affiliatetheme\",\n\t\t\t\"fab-f834\" => \"fab fa-airbnb\",\n\t\t\t\"fab-f36c\" => \"fab fa-algolia\",\n\t\t\t\"fab-f642\" => \"fab fa-alipay\",\n\t\t\t\"fab-f270\" => \"fab fa-amazon\",\n\t\t\t\"fab-f42c\" => \"fab fa-amazon-pay\",\n\t\t\t\"fab-f36d\" => \"fab fa-amilia\",\n\t\t\t\"fab-f17b\" => \"fab fa-android\",\n\t\t\t\"fab-f209\" => \"fab fa-angellist\",\n\t\t\t\"fab-f36e\" => \"fab fa-angrycreative\",\n\t\t\t\"fab-f420\" => \"fab fa-angular\",\n\t\t\t\"fab-f36f\" => \"fab fa-app-store\",\n\t\t\t\"fab-f370\" => \"fab fa-app-store-ios\",\n\t\t\t\"fab-f371\" => \"fab fa-apper\",\n\t\t\t\"fab-f179\" => \"fab fa-apple\",\n\t\t\t\"fab-f415\" => \"fab fa-apple-pay\",\n\t\t\t\"fab-f77a\" => \"fab fa-artstation\",\n\t\t\t\"fab-f372\" => \"fab fa-asymmetrik\",\n\t\t\t\"fab-f77b\" => \"fab fa-atlassian\",\n\t\t\t\"fab-f373\" => \"fab fa-audible\",\n\t\t\t\"fab-f41c\" => \"fab fa-autoprefixer\",\n\t\t\t\"fab-f374\" => \"fab fa-avianex\",\n\t\t\t\"fab-f421\" => \"fab fa-aviato\",\n\t\t\t\"fab-f375\" => \"fab fa-aws\",\n\t\t\t\"fab-f2d5\" => \"fab fa-bandcamp\",\n\t\t\t\"fab-f835\" => \"fab fa-battle-net\",\n\t\t\t\"fab-f1b4\" => \"fab fa-behance\",\n\t\t\t\"fab-f1b5\" => \"fab fa-behance-square\",\n\t\t\t\"fab-f378\" => \"fab fa-bimobject\",\n\t\t\t\"fab-f171\" => \"fab fa-bitbucket\",\n\t\t\t\"fab-f379\" => \"fab fa-bitcoin\",\n\t\t\t\"fab-f37a\" => \"fab fa-bity\",\n\t\t\t\"fab-f27e\" => \"fab fa-black-tie\",\n\t\t\t\"fab-f37b\" => \"fab fa-blackberry\",\n\t\t\t\"fab-f37c\" => \"fab fa-blogger\",\n\t\t\t\"fab-f37d\" => \"fab fa-blogger-b\",\n\t\t\t\"fab-f293\" => \"fab fa-bluetooth\",\n\t\t\t\"fab-f294\" => \"fab fa-bluetooth-b\",\n\t\t\t\"fab-f836\" => \"fab fa-bootstrap\",\n\t\t\t\"fab-f15a\" => \"fab fa-btc\",\n\t\t\t\"fab-f837\" => \"fab fa-buffer\",\n\t\t\t\"fab-f37f\" => \"fab fa-buromobelexperte\",\n\t\t\t\"fab-f8a6\" => \"fab fa-buy-n-large\",\n\t\t\t\"fab-f20d\" => \"fab fa-buysellads\",\n\t\t\t\"fab-f785\" => \"fab fa-canadian-maple-leaf\",\n\t\t\t\"fab-f42d\" => \"fab fa-cc-amazon-pay\",\n\t\t\t\"fab-f1f3\" => \"fab fa-cc-amex\",\n\t\t\t\"fab-f416\" => \"fab fa-cc-apple-pay\",\n\t\t\t\"fab-f24c\" => \"fab fa-cc-diners-club\",\n\t\t\t\"fab-f1f2\" => \"fab fa-cc-discover\",\n\t\t\t\"fab-f24b\" => \"fab fa-cc-jcb\",\n\t\t\t\"fab-f1f1\" => \"fab fa-cc-mastercard\",\n\t\t\t\"fab-f1f4\" => \"fab fa-cc-paypal\",\n\t\t\t\"fab-f1f5\" => \"fab fa-cc-stripe\",\n\t\t\t\"fab-f1f0\" => \"fab fa-cc-visa\",\n\t\t\t\"fab-f380\" => \"fab fa-centercode\",\n\t\t\t\"fab-f789\" => \"fab fa-centos\",\n\t\t\t\"fab-f268\" => \"fab fa-chrome\",\n\t\t\t\"fab-f838\" => \"fab fa-chromecast\",\n\t\t\t\"fab-f383\" => \"fab fa-cloudscale\",\n\t\t\t\"fab-f384\" => \"fab fa-cloudsmith\",\n\t\t\t\"fab-f385\" => \"fab fa-cloudversify\",\n\t\t\t\"fab-f1cb\" => \"fab fa-codepen\",\n\t\t\t\"fab-f284\" => \"fab fa-codiepie\",\n\t\t\t\"fab-f78d\" => \"fab fa-confluence\",\n\t\t\t\"fab-f20e\" => \"fab fa-connectdevelop\",\n\t\t\t\"fab-f26d\" => \"fab fa-contao\",\n\t\t\t\"fab-f89e\" => \"fab fa-cotton-bureau\",\n\t\t\t\"fab-f388\" => \"fab fa-cpanel\",\n\t\t\t\"fab-f25e\" => \"fab fa-creative-commons\",\n\t\t\t\"fab-f4e7\" => \"fab fa-creative-commons-by\",\n\t\t\t\"fab-f4e8\" => \"fab fa-creative-commons-nc\",\n\t\t\t\"fab-f4e9\" => \"fab fa-creative-commons-nc-eu\",\n\t\t\t\"fab-f4ea\" => \"fab fa-creative-commons-nc-jp\",\n\t\t\t\"fab-f4eb\" => \"fab fa-creative-commons-nd\",\n\t\t\t\"fab-f4ec\" => \"fab fa-creative-commons-pd\",\n\t\t\t\"fab-f4ed\" => \"fab fa-creative-commons-pd-alt\",\n\t\t\t\"fab-f4ee\" => \"fab fa-creative-commons-remix\",\n\t\t\t\"fab-f4ef\" => \"fab fa-creative-commons-sa\",\n\t\t\t\"fab-f4f0\" => \"fab fa-creative-commons-sampling\",\n\t\t\t\"fab-f4f1\" => \"fab fa-creative-commons-sampling-plus\",\n\t\t\t\"fab-f4f2\" => \"fab fa-creative-commons-share\",\n\t\t\t\"fab-f4f3\" => \"fab fa-creative-commons-zero\",\n\t\t\t\"fab-f6c9\" => \"fab fa-critical-role\",\n\t\t\t\"fab-f13c\" => \"fab fa-css3\",\n\t\t\t\"fab-f38b\" => \"fab fa-css3-alt\",\n\t\t\t\"fab-f38c\" => \"fab fa-cuttlefish\",\n\t\t\t\"fab-f38d\" => \"fab fa-d-and-d\",\n\t\t\t\"fab-f6ca\" => \"fab fa-d-and-d-beyond\",\n\t\t\t\"fab-f952\" => \"fab fa-dailymotion\",\n\t\t\t\"fab-f210\" => \"fab fa-dashcube\",\n\t\t\t\"fab-f1a5\" => \"fab fa-delicious\",\n\t\t\t\"fab-f38e\" => \"fab fa-deploydog\",\n\t\t\t\"fab-f38f\" => \"fab fa-deskpro\",\n\t\t\t\"fab-f6cc\" => \"fab fa-dev\",\n\t\t\t\"fab-f1bd\" => \"fab fa-deviantart\",\n\t\t\t\"fab-f790\" => \"fab fa-dhl\",\n\t\t\t\"fab-f791\" => \"fab fa-diaspora\",\n\t\t\t\"fab-f1a6\" => \"fab fa-digg\",\n\t\t\t\"fab-f391\" => \"fab fa-digital-ocean\",\n\t\t\t\"fab-f392\" => \"fab fa-discord\",\n\t\t\t\"fab-f393\" => \"fab fa-discourse\",\n\t\t\t\"fab-f394\" => \"fab fa-dochub\",\n\t\t\t\"fab-f395\" => \"fab fa-docker\",\n\t\t\t\"fab-f396\" => \"fab fa-draft2digital\",\n\t\t\t\"fab-f17d\" => \"fab fa-dribbble\",\n\t\t\t\"fab-f397\" => \"fab fa-dribbble-square\",\n\t\t\t\"fab-f16b\" => \"fab fa-dropbox\",\n\t\t\t\"fab-f1a9\" => \"fab fa-drupal\",\n\t\t\t\"fab-f399\" => \"fab fa-dyalog\",\n\t\t\t\"fab-f39a\" => \"fab fa-earlybirds\",\n\t\t\t\"fab-f4f4\" => \"fab fa-ebay\",\n\t\t\t\"fab-f282\" => \"fab fa-edge\",\n\t\t\t\"fab-f430\" => \"fab fa-elementor\",\n\t\t\t\"fab-f5f1\" => \"fab fa-ello\",\n\t\t\t\"fab-f423\" => \"fab fa-ember\",\n\t\t\t\"fab-f1d1\" => \"fab fa-empire\",\n\t\t\t\"fab-f299\" => \"fab fa-envira\",\n\t\t\t\"fab-f39d\" => \"fab fa-erlang\",\n\t\t\t\"fab-f42e\" => \"fab fa-ethereum\",\n\t\t\t\"fab-f2d7\" => \"fab fa-etsy\",\n\t\t\t\"fab-f839\" => \"fab fa-evernote\",\n\t\t\t\"fab-f23e\" => \"fab fa-expeditedssl\",\n\t\t\t\"fab-f09a\" => \"fab fa-facebook\",\n\t\t\t\"fab-f39e\" => \"fab fa-facebook-f\",\n\t\t\t\"fab-f39f\" => \"fab fa-facebook-messenger\",\n\t\t\t\"fab-f082\" => \"fab fa-facebook-square\",\n\t\t\t\"fab-f6dc\" => \"fab fa-fantasy-flight-games\",\n\t\t\t\"fab-f797\" => \"fab fa-fedex\",\n\t\t\t\"fab-f798\" => \"fab fa-fedora\",\n\t\t\t\"fab-f799\" => \"fab fa-figma\",\n\t\t\t\"fab-f269\" => \"fab fa-firefox\",\n\t\t\t\"fab-f907\" => \"fab fa-firefox-browser\",\n\t\t\t\"fab-f2b0\" => \"fab fa-first-order\",\n\t\t\t\"fab-f50a\" => \"fab fa-first-order-alt\",\n\t\t\t\"fab-f3a1\" => \"fab fa-firstdraft\",\n\t\t\t\"fab-f16e\" => \"fab fa-flickr\",\n\t\t\t\"fab-f44d\" => \"fab fa-flipboard\",\n\t\t\t\"fab-f417\" => \"fab fa-fly\",\n\t\t\t\"fab-f2b4\" => \"fab fa-font-awesome\",\n\t\t\t\"fab-f35c\" => \"fab fa-font-awesome-alt\",\n\t\t\t\"fab-f425\" => \"fab fa-font-awesome-flag\",\n\t\t\t\"fab-f280\" => \"fab fa-fonticons\",\n\t\t\t\"fab-f3a2\" => \"fab fa-fonticons-fi\",\n\t\t\t\"fab-f286\" => \"fab fa-fort-awesome\",\n\t\t\t\"fab-f3a3\" => \"fab fa-fort-awesome-alt\",\n\t\t\t\"fab-f211\" => \"fab fa-forumbee\",\n\t\t\t\"fab-f180\" => \"fab fa-foursquare\",\n\t\t\t\"fab-f2c5\" => \"fab fa-free-code-camp\",\n\t\t\t\"fab-f3a4\" => \"fab fa-freebsd\",\n\t\t\t\"fab-f50b\" => \"fab fa-fulcrum\",\n\t\t\t\"fab-f50c\" => \"fab fa-galactic-republic\",\n\t\t\t\"fab-f50d\" => \"fab fa-galactic-senate\",\n\t\t\t\"fab-f265\" => \"fab fa-get-pocket\",\n\t\t\t\"fab-f260\" => \"fab fa-gg\",\n\t\t\t\"fab-f261\" => \"fab fa-gg-circle\",\n\t\t\t\"fab-f1d3\" => \"fab fa-git\",\n\t\t\t\"fab-f841\" => \"fab fa-git-alt\",\n\t\t\t\"fab-f1d2\" => \"fab fa-git-square\",\n\t\t\t\"fab-f09b\" => \"fab fa-github\",\n\t\t\t\"fab-f113\" => \"fab fa-github-alt\",\n\t\t\t\"fab-f092\" => \"fab fa-github-square\",\n\t\t\t\"fab-f3a6\" => \"fab fa-gitkraken\",\n\t\t\t\"fab-f296\" => \"fab fa-gitlab\",\n\t\t\t\"fab-f426\" => \"fab fa-gitter\",\n\t\t\t\"fab-f2a5\" => \"fab fa-glide\",\n\t\t\t\"fab-f2a6\" => \"fab fa-glide-g\",\n\t\t\t\"fab-f3a7\" => \"fab fa-gofore\",\n\t\t\t\"fab-f3a8\" => \"fab fa-goodreads\",\n\t\t\t\"fab-f3a9\" => \"fab fa-goodreads-g\",\n\t\t\t\"fab-f1a0\" => \"fab fa-google\",\n\t\t\t\"fab-f3aa\" => \"fab fa-google-drive\",\n\t\t\t\"fab-f3ab\" => \"fab fa-google-play\",\n\t\t\t\"fab-f2b3\" => \"fab fa-google-plus\",\n\t\t\t\"fab-f0d5\" => \"fab fa-google-plus-g\",\n\t\t\t\"fab-f0d4\" => \"fab fa-google-plus-square\",\n\t\t\t\"fab-f1ee\" => \"fab fa-google-wallet\",\n\t\t\t\"fab-f184\" => \"fab fa-gratipay\",\n\t\t\t\"fab-f2d6\" => \"fab fa-grav\",\n\t\t\t\"fab-f3ac\" => \"fab fa-gripfire\",\n\t\t\t\"fab-f3ad\" => \"fab fa-grunt\",\n\t\t\t\"fab-f3ae\" => \"fab fa-gulp\",\n\t\t\t\"fab-f1d4\" => \"fab fa-hacker-news\",\n\t\t\t\"fab-f3af\" => \"fab fa-hacker-news-square\",\n\t\t\t\"fab-f5f7\" => \"fab fa-hackerrank\",\n\t\t\t\"fab-f452\" => \"fab fa-hips\",\n\t\t\t\"fab-f3b0\" => \"fab fa-hire-a-helper\",\n\t\t\t\"fab-f427\" => \"fab fa-hooli\",\n\t\t\t\"fab-f592\" => \"fab fa-hornbill\",\n\t\t\t\"fab-f3b1\" => \"fab fa-hotjar\",\n\t\t\t\"fab-f27c\" => \"fab fa-houzz\",\n\t\t\t\"fab-f13b\" => \"fab fa-html5\",\n\t\t\t\"fab-f3b2\" => \"fab fa-hubspot\",\n\t\t\t\"fab-f913\" => \"fab fa-ideal\",\n\t\t\t\"fab-f2d8\" => \"fab fa-imdb\",\n\t\t\t\"fab-f16d\" => \"fab fa-instagram\",\n\t\t\t\"fab-f955\" => \"fab fa-instagram-square\",\n\t\t\t\"fab-f7af\" => \"fab fa-intercom\",\n\t\t\t\"fab-f26b\" => \"fab fa-internet-explorer\",\n\t\t\t\"fab-f7b0\" => \"fab fa-invision\",\n\t\t\t\"fab-f208\" => \"fab fa-ioxhost\",\n\t\t\t\"fab-f83a\" => \"fab fa-itch-io\",\n\t\t\t\"fab-f3b4\" => \"fab fa-itunes\",\n\t\t\t\"fab-f3b5\" => \"fab fa-itunes-note\",\n\t\t\t\"fab-f4e4\" => \"fab fa-java\",\n\t\t\t\"fab-f50e\" => \"fab fa-jedi-order\",\n\t\t\t\"fab-f3b6\" => \"fab fa-jenkins\",\n\t\t\t\"fab-f7b1\" => \"fab fa-jira\",\n\t\t\t\"fab-f3b7\" => \"fab fa-joget\",\n\t\t\t\"fab-f1aa\" => \"fab fa-joomla\",\n\t\t\t\"fab-f3b8\" => \"fab fa-js\",\n\t\t\t\"fab-f3b9\" => \"fab fa-js-square\",\n\t\t\t\"fab-f1cc\" => \"fab fa-jsfiddle\",\n\t\t\t\"fab-f5fa\" => \"fab fa-kaggle\",\n\t\t\t\"fab-f4f5\" => \"fab fa-keybase\",\n\t\t\t\"fab-f3ba\" => \"fab fa-keycdn\",\n\t\t\t\"fab-f3bb\" => \"fab fa-kickstarter\",\n\t\t\t\"fab-f3bc\" => \"fab fa-kickstarter-k\",\n\t\t\t\"fab-f42f\" => \"fab fa-korvue\",\n\t\t\t\"fab-f3bd\" => \"fab fa-laravel\",\n\t\t\t\"fab-f202\" => \"fab fa-lastfm\",\n\t\t\t\"fab-f203\" => \"fab fa-lastfm-square\",\n\t\t\t\"fab-f212\" => \"fab fa-leanpub\",\n\t\t\t\"fab-f41d\" => \"fab fa-less\",\n\t\t\t\"fab-f3c0\" => \"fab fa-line\",\n\t\t\t\"fab-f08c\" => \"fab fa-linkedin\",\n\t\t\t\"fab-f0e1\" => \"fab fa-linkedin-in\",\n\t\t\t\"fab-f2b8\" => \"fab fa-linode\",\n\t\t\t\"fab-f17c\" => \"fab fa-linux\",\n\t\t\t\"fab-f3c3\" => \"fab fa-lyft\",\n\t\t\t\"fab-f3c4\" => \"fab fa-magento\",\n\t\t\t\"fab-f59e\" => \"fab fa-mailchimp\",\n\t\t\t\"fab-f50f\" => \"fab fa-mandalorian\",\n\t\t\t\"fab-f60f\" => \"fab fa-markdown\",\n\t\t\t\"fab-f4f6\" => \"fab fa-mastodon\",\n\t\t\t\"fab-f136\" => \"fab fa-maxcdn\",\n\t\t\t\"fab-f8ca\" => \"fab fa-mdb\",\n\t\t\t\"fab-f3c6\" => \"fab fa-medapps\",\n\t\t\t\"fab-f23a\" => \"fab fa-medium\",\n\t\t\t\"fab-f3c7\" => \"fab fa-medium-m\",\n\t\t\t\"fab-f3c8\" => \"fab fa-medrt\",\n\t\t\t\"fab-f2e0\" => \"fab fa-meetup\",\n\t\t\t\"fab-f5a3\" => \"fab fa-megaport\",\n\t\t\t\"fab-f7b3\" => \"fab fa-mendeley\",\n\t\t\t\"fab-f91a\" => \"fab fa-microblog\",\n\t\t\t\"fab-f3ca\" => \"fab fa-microsoft\",\n\t\t\t\"fab-f3cb\" => \"fab fa-mix\",\n\t\t\t\"fab-f289\" => \"fab fa-mixcloud\",\n\t\t\t\"fab-f956\" => \"fab fa-mixer\",\n\t\t\t\"fab-f3cc\" => \"fab fa-mizuni\",\n\t\t\t\"fab-f285\" => \"fab fa-modx\",\n\t\t\t\"fab-f3d0\" => \"fab fa-monero\",\n\t\t\t\"fab-f3d2\" => \"fab fa-napster\",\n\t\t\t\"fab-f612\" => \"fab fa-neos\",\n\t\t\t\"fab-f5a8\" => \"fab fa-nimblr\",\n\t\t\t\"fab-f419\" => \"fab fa-node\",\n\t\t\t\"fab-f3d3\" => \"fab fa-node-js\",\n\t\t\t\"fab-f3d4\" => \"fab fa-npm\",\n\t\t\t\"fab-f3d5\" => \"fab fa-ns8\",\n\t\t\t\"fab-f3d6\" => \"fab fa-nutritionix\",\n\t\t\t\"fab-f263\" => \"fab fa-odnoklassniki\",\n\t\t\t\"fab-f264\" => \"fab fa-odnoklassniki-square\",\n\t\t\t\"fab-f510\" => \"fab fa-old-republic\",\n\t\t\t\"fab-f23d\" => \"fab fa-opencart\",\n\t\t\t\"fab-f19b\" => \"fab fa-openid\",\n\t\t\t\"fab-f26a\" => \"fab fa-opera\",\n\t\t\t\"fab-f23c\" => \"fab fa-optin-monster\",\n\t\t\t\"fab-f8d2\" => \"fab fa-orcid\",\n\t\t\t\"fab-f41a\" => \"fab fa-osi\",\n\t\t\t\"fab-f3d7\" => \"fab fa-page4\",\n\t\t\t\"fab-f18c\" => \"fab fa-pagelines\",\n\t\t\t\"fab-f3d8\" => \"fab fa-palfed\",\n\t\t\t\"fab-f3d9\" => \"fab fa-patreon\",\n\t\t\t\"fab-f1ed\" => \"fab fa-paypal\",\n\t\t\t\"fab-f704\" => \"fab fa-penny-arcade\",\n\t\t\t\"fab-f3da\" => \"fab fa-periscope\",\n\t\t\t\"fab-f3db\" => \"fab fa-phabricator\",\n\t\t\t\"fab-f3dc\" => \"fab fa-phoenix-framework\",\n\t\t\t\"fab-f511\" => \"fab fa-phoenix-squadron\",\n\t\t\t\"fab-f457\" => \"fab fa-php\",\n\t\t\t\"fab-f2ae\" => \"fab fa-pied-piper\",\n\t\t\t\"fab-f1a8\" => \"fab fa-pied-piper-alt\",\n\t\t\t\"fab-f4e5\" => \"fab fa-pied-piper-hat\",\n\t\t\t\"fab-f1a7\" => \"fab fa-pied-piper-pp\",\n\t\t\t\"fab-f91e\" => \"fab fa-pied-piper-square\",\n\t\t\t\"fab-f0d2\" => \"fab fa-pinterest\",\n\t\t\t\"fab-f231\" => \"fab fa-pinterest-p\",\n\t\t\t\"fab-f0d3\" => \"fab fa-pinterest-square\",\n\t\t\t\"fab-f3df\" => \"fab fa-playstation\",\n\t\t\t\"fab-f288\" => \"fab fa-product-hunt\",\n\t\t\t\"fab-f3e1\" => \"fab fa-pushed\",\n\t\t\t\"fab-f3e2\" => \"fab fa-python\",\n\t\t\t\"fab-f1d6\" => \"fab fa-qq\",\n\t\t\t\"fab-f459\" => \"fab fa-quinscape\",\n\t\t\t\"fab-f2c4\" => \"fab fa-quora\",\n\t\t\t\"fab-f4f7\" => \"fab fa-r-project\",\n\t\t\t\"fab-f7bb\" => \"fab fa-raspberry-pi\",\n\t\t\t\"fab-f2d9\" => \"fab fa-ravelry\",\n\t\t\t\"fab-f41b\" => \"fab fa-react\",\n\t\t\t\"fab-f75d\" => \"fab fa-reacteurope\",\n\t\t\t\"fab-f4d5\" => \"fab fa-readme\",\n\t\t\t\"fab-f1d0\" => \"fab fa-rebel\",\n\t\t\t\"fab-f3e3\" => \"fab fa-red-river\",\n\t\t\t\"fab-f1a1\" => \"fab fa-reddit\",\n\t\t\t\"fab-f281\" => \"fab fa-reddit-alien\",\n\t\t\t\"fab-f1a2\" => \"fab fa-reddit-square\",\n\t\t\t\"fab-f7bc\" => \"fab fa-redhat\",\n\t\t\t\"fab-f18b\" => \"fab fa-renren\",\n\t\t\t\"fab-f3e6\" => \"fab fa-replyd\",\n\t\t\t\"fab-f4f8\" => \"fab fa-researchgate\",\n\t\t\t\"fab-f3e7\" => \"fab fa-resolving\",\n\t\t\t\"fab-f5b2\" => \"fab fa-rev\",\n\t\t\t\"fab-f3e8\" => \"fab fa-rocketchat\",\n\t\t\t\"fab-f3e9\" => \"fab fa-rockrms\",\n\t\t\t\"fab-f267\" => \"fab fa-safari\",\n\t\t\t\"fab-f83b\" => \"fab fa-salesforce\",\n\t\t\t\"fab-f41e\" => \"fab fa-sass\",\n\t\t\t\"fab-f3ea\" => \"fab fa-schlix\",\n\t\t\t\"fab-f28a\" => \"fab fa-scribd\",\n\t\t\t\"fab-f3eb\" => \"fab fa-searchengin\",\n\t\t\t\"fab-f2da\" => \"fab fa-sellcast\",\n\t\t\t\"fab-f213\" => \"fab fa-sellsy\",\n\t\t\t\"fab-f3ec\" => \"fab fa-servicestack\",\n\t\t\t\"fab-f214\" => \"fab fa-shirtsinbulk\",\n\t\t\t\"fab-f957\" => \"fab fa-shopify\",\n\t\t\t\"fab-f5b5\" => \"fab fa-shopware\",\n\t\t\t\"fab-f215\" => \"fab fa-simplybuilt\",\n\t\t\t\"fab-f3ee\" => \"fab fa-sistrix\",\n\t\t\t\"fab-f512\" => \"fab fa-sith\",\n\t\t\t\"fab-f7c6\" => \"fab fa-sketch\",\n\t\t\t\"fab-f216\" => \"fab fa-skyatlas\",\n\t\t\t\"fab-f17e\" => \"fab fa-skype\",\n\t\t\t\"fab-f198\" => \"fab fa-slack\",\n\t\t\t\"fab-f3ef\" => \"fab fa-slack-hash\",\n\t\t\t\"fab-f1e7\" => \"fab fa-slideshare\",\n\t\t\t\"fab-f2ab\" => \"fab fa-snapchat\",\n\t\t\t\"fab-f2ac\" => \"fab fa-snapchat-ghost\",\n\t\t\t\"fab-f2ad\" => \"fab fa-snapchat-square\",\n\t\t\t\"fab-f1be\" => \"fab fa-soundcloud\",\n\t\t\t\"fab-f7d3\" => \"fab fa-sourcetree\",\n\t\t\t\"fab-f3f3\" => \"fab fa-speakap\",\n\t\t\t\"fab-f83c\" => \"fab fa-speaker-deck\",\n\t\t\t\"fab-f1bc\" => \"fab fa-spotify\",\n\t\t\t\"fab-f5be\" => \"fab fa-squarespace\",\n\t\t\t\"fab-f18d\" => \"fab fa-stack-exchange\",\n\t\t\t\"fab-f16c\" => \"fab fa-stack-overflow\",\n\t\t\t\"fab-f842\" => \"fab fa-stackpath\",\n\t\t\t\"fab-f3f5\" => \"fab fa-staylinked\",\n\t\t\t\"fab-f1b6\" => \"fab fa-steam\",\n\t\t\t\"fab-f1b7\" => \"fab fa-steam-square\",\n\t\t\t\"fab-f3f6\" => \"fab fa-steam-symbol\",\n\t\t\t\"fab-f3f7\" => \"fab fa-sticker-mule\",\n\t\t\t\"fab-f428\" => \"fab fa-strava\",\n\t\t\t\"fab-f429\" => \"fab fa-stripe\",\n\t\t\t\"fab-f42a\" => \"fab fa-stripe-s\",\n\t\t\t\"fab-f3f8\" => \"fab fa-studiovinari\",\n\t\t\t\"fab-f1a4\" => \"fab fa-stumbleupon\",\n\t\t\t\"fab-f1a3\" => \"fab fa-stumbleupon-circle\",\n\t\t\t\"fab-f2dd\" => \"fab fa-superpowers\",\n\t\t\t\"fab-f3f9\" => \"fab fa-supple\",\n\t\t\t\"fab-f7d6\" => \"fab fa-suse\",\n\t\t\t\"fab-f8e1\" => \"fab fa-swift\",\n\t\t\t\"fab-f83d\" => \"fab fa-symfony\",\n\t\t\t\"fab-f4f9\" => \"fab fa-teamspeak\",\n\t\t\t\"fab-f2c6\" => \"fab fa-telegram\",\n\t\t\t\"fab-f3fe\" => \"fab fa-telegram-plane\",\n\t\t\t\"fab-f1d5\" => \"fab fa-tencent-weibo\",\n\t\t\t\"fab-f69d\" => \"fab fa-the-red-yeti\",\n\t\t\t\"fab-f5c6\" => \"fab fa-themeco\",\n\t\t\t\"fab-f2b2\" => \"fab fa-themeisle\",\n\t\t\t\"fab-f731\" => \"fab fa-think-peaks\",\n\t\t\t\"fab-f513\" => \"fab fa-trade-federation\",\n\t\t\t\"fab-f181\" => \"fab fa-trello\",\n\t\t\t\"fab-f262\" => \"fab fa-tripadvisor\",\n\t\t\t\"fab-f173\" => \"fab fa-tumblr\",\n\t\t\t\"fab-f174\" => \"fab fa-tumblr-square\",\n\t\t\t\"fab-f1e8\" => \"fab fa-twitch\",\n\t\t\t\"fab-f099\" => \"fab fa-twitter\",\n\t\t\t\"fab-f081\" => \"fab fa-twitter-square\",\n\t\t\t\"fab-f42b\" => \"fab fa-typo3\",\n\t\t\t\"fab-f402\" => \"fab fa-uber\",\n\t\t\t\"fab-f7df\" => \"fab fa-ubuntu\",\n\t\t\t\"fab-f403\" => \"fab fa-uikit\",\n\t\t\t\"fab-f8e8\" => \"fab fa-umbraco\",\n\t\t\t\"fab-f404\" => \"fab fa-uniregistry\",\n\t\t\t\"fab-f949\" => \"fab fa-unity\",\n\t\t\t\"fab-f405\" => \"fab fa-untappd\",\n\t\t\t\"fab-f7e0\" => \"fab fa-ups\",\n\t\t\t\"fab-f287\" => \"fab fa-usb\",\n\t\t\t\"fab-f7e1\" => \"fab fa-usps\",\n\t\t\t\"fab-f407\" => \"fab fa-ussunnah\",\n\t\t\t\"fab-f408\" => \"fab fa-vaadin\",\n\t\t\t\"fab-f237\" => \"fab fa-viacoin\",\n\t\t\t\"fab-f2a9\" => \"fab fa-viadeo\",\n\t\t\t\"fab-f2aa\" => \"fab fa-viadeo-square\",\n\t\t\t\"fab-f409\" => \"fab fa-viber\",\n\t\t\t\"fab-f40a\" => \"fab fa-vimeo\",\n\t\t\t\"fab-f194\" => \"fab fa-vimeo-square\",\n\t\t\t\"fab-f27d\" => \"fab fa-vimeo-v\",\n\t\t\t\"fab-f1ca\" => \"fab fa-vine\",\n\t\t\t\"fab-f189\" => \"fab fa-vk\",\n\t\t\t\"fab-f40b\" => \"fab fa-vnv\",\n\t\t\t\"fab-f41f\" => \"fab fa-vuejs\",\n\t\t\t\"fab-f83f\" => \"fab fa-waze\",\n\t\t\t\"fab-f5cc\" => \"fab fa-weebly\",\n\t\t\t\"fab-f18a\" => \"fab fa-weibo\",\n\t\t\t\"fab-f1d7\" => \"fab fa-weixin\",\n\t\t\t\"fab-f232\" => \"fab fa-whatsapp\",\n\t\t\t\"fab-f40c\" => \"fab fa-whatsapp-square\",\n\t\t\t\"fab-f40d\" => \"fab fa-whmcs\",\n\t\t\t\"fab-f266\" => \"fab fa-wikipedia-w\",\n\t\t\t\"fab-f17a\" => \"fab fa-windows\",\n\t\t\t\"fab-f5cf\" => \"fab fa-wix\",\n\t\t\t\"fab-f730\" => \"fab fa-wizards-of-the-coast\",\n\t\t\t\"fab-f514\" => \"fab fa-wolf-pack-battalion\",\n\t\t\t\"fab-f19a\" => \"fab fa-wordpress\",\n\t\t\t\"fab-f411\" => \"fab fa-wordpress-simple\",\n\t\t\t\"fab-f297\" => \"fab fa-wpbeginner\",\n\t\t\t\"fab-f2de\" => \"fab fa-wpexplorer\",\n\t\t\t\"fab-f298\" => \"fab fa-wpforms\",\n\t\t\t\"fab-f3e4\" => \"fab fa-wpressr\",\n\t\t\t\"fab-f412\" => \"fab fa-xbox\",\n\t\t\t\"fab-f168\" => \"fab fa-xing\",\n\t\t\t\"fab-f169\" => \"fab fa-xing-square\",\n\t\t\t\"fab-f23b\" => \"fab fa-y-combinator\",\n\t\t\t\"fab-f19e\" => \"fab fa-yahoo\",\n\t\t\t\"fab-f840\" => \"fab fa-yammer\",\n\t\t\t\"fab-f413\" => \"fab fa-yandex\",\n\t\t\t\"fab-f414\" => \"fab fa-yandex-international\",\n\t\t\t\"fab-f7e3\" => \"fab fa-yarn\",\n\t\t\t\"fab-f1e9\" => \"fab fa-yelp\",\n\t\t\t\"fab-f2b1\" => \"fab fa-yoast\",\n\t\t\t\"fab-f167\" => \"fab fa-youtube\",\n\t\t\t\"fab-f431\" => \"fab fa-youtube-square\",\n\t\t\t\"fab-f63f\" => \"fab fa-zhihu\"\n\t\t);\n\n\t\t$icons = array_merge( $solid_icons, $regular_icons, $brand_icons );\n\n\t\t$icons = apply_filters( \"megamenu_fontawesome_5_icons\", $icons );\n\n\t\treturn $icons;\n\n\t}", "protected function checkTranslatedShortcut() {}", "function theme_options_validate($input) {\n $options = get_option('theme_options');\n $options['theme-w3css'] = trim($input['theme-w3css']);\n // if (!preg_match('/^[a-z\\-]{32}$/i', $options['theme-w3css']) ) {\n // $options['theme-w3css'] = '';\n // }\n return $options;\n}", "public function admin_enqueue_fontawesomeBlock(){\n\t\t}", "function validarFormulario()\n\t\t{\n\t\t}", "public function update_font_awesome_classes( $class ) {\n\t\t\t$exceptions = array(\n\t\t\t\t'icon-envelope' => 'fa-envelope-o',\n\t\t\t\t'icon-star-empty' => 'fa-star-o',\n\t\t\t\t'icon-ok' => 'fa-check',\n\t\t\t\t'icon-zoom-in' => 'fa-search-plus',\n\t\t\t\t'icon-zoom-out' => 'fa-search-minus',\n\t\t\t\t'icon-off' => 'fa-power-off',\n\t\t\t\t'icon-trash' => 'fa-trash-o',\n\t\t\t\t'icon-share' => 'fa-share-square-o',\n\t\t\t\t'icon-check' => 'fa-check-square-o',\n\t\t\t\t'icon-move' => 'fa-arrows',\n\t\t\t\t'icon-file' => 'fa-file-o',\n\t\t\t\t'icon-time' => 'fa-clock-o',\n\t\t\t\t'icon-download-alt' => 'fa-download',\n\t\t\t\t'icon-download' => 'fa-arrow-circle-o-down',\n\t\t\t\t'icon-upload' => 'fa-arrow-circle-o-up',\n\t\t\t\t'icon-play-circle' => 'fa-play-circle-o',\n\t\t\t\t'icon-indent-left' => 'fa-dedent',\n\t\t\t\t'icon-indent-right' => 'fa-indent',\n\t\t\t\t'icon-facetime-video' => 'fa-video-camera',\n\t\t\t\t'icon-picture' => 'fa-picture-o',\n\t\t\t\t'icon-plus-sign' => 'fa-plus-circle',\n\t\t\t\t'icon-minus-sign' => 'fa-minus-circle',\n\t\t\t\t'icon-remove-sign' => 'fa-times-circle',\n\t\t\t\t'icon-ok-sign' => 'fa-check-circle',\n\t\t\t\t'icon-question-sign' => 'fa-question-circle',\n\t\t\t\t'icon-info-sign' => 'fa-info-circle',\n\t\t\t\t'icon-screenshot' => 'fa-crosshairs',\n\t\t\t\t'icon-remove-circle' => 'fa-times-circle-o',\n\t\t\t\t'icon-ok-circle' => 'fa-check-circle-o',\n\t\t\t\t'icon-ban-circle' => 'fa-ban',\n\t\t\t\t'icon-share-alt' => 'fa-share',\n\t\t\t\t'icon-resize-full' => 'fa-expand',\n\t\t\t\t'icon-resize-small' => 'fa-compress',\n\t\t\t\t'icon-exclamation-sign' => 'fa-exclamation-circle',\n\t\t\t\t'icon-eye-open' => 'fa-eye',\n\t\t\t\t'icon-eye-close' => 'fa-eye-slash',\n\t\t\t\t'icon-warning-sign' => 'fa-warning',\n\t\t\t\t'icon-folder-close' => 'fa-folder',\n\t\t\t\t'icon-resize-vertical' => 'fa-arrows-v',\n\t\t\t\t'icon-resize-horizontal' => 'fa-arrows-h',\n\t\t\t\t'icon-twitter-sign' => 'fa-twitter-square',\n\t\t\t\t'icon-facebook-sign' => 'fa-facebook-square',\n\t\t\t\t'icon-thumbs-up' => 'fa-thumbs-o-up',\n\t\t\t\t'icon-thumbs-down' => 'fa-thumbs-o-down',\n\t\t\t\t'icon-heart-empty' => 'fa-heart-o',\n\t\t\t\t'icon-signout' => 'fa-sign-out',\n\t\t\t\t'icon-linkedin-sign' => 'fa-linkedin-square',\n\t\t\t\t'icon-pushpin' => 'fa-thumb-tack',\n\t\t\t\t'icon-signin' => 'fa-sign-in',\n\t\t\t\t'icon-github-sign' => 'fa-github-square',\n\t\t\t\t'icon-upload-alt' => 'fa-upload',\n\t\t\t\t'icon-lemon' => 'fa-lemon-o',\n\t\t\t\t'icon-check-empty' => 'fa-square-o',\n\t\t\t\t'icon-bookmark-empty' => 'fa-bookmark-o',\n\t\t\t\t'icon-phone-sign' => 'fa-phone-square',\n\t\t\t\t'icon-hdd' => 'fa-hdd-o',\n\t\t\t\t'icon-hand-right' => 'fa-hand-o-right',\n\t\t\t\t'icon-hand-left' => 'fa-hand-o-left',\n\t\t\t\t'icon-hand-up' => 'fa-hand-o-up',\n\t\t\t\t'icon-hand-down' => 'fa-hand-o-down',\n\t\t\t\t'icon-circle-arrow-left' => 'fa-arrow-circle-left',\n\t\t\t\t'icon-circle-arrow-right' => 'fa-arrow-circle-right',\n\t\t\t\t'icon-circle-arrow-up' => 'fa-arrow-circle-up',\n\t\t\t\t'icon-circle-arrow-down' => 'fa-arrow-circle-down',\n\t\t\t\t'icon-fullscreen' => 'fa-arrows-alt',\n\t\t\t\t'icon-beaker' => 'fa-flask',\n\t\t\t\t'icon-paper-clip' => 'fa-paperclip',\n\t\t\t\t'icon-sign-blank' => 'fa-square',\n\t\t\t\t'icon-pinterest-sign' => 'fa-pinterest-square',\n\t\t\t\t'icon-google-plus-sign' => 'fa-google-plus-square',\n\t\t\t\t'icon-envelope-alt' => 'fa-envelope',\n\t\t\t\t'icon-comment-alt' => 'fa-comment-o',\n\t\t\t\t'icon-comments-alt' => 'fa-comments-o'\n\t\t\t);\n\n\t\t\tif( in_array( $class, array_keys( $exceptions ) ) ){\n\t\t\t\t$class = $exceptions[ $class ];\n\t\t\t}\n\n\t\t\t$class = str_replace( 'icon-', 'fa-', $class );\n\n\t\t\treturn $class;\n\t\t}", "private function validate_icon_data( $data ) {\n\n\t\t\t$validate = array_diff( $this->default_icon_data, array( 'icon_base', 'icon_prefix' ) );\n\n\t\t\tforeach ( $validate as $key => $field ) {\n\n\t\t\t\tif ( empty( $data[ $key ] ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}", "function validate() {\n // @todo Remove module_load_include() call when moving to Drupal core.\n module_load_include('inc', 'fapitng', '/includes/fapitng.validate');\n foreach ($this->validate_callbacks as $callback => $info) {\n if (!call_user_func_array($callback, array_merge(array($this->value), $info['arguments']))) {\n $this->errors[] = $info['message'];\n }\n }\n if ($this->errors) {\n $this->request['invalid_elements'][$this->id] = $this;\n }\n $this->validateInputElements($this->children);\n\n if (!empty($this->request['invalid_elements'])) {\n $this->request['rebuild'] = TRUE;\n return FALSE;\n }\n return TRUE;\n }", "function pagely_load_font_awesome() {\n\t\n\twp_enqueue_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', false, false, false ); \n}", "private function getFa() \n {\n $allStates = [\n 'S0' => 0,\n 'S1' => 1, \n 'S2' => 2,\n ];\n \n $initialState = 'S0';\n \n $allowableInputAlphabets = range('0','9');\n\n $acceptableFinalStates = ['S0', 'S1', 'S2'];\n\n $fa = new fa($allStates, $allowableInputAlphabets, $initialState, $acceptableFinalStates, 'transitionFunc');\n \n return $fa;\n }", "function __construct()\n\t{\n\t\t$this->name = 'font-awesome';\n\t\t$this->label = __('Font Awesome Icon');\n\t\t$this->category = __(\"Content\",'acf'); // Basic, Content, Choice, etc\n\t\t$this->defaults = array(\n\t\t\t'enqueue_fa' \t=>\t0,\n\t\t\t'allow_null' \t=>\t0,\n\t\t\t'save_format'\t=> 'element',\n\t\t\t'default_value'\t=>\t'',\n\t\t\t'choices'\t\t=>\t$this->get_icons()\n\t\t);\n\n\t\t$this->settings = array(\n\t\t\t'path' => apply_filters('acf/helpers/get_path', __FILE__),\n\t\t\t'dir' => apply_filters('acf/helpers/get_dir', __FILE__),\n\t\t\t'version' => '1.5'\n\t\t);\n\n\t\tadd_filter('acf/load_field', array( $this, 'maybe_enqueue_font_awesome' ) );\n\n \tparent::__construct();\n\t}", "public function use_pro() {\n\t\tif ( defined( \"MEGAMENU_PRO_USE_FONTAWESOME5_PRO\" ) ) {\n\t\t\treturn MEGAMENU_PRO_USE_FONTAWESOME5_PRO;\n\t\t}\n\n\t\tif ( function_exists( 'FortAwesome\\fa' ) && fa()->pro() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function studeon_vc_iconpicker_type_fontawesome($icons) {\n\t\t$list = studeon_get_list_icons();\n\t\tif (!is_array($list) || count($list) == 0) return $icons;\n\t\t$rez = array();\n\t\tforeach ($list as $icon)\n\t\t\t$rez[] = array($icon => str_replace('icon-', '', $icon));\n\t\treturn array_merge( $icons, array(esc_html__('Theme Icons', 'studeon') => $rez) );\n\t}", "protected function areFieldChangeFunctionsValid() {}", "public function getXfa() {}", "private function ValidateTranslationFields()\t\n\t{\n\t\t// check for required fields\t\t\n\t\tforeach($this->arrTranslations as $key => $val){\t\t\t\n\t\t\tif(strlen($val['image_text']) > 2048){\n\t\t\t\t$this->error = str_replace('_FIELD_', '<b>'._DESCRIPTION.'</b>', _FIELD_LENGTH_EXCEEDED);\n\t\t\t\t$this->error = str_replace('_LENGTH_', 2048, $this->error);\n\t\t\t\t$this->errorField = 'image_text_'.$key;\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\treturn true;\t\t\n\t}", "public function input_admin_enqueue_scripts() {\n\t\t// Min version ?\n\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ? '' : '.min';\n\n\t\twp_localize_script( 'acf-input-svg-icon', 'svg_icon_format_data', $this->parse_svg() );\n\t\twp_register_style( 'acf-input-svg-icon', ACF_SVG_ICON_URL . 'assets/css/style' . $suffix . '.css', array( 'select2' ), ACF_SVG_ICON_VER );\n\n\t\twp_enqueue_script( 'acf-input-svg-icon' );\n\t\twp_enqueue_style( 'acf-input-svg-icon' );\n\t}", "public function validate()\r\n\t{\r\n\t\tLumine_Validator_PHPValidator::clearValidations($this);\r\n\t\t// adicionando as regras \r\n\t\tLumine_Validator_PHPValidator::addValidation($this, 'nomeImagensUteis', Lumine_Validator::REQUIRED_STRING, 'Informe o nome da Imagem');\r\n\t\t\r\n\t\treturn parent::validate();\r\n\t}", "public function isMenuItemValidSetValidHrefAndTitleExpectTrue() {}" ]
[ "0.60326743", "0.5958138", "0.5934675", "0.56425655", "0.54771394", "0.54528016", "0.539618", "0.51538515", "0.50936645", "0.5065235", "0.5027622", "0.49419186", "0.4885704", "0.48843855", "0.48750663", "0.48740023", "0.485638", "0.48540446", "0.47822866", "0.47736126", "0.4768062", "0.47541466", "0.47154555", "0.4714215", "0.47117516", "0.46806416", "0.4674886", "0.46744716", "0.46701622", "0.4668283" ]
0.6673344
0
Validate the Font Awesome icon name.
public static function validateIconName($element, FormStateInterface $form_state) { // Load the configuration settings. $configuration_settings = \Drupal::config('fontawesome.settings'); // Check if we need to bypass. if ($configuration_settings->get('bypass_validation')) { return; } $value = $element['#value']; if (strlen($value) == 0) { $form_state->setValueForElement($element, ''); return; } // Load the icon data so we can check for a valid icon. $iconData = \Drupal::service('fontawesome.font_awesome_manager')->getIconMetadata($value); if (!isset($iconData['name'])) { $form_state->setError($element, t("Invalid icon name %value. Please see @iconLink for correct icon names, or turn off validation in the Font Awesome settings if you are trying to use custom icon names.", [ '%value' => $value, '@iconLink' => Link::fromTextAndUrl(t('the Font Awesome icon list'), Url::fromUri('https://fontawesome.com/icons'))->toString(), ])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIconName() {}", "public function getIconName() {}", "public function getIconName() {}", "public function getIconName() {}", "private function assertTheNameOnlyContainsAllowedCharacters()\n {\n if (1 !== preg_match(self::NAME_REGEX, $this->getName())) {\n throw new Exception('The result of the getName method can only contain letters, numbers, underscore and dashes.');\n }\n }", "public function validateName($attribute)\n {\n if (!$this->hasErrors()) {\n if (!preg_match('/^[\\w\\s\\p{L}]{1,255}$/u', $this->$attribute)) {\n $this->addError($attribute, Yii::t('podium/view', 'Name must contain only letters, digits, underscores and spaces (255 characters max).'));\n }\n }\n }", "static function checkNames($input)\r\n {\r\n if (preg_match('/^[\\w\\W][\\w\\W]{1,20}$/', $input)) {\r\n return true; //Illegal Character found!\r\n } else {\r\n echo PageBuilder::printError(\"Please enter alphabets only in name fields.\");\r\n return false;\r\n }\r\n }", "function fa_icon( $icon = 'user' ) {\n\t\treturn \"<i class=\\\"fa fa-{$icon}\\\"></i>\";\n\t}", "protected function checkName()\n {\n if (preg_match('/^[a-zA-Z_]{1}[a-zA-Z_0-9]*$/', $this->name) == false) {\n throw new ReflectionException('Annotation parameter name may contain letters, underscores and numbers, but contains an invalid character.');\n }\n }", "public function hasValidNameArgument()\n {\n $name = $this->argument('name');\n\n if (! Str::contains($name, '/')) {\n $this->error(\"The name argument expects a vendor and name in 'Composer' format. Here's an example: `vendor/name`.\");\n\n return false;\n }\n\n return true;\n }", "public static function isValidName($name) {}", "private function validate_icon_data( $data ) {\n\n\t\t\t$validate = array_diff( $this->default_icon_data, array( 'icon_base', 'icon_prefix' ) );\n\n\t\t\tforeach ( $validate as $key => $field ) {\n\n\t\t\t\tif ( empty( $data[ $key ] ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}", "private function assertValidName() : void\n {\n InvalidDescriptorArgumentException::assertIsNotEmpty(\n $this->name,\n '#[Route.name] must contain a non-empty string.'\n );\n }", "public function setIconName($iconName) {}", "public function setIconName($iconName) {}", "public function setIconName($iconName) {}", "protected static function validateName($file, $name, $attr)\n {\n $accept = array_map('trim', explode(',', strtolower($attr)));\n\n $extensions = array_filter($accept, function($value) {\n return !strstr($value, '/');\n });\n\n $mimes = array_filter($accept, function($value) {\n return strstr($value, '/');\n });\n\n if (static::validateExtension($name, $extensions) || static::validateMime($file, $mimes)) {\n return;\n }\n\n throw new InvalidValueException(sprintf(static::$error_message, $attr));\n }", "function is_name_valid($input)\n {\n return (preg_match(\"/^([-a-z_ ])+$/i\", $input)) ? TRUE : FALSE;\n }", "function _name_check($str){\n }", "function nameValidator() {\n\t\tglobal $firstname;\n\t\treturn ctype_alpha($firstname);\n\t}", "public function get_icon()\n\t{\n\t\treturn 'fab fa-algolia';\n\t}", "public function icon($icon);", "public function validateName()\n {\n if (strlen(trim($_POST[$this->key])) < $this->minLength) {\n self::$errors[] = $this->convertUnderscores() . \" field requires at least $this->minLength characters\";\n }\n\n //check for profanity.\n if ($this->noProfanity) {\n $this->checkProfanity();\n }\n\n //lastly, check for valid first name patterns.\n\n if (!preg_match(\"/^[a-zA-Z]+[ -\\/\\\\'\\\"]*[a-zA-Z]+[ \\\"]{0,2}[a-zA-Z]*$/\", trim($_POST[$this->key]))) {\n self::$errors[] = \"Not a valid \" . $this->convertUnderscores();\n }\n\n return self::$errors ? false : true;\n }", "function font_awesome($icon){\n\treturn \"<span class='fa fa-fw $icon'></span>\";\n}", "public function validateRealname() {\r\n $leng = mb_strlen($this->data[$this->name]['RealName']);\r\n if ($leng > 128) {\r\n return FALSE;\r\n } else if ($leng > 64) {\r\n if (mb_ereg(self::_REGEX_FULLWITH, $this->data[$this->name]['RealName']) !== false) {\r\n return FALSE;\r\n }\r\n }\r\n return TRUE;\r\n }", "public function getIconName(): ?string;", "public function enqueue_font_awesome() {\n\t\tglobal $hestia_load_fa;\n\n\t\tif ( $hestia_load_fa !== true ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twp_enqueue_style( 'font-awesome-5-all', get_template_directory_uri() . '/assets/font-awesome/css/all.min.css', array(), HESTIA_VENDOR_VERSION );\n\t\tif ( $this->should_load_shim() ) {\n\t\t\twp_enqueue_style( 'font-awesome-4-shim', get_template_directory_uri() . '/assets/font-awesome/css/v4-shims.min.css', array(), HESTIA_VENDOR_VERSION );\n\t\t}\n\n\t\treturn true;\n\t}", "public static function nameIsValid($name) {\r\n return ( is_string($name) && !empty($name) && strlen($name) >=2 ); \r\n }", "public static function filename_valid($name) {\n return strlen($name) < 100 && preg_match(\"/^[a-z0-9 \\.-]+$/i\", $name) != 0;\n }", "function us_is_fallback_icon( $icon_name ) {\r\n\t\treturn in_array( $icon_name, array(\r\n\t\t\t'angle-down',\r\n\t\t\t'angle-left',\r\n\t\t\t'angle-right',\r\n\t\t\t'angle-up',\r\n\t\t\t'bars',\r\n\t\t\t'check',\r\n\t\t\t'comments',\r\n\t\t\t'copy',\r\n\t\t\t'envelope',\r\n\t\t\t'map-marker-alt',\r\n\t\t\t'mobile',\r\n\t\t\t'phone',\r\n\t\t\t'play',\r\n\t\t\t'quote-left',\r\n\t\t\t'search',\r\n\t\t\t'search-plus',\r\n\t\t\t'shopping-cart',\r\n\t\t\t'star',\r\n\t\t\t'tags',\r\n\t\t\t'times',\r\n\t\t) );\r\n\t}" ]
[ "0.58730716", "0.58730716", "0.58724123", "0.58724123", "0.5839516", "0.56914526", "0.56051415", "0.5596326", "0.55347383", "0.5519239", "0.551734", "0.55072576", "0.54797703", "0.5433613", "0.5433613", "0.543236", "0.54220545", "0.5421784", "0.53743976", "0.53476727", "0.5347339", "0.5316145", "0.5272626", "0.527031", "0.52354217", "0.52215093", "0.52147657", "0.52124554", "0.52094007", "0.5199331" ]
0.7926421
0
Calculates the URL to the page containing parameters for the form fields which have been specified as needing values passed via the URL. This helps when the CMS user wants to copy and paste the URL in to an email to others, or display on the screen etc. Often a 3rd party system should create the paramertised URL.
protected function calculateUrlWithParams() { // Get the absolute URL to the page including the site domain. // Get the Url parameter records for this page. // Also include the project coordinator field values in the URL parameters. $pageUrl = $this->AbsoluteLink(); $parameters = ""; // If values for the project code, Project Manager, Project Coordinator, or Project Coordinator // email fields have been specified include them as parameters in the URL. if ($this->ProjectName) { $parameters .= '&Project_Name=' . urlencode($this->ProjectName); } if ($this->ProjectCode) { $parameters .= '&Project_Code=' . urlencode($this->ProjectCode); } if ($this->ProjectManager) { $parameters .= '&Project_Manager=' . urlencode($this->ProjectManager); } if ($this->ProjectManagerEmail) { $parameters .= '&Project_Manager_email=' . urlencode($this->ProjectManagerEmail); } if ($this->ProjectCoordinator) { $parameters .= '&Project_Coordinator=' . urlencode($this->ProjectCoordinator); } if ($this->ProjectCoordinatorEmail) { $parameters .= '&Project_Coordinator_email=' . urlencode($this->ProjectCoordinatorEmail); } // Get the URL parameters specified for this page. Loop and add them. $parameterFields = $this->UrlParams()->sort('SortOrder', 'Asc'); foreach($parameterFields as $field) { $parameters .= '&' . str_replace(' ', '_', $field->PostcardMetadataField()->Label) . '=' . urlencode($field->Value); } // Remove first & and replace with ?. $parameters = ltrim($parameters, '&'); // Put together the URL of the page with the params. $pageUrl .= '?' . $parameters; return $pageUrl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_url_params()\n {\n }", "private function getParamsUrlFormat() {\n $urlParams = \"\";\n\n if ($this->getMethod() == 'GET') {\n $urlParams .= ($this->getPaging()) ? \n \"?_paging=1\" : \n \"\";\n $urlParams .= ($this->getPaging()) ? \n \"&_return_as_object=1\" : \n \"\";\n $urlParams .= ($this->getPaging()) ? \n \"&_max_results=\" . $this->getMaxResults() : \n \"\";\n }\n\n if ($this->getMethod() == 'POST') {\n $function = $this->getFuction();\n $urlParams .= (isset($function) and $function != \"\") ?\n \"?_function=\" . $this->getFuction() :\n \"\";\n }\n\n return $urlParams;\n }", "public function getUrl ()\n {\n $url = $this->_config['formAction'] . '?';\n \n foreach ($this->_params as $key => $value) {\n if ($value != '') {\n $url .= $key . '=' . $value . '&';\n }\n }\n \n $url .= 'SHASign=' . $this->getSha1Sign();\n \n return $url;\n }", "function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }", "public function getUrl() {\n $url = $this->request->get_normalized_http_url() . '?';\n $url .= http_build_query($this->request->get_parameters(), '', '&');\n\n return $url;\n }", "public function getAdditionalParams()\n {\n return oxRegistry::get(\"oxUtilsUrl\")->processUrl('', false);\n }", "private function generateURL()\n\t{\n\t\t// Is there's a query string, strip it from the URI\n\t\t$sURI\t= ($iPos = strpos($_SERVER['REQUEST_URI'], '?')) ?\n\t\t\t\t\tsubstr($_SERVER['REQUEST_URI'], 0, $iPos) :\n\t\t\t\t\t$_SERVER['REQUEST_URI'];\n\n\t\t// Is there's a ampersand string, strip it from the URI\n\t\t$sURI\t= ($i = strpos($sURI, '&')) ?\n\t\t\t\t\tsubstr($sURI, 0, $i) :\n\t\t\t\t\t$sURI;\n\n\t\t// Is there's a hash string, strip it from the URI\n\t\t$sURI\t= ($i = strpos($sURI, '#')) ?\n\t\t\t\t\tsubstr($sURI, 0, $i) :\n\t\t\t\t\t$sURI;\n\n\t\t// If we're on page 1\n\t\tif($this->iPage == 1)\n\t\t{\n\t\t\t$this->sURL\t\t= $sURI;\n\t\t}\n\t\t// Else we need to pull off the current page\n\t\telse\n\t\t{\n\t\t\t// Split the URI by / after trimming them off the front and end\n\t\t\t$aURI\t= explode('/', trim($sURI, '/'));\n\n\t\t\t// If the last part doesn't match the current page\n\t\t\t$iPage\t= array_pop($aURI);\n\t\t\tif($iPage != $this->iPage) {\n\t\t\t\ttrigger_error(__METHOD__ . ' Error: Invalid page passed. ' . $iPage . ' / ' . $this->iPage, E_USER_ERROR);\n\t\t\t}\n\n\t\t\t// If there is no other parts\n\t\t\tif(count($aURI) == 0) {\n\t\t\t\t$this->sURL = '/';\n\t\t\t} else {\n\t\t\t\t$this->sURL = '/' . implode('/', $aURI) . '/';\n\t\t\t}\n\t\t}\n\n\t\t// Set the query string\n\t\t$this->sQuery\t= ($iPos) ? substr($_SERVER['REQUEST_URI'], $iPos) : '';\n\t}", "public function url() {\n if (empty($this->parameters)) {\n return $this->url;\n }\n\n return $this->url . '?' . http_build_query($this->parameters);\n }", "private static function generateUrlPrams(){\n\t\t$url = [] ;\n\t\tif ( isset($_GET['urlFromHtaccess']) ){\n\t\t\t$url = explode('/' , trim($_GET['urlFromHtaccess']) );\n\t\t}\n\t\tself::$url = $url ;\n\t}", "protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}", "private function _getUrlParamsForFormAction() {\n\n $param = $this->params()->fromRoute('param');\n $param2 = $this->params()->fromRoute('param2');\n $value = $this->params()->fromRoute('value', 0);\n $value2 = $this->params()->fromRoute('value2', 0);\n\n $params = array(\n 'productId' => 0,\n 'categoryId' => 0,\n 'parentId' => 0\n );\n\n// $productId = $categoryId = null;\n// if ($param == \"product\") {\n// $productId = $value;\n// $categoryId = $value2;\n// } else if ($param == \"category\") {\n// $productId = $value2;\n// $categoryId = $value;\n// }\n\n switch ($param) {\n case 'product':\n $params['productId'] = $value;\n $params['categoryId'] = $value2;\n break;\n case 'category':\n $params['productId'] = $value2;\n $params['categoryId'] = $value;\n break;\n case 'parent':\n $params['parentId'] = $value;\n break;\n default:\n break;\n }\n\n return $params;\n }", "protected function _getAddUrlParams()\n {\n if ($this->getListType() == \"search\") {\n return $this->getDynUrlParams();\n }\n }", "function UrlIfy($fields) {\n\t$delim = \"\";\n\t$fields_string = \"\";\n\tforeach($fields as $key=>$value) {\n\t\t$fields_string .= $delim . $key . '=' . $value;\n\t\t$delim = \"&\";\n\t}\n\n\treturn $fields_string;\n}", "function getURL($url, $prams)\n {\n return $url . '?' . http_build_query($prams);\n }", "public function url()\n {\n if (empty($this->parameters)) {\n return $this->url;\n }\n $total = array();\n foreach ($this->parameters as $k => $v) {\n if (is_array($v)) {\n foreach ($v as $va) {\n $total[] = HttpClient::urlencodeRFC3986($k).\"[]=\".HttpClient::urlencodeRFC3986($va);\n }\n } else {\n $total[] = HttpClient::urlencodeRFC3986($k).\"=\".HttpClient::urlencodeRFC3986($v);\n }\n }\n $out = implode(\"&\", $total);\n\n return $this->url.'?'.$out;\n }", "public static function getPageUrl()\n {\n $db = DataAccess::getInstance();\n $url = $db->get_site_setting('classifieds_file_name') . '?';\n $gets = array();\n foreach ($_GET as $key => $val) {\n if (in_array($key, array('filterValue','setFilter','resetFilter', 'resetAllFilters', 'page'))) {\n //don't add this -- it's part of the filters\n //also don't add \"page\" so that adding a new filter always forces the user to \"page one\"\n continue;\n }\n $gets[] = \"$key=$val\";\n }\n $url .= implode('&amp;', $gets);\n return $url;\n }", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n\n $this->url_params = array_values($url);\n // ::DEBUGGING\n // echo 'Controller: ' . $this->url_controller . '<br>';\n // echo 'Action: ' . $this->url_action . '<br>';\n // echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n // echo 'Parameters POST: ' . print_r($_POST, true) . '<br>';\n }\n }", "function getUrl($vars = null, $pageName = null, $sid = null)\n {\n $fvars = array();\n if (is_array($vars))\n {\n foreach ($vars as $k => $v)\n $fvars[$this->name($k)] = $v;\n }\n else if (isset($vars))\n $fvars[$this->name()] = $vars;\n\n return $this->form->getUrl($fvars, $pageName, $sid);\n }", "private function url_params()\n {\n return \"?user={$this->login}&password={$this->password}&answer=json\";\n }", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "function ghostpool_validate_url() {\n\t\tglobal $post;\n\t\t$gp_page_url = esc_url( home_url() );\n\t\t$gp_urlget = strpos( $gp_page_url, '?' );\n\t\tif ( $gp_urlget === false ) {\n\t\t\t$gp_concate = \"?\";\n\t\t} else {\n\t\t\t$gp_concate = \"&\";\n\t\t}\n\t\treturn $gp_page_url . $gp_concate;\n\t}", "protected function _getFormUrl() {\n $params = array();\n if (Mage::app()->getStore()->isCurrentlySecure()) {\n // Modern browsers require the Ajax request protocol to match the protocol used for initial request,\n // so force Magento to generate a secure URL if the request was secure.\n $params['_forced_secure'] = true;\n }\n return $this->getUrl('cloudiq/callme/request', $params);\n }", "protected function prepareURL() {\n $request = trim($_SERVER['REQUEST_URI'], '/');\n if( !empty($request)) {\n $url = explode('/', $request); // split the request into an array of controller, action, parameters\n \n // is controller is given, then set that name as controller\n // if this is empty, then make homeController as default controller\n $this->controller = isset($url[0]) ? $url[0].'Controller' : 'accountController';\n \n // action to be performed\n // it is specified after the controller name in the url\n // \n $this->action = isset($url[1]) ? $url[1]: 'index';\n \n unset($url[0], $url[1]); // delete this values from the url so that we can have parameters only\n \n // now add the parameters passed, to the prams array\n $this->prams = !empty($url) ? array_values($url) : [];\n }\n }", "private function getUrl() {\n $queryArr = array();\n\n $uri = filter_input(INPUT_SERVER, 'REQUEST_URI');\n\n //get uri as a array\n $uriArr = parse_url($uri);\n\n //get query parameter string\n $queryStr = isset($uriArr['query']) ? $uriArr['query'] : '';\n\n //get query parameters as a array\n parse_str($queryStr, $queryArr);\n\n //remove 'page' parameter if it is set\n if (isset($queryArr['page'])) {\n unset($queryArr['page']);\n }\n\n //rebuild the uri and return \n $returnUri = $uriArr['path'] . '?' . http_build_query($queryArr);\n\n return $returnUri;\n }", "private function getParameters()\n {\n $inputParametersStr = \"\";\n\n foreach ($_GET as $key => $input) {\n\n if(empty($input)){\n continue ; //ignore empty field \n }\n $inputParametersStr .= \"$key=\" . urlencode($input) . \"&\"; // convert string into url syntax.\n\n }\n $inputParametersStr = trim($inputParametersStr, '&'); // separate parameters by \"&\" .\n\n return $inputParametersStr ;\n }", "function email_build_url($options, $form=false, $arrayinput=false, $nameinput=NULL) {\n\n\t$url = '';\n\n\t// Build url part options\n \tif ($options) {\n \t\t// Index of part url\n \t\t$i = 0;\n\n foreach ($options as $name => $value) {\n \t// If not first param\n \tif (! $form ) {\n \t\tif ($i != 0) {\n \t\t\t$url .= '&amp;' .$name .'='. $value;\n \t\t} else {\n \t\t\t// If first param\n \t\t\t$url .= $name .'='. $value;\n \t\t}\n \t\t// Increment index\n \t\t$i++;\n \t} else {\n\n \t\tif ( $arrayinput ) {\n \t\t\t$url .= '<input type=\"hidden\" name=\"'.$nameinput.'[]\" value=\"'.$value.'\" /> ';\n \t\t} else {\n \t\t\t$url .= '<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\" /> ';\n \t\t}\n \t}\n }\n }\n\n return $url;\n}", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n \n // Put URL parts into according properties\n // By the way, the syntax here is just a short form of if/else, called \"Ternary Operators\"\n // @see http://davidwalsh.name/php-shorthand-if-else-ternary-operators\n $this->url_controller = (isset($url[0]) ? $url[0] : null);\n $this->url_action = (isset($url[1]) ? $url[1] : null);\n $this->url_parameter_1 = (isset($url[2]) ? $url[2] : null);\n $this->url_parameter_2 = (isset($url[3]) ? $url[3] : null);\n $this->url_parameter_3 = (isset($url[4]) ? $url[4] : null);\n\n // for debugging. uncomment this if you have problems with the URL\n # echo 'Controller: ' . $this->url_controller . '<br />';\n # echo 'Action: ' . $this->url_action . '<br />';\n # echo 'Parameter 1: ' . $this->url_parameter_1 . '<br />';\n # echo 'Parameter 2: ' . $this->url_parameter_2 . '<br />';\n # echo 'Parameter 3: ' . $this->url_parameter_3 . '<br />';\n }\n }", "protected function populateParams() {\r\n $this->pageNum = isset($_GET['p']) ? (int)$_GET['p'] : 0;\r\n $catId = isset($_GET['c']) ? (int)$_GET['c'] : 0;\r\n \r\n if ($this->pageNum < 1) {\r\n $this->pageNum = 1;\r\n }\r\n }", "protected function populateParams() {\r\n $this->pageNum = isset($_GET['p']) ? (int)$_GET['p'] : 0;\r\n $this->status = isset($_GET['status']) ? (int)$_GET['status'] : 0;\r\n if ($this->pageNum < 1) {\r\n $this->pageNum = 1;\r\n }\r\n }", "protected function determineValues()\n {\n $this->strUrl = preg_replace(\n array(\n '#\\?page=\\d+&#i',\n '#\\?page=\\d+$#i',\n '#&(amp;)?page=\\d+#i'\n ),\n array(\n '?',\n '',\n ''\n ),\n \\Environment::get('request')\n );\n\n $this->strVarConnector = strpos(\n $this->strUrl,\n '?'\n ) !== false\n ? '&amp;'\n : '?';\n $this->intTotalPages = ceil($this->intRows / $this->intRowsPerPage);\n }" ]
[ "0.6785151", "0.67579556", "0.6423543", "0.63742775", "0.6314623", "0.6295872", "0.6285857", "0.6260256", "0.6258695", "0.62438756", "0.6184899", "0.6171379", "0.61319715", "0.6098319", "0.60783106", "0.60723263", "0.60273266", "0.60028243", "0.59857315", "0.5982742", "0.5977669", "0.5976051", "0.5970223", "0.5934199", "0.5913682", "0.5907831", "0.58867323", "0.58849144", "0.5870174", "0.58699524" ]
0.7867275
0
Returns a list of previously created metadata postcard records for this page from the session these are output on the page so the user can see a history of records they have added this session.
public function PreviouslyCreatedRecords() { $createdRecords = new ArrayList(); // Only if we are to display the records added this session then get the info for that. if ($this->DisplayRecordList) { $records = Session::get('PostcardRecordsCreated_' . $this->ID); if ($records) { foreach($records as $record) { $createdRecords->push(ArrayData::create( array('Link' => $record) )); } } } return $createdRecords; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getCollectedRecords() {}", "protected function getCollectedRecords() {}", "protected function getCollectedRecords() {}", "function getRecords() {\n\t\treturn $this->records;\n\t}", "public function getMetadatas()\n {\n $matadata = new Cms_Model_Application_Page_Metadata();\n $results = $matadata->findAll(array('page_id' => $this->getPageId()));\n $this->_metadata = array();\n foreach ($results as $result) {\n array_push($this->_metadata, $result);\n }\n return $this->_metadata;\n }", "public function getRecords()\n {\n return $this->records;\n }", "public function getRecords()\n {\n return $this->records;\n }", "public function getStoredCards() {\n // TODO get from model or user select\n $customerId = 2;\n\n return $this->paymentTokenManagement->getListByCustomerId($customerId);\n }", "public function records() { return $this->_m_records; }", "public function records() {\n if( ! property_exists($this->response(), 'records') ) return [];\n\n return $this->response()->records;\n }", "public function getRecords()\n\t{\n\t\treturn $this->records['data'];\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function contents() {\n return Session::get_all();\n }", "function getARecords() {\n\t\t$arecords = array();\n\t\tif ( isset( $this->hostInfo[0]['arecord'] ) ) {\n\t\t\t$arecords = $this->hostInfo[0]['arecord'];\n\t\t\tarray_shift( $arecords );\n\t\t}\n\n\t\treturn $arecords;\n\t}", "public function records() : array {\n return $this->records;\n }", "public function get_all_session()\n\t\t{\n\t\t\treturn parent::get_all_items('session_items');\n\t\t}", "public function getAllMemberCards()\n {\n \n $query = \"SELECT MID, LoyaltyCardNumber FROM transactionsummary ORDER BY LoyaltyCardNumber ASC\";\n \n return parent::RunQuery($query);\n }", "public function getPageDetails()\n\t{\n\t\t$v = new View(0);\n\t\treturn $v->getAllRecords( FALSE );\n\t\t\n\t}", "public function all()\n {\n return $this->getCartSession();\n }", "public function getPaymentHistory(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "function retrive_history_details_for_single_pfac_in_preview($pfac_id, $params){\n\t\n\t\tglobal $connection;\n\t\t$sql = \"SELECT * FROM pfac__players_history WHERE PFAC_id = {$pfac_id}\";\n\t\treturn DBFunctions::result_to_array_for_few_fields(DBFunctions::execute_query($sql), $params);\t\t\t\t\n\t}", "public function getUserCards()\n {\n // Get the customer id\n $customerId = $this->adminQuote->getQuote()->getCustomer()->getId();\n\n // Return the cards list\n return $this->vaultHandler->getUserCards($customerId);\n }", "function getRedCards()\n\t{\n\t\t$data = array();\t\t\n\t\t$r_query = 'SELECT username, users.user_id FROM rcards, users '.\n\t\t\t\t\t'WHERE rcards.report_id = '.$this->id.' '.\n\t\t\t\t\t'AND rcards.user_id = users.user_id';\n\t\t$r_result = mysql_query($r_query)\n\t\t\tor die(mysql_error());\n\t\t\n\t\twhile ($r_row = mysql_fetch_array($r_result))\n\t\t{\n\t\t\t$data[] = array('link'=>'viewprofile.php?action=view&amp;uid='.$r_row['user_id'],\n\t\t\t\t\t\t\t\t'name'=>$r_row['username'],\n\t\t\t\t\t\t\t\t'id'=>$r_row['user_id']);\n\t\t}\n\t\treturn $data;\n\t}", "function getListOfRecords(){\n // the orders will be display and the receipts from there \n \n $element = new Order();\n \n $receipts_filter_orders = cisess(\"receipts_filter_orders\");\n \n if ($receipts_filter_orders===FALSE){\n $receipts_filter_orders = \"Abierta\"; // default to abiertas\n }\n \n if (!empty($receipts_filter_orders))\n {\n $element->where(\"status\",$receipts_filter_orders);\n }\n \n \n $element->order_by(\"id\",\"desc\");\n \n $all = $element->get()->all;\n //echo $element->check_last_query();\n ///die();\n $table = $this->entable($all);\n \n return $table;\n \n \n }", "function getRecords($pupil_id){\r\n\t\t$data = array('massive'=>array('Data','Dump'));\r\n\treturn $data;\r\n\t}", "public function getPersonalRecords() {\n\t\tif(!$data = $this->getNikePlusFile('http://nikerunning.nike.com/nikeplus/v2/services/app/personal_records.jsp?_plus=true')) {\n\t\t\tthrow new Exception($this->feedErrorMessage);\n\t\t}\n\t\treturn $data;\n\t}", "public static function getList()\n {\n return static::with(['customer', 'media'])->paginate(10);\n }", "public function getHistory()\n {\n \treturn QuizResult::where('user_id', '=', Auth::user()->id)->orderBy('id', 'DESC')->limit(5)->get();\n }", "function showRecordsOnMap () {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_RECORDSONMAP###');\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['recordsOnMap.']['LL'], 'recordsonmap');\n\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'],$markerArray);\n\t\treturn $content;\n\t}", "public function collect()\n {\n return $this->session->all();\n }" ]
[ "0.58330387", "0.58330387", "0.5830978", "0.5688265", "0.5546298", "0.5535827", "0.5535827", "0.55225563", "0.5510357", "0.5474016", "0.5450865", "0.543416", "0.53774935", "0.5371524", "0.53500473", "0.5195472", "0.51752853", "0.5144721", "0.51433235", "0.5117926", "0.5096426", "0.5096333", "0.50937295", "0.50869685", "0.50849104", "0.507683", "0.50745106", "0.5074215", "0.50734854", "0.5072086" ]
0.70930344
0
The newest deployable version of the appliance. The current appliance can't be updated into this version, and the owner must manually deploy this OVA to a new appliance. Generated from protobuf field .google.cloud.vmmigration.v1.ApplianceVersion new_deployable_appliance = 1;
public function getNewDeployableAppliance() { return $this->new_deployable_appliance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setNewDeployableAppliance($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\VMMigration\\V1\\ApplianceVersion::class);\n $this->new_deployable_appliance = $var;\n\n return $this;\n }", "public function setInPlaceUpdate($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\VMMigration\\V1\\ApplianceVersion::class);\n $this->in_place_update = $var;\n\n return $this;\n }", "public function makeNewVersion(): Versionable;", "public function getAppVersion() {\n return $this->appVersion;\n }", "public function getVersion(Deploy $deploy);", "public function toString()\n {\n return \"Application new version is correct.\";\n }", "public function getAppVersion()\n {\n return $this->getConfig('appVersion');\n }", "public function getApiVersion(): string\n {\n return $this->getAttribute('apiVersion', static::$stableVersion);\n }", "public function getAppVersion() : string {\n return $this->configVars['version-info']['version'];\n }", "public function getAppVersionType() : string {\n return $this->configVars['version-info']['version-type'];\n }", "public function getAppVersion(): string\n {\n $this->findAppPort();\n\n return $this->appVer;\n }", "public function getApplicationVersion()\n {\n return $this->application_version;\n }", "function &getNewVersion() {\n\t\treturn $this->newVersion;\n\t}", "public function upgrade( $previous_version ) {\n\n\t\t// Was previous Add-On version before 1.0.6?\n\t\t$previous_is_pre_custom_app_only = ! empty( $previous_version ) && version_compare( $previous_version, '1.0.6', '<' );\n\n\t\t// Run 1.0.6 upgrade routine.\n\t\tif ( $previous_is_pre_custom_app_only ) {\n\n\t\t\t// Get plugin settings.\n\t\t\t$settings = $this->get_plugin_settings();\n\n\t\t\t// Set default app flag.\n\t\t\tif ( ! rgar( $settings, 'customAppEnable' ) && $this->initialize_api() ) {\n\t\t\t\t$settings['defaultAppEnabled'] = '1';\n\t\t\t}\n\n\t\t\t// Remove custom app flag.\n\t\t\tunset( $settings['customAppEnable'] );\n\n\t\t\t// Save plugin settings.\n\t\t\t$this->update_plugin_settings( $settings );\n\n\t\t}\n\n\t\t// Was previous Add-On version before 2.0?\n\t\t$previous_is_pre_20 = ! empty( $previous_version ) && version_compare( $previous_version, '2.0dev2', '<' );\n\n\t\t// Run 2.0 upgrade routine.\n\t\tif ( $previous_is_pre_20 ) {\n\n\t\t\t// Get plugin settings.\n\t\t\t$settings = $this->get_plugin_settings();\n\n\t\t\t// Set custom app state.\n\t\t\tif ( rgar( $settings, 'defaultAppEnabled' ) ) {\n\t\t\t\tunset( $settings['defaultAppEnabled'], $settings['customAppEnable'] );\n\t\t\t} else {\n\t\t\t\t$settings['customAppEnable'] = '1';\n\t\t\t}\n\n\t\t\t// Save plugin settings.\n\t\t\t$this->update_plugin_settings( $settings );\n\n\t\t}\n\n\t}", "private function getAppVersion()\n {\n $ch = $this->createCurlConnection('/api/app/appversion');\n\n $body = curl_exec($ch);\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $result = null;\n\n if ($code == 200) {\n $json = json_decode($body, true);\n $result = $json['appversion'];\n } elseif ($code == 403) {\n $result = 'ERROR403';\n }\n curl_close($ch);\n\n return $result;\n }", "private function getOneAppVersion() {\n $this->app_version->findOne();\n }", "protected function getVersion()\n {\n return 'V1';\n }", "public function getAllowedVersions()\n {\n return $this->allowedVersions;\n }", "public function getDeployedIndex()\n {\n return $this->deployed_index;\n }", "public function getVersion()\n {\n $version = $this->getProjectVersion();\n\n if (APPLICATION_ENV !== 'production' && APPLICATION_ENV !== 'acceptance' && APPLICATION_ENV !== 'demo') {\n $version .= '.' . $this->getBuild() . ' [' . APPLICATION_ENV . ']';\n }\n\n return $version;\n }", "public function getVersion()\n {\n return $this->readOneof(2);\n }", "public function getApiVersion()\n {\n return $this->apiVersion;\n }", "public function getApiVersion()\n {\n return $this->apiVersion;\n }", "public function getApiVersion()\n {\n return $this->apiVersion;\n }", "public function getCurrentVersion();", "public function getProjectVersion()\n {\n return $this->getGemsVersion();\n }", "public static function version() {\n\t\treturn static::config('app.version', '1.0');\n\t}", "protected function whenNewVersionWasRequested()\n {\n }", "public function openapi_version()\n\t{\n\t\treturn '1.0';\n\t}", "public function deploy($version, $name){\n \n }" ]
[ "0.83875597", "0.5545925", "0.5045859", "0.4931152", "0.48497114", "0.47563252", "0.47412688", "0.47286463", "0.46525753", "0.46510193", "0.4648335", "0.4630422", "0.45924392", "0.45295712", "0.4512411", "0.4494492", "0.44933486", "0.44880563", "0.4478327", "0.4460974", "0.44451228", "0.4413746", "0.4413746", "0.4413746", "0.44063953", "0.44055456", "0.43932167", "0.4389293", "0.4377001", "0.43751484" ]
0.74558955
1
The newest deployable version of the appliance. The current appliance can't be updated into this version, and the owner must manually deploy this OVA to a new appliance. Generated from protobuf field .google.cloud.vmmigration.v1.ApplianceVersion new_deployable_appliance = 1;
public function setNewDeployableAppliance($var) { GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ApplianceVersion::class); $this->new_deployable_appliance = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNewDeployableAppliance()\n {\n return $this->new_deployable_appliance;\n }", "public function setInPlaceUpdate($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\VMMigration\\V1\\ApplianceVersion::class);\n $this->in_place_update = $var;\n\n return $this;\n }", "public function makeNewVersion(): Versionable;", "public function getAppVersion() {\n return $this->appVersion;\n }", "public function getVersion(Deploy $deploy);", "public function toString()\n {\n return \"Application new version is correct.\";\n }", "public function getAppVersion()\n {\n return $this->getConfig('appVersion');\n }", "public function getApiVersion(): string\n {\n return $this->getAttribute('apiVersion', static::$stableVersion);\n }", "public function getAppVersion() : string {\n return $this->configVars['version-info']['version'];\n }", "public function getAppVersionType() : string {\n return $this->configVars['version-info']['version-type'];\n }", "public function getAppVersion(): string\n {\n $this->findAppPort();\n\n return $this->appVer;\n }", "public function getApplicationVersion()\n {\n return $this->application_version;\n }", "function &getNewVersion() {\n\t\treturn $this->newVersion;\n\t}", "public function upgrade( $previous_version ) {\n\n\t\t// Was previous Add-On version before 1.0.6?\n\t\t$previous_is_pre_custom_app_only = ! empty( $previous_version ) && version_compare( $previous_version, '1.0.6', '<' );\n\n\t\t// Run 1.0.6 upgrade routine.\n\t\tif ( $previous_is_pre_custom_app_only ) {\n\n\t\t\t// Get plugin settings.\n\t\t\t$settings = $this->get_plugin_settings();\n\n\t\t\t// Set default app flag.\n\t\t\tif ( ! rgar( $settings, 'customAppEnable' ) && $this->initialize_api() ) {\n\t\t\t\t$settings['defaultAppEnabled'] = '1';\n\t\t\t}\n\n\t\t\t// Remove custom app flag.\n\t\t\tunset( $settings['customAppEnable'] );\n\n\t\t\t// Save plugin settings.\n\t\t\t$this->update_plugin_settings( $settings );\n\n\t\t}\n\n\t\t// Was previous Add-On version before 2.0?\n\t\t$previous_is_pre_20 = ! empty( $previous_version ) && version_compare( $previous_version, '2.0dev2', '<' );\n\n\t\t// Run 2.0 upgrade routine.\n\t\tif ( $previous_is_pre_20 ) {\n\n\t\t\t// Get plugin settings.\n\t\t\t$settings = $this->get_plugin_settings();\n\n\t\t\t// Set custom app state.\n\t\t\tif ( rgar( $settings, 'defaultAppEnabled' ) ) {\n\t\t\t\tunset( $settings['defaultAppEnabled'], $settings['customAppEnable'] );\n\t\t\t} else {\n\t\t\t\t$settings['customAppEnable'] = '1';\n\t\t\t}\n\n\t\t\t// Save plugin settings.\n\t\t\t$this->update_plugin_settings( $settings );\n\n\t\t}\n\n\t}", "private function getAppVersion()\n {\n $ch = $this->createCurlConnection('/api/app/appversion');\n\n $body = curl_exec($ch);\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $result = null;\n\n if ($code == 200) {\n $json = json_decode($body, true);\n $result = $json['appversion'];\n } elseif ($code == 403) {\n $result = 'ERROR403';\n }\n curl_close($ch);\n\n return $result;\n }", "private function getOneAppVersion() {\n $this->app_version->findOne();\n }", "protected function getVersion()\n {\n return 'V1';\n }", "public function getAllowedVersions()\n {\n return $this->allowedVersions;\n }", "public function getDeployedIndex()\n {\n return $this->deployed_index;\n }", "public function getVersion()\n {\n $version = $this->getProjectVersion();\n\n if (APPLICATION_ENV !== 'production' && APPLICATION_ENV !== 'acceptance' && APPLICATION_ENV !== 'demo') {\n $version .= '.' . $this->getBuild() . ' [' . APPLICATION_ENV . ']';\n }\n\n return $version;\n }", "public function getVersion()\n {\n return $this->readOneof(2);\n }", "public function getApiVersion()\n {\n return $this->apiVersion;\n }", "public function getApiVersion()\n {\n return $this->apiVersion;\n }", "public function getApiVersion()\n {\n return $this->apiVersion;\n }", "public function getCurrentVersion();", "public function getProjectVersion()\n {\n return $this->getGemsVersion();\n }", "public static function version() {\n\t\treturn static::config('app.version', '1.0');\n\t}", "protected function whenNewVersionWasRequested()\n {\n }", "public function openapi_version()\n\t{\n\t\treturn '1.0';\n\t}", "public function getVersion()\n {\n return \"1.0.0\";\n }" ]
[ "0.7454592", "0.55472726", "0.50470424", "0.49348116", "0.48488587", "0.47581327", "0.4744319", "0.47306126", "0.46555945", "0.46532592", "0.4652101", "0.46337828", "0.45940655", "0.45313075", "0.45160908", "0.4497303", "0.44941166", "0.44891012", "0.44770998", "0.44632533", "0.44460824", "0.44155782", "0.44155782", "0.44155782", "0.4408221", "0.4407057", "0.43951747", "0.4390738", "0.43785635", "0.43758893" ]
0.8387163
0
The latest version for in place update. The current appliance can be updated to this version using the API or m4c CLI. Generated from protobuf field .google.cloud.vmmigration.v1.ApplianceVersion in_place_update = 2;
public function getInPlaceUpdate() { return $this->in_place_update; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setInPlaceUpdate($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\VMMigration\\V1\\ApplianceVersion::class);\n $this->in_place_update = $var;\n\n return $this;\n }", "public function setNewDeployableAppliance($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\VMMigration\\V1\\ApplianceVersion::class);\n $this->new_deployable_appliance = $var;\n\n return $this;\n }", "public function update(Request $request, inversion $inversion)\n {\n //\n }", "public function extract_app_update() {\n \n // Extract App Update\n (new MidrubBaseAdminCollectionUpdateHelpers\\Apps)->extract_update();\n \n }", "public function getUpdateVersion()\n {\n if (array_key_exists(\"updateVersion\", $this->_propDict)) {\n return $this->_propDict[\"updateVersion\"];\n } else {\n return null;\n }\n }", "public function edit(inversion $inversion)\n {\n //\n }", "public function getAppVersion() {\n return $this->appVersion;\n }", "protected function getApiVersionInput()\n {\n return strtoupper(trim($this->argument('version')));\n }", "public function update()\n {\n foreach ($this->updates as list($url, $meetingPlace)) {\n try {\n $c = Page::getByPath(parse_url($url)['path']);\n $cp = new Permissions($c);\n\n // Only allow updates if this user can edit\n if ($cp->canEditPageProperties()) {\n $currentCollectionVersion = $c->getVersionObject();\n\n $map = json_decode($c->getAttribute('gmap'), true);\n\n // Check that we have a map marker\n if (!empty($map['markers'])) {\n $newCollectionVersion = $currentCollectionVersion->createNew('Updated via meetingplaceupdate script');\n $c->loadVersionObject($newCollectionVersion->getVersionID());\n // Set the first marker to the new meeting place\n $map['markers'][0]['title'] = $meetingPlace;\n $c->setAttribute('gmap', json_encode($map));\n\n $newCollectionVersion->approve();\n echo 'Updated walk ' . $url . ' to ' . $meetingPlace . PHP_EOL;\n } else {\n echo 'No map found for: ' . $url . PHP_EOL;\n }\n } else {\n throw new RuntimeException('Insufficient permissions to update');\n }\n } catch (Exception $e) {\n echo $e->getMessage() . ' URL: ' . $url . PHP_EOL;\n }\n }\n }", "public function getUpdate()\n {\n return $this->readOneof(2);\n }", "public function getAppVersion()\n {\n return $this->getConfig('appVersion');\n }", "public function update(Request $request, Place $place)\n {\n //\n }", "public function update(Request $request, Place $place)\n {\n //\n }", "public function getApiRequestVersion()\n {\n return $this->apiRequestVersion;\n }", "private function get_version(&$request) {\n $version = $request->get_parameter(\"oauth_version\");\n if (!$version) {\n // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.\n // Chapter 7.0 (\"Accessing Protected Ressources\")\n $version = '1.0';\n }\n if ($version !== $this->version) {\n throw new OAuthException(\"OAuth version '$version' not supported\");\n }\n return $version;\n }", "public function action_update_check()\n\t{\n\t\tUpdate::add( 'StatusNet', '8676A858-E4B1-11DD-9968-131C56D89593', $this->info->version );\n\t}", "public function getNewDeployableAppliance()\n {\n return $this->new_deployable_appliance;\n }", "public function getVersionsBehind(): int\n {\n return $this->data->versions_behind;\n }", "function updateVersion() {\n // Query to Update Build Version\n $query5 = \"UPDATE \" . $this->tableName . \" SET appLatestBuild=:appLatestBuild, appUpdatedAt=:appUpdatedAt WHERE appID=:appID\";\n // Prepare query\n $stmt5 = $this->conn->prepare($query5);\n // Sanitize\n $this->appID = htmlspecialchars(strip_tags($this->appID));\n $this->appLatestBuild = htmlspecialchars(strip_tags($this->appLatestBuild));\n $this->appUpdatedAt = htmlspecialchars(strip_tags($this->appUpdatedAt));\n // Bind values\n $stmt5->bindParam(':appID', $this->appID);\n $stmt5->bindParam(':appLatestBuild', $this->appLatestBuild);\n $stmt5->bindParam(':appUpdatedAt', $this->appUpdatedAt);\n // Execute query\n if ($stmt5->execute()) {\n return true;\n }\n return false;\n }", "public function getVersion(){\n $client = Yii::$app->infoServices;\n return $client->getVersion()->return->version;\n }", "public function update(Request $request, TopUp $topUp)\n {\n //\n }", "public function update(Request $request, TopUp $topUp)\n {\n //\n }", "public static function getAppVersion($app) {\n\t\treturn \\OC::$server->getAppManager()->getAppVersion($app);\n\t}", "public function check_version_and_update() {\n\t\tif ( ! defined( 'IFRAME_REQUEST' ) && $this->version !== WC_PAYSAFE_PLUGIN_VERSION ) {\n\t\t\t$this->update();\n\t\t}\n\t}", "public function api_version() {\n $v = $this->call( 'systemGetApiVersion' );\n\n return $v ? $v->version : false;\n }", "public function wp_check_update()\n\t{\n\t\t$content = file_get_contents('https://raw.githubusercontent.com/emulsion-io/wp-migration-url/master/version.json'.'?'.mt_rand());\n\t\t$version = json_decode($content);\n\n\t\t//var_dump($version); exit;\n\n\t\t$retour['version_courante'] = $this->_version;\n\t\t$retour['version_enligne'] = $version->version;\n\n\t\tif($retour['version_courante'] != $retour['version_enligne']) {\n\t\t\t$retour['maj_dipso'] = TRUE;\n\t\t} else {\n\t\t\t$retour['maj_dipso'] = FALSE;\n\t\t}\n\n\t\treturn $retour;\n\t}", "public function setOutOfCompetition($var)\n {\n GPBUtil::checkBool($var);\n $this->out_of_competition = $var;\n\n return $this;\n }", "public function updated(Outstation $outstation)\n {\n if ($outstation->is_approved) {\n $this->updateStatus(Attende::ABSENT, Attende::OUTSTATION, $outstation);\n } else {\n $this->updateStatus(Attende::OUTSTATION, Attende::ABSENT, $outstation);\n }\n }", "private function getVersion(Request &$request)\n {\n $version = $request->getParameter('oauth_version');\n if (!$version) {\n // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.\n // Chapter 7.0 (\"Accessing Protected Ressources\")\n $version = '1.0';\n }\n if ($version !== $this->version) {\n throw new OAuthException(\"OAuth version '$version' not supported\");\n }\n return $version;\n }", "public function getApplicationVersion()\n {\n return $this->application_version;\n }" ]
[ "0.82139015", "0.4721028", "0.44336727", "0.44272318", "0.42578417", "0.42249927", "0.42135683", "0.41952437", "0.4130493", "0.4129588", "0.409124", "0.40908483", "0.40908483", "0.40586483", "0.4040559", "0.40337253", "0.40278265", "0.4024384", "0.40241826", "0.40123272", "0.40104094", "0.40104094", "0.40062353", "0.3995742", "0.39711517", "0.39609447", "0.39601249", "0.395814", "0.39497283", "0.39404655" ]
0.50458825
1
The latest version for in place update. The current appliance can be updated to this version using the API or m4c CLI. Generated from protobuf field .google.cloud.vmmigration.v1.ApplianceVersion in_place_update = 2;
public function setInPlaceUpdate($var) { GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ApplianceVersion::class); $this->in_place_update = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInPlaceUpdate()\n {\n return $this->in_place_update;\n }", "public function setNewDeployableAppliance($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\VMMigration\\V1\\ApplianceVersion::class);\n $this->new_deployable_appliance = $var;\n\n return $this;\n }", "public function update(Request $request, inversion $inversion)\n {\n //\n }", "public function extract_app_update() {\n \n // Extract App Update\n (new MidrubBaseAdminCollectionUpdateHelpers\\Apps)->extract_update();\n \n }", "public function getUpdateVersion()\n {\n if (array_key_exists(\"updateVersion\", $this->_propDict)) {\n return $this->_propDict[\"updateVersion\"];\n } else {\n return null;\n }\n }", "public function edit(inversion $inversion)\n {\n //\n }", "public function getAppVersion() {\n return $this->appVersion;\n }", "protected function getApiVersionInput()\n {\n return strtoupper(trim($this->argument('version')));\n }", "public function update()\n {\n foreach ($this->updates as list($url, $meetingPlace)) {\n try {\n $c = Page::getByPath(parse_url($url)['path']);\n $cp = new Permissions($c);\n\n // Only allow updates if this user can edit\n if ($cp->canEditPageProperties()) {\n $currentCollectionVersion = $c->getVersionObject();\n\n $map = json_decode($c->getAttribute('gmap'), true);\n\n // Check that we have a map marker\n if (!empty($map['markers'])) {\n $newCollectionVersion = $currentCollectionVersion->createNew('Updated via meetingplaceupdate script');\n $c->loadVersionObject($newCollectionVersion->getVersionID());\n // Set the first marker to the new meeting place\n $map['markers'][0]['title'] = $meetingPlace;\n $c->setAttribute('gmap', json_encode($map));\n\n $newCollectionVersion->approve();\n echo 'Updated walk ' . $url . ' to ' . $meetingPlace . PHP_EOL;\n } else {\n echo 'No map found for: ' . $url . PHP_EOL;\n }\n } else {\n throw new RuntimeException('Insufficient permissions to update');\n }\n } catch (Exception $e) {\n echo $e->getMessage() . ' URL: ' . $url . PHP_EOL;\n }\n }\n }", "public function getUpdate()\n {\n return $this->readOneof(2);\n }", "public function getAppVersion()\n {\n return $this->getConfig('appVersion');\n }", "public function update(Request $request, Place $place)\n {\n //\n }", "public function update(Request $request, Place $place)\n {\n //\n }", "public function getApiRequestVersion()\n {\n return $this->apiRequestVersion;\n }", "private function get_version(&$request) {\n $version = $request->get_parameter(\"oauth_version\");\n if (!$version) {\n // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.\n // Chapter 7.0 (\"Accessing Protected Ressources\")\n $version = '1.0';\n }\n if ($version !== $this->version) {\n throw new OAuthException(\"OAuth version '$version' not supported\");\n }\n return $version;\n }", "public function action_update_check()\n\t{\n\t\tUpdate::add( 'StatusNet', '8676A858-E4B1-11DD-9968-131C56D89593', $this->info->version );\n\t}", "public function getNewDeployableAppliance()\n {\n return $this->new_deployable_appliance;\n }", "function updateVersion() {\n // Query to Update Build Version\n $query5 = \"UPDATE \" . $this->tableName . \" SET appLatestBuild=:appLatestBuild, appUpdatedAt=:appUpdatedAt WHERE appID=:appID\";\n // Prepare query\n $stmt5 = $this->conn->prepare($query5);\n // Sanitize\n $this->appID = htmlspecialchars(strip_tags($this->appID));\n $this->appLatestBuild = htmlspecialchars(strip_tags($this->appLatestBuild));\n $this->appUpdatedAt = htmlspecialchars(strip_tags($this->appUpdatedAt));\n // Bind values\n $stmt5->bindParam(':appID', $this->appID);\n $stmt5->bindParam(':appLatestBuild', $this->appLatestBuild);\n $stmt5->bindParam(':appUpdatedAt', $this->appUpdatedAt);\n // Execute query\n if ($stmt5->execute()) {\n return true;\n }\n return false;\n }", "public function getVersionsBehind(): int\n {\n return $this->data->versions_behind;\n }", "public function update(Request $request, TopUp $topUp)\n {\n //\n }", "public function update(Request $request, TopUp $topUp)\n {\n //\n }", "public function getVersion(){\n $client = Yii::$app->infoServices;\n return $client->getVersion()->return->version;\n }", "public static function getAppVersion($app) {\n\t\treturn \\OC::$server->getAppManager()->getAppVersion($app);\n\t}", "public function check_version_and_update() {\n\t\tif ( ! defined( 'IFRAME_REQUEST' ) && $this->version !== WC_PAYSAFE_PLUGIN_VERSION ) {\n\t\t\t$this->update();\n\t\t}\n\t}", "public function api_version() {\n $v = $this->call( 'systemGetApiVersion' );\n\n return $v ? $v->version : false;\n }", "public function wp_check_update()\n\t{\n\t\t$content = file_get_contents('https://raw.githubusercontent.com/emulsion-io/wp-migration-url/master/version.json'.'?'.mt_rand());\n\t\t$version = json_decode($content);\n\n\t\t//var_dump($version); exit;\n\n\t\t$retour['version_courante'] = $this->_version;\n\t\t$retour['version_enligne'] = $version->version;\n\n\t\tif($retour['version_courante'] != $retour['version_enligne']) {\n\t\t\t$retour['maj_dipso'] = TRUE;\n\t\t} else {\n\t\t\t$retour['maj_dipso'] = FALSE;\n\t\t}\n\n\t\treturn $retour;\n\t}", "public function setOutOfCompetition($var)\n {\n GPBUtil::checkBool($var);\n $this->out_of_competition = $var;\n\n return $this;\n }", "public function updated(Outstation $outstation)\n {\n if ($outstation->is_approved) {\n $this->updateStatus(Attende::ABSENT, Attende::OUTSTATION, $outstation);\n } else {\n $this->updateStatus(Attende::OUTSTATION, Attende::ABSENT, $outstation);\n }\n }", "private function getVersion(Request &$request)\n {\n $version = $request->getParameter('oauth_version');\n if (!$version) {\n // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.\n // Chapter 7.0 (\"Accessing Protected Ressources\")\n $version = '1.0';\n }\n if ($version !== $this->version) {\n throw new OAuthException(\"OAuth version '$version' not supported\");\n }\n return $version;\n }", "public function getApplicationVersion()\n {\n return $this->application_version;\n }" ]
[ "0.504715", "0.47204202", "0.4435094", "0.4427902", "0.4257221", "0.4225132", "0.42122072", "0.419359", "0.41304266", "0.4128884", "0.40900788", "0.4089813", "0.4089813", "0.40574875", "0.40398026", "0.40329742", "0.40275565", "0.40243804", "0.4023196", "0.40115404", "0.40115404", "0.4009454", "0.40045995", "0.39964053", "0.39684016", "0.3960689", "0.3960583", "0.39596933", "0.39493492", "0.39395905" ]
0.82146156
0
Handle the article "created" event.
public function created(Article $article) { if ($article->is_top == 1 && $article->status == 1) { Article::topArticle(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle(Article $article): void\n {\n // Log également un article stat avec pour action create.\n $article->setSlug($this->slug->generate($article->getTitle()));\n $article->setAuthor($this->token->getToken()->getUser());\n }", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $article = new Articles();\n\n $article->title = $this->request->getPost(\"title\");\n $article->slug = str_replace(' ','_', strtolower($article->title));\n $article->content = $this->request->getPost(\"content\");\n $article->category = $this->request->getPost(\"category\");\n $article->isPublished = $this->request->getPost(\"isPublished\");\n $article->author = $this->request->getPost(\"author\");\n $article->createdOn = new RawValue('now()');\n $article->views = 1;\n \n\n if (!$article->save()) {\n foreach ($article->getMessages() as $message) {\n $this->flash->error($message);\n }\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"article was created successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n\n }", "public function create()\n {\n\n $categories = $this->categoryModel->getCategories();\n $tags = $this->tagModel->getTags();\n\n $data = [\n 'title' =>'',\n 'slug' => '',\n 'body' => '',\n 'created_at' => '',\n 'categories' => $categories,\n 'tags' => $tags,\n 'date'=>'',\n 'image' => '',\n 'user_id' =>'',\n 'status' =>'',\n\n ];\n $this->view('articles/create', $data);\n\n\n }", "public function createArticle() {\n\n\t\t$ArticleItem = new ArticleItem();\n\n\t\t$this->articles[] = $ArticleItem;\n\n\t\treturn $ArticleItem->getArticle();\n\n\t}", "public function create()\n {\n $result = $this->service->create();\n return view(getThemeView('blog.article.create'))->with($result);\n }", "public function created(Post $post)\n {\n $post->recordActivity('created');\n }", "public function createAction()\n {\n // Checking a for a valid csrf token\n if ($this->request->isPost()) {\n if (!$this->security->checkToken()) {\n //if the csrf token is not valid, end the algorithm here\n return;\n }\n }\n\n // Getting a request instance\n $request = new Request();\n\n // Check whether the request was made with method POST\n if ($request->isPost()) {\n\n //TODO Question: is there a way to auto map the post data to a model?\n $article = new Article();\n $article->creationDate = $date = date('Y-m-d H:i:s');\n $article->title = $this->request->getPost('title');\n $article->summary = $this->request->getPost('summary');\n $article->content = $this->request->getPost('content');\n\n //try to save the article to the database, if it fails let the user know what went wrong\n if (!$article->save()) {\n //get all the validationErrors and store them in the flashSessions and return the view\n foreach ($article->getMessages() as $message) {\n //append the validation errors to the flash session\n $this->flashSession->error($message);\n }\n return;\n }\n\n //let the user know the article was saved successfully\n $this->flashSession->message('message', 'The article has successfully been created');\n\n //return to the admin article overview so the user can see the new article in the list\n return $this->response->redirect(\"/article\");\n }\n }", "public function onFigureCreated(GenericEvent $event): void\n {\n /** @var FigureAddEvent $figure_added */\n $figure_added = $event->getSubject();\n $figure = $figure_added->getFigure();\n\n $linkToFigure = $this->urlGenerator->generate('snowtrick_blog_figure', [\n 'slug' => $figure->getSlug(),\n '_fragment' => 'figure_added_'.$figure_added->getId(),\n ], UrlGeneratorInterface::ABSOLUTE_URL);\n\n $subject = $this->translator->trans('notification.figure_created');\n $body = $this->translator->trans('notification.figure_created_description',[\n '%title%' => $figure->getTitle(),\n '%content%' => $figure->getContent(),\n '%link%' => $linkToFigure,\n ]);\n $message = (new Swift_Message())\n ->setSubject($subject)\n ->setTo($figure_added->getAuthor()->getEmail())\n ->setFrom($this->sender)\n ->setBody($body, 'text/html');\n\n\n $this->mailer->send($message);\n }", "public function created(Post $post)\n {\n //\n }", "public function create()\n\t{\n\t\treturn View::make('pages.article.create');\n\t}", "public function onCreated()\n {\n parent::onCreated();\n\n }", "public function onCreated()\n {\n parent::onCreated();\n\n }", "public function store(ArticlesFormRequest $request)\n {\n $article = new Article;\n $article->fill($request->all());\n $article->published = $request->get('published', false);\n $article->featured = $request->get('featured', false);\n $article->authenticated = $request->get('authenticated', false);\n $article->is_page = $request->get('is_page', false);\n $article->save();\n\n $article->permissions()->sync($request->get('permissions', []));\n if ($request->tags) {\n $article->tag(explode(',', $request->tags));\n }\n\n event(new ArticleWasCreated($article));\n\n flash()->success(trans('cms::article.store.success'));\n\n return redirect()->route('administrator.articles.index');\n }", "public function create()\n {\n if (Gate::denies('save', new Article())){\n abort(403);\n }\n $this->title = \"Add new article\";\n $categories = Category::select(['title', 'alias', 'parent_id', 'id'])->get();\n $lists = array();\n foreach ($categories as $category){\n if($category->parent_id == 0){\n $lists[$category->title] = array();\n } else{\n $lists[$categories->where('id', $category->parent_id)->first()->title][$category->id] = $category->title;\n }\n }\n //dd($lists);\n $this->content = view(env('THEME') .'.admin.articles_create')->with('categories', $lists)->render();\n return $this->renderOutput();\n }", "public function create() {\n //\n return view('admin.article.create');\n }", "public function create()\n {\n return view('back.article.create');\n }", "public function create()\n {\n return view('admin.article_create');\n }", "public function created(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('created'));\n }", "public function create()\n\t{\n\t\t//\n\t\treturn \\View::make('specialties.articles.create');\n\t}", "private function createArticle(ArticleRequest $request){\n\n $article = \\Auth::user()->articles()->create($request->all());\n\n $this->syncTags($article, $request->input('tag_list'));\n\n return $article; \n }", "public function create()\n {\n $datas=$this->articleRepository->create();\n return view('backend.article.create', [\n 'datas' => $datas,\n ]);\n }", "public function creating(Article $article)\n {\n // assign default ordering\n //$article->{Orderable::$orderCol} = $article->maxOrder($article->parent_id) + 1;\n }", "public function create() {\n\t\treturn view('articles.create');\n\t}", "public function create()\n {\n $articles = null;\n return view('article.create',compact('articles'));\n }", "public function create()\n {\n return view('admin.article.create');\n }", "public function created(EntryInterface $entry)\n {\n $this->commands->dispatch(new CreateStream($entry));\n\n parent::created($entry);\n }", "private function insertArticle()\n {\n $this->testArticleId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $this->testArticleParentId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n\n //copy from original article parent and variant\n $articleParent = oxNew('oxarticle');\n $articleParent->disableLazyLoading();\n $articleParent->load(self::SOURCE_ARTICLE_PARENT_ID);\n $articleParent->setId($this->testArticleParentId);\n $articleParent->oxarticles__oxartnum = new oxField('666-T', oxField::T_RAW);\n $articleParent->save();\n\n $article = oxNew('oxarticle');\n $article->disableLazyLoading();\n $article->load(self::SOURCE_ARTICLE_ID);\n $article->setId($this->testArticleId);\n $article->oxarticles__oxparentid = new oxField($this->testArticleParentId, oxField::T_RAW);\n $article->oxarticles__oxprice = new oxField('10.0', oxField::T_RAW);\n $article->oxarticles__oxartnum = new oxField('666-T-V', oxField::T_RAW);\n $article->oxarticles__oxactive = new oxField('1', oxField::T_RAW);\n $article->save();\n\n }", "public function store(createArticleRequest $request)\n\t{\n\t\t$article = new Article($request->all());\n\n\t\t$name = $request->input('interest');\n\n\t\t$tag_id = DB::table('interests')\n\t\t\t->select('interests.id')\n\t\t\t->where('name','=',$name)->get();\n\n\t\t$article->interest()->attach($tag_id);\n\n\t\tAuth::user()->article()->save($article);\n\n\n\n\t\tflash()->overlay('Your article has been created', 'Thank you for posting');\n\t\t\n\t\treturn redirect('article');\n\t}", "public function create()\n {\n return view('pearlskin::admin.articles.create');\n }", "public function addArticle(): void\n {\n $this->title = $_POST['titleArticle'];\n $this->content = $_POST['contentArticle'];\n $this->category = $_POST['categoryArticle'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n $this->author = $_SESSION['user']['id'];\n\n $this->image = $_FILES['imageArticle'];\n $tmp_file = $this->image['tmp_name'];\n $type_file = $this->image['type'];\n\n $temp = explode(\".\", $this->image['name']);\n $name_file = round(microtime(true)) . '.' . end($temp);\n\n $destination = 'application/views/images/';\n\n if (!is_uploaded_file($tmp_file) === true) {\n exit(\"Le fichier est introuvable\");\n };\n if (!strstr($type_file, 'jpg') && !strstr($type_file, 'jpeg') && !strstr($type_file, 'bmp')) {\n exit(\"Le fichier n'est pas une image\");\n }\n if (preg_match('#[\\x00-\\x1F\\x7F-\\x9F/\\\\\\\\]#', $name_file)) {\n exit(\"Nom de fichier non valide\");\n } else if (!move_uploaded_file($tmp_file, $destination . $name_file)) {\n exit(\"Impossible de copier le fichier dans $destination\");\n } else {\n move_uploaded_file($tmp_file, $destination . $name_file);\n }\n\n $this->articleModel->addArticle($this->title, $this->content, $this->category, $name_file, $this->date, $this->author);\n\n // Redirect to the articles list page\n Router::redirectTo('listArticles');\n exit();\n }" ]
[ "0.6548769", "0.6399625", "0.62261313", "0.60732126", "0.6056525", "0.6029116", "0.60059524", "0.5978391", "0.597736", "0.5976863", "0.5891212", "0.5891212", "0.5872244", "0.58556974", "0.58203787", "0.58025295", "0.5795747", "0.57853097", "0.5779718", "0.5745753", "0.57433796", "0.5733665", "0.57332563", "0.5714664", "0.57066166", "0.56982476", "0.5689642", "0.56476283", "0.5644392", "0.5628866" ]
0.70579916
0
Handle the article "deleted" event.
public function deleted(Article $article) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleDeleted(Deleted $event): void\n {\n $entity = $event->entity();\n\n $this->scheduleRemovingOldDocuments($entity);\n\n $this->elasticsearchManager->commit();\n }", "public function deleteArticle(): void\n {\n $this->articleId = $_GET['deleteId'];\n\n $this->articleModel->deleteArticle($this->articleId);\n // Redirect to the articles list page\n Router::redirectTo('listArticles');\n exit();\n }", "public function onDelete(): void\n {\n if ($this->globals->getUpdated() !== (int) $_GET['id']) {\n $this->_entity->delete($_GET['id']);\n $this->globals->setUpdated($_GET['id']);\n $this->globals->unsetAlert();\n }\n }", "public function onAfterDelete() {\n\t\tparent::onAfterDelete();\n\n\t\tif($this->isPublished()) {\n\t\t\t$this->doUnpublish();\n\t\t}\n\t}", "public function onWikiDelete(WikiWasDeleted $event)\n {\n try {\n $this->wiki->withTrashed()->find($event->wiki['id'])->deleteFromIndex();\n } catch (\\Exception $e) {\n app('log')->warning($e->getMessage());\n }\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}", "public function handleDelete($eid) {\n\t\t$this->checkTeacherAuthority();\n\t\tif (EventModel::deleteEvent($eid)) {\n\t\t\t$this->flashMessage(_('Event Deleted'), 'success');\n\t\t\t$this->redirect('event:homepage', $this->cid);\n\t\t}\n\t\telse\n\t\t\t$this->flashMessage(_('There was an error deleting the event'), 'error');\n\t}", "protected function handleDoDelete() {\n\t\t\tif ($this->verifyRequest('DELETE') && $this->verifyParams()) {\n\t\t\t\tif ($this->blnAuthenticated) {\n\t\t\t\t\tif ($intEventId = str_replace('.' . $this->strFormat, '', $this->objUrl->getSegment(3))) {\n\t\t\t\t\t\t$objUserEvent = $this->initModel();\n\t\t\t\t\t\tif ($objUserEvent->loadById($intEventId) && $objUserEvent->count()) {\n\t\t\t\t\t\t\tif ($objUserEvent->current()->get('userid') == AppRegistry::get('UserLogin')->getUserId()) {\n\t\t\t\t\t\t\t\tif ($objUserEvent->destroy()) {\n\t\t\t\t\t\t\t\t\tCoreAlert::alert('The event was deleted successfully.');\n\t\t\t\t\t\t\t\t\t$this->blnSuccess = true;\n\t\t\t\t\t\t\t\t\t$this->intStatusCode = 200;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error deleting the event'));\n\t\t\t\t\t\t\t\t\t$this->error(400);\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\ttrigger_error(AppLanguage::translate('Invalid event permissions'));\n\t\t\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error loading the event data'));\n\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing event ID'));\n\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing or invalid authentication'));\n\t\t\t\t\t$this->error(401);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->error(400);\n\t\t\t}\n\t\t}", "public function deleted() {\n // TODO Implement this\n }", "public function deleted(Article $article)\n {\n $article->articles()->detach();\n }", "public function forceDeleted(Article $article)\n {\n //\n }", "protected function afterDelete()\r\n {\r\n }", "public function onAfterDelete();", "public static function deleted($callback)\n {\n self::listenEvent('deleted', $callback);\n }", "public function AdminDeleteArticleProcess(Request $request) {\n\n $article = Article::find($request->article_id);\n $article->delete();\n return redirect()->route('admin-article');\n }", "public function onContentAfterDelete($context, $article)\n {\n \n $articleId = $article->id;\n if ($articleId)\n {\n try {\n $this->deleteRow($articleId);\n } catch (JException $e) {\n $this->_subject->setError($e->getMessage());\n return false;\n }\n }\n\n return true;\n }", "public function handleDelete()\n {\n Craft::$app->getDb()->createCommand()\n ->delete(Table::REVISIONS, ['id' => $this->owner->revisionId])\n ->execute();\n }", "public function deleted(EntryInterface $entry)\n {\n //$this->dispatch(new DeleteStream($entry));\n\n parent::deleted($entry);\n }", "protected function afterDelete()\n {\n }", "public static function deleted($event) {\n\n\t\t$account = $event->getSubject();\n\n\t}", "public function delete($evID)\n {\n $event = Event::find($evID);\n if ($event == null) {\n return view('cms.error', ['message' => 'Event not found!']);\n }\n \n // delete main photo\n if ($event->article->image != null) {\n Storage::delete('public/images/'.$event->article->image);\n }\n\n // delete entry in events and article table\n $artID = $event->artID;\n Event::destroy($evID);\n \n // delete all article content\n // delete directory\n Storage::deleteDirectory('public/images/articles/'.$artID);\n \n Article::destroy($artID);\n return redirect('/cms/events');\n }", "public function afterDelete(&$id, Entity $entity) { }", "protected function onDeleted()\n {\n return true;\n }", "public function onBeforeDelete();", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, $this::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "public static function onArticleDeleteComplete( $article, User $user, $reason, $id, Content $content = null, LogEntry $logEntry ) {\n global $wgWebhooksRemovedArticle;\n if (!$wgWebhooksRemovedArticle) {\n return;\n }\n\n self::sendMessage('RemovedArticle', [\n 'articleId' => $article->getTitle()->getArticleID(),\n 'title' => $article->getTitle()->getFullText(),\n 'namespace' => $article->getTitle()->getNsText(),\n 'user' => (string) $user,\n 'reason' => $reason\n ]);\n }", "protected function _postDelete()\n\t{\n\t}" ]
[ "0.7087722", "0.7019726", "0.68952686", "0.6866915", "0.67814153", "0.67567617", "0.67555803", "0.6750633", "0.6691592", "0.66795015", "0.66701895", "0.66592854", "0.6648249", "0.6615855", "0.6586728", "0.6582891", "0.6579901", "0.65776056", "0.6562586", "0.6556635", "0.6552611", "0.6528949", "0.650521", "0.6491136", "0.6476672", "0.6475391", "0.64666694", "0.646526", "0.6461021", "0.64514834" ]
0.771325
0
Handle the article "restored" event.
public function restored(Article $article) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function restored(Document $document)\n {\n //\n }", "function restoreArticle($accountId, $articleId)\n {\n // update the database\n mysql_query(\"UPDATE argus_saved_articles SET status='SAVED' WHERE account_id = '\".$accountId.\"' AND saved_article_id = '\".$articleId.\"'\") or die(mysql_error());\n \n return;\n }", "protected function onRestored()\n {\n return true;\n }", "public function restored(Post $post)\n {\n $post->recordActivity('restored');\n }", "public function restore() {\n self::restoreAll($this->chapterID);\n }", "public function restored(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('restored'));\n\n // Once the model is restored, we need to put everything back\n // as before, in case a legitimate update event is fired\n static::$restoring = false;\n }", "function restore()\n {\n }", "public function restored(Remission $remission)\n {\n //\n }", "public function restored(BlogPost $blogPost)\n\t{\n\t\t//\n\t}", "public function restore()\n {\n //\n }", "public function restored(Post $post)\n {\n //\n }", "public function restored(Post $post)\n {\n //\n }", "public function restored(Installment $installment)\n {\n //\n }", "public function restored(Exchange $exchange)\n {\n //\n }", "public function after_restore(){\n \tglobal $DB;\n \t\n \t\n \t$pagemenuid = $this->get_activityid();\n\n \tif ($modulelinks = $DB->get_records('pagemenu_links', array('pagemenuid' => $pagemenuid))){\n \t\tforeach($modulelinks as $ml){\n \t\t\t\n \t\t\t$ml->previd = $this->get_mappingid('pagemenu_links', $ml->previd);\n \t\t\t$ml->nextid = $this->get_mappingid('pagemenu_links', $ml->nextid);\n\n\t\t\t\tif ($ml->type == 'module'){\n\t \t\t\tif ($link = $DB->get_record('pagemenu_link_data', array('linkid' => $ml->id))){\n\t \t\t\t\t$link->value = $this->get_mappingid('course_module', $link->value);\n\t \t\t\t\t$DB->update_record('pagemenu_link_data', $link);\n\t \t\t\t} else {\n\t\t\t\t\t\t$this->get_logger()->process(\"Failed to restore dependency for pagemenu link '$ml->name'. \", backup::LOG_ERROR); \t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$DB->update_record('pagemenu_links', $ml);\n \t\t}\n \t} \t \t\n }", "public function restore()\n {\n }", "public function restored($artistAlias)\n {\n parent::restored($artistAlias);\n\n Log::Info(\"Restored artist alias\", ['artist alias' => $artistAlias->id, 'artist' => $artistAlias->artist->id]);\n }", "public function restored(PurchaseReceipt $purchaseReceipt)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restoring($model)\n\t{\n\t}", "public function restoring(Auditable $model)\n {\n // When restoring a model, an updated event is also fired.\n // By keeping track of the main event that took place,\n // we avoid creating a second audit with wrong values\n static::$restoring = true;\n }", "public function undoRestore ()\n {\n if (file_exists ( $this->_previewFilename ))\n {\n unlink($this->_previewFilename);\n }\n }", "public function restore() {}", "public function restored(Region $region)\n {\n //\n }", "public function restored(ShopBlog $shopBlog)\n {\n //\n }", "public function updraft_ajaxrestore() {\n\t\t$this->prepare_restore();\n\t\tdie();\n\t}", "public function restored(Order $order)\n\t{\n\t\t//\n\t}" ]
[ "0.6418015", "0.64027333", "0.63659656", "0.6340953", "0.63122785", "0.6301364", "0.6143056", "0.6039298", "0.60353076", "0.6023699", "0.6021877", "0.6021877", "0.60056734", "0.59826285", "0.59790856", "0.5978622", "0.596696", "0.59533626", "0.5953029", "0.5953029", "0.5953029", "0.5953029", "0.594637", "0.5934472", "0.59151334", "0.5913316", "0.59116626", "0.5907908", "0.5886382", "0.5871357" ]
0.7296646
0
Handle the article "force deleted" event.
public function forceDeleted(Article $article) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleted(Article $article)\n {\n //\n }", "public function onBeforeDelete();", "protected function _postDelete() {}", "protected function _postDelete() {}", "protected function afterDelete()\r\n {\r\n }", "public function onAfterDelete() {\n\t\tparent::onAfterDelete();\n\n\t\tif($this->isPublished()) {\n\t\t\t$this->doUnpublish();\n\t\t}\n\t}", "protected function afterDelete()\n {\n }", "public function onAfterDelete();", "function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}", "public function deleteArticle(): void\n {\n $this->articleId = $_GET['deleteId'];\n\n $this->articleModel->deleteArticle($this->articleId);\n // Redirect to the articles list page\n Router::redirectTo('listArticles');\n exit();\n }", "public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}", "protected function _preDelete() {}", "protected function onDeleted()\n {\n return true;\n }", "public function onAfterDelete() {\n if (!($this->owner instanceof \\SiteTree))\n {\n $this->doDeleteDocumentIfInSearch();\n }\n }", "public function onAfterDelete() {\n\t\tif (!$this->owner->ID || self::get_disabled() || self::version_exist($this->owner))\n\t\t\treturn;\n\t\t$this->onAfterDeleteCleaning();\n\t}", "protected function _postDelete()\n\t{\n\t}", "public function onDelete(): void\n {\n if ($this->globals->getUpdated() !== (int) $_GET['id']) {\n $this->_entity->delete($_GET['id']);\n $this->globals->setUpdated($_GET['id']);\n $this->globals->unsetAlert();\n }\n }", "public function handleDelete()\n {\n Craft::$app->getDb()->createCommand()\n ->delete(Table::REVISIONS, ['id' => $this->owner->revisionId])\n ->execute();\n }", "function before_delete() {}", "public function onContentAfterDelete($context, $article)\n {\n \n $articleId = $article->id;\n if ($articleId)\n {\n try {\n $this->deleteRow($articleId);\n } catch (JException $e) {\n $this->_subject->setError($e->getMessage());\n return false;\n }\n }\n\n return true;\n }", "public function preDelete() { }", "protected function beforeDelete()\n {\n }", "public function deleted() {\n // TODO Implement this\n }", "protected function MetaAfterDelete() {\n\t\t}", "protected function onDeleting()\n {\n return true;\n }", "public function after_delete() {}", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "public function deleteDocument() {\n\n // should get instance of model and run delete-function\n\n // softdeletes-column is found inside database table\n\n return redirect('/home');\n }", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, $this::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "protected function afterDelete()\n {\n parent::afterDelete();\n //Comment::model()->deleteAll('post_id='.$this->id);\n VideoTag::model()->updateFrequency($this->tags, '');\n }" ]
[ "0.735307", "0.71821976", "0.71476066", "0.7147364", "0.7061638", "0.7032354", "0.69855005", "0.69759375", "0.69478565", "0.6932825", "0.6873485", "0.68435514", "0.6828872", "0.6807576", "0.67816925", "0.6770911", "0.67274284", "0.6707876", "0.6684959", "0.66434", "0.66096026", "0.65973854", "0.6537604", "0.65341467", "0.65249825", "0.65243334", "0.65156317", "0.65063864", "0.65045375", "0.6489292" ]
0.7735243
0
Updates an existing FacturaGastos model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $this->layout ="main-admin"; $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id_factura_gastos]); } else { return $this->render('update', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['NubeFactura'])) {\n $model->attributes = $_POST['NubeFactura'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->IdFactura));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_detalle_factura]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate() {\n $model = $this->loadModel();\n $modelAmbienteUso = new Ambiente_Uso;\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $a = $model->DT_DIA;\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelAmbienteUso,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n $condicion = new CodicionPago;\n $bodega = new Bodega;\n $categoria = new Categoria;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ConfFa']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ConfFa'];\n\t\t\tif($model->save()) {\n\t\t\t\t//$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t\t$this->redirect(array('update&id=1&men=S002'));\n } else {\n $this->redirect(array('update&id=1&men=E002'));\n }\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n 'condicion'=>$condicion,\n 'categoria'=>$categoria,\n 'bodega'=>$bodega,\n\t\t));\n\t}", "public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, factura $factura)\n {\n $factura->fill($request->all());\n $factura->save();\n $facturas=factura::all();\n return redirect()->route('factura.index',[$factura])->with('status','Informacion Actualizada Correctamente');\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['GestionComentarios'])) {\n $model->attributes = $_POST['GestionComentarios'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Pagosconceptos']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Pagosconceptos'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('admin','id'=>$model->PACO_ID));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(Request $request, Factura $factura)\n {\n //\n }", "public function actionUpdate()\n {\n $id_usuario_actual=\\Yii::$app->user->id;\n $buscaConcursante = Concursante::find()->where(['id' => $id_usuario_actual])->one();\n\n $request = Yii::$app->request;\n $id_tabla_presupuesto=$request->get('id_tabla_presupuesto');\n $id_postulacion = $request->get('id_postulacion');\n $model = $this->findModel($id_tabla_presupuesto);\n\n $buscaPostulacion = Postulacion::find()->where(['and',['id_postulacion' => $id_postulacion],['id_concursante' => $buscaConcursante->id_concursante]])->one();\n\n if($buscaPostulacion != null && $model != null){ \n\n if ($model->load(Yii::$app->request->post())) {\n\n $cantidad = (float) preg_replace('/[^0-9.]/', '', $model->cantidad);\n $precioUni = (float) preg_replace('/[^0-9.]/', '', $model->precioUnitario);\n $total = $cantidad * $precioUni;\n $model->costoTotal = $total.'';\n \n if($model->save()){\n return $this->redirect(['/site/section4', 'id_postulacion' => $id_postulacion]);\n }else{\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n }\n\n }else{\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n\n }", "public function actionUpdate()\n {\n $categoryOptions = DataHelper::getCategoryOptions();\n $statusMap = CmsCategory::getCategoryStatus();\n $model = $this->findModel($_GET['id']);\n if (Yii::$app->request->isPost) {\n $model->image_main_file = UploadedFile::getInstance($model, 'image_main_file');\n if (($file = $model->uploadImageMain())!=false) {\n UtilHelper::DeleteImg($model->image_main);\n $model->image_main = $file['src'];\n }\n $model->image_node_file = UploadedFile::getInstance($model, 'image_node_file');\n if (($file = $model->uploadImageNode())!=false) {\n UtilHelper::DeleteImg($model->image_node);\n $model->image_node = $file['src'];\n }\n $model->banner_file = UploadedFile::getInstance($model, 'banner_file');\n if (($file = $model->uploadBanner())!=false) {\n UtilHelper::DeleteImg($model->banner);\n $model->banner = $file['src'];\n }\n \n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n DataHelper::deleteCache();\n return $this->redirect(['index']);\n }\n }\n return $this->render('update', [\n 'model' => $model,\n 'categoryOptions' => $categoryOptions,\n 'statusMap' => $statusMap,\n ]);\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) \r\n {\r\n return $this->redirect(['view', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n\r\n ]);\r\n }\r\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Cotizador'])) {\n $model->attributes = $_POST['Cotizador'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function update($id, UpdateFacturasRequest $request)\n {\n $input = $request->all();\n $auxfacturas = $this->facturasRepository->find($id); \n\n if( isset($input['iva']) ){\n $input['iva']=1;\n }else{\n $input['iva']=0;\n }\n\n $facturas = $this->facturasRepository->update($input, $id);\n if($input['cantidad']!=null && $input['precio_unitario']!=null){\n \n $Detalle = new FacturasDetalles;\n $Detalle ->id_fac=$id; \n $Detalle ->id_prod=$input['descripcion'];\n $Detalle ->cantidad=$input['cantidad'];\n $Detalle ->descripcion=$input['descripcion'] ;\n $Detalle ->precio_unitario=$input['precio_unitario'] ;\n $Detalle ->destino=$input['destino'] ;\n $Detalle->save();\n return redirect(route('facturas.edit',$id));\n } \n \n return redirect(route('facturas.index',$id));\n\n }", "public function update(GrastofijoFormRequest $request,$id)\n {\n $gasto=Gatofijo::findOrfail($id);\n $gasto->luz=$request->get('luz');\n $gasto->cable=$request->get('cable');\n $gasto->agua=$request->get('agua'); \n $gasto->hipoteca=$request->get('hipoteca'); \n $gasto->alquiler=$request->get('alquiler'); \n $gasto->otros=$request->get('otros'); \n $gasto->sub_total=$request->get('sub_total'); \n $gasto->update();\n return Redirect::to('gasto/gastofijo');\n }", "public function update()\n {\n\n $id = null;\n $velo_id = null;\n $description = null;\n $image = null;\n\n if (!empty($_POST['id']) && ctype_digit($_POST['id'])) {\n $id = $_POST['id'];\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n if (!empty($_POST['image']) && $_POST['image'] != \"\") {\n $image = htmlspecialchars($_POST['image']);\n }\n\n if (!empty($_POST['description'])) {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!$id || !$image || !$description) {\n die(\"formulaire mal rempli $id, $image, $description\");\n }\n\n $voyage_to_edit = $this->model->find($id, $this->modelName);\n\n if (!$voyage_to_edit) {\n die(\"Does Not Exist\");\n }\n\n $this->model->edit($id, $description, $image);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function update()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_POST['id']);\n $tacgia->anh = $_POST['anh'];\n $tacgia->ten = $_POST['ten'];\n $tacgia->thongtin = $_POST['thongtin'];\n $tacgia->update();\n\n go_back();\n }", "public function update() {\n //Si no es adminitrador da un error.\n Login::checkAdmin(); \n \n //comprueba que llegue el formulario con los datos\n if (empty($_POST[T_UPDATE]))\n throw new Exception('No se recibieron datos');\n \n //podemos crear un nuevo coche o recuperar el de la BDD,\n // optamoss por crear uno nuevo para ahorrar una consulta.\n \n $coche= new Coche(); //coche nuevo\n \n $coche->id=intval($_POST['id']); //recuperar el id vía POST\n \n //recuperar el resto de campos\n $idmodelo=intval($_POST['idmodelo']); //recuperar el idmodelo vía POST\n $coche->idmodelo=$idmodelo;\n $coche->nombre=$_POST['nombre'];\n $coche->nserie=$_POST['nserie'];\n $coche->precio=floatval($_POST['precio']);\n \n //intenta realizar la actualización de datos\n if ($coche->actualizar()===false)\n throw new Exception(\"No se pudo actualizar $nave->nombre\");\n \n //redireccionamos a ModeloController::show($id);\n (new ModeloController())->show($idmodelo);\n \n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Aviso'])) {\n $model->attributes = $_POST['Aviso'];\n if ($model->save()) {\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Pago']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Pago'];\n\t\t\t$model->fechahoraregistro = date('Y-m-d H:i:s');\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('admin'));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(Request $request, $numero_factura)\n {\n $factura = Factura::find($numero_factura);\n $factura->fill($request->all());\n $factura->save();\n Flash::warning('La factura ha sido modificada');\n return redirect()->route('facturas.index');\n }", "public function update(CreateGastoRequest $request, Gasto $gasto)\n {\n $gasto->fill($request->validated());\n $gasto->save();\n $datos=Gasto::all();\n $suma=Gasto::sum('monto_g');\n return view('gasto.index',compact('datos', 'suma'));\n }", "public function actionUpdate($id)\n {\n $us = Usuarios::find()->where(['id' => Yii::$app->user->id])->one();\n if ($us->rol !== 'A' && $us->rol !== 'C' && $us->rol !== 'V') {\n return $this->goHome();\n }\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n $sec = Secstocks::findOne(['uniforme_id' => $model->id]);\n if ($sec !== null) {\n if ($model->cantidad > $sec->ss) {\n $model->underss = false;\n }\n }\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->save() && $model->upload()) {\n if ($us->rol === 'V') {\n return $this->redirect(['index']);\n }\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Docingresados']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Docingresados'];\n\t\t\tif($model->save()) {\n\t\t\t //verificando si se slecciono la opcion de conservarlos valores \n\t\t\t\t\t\tif ($model->conservarvalor=='0' ) \n\t\t\t\t\t\t $this->Destruyesesiones();\n\t\t\t\t\t if (!empty($_GET['asDialog']))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t//Close the dialog, reset the iframe and update the grid\n\t\t\t\t\t\t\t\t\t\t\t\t\techo CHtml::script(\"window.parent.$('#cru-dialog1').dialog('close');\n\t\t\t\t\t\t\t\t\t\t\t\t\t window.parent.$('#cru-frame1').attr('src','');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twindow.parent.$.fn.yiiGridView.update('{$_GET['gridId']}');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tYii::app()->end();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t \n\t\t }\n\t\t}\n\t\t$this->layout = '//layouts/iframe';\n\t\t$this->render('update',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t\t\t));\n\t}", "public function actionUpdate($id) {\n\t\t$model = $this -> loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this -> performAjaxValidation($model);\n\n\t\tif (isset($_POST['Proyecto'])) {\n\t\t\t$model -> attributes = $_POST['Proyecto'];\n\t\t\tif ($model -> save())\n\t\t\t\t$this -> redirect(array('view', 'id' => $model -> id));\n\t\t}\n\n\t\t$this -> render('update', array('model' => $model, ));\n\t}", "public function update(Request $request, $id)\n {\n $fpago=Pago::findOrFail($id);\n $fpago->forma=strtoupper($request->get('forma'));\n $fpago->descripcion=strtoupper($request->get('descripcion'));\n $fpago->update();\n Session::flash('message','Forma de pago actualizada');\n return redirect()->route('admin.fpagos.index');\n }", "public function actionUpdate($id)\n {\n if (Yii::$app->user->isGuest) {\n return $this->redirect([\"site/login\"]); \n }\n if(Permiso::requerirRol('lider')){\n $this->layout='/main2';\n }elseif(Permiso::requerirRol('vendedor')){\n $this->layout='/main3';\n }\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idproducto]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\t\n\t\t$this->titulo = 'Alterar Contato';\n\t\t$this->subTitulo = '';\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\n\t\t\t$this->session->setFlashProjeto( 'success', 'update' );\n \n\t\t\treturn $this->redirect(['view', 'id' => $model->cod_contato]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['OperaPlanes']))\n\t\t{\n\t\t\t$model->attributes=$_POST['OperaPlanes'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n$this->layout='//layouts/column2';\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}" ]
[ "0.68579215", "0.6842699", "0.67270225", "0.66001326", "0.6575052", "0.6437881", "0.6400569", "0.63786995", "0.6373376", "0.637138", "0.6363588", "0.63323665", "0.6303967", "0.62889224", "0.6274382", "0.6267757", "0.6264036", "0.6260078", "0.62341714", "0.6218727", "0.62018037", "0.619482", "0.6188804", "0.61596733", "0.6143455", "0.6127246", "0.6117736", "0.61139715", "0.6106455", "0.6098917" ]
0.7221478
0
Gets movie information by a string
public function getByString($movie){ $url = "http://www.omdbapi.com/?t=".urlencode($movie)."&y=&plot=short&r=json"; if($json = file_get_contents($url)){ $info = json_decode($json); if(isset($info->Title) && $info->Title !=''){ return $info->Title."(".$info->Year.") - Rating ".$info->imdbRating." - http://www.imdb.com/title/".$info->imdbID."/"; }else{ return 'Couldn\'t find this movie'; } }else{ return 'Could not connect.'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMovieInformation($movie)\n{\n if($movie != \"\") {\n $OMDB_API_KEY = '99842c57';\n $omdbUrl = \"http://www.omdbapi.com?s=$movie&apikey=$OMDB_API_KEY&type=movie\";\n $movie = file_get_contents($omdbUrl);\n\n $movieDetails =json_decode($movie, true);\n\n \n if(count($movieDetails['Search'])) {\n $movieList = $movieDetails['Search'];\n // Pick the first movie\n $movie = $movieList[0];\n $movieTitle = $movie[\"Title\"];\n $movieYear = $movie[\"Year\"];\n $moviePoster = $movie[\"Poster\"];\n\n sendFulfillmentResponse($movieTitle, $movieYear, $moviePoster, true);\n } else {\n sendFulfillmentResponse(null, null, null, false);\n }\n } else {\n sendFulfillmentResponse(null, null, null, false);\n }\n \n}", "function gatherMovieInfo($moviefile, $moviedbid)\n\t{\n\t\t$movieinfo['filepath'] = $moviefile;\n\t\t$movieinfo['moviedbid'] = $moviedbid;\n\n\t\t\n\t\tif ($moviedbid == \"0\") {\n\t\t\t//\n\t\t\t// adding as a custom movie with no moviedb link. Like a home movie.\n\t\t\t//\n\t\t\t$info = pathinfo($moviefile);\n\t\t\t$title = basename($moviefile,'.'.$info['extension']);\n\t\t\t\n\t\t\t$movieinfo['title'] = $title;\n\t\t\t$movieinfo['original_title'] = $title;\n\t\t\t$movieinfo['genres'] = 'Home Movies';\n\t\t}\n\t\telse\n\t\t{\n\t\t\n\t\t\t// get runtime from file\n\t\t\t$meta= new getID3();\n\t\t\t$file = $meta->analyze($moviefile);\n\t\t\t$duration = $file['playtime_seconds'];\n\t\t\t$movieinfo['duration'] = round($duration / 60);\n\n\t\t\t$moviedbinfo = getAPI3Result(\"movie/\" . $moviedbid, \"append_to_response=casts,releases,images\");\n\n\t//\t\t$movieinfo['duration'] = $moviedbinfo['runtime'];\n\t\t\t$movieinfo['title'] = $moviedbinfo['title'];\n\t\t\t$movieinfo['imdbid'] = $moviedbinfo['imdb_id'];\n\t\t\t$movieinfo['original_title'] = $moviedbinfo['original_title'];\n\t\t\t$movieinfo['year'] = substr($moviedbinfo['release_date'],0,4);\n\t\t\t$movieinfo['mpaa'] = getUSRating($moviedbinfo);\n\t\t\t$movieinfo['director'] = getDirector($moviedbinfo);\n\t\t\t$movieinfo['writers'] = getWriters($moviedbinfo);\n\t\t\t$movieinfo['tagline'] = $moviedbinfo['tagline'];\n\t\t\t$movieinfo['genres'] = getGenres($moviedbinfo);\n\t\t\t$movieinfo['overview'] = $moviedbinfo['overview'];\n\t\t\t$movieinfo['plot'] = $moviedbinfo['overview'];\n\t\t\t$movieinfo['actors'] = getActors($moviedbinfo);\n\t\t\t$movieinfo['moviedbruntime'] = $moviedbinfo['runtime'];\n\n\t\t\t$config = getAPI3Result(\"configuration\");\n\n\t\t\t// get the thumbnails\n\t\t\t$thumbnails = \"\";\n\t\t\tforeach($moviedbinfo['images'][\"posters\"] as $poster) {\n\t\t\t\t$fullpath = $config['images']['base_url'] . \"original\" . $poster['file_path'];\n\t\t\t\tif (empty($movieinfo['thumb'])) $movieinfo['thumb'] = $fullpath;\n\t\t\t\t$thumbnails .= \"<thumb>\" . $fullpath . \"</thumb>\";\n\t\t\t}\t\t\t\t\n\t\t\t$movieinfo['allthumbs'] = $thumbnails;\n\t\t}\n\t\t\n\t\treturn $movieinfo;\n\n\t}", "public function getMovieInfo($idMovie, $option = '', $append_request = ''){\n\t\t$option = (empty($option)) ? '' : '/' . $option;\n\t\t$params = 'movie/' . $idMovie . $option;\n\t\t$result = $this->_call($params, $append_request);\n\t\t\t\n\t\treturn $result;\n\t}", "public function doMovieSearch()\n {\n if ( !preg_match( \"/^(.*)(19|20)[0-9]{2}/\", $this->Release, $matches ) )\n {\n $variables = array( 'status' => 'ko', 'message' => 'unable to extract the movie name' );\n }\n else\n {\n $movieTitle = $matches[1];\n\n $scraper = new MkvManagerScraperSubsynchro();\n $movies = array_map(\n function( $movie ) {\n $movie['id'] = str_replace( array( '/', '.' ), array( '|', '~' ), $movie['id'] );\n return $movie;\n },\n $scraper->searchMovies( $movieTitle )\n );\n\n $variables = array( 'status' => 'ok', 'movies' => $movies );\n }\n\n $result = new ezcMvcResult();\n $result->variables += $variables;\n\n return $result;\n }", "public function movies()\n\t{\n\t\tif (preg_match('/^([a-z].+) - \\[\\d+\\/\\d+\\][ _-]{0,3}(\"|#34;).+(\"|#34;) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} ///^Have Fun - (\"|#34;)(.+)\\.nfo(\"|#34;) Ph4let0ast3r yEnc$/i\n\t\tif (preg_match('/^Have Fun - (\"|#34;)(.+)\\.nfo(\"|#34;) Ph4let0ast3r yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(01/34) \"Sniper.Reloaded.2011.BluRay.810p.DTS.x264-PRoDJi.Turkish.Audio.par2\" - 139,30 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) (\"|#34;)(.+)\\.(par2|nfo|rar|nzb)(\"|#34;) - \\d+[.,]\\d+ [kKmMgG][bB] - yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //\"Discovery.Channel.Tsunami.Facing.The.Wave.720p.HDTV.x264-PiX.rar\"\n\t\tif (preg_match('/^(\"|#34;)(.+)\\.rar(\"|#34;)$/i', $this->subject, $match)) {\n\t\t\treturn $match[2];\n\t\t} //Saw.VII.2010.720p.Bluray.x264.DTS-HDChina Saw.VII.2010.720p.Bluray.x264.DTS-HDChina.nzb\n\t\tif (preg_match('/^([a-z].+) .+\\.(par2|nfo|rar|nzb)$/i', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(????) [1/1] - \"The Secret Life of Walter Mitty 2013 CAM AAC x264-SSDD.mp4\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(001/114) - Description - \"The.Chronicles.of.Riddick.2004.DC.BluRay.1080p.DTS.par2\" - 10,50 GB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}Description[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[00/56] - \"The.Last.Days.On.Mars.720p.BluRay.x264-DR.nzb\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[REUP] 6.Degress.of.Hell.2012.1080p.BluRay.DTS-HD.x264-BARC0DE - [03/50] - \"BARC0DE.vol00+1.PAR2\" yEnc\n\t\t//[REUP]Home.Of.The.Brave.2006.1080p.BluRay.DTS-HD.x264-BARC0DE - [03/38] - \"BARC0DE.vol00+1.PAR2\" yEnc\n\t\tif (preg_match('/^\\[REUP\\]( )?(.+?) - \\[\\d+\\/\\d+\\] - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //- Description - \"The.Legend.of.Hercules.2014.720p.BluRay.x264.YIFY.mp4.01\" - 795,28 MB - yEnc\n\t\tif (preg_match('/^- Description - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])[- ]{0,4}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Star.Trek.Into.Darkness.2013.3D.HOU.BDRip.1080p-FAGGOTS [431/432] - \"stid3d.vol124+128.par2\" yEnc\n\t\tif (preg_match('/^([\\w.()-]{8,}?)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(130/138) - Captain America The Winter Soldier 2014 NEW (FIXED) 720p CAM x264 Pimp4003 - \"wXZ6LxFt.zip.130\" - 2.02 GB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}([\\w.() -]{8,}?\\b)[-_\\s]{0,3}\".+?' . $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //22.Jump.Street.2014.720p.BluRay.x264-tpU.vol000+01.PAR2 [73/84] - \"22.Jump.Street.2014.720p.BluRay.x264-tpU.vol000+01.PAR2\" yEnc\n\t\tif (preg_match('/^.+\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function getMovieDetails() {\n\t\t\t$url = \"http://api.brightcove.com/services/library?command=find_video_by_reference_id&media_delivery=http&reference_id=\".$this->getMovieID() .\"&video_fields=name,renditions&token=Ekg-LmhL4QrFPEdtjwJlyX2Zi4l6mgdiPnWGP0bKIyKKT_94PTKHrw..\";\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch,CURLOPT_URL,$url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$jsonResponse = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$result = json_decode($jsonResponse);\n\t\treturn $result->renditions;\n\t}", "function getSingleMovie($title, $vote_average, $overview, $releaseDate, $genres, $peer_id, $keyboard)\r\n{\r\n $movieGenres = '';\r\n\r\n foreach ($genres as $genre) {\r\n $movieGenres .= localizeGenreID($genre) . ', ';\r\n }\r\n $movieGenres = rtrim($movieGenres, ', ');\r\n if ($overview !== '') {\r\n $message = $title . '<br>' .\r\n 'Жанры: ' . $movieGenres . '<br>' .\r\n 'Оценка: ' . $vote_average . '<br>' .\r\n 'Дата выхода: ' . $releaseDate . '<br>' .\r\n 'Описание: ' . $overview;\r\n } else {\r\n $message = $title . '<br>' .\r\n 'Жанры: ' . $movieGenres . '<br>' .\r\n 'Оценка: ' . $vote_average . '<br>' .\r\n 'Дата выхода: ' . $releaseDate . '<br>';\r\n }\r\n\r\n request($message, $peer_id, $keyboard, '');\r\n}", "function get_movies( $query )\n{\n log_error('get_movies');\n $html = get_html($query);\n\n $results = array();\n\n foreach($html->find('#movie_results .theater') as $div) {\n log_error('found a theatre');\n $result = array();\n\n //$theatre_id = $div->find('h2 a',0)->getAttribute('href');\n $theatre_info = $div->find('.info',0)->innertext;\n\n //$result['theatre_id'] = substr( $theatre_id, (strrpos($theatre_id, 'tid=')+4) );\n $result['theatre_name'] = $div->find('.name',0)->innertext;\n\n $pos_info = strrpos( $theatre_info, '<a');\n if( $pos_info !== false )\n $result['theatre_info'] = substr( $theatre_info, 0, strrpos( $theatre_info, '<a'));\n else\n $result['theatre_info'] = $theatre_info;\n\n $result['movies'] = array();\n foreach($div->find('.movie') as $movie) {\n log_error('found a movie - '.$movie->find('.name a',0)->innertext);\n\n $movie_id = $movie->find('.name a',0)->getAttribute('href');\n $movie_id = substr( $movie_id, (strrpos($movie_id, 'mid=')+4) );\n\n log_error('obtained movie_id: '.$movie_id);\n\n $info_raw = $movie->find('.info',0)->innertext;\n $pos = strpos($info_raw, ' - <a');\n\n if( $pos !== false ){\n $info = substr( $info_raw, 0, $pos);\n\n $trailer = urldecode($movie->find('.info a', 0)->getAttribute('href'));\n $trailer = substr($trailer, 7);\n $trailer = substr($trailer, 0, strpos($trailer, '&'));\n }\n else {\n $trailer = '';\n }\n\n // showtimes\n $times = array();\n // echo 'movie: '.$movie->find('.name a',0)->innertext.'<br>';\n // echo $movie->find('.times',0)->childNodes(0);\n foreach($movie->find('.times > span') as $time) {\n // echo 'time: '.$time->innertext.'<br>';\n // echo 'attr: '.$time->getAttribute('style').'<br>';\n\n if( trim($time->getAttribute('style')) != 'padding:0' )\n {\n $time_strip = strip_tags($time->innertext);\n $time_strip = str_replace('&nbsp', '', $time_strip);\n $time_strip = str_replace(' ', '', $time_strip);\n //$time_strip = html_entity_decode($time_strip);\n //echo 'a:'.$time_strip.'<br>';\n /*$pos_time = false;\n $pos_time = strrpos($time->innertext, '-->');\n if( $pos_time !== false ){\n $showtime = substr($time->innertext, $pos_time+3);\n //echo $showtime.'<br>';\n }*/\n //echo $time;\n array_push( $times, $time_strip );\n }\n }\n\n array_push($result['movies'], array(\n 'id' => $movie_id,\n 'name' => $movie->find('.name a',0)->innertext,\n 'info' => $info, // (does <a> exist) ? (yes) : (no)\n 'time' => $times,\n 'trailer' => $trailer\n ));\n }\n\n $results[] = $result;\n }\n\n return $results;\n}", "function getSubtitleInfo($fileName) {\n\n $subtitleInfo = array();\n\n try {\n $url = \"http://www.opensubtitles.org/sv/search/sublanguageid-swe/moviename-\";\n $urlReadyName = urlencode(str_replace(\".mp4\", \"\", $fileName));\n $return = $this->controller->http->call($url.$urlReadyName, array(), \"GET\", \"\");\n\n preg_match_all(\"/servOC\\(([0-9]+),\\'\\/\\w+\\/\\w+\\/[0-9]+\\/([a-z-]+)\\/[a-z-]+\\',/\", $return['content'], $result);\n foreach ($result[1] as $key => $value) {\n $subtitleInfo[] = array($value, $result[2][$key]);\n }\n } catch (Exception $e) { return $subtitleInfo; }\n return $subtitleInfo;\n }", "public function genre()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" genre ?\");\n\t}", "function gatherMovieInfoFromPost( $params ) \n\t{\n\t\tif (!empty($params['localdbid']))\n\t\t\t$movieinfo['localdbid'] = $params['localdbid'];\n\t\t$movieinfo['filepath'] = $params['filepath'];\n\t\t$movieinfo['duration'] = $params['duration'];\n\t\t$movieinfo['title'] = $params['title'];\n\t\t$movieinfo['imdbid'] = $params['imdbid'];\n\t\t$movieinfo['original_title'] = $params['original_title'];\n\t\t$movieinfo['year'] = $params['year'];\n\t\t$movieinfo['mpaa'] = $params['mpaa'];\n\t\t$movieinfo['director'] = $params['director'];\n\t\t$movieinfo['writers'] = $params['writers'];\n\t\t$movieinfo['tagline'] = $params['tagline'];\n\t\t$movieinfo['genres'] = $params['genres'];\n\t\t$movieinfo['overview'] = $params['overview'];\n\t\t$movieinfo['plot'] = $params['overview'];\n\t\t$movieinfo['actors'] = $params['actors'];\n\t\t$movieinfo['thumb'] = isset($params['thumb']) ? urldecode($params['thumb']) : '';\n\t\t$movieinfo['allthumbs'] = urldecode($params['allthumbs']);\n\n\t\treturn $movieinfo;\n\t}", "public function retrieveMovie($args=[]){\n\t\t#ID argument: if not set, fallback to 0\n\t\t$id = $args[\"id\"] ?? 0;\n\t\t#If no ID given, return error\n\t\tif(!$id) return [\"success\" => 0, \"msg\" => \"Empty response from TMDb\"];\n\t\t#Define the URL based on api documentation (https://developers.themoviedb.org/3/movies/get-movie-details)\n\t\t$url = \"https://api.themoviedb.org/3/movie/{$id}?api_key={$this->apiKey}&language={$this->requestLang}\";\n\t\t#Instantiate a new HTTP handler class\n\t\t$HttpHandler = new HttpHandler();\n\t\t#Retrieve raw output from the HTTP handler over the URL\n\t\t$outputRaw = $HttpHandler->execGET($url);\n\t\t#Bypass the consumed output\n\t\treturn $this->consumeRawOutput($outputRaw);\n\t}", "function get_media_info( $video ){\n $media_infos = array( ); $content = shell_exec( 'mediainfo \"' . $video . '\"' ); $xx = explode( \"\\n\\n\", $content );\n\n foreach ( $xx as $data ){$infos = explode( \"\\n\", $data ); $media_type = '';\n foreach ( $infos as $key => $val ){@list($k, $v, $e) = explode( \":\", $val );\n if ( empty( $v ) ){$media_type = $k;}\n else{\n $media_key = str_replace( array( ' ' ), '_', trim( strtolower( $k ) ) );\n $media_value = trim( $v );\n if ( !empty( $e ) )$media_value .= \":$e\"; $media_infos[$media_type][$media_key] = $media_value;\n }\n }\n }return $media_infos;\n}", "public function show(movie $movie)\n {\n //\n }", "public function show(movie $movie)\n {\n //\n }", "public function dvd_movies()\n\t{\n\t\tif (preg_match('/^Skata - (.+) \\(\\d+ \\/ \\d+\\) - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(????) [02361/43619] - \"18j Amy-superlange Beine.exe\" yEnc\n\t\tif (preg_match('/\\(\\?+\\) \\[\\d+\\/\\d+\\] - \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Mutant.Chronicles.German.2008.AC3.DVDRip.XviD.(01/40) \"Mutant.Chronicles.German.2008.AC3.DVDRip.XviD.nfo\" yEnc\n\t\tif (preg_match('/.*\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function gatherMovieInfoFromLocal( $db, $localdbid ) \n\t{\n\t\t$movie = $db->querySingle($select = \"SELECT * FROM movieview WHERE idMovie='\" . $localdbid . \"'\", true);\n\n\t\t$movieinfo['localdbid'] = $localdbid;\n\t\tif ($movie)\n\t\t{\n\t\t\t$movieinfo['filepath'] = $movie['strPath'] . $movie['strFileName'];\n\t\t\t$movieinfo['duration'] = $movie['c11'];\n\t\t\t$movieinfo['title'] = $movie['c00'];\n\t\t\t$movieinfo['imdbid'] = $movie['c09'];\n\t\t\t$movieinfo['original_title'] = $movie['c16'];\n\t\t\t$movieinfo['year'] = $movie['c07'];\n\t\t\t$movieinfo['mpaa'] = $movie['c12'];\n\t\t\t$movieinfo['director'] = $movie['c15'];\n\t\t\t$movieinfo['writers'] = $movie['c06'];\n\t\t\t$movieinfo['tagline'] = $movie['c03'];\n\t\t\t$movieinfo['genres'] = $movie['c14'];\n\t\t\t$movieinfo['overview'] = $movie['c01'];\n\t\t\t$movieinfo['plot'] = $movie['c02'];\n\t\t\t$movieinfo['allthumbs'] = $movie['c08'];\n\t\t\t\n\n\t\t\tif (preg_match('/\\<thumb\\>(?P<thumb>.*)\\<\\/thumb\\>/', $movieinfo['allthumbs'], $matches)) {\n\t\t\t\t$movieinfo['thumb'] = $matches['thumb'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$movieinfo['thumb'] = '';\n\t\t\t}\n\t\n\t\t\t$actors = $db->query(\"SELECT * FROM actorlinkmovie JOIN actors ON actorlinkmovie.idActor=actors.idActor WHERE idMovie='\" . $localdbid . \"'\");\n\t\t\t$movieinfo['actors'] = \"\";\n\t\t\twhile ($actor = $actors->fetchArray()) {\n\t\t\t\tif (!empty($movieinfo['actors'] )) $movieinfo['actors'] .= \" /\\n\";\n\t\t\t\t$movieinfo['actors'] .= $actor['strActor'] . \" AS \" . $actor['strRole'];\n\t\t\t}\n\t\t\t$actors->finalize();\n\t\t}\n\n\n\t\treturn $movieinfo;\n\t}", "public function search_movie_by_imdb_id($id, $type = 'imdb') {\n $format = variable_get('rottentomatoes_format', '.json');\n $params['type'] = $type;\n $params['id'] = $id;\n return $this->call('movie_alias/' . $format, $params, 'GET');\n }", "function get_movie($id)\n{\n\t$db = open_database_connection();\n\t$stmt = $db->prepare(\"SELECT DateTime, video, user.name as author,\n\t\t\t\t\t\tmovie.name as title, text\n\t\t\t\t\t\tFROM movie, movie_category, user\n\t\t\t\t\t\tWHERE movie.userID = user.userID \n\t\t\t\t\t\tAND movie.movieID = :id\");\n\t$stmt->execute(array(':id' => $id));\n\t$movie = $stmt->fetchAll(PDO::FETCH_ASSOC);\n close_database_connection($db);\n return $movie[0];\n}", "function getMovieDB($webtmdb, $mid){\n $url = $webtmdb;\n\n if(!$curld = curl_init()){\n exit;\n }\n curl_setopt($curld, CURLOPT_URL, $url); //loads information from url, in our case a json \n curl_setopt($curld, CURLOPT_RETURNTRANSFER, true); //ends transfer \n $prepros = curl_exec($curld); //executes setopt we set previosly \n curl_close($curld); //close connection \n $json = json_decode($prepros, true); // decode json file we got from API\n //\n /*\n make a table \n original_title - movie name \n https://www.themoviedb.org/t/p/w300_and_h450_bestv2/\".$json['poster_path'] - poster image on a page \n */\n //\n $output = \"<style>th,td{padding: 15px;text-align: left; border-bottom: 1px solid #ddd;}</style><tr><th><a href='tmdb.php/?movieId=\".$mid.\"'>\".$json['original_title'].\"</a></th></tr><tr><img height='200' src='https://www.themoviedb.org/t/p/w300_and_h450_bestv2/\".$json['poster_path'].\"'></tr>\";\n return $output;\n}", "public function get_movie($movie_id) {\n\t\t\n\t\t$tmpl_args = array (\n\t\t\t\"movie-id\" => $movie_id\n\t\t);\n\t\t\n\t\t$json = $this->request(self::API_URL_TMPL_MOVIE, $tmpl_args);\n\t\t\t\t\n\t\tif(isset($json->id) and !empty($json->id)) {\n\t\t\treturn new rt_movie($json, $this);\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t}", "public function search_url($url){\n\n\n //Fetch the movie info\n $json = file_get_contents($url);\n\n //Convert json to array\n $array = json_decode($json);\n\n //Get rid of episode list before var_dumping\n //unset($array[0]->episodes);\n\n //Debug\n /*\n echo '<pre>';\n var_dump($array);\n echo '</pre>';\n */\n\n //Setup the video abstraction layer\n $test = new abstract_media;\n\n //Setup output buffering\n ob_start();\n\n //Echo the results\n if(isset($array[0])){\n if(isset($array[0]->poster->cover)){\n echo '<img src=\"'.$array[0]->poster->cover.'\" /><br />';\n $test->cover = $array[0]->poster->cover;\n }\n\n if(isset($array[0]->title)){\n echo 'Title: '.$array[0]->title.\"<br /> \\r\\n\";\n $test->title = $array[0]->title;\n }\n\n if(isset($array[0]->plot_simple)){\n echo 'Plot: '.$array[0]->plot_simple.\"<br /> \\r\\n\";\n $test->plot_simple = $array[0]->plot_simple;\n }\n\n if(isset($array[0]->year)){\n echo 'Year: '.$array[0]->year.\"<br /> \\r\\n\";\n $test->year = $array[0]->year;\n }\n\n if(isset($array[0]->rated)){\n echo 'Rated: '.$array[0]->rated.\"<br /> \\r\\n\";\n $test->rated = $array[0]->rated;\n }\n\n if(isset($array[0]->rating)){\n echo 'Rating: '.$array[0]->rating.\"<br /> \\r\\n\";\n $test->rating = $array[0]->rating;\n }\n\n if(isset($array[0]->runtime)){\n echo 'Runtime(s): '.implode(', ', $array[0]->runtime).\"<br /> \\r\\n\";\n $test->runtime = $array[0]->runtime;\n }\n\n if(isset($array[0]->genres)){\n echo 'Genre(s): '.implode(', ', $array[0]->genres).\"<br /> \\r\\n\";\n $test->genres = $array[0]->genres;\n }\n\n if(isset($array[0]->language)){\n echo 'Language(s): '.implode(', ', $array[0]->language).\"<br /> \\r\\n\";\n $test->language = $array[0]->language;\n }\n\n if(isset($array[0]->country)){\n echo 'Country(s): '.implode(', ', $array[0]->country).\"<br /> \\r\\n\";\n $test->country = $array[0]->country;\n }\n\n if(isset($array[0]->actors)){\n echo 'Actors: '.implode(', ', $array[0]->actors).\"<br /> \\r\\n\";\n $test->actors = $array[0]->actors;\n }\n\n if(isset($array[0]->directors)){\n echo 'Director(s): '.implode(', ', $array[0]->directors).\"<br /> \\r\\n\";\n $test->directors = $array[0]->directors;\n }\n\n if(isset($array[0]->writers)){\n echo 'Writer(s): '.implode(', ', $array[0]->writers).\"<br /> \\r\\n\";\n $test->writers = $array[0]->writers;\n }\n\n if(isset($array[0]->filming_locations)){\n echo 'Filming Location(s): '.$array[0]->filming_locations.\"<br /> \\r\\n\"; //This is output as a string for some reason\n $test->filming_locations = $array[0]->filming_locations;\n }\n\n if(isset($array[0]->imdb_id)){\n echo 'IMDb id: '.$array[0]->imdb_id.\"<br /> \\r\\n\";\n $test->ibdb_id = $array[0]->imdb_id;\n }\n }\n\n //Save the output buffer contents in the output variable\n $test->output = ob_get_contents();\n ob_end_clean();\n\n //Return the abstract video object\n return $test;\n }", "public function getFilmInfo($day)\n\t{\n\n\t\tswitch ($day->getName())\n\t\t{\n\t\t\tcase 'Friday':\n\t\t\t\t$day =\"01\";\n\t\t\t\tbreak;\n\t\t\tcase 'Saturday':\n\t\t\t\t$day =\"02\";\n\t\t\t\tbreak;\n\t\t\tcase 'Sunday':\n\t\t\t\t$day =\"03\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//TODO : Do something.\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$url =$this->cinemaLink;\n\t\t$data = $this->curl->curlGetReq($url);\n\t\t//Get all selects of movie exc. disabled w text instruction.\n\t\t$query = \"//select[@id ='movie']/option[not(text() = '--- Välj film ---')]\";\n\t\t$select = $this->curl->getDOMData($data,$query);\t\n\t\t\n\t\t//\n\n\t\t//Get the number of movies\n\t\t$numberOfMovies = $select->length;\n\t\t\n\t\t//add date query to the URL\n\t\t$url .=\"check?day=\".$day;\n\t\t/* Iterate through all movies, add them to url, get\n\t\t* and extract times \n\t\t*/\n\t\t$movieTimeRepository = new availableTimeRepository();\n\n\t\tfor($i =1; $i < $numberOfMovies+1; $i++)\n\t\t{\n\t\t\t//get the name of the movie\n\t\t\t$movieName = $select[$i-1]->nodeValue;\n\t\t\t//create a new movieTime object\n\t\t\t$movieTime = new availableTime($movieName);\n\t\t\t//get the times and availability for each movie\n\t\t\t//example of URL with movieQuery: http://localhost:8080/cinema/check?day=02&movie=01\n\t\t\t$movieQuery= ($i <10)? \"&movie=0\".$i: \"&movie=\".$i;\n\t\t\t$data = $this->curl->curlGetReq($url.$movieQuery);\n\t\t\t//decode it and iterate the data\n\t\t\t$movieData =json_decode($data,true);\n\t\t\t\n\t\t\tforeach ($movieData as $movieInfo)\n\t\t\t{\t\n\t\t\t\t//if the status ==1 ==true,it's available\n\t\t\t\tif($movieInfo['status'])\n\t\t\t\t{\t//save the available time to corresponding movie obj.\n\t\t\t\t\t$movieTime->addTime($movieInfo['time']);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$movieTimeRepository->add($movieTime);\n\n\n\t\t}\t\t\n\t\n\t\treturn $movieTimeRepository;\n\t\t\n\t}", "public function getById($id)\n {\n return \\App\\Movie::findOrFail($id)->load('genre');\n }", "public function getById($id)\n {\n $searchUrl = $this->apiUrl.$this->apiKey.\"/movie/\".$id.\"/\";\n $searchResponse = file_get_contents($searchUrl);\n $searchObj = json_decode($searchResponse, true);\n\n return $searchObj;\n }", "public function updateXXXInfo($xxxmovie)\n\t{\n\n\t\t$res = false;\n\t\t$this->whichclass = '';\n\n\t\t$iafd = new \\IAFD();\n\t\t$iafd->searchTerm = $xxxmovie;\n\n\t\tif ($iafd->findme() !== false) {\n\n\t\t\tswitch($iafd->classUsed) {\n\t\t\t\tcase \"ade\":\n\t\t\t\t\t$mov = new \\ADE();\n\t\t\t\t\t$mov->directLink = (string)$iafd->directUrl;\n\t\t\t\t\t$res = $mov->getDirect();\n\t\t\t\t\t$res['title'] = $iafd->title;\n\t\t\t\t\t$res['directurl'] = (string)$iafd->directUrl;\n\t\t\t\t\t$this->whichclass = $iafd->classUsed;\n\t\t\t\t\t$this->pdo->log->doEcho($this->pdo->log->primary(\"Fetching XXX info from IAFD -> Adult DVD Empire\"));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($res === false) {\n\n\t\t\t$this->whichclass = \"aebn\";\n\t\t\t$mov = new \\AEBN();\n\t\t\t$mov->cookie = $this->cookie;\n\t\t\t$mov->searchTerm = $xxxmovie;\n\t\t\t$res = $mov->search();\n\n\t\t\tif ($res === false) {\n\t\t\t\t$this->whichclass = \"ade\";\n\t\t\t\t$mov = new \\ADE();\n\t\t\t\t$mov->searchTerm = $xxxmovie;\n\t\t\t\t$res = $mov->search();\n\t\t\t}\n\n\t\t\tif ($res === false) {\n\t\t\t\t$this->whichclass = \"pop\";\n\t\t\t\t$mov = new \\Popporn();\n\t\t\t\t$mov->cookie = $this->cookie;\n\t\t\t\t$mov->searchTerm = $xxxmovie;\n\t\t\t\t$res = $mov->search();\n\t\t\t}\n\n\t\t\t// Last in list as it doesn't have trailers\n\t\t\tif ($res === false) {\n\t\t\t\t$this->whichclass = \"adm\";\n\t\t\t\t$mov = new \\ADM();\n\t\t\t\t$mov->cookie = $this->cookie;\n\t\t\t\t$mov->searchTerm = $xxxmovie;\n\t\t\t\t$res = $mov->search();\n\t\t\t}\n\n\n\t\t\t// If a result is true getAll information.\n\t\t\tif ($res !== false) {\n\t\t\t\tif ($this->echooutput) {\n\n\t\t\t\t\tswitch ($this->whichclass) {\n\t\t\t\t\t\tcase \"aebn\":\n\t\t\t\t\t\t\t$fromstr = \"Adult Entertainment Broadcast Network\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ade\":\n\t\t\t\t\t\t\t$fromstr = \"Adult DVD Empire\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"pop\":\n\t\t\t\t\t\t\t$fromstr = \"PopPorn\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"adm\":\n\t\t\t\t\t\t\t$fromstr = \"Adult DVD Marketplace\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$fromstr = null;\n\t\t\t\t\t}\n\t\t\t\t\t$this->pdo->log->doEcho($this->pdo->log->primary(\"Fetching XXX info from: \" . $fromstr));\n\t\t\t\t}\n\t\t\t\t$res = $mov->getAll();\n\t\t\t} else {\n\t\t\t\t// Nothing was found, go ahead and set to -2\n\t\t\t\treturn -2;\n\t\t\t}\n\t\t}\n\n\t\t$mov = array();\n\n\t\t$mov['trailers'] = (isset($res['trailers'])) ? serialize($res['trailers']) : '';\n\t\t$mov['extras'] = (isset($res['extras'])) ? serialize($res['extras']) : '';\n\t\t$mov['productinfo'] = (isset($res['productinfo'])) ? serialize($res['productinfo']) : '';\n\t\t$mov['backdrop'] = (isset($res['backcover'])) ? $res['backcover'] : 0;\n\t\t$mov['cover'] = (isset($res['boxcover'])) ? $res['boxcover'] : 0;\n\t\t$res['cast'] = (isset($res['cast'])) ? join(\",\", $res['cast']) : '';\n\t\t$res['genres'] = (isset($res['genres'])) ? $this->getgenreid($res['genres']) : '';\n\t\t$mov['title'] = html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8');\n\t\t$mov['plot'] = (isset($res['sypnosis'])) ? html_entity_decode($res['sypnosis'], ENT_QUOTES, 'UTF-8') : '';\n\t\t$mov['tagline'] = (isset($res['tagline'])) ? html_entity_decode($res['tagline'], ENT_QUOTES, 'UTF-8') : '';\n\t\t$mov['genre'] = html_entity_decode($res['genres'], ENT_QUOTES, 'UTF-8');\n\t\t$mov['director'] = (isset($res['director'])) ? html_entity_decode($res['director'], ENT_QUOTES, 'UTF-8') : '';\n\t\t$mov['actors'] = html_entity_decode($res['cast'], ENT_QUOTES, 'UTF-8');\n\t\t$mov['directurl'] = html_entity_decode($res['directurl'], ENT_QUOTES, 'UTF-8');\n\t\t$mov['classused'] = $this->whichclass;\n\n\t\t$check = $this->pdo->queryOneRow(sprintf('SELECT id FROM xxxinfo WHERE title = %s',\t$this->pdo->escapeString($mov['title'])));\n\t\t$xxxID = 0;\n\t\tif(isset($check['id'])){\n\t\t$xxxID = $check['id'];\n\t\t}\n\n\t\tif($check === false OR $xxxID > 0){\n\n\t\t// Update Current XXX Information - getXXXCovers.php\n\t\tif($xxxID > 0){\n\t\t\t$this->update($check['id'], $mov['title'], $mov['tagline'], $mov['plot'], $mov['genre'], $mov['director'], $mov['actors'], $mov['extras'], $mov['productinfo'], $mov['trailers'], $mov['directurl'], $mov['classused']);\n\t\t\t$xxxID = $check['id'];\n\t\t}\n\n\t\t// Insert New XXX Information\n\t\tif($check === false){\n\t\t\t$xxxID = $this->pdo->queryInsert(\n\t\t\t\tsprintf(\"\n\t\t\t\t\tINSERT INTO xxxinfo\n\t\t\t\t\t\t(title, tagline, plot, genre, director, actors, extras, productinfo, trailers, directurl, classused, cover, backdrop, createddate, updateddate)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t(%s, %s, COMPRESS(%s), %s, %s, %s, %s, %s, %s, %s, %s, 0, 0, NOW(), NOW())\",\n\t\t\t\t\t$this->pdo->escapeString($mov['title']),\n\t\t\t\t\t$this->pdo->escapeString($mov['tagline']),\n\t\t\t\t\t$this->pdo->escapeString($mov['plot']),\n\t\t\t\t\t$this->pdo->escapeString(substr($mov['genre'], 0, 64)),\n\t\t\t\t\t$this->pdo->escapeString($mov['director']),\n\t\t\t\t\t$this->pdo->escapeString($mov['actors']),\n\t\t\t\t\t$this->pdo->escapeString($mov['extras']),\n\t\t\t\t\t$this->pdo->escapeString($mov['productinfo']),\n\t\t\t\t\t$this->pdo->escapeString($mov['trailers']),\n\t\t\t\t\t$this->pdo->escapeString($mov['directurl']),\n\t\t\t\t\t$this->pdo->escapeString($mov['classused'])\n\t\t\t\t)\n\t\t\t);\n\t\t\t}\n\n\t\t\tif ($xxxID > 0) {\n\n\t\t\t\t// BoxCover.\n\t\t\t\tif (isset($mov['cover'])) {\n\t\t\t\t\t$mov['cover'] = $this->releaseImage->saveImage($xxxID . '-cover', $mov['cover'], $this->imgSavePath);\n\t\t\t\t}\n\n\t\t\t\t// BackCover.\n\t\t\t\tif (isset($mov['backdrop'])) {\n\t\t\t\t\t$mov['backdrop'] = $this->releaseImage->saveImage($xxxID . '-backdrop', $mov['backdrop'], $this->imgSavePath, 1920, 1024);\n\t\t\t\t}\n\n\t\t\t\t$this->pdo->queryExec(sprintf('UPDATE xxxinfo SET cover = %d, backdrop = %d WHERE id = %d', $mov['cover'], $mov['backdrop'], $xxxID));\n\n\t\t\t} else {\n\t\t\t\t$xxxID = -2;\n\t\t\t}\n\n\t\t}\n\n\t\tif ($this->echooutput) {\n\t\t\t$this->pdo->log->doEcho(\n\t\t\t\t$this->pdo->log->headerOver(($xxxID !== false ? 'Added/updated XXX movie: ' : 'Nothing to update: ')) .\n\t\t\t\t$this->pdo->log->primary($mov['title'])\n\t\t\t);\n\t\t}\n\n\t\treturn $xxxID;\n\t}", "function get_movies(){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_movies' => true, //a flag to execute the right code in App-Logic! \n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($response,true);\n\n }", "private function fetchUrl($strSearch)\n {\n // Remove whitespaces.\n $strSearch = trim($strSearch);\n \n // \"Remote Debug\" - so I can see which version you're running.\n // To due people complaining about broken functions while they're\n // using old versions. Feel free to remove this.\n if ($strSearch == '##REMOTEDEBUG##') {\n $strSearch = 'https://www.imdb.com/title/tt1022603/';\n echo '<pre>Running PHP-IMDB-Grabber v' . IMDB::IMDB_VERSION . '.</pre>';\n }\n \n // Get the ID of the movie.\n $strId = IMDB::matchRegex($strSearch, IMDB::IMDB_URL, 1);\n if (!$strId) {\n $strId = IMDB::matchRegex($strSearch, IMDB::IMDB_ID, 1);\n }\n \n // Check if we found an ID ...\n if ($strId) {\n $this->_strId = preg_replace('~[\\D]~', '', $strId);\n $this->_strUrl = 'https://www.imdb.com/title/tt' . $this->_strId . '/';\n $bolFound = false;\n $this->isReady = true;\n }\n \n // ... otherwise try to find one.\n else {\n $strSearchFor = 'all';\n if (strtolower(IMDB::IMDB_SEARCHFOR) == 'movie') {\n $strSearchFor = 'tt&ttype=ft&ref_=fn_ft';\n } elseif (strtolower(IMDB::IMDB_SEARCHFOR) == 'tvtitle') {\n $strSearchFor = 'tt&ttype=tv&ref_=fn_tv';\n } elseif (strtolower(IMDB::IMDB_SEARCHFOR) == 'tvepisode') {\n $strSearchFor = 'tt&ttype=ep&ref_=fn_ep';\n }\n \n $this->_strUrl = 'https://www.imdb.com/find?s=' . $strSearchFor . '&q=' . str_replace(' ', '+', $strSearch);\n $bolFound = true;\n \n // Check for cached redirects of this search.\n $fRedirect = @file_get_contents($this->getCacheFolder() . md5($this->_strUrl) . '.redir');\n if ($fRedirect) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Found an old redirect:</b> ' . $fRedirect . '<br>';\n }\n $this->_strUrl = trim($fRedirect);\n $this->_strId = preg_replace('~[\\D]~', '', IMDB::matchRegex($fRedirect, IMDB::IMDB_URL, 1));\n $this->isReady = true;\n $bolFound = false;\n }\n }\n\n // Check if there is a cache we can use.\n $fCache = $this->getCacheFolder() . md5($this->_strId) . '.cache';\n if (file_exists($fCache)) {\n $bolUseCache = true;\n $intChanged = filemtime($fCache);\n $intNow = time();\n $intDiff = round(abs($intNow - $intChanged) / 60);\n if ($intDiff > $this->_intCache) {\n $bolUseCache = false;\n }\n } else {\n $bolUseCache = false;\n }\n \n if ($bolUseCache) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Using cache for ' . $strSearch . ' from ' . $fCache . '</b><br>';\n }\n $this->_strSource = file_get_contents($fCache);\n return true;\n } else {\n // Cookie path.\n if (function_exists('sys_get_temp_dir')) {\n $this->_fCookie = tempnam(sys_get_temp_dir(), 'imdb');\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Path to cookie:</b> ' . $this->_fCookie . '<br>';\n }\n }\n // Initialize and run the request.\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Run cURL on:</b> ' . $this->_strUrl . '<br>';\n }\n\n $arrInfo = $this->doCurl($this->_strUrl);\n $strOutput = $arrInfo['contents'];\n \n // Check if the request actually worked.\n if ($strOutput === false) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>! cURL error:</b> ' . $this->_strUrl . '<br>';\n }\n $this->_strSource = file_get_contents($fCache);\n if ($this->_strSource) {\n return true;\n }\n return false;\n }\n \n // Check if there is a redirect given (IMDb sometimes does not return 301 for this...).\n $fRedirect = $this->getCacheFolder() . md5($this->_strUrl) . '.redir';\n if ($strMatch = $this->matchRegex($strOutput, IMDB::IMDB_REDIRECT, 1)) {\n $arrExplode = explode('?fr=', $strMatch);\n $strMatch = ($arrExplode[0] ? $arrExplode[0] : $strMatch);\n\t\t \n if (filter_var($strMatch, FILTER_VALIDATE_URL)) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Saved a new redirect:</b> ' . $fRedirect . '<br>';\n }\n file_put_contents($fRedirect, $strMatch);\n $this->isReady = false;\n // Run the cURL request again with the new url.\n IMDB::fetchUrl($strMatch);\n return true;\n\t\t}\n }\n // Check if any of the search regexes is matching.\n elseif ($strMatch = $this->matchRegex($strOutput, IMDB::IMDB_SEARCH, 1)) {\n $strMatch = 'https://www.imdb.com/title/tt' . $strMatch . '/';\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Using the first search result:</b> ' . $strMatch . '<br>';\n echo '<b>- Saved a new redirect:</b> ' . $fRedirect . '<br>';\n }\n file_put_contents($fRedirect, $strMatch);\n // Run the cURL request again with the new url.\n $this->_strSource = null;\n $this->isReady = false;\n IMDB::fetchUrl($strMatch);\n return true;\n }\n // If it's not a redirect and the HTTP response is not 200 or 302, abort.\n elseif ($arrInfo['http_code'] != 200 && $arrInfo['http_code'] != 302) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Wrong HTTP code received, aborting:</b> ' . $arrInfo['http_code'] . '<br>';\n }\n return false;\n }\n \n $this->_strSource = $strOutput;\n \n // Set the global source.\n $this->_strSource = preg_replace('~(\\r|\\n|\\r\\n)~', '', $this->_strSource);\n \n // Save cache.\n if (!$bolFound) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Saved a new cache:</b> ' . $fCache . '<br>';\n }\n file_put_contents($fCache, $this->_strSource);\n }\n \n return true;\n }\n }", "public function search_id($id){\n $imdb_id = urlencode($id);\n $url = 'http://mymovieapi.com/?ids='.$imdb_id.'&type=json&plot=simple&episode=1&lang=en-US&aka=simple&release=simple&business=0&tech=0';\n search_url($url);\n }", "function retrieve_details() {\n\n// 11/25 - this shit needs work...\n \n\t/**\n\t * step 1\n\t * \n\t * retrieve all movies with an imdb_id but no details\n\t */\n\tini_set(\"max_execution_time\", \"300\");\n\t$sql_all = \"SELECT * FROM mr_movie_details WHERE imdb_id > 0 AND date_updated <=> NULL\";\n\t$res_all = mysql_query( $sql_all );\n\n\t// End the script if there are no new movies\n\tif ( mysql_num_rows( $res_all ) > 0 ) {\n\n\t\t/**\n\t\t * step 2\n\t\t *\n\t\t * retrieve all imdb_info and update db\n\t\t */\n\t\n\t\twhile ( $r = mysql_fetch_array( $res_all ) ) {\n\t\n\t\t\t$imdbid = $r['imdb_id'];\n\t\t\t$movie_id = $r['movie_id'];\n\t\t\t$filename = $r['filename'];\n\t\t\n\t\t\t$movie = new imdb( $imdbid );\n\t\t\t$movie->setid( $imdbid );\n\t\t\t\n\t\t\t$title = $movie->title();\n\t\t\t$year = $movie->year();\n\t\t\t$runtime = $movie->runtime();\n\t\t\t$genre = $movie->genre();\n//\t\t\t$genreID \t= get_genre_id( $genre );\n\t\t\t$all_genres = $movie->genres();\n\t\t\t$mpaar \t\t= $movie->mpaa ();\n\t\t\t$tagline\t= $movie->tagline();\n\t\t\t$directors\t= $movie->director();\n\t\t\t$producers\t= $movie->producer();\n\t\t\t$writers\t= $movie->writing();\n\t\t\t$cast\t\t= $movie->cast();\n\t\t\t//$plot \t\t= $movie->plot();\n\t\t\t//$short_plot = substr( $plot[0], 0, 255 );\n\t\t\t\n\n\n\t\t\tif ( strlen( $plot[0] ) > 255 )\n\t\t\t\t$short_plot .= ' [...]';\n\t\t\t\n\t\t\tif ( check_genre( $genre ) == FALSE )\n\t\t\t\tadd_genre( $genre );\n\t\n\t\t\tforeach ( $all_genres as $g ) {\n\t\t\t\tif ( check_genre( $g ) == FALSE )\n\t\t\t\t\tadd_genre( $g );\n\t\n\t\t\t\t// Update movie_genres\n\t\t\t\t$mg_sql = \"INSERT INTO mr_movie_genres (movie_id, genre_id) VALUES \".\n\t\t\t\t\t\" ($movie_id, \". get_genre_id( $g ) .\")\";\n\t\n\t\t\t\t$mg_res = mysql_query( $mg_sql );\n\t\t\t}\n\n/*\n\t\n\t\t\t$theVersion = get_version( substr( $filename, 0, strlen( $filename ) - 4 ) );\n\t\t\t//echo \"Version: $theVersion\";\n\t\t\t//echo $theVersion;\n\t\t\tif ( !check_version( $theVersion ) ) \n\t\t\t\tif ( !add_new_version( $theVersion ) )\n\t\t\t\t\techo \"<p>Couln't add $theVersion version to database.</p>\\n\";\n\t\t\t\t\n\t\t\t$theVersionID = get_version_id( $theVersion );\n*/\t\t\t\n\t\t\t\n// -- THIS NEEDS TO BE EDITED..\n\n\t\t\t$md_sql =\t'UPDATE mr_movie_details SET '.\n\t\t\t\t\t\t' date_updated = NOW(), '.\n\t\t\t\t\t\t' title = '. format_sql( $title ). ', '.\n\t\t\t\t\t\t' year = '. format_sql( $year ). ', '.\n\t\t\t\t\t\t' runtime = '. format_sql( $runtime ). ', '.\n\t\t\t\t\t\t' mpaa_rating = '. format_sql( $mpaar['USA'] ). ', '.\n\t\t\t\t\t\t' tagline = '. format_sql( trim( $tagline ) ) . ' '.\n\t\t\t\t\t\t\" WHERE movie_id = $movie_id LIMIT 1\";\n\n\n\t\t\t$producersSQL = \"INSERT INTO mr_movie_producers (movie_id, producer_id, producer_role) VALUES \";\n\t\t\tfor ( $i = 0; $i < count( $producers ); $i++ ) {\n\t\t\t\t$checkSQL = \"SELECT * FROM mr_producers WHERE producer_name LIKE \". format_sql( trim( $producers[$i]['name'] ), TRUE );\n\t\t\t\t$checkRES = mysql_query( $checkSQL );\n\t\t\t\tif ( mysql_num_rows( $checkRES ) == 0 ) {\n\t\t\t\t\tmysql_query( \"INSERT INTO mr_producers (producer_name) VALUES (\". format_sql( trim( $producers[$i]['name'] ) ) .\")\" );\n\t\t\t\t} else {\n\t\t\t\t\twhile ( $r = mysql_fetch_array( $checkRES ) ) {\n\t\t\t\t\t\t$producer_id = $r['producer_id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$producersSQL .= \"( $movie_id, $producer_id, \". format_sql( trim( $producers[$i]['role'] ) ) .\"), \";\n\t\t\t}\n\t\t\t$producersSQL = substr( $producersSQL, 0, -2 );\n\t\t\t//echo $producersSQL;\n\t\t\t@mysql_query( $producersSQL );// or die(\"Couldn't add producers! \");\n\n $writersSQL = \"INSERT INTO mr_movie_writers (movie_id, writer_id) VALUES \";\n for ( $i = 0; $i < count( $writers ); $i++ ) {\n $checkSQL = \"SELECT * FROM mr_writers WHERE writer_name LIKE \". format_sql( trim( $writers[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_writers (writer_name) VALUES (\". format_sql( trim( $writers[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $writer_id = $r['writer_id'];\n }\n }\n $writersSQL .= \"( $movie_id, $writer_id ), \";\n }\n $writersSQL = substr( $writersSQL, 0, -2 );\n //echo $writersSQL;\n\t\t\t@mysql_query( $writersSQL );// or die(\"Couldn't add writers!\");\n\n $directorsSQL = \"INSERT INTO mr_movie_directors (movie_id, director_id) VALUES \";\n for ( $i = 0; $i < count( $directors ); $i++ ) {\n $checkSQL = \"SELECT * FROM mr_directors WHERE director_name LIKE \". format_sql( trim( $directors[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_directors (director_name) VALUES (\". format_sql( trim( $directors[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $director_id = $r['director_id'];\n }\n }\n $directorsSQL .= \"( $movie_id, $director_id ), \";\n }\n $directorsSQL = substr( $directorsSQL, 0, -2 );\n //echo $directorsSQL;\n\t\t\t@mysql_query( $directorsSQL );// or die(\"Couldn't add directors!\");\n\n\n $castSQL = \"INSERT INTO mr_movie_actors (movie_id, actor_id, actor_role) VALUES \";\n for ( $i = 0; $i < count( $cast ); $i++ ) { \n $checkSQL = \"SELECT * FROM mr_actors WHERE actor_name LIKE \". format_sql( trim( $cast[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_actors (actor_name) VALUES (\". format_sql( trim( $cast[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $actor_id = $r['actor_id'];\n }\n }\n $castSQL .= \"( $movie_id, $actor_id, \". format_sql( trim( $cast[$i]['role'] ) ) .\"), \";\n }\n $castSQL = substr( $castSQL, 0, -2 );\n //echo $castSQL;\n\t\t\t@mysql_query( $castSQL );// or die(\"Couldn't add cast!\");\n\n\n// directors, writers, cast\n\n\t\n\t\t\t$ratingSQL = \"INSERT INTO mr_movie_ratings (movie_id) VALUES ($movie_id)\";\n\t\t\t$ratingRes = mysql_query( $ratingSQL );\n\t\n\t\t\t$m_sql = \"UPDATE movies SET \".\n\t\t\t\t\" have_details = 'Y', \".\n\t\t\t\t\" version_id = $theVersionID \".\n\t\t\t\t\" WHERE movie_id = $movie_id\";\n\t\n\t\t\t//echo $m_sql;\n\t\t\t\n\t\t\t$md_res = mysql_query( $md_sql );\n//\t\t\t$m_res = mysql_query( $m_sql );\n\t\n\t\t\t$html['msg'] .= \"<div id=\\\"message\\\" class=\\\"updated\\\"><p>Info for <b>$title</b> added to database!</p></div>\\n\";\n\t\n\t\t}\n\t\t\n\t\t$html['main'] .= \"<p>Go <a href=\\\"{$_SERVER['PHP_SELF']}\\\">Home</a>.</p>\\n\";\n\t} else {\n\t\t$html['main'] .= \"<p>There are no movies with IMDB IDs but without details downloaded.</p>\\n\";\n\t}\n\t\n\treturn $html;\n}" ]
[ "0.6463239", "0.59844595", "0.5968494", "0.5854798", "0.5734729", "0.5726442", "0.5692581", "0.5684597", "0.5640007", "0.5587775", "0.55755264", "0.55613106", "0.5544933", "0.55266213", "0.55266213", "0.55053025", "0.5492138", "0.5454658", "0.54163796", "0.5406832", "0.5404731", "0.5393675", "0.5343914", "0.5324445", "0.53098977", "0.53097445", "0.52943945", "0.5284611", "0.5252939", "0.5248683" ]
0.7809437
0
date_default_timezone_set('America/New_York'); 08.20.2015 ghh this function verifies the dealerkey is correct and that if it doesn't have one already it will generate one and return
function verifyDealerKey( $dealerkey, $accountnumber ) { global $db; global $requestvars; if ( $db->db_connect_id ) { $query = "select DealerID, DealerKey, IPAddress, Active from DealerCredentials where AccountNumber='$accountnumber' "; if ( !$result = $db->sql_query( $query ) ) { RestLog( "Error" ); die(RestUtils::sendResponse(500, "Error: 16535 There was a problem finding dealer record")); } $row = $db->sql_fetchrow($result); //08.20.2015 ghh - if the query returns nothing,that means that there is not //a valid dealer key for that location and one needs to be created if ( $row[ 'IPAddress' ] != '' && $row[ 'IPAddress' ] != $SERVER['REMOVE_ADDR' ] ) { RestLog( "Error Not Authorized From This IP Address" ); die(RestUtils::sendResponse(401, 'Error 16536 Bad Location')); } //08.20.2015 ghh - here we deal with an inactive dealer trying to work with //the system if ( $row[ 'Active' ] == 0 ) { RestLog( "Error Account Is Inactive" ); die(RestUtils::sendResponse(401, 'Error 16537 Inactive Account')); } //08.20.2015 ghh - now we see if they have a valid key if ( isset( $row[ 'DealerKey' ] ) && $row[ 'DealerKey' ] != $dealerkey ) { RestLog( "Error Dealer Key is Invalid Query:".$query."\n $row[DealerKey] != $dealerkey" ); die(RestUtils::sendResponse(401, 'Error 16538 Bad Dealer Key')); } //08.20.2015 ghh - if we got this far and don't have a dealer key at all //then we need to generate one here. if ( !isset( $row[ 'DealerKey' ] ) ) { $uuid = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', // 32 bits for "time_low" mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), // 16 bits for "time_mid" mt_rand( 0, 0xffff ), // 16 bits for "time_hi_and_version", // four most significant bits holds version number 4 mt_rand( 0, 0x0fff ) | 0x4000, // 16 bits, 8 bits for "clk_seq_hi_res", // 8 bits for "clk_seq_low", // two most significant bits holds zero and one for variant DCE1.1 mt_rand( 0, 0x3fff ) | 0x8000, // 48 bits for "node" mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); //08.20.2015 ghh - save the new dealerkey into the dealer table $query = "update DealerCredentials set DealerKey='$uuid' where DealerID=$row[DealerID]"; if (!$result = $db->sql_query($query)) { RestLog("Error in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500, 'Error 16539 Problem updating key'); //Internal Server Error return false; } return $uuid; } //08.20.2015 ghh - if the query does return something, we need to evaluate //if the dealer key that it returns is a match to the dealer key that is passed //in $requestvars[ 'DealerID' ] = $row[ 'DealerID' ]; if ($dealerkey == $row['DealerKey']) return $dealerkey; } else { RestLog( "Error" ); die(RestUtils::sendResponse(500, 'Error 16540 Internal Database problem.')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_originator($clean_data = false)\n{\n $timenow = date(\"U\");\n if (($timenow - $clean_data[\"appheader\"][\"transmissiondatetime\"]) > 3600) {\n return false;\n }\n \n \n \n $conn = conn();\n $clean_data[\"privatekeypair\"] = false;\n \n if ($clean_data[\"appheader\"][\"key\"] == \"newlatcherinstallation\") {\n return $clean_data;\n }\n \n if ($result = mysqli_query($conn, \"SELECT * FROM session WHERE key='\" . $clean_data[\"appheader\"][\"key\"] . \"' LIMIT 1\")) {\n while ($row = mysqli_fetch_array($result)) {\n $clean_data[\"privatekeypair\"] = $row[\"key\"];\n }\n mysqli_free_result($result);\n }\n \n mysqli_close($conn);\n \n if ($clean_data[\"privatekeypair\"] === false) {\n return false;\n }\n \n return $clean_data;\n}", "function createKey(){\n\t$strKey = md5(microtime());\n\t\n\t//check to make sure this key isnt already in use\n\t$resCheck = mysql_query(\"SELECT count(*) FROM downloads WHERE downloadkey = '{$strKey}' LIMIT 1\");\n\t$arrCheck = mysql_fetch_assoc($resCheck);\n\tif($arrCheck['count(*)']){\n\t\t//key already in use\n\t\treturn createKey();\n\t}else{\n\t\t//key is OK\n\t\treturn $strKey;\n\t}\n}", "public static function getNewTrackingKey() {\n\t\n\t\t$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\t\t\n\t\t// try up to 100 times to guess a unique key\n\t\tfor($i=0; $i<100; $i++) {\n\t\t\t$key = '';\n\t\t\tfor($j=0; $j<32; $j++)\t// generate a random 32 char alphanumeric string\n\t\t\t\t$key .= substr($chars,rand(0,strlen($chars)-1), 1);\n\t\t\n\t\t\tif(X2Model::model('Contacts')->exists('trackingKey=\"'.$key.'\"'))\t// check if this key is already used\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\treturn $key;\n\t\t}\n\t\treturn null;\n\t}", "public static function getNewTrackingKey() {\n\n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\n // try up to 100 times to guess a unique key\n for ($i = 0; $i < 100; $i++) {\n $key = '';\n for ($j = 0; $j < 32; $j++) {// generate a random 32 char alphanumeric string\n $key .= substr($chars, rand(0, strlen($chars) - 1), 1);\n }\n\n // check if this key is already used\n if (X2Model::model('Contacts')->exists('trackingKey=\"' . $key . '\"')) {\n continue;\n } else {\n return $key;\n }\n }\n return null;\n }", "private function check_api_key() {\n return true;\n $post_token = $this->input->post('App-Request-Token');\n $post_datetime = $this->input->post('App-Request-Timestamp');\n if ($post_token && $post_datetime) {\n $date = gmdate('Y-m-d H:i:s');\n if (strtotime($post_datetime) >= (strtotime($date) - 300) && strtotime($post_datetime) <= strtotime($date)) {\n $token = sha1(config_item('api_request_key') . $post_datetime);\n if ($post_token === $token) {\n return true;\n }\n }\n } else {\n $this->send_error('ERROR');\n exit;\n }\n }", "function generateKeyPrimary($table){\n /*\n key : code-tanggal-hurufAcak-jam\n\n logikanya\n 1 cek create untuk tabel yang mana\n 2 jika pengguna codenya PGN\n 3 jika sawah codoenya SWH\n 4 nanti key akan jadi code-tanggal-hurufAcak-jam\n\n */\n // konfigurasi\n // hurufnya apaan\n $str = \"1234567890abcdefghijklmnopqrstuvwxyz\";\n //batas maksimal huruf randonmnya\n $keyLenght = 6;\n\n //Tentukan code\n if ($table == \"pengguna\") {\n $code = \"PGN\";\n } elseif ($table == \"sawah\") {\n $code = \"SWH\";\n }\n\n $date = date('ymd');\n $randStr = substr(str_shuffle($str), 0, $keyLenght);\n $hours = date('his');\n\n $key = $code . \"-\" . $date . \"-\" . $randStr . \"-\" . $hours;\n\n return $key;\n}", "function generate_mailkey(){\r\n $rseed=date(\"U\")%1000000;\r\n srand($rseed);\r\n $mailkey=md5(rand(10000,10000000));\r\n return $mailkey;\r\n}", "function old_validate_date($date){\n if ($date == \"\" ) { return '00:00:00' ; }\n # create temp table and attempt insert there\n $query = \"CREATE TEMP TABLE validation (test date) \";\n $result = do_sql($query);\n\n # Check if date is valid format by entering it into temp table\n $query = \"INSERT INTO validation (test) values ( '$date' )\";\n $result = do_sql($query);\n\n if ( $result ) {\n do_sql(\"DROP TABLE validation\") ;\n return \"$date\" ;\n }\n else { \n do_sql(\"DROP TABLE validation\") ;\n return false ;\n }\n}", "public function testKeyGenerator()\n {\n $localisationCookieIdGenerator = new LocalisationCookieIdGenerator();\n\n $request = new Request();\n $request->cookies->add([\n 'localisation' => '{\"client\":{\"11\":\"AOK Bayern\"},\"location\":null}'\n ]);\n\n $id = $localisationCookieIdGenerator->generate($request);\n $this->assertEquals('null_11', $id);\n }", "public function createKey()\n {\n return md5('Our-Calculator') . (time() + 60);\n }", "public function generateKey()\n {\n do\n {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while ($this->keyExists($newKey));\n\n return $newKey;\n }", "public static function generateKey()\n {\n do {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while (self::keyExists($newKey));\n\n return $newKey;\n }", "function generateCandiToken($name){\t\n\t$mydate = getdate();\n\t$token = sha1($name.\"candidate\");\n\treturn $token;\n}", "function validate_key($key)\n{\n if ($key == 'PhEUT5R251')\n return true;\n else\n return false;\n}", "function insertNewBooking($bookingnum, $custid, $pkgId) {\n $query = \"INSERT INTO `bookings` (BookingDate, BookingNo, TravelerCount, CustomerId, PackageId) VALUES ('\".date(\"Y-m-d H:i:s\").\"', '$bookingnum', '1', '$custid', '$pkgId')\";\n $result = Database::insertQuery($query); \n if ($result) {\n return true;\n } else {\n return false;\n }\n }", "public function test_generate_key_random()\n {\n $key1 = GuestToken::generate_key();\n $key2 = GuestToken::generate_key();\n $this->assertNotEquals($key1, $key2);\n }", "function askVerifyAndSaveLicenseKey()\n{\n if (empty($_POST['key']))\n {\n renderLicenseForm('Please enter a license key'); \n exit();\n } else {\n $license_key = preg_replace('/[^A-Za-z0-9-_]/', '', trim($_POST['key'])); \n }\n $checker = new Am_LicenseChecker($license_key, API_URL, RANDOM_KEY, null);\n if (!$checker->checkLicenseKey()) // license key not confirmed by remote server\n {\n renderLicenseForm($checker->getMessage()); \n exit();\n } else { // license key verified! save it into the file\n file_put_contents(DATA_DIR . '/key.txt', $license_key);\n return $license_key;\n }\n}", "function generate_key()\n{\n $pool = \"qwertzupasdfghkyxcvbnm\";\n $pool .= \"23456789\";\n $pool .= \"WERTZUPLKJHGFDSAYXCVBNM\";\n srand ((double)microtime()*1000000);\n for($index = 0; $index < 10; $index++)\n {\n $akti .= substr($pool,(rand()%(strlen ($pool))), 1);\n }\n return $akti;\n}", "function check_today($player) {\n $found = 1;\n\n $last = trim(file_get_contents(_PWD . '/' . $player->steamid));\n if ($last != date('m/d/Y')) {\n $found = 0;\n }\n\n return $found;\n }", "abstract protected function generateKey();", "function checkTotp($secret, $key, $timedrift = 1);", "public function genTrackingKey()\n {\n if ($this->trackMails) {\n $trackingKey = Yii::$app->security->generateRandomString(32);\n $this->setTrackingKey($trackingKey);\n return $trackingKey;\n } else {\n return null;\n }\n }", "function refreshLocalKey() {\n\t\t\t$localKey = $this->settings[\"localkey\"];\n\t\t\t\n\t\t\t// Get the number of validation failures due to communication\n\t\t\t$numFails = $this->settings[\"numbervalidatefails\"];\n\t\n\t\t\t// Get the last time a revalidation was attempted\n\t\t\t$lastValidateAttempt = $this->settings[\"lastvalidateattempt\"];\n\t\t\tif ($lastValidateAttempt > 0) {\n\t\t\t\tif ($this->debug) echo \"<BR>Last remote validation was \";\n\t\t\t\tif ($this->debug) echo $this->dateDifference(time(),$this->settings[\"lastvalidateattempt\"]) . \" ago\"; \n\t\t\t} else {\n\t\t\t\tif ($numFails == 0) {\n\t\t\t\t\tif ($this->debug) echo \"<BR>No remote validate has been attempted before\";\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->debug) echo \"<BR>The last remote validationg failed\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif ($this->debug) echo \"<br>Connecting to remote server: \" . $this->remoteUrl;\n\t\t\t$productid = \"\";\n\t\n\t\t\t$args = array( 'license'=>$this->settings[\"licensekey\"], 'productid' => $this->productId, 'ip' => $_SERVER['SERVER_ADDR'], 'domain'=>parse_url(home_url('/'), PHP_URL_HOST), 'username'=>$this->settings[\"username\"],'useremail'=>$this->settings[\"useremail\"] ); \n\t\n\t\t\t$response = wp_remote_post( $this->remoteUrl, array(\n\t\t\t\t'timeout' => 45,\n\t\t\t\t'redirection' => 5,\n\t\t\t\t'httpversion' => '1.0',\n\t\t\t\t'blocking' => true,\n\t\t\t\t'headers' => array(),\n\t\t\t\t'body' => $args,\n\t\t\t\t'cookies' => array()\n\t\t\t) );\n\t\n\t\n\t\t\t// Check for issues\n\t\t\t$error = false;\n\t\t\t\n\t\t\tif( is_wp_error( $response ) ) {\n\t\t\t\tif ($this->debug) echo '<br>Something went wrong!';\n\t\t\t\tif ($this->debug) echo \"<pre>\" . print_r($response,1) . \"</pre>\";\n\t\t\t\t\n\t\t\t\tif ($this->debug) echo '<br>Something went wrong!';\n\t\t\t\tif ($this->debug) echo \"<pre>\" . print_r($response,1) . \"</pre>\";\n\t\t\t\t\n\t\t\t\t// Update the number of fails, if it's more than 24 hours since the last one, and if\n\t\t\t\t// admin has set a limit\n\t\t\t\t$numFails = $this->incrementOfflineFails();\n\t\t\t\t$result = \"\";\n\t\t\t\t\n\t\t\t\t$error = true;\n\t\t\t\t$errorMessage = $response->errors[\"http_request_failed\"][0];\n\t\t\t\t$this->updateSetting(\"lastvalidateresponse\", \"Problem connecting to ActivateWP License Server (\" . $response->errors[\"http_request_failed\"][0] . \")\");\n\t\t\t} else {\n\t\t\t\tif ($this->debug) echo '<br>HTTP request succeeded!';\n\t\t\t\tif ($response[\"response\"][\"code\"] <> 200) {\n\t\t\t\t\tif ($this->debug) echo '<br>HTTP code: ' . $response[\"response\"][\"code\"];\n\t\t\t\t\t$error = true;\n\t\t\t\t\t$numFails = $this->incrementOfflineFails();\n\t\t\t\t\t$errorMessage = \"Unable to reach remote server (Response code:\" . $response[\"response\"][\"code\"] . \")\";\n\t\t\t\t\t$this->updateSetting(\"lastvalidateresponse\", \"Problem connecting to ActivateWP License Server: \" . $errorMessage);\n\t\t\t\t} else {\n\t\t\t\t\t// Reset any errors\n\t\t\t\t\t$this->updateSetting(\"lastvalidateresponse\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t\n\t\t\t\n\t\t\tif (! $error) {\n\t\t\t\t// Get the body only\n\t\t\t\t$response = $response['body'];\n\t\t\t\tif ($this->debug) echo '<HR>Response from remote server:<blockquote><font color=\"red\"><pre>';\n\t\t\t\tif ($this->debug) print_r( $response );\n\t\t\t\tif ($this->debug) echo '</pre></font></blockquote><hr>';\n\t\t\t\t$result = substr($response, strpos($response, \"===\")+3);\n\t\t\t\tif ($this->debug) echo '<Hr>Encoded Result:<pre>';\n\t\t\t\tif ($this->debug) print_r( $result );\n\t\t\t\tif ($this->debug) echo '</pre><hr>';\n\t\t\t\t$localkey = base64_decode($result);\n\t\t\t\tif ($this->debug) echo '<Hr>Decoded Result:<pre>';\n\t\t\t\tif ($this->debug) print_r( $result );\n\t\t\t\tif ($this->debug) echo '</pre><hr>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\t// Save the time and number of files\n\t\t\t$this->updateSetting(\"lastvalidateattempt\", time());\n\t\t\t$this->updateSetting(\"numbervalidatefails\", $numFails);\n\t\t\treturn $localkey;\n\t\t}", "function generateRequestID()\n{\n date_default_timezone_set('America/Chicago');\n $currenttime = date(\"YmdHis\");\n $randomnumber = rand(0, 9999);\n return $currenttime.$randomnumber;\n}", "function sign($date) {\n $key = base64_decode('MIIEowIBAAKCAQEA5NmI8GIsupuvOMXR4yfs8hK2RUmX/CKlHmLEr/b1mPr/gx+fenafOSKoXs7OUvUxF/CR0EW6iUJvJ9lmTACTZFsTfF+mSJZ76dpuh6J8BQj9lpnH+AEp05LqLr2zvlzkksrjYSW4hfaZqfUZDk8YvGsdBqDpWrEykD16R5Jv5Iw/Y13Jd99F5zYU+Z3M+XdBSrFSaDwU5GeiOQVyl8q/Bt9gY7O1HfqYY9udXmAzPfEaZdCqCj7B8V8Sj7Wc92TZ/fHabZFKzfhVwfHCAzK4mQZ1be8snJd1f9R2peqjzBEINGdOnAnm0rGItKZJY91LMYi5H6Wh/Qh21CYY4Ne2wwIDAQABAoIBAEKXQg+goZ9TOfNtLJvKvFncNAmJVp5Zfm6PEuiZFfID52HCS+eYqNA5U4Dy8HqXOkfbCrLt90+Fc07HJcsrx7fGAK+KLZqlnzz3AH6bOzdD3HZ8HQH/ZKpZ76bWMH1ODnzgaLWWAlGI5kHcPgQ549q/2FxbakunkC0ElpZI+CIqWEf0zNfTXOpExMWx+FENntk/qpHijE+zcbh1/cy8Bsmj0WcXZ3aTDElG3XCC21rPd7zgrFeL6Sy26Br0eqxqddatghZHB5PhZYE4BYM3AlZTZVfuDHogXn4BXILTyV+oQHNUzHKjStfVryJnslnWVAF5whaXGm1fyRY3WBAEmuECgYEA+AivBccqnKfgB7BTDTUMCdt7v+vVbR7CEZc5/jCRy+N0R6NN/L/+LdAAjsodjzVmkLOUzPbZhw72hHXA63RijAhSDeg8IdCUY1YVygyr5KZpHRnn96XJOucPCCFWFfiToJ2Qz+JfZMBUt9HhsSWGS2jF2hUGjixhRwFwTd5xtYsCgYEA7DMe0bJeF336UtgrY9MNVC1sc/A8sEeYtlr47rcLlRDboaO9PRsuIMssxiZ/9uRkYP1FDmS3S8pgwg4UuoVUYHg5Tt95iq3aK0BRQnpKuGIerbBCwFUBZMwpP1DW3fMKtOQ5pjoV74tqR+df7gD0hWlfMFV8WUP9vXLa+XBcWqkCgYEA85sbw3IEsQ3UY9jTCSKzqy7NUQcgfGb8NmiwBa7QU08XUpDatMYgsAAdvCBYfeH11WL7X3+G0DZq+lfo3ZhWfbBiXtRb0t5YD2RqTCK75PtoO7PI95r1lAuB4PtU4Ile/R4kL3jnNj4MNupFX0Y6qu/BetqxsIt4E1QfZ+t1BNcCgYBrDiCB2t5at3al5eSEsjvwU0Y8pj5bh5fnzwPU7pIJVkK12IkFETSvGGeKyBhnxszYSPLruyp455lDWy55+8RqlRMkdJWaDYI86EHsZ5FGUPKmtqUKl3yyOvbXA8TfhDDuHCMk/F7E2+OoA26vaS9q6H+EYLqjmvV+0Hf/ZrX1QQKBgGd8r9wi+fPG3IgGXHBQjmnVgaPNsvQzBKFmHrER0/iLZuA9A2R5x7DxZdHUSRWaPADIaHiU1O9jbNJCk7Jtnqn7M85Q0SRsqZhA2+28/1bmqrTkQmT7T9Q4+hUEN+qehZx83BkRYaP1QWuH11UcRxFr+O3HNXlC9mAG/zt6HhuV');\n $sig = hash_hmac('SHA1', $date, $key, true);\n $sig = base64_encode($sig);\n return $sig;\n }", "function keymaker($id = ''){\n\t\t//look up of info unique to the user or id. It could include date/time to timeout keys.\n\t\t$secretkey='1RuL1HutysK98UuuhDasdfafdCrackThisBeeeeaaaatchkHgjsheIHFH44fheo1FhHEfo2oe6fifhkhs';\n\t\t$key=md5($id.$secretkey);\n\t\treturn $key;\n\t}", "function timezonecalculator_checkData($timeZoneTime) {\r\n\t//first check if the size of the timezones-array match\r\n\tif (sizeof($timeZoneTime)!=7)\r\n\t\treturn -1;\r\n\r\n\t//WordPress TimeZones Support\r\n\tif ($timeZoneTime[0]=='Local_WordPress_Time') {\r\n\t\t$timeZoneTime[0]=get_option('timezone_string');\r\n\t}\r\n\r\n\t//the timezone_id should contain at least one character\r\n\tif (strlen($timeZoneTime[0])<1)\r\n\t\treturn -2;\r\n\r\n\t//are the last two array-parameters 0 or 1?\r\n\t$mycheck=false;\r\n\tif ($timeZoneTime[5]==1 || $timeZoneTime[5]==0)\r\n\t\t$mycheck=true;\r\n\tif (!$mycheck)\r\n\t\treturn -3;\r\n\r\n\t$mycheck=false;\r\n\tif ($timeZoneTime[6]==1 || $timeZoneTime[6]==0)\r\n\t\t$mycheck=true;\r\n\tif (!$mycheck)\r\n\t\treturn -4;\r\n\r\n\t/*\r\n\tprevious-version check by the following assumption:\r\n\tif array-parameter [4] (offset in older versions) is numeric\r\n\t&& the value between -12.5 and 12.5 ==> old version\r\n\tthrow error\r\n\t*/\r\n\r\n\t//thanx 2 Darcy Fiander 4 updating the regex to match the half-hour offsets which is now used for old-version checks\r\n\tif (ereg(\"(^[-]?[0-9]{1,2}(\\\\.5)?$)\", $timeZoneTime[4]) && $timeZoneTime[4]>=-12.5 && $timeZoneTime[4]<=12.5) {\r\n\t\treturn -5;\r\n\t}\r\n\r\n\t//check if timezone_id exists by creating a new instance\r\n\t$dateTimeZone=@timezone_open($timeZoneTime[0]);\r\n\r\n\tif (!$dateTimeZone)\r\n\t\treturn -2;\r\n\telse return $dateTimeZone;\r\n}", "protected function _generateHash()\n {\n //$formattedDateTime = $datetime->format(\"Y-m-d H:i:s\");\n $formattedDateTime = $this->udate('Y-m-d H:i:s.u T');\n $hash = $this->_getHash($formattedDateTime);\n return $hash;\n }", "public function isRegenerated(): bool;", "protected function generateEncryptionKeyIfNeeded() {}" ]
[ "0.62814796", "0.5932315", "0.5902009", "0.5747457", "0.5605034", "0.5410524", "0.5351025", "0.533453", "0.53118414", "0.5281884", "0.5247038", "0.5219282", "0.51786476", "0.51527965", "0.51453763", "0.51430696", "0.5138113", "0.51230687", "0.5116224", "0.511188", "0.51069486", "0.5097141", "0.50745136", "0.505952", "0.50553834", "0.505202", "0.5049677", "0.5041175", "0.5038763", "0.5035395" ]
0.6601664
0
08.21.2015 ghh this function deals with looking up an item in order to calculate its cost for the current dealership
function getItemCost( $itemid, $dealerid, $pricecode, $cost, $list ) { global $db; //08.21.2015 ghh - first we're going to see if there is a dealer specific price for //this item and if so we'll just pass it back $query = "select DealerCost from ItemCost where ItemID=$itemid and DealerID=$dealerid"; if (!$result = $db->sql_query($query)) { RestLog("Error 16527 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500,"16527 - There was a problem attempting find the dealer cost"); //Internal Server Error return false; } $row = $db->sql_fetchrow( $result ); //if there is a cost then lets just return it. if ( $row['DealerCost'] > 0 ) return $row['DealerCost']; //if there was no cost then the next step is to see if there is a price code if ( $pricecode != '' ) { $query = "select Discount from PriceCodesLink where DealerID=$dealerid and PriceCode=$pricecode"; if (!$result = $db->sql_query($query)) { RestLog("Error 16528 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500,"16528 - There was a problem finding your price code"); //Internal Server Error return false; } //08.28.2015 ghh - if we did not find a dealer specific code then next we're going to //look for a global code to see if we can find that if ( $db->sql_numrows( $result ) == 0 ) { $query = "select Discount from PriceCodesLink where DealerID=0 and PriceCode=$pricecode"; if (!$result = $db->sql_query($query)) { RestLog("Error 16626 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500,"16626 - There was a problem finding your price code"); //Internal Server Error return false; } //if we found a global price code entry then enter here if ( $db->sql_numrows( $result ) > 0 ) { $row = $db->sql_fetchrow( $result ); if ( $row['Discount'] > 0 ) $cost = bcmul( bcadd(1, $row['Discount']), $cost ); else $cost = bcmul( bcadd( 1, $row['Discount']), $list ); } } else { //if we found a dealer specific code then enter here $row = $db->sql_fetchrow( $result ); if ( $row['Discount'] > 0 ) $cost = bcmul( bcadd(1, $row['Discount']), $cost ); else $cost = bcmul( bcadd( 1, $row['Discount']), $list ); } } return $cost; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUnitCost( $modelid, $dealerid, $cost )\n{\nglobal $db;\n\n//08.21.2015 ghh - first we're going to see if there is a dealer specific price for \n//this item and if so we'll just pass it back\n$query = \"select Cost from UnitModelCost where ModelID=$modelid and \n\t\t\t\tDealerID=$dealerid\";\nif (!$result = $db->sql_query($query))\n\t{\n\tRestLog(\"Error 16562 in query: $query\\n\".$db->sql_error());\n\tRestUtils::sendResponse(500,\"16562 - There was a problem attempting find the dealer cost\"); //Internal Server Error\n\treturn false;\n\t}\n\n$row = $db->sql_fetchrow( $result );\n\n//if there is a cost then lets just return it.\nif ( $row['Cost'] > 0 )\n\treturn $row['Cost'];\n\nreturn $cost;\n}", "function getitemcost($item_cost)\r\n{\r\n require_once(\"heading.php\");\r\n$item = $_POST[\"items\"];\r\n$player = $_POST[\"character\"];\r\nif ($item == 'Bag')\r\n $item_cost = (int)20;\r\nif ($item == 'Phoenix')\r\n $item_cost = (int)20;\r\nif ($item == 'Raven')\r\n $item_cost = (int)15;\r\nif ($item == 'PrimalNether')\r\n $item_cost = (int)5;\r\nif ($item == 'NetherVortex')\r\n $item_cost = (int)8;\r\nif ($item == 'AVMark')\r\n $item_cost = (int)5;\r\nif ($item == 'MercilessD')\r\n $item_cost = (int)25;\r\nif ($item == 'Murloc')\r\n $item_cost = (int)5;\r\nif ($item == 'Tiger60')\r\n $item_cost = (int)20;\r\nif ($item == 'Tiger30')\r\n $item_cost = (int)15;\r\nif ($item == 'Ogre')\r\n $item_cost = (int)5;\r\nif ($item == 'BattleBear')\r\n $item_cost = (int)15;\r\nif ($item == 'FlyingBroom')\r\n $item_cost = (int)20;\r\nif ($item == 'XRocket')\r\n $item_cost = (int)25;\r\n\r\nreturn $item_cost;\r\n}", "public function getCost();", "public function getItemCost()\n {\n return $this->itemCost;\n }", "function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$cr_appliance_id = $this->appliance_id;\n\t\t$app_id_arr = explode(\",\", $cr_appliance_id);\n\t\t$cr_costs_final = 0;\n\t\tforeach ($app_id_arr as $app_id) {\n\t\t\t$cloud_app = new cloudappliance();\n\t\t\t$cloud_app->get_instance_by_appliance_id($app_id);\n\t\t\t// check state, only bill if active\n\t\t\tif ($cloud_app->state == 1) {\n\t\t\t\t// basic cost\n\t\t\t\t$cr_costs = 0;\n\t\t\t\t// + per cpu\n\t\t\t\t$cr_costs = $cr_costs + $this->cpu_req;\n\t\t\t\t// + per nic\n\t\t\t\t$cr_costs = $cr_costs + $this->network_req;\n\t\t\t\t// ha cost double\n\t\t\t\tif (!strcmp($this->ha_req, '1')) {\n\t\t\t\t\t$cr_costs = $cr_costs * 2;\n\t\t\t\t}\n\t\t\t\t// TODO : disk costs\n\t\t\t\t// TODO : network-traffic costs\n\n\t\t\t\t// sum\n\t\t\t\t$cr_costs_final = $cr_costs_final + $cr_costs;\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Billing active appliance $app_id (cr $this->id) = $cr_costs CC-units\", \"\", \"\", 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Not billing paused appliance $app_id (cr $this->id)\", \"\", \"\", 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Final bill for cr $this->id = $cr_costs_final CC-units\", \"\", \"\", 0, 0, 0);\n\t\treturn $cr_costs_final;\n\t}", "function sellItem($store_id, $journey_id, $character_id, $player_id, $item_id) {\n\t\t\n\t\taddToDebugLog(\"sellItem(), Function Entry - Store ID: \" . $store_id . \", Journey ID: \" . $journey_id . \"; Character ID: \" . $character_id . \"; Player ID: \" . $player_id . \"; Item ID: \" . $item_id . \", INFO\");\n\t\t\n\t\t// Get item details from the character\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE equipment_id = \" . $item_id . \";\";\n\t\taddToDebugLog(\"sellItem(), Constructed query: \" . $sql . \", INFO\");\n\t\t$result = search($sql);\n\t\t$name = $result[0][1];\n\t\t$ac_boost = $result[0][2];\n\t\t$attack_boost = $result[0][3];\n\t\t$weight = $result[0][4];\n\t\t$slot = $result[0][5];\n\t\tif (substr($result[0][5], 0, 6) == 'potion') {\n\t\t\t$name_elements = explode(' ', $name);\n\t\t\t$final_name = $name_elements[0];\n\t\t\t$cost = 100 * $name_elements[3];\n\t\t} elseif (substr($result[0][5], 0, 3) == 'pet') {\n\t\t\t$name_elements = explode(',', $name);\n\t\t\t$final_name = $name_elements[0];\n\t\t\t$cost = ($name_elements[1] * 500) + 5000;\n\t\t} else {\n\t\t\t$cost = 50 * ($ac_boost + $attack_boost);\n\t\t\t$final_name = $name;\n\t\t}\n\t\t\n\t\t// Add value to player gold\n\t\t$dml = \"UPDATE hackcess.character_details SET gold = gold + \" . $cost . \" WHERE character_id = \" . $character_id . \";\";\n\t\t$result = insert($dml);\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"sellItem(), Character record updated, INFO\");\n\t\t} else {\n\t\t\taddToDebugLog(\"sellItem(), Character record not updated, ERROR\");\n\t\t}\t\t\n\t\t\n\t\t// Add item to store\n\t\t$dml = \"INSERT INTO hackcess.store_contents (store_id, item_name, item_ac_boost, item_attack_boost, item_weight, item_slot, item_cost) VALUES (\" . $store_id . \", '\" . $final_name . \"', \" . $ac_boost . \", \" . $attack_boost . \", \" . $weight . \", '\" . $slot . \"', \" . $cost . \");\";\n\t\t$result = insert($dml);\t\t\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"sellItem(), Item added to store, INFO\");\n\n\t\t\t// Determine pet id\n\t\t\t$sql = \"SELECT pet_id FROM hackcess.pets WHERE pet_name = '\" . $name_elements[0] . \"';\";\n\t\t\t$result = search($sql);\n\t\t\t$pet_id = $result[0][0];\n\t\t\t\t\n\t\t\t// Unassign pet from character\n\t\t\t$dml = \"UPDATE hackcess.pets SET character_id = 0 WHERE pet_id = \" . $pet_id . \";\";\n\t\t\t$result = insert($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record updated, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record not updated, ERROR\");\n\t\t\t}\n\t\t\t\n\t\t\t// Remove item from store\n\t\t\t$dml = \"DELETE FROM hackcess.character_equipment WHERE equipment_id = \" . $item_id . \";\";\n\t\t\t$result = delete($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"sellItem(), Item deleted from character equipment, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"sellItem(), Item not deleted from character equipment, ERROR\");\n\t\t\t}\n\t\t\t\t\n\t\t} else {\n\t\t\taddToDebugLog(\"sellItem(), Item not added to store, ERROR\");\n\t\t}\n\t\t\n\t\toutputDebugLog();\n\t\t\n\t\t// Redirect back to store page\n\t\techo \"<script>window.location.href = 'store.php?player_id=\" . $player_id . \"&character_id=\" . $character_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"'</script>\";\n\t\t\n\t}", "function buyItem($store_id, $journey_id, $character_id, $player_id, $item_id) {\n\t\n\t\taddToDebugLog(\"buyItem(), Function Entry - Store ID: \" . $store_id . \", Journey ID: \" . $journey_id . \"; Character ID: \" . $character_id . \"; Player ID: \" . $player_id . \"; Item ID: \" . $item_id . \", INFO\");\n\t\n\t\t// Get item details from the store\n\t\t$sql = \"SELECT * FROM hackcess.store_contents WHERE contents_id = \" . $item_id . \";\";\n\t\t$result = search($sql);\n\t\t$name = $result[0][2];\n\t\t$final_name = $result[0][2]; \n\t\t$ac_boost = $result[0][3];\n\t\t$atk_boost = $result[0][4];\n\t\t$weight = $result[0][5];\n\t\t$slot = $result[0][6];\n\t\t$cost = $result[0][7];\n\t\n\t\t// Remove gold from player\n\t\t$dml = \"UPDATE hackcess.character_details SET gold = gold - \" . $cost . \" WHERE character_id = \" . $character_id . \";\";\n\t\t$result = insert($dml);\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"buyItem(), Character record updated, INFO\");\n\t\t} else {\n\t\t\taddToDebugLog(\"buyItem(), Character record not updated, ERROR\");\n\t\t}\n\t\t\n\t\t// If the item is a pet, determine the Level and attach to the name\n\t\tif (substr($slot, 0, 3) == \"pet\") {\n\t\t\t$level = ($cost - 5000) / 500;\n\t\t\t$final_name = $name . \",\" . $level;\n\t\t}\n\t\n\t\t// Add item to player equipment\n\t\t$dml = \"INSERT INTO hackcess.character_equipment (name, ac_boost, attack_boost, weight, slot, character_id) VALUES ('\" . $final_name . \"', \" . $ac_boost . \", \" . $atk_boost . \", \" . $weight . \", '\" . $slot . \"', \" . $character_id . \");\";\n\t\t$result = insert($dml);\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"buyItem(), Item added to player inventory, INFO\");\n\t\t\t\n\t\t\t// Determine pet id\n\t\t\t$sql = \"SELECT pet_id FROM hackcess.pets WHERE pet_name LIKE '\" . $name . \"%';\";\n\t\t\t$result = search($sql);\n\t\t\t$pet_id = $result[0][0]; \n\t\t\t\n\t\t\t// Assign pet to character\n\t\t\t$dml = \"UPDATE hackcess.pets SET character_id = \" . $character_id . \" WHERE pet_id = \" . $pet_id . \";\";\n\t\t\t$result = insert($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record updated, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record not updated, ERROR\");\n\t\t\t}\t\t\t\n\t\t\t\t\n\t\t\t// Remove item from store\n\t\t\t$dml = \"DELETE FROM hackcess.store_contents WHERE contents_id = \" . $item_id . \";\";\n\t\t\t$result = delete($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"buyItem(), Item deleted from store, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"buyItem(), Item not deleted from store, ERROR\");\n\t\t\t}\n\t\t\t\t\n\t\t} else {\n\t\t\taddToDebugLog(\"buyItem(), Item not added to player inventory, ERROR\");\n\t\t}\n\t\n\t\toutputDebugLog();\n\t\t\n\t\t// Redirect back to store page\n\t\techo \"<script>window.location.href = 'store.php?player_id=\" . $player_id . \"&character_id=\" . $character_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"'</script>\";\n\t\n\t}", "function characterEquipment($character_id, $player_id, $journey_id, $store_id) {\n\t\n\t\taddToDebugLog(\"characterEquipment(), Function Entry - supplied parameters: Player ID: \" . $player_id . \"; Journey ID: \" . $journey_id . \"; Character ID: \" . $charcter_id . \"; Store ID: \" . $store_id . \", INFO\");\n\t\t\n\t\t// Get Character Name\n\t\t$character_name = getCharacterDetails($character_id, 'character_name');\n\t\n\t\techo \"<table cellpadding=3 cellspacing=0 border=1>\";\n\t\techo \"<tr><td colspan=5 align=center><h2>\" . $character_name . \"</h2></tr>\";\n\t\techo \"<tr bgcolor=#bbb><td>Item<td align=center>Weight<td align=center>Value<td align=center>Actions</tr>\";\n\t\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE character_id = \" . $character_id . \" AND slot NOT LIKE 'potion%' AND slot NOT LIKE 'pet%' ORDER BY slot ASC, ac_boost, attack_boost DESC;\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\n\t\n\t\t// 0: ID\n\t\t// 1: Name\n\t\t// 2: AC Boost\n\t\t// 3: ATK Boost\n\t\t// 4: Weight\n\t\t// 5: Slot\n\t\n\t\t$weight_total = 0;\n\t\t$current_slot = \"\";\n\t\tfor ($e = 0; $e < $rows; $e++) {\n\t\n\t\t\tif ($result[$e][5] != $current_slot) {\n\t\t\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>\" . ucfirst($result[$e][5]) . \"</tr>\";\n\t\t\t\t$current_slot = $result[$e][5];\n\t\t\t}\n\t\n\t\t\t$bonus = $result[$e][2] + $result[$e][3];\n\t\t\techo \"<tr><td>+\" . $bonus . \" \" . $result[$e][1]; // Bonus + Item\n\t\t\techo \"<td align=center>\" . $result[$e][4]; // Weight\n\t\t\t\n\t\t\t//Value\n\t\t\t$value = $bonus * 50;\n\t\t\techo \"<td align=center>\" . $value;\n\t\n\t\t\t// Determine if the item of equipment is equipped or not\n\t\t\t$is_equipped = isEquipped($result[$e][5], $result[$e][0], $character_id);\n\t\t\t$weight_total = $weight_total + $result[$e][4];\n\t\t\tif ($is_equipped == 1) {\n\t\t\t\techo \"<td align=center bgcolor=#6f3>Equipped\";\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\techo \"<td align=center>\";\n\t\t\t\techo \"<a href='store.php?slot=\" . $result[$e][5] . \"&item_id=\" . $result[$e][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=sell'>Sell</a>\"; // $slot, $item_id, $character_id\n\t\t\t\techo \" | <a href='store.php?slot=\" . $result[$e][5] . \"&item_id=\" . $result[$e][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=equip&slot=\" . $result[$e][5] . \"'>Equip</a>\";\n\t\t\t}\n\t\t\t\t\n\t\t\techo \"</tr>\";\n\t\t\t\t\n\t\t}\n\t\n\t\t// Display Character potions\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE character_id = \" . $character_id . \" AND slot LIKE 'potion%' ORDER BY ac_boost, attack_boost DESC;\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\t\n\n\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>Potions</tr>\";\n\t\t\n\t\tfor ($p = 0; $p < $rows; $p++) {\n\t\t\t\n\t\t\techo \"<tr><td>\" . $result[$p][1]; // Item\n\t\t\techo \"<td align=center>-\"; // Weight\n\t\t\t\t\n\t\t\t//Value\n\t\t\t$potion_name = explode(' ', $result[$p][1]);\n\t\t\t$value = $potion_name[3] * 100;\n\t\t\techo \"<td align=center>\" . $value;\n\t\t\t\n\t\t\t// Write actions Sell\n\t\t\techo \"<td align=center>\";\n\t\t\techo \"<a href='store.php?slot=\" . $result[$p][5] . \"&item_id=\" . $result[$p][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=sell'>Sell</a>\"; // $slot, $item_id, $character_id\n\t\t\techo \"</tr>\";\t\t\t\n\t\t\t\n\t\t}\n\n\t\t// Display Character pets\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE character_id = \" . $character_id . \" AND slot LIKE 'pet%';\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\n\t\t\n\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>Pets</tr>\";\n\t\t\n\t\tfor ($p = 0; $p < $rows; $p++) {\n\t\t\t\t\n\t\t\t$details = explode(',', $result[$p][1]);\n\t\t\t$type = substr($result[$p][5], 4);\n\t\t\t\n\t\t\techo \"<tr><td>\" . $details[0] . \", Lvl \" . $details[1] . \" \" . ucfirst($type); // Item\n\t\t\techo \"<td align=center>-\"; // Weight\n\t\t\n\t\t\t//Value\n\t\t\t$value = ($details[1] * 500) + 5000;\n\t\t\techo \"<td align=center>\" . $value;\n\t\t\t\t\n\t\t\t// Write actions Sell\n\t\t\techo \"<td align=center>\";\n\t\t\techo \"<a href='store.php?slot=\" . $result[$p][5] . \"&item_id=\" . $result[$p][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=sell'>Sell</a>\"; // $slot, $item_id, $character_id\n\t\t\techo \"</tr>\";\n\t\t\t\t\n\t\t}\n\t\t\n\t\t// Get character strength\t\t\n\t\t$character_strength = getCharacterDetailsInfo($character_id, 'strength');\n\t\t$effects = getEffectBoosts($character_id);\n\t\t$traits = getTraitBoosts($character_id);\n\t\t$total_strength = $character_strength + $effects[\"str\"] + $traits[\"str\"];\n\t\t\n\t\techo \"<tr><td align=right>Total Weight<td align=center>\" . $weight_total;\n\t\techo \"<td align=center>\" . $total_strength . \"<td align=left>Strength</tr>\";\n\t\t\n\t\t// Character Gold\n\t\t$character_gold = getCharacterDetailsInfo($character_id,'gold');\n\t\techo \"<tr><td align=right colspan=2>Character Gold<td align=center>\" . $character_gold . \"<td></tr>\";\n\t\t\n\t\techo \"</table>\";\n\t \n\t}", "function calculatePrice( &$item ) {\r\n\t\r\n\tglobal $db, $site;\r\n\t\r\n\t$resultPrice = $basePrice = $item['price'];\r\n\t\r\n\t$pricing = $db->getAll( 'select * from '. ATTRPRICING_TABLE.\" where product_id='$item[id]' and site_key='$site'\" );\r\n\t\r\n\tforeach ( $pricing as $pidx=>$price ) {\r\n\t\t\r\n\t\t$match = true;\r\n\t\t\r\n\t\tif ( $item['attributes'] )\r\n\t\tforeach( $item['attributes'] as $attr_id=>$attr ) {\r\n\t\t\t\r\n\t\t\t$values = $db->getRow( 'select value1, value2 from '. ATTRPRICEVALUES_TABLE.\" where price_id='$price[id]' and attr_id='$attr_id'\" );\r\n\t\t\t\r\n\t\t\tif ( !$values )\r\n\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t$value1 = $values['value1'];\r\n\t\t\t$value2 = $values['value2'];\r\n\t\t\t$value = $attr['value'];\r\n\t\t\r\n\t\t\tswitch( $attr['type'] ) {\r\n\t\t\t\tcase 'number':\r\n/*\t\t\t\t\tif ( strlen( $value1 ) )\r\n\t\t\t\t\t\t$match &= $value >= $value1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif ( strlen( $value2 ) )\r\n\t\t\t\t\t\t$match &= $value <= $value2;\r\n\t\t\t\t\tbreak;\r\n*/\t\t\t\t\t\r\n\t\t\t\tcase 'single-text':\r\n\t\t\t\tcase 'multi-text':\r\n\t\t\t\tcase 'date':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$match &= $value == $value1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( $match ) {\r\n\t\t\t$resultPrice = getPriceValue( $price, $basePrice );\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $resultPrice;\r\n\t\r\n}", "function calculateBudget($ProjectID){\n\t$strLength = strlen($ProjectID) - 3;\n\t$ProjectIDsuff = substr($ProjectID , 3 ,$strLength);\n\t\n\t$conn = connectDB();\n\t\n\t//calculate total item cost for whole project.\n\t$totalItemSum = 0;\n\t\n\t$sql = \"SELECT TaskIDsuff FROM ProjectToConstruction \" . \n\t\t\t\t\"WHERE ProjectIDsuff = '\" . $ProjectIDsuff . \"';\";\n\tmysqli_query($conn, $sql);\n\t$result = $conn->query($sql);\n\t\n\twhile($get_TaskID = $result->fetch_array(MYSQLI_ASSOC)){\n\t\t\t$TaskIDsuff = $get_TaskID[\"TaskIDsuff\"];\n\t\t\t\n\t\t\t$sqlInner = \"SELECT ItemIDsuff, Quantity FROM QtyForItems \" . \n\t\t\t\t\t\t\t\"WHERE TaskIDsuff = '\" . $TaskIDsuff . \"';\";\n\t\t\tmysqli_query($conn, $sqlInner);\n\t\t\t$resultInner = $conn->query($sqlInner);\n\t\t\t\n\t\t\twhile($get_ItemID_Qty = $resultInner->fetch_array(MYSQLI_ASSOC)){\n\t\t\t\t$ItemIDsuff = $get_ItemID_Qty[\"ItemIDsuff\"];\n\t\t\t\t$Quantity = $get_ItemID_Qty[\"Quantity\"];\n\t\t\t\t\n\t\t\t\t$sqlInnerInner = \"SELECT ItemName, Supplier FROM Item \" . \n\t\t\t\t\t\t\t\t\t\"WHERE ItemIDsuff = '\" . $ItemIDsuff . \"';\";\n\t\t\t\tmysqli_query($conn, $sqlInnerInner);\n\t\t\t\t$resultInnerInner = $conn->query($sqlInnerInner);\n\t\t\t\t\n\t\t\t\t$get_ItemName_Supl = $resultInnerInner->fetch_array(MYSQLI_ASSOC);\n\t\t\t\t$ItemName = $get_ItemName_Supl[\"ItemName\"];\n\t\t\t\t$Supplier = $get_ItemName_Supl[\"Supplier\"];\n\t\t\t\t\t\n\t\t\t\t$sqlInnerInner = \"SELECT CostInDollars FROM ItemCost \" . \n\t\t\t\t\t\t\t\t\t\"WHERE ItemName = '\" . $ItemName . \"'\" . \n\t\t\t\t\t\t\t\t\t\"AND Supplier = '\" . $Supplier . \"';\";\n\t\t\t\tmysqli_query($conn, $sqlInnerInner);\n\t\t\t\t$resultInnerInner = $conn->query($sqlInnerInner);\n\t\t\t\t\n\t\t\t\t$get_CostInDollars = $resultInnerInner->fetch_array(MYSQLI_ASSOC);\n\t\t\t\t$CostInDollars = $get_CostInDollars[\"CostInDollars\"];\n\t\t\t\t\n\t\t\t\t$totalItemSum = $totalItemSum + ($CostInDollars * $Quantity);\n\t\t\t}\n\t}\n\t\n\t\n\t\n\t//calculate labour cost for all tasks\n\t$totalLabourSum = 0;\n\t\n\t$sql = \"SELECT TaskIDsuff FROM ProjectToConstruction \" . \n\t\t\t\"WHERE ProjectIDsuff = \" . $ProjectIDsuff . \";\";\n\tmysqli_query($conn, $sql);\n\t$result = $conn->query($sql);\n\t\n\twhile($get_TaskID = $result->fetch_array(MYSQLI_ASSOC)){\n\t\t\n\t\t$TaskIDsuff = $get_TaskID[\"TaskIDsuff\"];\n\t\t\n\t\t$sqlInner = \"SELECT CostPerHrs, TimeInHrs FROM Construction \" . \n\t\t\t\t\t\"WHERE TaskIDsuff = \" . $TaskIDsuff . \";\";\n\t\tmysqli_query($conn, $sqlInner);\n\t\t$result = $conn->query($sqlInner);\n\t\t\n\t\t$get_Cost_Time = $result->fetch_array(MYSQLI_ASSOC);\n\t\t$CostPerHrs = $get_Cost_Time[\"CostPerHrs\"];\n\t\t$TimeInHrs = $get_Cost_Time[\"TimeInHrs\"];\n\t\t\n\t\t$totalLabourSum = $totalLabourSum + ($CostPerHrs * $TimeInHrs);\n\t\t\n\t}\n\t\n\t\n\t//PermitCost\n\t$sql = \"SELECT PermitCost, Estimated FROM Project WHERE ProjectIDsuff = '\" . $ProjectIDsuff . \"'\";\n\tmysqli_query($conn, $sql);\n\t$result = $conn->query($sql);\n\t$thePertmitCost = $result->fetch_array(MYSQLI_ASSOC);\n\t$Estimated = $thePertmitCost[\"Estimated\"];\n\n\t$totalBudget = (int)$thePertmitCost[\"PermitCost\"] + (int)$totalItemSum + (int)$totalLabourSum;\n\t\n\t//Estimated - ActualCost\n\t$estimSubBudget = $Estimated - $totalBudget;\n\t\n\techo \"<h4>Total Item Cost: \" . $totalItemSum . \"<h4>\";\n\techo \"<h4>Total Labour Cost: \" . $totalLabourSum . \"<h4>\";\n\techo \"<h4>Permit Cost: \" . $thePertmitCost[\"PermitCost\"] . \"<h4>\";\n\techo \"<h4>Project Total Cost: \" . $totalBudget . \"<h4>\";\n\techo \"<h4>Surplus/Under: \" . $estimSubBudget .\"</h4>\";\n\n\t$sql = \"UPDATE Project SET \" .\n\t \"Budget=\" . $estimSubBudget . \" WHERE \" .\n\t \"ProjectIDsuff=\" . $ProjectIDsuff . \";\";\n\tmysqli_query($conn, $sql);\n\t\n\tmysqli_close($conn);\n}", "public function refactorBasedonItems()\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if ($cabinet->wood_xml)\n {\n $woods = self::returnWoodArray($cabinet);\n foreach ($woods AS $wood)\n {\n $this->cabItems += $wood['qty'];\n $this->instItems += $wood['qty'];\n }\n }\n }\n\n /*\n if ($this->cabItems < 30)\n {\n $this->cabItems = 30;\n }\n\n if ($this->instItems < 30 && $this->quote->type != 'Cabinet Small Job')\n {\n $this->instItems = 30;\n }\n\n\n if ($this->instItems > 35 && $this->instItems < 40)\n {\n $this->instItems = 40;\n }\n\n // Start Staging Price Blocks.\n if ($this->cabItems > 30 && $this->cabItems < 40)\n {\n $this->cabItems = 40;\n }\n */\n\n // For Designer\n if ($this->quote->type == 'Full Kitchen' || $this->quote->type == 'Cabinet and Install')\n {\n if ($this->cabItems <= 35)\n {\n $this->forDesigner = $this->getSetting('dL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forDesigner = $this->getSetting('dG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forDesigner = $this->getSetting('dG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forDesigner = $this->getSetting('dG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forDesigner = $this->getSetting('dG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forDesigner = $this->getSetting('dG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forDesigner = $this->getSetting('dG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forDesigner = $this->getSetting('dG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n }\n else\n {\n if ($this->quote->type == 'Cabinet Small Job' || $this->quote->type == 'Builder')\n {\n $this->forDesigner = 250;\n }\n }\n\n // ----------------------- Quote Type Specific values\n\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet Only')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if (!$cabinet->cabinet || !$cabinet->cabinet->vendor)\n {\n echo \\BS::alert(\"danger\", \"Unable To Determine Cabinets\",\n \"Cabinet type has not been selected! Unable to figure multiplier.\");\n return;\n }\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n $amt = ($cabinet->measure) ? 500 : 250;\n $this->forDesigner += $amt;\n $this->setDebug(\"Field Measure for Designer (Y=500/N=250)\", $amt);\n $this->forFrugal += 250; // for cabinet buildup.\n $this->setDebug(\"Frugal got $250 for Buildup\", 250);\n switch ($cabinet->location)\n {\n case 'North':\n $this->forFrugal += 300;\n $this->setDebug(\"Delivery North\", 300);\n break;\n case 'South':\n $this->forFrugal += 200;\n $this->setDebug(\"Delivery South\", 200);\n break;\n default:\n $this->forFrugal += 500;\n $this->setDebug(\"Further than 50m\", 500);\n break;\n }\n } // fe\n }\n else\n {\n if ($this->quote->type == 'Granite Only')\n {\n $this->forInstaller = 0;\n $this->forPlumber = 350;\n $this->forElectrician = 0;\n //$this->appElectrician = 0 ;\n //$this->forDesigner = 0;\n }\n else\n {\n if ($this->quote->type == \"Cabinet and Install\" || $this->quote->type == 'Builder')\n {\n if ($this->quote->type == 'Cabinet and Install')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n }\n\n $this->forInstaller += $this->instItems * 20; // get 20 per installable item not attach\n $this->forFrugal += 250; // For delivery\n $this->forFrugal += 250; // for cabinet buildup.\n $this->forFrugal += $this->instItems * 10; // Cabinet + Install gets $10 for frugal.\n $this->forFrugal += $this->attCount * 30; // Attachment Count.\n } // If it's cabinet install\n else\n {\n if ($this->instItems < 40)\n {\n $this->forInstaller += 500;\n }\n else\n {\n $remainder = $this->instItems - 40;\n $this->forInstaller += 500;\n $this->forInstaller += $remainder * 10;\n } // more than 40\n } // If builder\n } // if cabinet and install or builder\n else\n {\n if ($this->cabItems <= 35)\n {\n $this->forFrugal += $this->getSetting('fL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forFrugal += $this->getSetting('fG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forFrugal += $this->getSetting('fG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forFrugal += $this->getSetting('fG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forFrugal += $this->getSetting('fG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forFrugal += $this->getSetting('fG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forFrugal += $this->getSetting('fG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forFrugal += $this->getSetting('fG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n $this->forFrugal += ($this->attCount * 20);\n $this->setDebug(\"Frugal gets Attachment count * 20\", $this->attCount * 20);\n $this->forInstaller += ($this->instItems * 20);\n $this->setDebug(\"Installer gets Cabinet Installable ($this->instItems * 20)\",\n $this->instItems * 20);\n }\n }\n }\n\n $this->forElectrician += $this->appElectrician;\n $this->forPlumber += $this->appPlumber;\n $this->forInstaller += $this->accInstaller;\n $this->forFrugal += $this->accFrugal;\n // Additional - LED Lighting let's add this.\n $this->forDesigner += $this->designerLED;\n $this->forFrugal += $this->frugalLED;\n $this->forElectrician += $this->electricianLED;\n\n // No electrician or plumber if cabinet + install\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet and Install' || $this->quote->type == 'Cabinet Only')\n {\n $this->forPlumber = 0;\n $this->forElectrician = 0;\n }\n if ($this->quote->type == 'Cabinet Only')\n {\n $this->forInstaller = 0;\n }\n\n if ($this->quote->type == 'Granite Only')\n {\n $this->forElectrician = 0;\n }\n /*\n if ($this->quote->type == 'Cabinet Small Job')\n {\n if (!isset($this->gPrice))\n {\n $this->gPrice = 0;\n }\n\n $gMarkup = $this->gPrice * .2;\n $this->forFrugal += $gMarkup;\n\n $this->setDebug(\"Small Job Marks up Granite 20%\", $gMarkup);\n $sTotal = 0;\n if (isset($this->meta['sinks']))\n {\n foreach ($this->meta['sinks'] AS $sink)\n {\n if (!$sink)\n {\n continue;\n }\n $sink = Sink::find($sink);\n $sTotal += $sink->price;\n }\n $sMarkup = $sTotal * .2;\n $this->setDebug(\"Small Job Marks up Sink Costs 20%\", $sMarkup);\n $this->forFrugal += $sMarkup;\n }\n }\n */\n if ($this->quote->type == 'Cabinet Small Job')\n {\n $markup = $this->total * .4;\n $this->setDebug(\"Applying 40% Markup to Frugal for Cabinet Small Job\", $markup);\n $this->forFrugal = $markup;\n }\n\n // Add for installer to total\n $this->total += $this->forInstaller;\n $this->setDebug(\"Applying Installer Payouts to Quote\", $this->forInstaller);\n $this->total += $this->forElectrician;\n $this->setDebug(\"Applying Electrician Payouts to Quote\", $this->forElectrician);\n $this->total += $this->forPlumber;\n $this->setDebug(\"Applying Plumber Payouts to Quote\", $this->forPlumber);\n if ($this->quote->type != 'Builder')\n {\n $this->total += $this->forFrugal;\n $this->setDebug(\"Applying Frugal Payouts to Quote\", $this->forFrugal);\n }\n $this->total += $this->forDesigner;\n $this->setDebug(\"Applying Designer Payouts to Quote\", $this->forDesigner);\n if ($this->quote->type == 'Builder')\n {\n if ($this->quote->markup == 0)\n {\n $this->quote->markup = 30;\n $this->quote->save();\n }\n\n $perc = $this->quote->markup / 100;\n $markup = $this->total * $perc;\n $this->total += $markup;\n $this->setDebug(\"Applying {$this->quote->markup}% to Total For Builder Markup\", $markup);\n $this->forFrugal = $markup;\n }\n\n }", "public function getGoods($double_RRs = false)\n{\n\n global $DEA, $rules, $racesNoApothecary, $lng;\n\n $rr_price = $DEA[$this->race]['other']['rr_cost'] * (($double_RRs) ? 2 : 1);\n $apoth = !in_array($this->race_id, $racesNoApothecary);\n\n return array(\n // MySQL column names as keys\n 'apothecary' => array('cost' => $rules['cost_apothecary'], 'max' => ($apoth ? 1 : 0), 'item' => $lng->GetTrn('common/apothecary')),\n 'rerolls' => array('cost' => $rr_price, 'max' => $rules['max_rerolls'], 'item' => $lng->GetTrn('common/reroll')),\n 'ff_bought' => array('cost' => $rules['cost_fan_factor'], 'max' => $rules['max_fan_factor'], 'item' => $lng->GetTrn('matches/report/ff')),\n 'ass_coaches' => array('cost' => $rules['cost_ass_coaches'], 'max' => $rules['max_ass_coaches'], 'item' => $lng->GetTrn('common/ass_coach')),\n 'cheerleaders' => array('cost' => $rules['cost_cheerleaders'], 'max' => $rules['max_cheerleaders'], 'item' => $lng->GetTrn('common/cheerleader')),\n );\n}", "function get_item($item_id)\n\t{\n\t\tglobal $conn;\n\n\t\t$query=\"SELECT * FROM list_items WHERE item_id='$item_id' \";\n\t\t$result=mysqli_query($conn,$query);\n\n\t\t$item_data=\"\";\n\t\t\n\t\twhile($row = mysqli_fetch_array( $result))\n\t\t{\n\t\t\t$daily_price=$row['daily_rate'];\n\t\t\t$weekly_price=$row['weekly_rate'];\n\t\t\t$weekend_price=$row['weekend_rate'];\n\t\t\t$monthly_price=$row['monthly_rate'];\n\t\t\t$bond_price=$row['bond_rate'];\n\n\t\t\tif($daily_price=='0.00'){$daily_price=\"NA\";}\n\t\t\tif($weekly_price=='0.00'){$weekly_price=\"NA\";}\n\t\t\tif($weekend_price=='0.00'){$weekend_price=\"NA\";}\n\t\t\tif($monthly_price=='0.00'){$monthly_price=\"NA\";}\n\t\t\tif($bond_price=='0.00'){$bond_price=\"NA\";}\n\n\t\t\t$extra=array(\n\t\t\t\t'item_id'\t=>\t$row['item_id'],\n\t\t\t\t'item_pictures'\t=>\t$row['item_pictures'],\n\t\t\t\t'item_description'\t=>\t$row['item_description'],\n\t\t\t\t'item_name'\t=>\t$row['item_name'],\n\t\t\t\t'extra_option'\t=>\t$row['extra_option'],\t\t\t\t\n\t\t\t\t'user_id'\t=>\t$row['user_id'],\t\t\t\t\n\t\t\t\t'total_views'\t=>\t$row['total_views'],\t\t\t\t\n\t\t\t\t'cat_name'\t=>\t$row['cat_name'],\n\t\t\t\t'isLive'\t=>\t$row['isLive'],\n\t\t\t\t'user_name'\t=>\t$row['user_name'],\n\t\t\t\t'daily_rate'\t=>\t$daily_price,\n\t\t\t\t'weekly_rate'\t=>\t$weekly_price,\n\t\t\t\t'weekend_rate'\t=>\t$weekend_price,\n\t\t\t\t'monthly_rate'\t=>\t$monthly_price,\n\t\t\t\t'bond_rate'\t=>\t$bond_price\n\t\t\t);\n\t\t\t$item_data[]=$extra;\n\n\t\t}\n\n\t\tif(mysqli_query($conn, $query)){\n\t\t\t$response=array(\n\t\t\t\t'status' => 1,\n\t\t\t\t'items' => $item_data\t\t\t\t\t\t\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//insertion failure\n\t\t\t$response=array(\n\t\t\t\t'status' => 0,\n\t\t\t\t'status_message' =>'Item Details not found!!!'\t\t\t\n\t\t\t);\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($response);\n\t}", "public function get_services_cost(){\n //find all the requested services on a deadbody\n $sql = \"SELECT * FROM requested_service WHERE dead_no={$this->id}\";\n $this->requested_services = RequestedService::find_by_sql($sql);\n $total_debit = 0;\n //for each requested service find price and add to total debit\n foreach ($this->requested_services as $requested_service) {\n $service = Service::find_by_id($requested_service->service_no);\n $total_debit += $service->price;\n }\n return $total_debit;\n }", "function getPlayerWarehouseItem($player_id, $item_id)\n{\n global $db;\n return $db->where(\"player_id\", $player_id)\n ->where(\"item_id\", $item_id)\n ->getOne(\"warehouse\", \"quantity\");\n}", "public function getTotalEstimated() {\n\t\t$total = 0;\n\t\t$this->costitem->get();\n\t\tforeach($this->costitem->all as $item) {\n\t\t\tif ($item->item_type == 'price') {\n\t\t\t\t$total += $item->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t\t\n\t}", "public function get_info($item_id, $amt)\n\t{\n\t\t$taxtype = $this->session->userdata('taxtype');\n\t\t$category = $this->Item->get_info($item_id)->category;\n\t\t\n\t\t$main_array = [\"MEN'S CLOTHING\", \"WOMEN'S CLOTHING\", \"KID'S CLOTHING\", \"MEN'S FOOTWEAR\", \"WOMEN'S FOOTWEAR\", \"KID'S FOOTWEAR\"];\n\t\t$clothes_array = [\"MEN'S CLOTHING\", \"WOMEN'S CLOTHING\", \"KID'S CLOTHING\"];\n\t\t$footwear_array = [\"MEN'S FOOTWEAR\", \"WOMEN'S FOOTWEAR\", \"KID'S FOOTWEAR\"];\n\n\t\tif(in_array($category, $main_array))\n\t\t{\n\t\t\tif(in_array($category, $clothes_array)) //CLOTHES\n\t\t\t{\n\t\t\t\tif($taxtype) //IGST\n\t\t\t\t{\n\t\t\t\t\treturn ($amt > 1000) ? $this->create_igst_array($item_id, 12) : $this->create_igst_array($item_id, 5);\n\t\t\t\t}\n\t\t\t\telse //CSGT+SGST\n\t\t\t\t{\n\t\t\t\t\treturn ($amt > 1000) ? $this->create_array($item_id, 6) : $this->create_array($item_id, 2.5);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(in_array($category, $footwear_array)) //FOOTWEARS\n\t\t\t{\n\t\t\t\tif($taxtype) //IGST\n\t\t\t\t{\n\t\t\t\t\treturn ($amt > 1000) ? $this->create_igst_array($item_id, 18) : $this->create_igst_array($item_id, 5);\n\t\t\t\t}\n\t\t\t\telse //CSGT+SGST\n\t\t\t\t{\n\t\t\t\t\treturn ($amt > 1000) ? $this->create_array($item_id, 9) : $this->create_array($item_id, 2.5);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->from('items_taxes');\n\t\t\t$this->db->where('item_id',$item_id);\n\t\t\tif($taxtype)\n\t\t\t{\n\t\t\t\t$array = array('IGST');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$array = array('SGST', 'CGST');\n\t\t\t}\n\t\t\t$this->db->where_in('name', $array);\n\n\t\t\t//return an array of taxes for an item\n\t\t\treturn $this->db->get()->result_array();\n\t\t}\n\t}", "public function get_shipcost_details($dom, $sku, $item_id){\t\n\t\t\t//push each entry into new array\n\t\t\t$update_item_array = array();\n\n\t\t\t$update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_SHIPCOST_RESPONSE);\n\n\t\t\tforeach ($update_item_response as $item){\n\t\t\t\t//ad sku to first entry of array\n\t\t\t\tarray_push($update_item_array, $sku);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tarray_push($update_item_array, $item_id);\n\n\t\t\t\t$costs = $item->getElementsByTagName(DOM_ELEMENT_SHIP_DETAILS);\n\t\t\t\t\n\t\t\t\tforeach ($costs as $costsmsg){\n\t\t\t\t\t\n\t\t\t\t\t$serv_opts = $costsmsg->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_OPTIONS);\n\t\t\t\t\tforeach($serv_opts as $serv){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$costers = trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) != \"\" ? trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) : \"No Cost Entered - Error\";\n\t\t\t\t\t\tarray_push($update_item_array, $costers);\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\n\n\t\t\t\t//errors\n\t\t\t\t$error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS);\n\n\t\t\t\tforeach ($error_messages as $errormsg){\n\t\t\t\t\t$error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != \"\" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : \"No Error\";\n\t\t\t\t\tarray_push($update_item_array, $error);\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\treturn $update_item_array;\n\n\t\t//DOM_ELEMENT_SHORT_ERROR_MSG\n\t\t}", "function purchaseItem($idItem, $unitCost, $amount, $week){ //Seems to be no add() so maybe pull the new amount from the website or call an updateItemAmount()\n global $db;\n \n $money = $amount * $unitCost;\n $stmt=$db->prepare(\"INSERT INTO purchases (week, idItem, amount, money) VALUES (:week, :idItem, :amount, :money)\");\n \n $binds= array (\n \":week\" => $week,\n \":idItem\" => $idItem,\n \":amount\" => $amount,\n \":money\" => $money\n );\n \n if($stmt->execute($binds) && $stmt->rowCount()>0){\n //Runs functions to keep the other dataTables working\n addExpense($week, $money);\n $invAmount = getAmount($idItem);\n $netAmount = $invAmount['amount'] + $amount;\n return updateItemAmount($idItem, $netAmount);//returns true if successful\n \n }\n else{\n return false;\n }\n }", "private function makeItemPurchase() : void\n {\n $this->item->available = $this->item->available - 1;\n $this->coinService->setCoinCount(\n $this->coinService->getCurrenCoinCount() - $this->item->cost\n );\n $this->item->save();\n }", "public function getShippingCost();", "function calculate_delivery_cost($volume,$location_distance,$quantity){\n $total_volume = $volume * $quantity;\n // assume that the volume of space available in a motocycle is 500\n $motocycle_vol = 500;\n // assume that the volume of space available in a motocycle is 1000\n $cab_volume = 1000;\n if($total_volume <= $motocycle_vol){\n $means = 1; // 1 for motocycle ans 2 for cab\n }elseif ($total_volume <= $cab_volume && $total_volume > $motocycle_vol){\n $means = 2;\n }\n $cost_per_dist = ($means == 1)? 100 : 70;\n $total_cost = $cost_per_dist * $location_distance; // assume location distance is in km\n return $total_cost;\n}", "public function calItem($quantity,$item_price){\n $cal_price=$quantity*$item_price;\n return $cal_price;\n }", "function ciniki_sapos_itemCalcAmount($ciniki, $item) {\n\n if( !isset($item['quantity']) || !isset($item['unit_amount']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.30', 'msg'=>'Unable to calculate the item amount, missing quantity or unit amount'));\n }\n\n $unit_amount = $item['unit_amount'];\n //\n // Apply the dollar amount discount first\n //\n if( isset($item['unit_discount_amount']) && $item['unit_discount_amount'] > 0 ) {\n $unit_amount = bcsub($unit_amount, $item['unit_discount_amount'], 4);\n }\n //\n // Apply the percentage discount second\n //\n if( isset($item['unit_discount_percentage']) && $item['unit_discount_percentage'] > 0 ) {\n $percentage = bcdiv($item['unit_discount_percentage'], 100, 4);\n $unit_amount = bcsub($unit_amount, bcmul($unit_amount, $percentage, 4), 4);\n }\n\n //\n // Calculate what the amount should have been without discounts\n //\n $subtotal = bcmul($item['quantity'], $item['unit_amount'], 2);\n\n //\n // Apply the quantity\n //\n $total = bcmul($item['quantity'], $unit_amount, 2);\n\n //\n // Calculate the total discount on the item\n //\n $discount = bcsub(bcmul($item['quantity'], $item['unit_amount'], 2), $total, 2);\n\n //\n // Calculate the preorder_amount, after all discount calculations because this amount will be paid later\n //\n $preorder = 0;\n if( isset($item['unit_preorder_amount']) ) {\n $preorder = bcmul($item['quantity'], $item['unit_preorder_amount'], 2);\n if( $preorder > 0 ) {\n $total = bcsub($total, $preorder, 2);\n }\n }\n\n return array('stat'=>'ok', 'subtotal'=>$subtotal, 'preorder'=>$preorder, 'discount'=>$discount, 'total'=>$total);\n}", "function __lineItemTotal($qty, $price, $rate) {\n\n\n\n\n\n\n\n// if ($curency_id == 2)\n// $currency = 1;\n//\n// if ($curency_id == 1)\n// $currency = 4.17;\n//\n// if ($curency_id == 3)\n// $currency = 4.50;\n\n\n\n $line_total = $qty * $price * $rate;\n\n //$line_total = $line_total + (($line_total * $taxRate) / 100);\n\n\n\n return $line_total;\n }", "public function getCost()\n {\n return $this->get(self::_COST);\n }", "public function items($product, $protype='amount', $profit=0, $profit_child=0, $profit_baby=0)\n {\n if ($product['type'] != 2 || $product['payment'] != 'prepay') return $product;\n\n // type = 1 only hotel + auto product\n $sql = \"SELECT a.`id`, a.`name`, a.`objtype` AS `type`, a.`source`, a.`target`, a.`objpid`, a.`objid`, a.`ext`, a.`ext2`, a.`intro`, a.`childstd`, a.`babystd`, a.`default`,\n b.`profit` AS `profit`, b.`child` AS `profit_child`, b.`baby` AS `profit_baby`, b.`type` AS `protype`\n FROM `ptc_product_item` AS a\n LEFT JOIN `ptc_org_profit` AS b ON b.`org` = :org AND b.`payment` = 'prepay' AND b.`objtype` = 'item' AND b.`objid` = a.`id`\n WHERE a.`pid`=:pid\n ORDER BY a.`objtype` DESC, a.`seq` ASC;\";\n $db = db(config('db'));\n $items = $db -> prepare($sql) -> execute(array(':pid'=>$product['id'], ':org'=>api::$org));\n\n $hmax = $fmax = 0;\n $hmin = $fmin = 9999999;\n foreach ($items as $k => $v)\n {\n $sql = \"SELECT a.`id` AS `city`, a.`name` AS `cityname`, a.`pid` AS `country`, b.`name` AS `countryname`, a.`lng`, a.`lat`\n FROM `ptc_district` AS a\n LEFT JOIN `ptc_district` AS b ON a.pid = b.id\n WHERE a.`id`=:id\";\n\n if ($v['source'])\n {\n $source = $db -> prepare($sql) -> execute(array(':id' => $v['source']));\n $items[$k]['source'] = $source[0];\n }\n else\n {\n $items[$k]['source'] = null;\n }\n\n $target = $db -> prepare($sql) -> execute(array(':id' => $v['target']));\n $items[$k]['target'] = $target[0];\n\n if ($v['type'] == 'room')\n {\n $items[$k]['hotel'] = $v['objpid'];\n $items[$k]['room'] = $v['objid'];\n $items[$k]['night'] = $v['ext'];\n\n $sql = \"SELECT p.`key` AS `code`, p.`date`, p.`price`, p.`allot`-`sold` AS `allot`, p.`filled`, p.`standby`\n FROM `ptc_hotel_price_date` AS p\n WHERE p.`supply`='EBK' AND p.`supplyid`=:sup AND p.`hotel`=:hotel AND p.`room`=:room AND p.`close`=0\";\n $condition = array(':sup'=>$product['id'], ':hotel'=>$v['objpid'], ':room'=>$v['id']);\n\n $date = $db -> prepare($sql) -> execute($condition);\n }\n else\n {\n $items[$k]['auto'] = $v['objpid'];\n\n $sql = \"SELECT p.`key` AS `code`, p.`date`, p.`price`, p.`child`, p.`baby`, p.`allot`-p.`sold` AS `allot`, p.`filled`\n FROM `ptc_auto_price_date` AS p\n WHERE `auto`=:auto AND `close`=0\";\n $condition = array(':auto'=>$v['objpid']);\n\n $date = $db -> prepare($sql) -> execute($condition);\n }\n\n if ($v['protype'])\n {\n $_protype = $v['protype'];\n $_profit = $v['profit'];\n $_profit_child = $v['profit_child'];\n $_profit_baby = $v['profit_baby'];\n }\n else\n {\n $_protype = $protype;\n $_profit = $profit;\n $_profit_child = $profit_child;\n $_profit_baby = $profit_baby;\n }\n\n unset($items[$k]['protype'], $items[$k]['profit'], $items[$k]['profit_child'], $items[$k]['profit_baby']);\n\n $items[$k]['dates'] = array();\n foreach ($date as $d)\n {\n $d['code'] = key_encryption($d['code'].'_auto'.$product['id'].'.'.$v['id'].'_product2');\n $d['date'] = date('Y-m-d', $d['date']);\n $d['price'] = $d['price'] + round($_protype == 'amount' ? $_profit : ($d['price'] * $_profit / 100));\n $d['allot'] = $d['filled'] || $d['allot'] < 0 ? 0 : $d['allot'];\n if (isset($d['standby']))\n {\n $standby = json_decode($d['standby'], true);\n $d['child'] = $standby['child'] ? $standby['child'] + round($_protype == 'amount' ? $_profit_child : ($standby['child'] * $_profit_child / 100)) : 0;\n $d['baby'] = $standby['baby'] ? $standby['baby'] + round($_protype == 'amount' ? $_profit_baby : ($standby['baby'] * $_profit_baby / 100)) : 0;\n }\n else\n {\n $d['child'] = $d['child'] ? $d['child'] + round($_protype == 'amount' ? $_profit_child : ($d['child'] * $_profit_child / 100)) : 0;\n $d['baby'] = $d['baby'] ? $d['baby'] + round($_protype == 'amount' ? $_profit_baby : ($d['baby'] * $_profit_baby / 100)) : 0;\n }\n unset($d['uncombine'], $d['combine'], $d['standby']);\n $items[$k]['dates'][] = $d;\n\n if (!$d['allot']) continue;\n\n if ($v['type'] == 'room')\n {\n $hmin = $hmin > $d['price'] ? $d['price'] : $hmin;\n $hmax = $hmax < $d['price'] ? $d['price'] : $hmax;\n }\n else\n {\n $fmin = $fmin > $d['price'] ? $d['price'] : $fmin;\n $fmax = $fmax < $d['price'] ? $d['price'] : $fmax;\n }\n }\n }\n\n $product['maxprice'] = $hmax + $fmax;\n $product['minprice'] = $hmin + $fmin;\n $product['items'] = $items;\n return $product;\n }", "public function calculateQtyToShip();", "function getCost(){\n return $this->cost;\n }", "public function getTotalCost()\n {\n $this->loadItems();\n return $this->calculator->getCost($this->items);\n }" ]
[ "0.73825455", "0.67635363", "0.6667434", "0.6462335", "0.6318997", "0.62537485", "0.61736953", "0.6113484", "0.60957515", "0.6002453", "0.5979313", "0.59733385", "0.59671116", "0.59244585", "0.5916088", "0.5878113", "0.5864756", "0.58486265", "0.583431", "0.58190787", "0.58135825", "0.5770923", "0.575995", "0.57465255", "0.57241464", "0.57150525", "0.57104504", "0.56531554", "0.5652997", "0.56511956" ]
0.7816782
0
08.25.2015 ghh this function deals with looking up a model in order to calculate its cost for the current dealership
function getUnitCost( $modelid, $dealerid, $cost ) { global $db; //08.21.2015 ghh - first we're going to see if there is a dealer specific price for //this item and if so we'll just pass it back $query = "select Cost from UnitModelCost where ModelID=$modelid and DealerID=$dealerid"; if (!$result = $db->sql_query($query)) { RestLog("Error 16562 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500,"16562 - There was a problem attempting find the dealer cost"); //Internal Server Error return false; } $row = $db->sql_fetchrow( $result ); //if there is a cost then lets just return it. if ( $row['Cost'] > 0 ) return $row['Cost']; return $cost; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCost();", "public function model()\n {\n return Cost::class;\n }", "public function show(VehicleRequest $request)\n {\n \n $input = $request->input();\n $cost = $request->input('purchase_cost');\n\n\n \n // depreciation\n $depreciation = new depreciationCost($cost);\n $depreciation_amount = $depreciation->depreciateCalc();\n\n\n // interest \n $carInterest = new interestCost($cost);\n $interest_amount = $carInterest->interestCalc();\n $hire_amount = $carInterest->hirePurchase();\n\n // interest total\n $interest_total = $interest_amount + $hire_amount;\n\n\n $carInsurance = new insuranceCost($cost);\n $insurance_amount = $carInsurance->insuranceCalc();\n\n \n $cat = $request->input('category');\n\n //subscription\n $subscription_cost =$request->input('subs');\n\n\n //parking default\n $parking_cost = 93500;\n\n //liscence default\n $liscence_cost = 0;\n //dd($liscence_cost);\n\n $fixed_cost = $liscence_cost + $parking_cost + $subscription_cost + $insurance_amount + $interest_total + $depreciation_amount;\n \n\n\n //fixed cost per km\n $fixed_costs_km = round ($fixed_cost / 30000, 2);\n \n \n\n \n \n //Operating Cost\n\n $oil_cost = $request->input('oils');\n $drive = $request->input('oils');\n $services_cost = $request->input('services');\n $repairs_cost = $request->input('repairs');\n $tyres_cost = $request->input('tyres');\n \n\n //get distance and fuel price\n $capacity_id = $request->input('capacity');\n $fuel_worth = $this->getFuels($capacity_id);\n $distance = $this->getDistance($capacity_id);\n \n\n $fuel_cost = new runningCost($fuel_worth, $distance,);\n $fuel = $fuel_cost->fuelCalc();\n\n\n \n $operating_costs = $oil_cost + $services_cost + $repairs_cost + $tyres_cost + $fuel;\n\n \n //Total Running Cost per KM\n\n \n $running_cost = $fixed_costs_km + $operating_costs;\n\n \n \n \n return view('frontend.costs')->with(compact('fixed_cost','operating_costs','parking_cost','liscence_cost','depreciation_amount','interest_total','subscription_cost','insurance_amount','parking_cost','oil_cost','services_cost','repairs_cost','tyres_cost','drive', 'fuel', 'fixed_costs_km', 'running_cost'));\n }", "abstract public function calculate(Shippable $model): float;", "public function actionDeliveryCost($code){\n //check country\n $city= City::find()->where('Name=\"'.$code.'\"')->one();\n //var_dump($city);\n if($city->CountryCode == 'EGY'){\n //calculate weight\n $sum=0;\n foreach(Shopcart::goods() as $good) {\n $sum+= $good->item->product_weight ;\n\n }\n // return \"the new cost--\".$city->Name .$city->CountryCode;\n //$city->CountryCode;\n $cost= $this->GetCost($city->Name,$sum);\n if($cost =='' or $cost ==0){\n return Setting::get('deliver_cost');\n }else{return $cost ;}\n\n }else{\n return Setting::get('deliver_cost'); //.'-99'. $city->CountryCode;\n }\n\n }", "function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$cr_appliance_id = $this->appliance_id;\n\t\t$app_id_arr = explode(\",\", $cr_appliance_id);\n\t\t$cr_costs_final = 0;\n\t\tforeach ($app_id_arr as $app_id) {\n\t\t\t$cloud_app = new cloudappliance();\n\t\t\t$cloud_app->get_instance_by_appliance_id($app_id);\n\t\t\t// check state, only bill if active\n\t\t\tif ($cloud_app->state == 1) {\n\t\t\t\t// basic cost\n\t\t\t\t$cr_costs = 0;\n\t\t\t\t// + per cpu\n\t\t\t\t$cr_costs = $cr_costs + $this->cpu_req;\n\t\t\t\t// + per nic\n\t\t\t\t$cr_costs = $cr_costs + $this->network_req;\n\t\t\t\t// ha cost double\n\t\t\t\tif (!strcmp($this->ha_req, '1')) {\n\t\t\t\t\t$cr_costs = $cr_costs * 2;\n\t\t\t\t}\n\t\t\t\t// TODO : disk costs\n\t\t\t\t// TODO : network-traffic costs\n\n\t\t\t\t// sum\n\t\t\t\t$cr_costs_final = $cr_costs_final + $cr_costs;\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Billing active appliance $app_id (cr $this->id) = $cr_costs CC-units\", \"\", \"\", 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Not billing paused appliance $app_id (cr $this->id)\", \"\", \"\", 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Final bill for cr $this->id = $cr_costs_final CC-units\", \"\", \"\", 0, 0, 0);\n\t\treturn $cr_costs_final;\n\t}", "public function setModel()\n {\n return Cost::class;\n }", "function getItemCost( $itemid, $dealerid, $pricecode, $cost, $list )\n{\nglobal $db;\n\n//08.21.2015 ghh - first we're going to see if there is a dealer specific price for \n//this item and if so we'll just pass it back\n$query = \"select DealerCost from ItemCost where ItemID=$itemid and \n\t\t\t\tDealerID=$dealerid\";\nif (!$result = $db->sql_query($query))\n\t{\n\tRestLog(\"Error 16527 in query: $query\\n\".$db->sql_error());\n\tRestUtils::sendResponse(500,\"16527 - There was a problem attempting find the dealer cost\"); //Internal Server Error\n\treturn false;\n\t}\n\n$row = $db->sql_fetchrow( $result );\n\n//if there is a cost then lets just return it.\nif ( $row['DealerCost'] > 0 )\n\treturn $row['DealerCost'];\n\n//if there was no cost then the next step is to see if there is a price code\nif ( $pricecode != '' )\n\t{\n\t$query = \"select Discount from PriceCodesLink where DealerID=$dealerid\n\t\t\t\t\tand PriceCode=$pricecode\";\n\n\tif (!$result = $db->sql_query($query))\n\t\t{\n\t\tRestLog(\"Error 16528 in query: $query\\n\".$db->sql_error());\n\t\tRestUtils::sendResponse(500,\"16528 - There was a problem finding your price code\"); //Internal Server Error\n\t\treturn false;\n\t\t}\n\n\t//08.28.2015 ghh - if we did not find a dealer specific code then next we're going to \n\t//look for a global code to see if we can find that\n\tif ( $db->sql_numrows( $result ) == 0 )\n\t\t{\n\t\t$query = \"select Discount from PriceCodesLink where DealerID=0\n\t\t\t\t\t\tand PriceCode=$pricecode\";\n\n\t\tif (!$result = $db->sql_query($query))\n\t\t\t{\n\t\t\tRestLog(\"Error 16626 in query: $query\\n\".$db->sql_error());\n\t\t\tRestUtils::sendResponse(500,\"16626 - There was a problem finding your price code\"); //Internal Server Error\n\t\t\treturn false;\n\t\t\t}\n\n\t\t//if we found a global price code entry then enter here\n\t\tif ( $db->sql_numrows( $result ) > 0 )\n\t\t\t{\n\t\t\t$row = $db->sql_fetchrow( $result );\n\t\t\tif ( $row['Discount'] > 0 )\n\t\t\t\t$cost = bcmul( bcadd(1, $row['Discount']), $cost );\n\t\t\telse\n\t\t\t\t$cost = bcmul( bcadd( 1, $row['Discount']), $list );\n\t\t\t}\n\t\t}\n\telse\n\t\t{\n\t\t//if we found a dealer specific code then enter here\n\t\t$row = $db->sql_fetchrow( $result );\n\n\t\tif ( $row['Discount'] > 0 )\n\t\t\t$cost = bcmul( bcadd(1, $row['Discount']), $cost );\n\t\telse\n\t\t\t$cost = bcmul( bcadd( 1, $row['Discount']), $list );\n\t\t}\n\t}\n\nreturn $cost;\n}", "public function get_services_cost(){\n //find all the requested services on a deadbody\n $sql = \"SELECT * FROM requested_service WHERE dead_no={$this->id}\";\n $this->requested_services = RequestedService::find_by_sql($sql);\n $total_debit = 0;\n //for each requested service find price and add to total debit\n foreach ($this->requested_services as $requested_service) {\n $service = Service::find_by_id($requested_service->service_no);\n $total_debit += $service->price;\n }\n return $total_debit;\n }", "public function run()\n {\n //\n $commercialCompreheniveCost = [\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>4.50\n ],\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>5.75\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>7000000, \n 'rate'=>5.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>7000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>3\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>2.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>2000000, \n 'rate'=>7.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>2000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>6\n ],\n [\n 'commercial_class_id'=>5,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>6,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>7,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>8,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>12.5\n ],\n ];\n \n foreach($commercialCompreheniveCost as $key => $value){\n\n CommercialComprehensiveCost::create($value);\n\n }\n }", "public function getGoods($double_RRs = false)\n{\n\n global $DEA, $rules, $racesNoApothecary, $lng;\n\n $rr_price = $DEA[$this->race]['other']['rr_cost'] * (($double_RRs) ? 2 : 1);\n $apoth = !in_array($this->race_id, $racesNoApothecary);\n\n return array(\n // MySQL column names as keys\n 'apothecary' => array('cost' => $rules['cost_apothecary'], 'max' => ($apoth ? 1 : 0), 'item' => $lng->GetTrn('common/apothecary')),\n 'rerolls' => array('cost' => $rr_price, 'max' => $rules['max_rerolls'], 'item' => $lng->GetTrn('common/reroll')),\n 'ff_bought' => array('cost' => $rules['cost_fan_factor'], 'max' => $rules['max_fan_factor'], 'item' => $lng->GetTrn('matches/report/ff')),\n 'ass_coaches' => array('cost' => $rules['cost_ass_coaches'], 'max' => $rules['max_ass_coaches'], 'item' => $lng->GetTrn('common/ass_coach')),\n 'cheerleaders' => array('cost' => $rules['cost_cheerleaders'], 'max' => $rules['max_cheerleaders'], 'item' => $lng->GetTrn('common/cheerleader')),\n );\n}", "public function getCost() {\n return 15 + $this->carService->getCost();\n }", "public function createCostAvgObject() {\n\t\t/* Check to see if dealer and date combo already exists in DB table. \n\t\t * If so, will need to retrieve data from tables.\n\t\t * If not, will need to bypass table queries and create tables dynamically based on 'services' table\n\t\t */\n\t\tif((isset($_SESSION['profit_dlr_id']) && isset($_SESSION['profit_date'])) || (isset($_SESSION['export_dlr_id']) && isset($_SESSION['export_date']))) {\n\t\t\tif(isset($_SESSION['export_dlr_id']) && isset($_SESSION['export_date'])) {\n\t\t\t\t$dealer = $_SESSION['export_dlr_id'];\n\t\t\t\t$date = $_SESSION['export_date'];\n\t\t\t} else {\n\t\t\t\t$dealer = $_SESSION['profit_dlr_id'];\n\t\t\t\t$date = $_SESSION['profit_date'];\n\t\t\t}\n\t\t\t\n\t\t\tif($this->checkTableData($dealer, $date)) {\n\t\t\t\n\t\t\t\t// Run query of all services to get total for comparison to below query results\n\t\t\t\t$services_info = new ServicesInfo();\n\t\t\t\t$service_list_a = $services_info->getServicesTableData($id_list = NULL); // Will return an array of 8 items (with svc_id and svc_name)\n\t\t\t\t// echo var_dump($service_list_a);\n\t\t\t\t\n\t\t\t\t$sql = \"SELECT a.svc_id, b.svc_name \n\t\t\t\t\t\tFROM cost_avg_data a\n\t\t\t\t\t\tLEFT JOIN services b ON (a.svc_id = b.svc_id)\n\t\t\t\t\t\tWHERE a.dealer_record_id = :dealer_record_id AND a.record_date = :record_date\n\t\t\t\t\t\tGROUP BY a.svc_id \n\t\t\t\t\t\tORDER BY a.svc_id\";\n\t\t\t\ttry {\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(\":dealer_record_id\", $dealer, PDO::PARAM_INT);\n\t\t\t\t\t$stmt->bindParam(\":record_date\", $date, PDO::PARAM_STR);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$svc_results = $stmt->fetchALL(PDO::FETCH_ASSOC);\n\t\t\t\t\t$stmt->closeCursor();\n\t\t\t\t\t$service_list_b = array();\n\t\t\t\t\t$service_id_list = array();\n\t\t\t\t\tforeach ($svc_results as $output) {\n\t\t\t\t\t\t$service_list_b[$output['svc_name']] = $output['svc_id'];\n\t\t\t\t\t\t$service_id_list[]= $output['svc_id'];\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tdie($e->getMessage());\n\t\t\t\t}\n\t\t\t\t// echo '$service_list_a: <br>';\n\t\t\t\t// var_dump($service_list_a);\n\t\t\t\t// echo '$service_list_b: <br>';\n\t\t\t\t// var_dump($service_list_b);\n\t\t\t\t// echo '$service_id_list: <br>';\n\t\t\t\t// echo var_dump($service_id_list),'<br><br>';\n\t\t\t\t// die();\n\t\t\t\t\n\t\t\t\t// Query all unit table records for specific dealer and date\n\t\t\t\t$sql = \"SELECT c.svc_id, c.svc_name, a.cost_id, a.cost_desc, a.cost_code, a.cost_ro_count, a.cost_parts_sale, a.cost_parts_cost, a.cost_labor_sale\n\t\t\t\t\t\tFROM cost_avg_data a\n\t\t\t\t\t\tLEFT JOIN dealers b ON (b.dealer_record_id = a.dealer_record_id)\n\t\t\t\t\t\tLEFT JOIN services c ON (c.svc_id = a.svc_id)\n\t\t\t\t\t\tWHERE a.dealer_record_id = :dealer_record_id\n\t\t\t\t\t\tAND a.record_date = :record_date\n\t\t\t\t\t\tORDER BY a.cost_id\";\n\t\t\t\ttry {\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(\":dealer_record_id\", $dealer, PDO::PARAM_INT);\n\t\t\t\t\t$stmt->bindParam(\":record_date\", $date, PDO::PARAM_STR);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$cost_tables = $stmt->fetchALL(PDO::FETCH_ASSOC);\n\t\t\t\t\t$stmt->closeCursor();\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tdie($e->getMessage());\n\t\t\t\t}\n\t\t\t\t//echo '$cost_tables:<br>', var_dump($cost_tables),'<br>';\n\t\t\t\t//die();\n\t\t\t\t\n\t\t\t\t// Build comma-delimited list from $service_id_list for use in services query below (from getServicesTableData() function)\n\t\t\t\t$query_id_list = '';\n\t\t\t\tfor ($i=0; $i<sizeof($service_id_list); $i++) {\n\t\t\t\t\tif ($i == (sizeof($service_id_list) - 1)) {\n\t\t\t\t\t\t$query_id_list .= $service_id_list[$i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$query_id_list .= $service_id_list[$i].', ';\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t// echo '$query_id_list: <br>',var_dump($query_id_list),'<br><br>';\n\t\t\t\t\n\t\t\t\t// If service lists do not have the same number of items, add remaining service categories and cost table arrays \n\t\t\t\t// to $service_list_b and $cost_tables arrays so that default tables also appear\n\t\t\t\tif (sizeof($service_list_a) != sizeof($service_list_b)) {\n\t\t\t\t\t// echo 'entered sizeof if statement<br>';\n\t\t\t\t\t// Run services query using $query_id_list for 'NOT IN' clause\n\t\t\t\t\t$services_append_array = $services_info->getServicesTableData($query_id_list); // This works.\n\t\t\t\t\t// echo'$services_append_array: ',var_dump($services_append_array),'<br>';\n\t\t\t\t\t// var_dump($services_append_array);\n\t\t\t\t\t// die();\n\t\t\t\t\tforeach ($services_append_array as $value) {\n\t\t\t\t\t\t$service_list_b[$value['svc_name']] = $value['svc_id'];\n\t\t\t\t\t\t$cost_tables[] = array('svc_id' => $value['svc_id'], 'svc_name' => $value['svc_name'], 'cost_desc' => '', 'cost_code' => '', 'cost_ro_count' => '', 'cost_parts_sale' => '', 'cost_parts_cost' => '', 'cost_labor_sale' => '');\n\t\t\t\t\t\t//$cost_array = ($cost_append_array[$value['svc_name']][] = array(\"svc_id\" => $value['svc_id'], \"svc_name\" => '', \"cost_desc\" => '', \"cost_code\" => '', \"cost_ro_count\" => '', \"cost_parts_sale\" => '', \"cost_parts_cost\" => '', \"cost_labor_sale\" => ''));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\t/** \n\t\t\t\t* Create two-dimensional array from above query results.\n\t\t\t\t* 1) After obtaining list of service ID's and names (via GROUP BY) and full array(array()) of table rows (2 queries),\n\t\t\t\t* 2) Iterate through each service name and through each table row\n\t\t\t\t* 3) Check to see if 'svc_name' array element == $svc (obtained from 1st service query)\n\t\t\t\t* 4) If it is equal, then add the array row to $new_array, with $svc as the array key (this will be the service name)\n\t\t\t\t*/\n\t\t\t\t$cost_table_array = array();\n\t\t\t\tforeach ($service_list_b as $svc_name => $value) {\n\t\t\t\t\tforeach ($cost_tables as $cost_table) {\n\t\t\t\t\t\tif ($cost_table['svc_name'] == $svc_name) {\n\t\t\t\t\t\t\t$cost_table_array[$svc_name][] = $cost_table;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// echo '$cost_table_array:<br>',var_dump($cost_table_array),'<br>';\n\t\t\t} else { // If there is no table data available, will need to build tables dynamically based on 'services' table\n\t\t\t\t$cost_table_array = $this->buildDefaultCostTables();\n\t\t\t}\n\t\t} else {\n\t\t\t$cost_table_array = $this->buildDefaultCostTables();\n\t\t}\n\t\treturn $cost_table_array;\n\t}", "public function calculation()\n {\n $this->autoRender=false;\n $this->loadModel('Contract');\n $this->loadModel('Delivery');\n $this->Contract->recursive=-1;\n $contracts=$this->Contract->find('all');\n $this->Delivery->recursive=-1;\n foreach ($contracts as $contract)\n {\n $contract_id=$contract['Contract']['id'];\n \n $pli_pac_con=($contract['Contract']['pli_pac']>0)?$contract['Contract']['pli_pac']:0;\n $pli_aproval_con=($contract['Contract']['pli_aproval']>0)?$contract['Contract']['pli_aproval']:0;\n $rr_collection_progressive_con=($contract['Contract']['rr_collection_progressive']>0)?$contract['Contract']['rr_collection_progressive']:0;\n \n $invoice_submission_progressive_con=($contract['Contract']['invoice_submission_progressive']>0)?$contract['Contract']['invoice_submission_progressive']:0;\n $payment_cheque_collection_progressive_con=($contract['Contract']['payment_cheque_collection_progressive']>0)?$contract['Contract']['payment_cheque_collection_progressive']:0;\n $payment_credited_to_bank_progressive_con=($contract['Contract']['payment_credited_to_bank_progressive']>0)?$contract['Contract']['payment_credited_to_bank_progressive']:0;\n \n $conditions=array(\n 'conditions'=>array(\n 'Delivery.contract_id'=>$contract_id,\n 'Delivery.actual_delivery_date NOT LIKE'=>\"0000-00-00\",\n //'Delivery.invoice_submission_progressive LIKE'=>\"0000-00-00\",//this condition may change\n ),\n 'group'=>array(\n 'Delivery.contract_id',\n 'Delivery.actual_delivery_date'\n )\n );\n $deliveries=$this->Delivery->find('all',$conditions);\n $sql=\"\";\n foreach ($deliveries as $deliverie)\n {\n \n $actual_delivery_date=strtotime($deliverie['Delivery']['actual_delivery_date']);\n $id=$deliverie['Delivery']['id'];\n \n $pli_pac1 = $actual_delivery_date+$pli_pac_con * 86400;\n $pli_pac = date('Y-m-d',$pli_pac1);\n\n $pli_aproval1 = $pli_pac1 + $pli_aproval_con * 86400;\n $pli_aproval = date('Y-m-d', $pli_aproval1);\n //planned_rr_collection_date\n $rr_collection_progressive1=$pli_aproval1+$rr_collection_progressive_con* 86400;\n $rr_collection_progressive= date('Y-m-d', $rr_collection_progressive1);\n //invoice_submission_progressive\n $invoice_submission_progressive1 =$rr_collection_progressive1+ $invoice_submission_progressive_con * 86400;\n $invoice_submission_progressive = date('Y-m-d', $invoice_submission_progressive1); \n //payment_cheque_collection_progressive\n $payment_cheque_collection_progressive1=$invoice_submission_progressive1+$payment_cheque_collection_progressive_con * 86400;\n $payment_cheque_collection_progressive = date('Y-m-d', $payment_cheque_collection_progressive1);\n //payment_credited_to_bank_progressive\n $payment_credited_to_bank_progressive1=$payment_cheque_collection_progressive1+$payment_credited_to_bank_progressive_con * 86400;\n $payment_credited_to_bank_progressive = date('Y-m-d', $payment_credited_to_bank_progressive1);\n \n $sql.=\"UPDATE deliveries SET invoice_submission_progressive = '\".$invoice_submission_progressive.\"',payment_cheque_collection_progressive='\".$payment_cheque_collection_progressive.\"',payment_credited_to_bank_progressive='\".$payment_credited_to_bank_progressive.\"' WHERE contract_id= $contract_id and actual_delivery_date='\".$deliverie['Delivery']['actual_delivery_date'].\"';\";\n }\n if($sql){\n \n $this->Delivery->query($sql);\n }\n } \n }", "function getCost(){\n return $this->cost;\n }", "public function totalCost(): float;", "public function cost()\n {\n return $this->getPrice();\n }", "function getSellPricePrevious($targetMonth,$targetYear,$process,$id){\r\n\r\n\t$table = new Model_ChainVehicle();\r\n\t$select = $table->select();\r\n\t$select->where('id ='.$id);\t\r\n\t$detail = $table->fetchRow($select);\r\n\r\n\r\n\t\r\n\tif($process == 'previous'){\r\n\t$select = $table->select();\r\n\tif($detail->dealer){\r\n\t$select->where('dealer like ?',$detail->dealer);\r\n\t}\r\n\t$select->where('brand like ?',$detail->brand);\r\n\t$select->where('unit like ?',$detail->unit);\r\n\t$select->where('year like ?',$targetYear.'');\r\n\t$select->where('month like ?',$targetMonth.'');\t\r\n\t$select->where('status like ?','approved');\t\r\n\t$detail2 = $table->fetchRow($select);\r\n\treturn $detail2->selling_price;\r\n\t}\r\n\t/******************************************/\r\n\telse if($process == 'colorMain'){\r\n\t\t$select = $table->select();\r\n\t\tif($detail->dealer){\r\n\t\t$select->where('dealer like ?',$detail->dealer);\r\n\t\t}\r\n\t\t$targetYear = returnYearx($detail->month,$detail->year);\r\n\t\t$targetMonth = returnMonthx($detail->month);\r\n\t\t\r\n\t\t$select->where('brand like ?',$detail->brand);\r\n\t\t$select->where('unit like ?',$detail->unit);\r\n\t\t$select->where('year like ?',$targetYear.'');\r\n\t\t$select->where('month like ?',$targetMonth.'');\t\r\n\t\t$select->where('status like ?','approved');\t\r\n\t\t$detail2 = $table->fetchRow($select);\r\n\t\r\n\tif($detail2){\r\n\t\tif($detail->selling_price != 0){\r\n\t\t\tif($detail->selling_price < $detail2->selling_price){\r\n\t\t\t\treturn '#CC0000'; /** Decrease **/ }\r\n\t\t\telse if($detail->selling_price > $detail2->selling_price){\r\n\t\t\t\treturn '#0000FF'; /** Increase **/ }\r\n\t\t\telse if($detail->selling_price == $detail2->selling_price){\r\n\t\t\t\treturn '#FFFF00'; /** No Change **/ }\t\t\t\r\n\t\t}// end of seeling price !=0\r\n\t\telse {\r\n\t\t\treturn '#999966'; /** Drop Out **/ }\r\n\t\t}\t\r\n\telse{ return '#66CC00'; /** Not Found New **/ }\r\n\r\n\r\n\t} // end of colorMain\r\n/******************************************/\r\n\telse if($process == 'colorSub'){\r\n\t\t$select = $table->select();\r\n\t\tif($detail->dealer){\r\n\t\t$select->where('dealer like ?',$detail->dealer);\r\n\t\t}\r\n\t\t$select->where('brand like ?',$detail->brand);\r\n\t\t$select->where('unit like ?',$detail->unit);\r\n\t\t$select->where('month like ?',$targetMonth.'');\r\n\t\t$select->where('year like ?',$targetYear.'');\r\n\t\t$select->where('status like ?','approved');\t\t\t\r\n\t\t$detailCurr = $table->fetchRow($select);\r\n\r\n\t\t$select2 = $table->select();\r\n\t\tif($detail->dealer){\r\n\t\t$select2->where('dealer like ?',$detail->dealer);\r\n\t\t}\r\n\t\t$targetYearZ = returnYearx($targetMonth,$targetYear);\r\n\t\t$targetMonthZ = returnMonthx($targetMonth);\r\n\r\n\t\t$select2->where('brand like ?',$detail->brand);\r\n\t\t$select2->where('unit like ?',$detail->unit);\r\n\t\t$select2->where('month like ?',$targetMonthZ.'');\r\n\t\t$select2->where('year like ?',$targetYearZ.'');\r\n\t\t$select2->where('status like ?','approved');\t\t\t\r\n\t\t$detailPrev = $table->fetchRow($select2);\r\n\t\t\r\n\r\n\t\tif($detailPrev){\r\n\t\t\tif($detailCurr->selling_price != 0){\r\n\t\t\t\tif($detailCurr->selling_price < $detailPrev->selling_price){\r\n\t\t\t\t\treturn '#CC0000'; /** Decrease **/ }\r\n\t\t\t\telse if($detailCurr->selling_price > $detailPrev->selling_price){\r\n\t\t\t\t\treturn '#0000FF'; /** Increase **/ }\r\n\t\t\t\telse if($detailCurr->selling_price == $detailPrev->selling_price){\r\n\t\t\t\t\treturn '#FFFF00'; /** No Change **/ }\t\t\t\r\n\t\t\t}// end of seeling price !=0\r\n\t\t\telse {\r\n\t\t\t\treturn '#999966'; /** Drop Out **/ }\r\n\t\t\t}\t\r\n\t\telse{ return '#66CC00'; /** Not Found New **/ }\r\n\t\r\n\r\n\t}// end of if process color \t\r\n\t\r\n\t\r\n\r\n/******************************************/\r\n\t\r\n\t \t\r\n\t}", "function get_cost($from, $to,$weight)\r\n{\r\n require_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&amp;gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&amp;gt;post('cost/find', array(\r\n 'from' =&amp;gt; $from,\r\n 'to' =&amp;gt; $to,\r\n 'weight' =&amp;gt; $weight.'000',\r\n 'courier' =&amp;gt; 'jne',\r\n'API-Key' =&amp;gt;'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456'\r\n ));\r\n \r\n try\r\n {\r\n $status = $result['status'];\r\n \r\n // Handling the data\r\n if ($status-&amp;gt;code == 0)\r\n {\r\n $prices = $result['price'];\r\n $city = $result['city'];\r\n \r\n echo 'Ongkos kirim dari ' . $city-&amp;gt;origin . ' ke ' . $city-&amp;gt;destination . '&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;';\r\n \r\n foreach ($prices-&amp;gt;item as $item)\r\n {\r\n echo 'Layanan: ' . $item-&amp;gt;service . ', dengan harga : Rp. ' . $item-&amp;gt;value . ',- &amp;lt;br /&amp;gt;';\r\n }\r\n }\r\n else\r\n {\r\n echo 'Tidak ditemukan jalur pengiriman dari surabaya ke jakarta';\r\n }\r\n \r\n }\r\n catch (Exception $e)\r\n {\r\n echo 'Processing error.';\r\n }\r\n}", "public function breakdown(): CostBreakdownContract;", "public function cost(){\n\t\t\n\t\treturn 200;\n\t}", "protected function giveCost()\n\t{\n\t\t$solarSaving = 2;\n\t\t$this->valueNow = 210.54 / $solarSaving;\n\t\treturn $this->valueNow;\n\t}", "public function getCashFlowModel($loanId)\n {\n //$modelType = Config::get('constants.CONST_ANALYST_MODEL_TYPE_CREDIT');\n $modelType = 'Cash Flow Model';\n\n DB::enableQueryLog();\n\n $loan = null;\n $loanType = null;\n $amount = null;\n $loanTenure = null;\n $endUseList = null;\n $userProfile = null;\n $ratingModel = null;\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n\n }\n if (isset($loan)) {\n $loanType = $loan->type;\n $amount = $loan->loan_amount;\n $loanTenure = $loan->loan_tenure;\n $endUseList = $loan->end_use;\n $userId = $loan->user_id;\n $userProfile = UserProfile::where('user_id', '=', $userId)->get()->first();\n\n $cashflowInitial = CashFlowInitial::where('loan_id', '=', $loanId)->first();\n $srcFundschk = SrcOfFundsData::where('loan_id', '=', $loanId)->first();\n // $usesFundschk = UsesOfFundsData::where('loan_id', '=', $loanId)->first();\n\n if (isset($srcFundschk)) {\n for ($i = 0; $i < 11; $i++) {\n $srcFunds[] = DB::table('src_of_funds_data')\n ->where('loan_id', '=', $loanId)\n ->where('src_id', '=', $i)\n ->get();\n }\n }\n $usesFundschk = UsesOfFundsData::where('loan_id', '=', $loanId)->first();\n $SrcTotal = SrcTotal::where('loan_id', '=', $loanId)->first();\n $usesTotal = UsesTotal::where('loan_id', '=', $loanId)->first();\n $openingSrcUse = OpeningSrcUse::where('loan_id', '=', $loanId)->first();\n $surplusSrcUses = SurplusSrcUses::where('loan_id', '=', $loanId)->first();\n $closingSrcUses = ClosingSrcUses::where('loan_id', '=', $loanId)->first();\n if (isset($usesFundschk)) {\n for ($i = 0; $i < 19; $i++) {\n $dataFunds[] = DB::table('uses_of_funds_data')\n ->where('loan_id', '=', $loanId)\n ->where('uses_id', '=', $i)\n ->get();\n }\n }\n\n //$loanPeriod = CashFlowInitial::find($loanId);\n\n\n $period_name = $cashflowInitial->period_name;\n $no_of_period = $cashflowInitial->no_of_period;\n $opening_cash_balance = $cashflowInitial->opening_cash_balance;\n }\n //$validLoanHelper = new validLoanUrlhelper();\n $setDisable = null;\n $validLoanHelper = new validLoanUrlhelper();\n $user = Auth::getUser();\n $setDisable = $this->getIsDisabled($user, true);\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $srcOfFunds = SrcOfFund::all()->pluck('name');\n $useOfFund = UseOfFund::all()->pluck('name');\n\n\n\n\n $subViewType = 'loans.financial._cash_flow_model_table';\n $formaction = 'Loans\\LoansController@postCashFlowModel';\n return view('loans.createedit', compact('subViewType', 'formaction', 'srcFunds', 'SrcTotal', 'openingSrcUse', 'surplusSrcUses', 'closingSrcUses', 'usesTotal', 'dataFunds', 'loan', 'cashflowInitial', 'srcOfFunds', 'useOfFund', 'loanId', 'loanType', 'endUseList', 'validLoanHelper', 'amount', 'loanTenure', 'period_name', 'no_of_period', 'opening_cash_balance', 'setDisable', 'loanUserProfile'));\n }", "public function cost()\n {\n return $this->hasOne(CostService::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::COST_FOREIGN_KEY);\n }", "public function cost()\n {\n return $this->price;\n }", "function get_target_model($username,$model_name){\n\trequire_once('../conf/config.php');\n\t//Connect to mysql server\n\t$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);\n\tif(!$link){\n\t\tdie('Failed to connect to server: ' . mysql_error());\n\t}\n\t//Select database\n\t$db = mysql_select_db(DB_DATABASE);\n\tif(!$db){\n\t\tdie(\"Unable to select database\");\n\t}\n\t/*\n\t\n\tfunction get_models(f,ZZ)\n\tquery=select * from models where username='f' and object_name='ZZ'\n\tArray\n\t(\n\t[username] => f\n\t[object_name] => ZZ\n\t[object_desc] => newest test mar 1\n\t[model_type] => MTREE\n\t[string_type] => \n\t[pixel_count] => 50\n\t[folds] => 50\n\t[pixel_first] => 1\n\t[pixel_last] => 50\n\t[pixel_length] => 200.00\n\t[unit_of_measure] => in\n\t[total_strings] => 24\n\t[direction] => \n\t[orientation] => 0\n\t[topography] => UP_DOWN_NEXT\n\t[topography] => BOT_TOP\n\t[h1] => 120.00\n\t[h2] => 0.00\n\t[d1] => 40.00\n\t[d2] => 0.00\n\t[d3] => 0.00\n\t[d4] => 0.00\n\t)\n\t*/\n\t//\t\n\t$query =\"select * from models where username='$username' and object_name='$model_name'\";\n\t$result=mysql_query($query) or die(\"<b>A fatal MySQL error occured</b>.\\n<br />Query: \" . $query . \"<br />\\nError: (\" . mysql_errno() . \") \" . mysql_error()); \n\tif(!$result){\n\t\t$message = 'Invalid query: ' . mysql_error() . \"\\n\";\n\t\t$message .= 'Whole query: ' . $query;\n\t\tdie($message);\n\t}\n\t$NO_DATA_FOUND=0;\n\tif(mysql_num_rows($result) == 0){\n\t\t$NO_DATA_FOUND=1;\n\t}\n\t$query_rows=array();\n\t// While a row of data exists, put that row in $row as an associative array\n\t// Note: If you're expecting just one row, no need to use a loop\n\t// Note: If you put extract($row); inside the following loop, you'll\n\t// then create $userid, $fullname, and $userstatus\n\t//\n\tif(!isset($folds)) $folds=1;\n\tif($folds<1) $folds=1;\n\twhile($row = mysql_fetch_assoc($result)){\n\t\textract($row);\n\t}\n\t$pixel_count_even=$folds * intval($pixel_count/$folds); // this is the total pixels that are evenly divisible.\n\tif($folds==1){\n\t\t$maxPixels=$pixel_count;\n\t\t$maxStrands=$total_strings;\n\t}\n\telse{\n\t\t$maxPixels = intval($pixel_count/$folds); // \n\t\t$maxStrands=intval(0.5+($total_strings*$pixel_count)/$maxPixels);\n\t\tif(strtoupper($start_bottom)=='Y'){\n\t\t\t$maxStrands=intval(0.5 + ($total_strings*$pixel_count_even)/$maxPixels);\n\t\t}\n\t}\n\t//\techo \"pixel_count=$pixel_count, pixel_count_even=$pixel_count_even, maxStrands=$maxStrands, maxPixels=$maxPixels</pre>\";\n\t$return_array[0]=$maxStrands;\n\t$return_array[1]=$maxPixels;\n\t$return_array[2]=$model_type;\n\treturn $return_array;\n}", "function getModel($model)\n{\n $models = [];\n /* $models['Address'] = new Address;\n $models['Agency'] = new Agency;\n $models['AgencyBranch'] = new AgencyBranch;\n $models['AgencySolicitorPartnership'] = new AgencySolicitorPartnership;\n $models['Cache'] = new Cache;\n $models['ConveyancingCase'] = new ConveyancingCase;\n $models['User'] = new User;\n $models['UserAddress'] = new UserAddress;\n $models['UserPermission'] = new UserPermission;\n $models['UserRole'] = new UserRole;*/\n $models['TargetsAgencyBranch'] = new TargetsAgencyBranch;\n return $models[$model];\n}", "function dCost($i,$j){\n\t\t\t\treturn $GLOBALS[\"diagCostsTable\"][$i][$j];\n\t\t\t}", "public function getCost()\n {\n return $this->get(self::_COST);\n }", "function costEstimation()\n {\n return $this->hasOne('App\\CostEstimation')->where(['isactive' => 1]);\n }" ]
[ "0.6441135", "0.6173662", "0.60810155", "0.6068854", "0.5973467", "0.594401", "0.59191006", "0.57530713", "0.57348126", "0.5643641", "0.5623484", "0.56046253", "0.55899996", "0.5576606", "0.55431503", "0.5489911", "0.54556817", "0.5444968", "0.5442407", "0.5439247", "0.54386044", "0.54301053", "0.5408218", "0.53922635", "0.5372855", "0.5344261", "0.53437626", "0.533622", "0.5334882", "0.53106964" ]
0.71803933
0
08.26.2015 ghh added to make sure nothing nasty can be sent through any of the vars given to merx.
function safetycheck( $vars, $responsetype ) { //08.26.2015 ghh - first we figure out if we're dealing with get or //post because we can work directly with get but need to convert post //from json object if ( $responsetype == 'get' ) { foreach ( $vars as $v ) $temp[] = addslashes( $v ); return $temp; } else { return $vars; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _pog($v) {\r\n return isset($_POST[$v]) ? bwm_clean($_POST[$v]) : (isset($_GET[$v]) ? bwm_clean($_GET[$v]) : NULL);\r\n}", "function check_required_vars($params = array())\n\t{\n\t\tglobal $SID, $phpEx, $data;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (empty($data[$param]))\n\t\t\t{\n\t\t\t\tredirect(append_sid(\"garage.$phpEx?mode=error&EID=3\", true));\n\t\t\t}\n\t\t}\n\n\t\treturn ;\n\t}", "function rescue_shortened_post_request()\n{\n global $MODSECURITY_WORKAROUND_ENABLED;\n if ($MODSECURITY_WORKAROUND_ENABLED) {\n return;\n }\n\n $setting_value = mixed();\n $setting_name = mixed();\n foreach (array('max_input_vars', 'suhosin.post.max_vars', 'suhosin.request.max_vars') as $setting) {\n if ((is_numeric(ini_get($setting))) && (intval(ini_get($setting)) > 10)) {\n $this_setting_value = intval(ini_get($setting));\n if (($setting_value === null) || ($this_setting_value < $setting_value)) {\n $setting_value = $this_setting_value;\n $setting_name = $setting;\n }\n }\n }\n\n if (($setting_value !== null) && ($setting_value > 1/*sanity check*/)) {\n if ((count($_POST) >= $setting_value - 5) || (array_count_recursive($_POST) >= $setting_value - 5)) {\n if ((has_zone_access(get_member(), 'adminzone')) || (running_script('upgrader'))) {\n $post = parse_raw_http_request();\n if ($post !== null) {\n $_POST = $post;\n return;\n }\n }\n\n warn_exit(do_lang_tempcode('_SUHOSIN_MAX_VARS_TOO_LOW', escape_html($setting_name)));\n }\n }\n}", "protected function wrong_arguments() {\n\t\t\twp_die();\n\t\t}", "private static function checkRequest(): void\n {\n if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {\n Core::fatalError(__('GLOBALS overwrite attempt'));\n }\n\n /**\n * protect against possible exploits - there is no need to have so much variables\n */\n if (count($_REQUEST) <= 1000) {\n return;\n }\n\n Core::fatalError(__('possible exploit'));\n }", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }", "function c_request($varstipus,$origen,$strict=false)\n{\n\tif (!is_array($origen))\t{$origen=merge_request($origen);} \t//en comptes d'un array, passa PG o similar \n\n\t$pattern=array('REAL'=>\"/[^0-9\\.-]/\",'CHAR'=>\"/[^A-Za-z0-9_\\-\\.]/\",'STRING'=>\"/\\\"|'/\");\n\t$varstipus=explode(\",\",$varstipus);\n\tforeach ($varstipus as $vargrup)\n\t{\n\t\t$vargrup=explode(\"=>\",$vargrup);\n\t\t$vars=explode(\"|\",$vargrup[0]);\n\t\t$tipus=trim(strtoupper($vargrup[1]));\n\n\t\tforeach ($vars as $var)\n\t\t{\n\t\t\t$var=trim($var);\n\t\t\tif (isset($origen[$var]))\n\t\t\t{\n\t\t\t\tswitch($tipus)\n\t\t\t\t{\n\t\t\t\t\tcase 'INT':\t//nomès numeros enters\n\t\t\t\t\t\t$origen[$var]=(int)$origen[$var];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'MQ':\n\t\t\t\t\t\t$origen[$var]=MQ($origen[$var]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'REAL': //numeros decimals i negatius\n\t\t\t\t\tcase 'CHAR': //nomes texte i números\n\t\t\t\t\tcase 'STRING': //eliminar cometes\n\t\t\t\t\t\t$origen[$var]=preg_replace($pattern[$tipus], $strict?\"_\":\"\", $origen[$var]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\n\t\t\t}\n\t\t}\n\t}\n\treturn $origen;\n}", "function strict() {\r\n\t\treturn true;\r\n\t}", "function process_str_vars($params = array())\n\t{\n\t\tglobal $HTTP_POST_VARS, $HTTP_GET_VARS;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (!empty($HTTP_POST_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_POST_VARS[$param])));\n\t\t\t}\n\t\t\telse if (!empty($HTTP_GET_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_GET_VARS[$param])));\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "function repeatVars() {\n\treturn false;\n}", "function cc_post_fail_if_not_valid( $var ) {\n\tif ( !cc_post_is_valid( $var ) ) {\n\t\tthrow new IllegalSuperglobalException( $var, '_POST',\n\t\t\t\t\t\t PostVariables::val() );\n\t}\n}", "function input_check_mailinj($value, $sendto)\n{\n # mail adress(ess) for reports...\n $report_to = $sendto;\n\n # array holding strings to check...\n $suspicious_str = array\n (\n\t \"content-type:\"\n\t ,\"charset=\"\n\t ,\"mime-version:\"\n\t ,\"multipart/mixed\"\n\t ,\"bcc:\"\n );\n\n // remove added slashes from $value...\n $value = stripslashes($value);\n\n //SETUP REPLY EMAIL ADDRESS\n $fifth = '-f ' . $report_to;\n\n //SETUP THE FROM ADDRESS\n $headers = \"From: <\" . $report_to . \">\\n\";\n $headers .= \"MIME-Version: 1.0\\n\";\n $headers .= \"Content-type: text/plain; charset=iso-8859-1\\r\\n\";\n $email_body = '<table width=\"100%\" border=\"0\"\n cellspacing=\"0\" cellpadding=\"0\"\nstyle=\"font-family:Vivaldi;font-size:12px;text-align:left\">'.\"\\n\";\n\n\n foreach($suspicious_str as $suspect)\n {\n\t # checks if $value contains $suspect...\n\t if(eregi($suspect, strtolower($value)))\n\t {\n\t\t // replace this with your own get_ip function...\n\t\t $ip = (empty($_SERVER['REMOTE_ADDR'])) ? 'empty'\n\t\t\t : $_SERVER['REMOTE_ADDR'];\n\t\t $rf = (empty($_SERVER['HTTP_REFERER'])) ? 'empty'\n\t\t\t : $_SERVER['HTTP_REFERER'];\n\t\t $ua = (empty($_SERVER['HTTP_USER_AGENT'])) ? 'empty'\n\t\t\t : $_SERVER['HTTP_USER_AGENT'];\n\t\t $ru = (empty($_SERVER['REQUEST_URI'])) ? 'empty'\n\t\t\t : $_SERVER['REQUEST_URI'];\n\t\t $rm = (empty($_SERVER['REQUEST_METHOD'])) ? 'empty'\n\t\t\t : $_SERVER['REQUEST_METHOD'];\n\n\t\t # if so, file a report...\n\t\t if(isset($report_to) && !empty($report_to))\n\t\t {\n\t\t\t @mail\n\t\t\t (\n\t\t\t\t\t $report_to\n\t\t\t\t ,\"[ABUSE] mailinjection @ \" .\n\t\t\t\t $_SERVER['HTTP_HOST'] . \" by \" . $ip\n\t\t\t\t ,\"Stopped possible mail-injection @ \" .\n\t\t\t\t $_SERVER['HTTP_HOST'] . \" by \" . $ip .\n\t\t\t\t \" (\" . date('d/m/Y H:i:s') . \")\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** IP/HOST\\r\\n\" . $ip . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** USER AGENT\\r\\n\" . $ua . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** REFERER\\r\\n\" . $rf . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** REQUEST URI\\r\\n\" . $ru . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** REQUEST METHOD\\r\\n\" . $rm . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** SUSPECT\\r\\n--\\r\\n\" . $value . \"\\r\\n--\"\n\t\t\t\t\t , $headers, $fifth\n\t\t\t );\n\t\t }\n\n\t\t # ... and kill the script.\n\t\t die\n\t\t (\n\t\t\t '<p>Script processing cancelled: string\n\t\t\t (`<em>'.$value.'</em>`) contains text portions that\n\t\t\t are potentially harmful to this server. <em>Your input\n\t\t\t has not been sent!</em> Please try\n\t\t\t rephrasing your input.</p>'\n\t\t );\n\t }\n }\n}", "function strict() {\n return false;\n }", "function extraVars() {\n\t\tif (func_num_args()) {\n\t\t\tif (is_array(func_get_arg(0))) {\n\t\t\t\t$this->_extraVars = func_get_arg(0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->_extraVars = array(func_get_arg(0)=>'');\n\t\t\t}\t\t\t\n\t\t}\n\t\telse return $this->_extraVars;\n\t}", "function check_all_incomming_vars($request_array, $save_name = null) {\n//checks all the incomming vars\n// V0.8 forces the use of an non empty array\n// if (empty($request_array)) {\n// $request_array = $_REQUEST;\n// } else {\n if (!is_array($request_array)) {\n die(__FUNCTION__ . \" need an array to work\");\n }\n// }\n $form = array();\n foreach ($request_array as $index => $value) {\n if (!is_array($value)) {\n $form[$index] = \\k1lib\\forms\\check_single_incomming_var($value);\n } else {\n $form[$index] = check_all_incomming_vars($value);\n }\n }\n if (!empty($save_name)) {\n \\k1lib\\common\\serialize_var($form, $save_name);\n }\n return $form;\n}", "function fix_request(){\n\t$var=array();\n\tforeach($_GET as $k=>$v){\n//\t\tif(!is_array($v)){\n//\t\t\tforeach($filtros as $filtro){\n//\t\t\t\t$v=str_replace(trim($filtro),'',$v);\n//\t\t\t}\n//\t\t\t$_GET[$k]=$v;\n\t\t\t$var[$k]=$v;\n//\t\t}\n\t}\n\tforeach($_POST as $k=>$v){\n//\t\tif(!is_array($v)){\n//\t\t\tforeach($filtros as $filtro){\n//\t\t\t\t$v=str_replace(trim($filtro),'',$v);\n//\t\t\t}\n//\t\t\t$_POST[$k]=$v;\n\t\t\t$var[$k]=$v;\n//\t\t}\n\t}\n\t$_REQUEST=$var;\n}", "private function reworkArgs() {\n $this->functionArgs = array_diff(self::goodSplit($this->functionArgs, ','), array(''));\n }", "function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }", "Public function validateHacker($var)\n\t\t{\n\t\t\t$CadenasProhibidas = array(\"Content-Type:\",\n\t\t\t\"MIME-Version:\", //evita email injection\n\t\t\t\"Content-Transfer-Encoding:\",\n\t\t\t\"Return-path:\",\n\t\t\t\"Subject:\",\n\t\t\t\"From:\",\n\t\t\t\"Envelope-to:\",\n\t\t\t\"To:\",\n\t\t\t\"bcc:\",\n\t\t\t\"cc:\",\n\t\t\t\"UNION\", // evita sql injection\n\t\t\t\"DELETE\",\n\t\t\t\"DROP\",\n\t\t\t\"SELECT\",\n\t\t\t\"INSERT\",\n\t\t\t\"UPDATE\",\n\t\t\t\"CRERATE\",\n\t\t\t\"TRUNCATE\",\n\t\t\t\"ALTER\",\n\t\t\t\"INTO\",\n\t\t\t\"DISTINCT\",\n\t\t\t\"GROUP BY\",\n\t\t\t\"WHERE\",\n\t\t\t\"RENAME\",\n\t\t\t\"DEFINE\",\n\t\t\t\"UNDEFINE\",\n\t\t\t\"PROMPT\",\n\t\t\t\"ACCEPT\",\n\t\t\t\"VIEW\",\n\t\t\t\"COUNT\",\n\t\t\t\"HAVING\",\n\t\t\t\n\t\t\t\"'\",\n\t\t\t'\"',\n\t\t\t\"{\",\n\t\t\t\"}\",\n\t\t\t\"[\",\n\t\t\t\"]\",\n\t\t\t\"HOTMAIL\", // evita introducir direcciones web\n\t\t\t\"WWW\",\n\t\t\t\".COM\",\n\t\t\t\"@\",\n\t\t\t\"W W W\",\n\t\t\t\". c o m\",\n\t\t\t\"http://\",\n\t\t\t\"$\", //variables y comodines\n\t\t\t\"&\",\n\t\t\t\"*\"\n\t\t\t); \n\t\t\t//Comprobamos que entre los datos no se encuentre alguna de \n\t\t\t//las cadenas del array. Si se encuentra alguna cadena se \n\t\t\t//dirige a una página de Forbidden \n\t\t\t$vandera=\"\";\n\t\t\tforeach($CadenasProhibidas as $valor)\n\t\t\t{ \n\t\t\t\tif((strpos(strtolower($var), strtolower($valor)) !== false))\n\t\t\t\t{ \n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function checkAllParams(){\n\t\tif(isset($_REQUEST['appid'][100]) || isset($ref[1000]) || isset($_REQUEST['uid'][200]) ){\n\t\t\tthrow new Exception('paramater length error',10001);\n\t\t}\n\t\tif(isset($_REQUEST['ref']))$_REQUEST['ref']=substr($_REQUEST['ref'], 0,990);\n\t\t\n\t\tif(!$this->check(\"appid\",$_REQUEST['appid']) && !isset($_REQUEST['json'])){\n\t\t\t//ea_write_log(APP_ROOT.\"/error_log/\".date('Y-m-d').\".log\", \"error_appid=\".$_REQUEST['appid'].\" \".$_REQUEST['event'].\" \".$_REQUEST['logs'].\" \\n\");\n\t\t\tthrow new Exception('appid error',10001);\n\t\t}\n\t\t\n\t\t$_REQUEST['appid']=strtolower($_REQUEST['appid']);\n\t\t$this->appidmap();\n\t}", "function sanitization_allowed() {\n\n\t$foo = (int) $_POST['foo']; // OK.\n\t$bar = sanitize_key( $_POST['bar'] ); // OK.\n\n\tcheck_ajax_referer( \"something-{$foo}-{$bar}\" );\n}", "function _postn($v) {\r\n $r = isset($_POST[$v]) ? bwm_clean($_POST[$v]) : '';\r\n return $r == '' ? NULL : $r;\r\n}", "function pred(...$vars)\n {\n pre(...$vars);\n die();\n }", "function fix() ;", "function prepare_vars_for_template_usage()\n {\n }", "function yy_r139()\n {\n if ($this->security && substr($this->yystack[$this->yyidx + - 3]->minor, 0, 1) == '_') {\n $this->compiler->error(self::Err1);\n }\n $this->_retvalue = $this->yystack[$this->yyidx + - 3]->minor . \"(\" . implode(',', $this->yystack[$this->yyidx + - 1]->minor) . \")\";\n }", "function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}", "function required_param($parname, $type=PARAM_CLEAN, $errMsg=\"err_param_requis\") {\n\n // detect_unchecked_vars addition\n global $CFG;\n if (!empty($CFG->detect_unchecked_vars)) {\n global $UNCHECKED_VARS;\n unset ($UNCHECKED_VARS->vars[$parname]);\n }\n\n if (isset($_POST[$parname])) { // POST has precedence\n $param = $_POST[$parname];\n } else if (isset($_GET[$parname])) {\n $param = $_GET[$parname];\n } else {\n erreur_fatale($errMsg,$parname);\n }\n // ne peut pas �tre vide !!! (required)\n $tmpStr= clean_param($param, $type); //PP test final\n // attention \"0\" est empty !!!\n\n if (!empty($tmpStr) || $tmpStr==0) return $tmpStr;\n else erreur_fatale(\"err_param_suspect\",$parname.' '.$param. \" \".__FILE__ );\n\n\n}", "function remove_unexpected_superglobals($superGlobal, $allowedKeys) {\n foreach ($superGlobal as $key => $val) {\n if (!in_array($key, $allowedKeys))\n unset($superGlobal[$key]);\n }\n return $superGlobal;\n}" ]
[ "0.57345164", "0.5489058", "0.54833275", "0.5301775", "0.51588583", "0.51447517", "0.5101529", "0.5092761", "0.5090717", "0.50822395", "0.5080333", "0.5054584", "0.5025061", "0.5022579", "0.4995433", "0.49929854", "0.49758363", "0.4968213", "0.49509832", "0.494796", "0.49463856", "0.49400496", "0.49302042", "0.49246457", "0.49160215", "0.49159676", "0.49009994", "0.48968965", "0.48897523", "0.48892316" ]
0.5887516
0
08.26.2015 ghh this function retrieves shipvendor name and returns it
function getShipVendorName( $shipvendorid ) { global $db; $query = "select ShipVendorName from ShippingVendors where ShipVendorID=$shipvendorid"; if (!$tmpresult = $db->sql_query($query)) { RestLog("Error 16601 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500, "16601 - There was a problem getting shipping vendor"); //Internal Server Error return false; } $shiprow = $db->sql_fetchrow( $tmpresult ); return $shiprow['ShipVendorName']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVendorName(): string;", "function getVendorname(){\r\n return $this->vendorname;\r\n }", "public function getShipname()\n {\n return $this->shipname;\n }", "public function getVendorName(): string\n {\n return 'local';\n }", "public function getShipName()\n {\n $ship = $this->pKShip->ShipNumber . \" \" . $this->pKShip->ShipName;\n return $ship;\n }", "public function getVendor()\n {\n return $this->_coreRegistry->registry('current_vendor');\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function GetVendorShippingContact($SuppID,$ShipId='')\r\n\t{\r\n\t\t$AddType='shipping';\t\t\r\n\t\t \r\n\t\t$strAddQuery .= \" and ( ab.Status='1' or ab.Status='0')\";\r\n\t\t$strAddQuery .= (!empty($ShipId))?(\" and ab.AddID='\".$ShipId.\"'\"):(\"\");\t \r\n\r\n\t\t$strSQLQuery = \"SELECT s.CompanyName, ab.* FROM p_address_book ab inner join p_supplier s on ab.SuppID=s.SuppID WHERE ab.SuppID='\".$SuppID.\"' AND ab.AddType = '\".$AddType.\"' \".$strAddQuery.\" order by Status Desc\";\r\n\t\treturn $this->query($strSQLQuery, 1);\r\n\t}", "function getVendorId($vendor_name)\n\t{\n\t\t global $log;\n $log->info(\"in getVendorId \".$vendor_name);\n\t\tglobal $adb;\n\t\tif($vendor_name != '')\n\t\t{\n\t\t\t$sql = \"select vendorid from ec_vendor where vendorname='\".$vendor_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$vendor_id = $adb->query_result($result,0,\"vendorid\");\n\t\t}\n\t\treturn $vendor_id;\n\t}", "public function GetVendor()\n\t{\n\t\treturn $this->vendor;\n\t}", "public function getVendorId() {}", "public function column_vendor( $request ) {\n\t\t$vendor = get_post_meta( $request->ID, '_camppayments_vendor_name', true );\n\t\treturn $vendor;\n\t}", "public function getVendorName($uid=''){\r\n if($uid != ''){\r\n $userDetail = $this->CI->DatabaseModel->access_database('ts_user','select','',array('user_id'=>$uid));\r\n if(!empty($userDetail)) {\r\n $uname = $userDetail[0]['user_uname'];\r\n $p = strtolower($uname);\r\n return $p;\r\n }\r\n else {\r\n return '0';\r\n }\r\n }\r\n else {\r\n return '0';\r\n }\r\n die();\r\n\t}", "public function getVendorCode()\n {\n return $this->vendorCode;\n }", "public function getIosVendorId();", "function MacVendor($mac_address) {\n $url = \"https://macvendors.co/api/vendorname/\" . urlencode($mac_address);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $response = curl_exec($ch);\n\n // $macprovider = 'UNKNOWN';\n if($response) {\n $macprovider = $response;\n } \n \n return $macprovider;\n }", "public function getVendorPartNumber(): string\n {\n return $this->vendorPartNumber;\n }", "public function getVendorId(): ?string;", "protected function _getClientName() {\n //return \"TEST STRING\";\n $mageVersion = Mage::getVersion();\n $mageVerParts = explode('.', $mageVersion, 2);\n\n $opVersion = Mage::getResourceModel('core/resource')->getDbVersion('upop_setup');\n $opVerParts = explode('.', $opVersion, 2);\n\n $part = array();\n $part[] = self::CONFIG_KEY;\n $part[] = $mageVerParts[0];\n $part[] = $mageVerParts[1];\n $part[] = self::APP_NAME;\n $part[] = $opVerParts[0];\n $part[] = $opVerParts[1];\n return implode(',', $part);\n }", "function wac_vendor_name($user){\n\t$firstname = get_user_meta($user->ID,'first_name',true);\n\t$lastname = get_user_meta($user->ID,'last_name',true);\n\t\n\t$fullName = $user->data->user_nicename;\n\tif(!empty($firstname)){\n\t\t$fullName = trim($firstname.' '.$lastname);\n\t}\n\treturn $fullName;\n}", "public function getFieldId()\n {\n \treturn 'product_vendor';\n }", "public function getShipmentName()\n {\n return $this->_fields['ShipmentName']['FieldValue'];\n }", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function getShipcom()\n {\n return $this->shipcom;\n }", "public function getShipToLastName();", "public function getGoodsName()\n {\n return $this->goods_name;\n }", "public function getGoodsName()\n {\n return $this->goods_name;\n }", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "public function getProduct_name () {\n\t$preValue = $this->preGetValue(\"product_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_name;\n\treturn $data;\n}" ]
[ "0.7136825", "0.7092398", "0.6576986", "0.6573904", "0.64686435", "0.64611036", "0.6413736", "0.63894826", "0.6336757", "0.61387306", "0.6106339", "0.6106332", "0.60968894", "0.6019106", "0.5995813", "0.5941029", "0.5828133", "0.58256876", "0.5783472", "0.5782342", "0.57806104", "0.5768989", "0.5759349", "0.5743253", "0.57425153", "0.5718628", "0.5718628", "0.57082796", "0.57082796", "0.5700924" ]
0.8080949
0
returns array with all values from a given section
public function getSection($section) { $data=[]; foreach($this->settings AS $name=>$settingData) { if($section===$settingData['section']) { $data[$name]=$this->get($name); } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getData($section = null)\n {\n $config = Config::getInstance();\n\n if(!$section)\n return $config->data;\n else\n {\n $values = array();\n\n foreach($config->data as $key => $value)\n if(strtolower($section) == strtolower($key))\n $values[] = $value;\n\n return $values;\n }\n }", "public function read($section) {\n $values = parent::read($section);\n\n switch ($section) {\n case 'smarty':\n if (!array_key_exists('compile', $values)) {\n $values['compile'] = array();\n }\n\n $values['compile']['directory'] = Module::getTempDirectory('smarty')->getPath();\n\n break;\n case 'system':\n if (!array_key_exists('session', $values)) {\n $values['session'] = array();\n }\n\n $values['session']['path'] = Module::getTempDirectory('session')->getPath();\n\n break;\n }\n\n return $values;\n }", "protected function getModuleArray($section) {\n $config = $this->getModuleConfig();\n $return = array();\n\n if ($data = $config->getSection($section)) {\n $fields = array_keys($data);\n \n for ($i=0; $i<count($data[$fields[0]]); $i++) {\n $item = array();\n foreach ($fields as $field) {\n $item[$field] = $data[$field][$i];\n }\n $return[] = $item;\n }\n } \n \n return $return;\n }", "public function getSectionFull($section) {\n $data=[];\n\n foreach($this->settings AS $name=>$settingData) {\n if($section===$settingData['section']) {\n $data[$name]=$this->getFull($name);\n }\n }\n\n return $data;\n }", "private function get_section_data() {\n\t\t$sections = apply_filters( 'toolset_get_troubleshooting_sections', array() );\n\t\t\n\t\tif( !is_array( $sections ) ) {\n\t\t\t$sections = array();\n\t\t}\n\t\t\n\t\treturn $sections;\n\t}", "public function get_section()\n\t\t{\n\t\t\t$retArr = null;\n\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->find_all();\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$retArr[] = $obj->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t}", "public function getSections(): array {\n\t\t\n\t\tif (isset($this->sections)) {\n\t\t\treturn $this->sections;\n\t\t}\n\t\t\n\t\t$this->sections = [];\n\t\t\n\t\t$sections = elgg_extract('sections', $this->config, []);\n\t\tforeach ($sections as $section) {\n\t\t\t$this->sections[] = new Section($section);\n\t\t}\n\t\t\n\t\treturn $this->sections;\n\t}", "public function getSections()\r\n {\r\n $sql=\"SELECT * FROM sections\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }", "public function GetKeys($section)\n {\n $result = [];\n $tmpArray = Util::GetAttribute($this->vars, $section, []);\n foreach ($tmpArray as $key => $value) {\n $newValue = $this->Get($section, $key, \"\");\n $result[ $key ] = $newValue;\n }\n return $result;\n }", "public function GetAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetKeys($key);\n }\n return $result;\n }", "public function get_sections() {\n\n $sections = [];\n\n foreach( $this->options as $key => $value ){\n\n if( isset($value['sections']) ) {\n foreach( $value['sections'] as $section ) {\n\n if( isset($section['fields']) ) {\n $sections[] = $section;\n }\n\n }\n }else {\n if( isset( $value['fields'] ) ) {\n $sections[] = $value;\n }\n }\n\n }\n\n return $sections;\n\n }", "public function getArticlesBySection(string $section): array {\n\t\t$selected = [];\n\t\t$q = $this->pdo->prepare(\"SELECT \".$this->columns.\" from `articles` WHERE `ArticleSection` LIKE :section\");\n\t\t$q->bindValue(\":section\", \"%\\\"\".$section.\"\\\"%\", PDO::PARAM_STR);\n\t\t$q->execute();\n\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t$sections = json_decode($a[\"ArticleSection\"], true);\n\t\t\tforeach($sections as $s){\n\t\t\t\t$article = $this->makeArticleFromDB($a);\n\t\t\t\tif(mb_strtolower($section) == mb_strtolower($s) && !in_array($article, $selected, true)){\n\t\t\t\t\t$selected[] = $article;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $selected;\n\t}", "public function get_all_sections() {\n\t\t$sql = \"SELECT section_id FROM peducator_sections \n\t\tWHERE peducator_id='$this->peducator_id'\";\n\t\t$result = mysqli_query($this->connect_to_db, $sql);\n\n\t\t$arr = [];\n\t\twhile ($row = mysqli_fetch_array($result)) {\n\t\t\tarray_push($arr, get_section($row['section_id']));\n\t\t}\n\n\t\treturn $arr;\t\n\t}", "public function to_array() {\n\t\t$config = array();\n\t\t\n\t\tforeach( $this->sections as $id => $section ) {\n\t\t\t$config[$id] = $section->to_array();\n\t\t}\n\t\t\n\t\treturn $config;\n\t}", "function spr_get_sections() {\n\tglobal $spr_sql_fields;\n\n\t$sql_tables = safe_pfx('txp_section');\n\t$rs = safe_query(\"SELECT \".$spr_sql_fields.\" FROM \".$sql_tables.\" WHERE name != 'default' ORDER BY name\");\n\twhile ($a = nextRow($rs)) {\n\t\textract($a); // set 'name','title','parent' etc in $a\n\t\t$out[$name] = $a;\n\t}\n\treturn $out;\n}", "public function get_main_sections($section) {\n\t\t$query = $this->CI->db->select()->from('settings')\n\t\t\t->where([\n\t\t\t\t'section' => $section . '-main'\n\t\t\t])\n\t\t\t->order_by('order asc')\n\t\t\t->get();\n\n\t\t$result = [];\n\n\t\tforeach ($query->result() as $row) {\n\t\t\t$result[] = $row;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function GetRawKeys($section)\n {\n $result = [];\n $tmpArray = Util::GetAttribute($this->vars, $section, []);\n foreach ($tmpArray as $key => $value) {\n $newValue = $this->GetRaw($section, $key, \"\");\n $result[ $key ] = $newValue;\n }\n return $result;\n }", "public function __allSections()\n\t{\n\t\t//current user course\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t$sectionList = array();\n\t\t//getting the course in section/all section setting(changed on 16 April, 2014)\n\t $setting = $this->__getDbSetting($user_course_section);\n\t\tif ($setting == 2) {\n\t\t\t$sections = $this->PleSetting->find('all',array('conditions'=>array('PleSetting.course'=>$course_name,'PleSetting.setting_value'=>2),'fields'=>array('section')));\n\t\t\tforeach ($sections as $section) {\n\t\t\t\t$sectionList[] = trim($section['PleSetting']['section']);\n\t\t\t}\n\t\t\t$sectionList[] = $course_section;\n\t } else {\n\t\t\t//add current user login section\n\t\t\t$sectionList[] = $course_section;\n\t }\n\t\t$tz = array_unique($sectionList);\n\t\treturn $tz;\n\t}", "public function getSections(): iterable;", "function getSection($sectionID,$attr='VALUE') {\n \n // uppercase varAttr\n $attr = strtoupper($attr);\n \n if (($sectionID == '')&&(sizeof($this->varList)>1)) {\n // combine all sectionID's (pretend no sectionID's)\n $allID = array();\n\n // foreach sectionID...\n foreach ($this->varList as $secID=>$secVal) {\n\n // get the vars in this sectionID\n $varList = array_keys($secVal);\n\n // for each var in this section..\n foreach ($varList as $varKey) {\n\n if (isset($allID[$varKey])) {\n // add values\n $allID[$varKey] = array_merge((array)$allID[$varKey],(array)$this->getVarAttr($secID, $varKey, $attr));\n }\n else {\n // set value\n $allID[$varKey] = $this->getVarAttr($secID, $varKey, $attr);\n }\n }\n }\n return $allID;\n }\n else {\n\n // either specified sectionID or there was only one anyway\n\n // default sectionID\n if ($sectionID == '')\n $sectionID = 'default';\n\n // if it's there, gather all VALUE attributes from all VAR tags in this section\n if (isset($this->varList[$sectionID])) {\n foreach ($this->varList[$sectionID] as $varKey => $varTag) {\n if (is_array($varTag)) {\n foreach ($varTag as $varObj) {\n $sectionArray[$varKey][] = $varObj->getAttr($attr);\n }\n }\n else {\n $sectionArray[$varKey] = $varTag->getAttr($attr);\n }\n }\n return $sectionArray;\n }\n else { \n // otherwise, not found.\n SM_debugLog(\"getSection ($this->sectionName): requested sectionID [$sectionID] wasn't found: ignoreing\",$this,1);\n return NULL;\n }\n }\n }", "public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }", "private function getSections() {\n\t\t$sections = array();\n\t\tforeach (Craft::$app->getSections()->getEditableSections() as $section) {\n\t\t\t$sections[$section->id] =['value'=>$section->handle, 'label' =>Craft::t('site',$section->name)];\n\t\t}\n\t\treturn $sections;\n\t}", "public function getSections(): array\n {\n return $this->sections;\n }", "public function GetSections()\n {\n return array_keys($this->vars);\n }", "function c_ini_data($filename,$process_sections=false)\r\n {\r\n\r\n if (file_exists($filename))\r\n {\r\n $output = parse_ini_file($filename,$process_sections);\r\n return (array) $output;\r\n }\r\n else\r\n {\r\n trigger_error($filename.' configuration file not found.');\r\n }\r\n\r\n }", "public function getDataStructure()\n\t{\n\t\t$sections = [];\n\t\tforeach($this->sections as $section) {\n\t\t\t$sections[] = [\n\t\t\t\t'name' => $section['name'],\n\t\t\t\t'blocks' => []\n\t\t\t];\n\t\t}\n\t\treturn $sections;\n\t}", "public function read($section);", "public function getSection($userId = null, $section = null) {\n\t\t$conditions = array(\n\t\t\t\"{$this->alias}.user_id\" => $userId);\n\n\t\tif (!is_null($section)) {\n\t\t\t$conditions[\"{$this->alias}.field LIKE\"] = $section . '.%'; \n\t\t}\n\n\t\t$results = $this->find('all', array(\n\t\t\t'recursive' => -1,\n\t\t\t'conditions' => $conditions,\n\t\t\t'fields' => array(\"{$this->alias}.field\", \"{$this->alias}.value\")));\n\n\t\tif (!empty($results)) {\n\t\t\tforeach($results as $result) {\n\t\t\t\tlist($prefix, $field) = explode('.', $result[$this->alias]['field']);\n\t\t\t\t$userDetails[$prefix][$field] = $result[$this->alias]['value'];\n\t\t\t}\n\t\t\t$results = $userDetails;\n\t\t} else {\n\t\t\t$this->createDefaults($userId);\n\t\t\t$results = array();\n\t\t}\n\t\treturn $results;\n\t}", "function get_trip_section_values($trip_section_id,$tbl){ \n\t\t$this->db->where('id',$trip_section_id);\n\t\t$qry=$this->db->get($tbl);\n\t\t\n\t\tif($qry->num_rows() > 0){\n\t\t\t$editable_values=$qry->row_array();\n\t\t\tif($tbl=='trip_accommodation' || $tbl=='package_accommodation'){ \n\t\t\t$this->db->select('hotel_category_id,destination_id');\n\t\t\t$this->db->where('id',$editable_values['hotel_id']);\n\t\t\t$this->db->from('hotels');\n\t\t\t$qry=$this->db->get()->row(); \n\t\t\t$editable_values['hotel_category_id']=$qry->hotel_category_id;\n\t\t\t$editable_values['destination_id']=$qry->destination_id;\n\t\t\t$editable_values['room_attributes']=unserialize($editable_values['room_attributes']);\n\t\t\t$editable_values['meals_package']=unserialize($editable_values['meals_package']);\n\t\t\t}\n\t\t\treturn $editable_values;\n\t\t}else{\n\t\t\treturn array();\n\t\t}\n\t}", "public function getSection() {\n try {\n $client = new SoapClient($this->SECTION_WSDL);\n $res = $client->findAllActiveSection();\n return $res;\n //print_r($res);\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }" ]
[ "0.69068193", "0.68180704", "0.6641202", "0.658758", "0.6574381", "0.6548997", "0.64513963", "0.6376657", "0.6373854", "0.63614976", "0.63369614", "0.6296561", "0.62773", "0.62386906", "0.6222597", "0.6219265", "0.62117183", "0.62105864", "0.618181", "0.61688817", "0.61688584", "0.61405104", "0.613825", "0.5985774", "0.5982826", "0.59642124", "0.5940617", "0.59401286", "0.5922427", "0.5874761" ]
0.7026429
0
fetches all options to cache
public function fetchAll() { $settings=$this->em->getRepository('CreavoOptionBundle:Setting')->findAll(); /** @var Setting $setting */ foreach($settings AS $setting) { $this->addToCache($setting); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCacheOptions();", "public function cacheOptions ()\n {\n\n foreach ( $this->optionsToPersist as $option ) {\n\n $this->optionsCache[ $option ] = $this->getOption ( $option );\n\n }\n\n }", "public \tfunction\tretrieveOptions() {\n\t\t\t//For each option category.\n\t\t\tforeach($this -> options as $category => $k) {\n\t\t\t\t//For each option. \n\t\t\t\tforeach ($this -> options[$category] as $key => $value) {\n\t\t\t\t\t//Set the option. \n\t\t\t\t\t$this -> options[$category][$key]\t\t=\tget_option($key);\n\t\t\t\t\t\n\t\t\t\t\t//If the option is serialized.\n\t\t\t\t\tif (is_serialized($this -> options[$category][$key])) {\n\t\t\t\t\t\t//Unserialize the option.\n\t\t\t\t\t\t$this -> options[$category][$key]\t=\t \n\t\t\t\t\t\tunserialize($this -> options[$category][$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function apc_cache_shunt_all_options($false) {\n\tglobal $ydb; \n\t\n\t$key = APC_CACHE_ALL_OPTIONS; \n\tif(apc_exists($key)) {\n\t\t$ydb->option = apc_fetch($key);\n\t\t$ydb->installed = apc_fetch(APC_CACHE_YOURLS_INSTALLED);\n\t\treturn true;\n\t} \n\t\n\treturn false;\n}", "public function doRetrieveAll(){\n\t\t\t$this->openConnection();\n\t\t\t$options=null;\n\n\t\t\t$query=\"SELECT flagList\n\t\t\t\t\tFROM options\";\n\t\t\t$result = $this->connessione->query($query);\n\t\t \n\t\t\twhile($row = $result->fetch_array(MYSQLI_ASSOC))\n\t\t\t{ \n\t\t\t\t\t$options=new ListOption();\n\t\t\t\t\t$options->setFlagList($row[\"flagList\"]);\n\t\t\t}\n\t\n\t\t\t$result->close();\n\t\t\t$this->closeConnection();\n\t\n\t\t\treturn $options;\n\t\t}", "private function get_caches () {\n $caches_slug = 'cache';\n return $this->get_option($caches_slug, array());\n }", "protected function readUserOptions() {\n\t\t// add cache resource\n\t\t$cacheName = 'user-option-'.PACKAGE_ID;\n\t\tWCF::getCache()->addResource($cacheName, WCF_DIR.'cache/cache.'.$cacheName.'.php', WCF_DIR.'lib/system/cache/CacheBuilderOption.class.php');\n\t\t\n\t\t// get options\n\t\t$this->options = WCF::getCache()->get($cacheName, 'options');\n\t}", "public function getAll($cache = true) {}", "protected function get_options()\n\t{}", "public function getAll()\n {\n return $this->options;\n }", "public function options_load();", "public function cache($options = true);", "function getOptions() ;", "private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }", "public function all() {\n\t\t$this->delete_all_plugin_options();\n\t\t$this->delete_all_user_metas();\n\t\t$this->delete_all_transients();\n\n\t\t// Clear options cache.\n\t\twp_cache_delete( 'alloptions', 'options' );\n\t}", "public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }", "public function all()\n\t{\n\t\treturn $this->options;\n\t}", "static function cached_all(){\n return static::get_cache();\n }", "private function getAllOptions() {\n return $this->config[$this->context];\n }", "public static function allCache() \n\t{\n\t return Cache::rememberforever('settings', function()\n\t {\n\t return Setting::all();\n\t });\n\t}", "function wp_load_alloptions($force_cache = \\false)\n {\n }", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function get_options()\n {\n }", "abstract public function getOptions();", "public function setCacheOptions($options);" ]
[ "0.7268947", "0.7268178", "0.68475544", "0.6625522", "0.6381333", "0.6301372", "0.6260428", "0.6176879", "0.60747427", "0.6051961", "0.60417885", "0.5985683", "0.59673333", "0.59346783", "0.59316635", "0.59224695", "0.59152085", "0.59088993", "0.58953696", "0.58949435", "0.58897567", "0.58759093", "0.58759093", "0.58749276", "0.5871927", "0.5871927", "0.5871699", "0.586164", "0.58525527", "0.5838556" ]
0.7315877
0
adds a setting to the cache
protected function addToCache(Setting $setting) { $this->settings[$setting->getName()]=$setting->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function storeCacheSetting()\n {\n Cache::forever('setting', $this->setting->getKeyValueToStoreCache());\n }", "function wp_cache_add($key, $value, $group = '', $expiration = 0)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->add($key, $value, $group, $expiration);\n}", "function wp_cache_add($key, $data, $flag = '', $expire = 0)\n{\n global $wp_object_cache;\n return $wp_object_cache->add($key, $data, $flag, $expire);\n}", "public function cache()\n {\n add_settings_field(\n 'cache',\n apply_filters($this->plugin_name . 'label-cache', esc_html__('Cache', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-library',\n [\n 'description' => 'Enable cacheing of your security.txt file.',\n 'id' => 'cache',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['cache']) ? $this->options['cache'] : false,\n ]\n );\n }", "function wp_cache_set($key, $value, $group = '', $expiration = 0)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->set($key, $value, $group, $expiration);\n}", "public function set($key, $value): CacheInterface;", "public function setValToCache($key, $value, $timeToCache = 0);", "function wp_cache_add($key, $data, $group = '', $expire = 0)\n {\n }", "protected function set_cache($value) {\n \t set_transient( $this->get_cache_id(), $value, $this->cache_time ); \t \t\n\t}", "public function enableCache() :void\n {\n Settings::setCache($this->cacheAdapter->buildCache());\n }", "function add($key, $pVal, $exp = 0) {\n\t\t\t$file = CACHE_DIR.md5($key).\".cache\";\n\t\t\tif(!file_exists($file)) {\n\t\t\t\treturn $this->set($key,$pVal,$exp);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}", "function object_cache_add($key, $data, $flag = '', $expire = 0) {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->add($key, $data, $flag, $expire);\n}", "public function setObjToCache($key, $value, $timeToCache = 0);", "public function setCache($token){\n \n $this->cacheStack->push($token);\n }", "function wp_cache_add($key, $data, $group = '', $expire = 0)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->add($key, $data, $group, (int) $expire);\n}", "public function storeSetting($setting,$key)\n\t{\n\t\t$this->settings[$key]=$setting;\n\t}", "public static function put ($key, $value){\t\t\n\t\tif (Setting::$cache[$key]==$value){\n\t\t\treturn $value;\n\t\t}\n\t\t$database = new database( _DB_SERVER, _DB_USER, _DB_PASS, _DB_NAME, '');\n\t\t$database->setQuery ( \"DELETE FROM setting WHERE name = '$key'\" );\n\t\tif (!$database->query ()){\n\t\t\thandle_error('unexpected database query failure ' . $database->getErrorNum() . \" error message :\" . $database->getErrorMsg());\n\t\t}\n\t\t\n\t\t$database->setQuery ( \"INSERT INTO setting (name, value) VALUES ('$key','$value')\" );\n\t\tif (!$database->query ()){\n\t\t\thandle_error('unexpected database query failure ' . $database->getErrorNum() . \" error message :\" . $database->getErrorMsg());\n\t\t}\n\t\t\n\t\tSetting::$cache[$key] = $value;\n\t\treturn Setting::$cache[$key];\n\t}", "protected function saveToCache() {}", "protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n }\n //cache_set($this->id, $data, 'cache');\n }", "public function storeSetting($setting, $key) {\n\t\t$this->settings[$key] = $setting;\n\t}", "public static function setCache($cache) {}", "public function setCache($url,$data){\n\t\t$hash = md5($url);\n\t\treturn apc_add($hash, $data, $this->expire_time);;\n\t}", "public function setCache()\n\t{\n\t\treturn CacheBot::set($this->getCacheKey(), $this->getDataToCache(), self::$objectCacheLife);\n\t}", "function register_setting($key, $value)\n{\n csSettings::set($key, $value);\n}", "function object_cache_set($key, $data, $flag = '', $expire = 0) {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->set($key, $data, $flag, $expire);\n}", "public function set($key, $value) {\n if (@apc_store($key, array('time' => time(), 'data' => serialize($value)), Shindig_ConfigGet('cache_time')) == false) {\n throw new CacheException(\"Couldn't store data in cache\");\n }\n }", "public function saveToCacheForever();", "private function storeInCache($name, $value)\n {\n if ($this->isCacheEnabled()) {\n $this->cache->setValue('conf_' . $name, $value);\n }\n }", "public function cache() {\n if(!array_key_exists($this->steamId64, self::$steamIds)) {\n self::$steamIds[$this->steamId64] = $this;\n if(!empty($this->customUrl) &&\n !array_key_exists($this->customUrl, self::$steamIds)) {\n self::$steamIds[$this->customUrl] = $this;\n }\n }\n }", "public static function setCache($caching)\n{\nself::$caching=$caching;\n}" ]
[ "0.7081158", "0.6737219", "0.65740365", "0.65041476", "0.6355629", "0.6296402", "0.6277461", "0.62366873", "0.62213206", "0.6219048", "0.6195598", "0.61488736", "0.6121935", "0.6042896", "0.6040885", "0.60152656", "0.6006894", "0.600595", "0.59982073", "0.5989549", "0.59833276", "0.59607404", "0.593861", "0.59236693", "0.59217316", "0.5910459", "0.5907862", "0.59063506", "0.5889989", "0.58857954" ]
0.7340887
0
Instance of the Role class.
public static function role(): Role { return new Role; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->Role = new Role();\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Role');\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\Role');\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function getRole() {}", "public function getRole();", "public function getRole();", "public function getRole()\n {\n return $this->hasOne(Role::className(), ['id' => 'role_id']);\n }", "public function getROLE()\n {\n return $this->hasOne(Role::className(), ['id' => 'ROLE']);\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\Role', 'id', 'role_id');\n }", "public function role()\n {\n return $this->hasOne('Role', 'id', 'role_id');\n }", "public function getRole()\n {\n return new Horde_Pear_Package_Contents_Role_HordeApplication();\n }", "public function get_role()\n {\n }", "public function getRoleModel()\n\t{\n\t\treturn $this->roleModel = new RoleModel();\n\t}", "function getRole()\n {\n return $this->role;\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\UserRoles', 'role_id', 'id');\n }", "public static function getInstance()\n {\n if (self::$instance == null)\n {\n self::$instance = new RoleDAO();\n }\n \n return self::$instance;\n }", "public function getRole() \n {\n return $this->role;\n }", "public function role()\n {\n return $this->hasOne('App\\Roles','id','role');\n }", "public function getRole(){\r\n\t\t\treturn $this->role;\r\n\t\t}", "function factory(array $data) {\n if(parent::has($data['id'])) {\n $role = parent::get($data['id']);\n $role->_patch($data);\n return $role;\n }\n \n $role = new Role($this->client, $this->guild, $data);\n $this->set($role->id, $role);\n return $role;\n }", "public function getRole(){\n return $this->role; \n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }" ]
[ "0.77834207", "0.71343595", "0.70198596", "0.7002539", "0.7002539", "0.7002539", "0.7002539", "0.7002539", "0.6984974", "0.69798034", "0.69798034", "0.69757116", "0.6935079", "0.6877051", "0.68580973", "0.6836532", "0.6748584", "0.67075443", "0.6705221", "0.6689035", "0.6684583", "0.6681124", "0.6662023", "0.665484", "0.66217375", "0.660492", "0.65978867", "0.65978867", "0.65978867", "0.65978867" ]
0.8271709
0
/ Count all moderated sites
private function getSiteAmount() { $repository = $this->getDoctrine() ->getRepository('AppBundle:Site'); return $repository->createQueryBuilder('s') ->select('count(s.id)') ->where('s.isModerated = 1') ->getQuery() ->getSingleScalarResult(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSiteCount()\n\t\t{\n\t\t\tglobal $CFG;\n\t\t\tglobal $objSmarty;\n\t\t\t$sql_qry = \"SELECT count(theme_id) as site_count FROM \".$CFG['table']['domaindetails'].\" WHERE theme_id != '0'\";\n\t\t \t$res_qry = $this->ExecuteQuery($sql_qry,'select');\n\t\t \treturn $res_qry[0]['site_count'];\n\t\t}", "public function countNotModerated(){\n $count = ORM::factory($this->object_name())->where('moderate', '=', 0)->count_all();\n return $count;\n }", "function wp_update_network_user_counts() {\n\tglobal $wpdb;\n\n\t$count = $wpdb->get_var( \"SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'\" );\n\tupdate_site_option( 'user_count', $count );\n}", "public static function count_for_site( $db_site, $modifier = NULL )\n {\n return static::select_for_site( $db_site, $modifier, true );\n }", "public function getWebsiteCount()\n {\n return count($this->getWebsites());\n }", "public function count()\n {\n return count($this->sitemaps);\n }", "private function count_urls_to_validate() {\n\t\t/*\n\t\t * If the homepage is set to 'Your latest posts,' start the $total_count at 1.\n\t\t * Otherwise, it will probably be counted in the query for pages below.\n\t\t */\n\t\t$total_count = 'posts' === get_option( 'show_on_front' ) && $this->is_template_supported( 'is_home' ) ? 1 : 0;\n\n\t\t$amp_enabled_taxonomies = array_filter(\n\t\t\tget_taxonomies( [ 'public' => true ] ),\n\t\t\t[ $this, 'does_taxonomy_support_amp' ]\n\t\t);\n\n\t\t// Count all public taxonomy terms.\n\t\tforeach ( $amp_enabled_taxonomies as $taxonomy ) {\n\t\t\t$term_query = new WP_Term_Query(\n\t\t\t\t[\n\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t'fields' => 'ids',\n\t\t\t\t\t'number' => $this->limit_type_validate_count,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// If $term_query->terms is an empty array, passing it to count() will throw an error.\n\t\t\t$total_count += ! empty( $term_query->terms ) ? count( $term_query->terms ) : 0;\n\t\t}\n\n\t\t// Count posts by type, like post, page, attachment, etc.\n\t\t$public_post_types = get_post_types( [ 'public' => true ], 'names' );\n\t\tforeach ( $public_post_types as $post_type ) {\n\t\t\t$posts = $this->get_posts_that_support_amp( $this->get_posts_by_type( $post_type ) );\n\t\t\t$total_count += ! empty( $posts ) ? count( $posts ) : 0;\n\t\t}\n\n\t\t// Count author pages, like https://example.com/author/admin/.\n\t\t$total_count += count( $this->get_author_page_urls() );\n\n\t\t// Count a single example date page, like https://example.com/?year=2019.\n\t\tif ( $this->get_date_page() ) {\n\t\t\t$total_count++;\n\t\t}\n\n\t\t// Count a single example search page, like https://example.com/?s=example.\n\t\tif ( $this->get_search_page() ) {\n\t\t\t$total_count++;\n\t\t}\n\n\t\treturn $total_count;\n\t}", "function subsite_manager_get_site_statistics($site_guid = 0) {\n global $CONFIG;\n\n $site_stats = array();\n $site_guid = (int) $site_guid;\n\n $dbprefix = get_config(\"dbprefix\");\n\n $query = \"SELECT distinct e.type,s.subtype,e.subtype as subtype_id from {$dbprefix}entities e left join {$dbprefix}entity_subtypes s on e.subtype=s.id\";\n\n $site_query = \"\";\n if ($site_guid) {\n $query .= \" where site_guid=$site_guid\";\n $site_query = \"and site_guid=$site_guid \";\n }\n\n // Get a list of major types\n if($types = get_data($query)){\n foreach ($types as $type) {\n // assume there are subtypes for now\n if (!is_array($site_stats[$type->type])) {\n $site_stats[$type->type] = array();\n }\n\n $query = \"SELECT count(*) as count from {$dbprefix}entities where type='{$type->type}' $site_query\";\n if ($type->subtype) {\n $query.= \" and subtype={$type->subtype_id}\";\n }\n\n $subtype_cnt = get_data_row($query);\n\n if ($type->subtype) {\n $site_stats[$type->type][$type->subtype] = $subtype_cnt->count;\n } else {\n $site_stats[$type->type]['__base__'] = $subtype_cnt->count;\n }\n }\n }\n\n return $site_stats;\n }", "function get_all_pagina_web_count()\r\n {\r\n $pagina_web = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `pagina_web`\r\n \")->row_array();\r\n\r\n return $pagina_web['count'];\r\n }", "public function numLinks();", "public function getModerationCountAttribute()\n\t{\n\t\treturn $this->moderations->count();\n\t}", "public function count_lists(){\n $cart_result = @mysqli_query($this->dbc, \"SELECT SUM(state='draft') as draft, SUM(article_type='news' and state='published') as news, SUM(article_type='guidance' and state='published') as guidance from `news_advice`\") or die(\"Couldn't ViewSql page USERS lists()\");\n $this->num_rows = mysqli_num_rows($cart_result);\n while ($row = mysqli_fetch_assoc($cart_result)) {\n $this->draft = $row[\"draft\"];\n $this->news = $row[\"news\"];\n $this->guidance = $row[\"guidance\"];\n }// end while\n mysqli_close($this->dbc);\n }", "static function countAdministrators() {\n return Users::count(\"type = 'Administrator' AND state = '\" . STATE_VISIBLE . \"'\");\n }", "public function computeCount() {\n $count = 0;\n foreach ($this->sourceUrls as $url) {\n $reader = new $this->readerClass($url, $this->elementQuery, $this->idQuery);\n foreach ($reader as $element) {\n // Only count relevant postType\n $field = 'wp:post_type';\n\n $post_type = current($element->xpath($field));\n\n // Check menu name.\n $menu = 'category[@domain=\"nav_menu\"]';\n $menu_name = current($element->xpath($menu));\n\n // Hard code main menu here.\n if ($post_type == $this->postType && $menu_name == 'Main') {\n $count++;\n }\n }\n }\n\n return $count;\n }", "public static function getAllCount()\n {\n return (int) FrontendModel::get('database')->getVar(\n 'SELECT COUNT(i.id) AS count\n FROM menu AS i\n WHERE i.language = ?',\n array(FRONTEND_LANGUAGE)\n );\n }", "function wp_count_posts($type = 'post', $perm = '')\n {\n }", "function get_all_download_count() {\n\t// the cached count is maintained in PluginProject::updateDownloadCount\n\treturn (int)elgg_get_plugin_setting('site_plugins_downloads', 'community_plugins');\n}", "function getBlogCount()\n\t\t{\n\t\t\tglobal $CFG;\n\t\t\tglobal $objSmarty;\n\t\t\t$sql_qry = \"SELECT count(blog_id) as blog_count FROM \".$CFG['table']['domaindetails'].\" WHERE blog_id != '0'\";\n\t\t \t$res_qry = $this->ExecuteQuery($sql_qry,'select');\n\t\t \treturn $res_qry[0]['blog_count'];\n\t\t}", "function wp_update_network_site_counts($network_id = \\null)\n {\n }", "public function get_sites_count( $filter, $search, $orderby )\n\t{\n\t\tglobal $wpdb;\n \t\t$groupby = null;\n\t\treturn $wpdb->get_var( \"SELECT COUNT(DISTINCT \".self::$site_table.\".id) FROM \".self::$site_table.' '.$this->filter_sql($filter, $search, $groupby, $orderby) );\n\t}", "public function computeCount() {\n $count = 0;\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n $count = count($data);\n }\n }\n return $count;\n }", "private function getAdminCount() {\n $roles_name = array();\n $get_roles = Role::loadMultiple();\n unset($get_roles[AccountInterface::ANONYMOUS_ROLE]);\n $permission = array('administer permissions', 'administer users');\n foreach ($permission as $value) {\n $filtered_roles = array_filter($get_roles, function ($role) use ($value) {\n return $role->hasPermission($value);\n });\n foreach ($filtered_roles as $role_name => $data) {\n $roles_name[] = $role_name;\n }\n }\n\n if (!empty($roles_name)) {\n $roles_name_unique = array_unique($roles_name);\n $query = db_select('user__roles', 'ur');\n $query->fields('ur', array('entity_id'));\n $query->condition('ur.bundle', 'user', '=');\n $query->condition('ur.deleted', '0', '=');\n $query->condition('ur.roles_target_id', $roles_name_unique, 'IN');\n $count = $query->countQuery()->execute()->fetchField();\n }\n\n return (isset($count) && is_numeric($count)) ? $count : NULL;\n }", "public function countSiteTags($siteId);", "public function getAllWithPostsCounts();", "public function getPostCount();", "function count_site_visit($from_admin_overview=false) {\r\n\tif (file_exists(COUNTER_FILE)) {\r\n\t\t$ignore = false;\r\n\t\t$current_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? addslashes(trim($_SERVER['HTTP_USER_AGENT'])) : \"no agent\";\r\n\t\t$current_time = time();\r\n\t\t$current_ip = $_SERVER['REMOTE_ADDR']; \r\n\t \r\n\t\t// daten einlesen\r\n\t\t$c_file = array();\r\n\t\t$handle = fopen(COUNTER_FILE, \"r\");\r\n\t \r\n\t \tif ($handle) {\r\n\t\t\twhile (!feof($handle)) {\r\n\t\t\t\t$line = trim(fgets($handle, 4096)); \r\n\t\t\t\tif ($line != \"\") {\r\n\t\t\t\t\t$c_file[] = $line;\r\n\t\t\t\t}\t\t \r\n\t\t\t}\r\n\t\t\tfclose ($handle);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t \r\n\t\t// bots ignorieren \r\n\t\tif (substr_count($current_agent, \"bot\") > 0) {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t\t \r\n\t \r\n\t\t// hat diese ip einen eintrag in den letzten expire sec gehabt, dann igornieren?\r\n\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t$counter_time = trim($counter_time);\r\n\t\t \r\n\t\t\tif ($counter_ip == $current_ip && $current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t// besucher wurde bereits gezählt, daher hier abbruch\r\n\t\t\t\t$ignore = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n\t\t// counter hochzählen\r\n\t\tif (!$ignore) {\r\n\t\t\tif (sizeof($c_file) == 0) {\r\n\t\t\t\t// wenn counter leer, dann füllen \r\n\t\t\t\t$add_line1 = date(\"z\") . \":1||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $current_time . \"\\n\";\r\n\t\t\t\t$add_line2 = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t \r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\t\t\t\t\tfwrite($fp, $add_line2);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// werte zur verfügung stellen\r\n\t\t\t\t$day = $week = $month = $year = $all = $record = 1;\r\n\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t$online = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// counter hochzählen\r\n\t\t\t\tlist($day_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", $c_file[0]);\r\n\t\t\t \r\n\t\t\t\t// day\r\n\t\t\t\t$day_data = explode(\":\", $day_arr);\r\n\t\t\t\t$day = $day_data[1];\r\n\t\t\t\tif ($day_data[0] == date(\"z\")) $day++; else $day = 1;\r\n\t\t\t \r\n\t\t\t\t// week\r\n\t\t\t\t$week_data = explode(\":\", $week_arr);\r\n\t\t\t\t$week = $week_data[1];\r\n\t\t\t\tif ($week_data[0] == date(\"W\")) $week++; else $week = 1;\r\n\t\t\t \r\n\t\t\t\t// month\r\n\t\t\t\t$month_data = explode(\":\", $month_arr);\r\n\t\t\t\t$month = $month_data[1];\r\n\t\t\t\tif ($month_data[0] == date(\"n\")) $month++; else $month = 1;\r\n\t\t\t \r\n\t\t\t\t// year\r\n\t\t\t\t$year_data = explode(\":\", $year_arr);\r\n\t\t\t\t$year = $year_data[1];\r\n\t\t\t\tif ($year_data[0] == date(\"Y\")) $year++; else $year = 1;\r\n\t\t\t \r\n\t\t\t\t// all\r\n\t\t\t\t$all++;\r\n\t\t\t \r\n\t\t\t\t// neuer record?\r\n\t\t\t\t$record_time = trim($record_time);\r\n\t\t\t\tif ($day > $record) {\r\n\t\t\t\t\t$record = $day;\r\n\t\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// speichern und aufräumen und anzahl der online leute bestimmten\r\n\t\t\t \r\n\t\t\t\t$online = 1;\r\n\t\t\t \t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\t$add_line1 = date(\"z\") . \":\" . $day . \"||\" . date(\"W\") . \":\" . $week . \"||\" . date(\"n\") . \":\" . $month . \"||\" . date(\"Y\") . \":\" . $year . \"||\" . $all . \"||\" . $record . \"||\" . $record_time . \"\\n\";\t\t \r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\r\n\t\t\t\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\t\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// übernehmen\r\n\t\t\t\t\t\tif ($current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t\t\t\t$counter_time = trim($counter_time);\r\n\t\t\t\t\t\t\t$add_line = $counter_ip . \"||\" . $counter_time . \"\\n\";\r\n\t\t\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\t\t\t$online++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$add_line = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function countUnseenNewsItems(){\n return $this->newsModel->countUnseenNewsItems();\n }", "function dokan_get_seller_count() {\n global $wpdb;\n\n\n $counts = array( 'yes' => 0, 'no' => 0 );\n\n $result = $wpdb->get_results( \"SELECT COUNT(um.user_id) as count, um1.meta_value as type\n FROM $wpdb->usermeta um\n LEFT JOIN $wpdb->usermeta um1 ON um1.user_id = um.user_id\n WHERE um.meta_key = 'wp_capabilities' AND um1.meta_key = 'dokan_enable_selling'\n AND um.meta_value LIKE '%seller%'\n GROUP BY um1.meta_value\" );\n\n if ( $result ) {\n foreach ($result as $row) {\n $counts[$row->type] = (int) $row->count;\n }\n }\n\n return $counts;\n}", "function social_get_share_count($service, $url)\n{\n switch ($service) {\n case 'linkedin':\n $get = router_add_query(\n 'https://www.linkedin.com/countserv/count/share',\n array('url' => $url, 'format' => 'json')\n );\n callmap_log($get);\n $response = http_get($get);\n $body = json_decode($response['body'], true);\n return empty($body['count']) ? 0 : (int) $body['count'];\n case 'gplus':\n $get = router_add_query(\n 'https://plusone.google.com/_/+1/fastbutton',\n array('url' => $url)\n );\n callmap_log($get);\n $response = http_get($get);\n $regex = '/id=\"aggregateCount\"[^>]*>([^<]+)</';\n if (preg_match($regex, $response['body'], $matches)) {\n $count = strtolower($matches[1]);\n $count = str_replace(['k', 'm'], ['000', '000000'], $count);\n $count = preg_replace('/[^\\d]/', '', $count);\n return (int) $count;\n }\n return 0;\n default:\n return 0;\n }\n}", "public function getCountLikes() {\r\n\t\t$table = Engine_Api::_() -> getDbtable('likes', 'core');\r\n\t\t$Name = $table -> info('name');\r\n\t\t$select = $table -> select() -> from($Name);\r\n\t\t$select -> where(\"resource_id = ?\", $this -> blog_id) -> where(\"resource_type LIKE 'blog'\");\r\n\t\t$blogs = $table -> fetchAll($select);\r\n\t\treturn count($blogs);\r\n\t}" ]
[ "0.658768", "0.64084667", "0.62968117", "0.6254764", "0.62051487", "0.6088182", "0.59934217", "0.59437364", "0.5860839", "0.5857473", "0.584826", "0.58198833", "0.5769829", "0.57277817", "0.5715145", "0.5705795", "0.5631194", "0.56064904", "0.5594903", "0.55948424", "0.5570315", "0.5566569", "0.55660325", "0.55635965", "0.5557975", "0.55480945", "0.55475247", "0.5534252", "0.5525898", "0.5523588" ]
0.6435331
1
/ Get last added site
private function getLastSite() { $repository = $this->getDoctrine() ->getRepository('AppBundle:Site'); return $repository-> findOneBy(['isModerated' => '1'],['id' => 'DESC']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function last()\n {\n return $this->execGetRequest(['allow_state' => true], UrlBuilder::RESOURCE_GET_LATEST_NEWS);\n }", "public function get_last_url_request() {\n\t\treturn $this->_last_url_request;\n\t}", "public function getUrl()\n {\n return $this->lastUrl;\n }", "public function getSiteUrl()\n {\n sort($this->siteUrl);\n return $this->siteUrl;\n }", "function get_current_site()\n {\n }", "public function getLastPageUrl();", "public function getLastUpdate()\n {\n return $this->cache->load(\n self::CACHE_TAG\n );\n }", "public function getLastUpdate()\n {\n return Mage::app()->loadCache('admin_notifications_lastcheck');\n// return Mage::getStoreConfig(self::XML_LAST_UPDATE_PATH);\n }", "public function getSite();", "public function getCurrentSite() {\n\t\treturn $this->_currentSite;\n\t}", "function wp_cache_set_sites_last_changed()\n {\n }", "public function lastBlog()\n {\n $chapitres = $this->chapitre->getLastBlog();\n $commentaires = $this->comment->lastComments();\n }", "public function getSite()\n\t\t{\n\t\t\t$ref_list = ECash::getFactory()->getReferenceList('Site');\n\t\t\t$list_item = isset($ref_list[$this->model->enterprise_site_id]) ? $ref_list[$this->model->enterprise_site_id] : null;\n\t\t\treturn $list_item;\t\t\t\n\t\t}", "public static function getLastPageAddress()\n {\n return $_SESSION[self::LAST_PAGE_SESSION_NAME];\n }", "public function getLastApp();", "private function getLatestPlace(){\n $last = -100000000;\n foreach($this->URLs as $url){\n if($url['url_place'] > $last) $last = $url['url_place'];\n }\n if($last == -100000000) $last = 0;\n return $last;\n }", "public function getSite()\n {\n return $this->site;\n }", "public function getSite()\n {\n return $this->_site;\n }", "public function getSite()\n {\n return $this->_site;\n }", "public function getCurrentSite()\n {\n return $this->application->getSite();\n }", "public function getSite() {\n return $this->sSite;\n }", "public static function site()\n {\n return \\get_current_site();\n }", "public function getSiteURL()\r\n {\r\n return $this->siteURL;\r\n }", "public function getSite()\n {\n return $this->site;\n }", "public function getSite()\n {\n return $this->site;\n }", "public function getLastRequestURL()\n {\n return $this->requestUrl;\n \n }", "public function GetLastRecord(){$this->LastPosts();return $this->lastrecord;}", "public function site() {\n return $this->site;\n }", "public function getLastUpdated();", "public function getLast()\n\t{\n\t\t$this->_db->setQuery(\"SELECT publish_down FROM $this->_tbl ORDER BY publish_down DESC LIMIT 1\");\n\t\treturn $this->_db->loadResult();\n\t}" ]
[ "0.68619466", "0.68574226", "0.6604839", "0.6493649", "0.64382714", "0.6411656", "0.63763833", "0.63734347", "0.6371999", "0.636809", "0.63617903", "0.63151956", "0.6259804", "0.62585896", "0.6230022", "0.6228856", "0.62230706", "0.62095916", "0.62095916", "0.6195821", "0.619072", "0.61887056", "0.6187134", "0.6184458", "0.6184458", "0.61836296", "0.6170632", "0.6155729", "0.6135693", "0.6123644" ]
0.79681635
0
Saves a state related to an interactionID. Example: Clicking an option will bring you to a new question state. We want to know what the resulting state (or destination) of this interaction on the option brought someone to. This insertion will allow us to track that.
private function insertState($interactionID, $stateID) { /************************************** ** WARNING!!!!!! ** ** ** ** NO VALIDATION OCCURS HERE. ** ** ONLY CALL FROM $this->insert() ** ***************************************/ // save the state too $params = [ ':interactionID' => $interactionID, ':elID' => $stateID ]; // write our SQL statement $sql = 'INSERT INTO '.$this->db->tables['treeState'].' ( interactionID, elID ) VALUES( :interactionID, :elID )'; // insert the mc_option into the database $stmt = $this->db->query($sql, $params); if($stmt !== false) { // return the inserted ID return $this->db->lastInsertId(); } else { // handle errors $this->errors[] = 'Insert state failed.'; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save($state);", "function insertJointSourceState($jointSourceId, $state = STATE_PUBLISHED) {\n\n global $DATABASE;\n $accountId = \\Session\\getAccountId();\n\n $stateEncoded = encodeState($state);\n\n $result = query(\"INSERT INTO jointsources_states\n (`jointsource_id`, `author_id`, `state`)\n VALUES ($jointSourceId, $accountId, $stateEncoded);\");\n $stateId = $DATABASE->insert_id;\n\n return $stateId;\n\n }", "private function insertInteractionElement($interactionID, $elID) {\n /**************************************\n ** WARNING!!!!!! **\n ** **\n ** NO VALIDATION OCCURS HERE. **\n ** ONLY CALL FROM $this->insert() **\n ***************************************/\n\n // save the interaction\n $params = [\n ':interactionID' => $interactionID,\n ':elID' => $elID\n ];\n // write our SQL statement\n $sql = 'INSERT INTO '.$this->db->tables['treeInteractionElement'].' (\n interactionID,\n elID\n )\n VALUES(\n :interactionID,\n :elID\n )';\n // insert the mc_option into the database\n $stmt = $this->db->query($sql, $params);\n\n if($stmt !== false) {\n // return the inserted ID\n return $this->db->lastInsertId();\n } else {\n // handle errors\n $this->errors[] = 'Insert interaction element failed.';\n return false;\n }\n }", "public function save($state)\n\t{\n\t\tIOHelper::writeToFile($this->stateFile, serialize($state));\n\t}", "public function save()\n {\n $this->persist($this->state);\n }", "function insertJointSourceMetaParticipantState($delegId, $state = STATE_PUBLISHED) {\n\n global $DATABASE;\n $accountId = \\Session\\getAccountId();\n\n $stateEncoded = encodeState($state);\n $result = query(\"INSERT INTO jointsources_participants_states\n (`deleg_id`, `state`, `author_id`)\n VALUES ({$delegId}, {$stateEncoded}, {$accountId});\");\n\n $stateId = $DATABASE->insert_id;\n return $stateId;\n\n }", "public function save($state) {\n $data = serialize($state);\n try {\n $db = $this->getDbConnection();\n $sql = \"SELECT id FROM {$this->persisterTableName} WHERE id=1\";\n if ($db->createCommand($sql)->queryScalar() === false)\n $sql = \"INSERT INTO {$this->persisterTableName} (id, data) VALUES (1, :data)\";\n else\n $sql = \"UPDATE {$this->persisterTableName} SET data=:data WHERE id=1\";\n $db->createCommand($sql)->bindValue(':data', $data)->execute();\n }\n catch (Exception $e) {\n if (YII_DEBUG)\n echo $e->getMessage();\n return false;\n }\n return true;\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"index\"\n ));\n }\n\n $state_id = $this->request->getPost(\"state_id\");\n\n $mission_user_state = MissionUserState::findFirstBystate_id($state_id);\n if (!$mission_user_state) {\n $this->flash->error(\"mission_user_state does not exist \" . $state_id);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"index\"\n ));\n }\n\n $mission_user_state->mission_id = $this->request->getPost(\"mission_id\");\n $mission_user_state->user_id = $this->request->getPost(\"user_id\");\n $mission_user_state->state = $this->request->getPost(\"state\");\n \n\n if (!$mission_user_state->save()) {\n\n foreach ($mission_user_state->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"edit\",\n \"params\" => array($mission_user_state->state_id)\n ));\n }\n\n $this->flash->success(\"mission_user_state was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"index\"\n ));\n\n }", "public function saveObjectState() {\n $this->objectState = base64_encode(serialize($this));\n $this->isNewRecord = false;\n $this->update();\n $this->reconstructCombatants();\n }", "public function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->saveQuestionDataToDb($original_id);\n\t\t$this->saveAdditionalQuestionDataToDb();\n\t\t$this->saveAnswerSpecificDataToDb();\n\n\t\tparent::saveToDb($original_id);\n\t}", "function insertJointSourceMetaThemeState($delegId, $state = STATE_PUBLISHED) {\n\n global $DATABASE;\n $accountId = \\Session\\getAccountId();\n\n $stateEncoded = encodeState($state);\n $result = query(\"INSERT INTO jointsources_themes_states\n (`deleg_id`, `state`, `author_id`)\n VALUES ({$delegId}, {$stateEncoded}, {$accountId});\");\n\n $stateId = $DATABASE->insert_id;\n return $stateId;\n\n }", "protected function saveState() {\n $filename = $this->tempPath() . self::STATEFILE_STUB;\n return file_put_contents($filename, serialize($this->state));\n }", "public function saveResponse($responseID, $response);", "function insertJointSourceMetaRegionLanguageState($langId, $state = STATE_PUBLISHED) {\n\n global $DATABASE;\n $accountId = \\Session\\getAccountId();\n\n $stateEncoded = encodeState($state);\n $result = query(\"INSERT INTO jointsources_regions_langs_states\n (`lang_id`, `state`, `author_id`)\n VALUES ({$langId}, {$stateEncoded}, {$accountId});\");\n\n $stateId = $DATABASE->insert_id;\n return $stateId;\n\n }", "function insert_state($state) {\n if (!RefineData::isStateExists($state)) {\n RefineData::insertState(remove_numbers($state));\n }\n}", "public function saveState($jsonState)\n {\n $state = null;\n if ($jsonState !== null) {\n $state = new State();\n $state->setSlug($this->application->getSlug());\n $state->setTitle(\"SuggestMap\");\n $state->setJson($jsonState);\n $state = $this->unSignUrls($state);\n $this->entityManager->persist($state);\n $this->entityManager->flush();\n }\n return $state;\n }", "public function store()\n { \n $real_state = new RealState();\n $real_state->name = Input::get('name');\n $real_state->description = Input::get('description');\n $real_state->save(); \n return Redirect::route('real_state.index');\n }", "public function store(StateRequest $request)\n {\n $state = $this->service->saveOrUpdateDetails($request);\n if ($state) {\n return redirect(route('state.edit',['state' => $state]))->with('success', 'State has been created successfully!');\n }\n\n return back()->withInput();\n }", "function save($overideId = false)\n\t{\n\t\tif ($overideId)\n\t\t\t$this->getAdapter()->insert($this->data, $this);\n\n\t\telse if ($this->id)\n\t\t\t$this->getAdapter()->update($this->data, $this, \"{$this->id_column} = {$this->id}\");\n\n\t\telse\n\t\t{\n\t\t\t$this->getAdapter()->insert($this->data, $this);\n\t\t\t$this->id = $this->getAdapter()->lastInsertId();\n\t\t}\n\t}", "function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->saveQuestionDataToDb($original_id);\n\n\t\t// save additional data\n\t\t$ilDB->manipulateF(\"DELETE FROM \" . $this->getAdditionalTableName() . \" WHERE question_fi = %s\", \n\t\t\tarray(\"integer\"),\n\t\t\tarray($this->getId())\n\t\t);\n\t\t\n\t\t$ilDB->insert(\n\t\t\t\t$this->getAdditionalTableName(),\n\t\t\t\tarray(\n\t\t\t\t\t'question_fi'\t=> array('integer',(int) $this->getId()),\n\t\t\t\t\t'vip_sub_id'\t=> array('integer',(int) $this->getVipSubId()),\n\t\t\t\t\t'vip_cookie'\t=> array('text',(string) $this->getVipCookie()),\n\t\t\t\t\t'vip_exercise'\t=> array('clob',(string) $this->getVipExercise()),\n\t\t\t\t\t'vip_lang'\t\t=> array('text', (string) $this->getVipLang()),\n\t\t\t\t\t'vip_exercise_id'\t=> array('integer',(string) $this->getVipExerciseId()),\n\t\t\t\t\t'vip_evaluation' => array('clob',(string) $this->getVipEvaluation()),\n\t\t\t\t\t'vip_result_storage' => array('integer',(string) $this->getVipResultStorage()),\n\t\t\t\t\t'vip_auto_scoring' => array('integer', (int) $this->getVipAutoScoring())\n\t\t\t\t)\n\t\t);\n\t\tparent::saveToDb($original_id);\n\t}", "public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }", "public function store(){\n // state\n $state = new State;\n $state->name_en = Input::get('name_en');\n $state->name_jp = Input::get('name_jp');\n $state->region_id = Input::get('region_id');\n $state->rise_year = Input::get('rise_year');\n if(Input::has('is_rise_year_fixed')) $state->is_rise_year_fixed = true;\n $state->fall_year = Input::get('fall_year');\n if(Input::has('is_fall_year_fixed')) $state->is_fall_year_fixed = true;\n $state->explanation_en = Input::get('explanation_en');\n $state->explanation_jp = Input::get('explanation_jp');\n $state->capital_name_en = Input::get('capital_name_en');\n $state->capital_name_jp = Input::get('capital_name_jp');\n $state->save();\n\n //redirect\n Session::flash('message','Success create.');\n return Redirect::to('/admin/state');\n\n\t}", "public function saveState($data) {\n if (!is_numeric($data['user_id']))\n return;\n\n $this->logger->log(\"Application::saveState() SAVING...\", Zend_Log::INFO);\n try {\n $query = \"SELECT `user_id` FROM `app_state` WHERE user_id = ?\";\n $user_id = $this->db->fetchOne($query, $data['user_id']);\n\n $var = print_r($data, true);\n if (is_numeric($user_id)) {\n $n = $this->db->update('app_state', $data, \"user_id = $user_id\");\n $this->logger->log(\"Application::saveState() SAVING...UPDATING $var\", Zend_Log::INFO);\n } else {\n $this->db->insert('app_state', $data);\n $this->logger->log(\"Application::saveState() SAVING...INSERTING $var\", Zend_Log::INFO);\n }\n } catch (Exception $e) {\n $dbLoggerObj = new DbLogger($e);\n $this->logger->log($dbLoggerObj->message, Zend_Log::ERR);\n }\n }", "public function store($id)\n\t{\n\t\t//\n\t}", "public function store($id)\n\t{\n\t\t//\n\t}", "protected function actionSaveState($params){\n\t\tGO::session()->closeWriting();\n\t\t\n\t\tif(isset($params['values'])){\n\t\t\t$values = json_decode($params['values'], true);\n\n\t\t\tif(!is_array($values)){\n\t\t\t\ttrigger_error (\"Invalid value for Core::actionSaveState: \".var_export($params, true), E_USER_NOTICE);\n\t\t\t}else\n\t\t\t{\n\t\t\t\tforeach($values as $name=>$value){\n\n\t\t\t\t\t$state = \\GO\\Base\\Model\\State::model()->findByPk(array('name'=>$name,'user_id'=>GO::user()->id));\n\n\t\t\t\t\tif(!$state){\n\t\t\t\t\t\t$state = new \\GO\\Base\\Model\\State();\n\t\t\t\t\t\t$state->name=$name;\n\t\t\t\t\t}\n\n\t\t\t\t\t$state->value=$value;\n\t\t\t\t\t$state->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$response['success']=true;\n\t\techo json_encode($response);\n\t}", "public function save()\n\t{\n\t\t$this->copyAttributesToValues() ;\n\t\tif( $this->factory )\n\t\t{\n\t\t\tswitch( $this->todo )\n\t\t\t{\n\t\t\t\tcase 1: // Insert\n\t\t\t\t\tif( $this->factory->insertObjectIntoDB( $this ) ) $this->state = \"inserted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 2: // update\n\t\t\t\t\tif( $this->factory->updateObjectIntoDB( $this ) ) $this->state = \"updated\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 3: // delete\n\t\t\t\t\tif( $this->factory->deleteObjectIntoDB( $this ) ) $this->state = \"deleted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t}", "public function addState(StateInterface $state): void;", "function save_district_state() {\n $datas = RefineData::getMasterData();\n foreach ($datas as $data) {\n insert_district($data->state, $data->district);\n }\n}", "public function changeStateOutcomeToCreated($id)\n {\n\n $outcome = Outcome::where('ID_ST_OUTCOME', '=', $id)->first();\n\n // $outcome->STATE_ID_STATE='15';\n // $outcome->save();\n\n $response = Response::json($outcome, 200);\n return $response;\n }" ]
[ "0.5938603", "0.56179863", "0.5570784", "0.5551435", "0.5532026", "0.54963744", "0.54621977", "0.51635957", "0.5058857", "0.49947414", "0.4986856", "0.49748155", "0.4966034", "0.4945887", "0.4932158", "0.48915535", "0.48882657", "0.486293", "0.48371324", "0.48259965", "0.48153305", "0.48093542", "0.47970197", "0.47859743", "0.47859743", "0.4782872", "0.47595263", "0.4754389", "0.47520366", "0.4749895" ]
0.7648632
0
Saves the element interacted with (like a click) related to an interactionID. Example: Clicking an option will bring you to a new question state. We want to know what element (option) was clicked on. This insertion will allow us to track that.
private function insertInteractionElement($interactionID, $elID) { /************************************** ** WARNING!!!!!! ** ** ** ** NO VALIDATION OCCURS HERE. ** ** ONLY CALL FROM $this->insert() ** ***************************************/ // save the interaction $params = [ ':interactionID' => $interactionID, ':elID' => $elID ]; // write our SQL statement $sql = 'INSERT INTO '.$this->db->tables['treeInteractionElement'].' ( interactionID, elID ) VALUES( :interactionID, :elID )'; // insert the mc_option into the database $stmt = $this->db->query($sql, $params); if($stmt !== false) { // return the inserted ID return $this->db->lastInsertId(); } else { // handle errors $this->errors[] = 'Insert interaction element failed.'; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save($overideId = false)\n\t{\n\t\tif ($overideId)\n\t\t\t$this->getAdapter()->insert($this->data, $this);\n\n\t\telse if ($this->id)\n\t\t\t$this->getAdapter()->update($this->data, $this, \"{$this->id_column} = {$this->id}\");\n\n\t\telse\n\t\t{\n\t\t\t$this->getAdapter()->insert($this->data, $this);\n\t\t\t$this->id = $this->getAdapter()->lastInsertId();\n\t\t}\n\t}", "public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }", "public function save() {\n\t\t$this->data[] = $this->current();\n\t}", "public function save()\n {\n parent::save();\n $warningBlock = $this->browser->find($this->warningBlock);\n if ($warningBlock->isVisible()) {\n $warningBlock->click();\n }\n }", "function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `svg_info` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `svg_info` values('\".addslashes($this->id).\"' , '\".addslashes($this->bf).\"' , '\".addslashes($this->type).\"' , '\".addslashes($this->lid).\"' , '\".addslashes($this->index).\"' , '\".addslashes($this->transform).\"' , '\".addslashes($this->value).\"' , '\".addslashes($this->fontsize).\"' , '\".addslashes($this->color).\"' , '\".addslashes($this->fill).\"' , '\".addslashes($this->stroke).\"' , '\".addslashes($this->points).\"' , '\".addslashes($this->txt).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}", "private function insertState($interactionID, $stateID) {\n /**************************************\n ** WARNING!!!!!! **\n ** **\n ** NO VALIDATION OCCURS HERE. **\n ** ONLY CALL FROM $this->insert() **\n ***************************************/\n // save the state too\n $params = [\n ':interactionID' => $interactionID,\n ':elID' => $stateID\n ];\n // write our SQL statement\n $sql = 'INSERT INTO '.$this->db->tables['treeState'].' (\n interactionID,\n elID\n )\n VALUES(\n :interactionID,\n :elID\n )';\n // insert the mc_option into the database\n $stmt = $this->db->query($sql, $params);\n\n if($stmt !== false) {\n // return the inserted ID\n return $this->db->lastInsertId();\n } else {\n // handle errors\n $this->errors[] = 'Insert state failed.';\n return false;\n }\n }", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "public function save(){\n\t\tglobal $wpdb;\n\t\t$wpdb->insert( $wpdb->prefix . 'cf_form_entry_values', $this->to_array() );\n\t\treturn (int) $wpdb->insert_id;\n\n\t}", "function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `tours` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `tours` values('\".addslashes($this->id).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->duration).\"' , '\".addslashes($this->description).\"' , '\".addslashes($this->tcid).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}", "public function save(array $options = []) {\n \n // before save code \n parent::save();\n // after save code\n\n $id = $this->attributes['id'];\n $cms_tag = \\App\\Models\\CmsTag::find($id);\n\n // Define Position\n $input['position']=$cms_tag->id;\n\n // Save\n if ($cms_tag->position<1) {\n \\App\\Models\\CmsTag::where('id', $id)->update($input);\n }\n \n }", "public function store(DiagramInterface $diagram, $saveChildElements=false);", "public function saveElement($elementName, $elementType)\n {\n /* @var $connection PDO */\n $connection = $this->connection;\n \n //trim whitespace\n $elementName = trim($elementName);\n $elementType = trim($elementType);\n \n //check if element already exists\n $sql = \"SELECT ID FROM Elements WHERE Name = ? AND Type = ?\";\n $query = $connection->prepare($sql);\n $query->execute(array($elementName, $elementType));\n $result = $query->fetch(PDO::FETCH_ASSOC);\n \n if(!$result) {\n //element doesnt exist, save it and return its ID\n $sql = \"INSERT INTO Elements (Name, Type) VALUES (?, ?)\";\n $query = $connection->prepare($sql);\n $query->execute(array($elementName, $elementType));\n \n $elementID = $connection->lastInsertId();\n } else {\n //browser exists, return its ID\n $elementID = $result[\"ID\"];\n }\n \n return $elementID;\n }", "function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->saveQuestionDataToDb($original_id);\n\n\t\t// save additional data\n\t\t$ilDB->manipulateF(\"DELETE FROM \" . $this->getAdditionalTableName() . \" WHERE question_fi = %s\", \n\t\t\tarray(\"integer\"),\n\t\t\tarray($this->getId())\n\t\t);\n\t\t\n\t\t$ilDB->insert(\n\t\t\t\t$this->getAdditionalTableName(),\n\t\t\t\tarray(\n\t\t\t\t\t'question_fi'\t=> array('integer',(int) $this->getId()),\n\t\t\t\t\t'vip_sub_id'\t=> array('integer',(int) $this->getVipSubId()),\n\t\t\t\t\t'vip_cookie'\t=> array('text',(string) $this->getVipCookie()),\n\t\t\t\t\t'vip_exercise'\t=> array('clob',(string) $this->getVipExercise()),\n\t\t\t\t\t'vip_lang'\t\t=> array('text', (string) $this->getVipLang()),\n\t\t\t\t\t'vip_exercise_id'\t=> array('integer',(string) $this->getVipExerciseId()),\n\t\t\t\t\t'vip_evaluation' => array('clob',(string) $this->getVipEvaluation()),\n\t\t\t\t\t'vip_result_storage' => array('integer',(string) $this->getVipResultStorage()),\n\t\t\t\t\t'vip_auto_scoring' => array('integer', (int) $this->getVipAutoScoring())\n\t\t\t\t)\n\t\t);\n\t\tparent::saveToDb($original_id);\n\t}", "public function saveDetails() \n {\n // Save the author list.\n $this->authorList->setValue('bookId', $this->bookId);\n $this->authorList->save();\n \n // Save the booklanguage list.\n $this->bookLanguageList->setValue('bookId', $this->bookId);\n $this->bookLanguageList->save();\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->saveQuestionDataToDb($original_id);\n\t\t$this->saveAdditionalQuestionDataToDb();\n\t\t$this->saveAnswerSpecificDataToDb();\n\n\t\tparent::saveToDb($original_id);\n\t}", "function save($id, DataHolder $holder);", "protected function SaveActionIdToComment()\n {\n $sActionId = TTools::GetUUID();\n $this->sqlData['action_id'] = $sActionId;\n $this->AllowEditByAll(true);\n $this->Save();\n $this->AllowEditByAll(false);\n }", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "function save(){\n\t\t// returns the item's id if successful\n\t\tif($this->beforesave()){\n\t\t\t$query = ($this->id?\"UPDATE \":\"INSERT INTO \").$this->tablename.\" SET \";\n\t\t\t$qvalues = \"\";\n\t\t\tforeach($this->dbvariables as $key){\n\t\t\t\t$qvalues .= ($qvalues == \"\"?\"\":\", \").$key.\"='\".trim(addslashes($this->$key)).\"'\";\n\t\t\t}\n\t\t\t$query .= $qvalues;\n\t\t\tif($this->id){\n\t\t\t\t$query .= \" WHERE id=\".$this->id;\n\t\t\t}else{\n\t\t\t\t$query .= \", item_order=\".get_neworder($this->tablename, $this->neworder_where());\n\t\t\t}\n\t\t\tmy_debug(\"Attempting query: \".$query,__FILE__,__LINE__,\"green\");\n\t\t\tif(mysql_query($query)){\t\t\t\t\n\t\t\t\tif(!$this->id && mysql_insert_id())\t$this->id = mysql_insert_id();\n\t\t\t\t$this->onsave();\n\t\t\t\treturn $this->id;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function save()\r\n {\r\n $changes = array();\r\n\tforeach( $this->saveable_fields as $field )\r\n\t{\r\n\t $changes[ $field ] = $this->$field;\r\n\t}\r\n\t$this->registry->getObject('db')->insertRecords( 'links', $changes );\r\n\t$uid = $this->registry->getObject('db')->lastInsertID();\r\n\treturn $uid; \r\n }", "public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "function save() {\n //save the added fields\n }", "public function save(Identifiable $model);", "abstract protected function _doSave($id, $data, $lifeTime = false);", "public function save($id, $data, $lifeTime = 0);", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function test_save_1() {\n $course = $this->getDataGenerator()->create_course();\n $module = $this->getDataGenerator()->create_module('talkpoint', array(\n 'course' => $course->id,\n ));\n $data = array(\n 'instanceid' => $module->id,\n 'userid' => 2,\n 'title' => 'Talkpoint 001',\n 'uploadedfile' => 'foo.mp4',\n 'mediatype' => 'file',\n 'closed' => 0,\n );\n $data = $this->_cut->save($data, time());\n $this->assertArrayHasKey('id', $data);\n }" ]
[ "0.527578", "0.5078858", "0.50737625", "0.50131184", "0.49910444", "0.49553353", "0.49524158", "0.491659", "0.48778728", "0.48703498", "0.48508808", "0.48382857", "0.48338446", "0.48212272", "0.48145598", "0.48132876", "0.48061946", "0.47945273", "0.47937885", "0.47786736", "0.47721326", "0.47698212", "0.47580022", "0.47461343", "0.47411352", "0.4727815", "0.47251284", "0.46995333", "0.46878535", "0.46650642" ]
0.6531297
0
get the revenue data to generate the revenue plot
public function retrieveRevenueData() { //setting header to json header('Content-Type: application/json'); //query to get the revenue data $query = sprintf("SELECT CONCAT(YEAR(date), '/', WEEK(date)) AS theWeek, SUM(exlAmount) AS revenue FROM payment GROUP BY theWeek ORDER BY YEAR(DATE) ASC, WEEK(date) ASC;"); //execute query $result = $GLOBALS['db']->query($query); //loop through the returned data $data = array(); foreach ($result as $row) { $data[] = $row; } //free memory associated with result $result->close(); //return the data return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_revenue() {\n return response()->json(Revenue::active()->get()->toArray(), 200);\n }", "public function getDistribusiRevenueData()\n {\n $rekening_tabungan = $this->getRekening(\"TABUNGAN\");\n $rekening_deposito = $this->getRekening(\"DEPOSITO\");\n\n $data_rekening = array();\n $total_rata_rata = array();\n\n foreach($rekening_tabungan as $tab)\n {\n $rata_rata_product_tabungan = 0.0;\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n foreach($tabungan as $user_tabungan) {\n $temporarySaldo = $this->getSaldoAverageTabunganAnggota($user_tabungan->id_user, $user_tabungan->id);\n $rata_rata_product_tabungan = $rata_rata_product_tabungan + $temporarySaldo;\n }\n Session::put($user_tabungan->jenis_tabungan, $rata_rata_product_tabungan);\n array_push($total_rata_rata, $rata_rata_product_tabungan);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $rata_rata_product_deposito = 0.0;\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n foreach($deposito as $user_deposito) {\n if ($user_deposito->type == 'jatuhtempo'){\n $tanggal = $user_deposito->tempo;\n }\n else if($user_deposito->type == 'pencairanawal')\n {\n $tanggal = $user_deposito->tanggal_pencairan;\n }\n else if($user_deposito->type == 'active')\n {\n $tanggal = Carbon::parse('first day of January 1970');\n }\n $temporarySaldo = $this->getSaldoAverageDepositoAnggota($user_deposito->id_user, $user_deposito->id, $tanggal);\n $rata_rata_product_deposito = $rata_rata_product_deposito + $temporarySaldo ;\n }\n Session::put($dep->nama_rekening, $rata_rata_product_deposito);\n array_push($total_rata_rata, $rata_rata_product_deposito);\n }\n\n $total_rata_rata = $this->getTotalProductAverage($total_rata_rata);\n Session::put(\"total_rata_rata\", $total_rata_rata);\n $total_pendapatan = $this->getRekeningPendapatan(\"saldo\") - $this->getRekeningBeban(\"saldo\");\n $total_pendapatan_product = 0;\n\n foreach($rekening_tabungan as $tab)\n {\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n $rata_rata = Session::get($tab->nama_rekening);\n $nisbah_anggota = json_decode($tab->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($tab->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $tab->nama_rekening,\n \"jumlah\" => count($tabungan),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product),\n \"percentage_anggota\" => $total_pendapatan > 0 ?$this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product) / $total_pendapatan : 0\n ]);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n $rata_rata = Session::get($dep->nama_rekening);\n $nisbah_anggota = json_decode($dep->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($dep->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $dep->nama_rekening,\n \"jumlah\" => count($deposito),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product)\n ]);\n }\n\n\n return $data_rekening;\n }", "static function get_plan_revenue()\n {\n $cond_str = RestaurantTotalReportDB::get_month_year_string($_REQUEST['from_date'],$_REQUEST['to_date']);\n $sql = 'select\n (bar.name || \\'_\\' || pim.bar_index) as id,\n sum(pim.value) as value,\n pim.portal_id,\n pim.bar_index\n from\n plan_in_month pim\n inner join bar on bar.id = pim.bar\n where\n (pim.month || pim.year) in ('.$cond_str.')\n and pim.bar is not null\n and pim.bar_index is not null\n group by \n bar.name,\n pim.portal_id,\n pim.bar_index\n ';\n $items = DB::fetch_all($sql);\n return $items;\n }", "public function getCurrentMonthTotalRevenue() : float;", "function getRevenueData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n \n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$i]['time'][]=$arrData;\n $arrRes[$i]['count']=$count;\n }\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function display_site_revenue() {\n if ($this->checkLogin('C') == '') {\n redirect(COMPANY_NAME);\n } else {\n\t\t\t$company_id=$this->data['company_id'];\n $billingsList = $this->revenue_model->get_all_details(TRANSACTION, array(), array('bill_generated' => 'DESC'));\n\n $req = (empty($_GET['range'])) ? '' : $_GET['range'];\n $this->data['range'] = $range = (empty($_GET['range'])) ? '' : base64_decode(rawUrlDecode($_GET['range']));\n\t\t\t\n\t\t\t$dateFrom = $this->input->get('from'); \n\t\t\t$dateTo = $this->input->get('to');\n\t\t\tif($range == '' && $dateFrom != '' && $dateTo != ''){\n\t\t\t\t$range = $dateFrom.' - '.$dateTo; \n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$locationId = $this->input->get('location_id');\n\t\t\t$driverCond = array();\n\t\t\t$driverCond = array('company_id'=>$company_id);\n\t\t\tif($locationId != '' && $locationId != 'all'){\n\t\t\t\t$driverCond = array('driver_location' => $locationId,'company_id'=>$company_id);\n\t\t\t}\n\t\t\t\n $selectFields = array('email', 'image', 'driver_name', 'vehicle_number', 'vehicle_model', 'no_of_rides', 'cancelled_rides', 'mobile_number', 'dail_code');\n $driversCount = $this->revenue_model->get_all_counts(DRIVERS,$driverCond);\n if ($driversCount > 500) {\n $limitPerPage = 100;\n $offsetVal = 0;\n if (isset($_GET['per_page'])) {\n $offsetVal = $this->input->get('per_page');\n }\n\n $driverDetails = $this->revenue_model->get_selected_fields(DRIVERS, $driverCond, $selectFields, array(), $limitPerPage, $offsetVal);\n\n if(!isset($_GET['range']) && $dateFrom != '' && $dateTo != ''){\n\t\t\t\t\t$manRange = 'from='.urlencode($dateFrom).'&to='.urlencode($dateTo);\n\t\t\t\t\t$searchbaseUrl = COMPANY_NAME.'/revenue/display_site_revenue?' . $manRange;\n\t\t\t\t} else {\n\t\t\t\t\t$searchbaseUrl = COMPANY_NAME.'/revenue/display_site_revenue?range=' . $req;\n\t\t\t\t}\n\t\t\t\t\n $config['num_links'] = 3;\n $config['display_pages'] = TRUE;\n $config['page_query_string'] = TRUE;\n $config['base_url'] = $searchbaseUrl;\n $config['total_rows'] = $driversCount;\n $config[\"per_page\"] = $limitPerPage;\n $config[\"uri_segment\"] = 4;\n $config['first_link'] = '';\n $config['last_link'] = '';\n $config['full_tag_open'] = '<ul class=\"tsc_pagination tsc_paginationA tsc_paginationA01\">';\n $config['full_tag_close'] = '</ul>';\n if ($this->lang->line('pagination_prev_lbl') != '') $config['prev_link'] =stripslashes($this->lang->line('pagination_prev_lbl')); else $config['prev_link'] ='Prev';\n $config['prev_tag_open'] = '<li>';\n $config['prev_tag_close'] = '</li>';\n if ($this->lang->line('pagination_next_lbl') != '') $config['next_link'] =stripslashes($this->lang->line('pagination_next_lbl')); else $config['next_link'] ='Next';\n $config['next_tag_open'] = '<li>';\n $config['next_tag_close'] = '</li>';\n $config['cur_tag_open'] = '<li class=\"current\"><a href=\"javascript:void(0);\" style=\"cursor:default;\">';\n $config['cur_tag_close'] = '</a></li>';\n $config['num_tag_open'] = '<li>';\n $config['num_tag_close'] = '</li>';\n $config['first_tag_open'] = '<li>';\n $config['first_tag_close'] = '</li>';\n $config['last_tag_open'] = '<li>';\n $config['last_tag_close'] = '</li>';\n if ($this->lang->line('pagination_first_lbl') != '') $config['first_link'] =stripslashes($this->lang->line('pagination_first_lbl')); else $config['first_link'] ='First';\n if ($this->lang->line('pagination_last_lbl') != '') $config['last_link'] = stripslashes($this->lang->line('pagination_last_lbl')); else $config['last_link'] ='Last';\n $this->pagination->initialize($config);\n $paginationLink = $this->pagination->create_links();\n $this->data['paginationLink'] = $paginationLink;\n } else {\n $this->data['paginationLink'] = '';\n $driverDetails = $this->revenue_model->get_selected_fields(DRIVERS, $driverCond, $selectFields);\n }\n \n $dates = @explode('-', $range);\n $mfrom = '';\n $mto = '';\n\n if (count($dates) == 2) {\n $mfrom = trim($dates[0]);\n $mto = trim($dates[1]);\n } else {\n $mto = get_time_to_string(\"m/d/Y\");\n if ($billingsList->num_rows() == 0) {\n $mfrom = get_time_to_string(\"m/d/Y\", strtotime(\"first day of this month\"));\n } else {\n $mfrom = get_time_to_string(\"m/d/Y\", strtotime(\"+1 day\", MongoEPOCH($billingsList->row()->bill_period_to)));\n }\n }\n\n if ($billingsList->num_rows() == 0) {\n $last_bill = get_time_to_string(\"m/d/Y\", strtotime(\"first day of this month\"));\n } else {\n $last_bill = get_time_to_string(\"m/d/Y\", strtotime(\"+1 day\", MongoEPOCH($billingsList->row()->bill_period_to)));\n }\n\n $filter = '';\n $fromdate = '';\n $todate = '';\n $fdate = '';\n $tdate = '';\n if ($mfrom != \"\" && $mto != \"\") {\n $filter = 'dummy';\n $fromdate = strtotime($mfrom . ' 00:00:00');\n $todate = strtotime($mto . ' 23:59:59');\n }\n $this->data['filter'] = $filter;\n $this->data['last_bill'] = $last_bill;\n\n $cB = get_time_to_string(\"m/d/Y\", $fromdate) . ' - ' . get_time_to_string(\"m/d/Y\", $todate);\n $this->data['cB'] = $cB;\n\n if ($fromdate != '' && $todate != '') {\n $fdate = $fromdate;\n $tdate = $todate;\n }\n\n $totalRides = 0;\n $totalRevenue = 0;\n $siteRevenue = 0;\n $driverRevenue = 0;\n if ($driverDetails->num_rows() > 0) {\n foreach ($driverDetails->result() as $driver) {\n $total_rides = 0;\n $cancelled_rides = 0;\n $successfull_rides = 0;\n $total_revenue = 0;\n $in_site = 0;\n $couponAmount = 0;\n $in_driver = 0;\n $total_due = 0;\n $site_earnings = 0;\n $driver_earnings = 0;\n $tips_amount = 0;\n $tips_in_site = 0;\n $tips_in_driver = 0;\n\n $driver_id = (string) $driver->_id;\n $driver_name = (string) $driver->driver_name;\n $driver_email = (string) $driver->email;\n $driver_phone = (string) $driver->dail_code . $driver->mobile_number;\n $driver_image = USER_PROFILE_IMAGE_DEFAULT;\n if (isset($driver->image)) {\n if ($driver->image != '') {\n $driver_image = USER_PROFILE_IMAGE . $driver->image;\n }\n }\n $rideDetails = $this->revenue_model->get_ride_details_company($driver_id, $fdate, $tdate,$company_id);\n\n if (!empty($rideDetails['result'])) {\n $total_rides = $rideDetails['result'][0]['totalTrips'];\n $total_revenue = $rideDetails['result'][0]['totalAmount'];\n #$in_site = $rideDetails['result'][0]['by_wallet'];\n $couponAmount = $rideDetails['result'][0]['couponAmount'];\n $site_earnings = $rideDetails['result'][0]['site_earnings'];\n $driver_earnings = $rideDetails['result'][0]['driver_earnings'];\n\t\t\t\t\t\t\n if (isset($rideDetails['result'][0]['tipsAmount'])) {\n $tips_amount = $rideDetails['result'][0]['tipsAmount'];\n }\n if (isset($rideDetails['result'][0]['amount_in_site'])) {\n $in_site = $rideDetails['result'][0]['amount_in_site'];\n }\n if (isset($rideDetails['result'][0]['amount_in_driver'])) {\n $in_driver = $rideDetails['result'][0]['amount_in_driver'];\n }\n }\n\n $driver_earnings = $driver_earnings + $tips_amount;\n\n $this->data['driversList'][$driver_id]['id'] = $driver_id;\n $this->data['driversList'][$driver_id]['driver_name'] = $driver_name;\n $this->data['driversList'][$driver_id]['driver_email'] = $driver_email;\n $this->data['driversList'][$driver_id]['driver_image'] = base_url() . $driver_image;\n $this->data['driversList'][$driver_id]['driver_phone'] = $driver_phone;\n\t\t\t\t\t\n\t\t\t\t\t$this->data['driversList'][$driver_id]['total_rides'] = $total_rides;\n $this->data['driversList'][$driver_id]['total_revenue'] = $total_revenue;\n $this->data['driversList'][$driver_id]['in_site'] = $in_site;\n $this->data['driversList'][$driver_id]['couponAmount'] = $couponAmount;\n $this->data['driversList'][$driver_id]['in_driver'] = $in_driver;\n $this->data['driversList'][$driver_id]['total_due'] = $total_due;\n\n $this->data['driversList'][$driver_id]['site_earnings'] = $site_earnings;\n $this->data['driversList'][$driver_id]['driver_earnings'] = $driver_earnings;\n $this->data['driversList'][$driver_id]['driver_tips'] = $tips_amount;\n\t\n }\n } \n $rideSummary = $this->revenue_model->get_ride_summary_company($fdate, $tdate,$company_id,$locationId);\n \n if (!empty($rideSummary['result'])) {\n $totalRides = $rideSummary['result'][0]['totalTrips'];\n $siteRevenue = $rideSummary['result'][0]['site_earnings'];\n $driverRevenue = $rideSummary['result'][0]['driver_earnings'];\n $totalRevenue = $siteRevenue + $driverRevenue;\n }\n\n $this->data['totalRides'] = $totalRides;\n $this->data['totalRevenue'] = $totalRevenue;\n $this->data['siteRevenue'] = $siteRevenue;\n $this->data['driverRevenue'] = $driverRevenue;\n\n $this->data['fromdate'] = $mfrom;\n $this->data['todate'] = $mto;\n\n\n $this->data['billingsList'] = $billingsList;\n\t\t\t\n\t\t\t $this->data['locationList'] = $this->revenue_model->get_all_details(LOCATIONS, array('status' => 'Active'), array('city' => 'ASC'));\n\n if ($this->lang->line('admin_site_earnings_total_revenue_list') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_site_earnings_total_revenue_list')); \n\t\t else $this->data['heading'] = 'Total Revenue List';\n $this->load->view(COMPANY_NAME.'/revenue/display_site_revenue', $this->data);\n }\n }", "public function retrieveRevenueAverage()\n {\n $query = \"SELECT AVG(revenue) AS avgRevenue FROM (SELECT CONCAT(YEAR(date), '/', MONTH(date)) AS theMonth, SUM(exlAmount) AS revenue FROM payment GROUP BY theMonth ORDER BY YEAR(DATE) ASC, MONTH(date) ASC) AS T1;\";\n $result = mysqli_query($GLOBALS['db'], $query);\n $row = mysqli_fetch_assoc($result);\n return $row;\n }", "function getRevenuesData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='daily' || $varAction=='yesterday'){\n if($varAction=='daily'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n $sum=0;\n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,TIME(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded < '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$i]['time']=$arrData;\n $arrRes['data'][$i]['count']=$currSum;\n }\n $arrRes['total']=$sum;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='weekly'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,DATE(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded <= '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$currSum;\n //\n //$count=count($arrData);\n //$arrRes['data'][$key]['dates']=$arrData;\n //$arrRes['data'][$key]['count']=$count;\n //$total +=$count;\n }\n $arrRes['total']=$sum;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='monthly'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $currMonth.'=='.$currMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,DATE(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded <= '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$currSum;\n \n \n //$arrClms = array('DATE(ItemDateAdded) as date');\n //$argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n //$argWhere .= 'AND Status <> \"Canceled\"';\n //\n //$arrData = $this->select($varTable, $arrClms, $argWhere);\n //$count=count($arrData);\n //$arrRes['data'][$key]['dates']=$arrData;\n //$arrRes['data'][$key]['count']=$count;\n //$total +=$count; \n }\n $arrRes['total']=$sum;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function get_revenue_history( $args = array() ) {\n $default_args = array(\n 'group_by' => 'currency_id',\n 'order' => 'ASC',\n 'fields' => array(\n 'currency_id',\n 'SUM(price) AS amount',\n 'COUNT(*) AS quantity',\n 'DATE(date) AS date',\n 'DAY(date) AS day',\n 'MONTH(date) AS month',\n 'HOUR(date) AS hour',\n ),\n );\n $args = wp_parse_args( $args, $default_args );\n\n return $this->get_results( $args );\n }", "public function revenues()\n {\n return $this->hasMany('App\\revenue','store_id');\n }", "static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }", "public function show(Revenue $revenue)\n {\n return $this->response->item($revenue, new Transformer());\n }", "public function rankAffiliatesByRevenue()\n {\n $this->affiliates = DB::select(\"SELECT SUM(sale_amount) AS 'revenue', affiliate_id FROM \" . $this->source_table . \" GROUP BY (affiliate_id) ORDER BY sale_amount DESC LIMIT 1000;\");\n }", "public function retrieveRevenueThisMonth()\n {\n $query = \"SELECT SUM(exlAmount) as thisMonthTotal FROM payment WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE()));\";\n $result = mysqli_query($GLOBALS['db'], $query);\n $row = mysqli_fetch_assoc($result);\n return $row;\n }", "public function actionPending_revenue() {\n\n /* redirect a user if not super admin */\n if (!Yii::$app->CustomComponents->check_permission('pending_revenue')) {\n return $this->redirect(['site/index']);\n }\n\n $dataService = $this->quickbook_instance();\n $courses_from_qb = $dataService->Query(\"SELECT * FROM Item\");\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $user = Yii::$app->user->identity;\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n $data = Yii::$app->request->post();\n\n $filter_data = array();\n $by_team_arr = array();\n $month_year_arr = array();\n $all_invoice_of_customer = array();\n $allInvoices = array();\n $allPayments = array();\n\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n\n if ($data) {\n\n if ($user_role == 33) {\n $this->pending_revenue_manager_filter();\n } else {\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $user_id = $data['sales_user_id'];\n } else {\n $user_id = $user->id;\n }\n\n if ($user_role == 7) {\n $filters = [];\n } else if ($user_role == 6) {\n $filters = ['sales_user_id' => $data['sales_user_id']];\n } else if ($user_role == 1) {\n $filters = [];\n } else {\n $filters = ['sales_user_id' => $user_id];\n }\n\n $team_ids = array();\n if (isset($data['email']) && $data['email'] != '') {\n $filter_data['email'] = $data['email'];\n }\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n\n $new_date = explode('_', $data['bymonth']);\n $fyear = $new_date['1'];\n $fmonth = $new_date['0'];\n\n if ($fmonth <= 9 && strlen($fmonth) == 1) {\n $fmonth = \"0\" . $fmonth;\n }\n $first_date_of_current_month = date(\"$fyear-$fmonth-01\");\n $last_date_of_current_month = $lastday = date('Y-m-t', strtotime($first_date_of_current_month));\n } else if ($data['by_date_month'] == 'd') {\n $first_date_of_current_month = date(\"Y-m-d\", strtotime($data['sdate']));\n $last_date_of_current_month = date(\"Y-m-d\", strtotime($data['edate']));\n }\n\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $allInvoices = array();\n $qb_cust_id_arr = array();\n\n if ($user_role == 7) {\n \n } else if ($user_role == 6) {\n \n } else if ($user_role != 1) {\n $filter_data['sales_user_id'] = $user->id;\n }\n if (isset($data['by_date_month'])) {\n\n if ($user_role == 7) { /* If current user is not super admin */\n\n if (isset($data['byTeam']) && !empty($data['byTeam'])) {\n $by_team_arr['byTeam'] = $data['byTeam'];\n $byteam = $data['byTeam'];\n if (isset($data['sales_user_id']) && !empty($data['sales_user_id'])) {\n if (count($data['sales_user_id']) == 1 && empty($data['sales_user_id'][0])) {\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = $byteam \")->queryAll();\n $sales_head_str = \"\";\n if (!empty($team_model_val)) {\n foreach ($team_model_val as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str .= $byteam;\n $sales_head_str = rtrim($sales_head_str, \",\");\n\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n $sales_user_id_arr = $data['sales_user_id'];\n if (empty($data['sales_user_id'][0])) {\n $sales_user_id_arr[] = $data['byTeam'];\n }\n\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['in', 'sales_user_id', $sales_user_id_arr])->all();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n if (!empty($data['byTeam'])) {\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id = $team\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n }\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else if ($user_role == 6) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $data['sales_user_id']])->all();\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else if ($user_role != 1) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else { /* If current user is super admin */\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n } else {\n if ($user_role == 7) { /* If current user is not super admin */\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n }\n\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n if ($data['sdate'] != \"\" && $data['by_date_month'] == 'd') {\n $query = DvRegistration::find()\n ->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } elseif ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['assist_participant.id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n\n $query->andWhere(['>', 'qb_customer_id', 0]);\n $query->groupBy(['email']);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 20]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $filter_data['bymonth'] = $data['bymonth'];\n }\n if ($data['by_date_month'] != '') {\n $filter_data['by_date_month'] = $data['by_date_month'];\n }\n\n if ($data['sdate'] != '' && $data['by_date_month'] == 'd') {\n $filter_data['sdate'] = $data['sdate'];\n $filter_data['edate'] = $data['edate'];\n }\n\n if ($data['email'] != \"\") {\n $filter_data['email'] = $data['email'];\n }\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $filter_data['sales_user_id'] = $data['sales_user_id'];\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n\n $invoice_number = \"\";\n $total_of_all_currencys = array();\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n /* echo \"<pre>\";\n print_r($models);\n die; */\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'pagination' => $pagination,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'count' => $offset,\n 'total_count' => $count,\n 'filter_data' => $filter_data,\n 'by_team_arr' => $by_team_arr,\n 'allInvoices' => $allInvoices,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month,\n 'courses_from_qb' => $courses_from_qb\n ]);\n }\n } else {\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n if ($user_role == 1) {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n $query = DvRegistration::find()->where(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 6) {\n $sales_heads = Yii::$app->db->createCommand(\"SELECT assist_users.id FROM assist_users INNER JOIN assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.status = 1 AND assist_users.department = 1 AND assist_user_meta.meta_key = 'team' AND assist_user_meta.meta_value=$user->id\")->queryAll();\n $sales_heads_str = \"\";\n if (!empty($sales_heads)) {\n foreach ($sales_heads as $m_sales_head) {\n $sales_heads_str .= $m_sales_head['id'] . \",\";\n }\n }\n $sales_heads_str .= $user->id;\n $sales_heads_str = rtrim($sales_heads_str, \",\");\n\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_heads_str )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 7) {\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' \")->queryAll();\n\n $executive_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) \")->queryAll();\n $team_model_val[]['uid'] = $user->id;\n $combined_sales_head_arr = array_merge($team_model_val, $executive_model_val);\n\n $sales_head_str = \"\";\n if (!empty($combined_sales_head_arr)) {\n foreach ($combined_sales_head_arr as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str = rtrim($sales_head_str, \",\");\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n /* echo \"<pre>\";\n print_r($all_invoice_of_customer);\n die; */\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['sales_user_id' => $user->id])->andWhere(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n $query->groupBy(['email']);\n $query->orderBy(['id' => SORT_DESC]);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 10]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n // echo \"in\"; die;\n // Start Get Total of different currency \n $invoice_number = \"\";\n $total_of_all_currencys = array();\n\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'pagination' => $pagination,\n 'count' => $offset,\n 'total_count' => $count,\n 'allInvoices' => $allInvoices,\n 'courses_from_qb' => $courses_from_qb,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month\n ]);\n }\n }", "public function index()\n {\n return Revenue::latest()->paginate(10);\n }", "public function sumRevenueAnalytics(Request $request, $period)\n {\n $orders = Order::LatestOrder('ASC')->withScopes($this->scopes())->get()->groupBy($period);\n\n if ($orders->isEmpty()) {\n return new RevenueAnalyticsResource([]);\n }\n\n $numbers = $orders->mapToGroups(function ($items, $key) {\n return [\n 'revenue' => $items->sum(function($item){\n return $item->revenue();\n })\n ];\n });\n\n return new RevenueAnalyticsResource($numbers->merge(['status' => $orders->keys()]));\n }", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "public function reports_revenue(Request $request){\n // $reports_salary = DB::table('reservation_details')->orderBy('id','desc')->paginate();\n return view('admin.reports.reports_revenue');\n }", "public function purchaseSalesGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t\r\n\t\t$arrayData=array();\r\n\t\t$cashData=array();\r\n\t\t//total sales in amount\r\n\t\t\t$saleQuery='SELECT sum(invoice_total_value) as total_sales FROM '.$this->tableNames['client_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\" \r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\t\t\t\r\n\t\t\t//total purchase in amount\r\n\t\t\t$purchaseQuery = 'SELECT sum(invoice_total_value) as total_purchase FROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\"\r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\r\n\t\t\t$totalSales = $this->get_row($saleQuery,false);\r\n\t\t\t$totalPurchase = $this->get_row($purchaseQuery,false);\r\n\t\t\t\r\n\t\t\tif(empty($totalSales)) {\r\n\t\t\t\t$cashData['sales'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['sales'] = $totalSales[0];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(empty($totalPurchase)) {\r\n\t\t\t\t$cashData['purchase'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['purchase'] = $totalPurchase[0];\r\n\t\t\t\t$cashData['month'] = $financial_month;\r\n\t\t\t}\r\n\t\t\tarray_push($arrayData, $cashData);\r\n\t\t\treturn $arrayData;\r\n\t}", "public function index()\n {\n\n $data = Purchase::select(DB::raw('month(purchases.created_at) as month'), DB::raw('SUM(purchases.payment) as aggregates'))->groupBy(DB::raw('month(purchases.created_at)'))->get();\n \n $purchases = Charts::create('line', 'highcharts')\n ->title('Purchase Statistics')\n ->elementLabel('Purchase Statistics')\n ->dimensions(550, 400)\n ->responsive(false)\n ->labels($data->pluck('month'))\n ->values($data->pluck('aggregates'));\n\n $data = Expense::select(DB::raw('month(expenses.created_at) as month'), DB::raw('SUM(expenses.ex_amount) as aggregates'))->groupBy(DB::raw('month(expenses.created_at)'))->get();\n\n $data = Sale::select(DB::raw('date(sales.created_at) as date'), DB::raw('SUM(sales.spayment) as aggregates'))->groupBy(DB::raw('date(sales.created_at)'))->get();\n \n $sales = Charts::create('bar', 'highcharts')\n ->title('Sale Statistics')\n ->elementLabel('Sale Statistics')\n ->dimensions(1140, 400)\n ->responsive(false)\n ->labels($data->pluck('date'))\n ->values($data->pluck('aggregates'));\n\n $data = Expense::select(DB::raw('date(expenses.created_at) as date'), DB::raw('SUM(expenses.ex_amount) as amount'))->groupBy(DB::raw('date(expenses.created_at)'))->get();\n //dd($data);\n $expense = Charts::create('line', 'highcharts')\n ->title('Expense Statistics')\n ->elementLabel('Expense Statistics')\n ->dimensions(550, 400)\n ->responsive(false)\n ->labels($data->pluck('date'))\n ->values($data->pluck('amount'));\n\n $shop = DB::table('settings')->pluck('shop_name');\n $logo = DB::table('settings')->pluck('logo');\n $copy = DB::table('settings')->pluck('copy');\n\n return view('dashboard')->withPurchases($purchases)->withSales($sales)->withExpense($expense)->withShop($shop)->withLogo($logo)->withCopy($copy);\n }", "function total_video_revenue() {\n return PayPerView::sum('amount');\n}", "public function index()\n {\n return \\response()->json(collect(Revenue::latest()->paginate(15)));\n }", "public function response_rom()\n {\n $roms = $this->roms;\n $data=[];\n $village_rom=new SampleChart;\n /*\n $villages = DB::table('households')\n ->join('villages','households.village_id','=','villages.id')\n ->join('stats','households.id','=','stats.household_id')\n ->select(DB::raw('sum(stats.household_count) as sum, villages.village_name'))\n ->whereIn('households.nationality',$roms)\n ->groupBy('villages.village_name')\n ->get();\n */\n $villages = DB::table('village_stats')\n ->select('village_stats.*')\n ->orderBy('village_stats.village_name')\n ->get();\n\n\n foreach ($villages as $village) {\n //$name[]=$village->village_name;\n $sum[]=$village->roms_count;\n\n }\n\n\n //$village_rom->dataset('Households(total)', 'bar', $households)->color('#00ff00');\n $village_rom->dataset('Roms per village', 'bar', $sum)->color('#00ff00');\n //$village_rom->dataset('Roms total', 'bar', $rom_total)->color('#ff0000');\n return $village_rom->api();\n\n }", "public function getLastSevenDaysRevenue() {\n $userClient = Auth::user()->clientID;\n\n if($userClient == 1) {\n \t\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id GROUP BY DATE DESC LIMIT 7\");\n } else {\n\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id WHERE ccr.clientID='$userClient' or ccr.destinationClientID='$userClient' GROUP BY DATE DESC LIMIT 7\");\n }\n\n \treturn $result;\n\n }", "public function ppv_revenue(Request $request) {\n\n $currency = Setting::get('currency');\n\n $take = $request->take ? $request->take : Setting::get('admin_take_count');\n\n $model = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)\n ->orderBy('vod_videos.user_amount', 'desc')->skip($request->skip)\n ->take($take)->get();\n\n $data = [];\n\n $user_commission = VodVideo::where('vod_videos.user_id', $request->id)->sum('user_amount');\n\n foreach ($model as $key => $value) {\n \n $data[] = [\n 'vod_id'=>$value->vod_id,\n 'title'=>$value->title,\n 'user_id'=>$value->user_id,\n 'description'=>$value->description,\n 'image'=>$value->image,\n 'amount'=>$value->amount,\n 'admin_amount'=>$value->admin_amount,\n 'user_amount'=>$value->user_amount,\n 'created_at'=>$value->created_at->diffForhumans(),\n 'currency'=>$value->currency,\n 'unique_id'=>$value->unique_id\n ];\n\n }\n\n $paid_videos = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)\n ->where('vod_videos.user_amount', '>', 0)->count();\n\n $total_videos = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)->count();\n\n $response_array = ['success'=>true, 'data'=>$data, \n 'total_amount'=>$user_commission, \n 'currency'=>$currency, \n 'total_paid_videos'=>$paid_videos ? $paid_videos : 0,\n 'total_videos'=>$total_videos ? $total_videos : 0];\n\n return response()->json($response_array);\n }", "public function get_main_chart() {\n\t\tglobal $wp_locale;\n\n\t\t// Get orders and dates in range - we want the SUM of order totals, COUNT of order items, COUNT of orders, and the date\n\t\t$orders = $this->get_order_report_data( array(\n\t\t\t'data' => array(\n\t\t\t\t'ID' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => 'COUNT',\n\t\t\t\t\t'name' => 'total_orders',\n\t\t\t\t\t'distinct' => true,\n\t\t\t\t),\n\t\t\t\t'post_date' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => '',\n\t\t\t\t\t'name' => 'post_date'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'group_by' => $this->group_by_query,\n\t\t\t'order_by' => 'post_date ASC',\n\t\t\t'query_type' => 'get_results',\n\t\t\t'filter_range' => true\n\t\t) );\n\n\t\t// Get Abadoned Carts in range 1 years\n\t\t$abandoned_carts_items = CartModel::get_carts_one_year();\n\t\t$ee_abandoned_posts = array();\n\n\t\tif ( $abandoned_carts_items ) {\n\n\t\t\tforeach ( $abandoned_carts_items as $order_item ) {\n\t\t\t\t$date = date( 'Y-m-d h:i:s', $order_item->post_date );\n\n\t\t\t\t$obj = new stdClass();\n\t\t\t\t$obj->post_date = $date;\n\t\t\t\t$obj->abandoned_cart_itms = 1;\n\n\t\t\t\t$ee_abandoned_posts[] = $obj;\n\t\t\t}\n\t\t}\t\n\n\t\t// Prepare data for report\n\t\t$order_counts = $this->prepare_chart_data( $orders, 'post_date', 'total_orders', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$abandoned_carts_encoded = $this->prepare_chart_data( $ee_abandoned_posts, 'post_date', 'abandoned_cart_itms', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t\n\t\t// Encode in json format\n\t\t$chart_data = json_encode( array(\n\t\t\t'order_counts' => array_values( $order_counts ),\n\t\t\t'abandoned_cart_itms' => array_values( $abandoned_carts_encoded )\n\t\t) );\n\t\t?>\n\n\t\t<?php //echo $chart_data; ?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar order_data = jQuery.parseJSON( '<?php echo $chart_data; ?>' );\n\t\t\t\tvar drawGraph = function( highlight ) {\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Number of conversions', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.order_counts,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['order_counts']; ?>',\n\t\t\t\t\t\t\tbars: { fillColor: '<?php echo $this->chart_colours['order_counts']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Abandoned Carts', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.abandoned_cart_itms,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['abandoned_carts']; ?>',\n\t\t\t\t\t\t\tpoints: { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines: { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars )\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery('.chart-placeholder.main'),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t grid: {\n\t\t\t\t\t\t color: '#aaa',\n\t\t\t\t\t\t borderColor: 'transparent',\n\t\t\t\t\t\t borderWidth: 0,\n\t\t\t\t\t\t hoverable: true\n\t\t\t\t\t\t },\n\t\t\t\t\t\t xaxes: [ {\n\t\t\t\t\t\t \tcolor: '#aaa',\n\t\t\t\t\t\t \tposition: \"bottom\",\n\t\t\t\t\t\t \ttickColor: 'transparent',\n\t\t\t\t\t\t\t\tmode: \"time\",\n\t\t\t\t\t\t\t\ttimeformat: \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,\n\t\t\t\t\t\t\t\ttickLength: 1,\n\t\t\t\t\t\t\t\tminTickSize: [1, \"<?php echo $this->chart_groupby; ?>\"],\n\t\t\t\t\t\t\t\tfont: {\n\t\t\t\t\t\t \t\tcolor: \"#aaa\"\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t yaxes: [\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\tminTickSize: 1,\n\t\t\t\t\t\t \t\ttickDecimals: 0,\n\t\t\t\t\t\t \t\tcolor: '#d4d9dc',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\n\t\t\t\t\t\t \t},\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tposition: \"right\",\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\ttickDecimals: 2,\n\t\t\t\t\t\t \t\talignTicksWithAxis: 1,\n\t\t\t\t\t\t \t\tcolor: 'transparent',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t ],\n\t\t\t\t \t\t}\n\t\t\t\t \t);\n\n\t\t\t\t\tjQuery('.chart-placeholder').resize();\n\t\t\t\t}\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery('.highlight_series').hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery(this).data('series') );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function index()\n {\n $revenues = Revenue::with(['account', 'customer', 'category'])->collect();\n\n return $this->response->paginator($revenues, new Transformer());\n }", "public function show($id)\n {\n return response()->json(Revenue::findOrFail($id));\n }", "public function purchaseSalesInvoiceGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t$invoiceArray=array();\r\n\t\t$invoiceData=array();\r\n\t\t\r\n\t\t$saleInvoice='SELECT count(reference_number) as sales_invoice \r\n\t\tFROM '.$this->tableNames['client_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\t\t\r\n\t\t//total purchase invoice\r\n\t\t$purchaseInvoice = 'SELECT count(reference_number) as purchase_invoice \r\n\t\tFROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\r\n\t\t$totalSalesInvoice = $this->get_row($saleInvoice,false);\r\n\t\t$totalPurchaseInvoice = $this->get_row($purchaseInvoice,false);\r\n\t\t\r\n\t\tif(empty($totalSalesInvoice)) {\r\n\t\t\t$invoiceData['sales'] = \"0\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['sales'] = $totalSalesInvoice[0];\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($totalPurchaseInvoice)) {\r\n\t\t\t$invoiceData['purchase'] = \"0.00\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['purchase'] = $totalPurchaseInvoice[0];\r\n\t\t\t$invoiceData['month'] = $financial_month;\r\n\t\t}\r\n\t\tarray_push($invoiceArray, $invoiceData);\r\n\t\treturn $invoiceArray;\r\n\t}" ]
[ "0.6808142", "0.6577448", "0.6535899", "0.61825943", "0.6147914", "0.60683346", "0.59769905", "0.5923115", "0.5867847", "0.58664966", "0.58308786", "0.5800799", "0.57747054", "0.5715249", "0.5677219", "0.56616706", "0.5611785", "0.5584933", "0.55576986", "0.55254954", "0.5508388", "0.5504666", "0.5482957", "0.542023", "0.5404219", "0.5401058", "0.5359872", "0.53249246", "0.5317315", "0.5302873" ]
0.6911764
0
$listCinema = $cinemaList; // no hace falta asignar la variable a otra variable en este ambito ya que lo trae del otro metodo
public function ShowListCinemaView($listCinema, $message = '') { require_once(VIEWS_PATH."cinema-list.php"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDashboardCinemaList(){\n $cinema_ads = Cinemas::all();\n return view('backend.mediatypes.cinemas.cinema-list', ['cinema_ads' => $cinema_ads]);\n }", "function getLista(){\n\n }", "public function getCinema()\n {\n return $this->cinema;\n }", "function searchMoviesFromCinema($sCinema, array $aCinemas, array $aMovies)\n{\n $aSearchMovies = array();\n foreach ($aCinemas[$sCinema]['rooms'] as $iMovieId) {\n $aSearchMovies[] = $aMovies[$iMovieId];\n }\n\n return $aSearchMovies;\n}", "function getListeChamps()\n{\n\t// ATTENTION, respecter l'ordre des champs de la table dans la base de données pour construire laListeChamp\n\t$laListeChamps[]=new dbChamp(\"Cms_id\", \"entier\", \"get_id\", \"set_id\");\n\t$laListeChamps[]=new dbChamp(\"Cms_type\", \"entier\", \"get_type\", \"set_type\");\n\t$laListeChamps[]=new dbChamp(\"Cms_title\", \"text\", \"get_title\", \"set_title\");\n\t$laListeChamps[]=new dbChamp(\"Cms_description\", \"text\", \"get_description\", \"set_description\");\n\t$laListeChamps[]=new dbChamp(\"Cms_thumbnail_loc\", \"text\", \"get_thumbnail_loc\", \"set_thumbnail_loc\");\n\t$laListeChamps[]=new dbChamp(\"Cms_file\", \"text\", \"get_file\", \"set_file\");\n\t$laListeChamps[]=new dbChamp(\"Cms_youtube\", \"text\", \"get_youtube\", \"set_youtube\");\n\t$laListeChamps[]=new dbChamp(\"Cms_content_loc\", \"text\", \"get_content_loc\", \"set_content_loc\");\n\t$laListeChamps[]=new dbChamp(\"Cms_player_loc\", \"text\", \"get_player_loc\", \"set_player_loc\");\n\t$laListeChamps[]=new dbChamp(\"Cms_duration\", \"text\", \"get_duration\", \"set_duration\");\n\t$laListeChamps[]=new dbChamp(\"Cms_tag\", \"text\", \"get_tag\", \"set_tag\");\n\t$laListeChamps[]=new dbChamp(\"Cms_category\", \"text\", \"get_category\", \"set_category\");\n\t$laListeChamps[]=new dbChamp(\"Cms_family_friendly\", \"entier\", \"get_family_friendly\", \"set_family_friendly\");\n\t$laListeChamps[]=new dbChamp(\"Cms_cms_site\", \"entier\", \"get_cms_site\", \"set_cms_site\");\n\t$laListeChamps[]=new dbChamp(\"Cms_statut\", \"entier\", \"get_statut\", \"set_statut\");\n\treturn($laListeChamps);\n}", "function list_jenis_kelamin() {\n $list = ['laki - laki', 'perempuan'];\n \n return $list;\n}", "function desList(){\n\t$sql = 'SELECT * FROM votos';\n\t$resultado = mysql_query($sql);\n\t\n\twhile($row = mysql_fetch_array($resultado)){\n\t\toculta( $row['cancion'] );\n \t}\n}", "function adiHijo($lista) {\n\t\t$this->listas[] = $lista;\n\t}", "static function listaStilova(){\n\t\t$stilovi=\"\";\n\t\treturn $stilovi;\n\t}", "function getListeChamps()\n{\n\t// ATTENTION, respecter l'ordre des champs de la table dans la base de données pour construire laListeChamp\n\t$laListeChamps[]=new dbChamp(\"Xdc_id\", \"entier\", \"get_id\", \"set_id\");\n\t$laListeChamps[]=new dbChamp(\"Xdc_cms_description\", \"entier\", \"get_cms_description\", \"set_cms_description\");\n\t$laListeChamps[]=new dbChamp(\"Xdc_classe\", \"entier\", \"get_classe\", \"set_classe\");\n\t$laListeChamps[]=new dbChamp(\"Xdc_classeid\", \"entier\", \"get_classeid\", \"set_classeid\");\n\treturn($laListeChamps);\n}", "function cheezeList($cheezeList){\n $cheezeListView = \"\\nLes frommages : \\n\";\n for($i=0;$i<count($cheezeList);$i++){\n $cheezeListView .= $i.\")\".$cheezeList[$i].\"\\n\";\n }\n return $cheezeListView;\n }", "function create_movie_lists() {\n\t\tforeach($movie_list as $current_movie) {\n\t\t\tmake_one_movie_list($current_movie);\n\t\t}\n\t}", "function getListMarca()\n{\n global $conn;\n /*\n *query da disciplina\n */\n $sqld = \"SELECT\n cat_id,\n cat_titulo\n\n FROM \".TABLE_PREFIX.\"_categoria\n WHERE cat_status=1 AND cat_area='Marca'\n ORDER BY cat_titulo\";\n\n $disciplina = array();\n if(!$qryd = $conn->prepare($sqld))\n echo divAlert($conn->error, 'error');\n\n else {\n\n $qryd->execute();\n $qryd->bind_result($id, $titulo);\n\n while ($qryd->fetch())\n $disciplina[$id] = $titulo;\n\n $qryd->close();\n\n\n }\n\n return $disciplina;\n}", "function buscaMaiorLanceCrescente ($listaDeLances){ \n usort($listaDeLances, array($this, 'comparaLancesCrescente')); //ordena lista\n $maiorlance = $this->buscaMaiorLance($listaDeLances);\n return $maiorlance;\n }", "public function setCinema($cinema)\n {\n $this->cinema = $cinema;\n\n return $this;\n }", "public function index(Cinemas $cinema)\n {\n $cinemas = array();\n return view('cinemas.show',compact('cinemas'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "function listar_meses()\n{\n $meses = [\n '1' => 'Enero',\n '2' => 'Febrero',\n '3' => 'Marzo',\n '4' => 'Abril',\n '5' => 'Mayo',\n '6' => 'Junio',\n '7' => 'Julio',\n '8' => 'Agosto',\n '9' => 'Septiembre',\n '10' => 'Octubre',\n '11' => 'Noviembre',\n '12' => 'Diciembre',\n ];\n\n return $meses;\n}", "function outputContinents() {\r\n $continents = new ContinentCollection();\r\n $continents->loadCollection();\r\n \r\n $result = $continents->getArray();\r\n \r\n for($i=0;$i<$continents->getCount();$i++){\r\n \r\n echo '<li class=\"list-group-item\"><a href=\"#\">' . $result[$i]->getContinentName() . '</a></li>';\r\n \r\n }\r\n}", "function getListeChamps()\n{\n\t// ATTENTION, respecter l'ordre des champs de la table dans la base de données pour construire laListeChamp\n\t$laListeChamps[]=new dbChamp(\"Xps_id\", \"entier\", \"get_id\", \"set_id\");\n\t$laListeChamps[]=new dbChamp(\"Xps_cms_prepend\", \"entier\", \"get_cms_prepend\", \"set_cms_prepend\");\n\t$laListeChamps[]=new dbChamp(\"Xps_cms_site\", \"entier\", \"get_cms_site\", \"set_cms_site\");\n\treturn($laListeChamps);\n}", "public function listar(){\r\n }", "function listado();", "public function list();", "public function list();", "public function list();", "function resetList(){\n\n\t$sql = 'SELECT * FROM votos';\n\t$resultado = mysql_query($sql);\n\t\n\twhile($row = mysql_fetch_array($resultado)){\n\t\tvisible( $row['cancion'] );\n \t}\n\n}", "public function getCampusList(){\n $campuses = \"\";\n $sql = \"SELECT * FROM campus ORDER BY campusName ASC\";\n $result = db::returnallrows($sql);\n foreach($result as $campus){\n $campuses .= \"<option value='\".$campus['campusid'].\"'>\".$campus['campusName'].\"</option>\";\n }\n \n return $campuses;\n\n }", "function listarCitasDisponibles()\n\t\t{\n\t\t\t$dia = $this->uri->segment(3);\n\t\t\t$mes = $this->uri->segment(4);\n\t\t\t$year = $this->uri->segment(5);\n\t\t\t$diaDeLaSemana = date('N',mktime(0, 0, 0, $mes, $dia, $year));\n\t\t\t\n\t\t\t//Obetenemos los arrays de horarios del dia de la semana concreto\n\t\t\t$diasSemana = $this->PacienteModel->getCalendario();\n\t\t\tforeach ($diasSemana as $value) {\n\t\t\t\tif($diaDeLaSemana == $value->Dia)\n\t\t\t\t{\n\t\t\t\t\t$horaInicio = explode(':', $value->HoraInicio);\n\t\t\t\t\t$horaFin = explode(':', $value->HoraFin);\n\t\t\t\t\t$duracionCita[] = $value->DuracionCita;\n\t\t\t\t\t$unixInicio[] = mktime($horaInicio[0], $horaInicio[1], 0, $mes, $dia, $year);\n\t\t\t\t\t$unixFin[] = mktime($horaFin[0], $horaFin[1], 0, $mes, $dia, $year);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Comprobamos las citas planificadas para el dia concreto\n\t\t\t$data = $this->PacienteModel->getCitasDisponibles($dia, $mes, $year);\n\t\t\tforeach ($data as $value) {\n\t\t\t\t$aux = explode(\" \", $value->FechaIni);\n\t\t\t\t$aux = $aux[1];\n\t\t\t\t$aux = explode(\":\", $aux);\n\t\t\t\t$hora[] = $aux[0];\n\t\t\t\t$min[] = $aux[1];\n\t\t\t}\n\t\t\t\n\t\t\t//Si no hay ninguna cita se ponen los arrays fuera de rango\n\t\t\tif(!isset($hora) && !isset($min))\n\t\t\t{\n\t\t\t\t$hora[0] = -1;\n\t\t\t\t$min[0] = -1;\n\t\t\t}\n\n\t\t\t//Visualizamos las citas disponibles\n\t\t\techo '<ul class=\"list-group\">';\n\t\t\techo '<li class=\"list-group-item\">'.date('d-m-Y',mktime(0, 0, 0, $mes, $dia, $year)).'</li>';\n\t\t\tfor($j = 0; $j < sizeof($unixInicio); $j++)\n\t\t\t\tfor($i = $unixInicio[$j]; $i < $unixFin[$j]; $i += 60*$duracionCita[$j] )\n\t\t\t\t{\n\t\t\t\t\tif ( (in_array(date('H',$i), $hora) && in_array(date('i',$i), $min) )\n\t\t\t\t\t\t|| time()>$i )\n\t\t\t\t\t\techo '<li class=\"list-group-item\">'.date('H:i',$i).'</li>';\n\t\t\t\t\telse \n\t\t\t\t\t\techo '<li class=\"list-group-item active\">\n\t\t\t\t\t\t\t<a style=\"color: black;\" onclick=\"crearCita(\\''.$this->session->userdata('id').'\\',\n\t\t\t\t\t\t\t\\''.date('Y-m-d H:i:s',$i).'\\',\n\t\t\t\t\t\t\t\\''.date('Y-m-d H:i:s',$i + 60 * $duracionCita[$j]).'\\'\n\t\t\t\t\t\t\t)\">'.date('H:i',$i).'</a></li>';\n\t\t\t\t}\n\t\t\techo '</ul>';\n\t\t}", "public function verMarcaslista(){\n\t\t\t//$this->producto->set(\"marca\",$marca);\n\t\t\t$resultado=$this->producto->verMarcaslista();\n\t\t return $resultado;\n\t\t\t\n\t\t}", "public function lists();", "public function Lista_Ciudades()//FUNCION PARA LLAMAR LA LISTA DE DEPARTAMENTOS\n {\n \n include('conexion.php');\n \n\n $Consulta_Ciudad = \"SELECT * FROM p_ciudad ORDER BY ciud_nombre\";\n\t\t\t $Resultado_Consulta_Ciudad = $conexion->prepare($Consulta_Ciudad);\n $Resultado_Consulta_Ciudad->execute();\n\t\t\t\t\t while ($f = $Resultado_Consulta_Ciudad->fetch())\t\n {\n\t\t\t\t\t\t echo '<option value=\"'.$f[ciud_codigo].'\">'.$f[ciud_nombre].'</option>';\n }\n \n }" ]
[ "0.6279741", "0.61171144", "0.60118836", "0.5939055", "0.5793099", "0.57706267", "0.56923914", "0.5651858", "0.5648707", "0.5567089", "0.556347", "0.5562617", "0.55115795", "0.5507636", "0.5489906", "0.5476377", "0.54567397", "0.5450356", "0.54264987", "0.5423006", "0.54149956", "0.53847235", "0.53847235", "0.53847235", "0.53567946", "0.5352176", "0.53383654", "0.5294735", "0.5280318", "0.5278154" ]
0.627559
1
Main processor for this github webhook: check that each commit has a "Signedoffby" line.
function signed_off_by_checker($commit, $config, &$msg_out) { # Skip this commit if it's a merge commit and we've been told to # skip merge commits. if (isset($config["ignore merge commits"]) && $config["ignore merge commits"] && count($commit->{"parents"}) > 1) { return true; } if (preg_match("/Signed-off-by: /", $commit->{"commit"}->{"message"})) { return true; } else { $msg_out = $config["gwc one bad msg"]; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verify_request ($body) {\n\tglobal $config;\n\treturn strpos($_SERVER['HTTP_USER_AGENT'], 'GitHub-Hookshot') !== false &&\n\t\thash_equals($_SERVER['HTTP_X_HUB_SIGNATURE'], 'sha1=' . hash_hmac('sha1', $body, $config->token));\n}", "public function checkForFollowUpNotClicked()\n {\n $now = Carbon::now();\n $logs = $this->getNotClickedMessagesToFollow();\n foreach($logs as $log) {\n MailLog::info(sprintf('Trigger sending follow-up not clicked email for automation `%s`, subscriber: %s, event ID: %s', $this->automation->name, $log->subscriber_id, $this->id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }", "public function checkForFollowUpNotOpened()\n {\n $now = Carbon::now();\n $logs = $this->getNotOpenedMessagesToFollow();\n foreach($logs as $log) {\n MailLog::info(sprintf('Trigger sending follow-up not opened email for automation `%s`, subscriber: %s, event ID: %s', $this->automation->name, $log->subscriber_id, $this->id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }", "function github($key) {\n //the commit message should be ending with #task_id. ex: Added webhook #233\n $payloads = json_decode(file_get_contents('php://input'));\n if (!$this->_is_valid_payloads_of_github($payloads, $key)) {\n app_redirect(\"forbidden\");\n }\n\n $final_commits_array = $this->_get_final_commits_of_github($payloads);\n\n if ($final_commits_array) {\n foreach ($final_commits_array as $commit) {\n $task_id = get_array_value($commit, \"task_id\");\n $task_info = $this->Tasks_model->get_one($task_id);\n if ($task_info->id) {\n $log_data = array(\n \"action\" => \"github_notification_received\",\n \"log_type\" => \"task\",\n \"log_type_title\" => $task_info->title,\n \"log_type_id\" => $task_id,\n \"changes\" => serialize(array(\"github\" => array(\"from\" => \"\", \"to\" => $commit))),\n \"log_for\" => \"project\",\n \"log_for_id\" => $task_info->project_id,\n );\n\n $save_id = $this->Activity_logs_model->ci_save($log_data, true);\n\n if ($save_id) {\n //send notification\n $notification_options = array(\"project_id\" => $task_info->project_id, \"task_id\" => $task_id, \"activity_log_id\" => $save_id, \"user_id\" => \"999999997\");\n log_notification(\"github_push_received\", $notification_options);\n }\n }\n }\n }\n }", "function authorProofreadingComplete($args) {\n\t\t$monographId = Request::getUserVar('monographId');\n\t\t$this->validate($monographId);\n\t\t$this->setupTemplate(true, $monographId);\n\n\t\t$send = Request::getUserVar('send') ? true : false;\n\n\t\timport('classes.submission.proofreader.ProofreaderAction');\n\n\t\tif (ProofreaderAction::proofreadEmail($monographId,'PROOFREAD_AUTHOR_COMPLETE', $send?'':Request::url(null, 'copyeditor', 'authorProofreadingComplete', 'send'))) {\n\t\t\tRequest::redirect(null, null, 'submission', $monographId);\n\t\t}\n\t}", "function checkWriteFollowups($reqdata, $curdata = null, $origdata = null) {\n if(!empty($reqdata['SalesforceSource']['serverurl'])\n && (empty($reqdata['SalesforceSource']['refresh_token'])\n || empty($reqdata['SalesforceSource']['access_token']))) {\n // Warn that no oauth token is present\n \n $this->Flash->set(_txt('pl.salesforcesource.token.missing'), array('key' => 'information')); \n }\n \n return true;\n }", "public function checkOrdersForUpdateCheckouts()\n {\n $orderCollection = Mage::getModel(\"sales/order\")->getCollection();\n\n //get current timestamp\n $nowTime = new DateTime(null, new DateTimeZone(\"UTC\"));\n $nowTimestamp = $nowTime->getTimestamp();\n\n foreach ($orderCollection as $order) {\n $isTriggered = $order->getUrbitTriggered();\n\n if (isset($isTriggered) && $isTriggered == 'false') {\n $orderUpdateCheckoutTime = $order->getUrbitUpdateCheckoutTime();\n\n if (isset($orderUpdateCheckoutTime) && $orderUpdateCheckoutTime != \"\" && (int)$orderUpdateCheckoutTime <= $nowTimestamp) {\n $this->sendUpdateCheckout($order->getId());\n $order->setData('urbit_triggered', 'true');\n $order->save();\n }\n }\n }\n }", "function getUserBadges($userObj){\n\t if (isset($_SESSION[\"TOKEN\"])) {\n\n\t }\n }", "public function checkForFollowUpClicked()\n {\n $now = Carbon::now();\n $logs = $this->getClickedMessagesToFollow();\n\n foreach($logs as $log) {\n if ($now->gte($log->created_at->copy()->modify($this->getDelayInterval()))) {\n MailLog::info(sprintf('Trigger sending follow-up clicked email for automation `%s`, subscriber: %s, event ID: %s, message ID: %s', $this->automation->name, $log->subscriber_id, $this->id, $log->message_id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }\n }", "public function handlePush()\n {\n // We only care about push events\n if ($this->request->header('X-GitHub-Event') !== 'push') {\n return false;\n }\n\n $payload = $this->request->json();\n\n // Github sends a payload when you close a pull request with a non-existent commit.\n if ($payload->has('after') && $payload->get('after') === '0000000000000000000000000000000000000000') {\n return false;\n }\n\n $head = $payload->get('head_commit');\n $branch = preg_replace('#refs/(tags|heads)/#', '', $payload->get('ref'));\n\n return [\n 'reason' => trim($head['message']),\n 'branch' => $branch,\n 'source' => 'Github',\n 'build_url' => $head['url'],\n 'commit' => $head['id'],\n 'committer' => $head['committer']['name'],\n 'committer_email' => $head['committer']['email'],\n ];\n }", "function fill_webhook_config()\n{\n # git-commit-email-checker.php will ignore any incoming POST that does\n # not come from these network blocks.\n #\n # For GitHub Enterprise, fill in the CIDR notation for your GitHub\n # server(s).\n #$config[\"allowed_sources\"] = array(\"10.10.11.0/24\", \"10.10.22.0/24\");\n #\n # For GitHub.com, as of 9 Aug 2016, according to\n # https://help.github.com/articles/what-ip-addresses-does-github-use-that-i-should-whitelist/:\n $config[\"allowed_sources\"] = array(\"192.30.252.0/22\");\n\n # Fill this in with a Github personal access token that is allowed\n # to set pull request statuses. See the README.md for more detail.\n $config[\"auth_token\"] = \"Fill me in\";\n\n # The name that will appear for this CI agent at GitHub on pull\n # requests.\n $config[\"ci-context\"] = \"Commit email checker\";\n\n # Optional: if a commit contains a boneheaded email address, link\n # to this URL\n #$config[\"ci-link-url\"] = \"http://example.com\";\n\n # You almost certainly want \"debug\" set to 0 (or unset)\n $config[\"debug\"] = 0;\n\n # These are the repos for which we are allowed to reply.\n # Valid values are:\n # - a full repo name, such as: jsquyres/email-checker-github-webhook\n # - full wildcard: *\n # - wildcard the username/org name: */email-checker-github-webhook\n # - wildcard the repo name: jsquyres/*\n # - wildcard both names: */*\n #$config[\"github\"][\"jsquyres/github-webhooks\"] = 1;\n $config[\"github\"][\"jsquyres/*\"] = 1;\n\n # GitHub API URL. Can be configured for internal / GitHub\n # Enterprise instances.\n #\n # GitHub.com: https://api.github.com\n # GHE: http[s]://YOUR_GHE_SERVER/api/v3\n #\n $config[\"api_url_base\"] = \"https://api.github.com\";\n\n #####################################################################\n # Config specific to the bozo email checker\n #####################################################################\n\n # You can define any of the \"bad\", \"good\", and/or \"hooks\" values,\n # or leave them undefined (although you probably want to define at\n # least one of them!).\n\n # Array of regular expressions used to check author/committer\n # email addresses. These are Perl-style regular expressions\n # (i.e., they are passed to the PHP function preg_match()). If\n # any of these match, fail the test.\n $config[\"bad\"] = array(\n \"/^root@/\",\n \"/localhost/\",\n \"/localdomain/\");\n\n # Array of regular expressions used to check author/committer\n # email addresses. These are Perl-style regular expressions\n # (i.e., they are passed to the PHP function preg_match()). If\n # any of these DO NOT match, fail the test (i.e., all of them must\n # match to pass the test).\n $config[\"good\"] = array(\n '/^(\\w+)\\@mydomain\\.com$/i');\n\n # Array function names to be called for each commit (i.e., any\n # custom code you want to check). Note that these hooks are only\n # called if the above good/bad checks pass.\n $config[\"hooks\"] = array(\n \"my_email_check_function\");\n\n # Return the $config variable\n return $config;\n}", "public function test_onHook_ok() {\n\t\t\t$request = array(\n\t\t\t\t'post' => array(\n\t\t\t\t\t'payload' => json_encode(array(\n\t\t\t\t\t\t'revision' => \"r126299\",\n\t\t\t\t\t\t'author' => 'ph',\n\t\t\t\t\t\t'log' => 'commit message',\n\t\t\t\t\t), true),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$ret = $this->instance->onHook($request);\n\n\t\t\t$this->assertTrue($ret['ok']);\n\n\t\t\t$expected = array(array(\n\t\t\t\t'channel' => '#test',\n\t\t\t\t'message' => array('text' => 'r126299: ph - commit message', 'mrkdwn' => false)\n\t\t\t));\n\t\t\t$this->assertEquals($expected, $this->instance->posted_messages);\n\t\t}", "private function do_commit_post()\n {\n // so will re-run 'porcelain' to get a list of files. We'll only 'git add'\n // any files supplied by the user that are in the list we get from porcelain\n // we'll then go ahead and commit them with the message supplied\n require_once 'Git-php-lib';\n $repo = Git::open('.');\n $status = $repo->porcelain();\n $git_files = array();\n foreach($status as $item) {\n $git_files[$item['file']] = $item['y'];\n }\n\n $to_add = array();\n $to_rm = array();\n foreach($_REQUEST['file'] as $requested_file) {\n if(array_key_exists($requested_file, $git_files)) {\n if($git_files[$requested_file] == 'D') {\n $to_rm[] = $requested_file;\n } else {\n $to_add[] = $requested_file;\n }\n }\n }\n\n $add_output = '';\n if(count($to_add) > 0) {\n try {\n $add_output = $repo->add($to_add);\n }\n catch(Exception $e) {\n $add_output = 'Failed to run git-add: ' . $e->getMessage();\n }\n }\n #$add_output = preg_replace('/\\r?\\n\\r?/', \"<br>\\n\", $add_output);\n if(count($to_rm) > 0) {\n $rm_output = '';\n try {\n $rm_output = $repo->rm($to_rm);\n }\n catch(Exception $e) {\n $rm_output = 'Failed to run git-rm: ' . $e->getMessage();\n }\n }\n\n $commit_output = '';\n try {\n $commit_output = $repo->commit($_REQUEST['message'], false);\n }\n catch(Exception $e) {\n $commit_output = 'Failed to run git-commit: ' . $e->getMessage();\n }\n #$commit_output = preg_replace('/\\r?\\n\\r?/', \"<br>\\n\", $add_output);\n\n if(file_exists('./plugins/pico_edit/commitresponse.html')) {\n $loader = new Twig_Loader_Filesystem('./plugins/pico_edit');\n $twig = new Twig_Environment($loader, array('cache' => null));\n $twig->addExtension(new Twig_Extension_Debug());\n $twig_vars = array(\n 'add' => $add_output,\n 'rm' => $rm_output,\n 'commit' => $commit_output,\n );\n $content = $twig->render('commitresponse.html', $twig_vars);\n die($content);\n } else {\n die('Sorry, commitresponse.html was not found in the backend plugin. This is an installation problem.');\n }\n }", "public function afterCallActionHandler()\n\t{\n\t\t$committer = AssetCommitterFactory::getCommitter();\n\n\t\t// Check if there are any pushable commits\n\t\tif ($committer->isPushingEnabled() && $committer->hasCreatedNewCommits())\n\t\t{\n\t\t\t$committer->PushToRemoteRepository();\n\t\t}\n\t}", "public function validateWebhookCall()\n {\n // If the webhook was called with an invalid method, throw an error\n if($_SERVER['REQUEST_METHOD'] != 'POST'){\n die(json_encode([\n 'success' => false,\n 'error' => 'invalid_method',\n ]));\n }\n\n // If the webhook was called without any auth header, throw another error\n if (!isset($_SERVER['HTTP_AUTHORIZATION']) || empty($_SERVER['HTTP_AUTHORIZATION'])) {\n die(json_encode([\n 'success' => false,\n 'error' => 'no_auth_header',\n ]));\n }\n\n if($_SERVER['HTTP_AUTHORIZATION'] != Config::i()->getSXApiKey()){\n die(json_encode([\n 'success' => false,\n 'error' => 'invalid_auth',\n ]));\n }\n }", "public function checkAgreementSigned($request)\n {\n if( $request->filled('meta.participant_signature') ){\n \\App\\Participant::where('participants_details.user_id', (int)$request->input('user_id'))\n ->update(['agreement_signed' => 1]);\n }\n\n if( $request->filled('meta.worker_signature') ){\n \\App\\SupportWorker::where('support_workers_details.user_id', (int)$request->input('user_id'))->update(['agreement_signed' => 1, 'onboarding_step'=>2]);\n }\n\n if($request->filled('meta.worker_signature')){\n \\App\\ServiceProvider::where('service_provider_details.user_id', (int)$request->input('user_id'))\n ->update(['agreement_signed' => 1]);\n }\n \n }", "function ihc_run_check_verify_email_status(){\n\t$time_limit = (int)get_option('ihc_double_email_delete_user_not_verified');\n\tif ($time_limit>-1){\n\t\t$time_limit = $time_limit * 24 * 60 * 60;\n\t\tglobal $wpdb;\n\t\t$data = $wpdb->get_results(\"SELECT user_id FROM \" . $wpdb->prefix . \"usermeta\n\t\t\t\t\t\t\t\t\t\tWHERE meta_key='ihc_verification_status'\n\t\t\t\t\t\t\t\t\t\tAND meta_value='-1';\");\n\t\tif (!empty($data)){\n\n\t\t\tif (!function_exists('wp_delete_user')){\n\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/user.php';\n\t\t\t}\n\n\t\t\tforeach ($data as $k=>$v){\n\t\t\t\tif (!empty($v->user_id)){\n\t\t\t\t\t$time_data = $wpdb->get_row(\"SELECT user_registered FROM \" . $wpdb->prefix . \"users\n\t\t\t\t\t\t\tWHERE ID='\" . $v->user_id . \"';\");\n\t\t\t\t\tif (!empty($time_data->user_registered)){\n\t\t\t\t\t\t$time_to_delete = strtotime($time_data->user_registered)+$time_limit;\n\t\t\t\t\t\tif ( $time_to_delete < time() ){\n\t\t\t\t\t\t\t//delete user\n\t\t\t\t\t\t\twp_delete_user( $v->user_id );\n\t\t\t\t\t\t\t$wpdb->query(\"DELETE FROM \" . $wpdb->prefix . \"ihc_user_levels WHERE user_id='\" . $v->user_id . \"';\");\n\t\t\t\t\t\t\t//send notification\n\t\t\t\t\t\t\tihc_send_user_notifications($v->user_id, 'delete_account');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "public function webhook()\n {\n $this->paymentSettings = $this->getPaymentSettings();\n $payload = file_get_contents(\"php://input\");\n $signature = (isset($_SERVER['HTTP_X_PAYSTACK_SIGNATURE']) ? $_SERVER['HTTP_X_PAYSTACK_SIGNATURE'] : '');\n /* It is a good idea to log all events received. Add code *\n * here to log the signature and body to db or file */\n if (!$signature) {\n // only a post with paystack signature header gets our attention\n exit();\n }\n // confirm the event's signature\n if ($signature !== hash_hmac('sha512', $payload, $this->paymentSettings['secret_key'])) {\n // silently forget this ever happened\n exit();\n }\n $webhook_response = json_decode($payload, true);\n if ('charge.success' != $webhook_response['event']) {\n exit;\n }\n try {\n $orderId = $this->updatePaymentStatus($webhook_response['data']['reference']);\n } catch (Exception $e) {\n // Invalid payload\n http_response_code(400);\n exit();\n }\n http_response_code(200);\n exit();\n }", "public function verifyWebhook($request)\n {\n return $request['RDG_WH_SIGNATURE'] === hash_hmac(\n 'sha256',\n $request['order']['transaction_id'] . $request['status'],\n $this->secret\n );\n }", "public function markSubmitted(): void\n {\n $user = Auth::user()->callsign;\n $uploadDate = date('n/j/y G:i:s');\n $batchInfo = $this->batchInfo ?? '';\n\n foreach ($this->bmids as $bmid) {\n $bmid->status = Bmid::SUBMITTED;\n\n /*\n * Make a note of what provisions were set\n */\n\n $showers = [];\n if ($bmid->showers) {\n $showers[] = 'set';\n }\n\n if ($bmid->earned_showers) {\n $showers[] = 'earned';\n }\n if ($bmid->allocated_showers) {\n $showers[] = 'allocated';\n }\n if (empty($showers)) {\n $showers[] = 'none';\n }\n\n $meals = [];\n if (!empty($bmid->meals)) {\n $meals[] = $bmid->meals . ' set';\n }\n if (!empty($bmid->earned_meals)) {\n $meals[] = $bmid->earned_meals . ' earned';\n }\n if (!empty($bmid->allocated_meals)) {\n $meals[] = $bmid->allocated_meals . ' allocated';\n }\n\n if (empty($meals)) {\n $meals[] = 'none';\n }\n\n /*\n * Figure out which provisions are to be marked as submitted.\n *\n * Note: Meals and showers are not allowed to be banked in the case were the\n * person earned them yet their position (Council, OOD, Supervisor, etc.) comes\n * with a provisions package.\n */\n\n $items = [];\n if ($bmid->effectiveShowers()) {\n $items[] = Provision::WET_SPOT;\n }\n\n if (!empty($bmid->meals) || !empty($bmid->allocated_meals)) {\n // Person is working.. consume all the meals.\n $items = [...$items, ...Provision::MEAL_TYPES];\n } else if (!empty($bmid->earned_meals)) {\n // Currently only two meal provision types, All Eat, and Event Week\n $items[] = ($bmid->earned_meals == Bmid::MEALS_ALL) ? Provision::ALL_EAT_PASS : Provision::EVENT_EAT_PASS;\n }\n\n\n if (!empty($items)) {\n $items = array_unique($items);\n Provision::markSubmittedForBMID($bmid->person_id, $items);\n }\n\n $meals = '[meals ' . implode(', ', $meals) . ']';\n $showers = '[showers ' . implode(', ', $showers) . ']';\n $bmid->notes = \"$uploadDate $user: Exported $meals $showers\\n$bmid->notes\";\n $bmid->auditReason = 'exported to print';\n $bmid->batch = $batchInfo;\n $bmid->saveWithoutValidation();\n }\n }", "function _sf_send_user_publish_note($new_status, $old_status, $post) {\n\t\tif($post->post_type == 'spot') {\n\t\t\t\n\t\t\t$user = get_user_by('id', $post->post_author);\n\t\t\t\n\t\t\t//// IF THIS POST IS BEING PUBLISHED AND THE AUTHOR IS A SUBMITTER\n\t\t\tif($old_status != 'publish' && $new_status == 'publish' && isset($user->caps['submitter'])) {\n\t\t\t\t\n\t\t\t\t//// SENDS AN EMAIL SAYING HIS POST HAS BEEN SUBMITTED\n\t\t\t\t$message = sprintf2(__(\"Dear %user,\n\t\t\t\t\nThis is to inform you that your submission %title at %site_name has been approved and it is now published.\n\nYou can view it here at %link\n\nKind regards,\nthe %site_name team.\", 'btoa'), array(\n\t\t\t\n\t\t\t\t\t'user' => $user->display_name,\n\t\t\t\t\t'title' => $post->post_title,\n\t\t\t\t\t'site_name' => get_bloginfo('name'),\n\t\t\t\t\t'link' => get_permalink($post->ID),\n\t\t\t\t\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t$subject = sprintf2(__('Submission approved at %site_name', 'btoa'), array('site_name' => get_bloginfo('name')));\n\t\t\t\t\n\t\t\t\t$headers = \"From: \".get_bloginfo('name').\" <\".get_option('admin_email').\">\";\n\t\t\t\t\n\t\t\t\twp_mail($user->user_email, $subject, $message, $headers);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t///// IF ITS A SPOT\n\t\t\tif($post->post_type == 'spot') {\n\t\t\t\t\n\t\t\t\tif(ddp('future_notification') == 'on' && $old_status != 'publish' && $new_status == 'publish') {\n\t\t\t\t\t\n\t\t\t\t\t//// ALSO CHECKS FOR USER NOTIFICATIONS FOR MATCHING CRITERIA\n\t\t\t\t\tif(function_exists('_sf_check_for_user_notifications_matching_spot')) { _sf_check_for_user_notifications_matching_spot($post->ID); }\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('submission_days') != '' && ddp('submission_days') != '0') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO PENDING IN X AMOUNT OF DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET FOR OUR FEATURED SUBMISSION - AND ITS INDEED FEATURED\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('price_featured_days') != '' && ddp('price_featured_days') != '0' && get_post_meta($post->ID, 'featured', true) == 'on') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO NORMAL SUBMISSION AFTER X DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date_featured($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "function um_add_security_checks( $args ) {\r\n\tif ( is_admin() ) {\r\n\t\treturn;\r\n\t} ?>\r\n\r\n\t<input type=\"hidden\" name=\"timestamp\" class=\"um_timestamp\" value=\"<?php echo current_time( 'timestamp' ) ?>\" />\r\n\r\n\t<p class=\"<?php echo UM()->honeypot; ?>_name\">\r\n\t\t<label for=\"<?php echo UM()->honeypot . '_' . $args['form_id']; ?>\"><?php _e( 'Only fill in if you are not human' ); ?></label>\r\n\t\t<input type=\"text\" name=\"<?php echo UM()->honeypot; ?>\" id=\"<?php echo UM()->honeypot . '_' . $args['form_id']; ?>\" class=\"input\" value=\"\" size=\"25\" autocomplete=\"off\" />\r\n\t</p>\r\n\r\n\t<?php\r\n}", "function onAfterWrite() {\n\t\t$bt = defined('DB::USE_ANSI_SQL') ? \"\\\"\" : \"`\";\n\n\t\tif(!$this->owner->ApproverGroups()->Count() && $this->owner->CanApproveType == 'OnlyTheseUsers') {\n\t\t\t$SQL_group = Convert::raw2sql('site-content-approvers');\n\t\t\t$groupCheckObj = DataObject::get_one('Group', \"{$bt}Code{$bt} = '{$SQL_group}'\");\n\t\t\tif($groupCheckObj) $this->owner->ApproverGroups()->add($groupCheckObj);\n\t\t}\n\t\t\n\t\tif(!$this->owner->PublisherGroups()->Count() && $this->owner->CanPublishType == 'OnlyTheseUsers') {\n\t\t\t$SQL_group = Convert::raw2sql('site-content-publishers');\n\t\t\t$groupCheckObj = DataObject::get_one('Group', \"{$bt}Code{$bt} = '{$SQL_group}'\");\n\t\t\tif($groupCheckObj) $this->owner->PublisherGroups()->add($groupCheckObj);\n\t\t}\n\t}", "public function check_for_license_updates() {\n\n\t\t$aggregator = tribe( 'events-aggregator.main' );\n\t\t$aggregator->pue_checker->check_for_updates();\n\n\t}", "public function getPostCommitHookList() {}", "function cancelCommit()\n{\n global $user;\n $UID = $user->uid;\n $params = drupal_get_query_parameters();\n $OID = $params['OID'];\n\n // removing user's commitment from the outreach completely\n dbRemoveUserFromOutreach($UID,$OID);\n drupal_set_message(\"Your commitment to outreach event: \" . dbGetOutreachname($OID) . \" has been removed!\"); //letting them know and redirecting user to the previous page they were on\n drupal_goto($_SERVER['HTTP_REFERER']);\n}", "protected function checkDiffs() {\n $status = $this->terminal->run($this->git->status());\n \n if (strpos($status, 'nothing to commit') === false)\n {\n \n $this->output->write('<info>Changes found</info>');\n $this->output->write(PHP_EOL);\n // Show diff\n $this->output->writeln($this->terminal->ignoreError()->run($this->git->diff())); \n \n $message = $this->dialog->ask(\n $this->output,\n '<question>You have uncommitted changes, please provide a commit message:</question> '\n );\n\n $this->terminal->run($this->git->add('-A .'));\n \n $this->terminal->ignoreError()->run($this->git->commit($message));\n \n } else {\n $this->output->write('<info>Ok</info>' . PHP_EOL);\n }\n }", "public function checkForFollowUpOpened()\n {\n $now = Carbon::now();\n $logs = $this->getOpenedMessagesToFollow();\n foreach($logs as $log) {\n if ($now->gte($log->created_at->copy()->modify($this->getDelayInterval()))) {\n MailLog::info(sprintf('Trigger sending follow-up opened email for automation `%s`, subscriber: %s, event ID: %s', $this->automation->name, $log->subscriber_id, $this->id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }\n }", "function notification_ignore() {\n\n $ignore_key = CUSTOM_LOGIN_OPTION . '_ignore_announcement';\n\n // Bail if not set\n if ( ! isset( $_GET[ $ignore_key ] ) ) {\n return;\n }\n\n // Check nonce\n check_admin_referer( $ignore_key, $ignore_key );\n\n // If user clicks to ignore the notice, add that to their user meta\n add_user_meta( get_current_user_id(), $ignore_key, 1, true );\n }", "function cover_session_in_committee($committee) {\n return in_array(strtolower($committee), cover_session_get_committees());\n}" ]
[ "0.52288663", "0.48526266", "0.4793062", "0.47879916", "0.4779021", "0.47446674", "0.47388566", "0.4736664", "0.4712275", "0.46846378", "0.46775663", "0.46686238", "0.46414825", "0.46202186", "0.46199876", "0.46018803", "0.46017623", "0.45613343", "0.45521912", "0.45517388", "0.45464775", "0.4531997", "0.45303637", "0.45293945", "0.45259437", "0.4521926", "0.4516315", "0.45095882", "0.44895223", "0.44869867" ]
0.7321973
0
Gets a list of countries that Paystack currently supports
public function countries(): array { return $this->client->get("country"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCountryList()\n {\n return $this->call('country.list');\n }", "public function getCountrylist()\n {\n $cachePool = new FilesystemAdapter('', 0, \"cache\");\n \n if ($cachePool->hasItem('countries')) {\n $countries = $cachePool->getItem('countries')->get();\n } else {\n $countries = $this->client->request(\n 'GET',\n 'https://kayaposoft.com/enrico/json/v2.0?action=getSupportedCountries'\n )->toArray();\n $countriesCache = $cachePool->getItem('countries');\n \n if (!$countriesCache->isHit()) {\n $countriesCache->set($countries);\n $countriesCache->expiresAfter(60*60*24);\n $cachePool->save($countriesCache);\n }\n }\n\n return $countries;\n }", "public function get_countries()\n\t{\n\t\t$t_countries = xtc_get_countriesList();\n\t\treturn $t_countries;\n\t}", "public function getCountriesList() {\n return $this->_get(7);\n }", "public function getCountryList()\n {\n $countryList=array(\n 'BG'=>__('Bulgaria')\n 'DE'=>__('Germany'),\n 'GB'=>__('Great Britain'),\n );\n\n return $countryList;\n }", "public static function getCountries()\n {\n return self::$countryList;\n }", "public function getCountryList()\r\n {\r\n return $this->admin->sGetCountryList();\r\n }", "public function getCountries();", "public function countries(): array\n {\n $payload = Payload::list('countries');\n\n $result = $this->transporter->get($payload->uri)->throw();\n\n return (array) $result->json('data');\n }", "public function getCountries() {\n\n $result = $this->doRequest('v1.0/all-countries', 'GET');\n\n return $result;\n\n }", "static function get_countries() {\n static $ret = array();\n if(empty($ret)) {\n global $wpdb;\n $ret = $wpdb->get_results('SELECT * FROM ai_country ORDER BY name', OBJECT_K);\n }\n return $ret;\n }", "public function get_country_list() \n\t{\n\t\treturn $this->db->select('num_code')\n\t\t->select('country_name')\n\t\t->select('num_code')\n\t\t->from('system_iso3166_l10n')\n\t\t->order_by('country_name', 'ASC')\t\n\t\t->get()->result();\n\t}", "public function getListCountry()\n\t{\n\t\t$params = [\n\t\t\t'verify' => false,\n\t\t\t'query' => [\n\t\t\t\t'output' => Config::get( 'response.format' )\n\t\t\t]\n\t\t];\n\n\t\t$baseUrl = sprintf( Config::get( 'endpoints.base_url' ), Config::get( 'settings.api' ) ) . Config::get( 'endpoints.general_list_country' );\n\n\t\ttry {\n\t\t\t$response = parent::send( 'GET', $baseUrl, $params );\n\t\t} catch (TiketException $e) {\n\t\t\tthrow parent::convertException( $e );\n\t\t}\n\n\t\treturn $response;\n\t}", "public function getAllCountryCodes() {\n\t\t$filter = new Filters\\Misc\\CountryCode();\n\t\treturn $filter->query->find();\n\t}", "public function getCountriesInfo();", "public function getAvailableCountries()\n {\n $availableCountries=array();\n $models=ShippingCosts::model()->findAll(array(\n 'select'=>'t.country_code',\n 'group'=>'t.country_code',\n 'distinct'=>true,\n 'condition'=>'t.shipping_method_id=:shipping_method_id',\n 'params'=>array(':shipping_method_id'=>$this->id),\n ));\n $availableCountries=CHtml::listData($models, 'country_code', 'country_code');\n return $availableCountries;\n }", "public function getCountries() {\n\n $countries = civicrm_api3('Address', 'Getoptions', [\n 'field' => 'country_id',\n ]);\n return $countries['values'];\n }", "public function sGetCountryList()\n {\n $context = Shopware()->Container()->get('shopware_storefront.context_service')->getShopContext();\n $service = Shopware()->Container()->get('shopware_storefront.location_service');\n\n $countryList = $service->getCountries($context);\n $countryList = Shopware()->Container()->get('legacy_struct_converter')->convertCountryStructList($countryList);\n\n $countryList = array_map(function ($country) {\n $request = $this->front->Request();\n $countryId = (int) $country['id'];\n $country['flag'] = ((int) $request->getPost('country') === $countryId || (int) $request->getPost('countryID') === $countryId);\n\n return $country;\n }, $countryList);\n\n $countryList = $this->eventManager->filter(\n 'Shopware_Modules_Admin_GetCountries_FilterResult',\n $countryList,\n ['subject' => $this]\n );\n\n return $countryList;\n }", "protected function _getCountries()\n {\n return $options = $this->_getCountryCollection()\n ->setForegroundCountries($this->_getTopDestinations())\n ->toOptionArray();\n }", "public function get_all_countries_list()\n\t {\n\t \t$query=$this->ApiModel->get_all_countries();\n\t \techo json_encode($query);\n\t }", "public static function getSupportedCountriesOffline()\n {\n return static::getSupportedCountries();\n }", "public function getCountries() {\n\t\treturn $this->getData('/objekt/laender');\n\t}", "public function getCountries()\n {\n return $this->countries;\n }", "public function getCountries()\n {\n return $this->countries;\n }", "public function getCountries()\n {\n return $this->countries;\n }", "public function getCountryOptions() {\n\t\treturn array(\n \"us\" => \"United States\",\n \"uk\" => \"United Kingdom\",\n \"ca\" => \"Canada\",\n );\n }", "public function getCountries()\n {\n if (is_null($this->_countries)) {\n $this->_countries = Mage::getModel('adminhtml/system_config_source_country')\n ->toOptionArray();\n }\n\n return $this->_countries;\n }", "function GetCountries()\n\t{\n\t\t$result = $this->sendRequest(\"GetCountries\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getCountryList() {\n $result = array();\n $collection = Mage::getModel('directory/country')->getCollection();\n foreach ($collection as $country) {\n $cid = $country->getId();\n $cname = $country->getName();\n $result[$cid] = $cname;\n }\n return $result;\n }", "public function country_list()\n {\n $result = common_select_values('id, name', 'ad_countries', '', 'result');\n return $result; \n }" ]
[ "0.82328606", "0.79425204", "0.7853372", "0.7819766", "0.7788552", "0.7752574", "0.7745809", "0.77285737", "0.7712425", "0.76149666", "0.75923795", "0.755674", "0.7508336", "0.7477317", "0.74669105", "0.742322", "0.7414343", "0.7392078", "0.73531646", "0.7339168", "0.73372555", "0.73251635", "0.7320133", "0.7320133", "0.7320133", "0.7311419", "0.73029333", "0.72932476", "0.7287472", "0.7280018" ]
0.8069366
1
Get a list of states for a country for address verification.
public function states(string $country): array { $params['country'] = $country; return $this->client->get("address_verification/states", $params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllStates(Country $country) {\n $out = [];\n $r = $this->db->query(\"SELECT divcode, divname FROM country_state WHERE country = '{$country->code}'\");\n while($row = $r->fetchArray(SQLITE3_ASSOC)) {\n $out[$row['divcode']] = $row['divname'];\n }\n return $out;\n }", "public function getStates() {\n $stateList = array();\n \n if (!empty($this->billing_country)) {\n /*\n * PCM\n */\n $stateList = Subregion::model()->findAll('region_id=\"' . $this->billing_country . '\"');\n\n $stateList = CHtml::listData($stateList, 'name', 'name');\n \n }\n return $stateList;\n }", "public function getStates() {\n $stateList = array();\n if (!empty($this->shipping_country)) {\n /*\n * PCM\n */\n $stateList = Subregion::model()->findAll('region_id=\"' . $this->shipping_country . '\"');\n\n $stateList = CHtml::listData($stateList, 'name', 'name');\n }\n return $stateList;\n }", "static function get_states() {\r\n // https://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations\r\n $states = [];\r\n $states['AL'] = 'Alabama';\r\n $states['AK'] = 'Alaska';\r\n $states['AZ'] = 'Arizona';\r\n $states['AR'] = 'Arkansas';\r\n $states['CA'] = 'California';\r\n $states['CO'] = 'Colorado';\r\n $states['CT'] = 'Connecticut';\r\n $states['DE'] = 'Delaware';\r\n $states['DC'] = 'District of Columbia';\r\n $states['FL'] = 'Florida';\r\n $states['GA'] = 'Georgia';\r\n $states['HI'] = 'Hawaii';\r\n $states['ID'] = 'Idaho';\r\n $states['IL'] = 'Illinois';\r\n $states['IN'] = 'Indiana';\r\n $states['IA'] = 'Iowa';\r\n $states['KS'] = 'Kansas';\r\n $states['KY'] = 'Kentucky';\r\n $states['LA'] = 'Louisiana';\r\n $states['ME'] = 'Maine';\r\n $states['MD'] = 'Maryland';\r\n $states['MA'] = 'Massachusetts';\r\n $states['MI'] = 'Michigan';\r\n $states['MN'] = 'Minnesota';\r\n $states['MS'] = 'Mississippi';\r\n $states['MO'] = 'Missouri';\r\n $states['MT'] = 'Montana';\r\n $states['NE'] = 'Nebraska';\r\n $states['NV'] = 'Nevada';\r\n $states['NH'] = 'New Hampshire';\r\n $states['NJ'] = 'New Jersey';\r\n $states['NM'] = 'New Mexico';\r\n $states['NY'] = 'New York';\r\n $states['NC'] = 'North Carolina';\r\n $states['ND'] = 'North Dakota';\r\n $states['OH'] = 'Ohio';\r\n $states['OK'] = 'Oklahoma';\r\n $states['OR'] = 'Oregon';\r\n $states['PA'] = 'Pennsylvania';\r\n $states['RI'] = 'Rhode Island';\r\n $states['SC'] = 'South Carolina';\r\n $states['SD'] = 'South Dakota';\r\n $states['TN'] = 'Tennessee';\r\n $states['TX'] = 'Texas';\r\n $states['UT'] = 'Utah';\r\n $states['VT'] = 'Vermont';\r\n $states['VA'] = 'Virginia';\r\n $states['WA'] = 'Washington';\r\n $states['WV'] = 'West Virginia';\r\n $states['WI'] = 'Wisconsin';\r\n $states['WY'] = 'Wyoming';\r\n $states['AS'] = 'American Samoa';\r\n $states['GU'] = 'Guam';\r\n $states['MP'] = 'Northern Mariana Islands';\r\n $states['PR'] = 'Puerto Rico';\r\n $states['VI'] = 'U.S. Virgin Islands';\r\n $states['UM'] = 'U.S. Minor Outlying Islands';\r\n $states['FM'] = 'Micronesia';\r\n $states['MH'] = 'Marshall Islands';\r\n $states['PW'] = 'Palau';\r\n natsort($states);\r\n return $states;\r\n }", "public function test_list_country_states()\n {\n $data = factory(State::class)->create();\n $response = $this->get($this->url.$data->country_id.'/states', $this->headers());\n $response->assertStatus(200);\n $response->assertJsonStructure(array_keys($data->toarray()), $data->toarray());\n $this->assertDatabaseHas($this->table, $data->toarray());\n }", "public static function getStates()\n {\n return self::$statesUSA;\n }", "public function getAllStatesByCountryId($country) {\n $countryName = '';\n $countryId = '';\n $countries = explode(\"/\", $country);\n $countryName = $countries[0]; // piece1\n $countryId = $countries[1]; // piece2\n\n $sql = \"SELECT * FROM states WHERE country_id = '$countryId'\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return false;\n } else {\n return $result->result_array();\n }\n }", "public function get_states_by_country($country_id)\n {\n\t\t$this->db2->select('s.id as state_id,s.name as state_name');\n\t\t$this->db2->from('state s');\n\t\t$this->db2->where('country_id',$country_id);\n\t\t$this->db2->order_by('state_name', 'Asc');\n\t\t$query = $this->db2->get();\n\t\t$results = $query->result_array(); \n\t\treturn $results;\n }", "function get_state_options_by_country($country) {\r\n\r\n /* $states = [\"India\" =>[ \"Tamil Nadu\",\"Kerala\", \"Andra Pradesh\" , \"Telungana\", \"Karnataka\"]];\r\n $options = $states[$country]; \r\n\treturn $options; */\r\n}", "function get_all_states()\n{\n\t\t$states = array(\n\t\t\t\"Alabama\" => \"Alabama\",\n\t\t\t\"Alaska\" => \"Alaska\",\n\t\t\t\"Arizona\" => \"Arizona\",\n\t\t\t\"Arkansas\" => \"Arkansas\",\n\t\t\t\"California\" => \"California\",\n\t\t\t\"Colorado\" => \"Colorado\",\n\t\t\t\"Connecticut\" => \"Connecticut\",\n\t\t\t\"Delaware\" => \"Delaware\",\n\t\t\t\"District of Columbia\" => \"District of Columbia\",\n\t\t\t\"Florida\" => \"Florida\",\n\t\t\t\"Georgia\" => \"Georgia\",\n\t\t\t\"Hawaii\" => \"Hawaii\",\n\t\t\t\"Idaho\" => \"Idaho\",\n\t\t\t\"Illinois\" => \"Illinois\",\n\t\t\t\"Indiana\" => \"Indiana\",\n\t\t\t\"Iowa\" => \"Iowa\",\n\t\t\t\"Kansas\" => \"Kansas\",\n\t\t\t\"Kentucky\" => \"Kentucky\",\n\t\t\t\"Louisiana\" => \"Louisiana\",\n\t\t\t\"Maine\" => \"Maine\",\n\t\t\t\"Maryland\" => \"Maryland\",\n\t\t\t\"Massachusetts\" => \"Massachusetts\",\n\t\t\t\"Michigan\" => \"Michigan\",\n\t\t\t\"Minnesota\" => \"Minnesota\",\n\t\t\t\"Mississippi\" => \"Mississippi\",\n\t\t\t\"Missouri\" => \"Missouri\",\n\t\t\t\"Montana\" => \"Montana\",\n\t\t\t\"Nebraska\" => \"Nebraska\",\n\t\t\t\"Nevada\" => \"Nevada\",\n\t\t\t\"New Hampshire\" => \"New Hampshire\",\n\t\t\t\"New Jersey\" => \"New Jersey\",\n\t\t\t\"New Mexico\" => \"New Mexico\",\n\t\t\t\"New York\" => \"New York\",\n\t\t\t\"North Carolina\" => \"North Carolina\",\n\t\t\t\"North Dakota\" => \"North Dakota\",\n\t\t\t\"Ohio\" => \"Ohio\",\n\t\t\t\"Oklahoma\" => \"Oklahoma\",\n\t\t\t\"Oregon\" => \"Oregon\",\n\t\t\t\"Pennsylvania\" => \"Pennsylvania\",\n\t\t\t\"Rhode island\" => \"Rhode island\",\n\t\t\t\"South Carolina\" => \"South Carolina\",\n\t\t\t\"South Dakota\" => \"South Dakota\",\n\t\t\t\"Tennessee\" => \"Tennessee\",\n\t\t\t\"Texas\" => \"Texas\",\n\t\t\t\"Utah\" => \"Utah\",\n\t\t\t\"Vermont\" => \"Vermont\",\n\t\t\t\"Virgin Islands\" => \"Virgin Islands\",\n\t\t\t\"Virginia\" => \"Virginia\",\n\t\t\t\"Washington\" => \"Washington\",\n\t\t\t\"West Virginia\" => \"West Virginia\",\n\t\t\t\"Wisconsin\" => \"Wisconsin\",\n\t\t\t\"Wyoming\" => \"Wyoming\",\n\t\t\t\"Alberta\" => \"Alberta\",\n\t\t\t\"Nova Scotia\" => \"Nova Scotia\",\n\t\t\t\"British Columbia\" => \"British Columbia\",\n\t\t\t\"Ontario\" => \"Ontario\",\n\t\t\t\"Manitoba\" => \"Manitoba\",\n\t\t\t\"Prince Edward Island\" => \"Prince Edward Island\",\n\t\t\t\"New Brunswick\" => \"New Brunswick\",\n\t\t\t\"Quebec\" => \"Quebec\",\n\t\t\t\"Newfoundland\" => \"Newfoundland\",\n\t\t\t\"Saskatchewan\" => \"Saskatchewan\",\n\t\t\t\"Northwest Territories\" => \"Northwest Territories\",\n\t\t\t\"Yukon Territory\" => \"Yukon Territory\",\n\t\t\t\"Nunavut\" => \"Nunavut\",\n\t\t\t\"American Samoa\" => \"American Samoa\",\n\t\t\t\"Guam\" => \"Guam\",\n\t\t\t\"Marshall Islands\" => \"Marshall Islands\",\n\t\t\t\"Micronesia (Federated States of)\" => \"Micronesia (Federated States of)\",\n\t\t\t\"Palau\" => \"Palau\",\n\t\t\t\"Puerto Rico\" => \"Puerto Rico\",\n\t\t\t\"U.S. Minor Outlying Islands\" => \"U.S. Minor Outlying Islands\",\n\t\t\t\"Northern Mariana Islands\" => \"Northern Mariana Islands\",\n\t\t\t\"Armed Forces Africa\" => \"Armed Forces Africa\",\n\t\t\t\"Armed Forces Americas AA (except Canada)\" => \"Armed Forces Americas AA (except Canada)\",\n\t\t\t\"Armed Forces Canada\" => \"Armed Forces Canada\",\n\t\t\t\"Armed Forces Europe AE\" => \"Armed Forces Europe AE\",\n\t\t\t\"Armed Forces Middle East AE\" => \"Armed Forces Middle East AE\",\n\t\t\t\"Armed Forces Pacific AP\" => \"Armed Forces Pacific AP\",\n\t\t\t\"Foreign\" => \"Foreign\",\n\t\t\t\"Others Not Listed above\" => \"Others Not Listed above\"\n\t\t);\n\treturn $states;\n}", "static function states()\n {\n return array(\n 'USA' => array('name' => 'United States',\n 'states' => array(\n 'AL'=>'ALABAMA',\n 'AK'=>'ALASKA',\n 'AZ'=>'ARIZONA',\n 'AR'=>'ARKANSAS',\n 'CA'=>'CALIFORNIA',\n 'CO'=>'COLORADO',\n 'CT'=>'CONNECTICUT',\n 'DE'=>'DELAWARE',\n 'DC'=>'DISTRICT OF COLUMBIA',\n 'FL'=>'FLORIDA',\n 'GA'=>'GEORGIA',\n 'HI'=>'HAWAII',\n 'ID'=>'IDAHO',\n 'IL'=>'ILLINOIS',\n 'IN'=>'INDIANA',\n 'IA'=>'IOWA',\n 'KS'=>'KANSAS',\n 'KY'=>'KENTUCKY',\n 'LA'=>'LOUISIANA',\n 'ME'=>'MAINE',\n 'MD'=>'MARYLAND',\n 'MA'=>'MASSACHUSETTS',\n 'MI'=>'MICHIGAN',\n 'MN'=>'MINNESOTA',\n 'MS'=>'MISSISSIPPI',\n 'MO'=>'MISSOURI',\n 'MT'=>'MONTANA',\n 'NE'=>'NEBRASKA',\n 'NV'=>'NEVADA',\n 'NH'=>'NEW HAMPSHIRE',\n 'NJ'=>'NEW JERSEY',\n 'NM'=>'NEW MEXICO',\n 'NY'=>'NEW YORK',\n 'NC'=>'NORTH CAROLINA',\n 'ND'=>'NORTH DAKOTA',\n 'OH'=>'OHIO',\n 'OK'=>'OKLAHOMA',\n 'OR'=>'OREGON',\n 'PA'=>'PENNSYLVANIA',\n 'PR'=>'PUERTO RICO',\n 'RI'=>'RHODE ISLAND',\n 'SC'=>'SOUTH CAROLINA',\n 'SD'=>'SOUTH DAKOTA',\n 'TN'=>'TENNESSEE',\n 'TX'=>'TEXAS',\n 'UT'=>'UTAH',\n 'VT'=>'VERMONT',\n 'VA'=>'VIRGINIA',\n 'WA'=>'WASHINGTON',\n 'WV'=>'WEST VIRGINIA',\n 'WI'=>'WISCONSIN',\n 'WY'=>'WYOMING'\n )\n ),\n 'CAN' => array('name' => 'Canada',\n 'states' => array(\n \"BC\"=>\"British Columbia\", \n \"ON\"=>\"Ontario\", \n \"NL\"=>\"Newfoundland and Labrador\", \n \"NS\"=>\"Nova Scotia\", \n \"PE\"=>\"Prince Edward Island\", \n \"NB\"=>\"New Brunswick\", \n \"QC\"=>\"Quebec\", \n \"MB\"=>\"Manitoba\", \n \"SK\"=>\"Saskatchewan\", \n \"AB\"=>\"Alberta\", \n \"NT\"=>\"Northwest Territories\", \n \"NU\"=>\"Nunavut\",\n \"YT\"=>\"Yukon Territory\"\n )\n )\n );\n }", "function stateList(){\n\t$stateList = array( 'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', \n\t\t\t\t\t 'District Of Columbia', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', \n\t\t\t\t\t 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', \n\t\t\t\t\t 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', \n\t\t\t\t\t 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', \n\t\t\t\t\t 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', \n\t\t\t\t\t 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming' );\n\n\treturn $stateList;\n}", "public function get_all_state()\n\t {\n\t \t $data=(array)json_decode(file_get_contents(\"php://input\"));\n\t \t$id=$data['country_id'];\n\t \t$query=$this->ApiModel->get_all_state($id);\n\t \techo json_encode($query);\n\t }", "public function getCountries() {\n\n $countries = civicrm_api3('Address', 'Getoptions', [\n 'field' => 'country_id',\n ]);\n return $countries['values'];\n }", "function getStatesList()\n\t\t{\n\t\t\t$sSQL\t=\t\"select abbr , name from tbl_states\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\t\n\t\t\t$stateList = array();\n\t\t\t\n\t\t\twhile($row = $response->FetchRow())\n\t\t\t{\t\t\t\n\t\t\t\t$arr['abbr'] = $row['abbr'];\n\t\t\t\t$arr['name'] = $row['name'];\n\t\t\t\t$stateList[] = $arr;\n\t\t\t}\n\t\t\t\n\t\t\treturn $stateList;\t\t\t\n\t\t}", "public function getAllStates() {\n $states = [];\n $values = DB::table(self::TABLE_NAME)\n ->select([self::C_STATE, self::C_STATE_FULL_NAME])\n ->distinct()\n ->where('region', '!=', \" \")\n ->orderBy(self::C_STATE)\n ->get();\n\n foreach ($values as $value) {\n $states[$value->state] = $value->stateFullName;\n }\n\n return $states;\n }", "public function sGetCountryList()\n {\n $context = Shopware()->Container()->get('shopware_storefront.context_service')->getShopContext();\n $service = Shopware()->Container()->get('shopware_storefront.location_service');\n\n $countryList = $service->getCountries($context);\n $countryList = Shopware()->Container()->get('legacy_struct_converter')->convertCountryStructList($countryList);\n\n $countryList = array_map(function ($country) {\n $request = $this->front->Request();\n $countryId = (int) $country['id'];\n $country['flag'] = ((int) $request->getPost('country') === $countryId || (int) $request->getPost('countryID') === $countryId);\n\n return $country;\n }, $countryList);\n\n $countryList = $this->eventManager->filter(\n 'Shopware_Modules_Admin_GetCountries_FilterResult',\n $countryList,\n ['subject' => $this]\n );\n\n return $countryList;\n }", "public function states()\n {\n return $this->hasMany('App\\State', 'country_id')->orderby('name', 'asc');\n }", "function getStatesBehalfCountry($countryId) {\n $myModel = new My_Model();\n $whereArray = [\n \"country_id\" => $countryId\n ];\n $result = $myModel->select('states', \"*\", $whereArray);\n if (count($result) > 1) {\n return $result = [\n \"message\" => \"states list\",\n \"data\" => $result\n ];\n } else {\n return $resp = [\n \"message\" => \"no state available\",\n \"data\" => \"null\"\n ];\n }\n }", "static function getStates($bLong=False) {\n\t\tif ($bLong)\n\t\treturn array('AL'=>'Alabama (AL)','AK'=>'Alaska (AK)','AZ'=>'Arizona (AZ)','AR'=>'Arkansas (AR)','CA'=>'California (CA)','CO'=>'Colorado (CO)',\n\t\t\t'CT'=>'Connecticut (CT)','DE'=>'Delaware (DE)','FL'=>'Florida (FL)','GA'=>'Georgia (GA)','HI'=>'Hawaii (HI)','ID'=>'Idaho (ID)',\n\t\t\t'IL'=>'Illinois (IL)','IN'=>'Indiana (IN)','IA'=>'Iowa (IA)','KS'=>'Kansas (KS)','KY'=>'Kentucky (KY)','LA'=>'Louisiana (LA)',\n\t\t\t'ME'=>'Maine (ME)','MD'=>'Maryland (MD)','MA'=>'Massachusetts (MA)','MI'=>'Michigan (MI)','MN'=>'Minnesota (MN)','MS'=>'Mississippi (MS)',\n\t\t\t'MO'=>'Missouri (MO)','MT'=>'Montana (MT)','NE'=>'Nebraska (NE)','NV'=>'Nevada (NV)','NH'=>'New Hampshire (NH)','NJ'=>'New Jersey (NJ)',\n\t\t\t'NM'=>'New Mexico (NM)','NY'=>'New York (NY)','NC'=>'North Carolina (NC)','ND'=>'North Dakota (ND)','OH'=>'Ohio (OH)','OK'=>'Oklahoma (OK)',\n\t\t\t'OR'=>'Oregon (OR)','PA'=>'Pennsylvania (PA)','RI'=>'Rhode Island (RI)','SC'=>'South Carolina (SC)','SD'=>'South Dakota (SD)','TN'=>'Tennessee (TN)',\n\t\t\t'TX'=>'Texas (TX)','UT'=>'Utah (UT)','VT'=>'Vermont (VT)','VA'=>'Virginia (VA)','WA'=>'Washington (WA)','WV'=>'West Virginia (WV)',\n\t\t\t'WI'=>'Wisconsin (WI)','WY'=>'Wyoming (WY)');\n\t\telse\n\t\t\treturn array('AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS',\n\t\t\t'MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY');\n\t}", "public function getCountryList()\n {\n return $this->call('country.list');\n }", "public function getStates(Request $request) {\n if ($states = \\CountryState::getStates(strtoupper($request->get('country')))) {\n $options = '';\n foreach($states as $code=>$country) {\n $options .= '<option value=\"'.$code.'\">'.$country.'</option>';\n }\n $return = [\n 'states' => $states,\n 'options' => $options,\n ];\n } else {\n $return = [\n 'states' => null\n ];\n }\n return response()->json($return);\n }", "public function countries(): array\n {\n return $this->client->get(\"country\");\n }", "function get_list_states($preselect = null){\n $states = array('AL'=>\"Alabama\",\n 'AK'=>\"Alaska\",\n 'AZ'=>\"Arizona\",\n 'AR'=>\"Arkansas\",\n 'CA'=>\"California\",\n 'CO'=>\"Colorado\",\n 'CT'=>\"Connecticut\",\n 'DE'=>\"Delaware\",\n 'DC'=>\"District Of Columbia\",\n 'FL'=>\"Florida\",\n 'GA'=>\"Georgia\",\n 'HI'=>\"Hawaii\",\n 'ID'=>\"Idaho\",\n 'IL'=>\"Illinois\",\n 'IN'=>\"Indiana\",\n 'IA'=>\"Iowa\",\n 'KS'=>\"Kansas\",\n 'KY'=>\"Kentucky\",\n 'LA'=>\"Louisiana\",\n 'ME'=>\"Maine\",\n 'MD'=>\"Maryland\",\n 'MA'=>\"Massachusetts\",\n 'MI'=>\"Michigan\",\n 'MN'=>\"Minnesota\",\n 'MS'=>\"Mississippi\",\n 'MO'=>\"Missouri\",\n 'MT'=>\"Montana\",\n 'NE'=>\"Nebraska\",\n 'NV'=>\"Nevada\",\n 'NH'=>\"New Hampshire\",\n 'NJ'=>\"New Jersey\",\n 'NM'=>\"New Mexico\",\n 'NY'=>\"New York\",\n 'NC'=>\"North Carolina\",\n 'ND'=>\"North Dakota\",\n 'OH'=>\"Ohio\",\n 'OK'=>\"Oklahoma\",\n 'OR'=>\"Oregon\",\n 'PA'=>\"Pennsylvania\",\n 'RI'=>\"Rhode Island\",\n 'SC'=>\"South Carolina\",\n 'SD'=>\"South Dakota\",\n 'TN'=>\"Tennessee\",\n 'TX'=>\"Texas\",\n 'UT'=>\"Utah\",\n 'VT'=>\"Vermont\",\n 'VA'=>\"Virginia\",\n 'WA'=>\"Washington\",\n 'WV'=>\"West Virginia\",\n 'WI'=>\"Wisconsin\",\n 'WY'=>\"Wyoming\");\n foreach ($states as $key=>$val) {\n if ($preselect == $key) {\n $selected = 'selected';\n } else {\n $selected = null;\n }\n echo '<option value=\"' . $key . '\" ' . $selected . '>' . $val . '</option>';\n }\n }", "public function getStates(Request $request) {\n\n $states = StateModel::where('country_id', $request->country_id)->get();\n\n return response()->json($states);\n }", "public function countryList(){\n $response['status'] = \"false\"; \n $response['message'] = \"Invalid request.\"; \n \n $country = Country::getCountries();\n if(!empty($country)){\n $response['status'] = \"true\"; \n $response['message'] = \"Country data.\"; \n $response['data'] = $country; \n }\n $this->response($response);\n \n }", "function _get_valid_state_array()\r\n{\r\n\t$ARRAY = array();\t\t// return\r\n\r\n\t$STATES = array\r\n\t(\r\n 'AL' => 'Alabama',\r\n 'AK' => 'Alaska',\r\n 'AR' => 'Arizona',\r\n 'AZ' => 'Arkansas',\r\n 'CA' => 'California',\r\n 'CO' => 'Colorado',\r\n 'CT' => 'Connecticut',\r\n 'DE' => 'Delaware',\r\n 'FL' => 'Florida',\r\n 'GA' => 'Georgia',\r\n 'HI' => 'Hawaii',\r\n 'ID' => 'Idaho',\r\n 'IL' => 'Illinois',\r\n 'IN' => 'Indiana',\r\n 'IA' => 'Iowa',\r\n 'KS' => 'Kansas',\r\n 'KY' => 'Kentucky',\r\n 'LA' => 'Lousiana',\r\n 'ME' => 'Maine',\r\n 'MD' => 'Maryland',\r\n 'MA' => 'Massachusetts',\r\n 'MI' => 'Michigan',\r\n 'MN' => 'Minnesota',\r\n 'MS' => 'Mississippi',\r\n 'MO' => 'Missouri',\r\n 'MT' => 'Montana',\r\n 'NE' => 'Nebraska',\r\n 'NV' => 'Nevada',\r\n 'NH' => 'New Hampshire',\r\n 'NJ' => 'New Jersey',\r\n 'NM' => 'New Mexico',\r\n 'NY' => 'New York',\r\n 'NC' => 'North Carolina',\r\n 'ND' => 'North Dakota',\r\n 'OH' => 'Ohio',\r\n 'OK' => 'Oklahoma',\r\n 'OR' => 'Oregon',\r\n 'PA' => 'Pennsylvania',\r\n 'RI' => 'Rhode Island',\r\n 'SC' => 'South Carolina',\r\n 'SD' => 'South Dakota',\r\n 'TN' => 'Tennessee',\r\n 'TX' => 'Texas',\r\n 'UT' => 'Utah',\r\n 'VT' => 'Vermont',\r\n 'VA' => 'Virgina',\r\n 'WA' => 'Washington',\r\n 'WV' => 'West Virginia',\r\n 'WI' => 'Wisconsin',\r\n 'WY' => 'Wyoming',\r\n 'DC' => 'District of Columbia'\r\n\t);\r\n\t\r\n\tforeach ( $STATES as $key => $state )\r\n\t{\r\n\t\t$abr = strtoupper($key);\r\n\t\t$ARRAY[$abr] = strtoupper($state);\r\n\t}\r\n\t\r\n\treturn $ARRAY;\r\n}", "function getstates() {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT abbreviation as state, name FROM states\");\n\t\t$sql->execute();\n\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function getState($countryId) {\n $data = [];\n $countries = $this->countryInformationAcquirer->getCountriesInfo();\n foreach ($countries as $country) {\n if ($country->getId() == $countryId) { \n $regions = [];\n if ($availableRegions = $country->getAvailableRegions()) {\n foreach ($availableRegions as $region) {\n $data[] = [\n 'code' => $region->getCode(),\n 'region_id' => $region->getId(),\n 'name' => $region->getName()\n ];\n }\n }\n }\n }\n\n return $data;\n }", "function getStatesProv($country = null) {\n $stpr = [];\n $data = getDataCsv('states.csv');\n\n if (($data) && is_array($data) && ($country)) {\n foreach ($data as $row) {\n if ($country === $row[0]) {\n $stpr[] = $row[1];\n }\n }\n sort($stpr);\n }\n\n return $stpr;\n}" ]
[ "0.7579769", "0.74495417", "0.72990924", "0.72704816", "0.72699696", "0.7187907", "0.7137268", "0.70176685", "0.6987478", "0.6966189", "0.67869556", "0.6778944", "0.6775856", "0.6770199", "0.6745136", "0.67390084", "0.67341036", "0.6726711", "0.66620976", "0.663287", "0.6615733", "0.66152316", "0.6605556", "0.6592925", "0.6551487", "0.65468144", "0.6527216", "0.65180254", "0.64846253", "0.64517784" ]
0.83598095
0
Helper method to create a resource response from arbitrary JSON.
protected function createResponse($json = NULL) { $response = new ResourceResponse(); if ($json) { $response->setContent($json); } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function instantiateJsonResource($payload)\n {\n return new JsonResource($payload);\n }", "private function _createJson()\n {\n return new SlimBootstrap\\ResponseOutputWriter\\Json(\n $this->_request,\n $this->_response,\n $this->_headers,\n $this->_shortName\n );\n }", "function json_response() {\n return app(JsonResponse::class);\n }", "abstract protected function createResource();", "protected function parseResource($resource)\n {\n return json_decode($resource, true);\n }", "private function json() {\n if( $this->format === 'application/hal+json' ) {\n header('Content-Type: application/hal+json; charset=utf-8', TRUE, $this->status);\n $hal_response = (new Resource())\n ->setURI(\"/{$this->resource}\". (isset($this->filters['id']) ? $this->filters['id'] : ''))\n ->setLink($this->resource, new Link(\"/{$this->resource}\"))\n ->setData($this->content);\n\n $writer = new Hal\\JsonWriter(true);\n return $writer->execute($hal_response);\n } else {\n header('Content-Type: application/json; charset=utf-8', TRUE, $this->status);\n return json_encode($this->content, JSON_NUMERIC_CHECK);\n }\n }", "public function createResponse(): ResponseInterface {\n return $this->responseFactory->createResponse()->withHeader('Content-Type', 'application/json');\n }", "private function renderJsonResponse($json, $code = 200)\n {\n return new Response($json, $code, ['application/json']);\n }", "public function json($content): ResponseInterface;", "public static function createFromJson($json);", "private function makeExpectedResource(): CustomerResource\n {\n return new CustomerResource(1, 'John Smith', new AddressResource('UK', 'London'));\n }", "public function jsonAction()\n {\n $response = new Response(json_encode(['name' => 'John Doe']));\n $response->headers->set('Content-Type', 'application/json');\n\n return $response;\n }", "public function json($data): PsrResponseInterface;", "private function createResponse($request)\n {\n return json_decode($request->getBody()->getContents());\n }", "public function toApi(): JsonResource\n {\n return resolve(InputResourcerContract::class, ['input' => $this]);\n }", "private function ajson($data){\n $json = $this->get('serializer')->serialize($data, 'json');\n\n // Response with httpfoundation\n $response = new Response();\n\n // Assign content to the response\n $response->setContent($json);\n\n // Specify response format\n $response->headers->set('Content-Type', 'application/json');\n\n // Return response\n return $response;\n }", "public static function fromJson($json)\n {\n $response = new Response();\n $response->job_id = $json->job_id;\n $response->status = $json->status;\n if ($response->msgs){\n $response->msgs = $json->msgs;\n }\n $response->data = $json->data;\n\n return $response;\n }", "protected function buildResponse($json)\n {\n //log the http response to the timeline\n $this->dispatch('utilbundle.symfout', new SymfonyEvent($this->get('g4_container')->getManifestId(), $json, get_class($this), $this->getRequest()->getRequestUri(), $this->get('g4_container')->getRequestPairKey(), 200));\n\n return new Response($json);\n }", "abstract public function createResponse(AbstractRequestClient $request);", "public function __invoke(): JsonResponse\n {\n $ads = $this->show_properties_to_business_use_case->execute();\n\n $response = new JsonResponse($ads);\n $response->setEncodingOptions( $response->getEncodingOptions() | JSON_PRETTY_PRINT );\n\n return $response;\n }", "abstract protected function createResponse(GuzzleResponse $response);", "public function json(array $data = [], int $status = 200, array $headers = []): ResponseInterface;", "function createResponse ( $from, $action=\"Process Request\", $api_key=null )\n {\n $response = new SyndicationResponse();\n $response->raw = $from;\n\n /// an exception was thrown\n if ( is_subclass_of($from,'Exception') )\n {\n $response->success = false;\n $response->status = $from->getCode();\n $response->format = 'Exception';\n $response->addMessage(array(\n 'errorCode' => $from->getCode(),\n 'errorMessage' => $from->getMessage(),\n 'errorDetail' => \"{$action} Exception\"\n ));\n return $response;\n\n /// we got a response from the server\n } else if ( is_array($from)\n && !empty($from['http'])\n && !empty($from['format']) )\n {\n $status = isset($from['http']['http_code']) ? intval($from['http']['http_code']) : null;\n $response->status = $status;\n /// SUCCESS\n if ( $status>=200 && $status<=299 )\n {\n $response->success = true;\n /// CLIENT SIDE ERROR\n } else if ( $status>=400 && $status<=499 ) {\n /// BAD API KEY\n if ( $status == 401 ) {\n $errorDetail = \"Unauthorized. Check API Key.\";\n /// VALID URL but specific id given does not exist\n } else if ( $status == 404 && !empty($api_key) ) {\n $errorDetail = \"Failed to {$action}. {$api_key} Not Found.\";\n /// Error in the request\n } else {\n $errorDetail = \"Failed to {$action}. Request Error.\";\n }\n $response->success = false;\n $response->addMessage(array(\n 'errorCode' => $status,\n 'errorMessage' => $this->httpStatusMessage($status),\n 'errorDetail' => $errorDetail\n ));\n /// SERVER SIDE ERROR\n } else if ( $status>=500 && $status<=599 ) {\n $response->success = false;\n $response->addMessage(array(\n 'errorCode' => $status,\n 'errorMessage' => $this->httpStatusMessage($status),\n 'errorDetail' => \"Failed to {$action}. Server Error.\"\n ));\n }\n\n if ( $from['format']=='json' )\n {\n /// for any json response\n /// [meta] and [results] expected back from api\n /// [meta][messages] should be consumed if found\n /// [meta][pagination] should be consumed if found\n /// [message] was changed to plural, check for both for now just incase\n\n /// look for meta\n if ( isset($from['meta']) )\n {\n if ( isset($from['meta']['pagination']) )\n {\n $response->addPagination($from['meta']['pagination']);\n }\n if ( isset($from['meta']['messages']) )\n {\n $response->addMessage($from['content']['meta']['messages']);\n }\n if ( isset($from['meta']['message']) )\n {\n $response->addMessage($from['content']['meta']['message']);\n }\n } else if ( isset($from['content']) && isset($from['content']['meta']) ) {\n if ( isset($from['content']['meta']['pagination']) )\n {\n $response->addPagination($from['content']['meta']['pagination']);\n }\n if ( isset($from['content']['meta']['messages']) )\n {\n $response->addMessage($from['content']['meta']['messages']);\n }\n if ( isset($from['content']['meta']['message']) )\n {\n $response->addMessage($from['content']['meta']['message']);\n }\n }\n /// look for results\n if ( isset($from['content']) )\n {\n if ( isset($from['content']['results']) )\n {\n $response->results = (array)$from['content']['results'];\n } else {\n $response->results = (array)$from['content'];\n }\n }\n $response->format = 'json';\n return $response;\n } else if ( $from['format']=='image' ) {\n $response->format = 'image';\n\n /// a single string: base64 encoded image : imagecreatefromstring?\n $response->results = $from['content'];\n return $response;\n /// unknown format\n } else {\n $response->format = $from['format'];\n /// a single string : html : filtered_html?\n $response->results = $from['content'];\n return $response;\n }\n }\n /// we got something weird - can't deal with this\n $response->success = false;\n $status = null;\n if ( is_array($from) && !empty($from['http']) && isset($from['http']['http_status']) )\n {\n $status = $from['http']['http_status'];\n }\n $response->addMessage(array(\n 'errorCode' => $status,\n 'errorMessage' => $this->httpStatusMessage($status),\n 'errorDetail' => \"Unknown response from Server.\"\n ));\n return $response;\n }", "public static function json($data)\n {\n return new JSONResponse($data);\n }", "public function createResponse(): IResponse;", "private function createJsonResponse(\n string $filename,\n \\GuzzleHttp\\Psr7\\Response $response\n )\n {\n $json_response = new \\stdClass();\n $json_response->fileName = $filename;\n $json_response->statusCode = $response->getStatusCode();\n $json_response->reasonPhrase = $response->getReasonPhrase();\n\n return $json_response;\n }", "public function createResponse()\n {\n return new GuzzleResponse();\n }", "private function _createJsonHal()\n {\n return new SlimBootstrap\\ResponseOutputWriter\\JsonHal(\n $this->_request,\n $this->_response,\n $this->_headers,\n $this->_shortName\n );\n }", "public function create(){\n if($resources = Resources::orderby('ResourceName')->get()){\n return Response::json(array(\"status\" => \"success\", \"resources\" => $resources));\n } else {\n return Response::json(array(\"status\" => \"failed\", \"message\" => \"Some thing wrong.\"));\n }\n }", "public function create(): JsonResponse;" ]
[ "0.63463795", "0.6201093", "0.61457247", "0.60321003", "0.5983709", "0.59776056", "0.59756637", "0.59735614", "0.5971271", "0.59570324", "0.59452164", "0.59303325", "0.5910199", "0.588668", "0.5855579", "0.58547795", "0.5849975", "0.5846977", "0.5828988", "0.58284366", "0.57841766", "0.5740029", "0.56545526", "0.56259215", "0.56129706", "0.5611727", "0.55878186", "0.5587094", "0.5574906", "0.55400395" ]
0.753264
0
Creates the archive navigation menu
function create_archive_nav_menu($arr) { // start the html $html = '<nav id="archmenuWP">'; $html .= '<ul class="archlev1 archmenu_list_years" id="archmenu">'; $years = array_keys($arr); foreach($years as $y) { $html .= '<li id="archmenu_li_y_' . $y . '">'; $html .= make_link($y . ' (' . $arr[$y]['count'] . ')', make_url($y.'/')); $html .= '<span class="archmenu_ty archToggleButton" id="archmenu_ty_' . $y . '">+</span>'; // handle clicks with JS $html .= '</li>'; unset($arr[$y]['count']); $months = array_keys($arr[$y]); $html .= '<ul class="archlev2 archmenu_list_months hidden" id="archmenu_y_' . $y . '">'; foreach($months as $m) { $html .= '<li id="archmenu_li_y_' . $y . '_m_' . $m . '">'; $html .= make_link(monthname($m) . ' (' . $arr[$y][$m]['count'] . ')', make_url($y.'/'.$m.'/')); $html .= '<span class="archmenu_tm archToggleButton" id="archmenu_ty_' . $y . '_tm_' . $m . '">+</span>'; // handle clicks with JS $html .= '</li>'; unset($arr[$y][$m]['count']); $entries = $arr[$y][$m]; $html .= '<ul class="archlev3 archmenu_list_titles hidden" id="archmenu_y_' . $y . '_m_' . $m . '">'; foreach($entries as $id => $entry) { $html .= '<li id="archmenu_li_id_' . str_replace('/','-',$id) . '">'; # replace slashes with hyphens for id $html .= make_link($entry['title'], make_url($id)); $html .= '</li>'; } $html .= '</ul>'; } $html .= '</ul>'; } $html .= '</ul></nav>'; return $html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createMenu()\n {\n $parent = $this->Menu()->findOneBy(['label' => 'Artikel']);\n\n $this->createMenuItem(\n [\n 'label' => 'Custom sort',\n 'controller' => 'CustomSort',\n 'action' => 'Index',\n 'active' => 0,\n 'class' => 'sprite-blue-document-text-image',\n 'parent' => $parent,\n 'position' => 6,\n ]\n );\n }", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "public function create_menu()\n\t{\n\t\t$obj = $this; // PHP 5.3 doesn't allow $this usage in closures\n\n\t\t// Add main menu page\n\t\tadd_menu_page(\n\t\t\t'Testimonials plugin', // page title\n\t\t\t'Testimonials', // menu title\n\t\t\t'manage_options', // minimal capability to see it\n\t\t\t'jststm_main_menu', // unique menu slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('main_menu'); // render main menu page template\n\t\t\t},\n\t\t\tplugins_url('images/theater.png', dirname(__FILE__)), // dashboard menu icon\n\t\t\t'25.777' // position in the dahsboard menu (just after the Comments)\n\t\t);\n\t\t// Add help page\n\t\tadd_submenu_page(\n\t\t\t'jststm_main_menu', // parent page slug\n\t\t\t'Testimonials plugin help', // page title\n\t\t\t'What is this?', // menu title\n\t\t\t'manage_options', // capability\n\t\t\t'jststm_help', // slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('help_page');\n\t\t\t}\n\t\t);\n\t}", "function index($isAjaxR=true) {\n if ($isAjaxR) $this->doNotRenderHeader = true;\n return $this->create_archive_nav_menu($this->create_archive_nav_array());\n }", "public function create_menu() {\n\t\tif ( get_network()->site_id !== get_current_blog_id() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//create new top-level menu\n\t\tadd_management_page(\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t'manage_options',\n\t\t\t'sync-newsletter',\n\t\t\tarray( $this, 'display_submenu_page' ),\n\t\t\t6\n\t\t);\n\t}", "public function makeMenu() {}", "function getMenuItems()\n {\n $this->menuitem(\"xp\", \"\", \"main\", array(\"xp.story\", \"admin\"));\n $this->menuitem(\"stories\", dispatch_url(\"xp.story\", \"admin\"), \"xp\", array(\"xp.story\", \"admin\"));\n }", "public function addMenu()\n {\n $wpMenu = [\n [\n 'Bolsista',\n 'Bolsista',\n 'edit_pages',\n 'bolsista',\n $this,\n 'doAction',\n 'dashicons-format-aside',\n 2\n ]\n ];\n $wpSubMenu = [];\n $this->addMenuItem($wpMenu, $wpSubMenu);\n }", "function wpclean_add_metabox_menu_posttype_archive() {\n add_meta_box(\n 'wpclean-metabox-nav-menu-posttype',\n 'Custom Post Archives',\n 'wpclean_metabox_menu_posttype_archive',\n 'nav-menus',\n 'side',\n 'default'\n );\n}", "private function menu()\n {\n $data['links'] = ['create', 'read', 'update', 'delete'];\n\n return $this->view->render($data, 'home/menu');\n }", "public function buildNavigation()\r\n\t{\r\n\t\t$uri\t=\tDunUri :: getInstance( 'SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'intouch' );\r\n\t\t\r\n\t\t$data\t\t=\t'<ul class=\"nav nav-pills\">';\r\n\t\t$actions\t=\tarray( 'default', 'syscheck', 'groups', 'configure', 'updates', 'license' );\r\n\t\t\r\n\t\tforeach( $actions as $item ) {\r\n\t\t\tif ( $item == $this->action && in_array( $this->task, array( 'default', 'save' ) ) ) {\r\n\t\t\t\t$data .= '<li class=\"active\"><a href=\"#\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t\t$data .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$data\t.= '</ul>';\r\n\t\treturn $data;\r\n\t}", "function template_navigation() {\n\t\t$_ENV['menu'] = array();\n\t\t$_ENV['menu']['Main'] = _URL_;\n\t\tModule::includes('menus');\n\t\t$_ENV['menu']['Preferences'] = '?module=prefs';\n\t\t$_ENV['menu']['Logout'] = '?logout=true';\n\n\t\t$buffer = '<ul><li><h2>';\n\t\t$buffer .= array_key_exists('Menu',$_ENV['imgs']['menu']) \n\t\t\t? '<img src=\"'.$_ENV['imgs']['menu']['Menu'].'\" border=\"0\" /> ' : ' ';\n\t\t$buffer .= ' Main Menu</h2><ul>';\n\t\tforeach ($_ENV['menu'] as $module => $items) {\n\t\t\tif (is_array($items)) {\n\t\t\t\t$buffer .= '<li><a href=\"#\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.'</a><ul>';\n\t\t\t\tforeach ($items as $label => $url) {\n\t\t\t\t\t$buffer .= '<li><a href=\"'.$url.'\">';\n\t\t\t\t\t$buffer .= array_key_exists($label,$_ENV['imgs']['menu'])\n\t\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$label].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t\t$buffer .= $label.'</a></li>';\n\t\t\t\t}\n\t\t\t\t$buffer .= '</ul></li>';\n\t\t\t} else {\n\t\t\t\t$buffer .= '<li><a href=\"'.$items.'\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.' </a></li>';\n\t\t\t}\t\n\t\t}\n\t\t$buffer .= '</ul></li></ul>';\n\t\treturn $buffer;\n\t}", "public function archive()\n\t{ \n\t\t$data['title'] = 'Arsip Surat';\n\t\t$this->load->view('admin/includes/_header', $data);\n\t\t$this->load->view('admin/tracemail/archive/index', $data);\n\t\t$this->load->view('admin/includes/_footer', $data);\n }", "public function appendNavigation(){\n\t\t\t$nav = $this->getNavigationArray();\n\n\t\t\t/**\n\t\t\t * Immediately before displaying the admin navigation. Provided with the\n\t\t\t * navigation array. Manipulating it will alter the navigation for all pages.\n\t\t\t *\n\t\t\t * @delegate NavigationPreRender\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t * @param array $nav\n\t\t\t * An associative array of the current navigation, passed by reference\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers('NavigationPreRender', '/backend/', array('navigation' => &$nav));\n\n\t\t\t$xNav = new XMLElement('ul');\n\t\t\t$xNav->setAttribute('id', 'nav');\n\n\t\t\tforeach($nav as $n){\n\t\t\t\tif($n['visible'] == 'no') continue;\n\n\t\t\t\t$can_access = false;\n\n\t\t\t\tif(!isset($n['limit']) || $n['limit'] == 'author')\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\tif($can_access) {\n\t\t\t\t\t$xGroup = new XMLElement('li', $n['name']);\n\t\t\t\t\tif(isset($n['class']) && trim($n['name']) != '') $xGroup->setAttribute('class', $n['class']);\n\n\t\t\t\t\t$hasChildren = false;\n\t\t\t\t\t$xChildren = new XMLElement('ul');\n\n\t\t\t\t\tif(is_array($n['children']) && !empty($n['children'])){\n\t\t\t\t\t\tforeach($n['children'] as $c){\n\t\t\t\t\t\t\tif($c['visible'] == 'no') continue;\n\n\t\t\t\t\t\t\t$can_access_child = false;\n\n\t\t\t\t\t\t\tif(!isset($c['limit']) || $c['limit'] == 'author')\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\tif($can_access_child) {\n\t\t\t\t\t\t\t\t$xChild = new XMLElement('li');\n\t\t\t\t\t\t\t\t$xChild->appendChild(\n\t\t\t\t\t\t\t\t\tWidget::Anchor($c['name'], SYMPHONY_URL . $c['link'])\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$xChildren->appendChild($xChild);\n\t\t\t\t\t\t\t\t$hasChildren = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($hasChildren){\n\t\t\t\t\t\t\t$xGroup->appendChild($xChildren);\n\t\t\t\t\t\t\t$xNav->appendChild($xGroup);\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$this->Header->appendChild($xNav);\n\t\t\tAdministration::instance()->Profiler->sample('Navigation Built', PROFILE_LAP);\n\t\t}", "protected function makeActionMenu() {}", "function theme_menu() {\n global $theme;\n $content = new UN_Content();\n $cAll = $content->getMenuContent($theme->langid);\n if (is_array($cAll)) {\n $out = '<ul>';\n if ($theme->indexlink == 1) {\n $out .= '<li><a href=\"index.php'.theme_global_url(true).'\"><span>'._('Main Page').'</span></a></li>';\n }\n foreach($cAll as $c) {\n $link = ($c['pagelink']!=\"\") ? $c['pagelink'] : 'index.php?t=page&amp;id='.$c['pageid'];\n $title = ($c['pagelink']!=\"\") ? $c['pagedetail'] : $c['pagetitle'];\n $out .= '<li><a href=\"'.$link.theme_global_url().'\" title=\"'.strip_tags($title).'\"><span>'.$c['pagetitle'].'</span></a></li>';\n }\n $out .= '</ul>';\n }\n echo $out;\n}", "public function add_menu() {\n\t\t\tadd_menu_page(\n\t\t\t\t'Amazon Affiliate | Products',\n\t\t\t\t'Products',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\tarray( &$this, 'load_product_page' ),\n\t\t\t\tplugins_url( 'amz-affiliate/img/icon.png' ),\n\t\t\t\t50\n\t\t\t);\n\t\t\tadd_submenu_page(\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\t'Amazon Affiliate | Tables',\n\t\t\t\t'Tables',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/table.php',\n\t\t\t\tarray( &$this, 'load_table_page' )\n\t\t\t);\n\t\t}", "public function menu( )\n {\n\n if( $this->view->isType( View::SUBWINDOW ) )\n {\n $view = $this->view->newWindow('WebfrapMainMenu', 'Default');\n }\n else if( $this->view->isType( View::MAINTAB ) )\n {\n $view = $this->view->newMaintab('WebfrapMainMenu', 'Default');\n $view->setLabel('Explorer');\n }\n else\n {\n $view = $this->view;\n }\n\n $view->setTitle('Webfrap Main Menu');\n\n $view->setTemplate( 'webfrap/menu/modmenu' );\n\n $modMenu = $view->newItem( 'modMenu', 'MenuFolder' );\n $modMenu->setData( DaoFoldermenu::get('webfrap/root',true) );\n\n }", "private function createMenu() {\n $menu = new Menu;\n $menu->name = $this->page['title'];\n if ($this->page['parent_id']) {\n $parent = ModelsPage::findOrFail($this->page['parent_id']);\n $menu->link = env('APP_URL') . '/' . $parent->slug . '/' . $this->page['slug'];\n } else {\n $menu->link = env('APP_URL') . '/' . $this->page['slug'];\n }\n $menu->parent_id = null;\n $order = Menu::select('order')->where('parent_id', null)->orderBy('order', 'desc')->first();\n $menu->order = (($order) ? $order->order : 0) + 1;\n $menu->target = '_self';\n $menu->status = true;\n $menu->save();\n }", "function makeNav($active,$AdminEdit,$userObj)\r\n{\r\n $navArray = array(\r\n \"Resume Archive\" => \"ResumeArchive.php\",\r\n \"Address\" => \"AddressEdit.php\",\r\n \"Phone\" => \"PhoneEdit.php\",\r\n \"Job\" => \"JobEdit.php\",\r\n \"Help/Info\" => \"help.html\",\r\n \"Admin\" => \"Admin.php\"\r\n \r\n );\r\n \r\n \r\n //if they are not an admin delete the admin link\r\n if(!$userObj->isAdmin)\r\n {\r\n unset( $navArray[\"Admin\"]);\r\n }\r\n \r\n //if they are a guest then remove the multiple resume capability and admin link\r\n if($userObj->isGuest)\r\n {\r\n unset($navArray[\"Admin\"]);\r\n unset($navArray[\"Resume Archive\"]);\r\n $navArray = array(\"Create Resume\" => \"ResumeEdit.php\") + $navArray;\r\n \r\n }\r\n \r\n //BUILDS THE MENU\r\n //sets the begining of the menu\r\n $result = \"\r\n <!--Menu-->\r\n <div id='cssmenu'>\r\n <ul>\";\r\n \r\n \r\n //iterates through the array and adds additional items\r\n foreach ($navArray as $key => $value) \r\n { \r\n \r\n $selection = ($active == $value) ? \" class='active'\" : \"\";\r\n $result = $result . \"<li $selection><a href='$value'><span>$key</span></a></li>\";\r\n }\r\n //add closing brace\r\n $result = $result . \" \r\n </ul>\r\n </div>\";\r\n \r\n return $result;//return the nave menu\r\n}", "protected function buildMenu() {\n// $structures = DataSource::factory(Structure::cls());\n// $structures->builder()\n// ->where(\"structure_id=0\")\n// ->order('priority');\n// /** @var Structure[] $aStructures */\n// $aStructures = $structures->findAll();\n// foreach ($aStructures as $oStructure) {\n// $menu->addLeftItem($oStructure->name, $oStructure->path);\n// $this->loadMenuItems($menu->findLeftItemByPath($oStructure->path), $oStructure);\n// }\n//\n// $view = new ViewMMenu();\n// $view->menu = $menu;\n// return $view;\n\n $ViewMainMenu = new ViewMainMenu($this->config['name']);\n $this->setMenuItems($ViewMainMenu->itemsList);\n $currentPath = explode('?', $this->Router->getRoute());\n $ViewMainMenu->currentPath = reset($currentPath);\n\n return $ViewMainMenu;\n }", "public function addMenu(){\n\t\tadd_menu_page(\n\t\t\t$this->plugin->name,\n\t\t\t$this->plugin->name,\n\t\t\t'publish_pages',\n\t\t\t$this->plugin->varName,\n\t\t\tarray($this, 'page'),\n\t\t\t$this->plugin->uri . 'assets/images/icn-menu.png'\n\t\t);\n\t}", "function build () {\n foreach ( $this->items as $item ) {\n if ( $item->id() == $this->current->id() ) {\n $this->menu[]=$item;\n $this->appendChildren();\n } else if ( $item->parent_id() == $this->current->parent_id() ) {\n $this->menu[]=$item;\n }\n }\n reset ( $this->menu );\n }", "public function add_menus()\n {\n }", "protected function buildMenuArray() {}" ]
[ "0.7171481", "0.6945307", "0.6945307", "0.6945307", "0.6945307", "0.6945307", "0.6945307", "0.6941667", "0.68168396", "0.6654495", "0.6566183", "0.64741063", "0.6412446", "0.63486564", "0.6347025", "0.6336897", "0.6327642", "0.6316865", "0.63029736", "0.6295385", "0.6288747", "0.62718564", "0.62628156", "0.62404364", "0.623628", "0.6234856", "0.6226689", "0.6222881", "0.6188968", "0.61811763" ]
0.74843824
0
returns a multidimensional array of year>count, year>months, month>count, month>titles, titles>id>title
function create_archive_nav_array() { $start_and_end_dates = blog_first_and_last_dates(); $start_date = $start_and_end_dates[0]; $end_date = $start_and_end_dates[1]; $start_year = strftime("%Y", strtotime($start_date)); $end_year = strftime("%Y", strtotime($end_date)); $titles_counts_array = array(); // for expand/collapse $now = my_time(); $now_year = date('Y', $now); $now_month= date('m', $now); // build the array for($y=$end_year;$y>=$start_year;$y--) { $num_rows_in_year = count(rtrv_titles($y)); if ($num_rows_in_year) { $titles_counts_array[$y] = array(); $titles_counts_array[$y]['count'] = $num_rows_in_year; for($m='12';$m>='1';$m--) { if ($m<='9') { $m = '0' . $m; } $ids_titles = rtrv_titles($y . '/' . $m); $num_rows_in_month = count($ids_titles); if ($num_rows_in_month) { $titles_counts_array[$y][$m] = array(); $titles_counts_array[$y][$m]['count'] = $num_rows_in_month; foreach($ids_titles as $id_title) { $id = $id_title[0]; $title = $id_title[1]; $titles_counts_array[$y][$m][$id] = array(); $titles_counts_array[$y][$m][$id]['title'] = $title; } } } } } return $titles_counts_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArchiveList()\n {\n $sql = \"SELECT LEFT(`published`, 7) AS `year_month`, COUNT(*) AS `count` FROM `blog_articles` WHERE `published` < NOW() GROUP BY `year_month` ASC\";\n $rows = $this->db->fetchAll($sql);\n\n $years = [];\n foreach ($rows as $row) {\n list($year, $month) = explode('-', $row->year_month);\n $time = strtotime($row->year_month.'-01 00:00:00');\n\n if (!isset($years[$year])) {\n $years[$year] = [ 'count' => 0, 'months' => [] ];\n }\n $years[$year]['count'] += (int)$row->count;\n $years[$year]['months'][$month] = [ 'count' => (int)$row->count, 'name' => strftime('%B', $time) ];\n }\n\n return $years;\n }", "function group_by_month($objects, $getter = 'getCreatedOn') {\n $months = array(\n 1 => lang('January'),\n 2 => lang('February'),\n 3 => lang('March'),\n 4 => lang('April'),\n 5 => lang('May'),\n 6 => lang('June'),\n 7 => lang('July'),\n 8 => lang('August'),\n 9 => lang('September'),\n 10 => lang('October'),\n 11 => lang('November'),\n 12 => lang('December')\n );\n\n $result = array();\n if(is_foreachable($objects)) {\n foreach($objects as $object) {\n $date = $object->$getter();\n\n $month_name = $months[$date->getMonth()];\n\n if(instance_of($date, 'DateValue')) {\n if(!isset($result[$date->getYear()])) {\n $result[$date->getYear()] = array();\n } // if\n\n if(!isset($result[$date->getYear()][$month_name])) {\n $result[$date->getYear()][$month_name] = array();\n } // if\n\n $result[$date->getYear()][$month_name][] = $object;\n } // if\n } // foreach\n } // if\n return $result;\n }", "public function FireStatisticalinYear($date){\n $month_array = array();\n $month = date('Y/m', strtotime($date));\n $month_array[0]['month'] = $month;\n $month_array[0]['count'] = $this->FireStatistical($month);\n for($i = 1; $i < 6; $i++){\n $month = date('Y/m', strtotime($date.' -'.$i.' month'));\n $month_array[$i]['month'] = $month;\n $month_array[$i]['count'] = $this->FireStatistical($month);\n }\n return $month_array;\n }", "public function OrderMonth_Year()\n {\n\t $arrMonth=array();\n\t $year=$this->OrderYear();\n\t foreach($year as $a)\n\t {\n\t\t $arr=array();\n\t\t $select= \"SELECT DISTINCT(month(orderDate)) As orderMonth FROM orders \n\t\t \t\t\twhere year(orderDate)=\".$a->getorderYear(). \" order by orderDate\";\n\t\t $result=$this->executeSelect($select);\n\t\t while($row=mysqli_fetch_array($result))\n\t\t {\n\t\t\t $month=new ordersDto();\n\t\t\t $month->setorderMonth($row['orderMonth']);\n\t\t\t $arr[]=$month;\n\t\t }\n\t\t $this->DisConnectDB();\n\t\t $arrMonth[]=$arr;\n\t }\n/*\t\tfor( $i=0; $i<count($arrMonth); $i++)\n\t\t for($j=0; $j<count($arrMonth[$i]); $j++)\n\t\t\t echo $arrMonth[$i][$j]->getorderMonth();\n\t Thử kiểm tra xem có lấy đc các tháng trong các năm hay k -->>Lấy được\n*/\t\t\n\treturn $arrMonth;\n }", "function _getNbByMonth($year, $sql, $format=0)\r\n\t{\r\n\t\tglobal $langs;\r\n\r\n\t\t$result=array();\r\n\t\t$res=array();\r\n\r\n\t\tdol_syslog(get_class($this).'::'.__FUNCTION__.\"\", LOG_DEBUG);\r\n\t\t$resql=$this->db->query($sql);\r\n\t\tif ($resql)\r\n\t\t{\r\n\t\t\t$num = $this->db->num_rows($resql);\r\n\t\t\t$i = 0; $j = 0;\r\n\t\t\twhile ($i < $num)\r\n\t\t\t{\r\n\t\t\t\t$row = $this->db->fetch_row($resql);\r\n\t\t\t\t$j = $row[0] * 1;\r\n\t\t\t\t$result[$j] = $row[1];\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\t$this->db->free($resql);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdol_print_error($this->db);\r\n\t\t}\r\n\r\n\t\tfor ($i = 1 ; $i < 13 ; $i++)\r\n\t\t{\r\n\t\t\t$res[$i] = (isset($result[$i])?$result[$i]:0);\r\n\t\t}\r\n\r\n\t\t$data = array();\r\n\r\n\t\tfor ($i = 1 ; $i < 13 ; $i++)\r\n\t\t{\r\n\t\t\t$month='unknown';\r\n\t\t\tif ($format == 0) $month=$langs->transnoentitiesnoconv('MonthShort'.sprintf(\"%02d\", $i));\r\n\t\t\telseif ($format == 1) $month=$i;\r\n\t\t\telseif ($format == 2) $month=$langs->transnoentitiesnoconv('MonthVeryShort'.sprintf(\"%02d\", $i));\r\n\t\t\t//$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),($format?\"%m\":\"%b\"));\r\n\t\t\t//$month=dol_substr($month,0,3);\r\n\t\t\t$data[$i-1] = array($month, $res[$i]);\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "public static function archives()\n {\n return static::selectRaw(\"to_char(created_at, 'Month') as month, extract(year from created_at) as year, extract(month from created_at) as sort, count(*) as published\")\n ->groupBy('year', 'month', 'sort')\n ->orderBy('year', 'desc')\n ->orderBy('sort', 'desc')\n ->get()\n ->toArray();\n }", "public function getYears() {\r\n\t\t$year = array();\r\n\t\t$current_year = strftime(\"%Y\");\r\n\t\tfor($i = 2000; $i <= $current_year+1 && $y = strftime(\"%Y\", mktime(0,0,0,0,0,$i)); ++$i) {\r\n\t\t\t$year[$i] = array('id' => $i, 'name' => $y+1);\r\n\t\t}\r\n\t\treturn $year; //array\r\n\t}", "public function getYearValues() {\n\t return array (\n\t array (2012),\n\t array (900),\n\t array (2050),\n\t array ('2050'),\n\t array ('year')\n\t );\n }", "public static function archives()\n {\n return static::selectRaw('year(created_at) year, monthname(created_at) month, \n day(created_at) day, count(*) Published')\n ->groupBy('year','month','day')\n ->orderByRaw('min(created_at) desc')\n ->get()\n ->toArray();\n\n }", "public function getTotalMPerYear(){\n // FROM [dbo].[MDeviceProfile]\n // GROUP BY YEAR([CreatedAt])\n $result = [];\n $this->db->select(\"YEAR([CreatedAt]) as year, count(DeviceId) as count\");\n $this->db->from($this->TBL_MDEVICEPROFILE);\n $this->db->group_by('YEAR([CreatedAt])');\n $q = $this->db->get();\n return $q->result_array();\n }", "public function getMonths() {\r\n\t\t$month = array();\r\n\r\n\t\t$month[1] = array('id' => 1, 'name' => 'January');\r\n\t\t$month[2] = array('id' => 2, 'name' => 'February');\r\n\t\t$month[3] = array('id' => 3, 'name' => 'March');\r\n\t\t$month[4] = array('id' => 4, 'name' => 'April');\r\n\t\t$month[5] = array('id' => 5, 'name' => 'May');\r\n\t\t$month[6] = array('id' => 6, 'name' => 'June');\r\n\t\t$month[7] = array('id' => 7, 'name' => 'July');\r\n\t\t$month[8] = array('id' => 8, 'name' => 'August');\r\n\t\t$month[9] = array('id' => 9, 'name' => 'September');\r\n\t\t$month[10] = array('id' => 10, 'name' => 'October');\r\n\t\t$month[11] = array('id' => 11, 'name' => 'November');\r\n\t\t$month[12] = array('id' => 12, 'name' => 'December');\r\n\r\n\t\treturn $month; //array\r\n\t}", "public function gettotalStoriesPerMonth() {\n $googleVis = new Googlevis();\n $columns = $googleVis->createColumns(\n array('Year/Month' => 'string', 'No. of Stories' => 'number')\n );\n\n $estimate_data = $this->getEstimateDataByMonth(\n $this->easybacklogClient->getStoriesFromTheme()\n );\n\n $row = $rows = $row_data = $row_label = array();\n\n foreach($estimate_data AS $year => $month) {\n foreach($month AS $month_no => $stories) {\n foreach($stories AS $story) {\n $counter = (!isset($counter) ? 0 : $counter);\n $counter += $story;\n }\n $rows[] = $googleVis->createDataRow(\n $year .\"/\". $month_no,\n $counter\n );\n $counter = 0;\n }\n }\n return array('cols' => $columns, 'rows' => $rows);\n }", "protected function getMonthsArray()\n\t{\n\t\t$ma = array_pad([], 13, null);\n\t\tunset($ma[0]);\n\t\tforeach ($this->_attr[self::MONTH_OF_YEAR] as $m) {\n\t\t\tif (is_numeric($m['moy'])) {\n\t\t\t\tfor ($i = $m['moy']; $i <= $m['end'] && $i <= 12; $i += $m['period']) {\n\t\t\t\t\t$ma[$i] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ma;\n\t}", "public function getArchives()\n {\n \n $qb = $this->createQueryBuilder('p')\n ->select('p.published_at as publishedat, YEAR(p.published_at) as year, MONTH(p.published_at) as month, COUNT(p.published_at) as post')\n ->groupBy('year')\n ->groupBy('month')\n ->orderBy('p.published_at', 'DESC');\n \n $query = $qb->getQuery();\n \n return $query->getResult();\n }", "public function monthly_sales_report()\n\t{\n\t\t$query1 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tdate,\n\t\t\t\tEXTRACT(MONTH FROM date) as month, \n\t\t\t\tCOUNT(invoice_id) as total\n\t\t\tFROM \n\t\t\t\tinvoice\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\t$query2 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tpurchase_date,\n\t\t\t\tEXTRACT(MONTH FROM purchase_date) as month, \n\t\t\t\tCOUNT(purchase_id) as total_month\n\t\t\tFROM \n\t\t\t\tproduct_purchase\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM purchase_date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM purchase_date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\treturn [$query1,$query2];\n\t}", "function sortReportByMonth($data) {\n\t\t$sortedLabels = array();\n\t\t$sortedValues = array();\n\t\t$sortedLinks = array();\n\t\t$years = array();\n\t\t$mOrder = array(\"January\" => 0,\"February\" => 1,\"March\" => 2, \"April\" => 3, \"May\" => 4, \"June\" => 5,\"July\" => 6,\"August\" => 7,\"September\" => 8,\"October\" => 9,\"November\" => 10,\"December\" => 11);\n\t\tforeach($data['labels'] as $key=>$label) {\n\t\t\tlist($month, $year) = explode(' ', $label);\n\t\t\tif(!empty($year)) {\n\t\t\t\t$indexes = $years[$year];\n\t\t\t\tif(empty($indexes)) {\n\t\t\t\t\t$indexes = array();\n\t\t\t\t\t$indexes[$mOrder[$month]] = $key;\n\t\t\t\t\t$years[$year] = $indexes; \n\t\t\t\t} else {\n\t\t\t\t\t$indexes[$mOrder[$month]] = $key;\n\t\t\t\t\t$years[$year] = $indexes;\n\t\t\t\t}\n\t\t\t} else if ($label == '--'){\n\t\t\t\t$indexes = $years['unknown'];\n\t\t\t\tif(empty($indexes)) {\n\t\t\t\t\t$indexes = array();\n\t\t\t\t\t$indexes[] = $key;\n\t\t\t\t\t$years['unknown'] = $indexes; \n\t\t\t\t} else {\n\t\t\t\t\tdie;\n\t\t\t\t\t$indexes[] = $key;\n\t\t\t\t\t$years['unknown'] = $indexes;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($years)) {\n\t\t\tksort($years);\n\t\t\tforeach ($years as $indexes) {\n\t\t\t\tksort($indexes); // to sort according to the index\n\t\t\t\tforeach($indexes as $index) {\n\t\t\t\t\t$sortedLabels[] = $data['labels'][$index];\n\t\t\t\t\t$sortedValues[] = $data['values'][$index];\n\t\t\t\t\t$sortedLinks[] = $data['links'][$index];\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$indexes = array();\n\t\t\tforeach ($data['labels'] as $key=>$label) {\n\t\t\t\tif(isset($mOrder[$label])) {\n\t\t\t\t\t$indexes[$mOrder[$label]] = $key;\n\t\t\t\t} else {\n\t\t\t\t\t$indexes['unknown'] = $key;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tksort($indexes);\n\t\t\tforeach ($indexes as $index) {\n\t\t\t\t$sortedLabels[] = $data['labels'][$index];\n\t\t\t\t$sortedValues[] = $data['values'][$index];\n\t\t\t\t$sortedLinks[] = $data['links'][$index];\n\t\t\t}\n\t\t}\n\n\t\t$data['labels'] = $sortedLabels;\n\t\t$data['values'] = $sortedValues;\n\t\t$data['links'] = $sortedLinks;\n\n\t\treturn $data;\n\t}", "protected function getMesesArray(){\n\n $dt = new \\DateTime();\n $dt->modify('-13 months');\n for ($i = 0 ; $i < 12 ; $i ++){\n \t\t$dt->modify('+1 month');\n $meses[$i] = strftime(\"%b %Y\" , $dt->getTimeStamp());\n }\n return json_encode($meses);\n }", "function getMonthArray()\n{\n\t$arrMonths = array();\n\n\tfor ($i=1; $i<13; $i++)\n\t{\n\t\t$arrMonths[$i] = date('M', mktime(0, 0, 1, $i, 1));\n\t}\n\t\n\treturn $arrMonths;\n}", "public function getTotalSPerYear(){\n // FROM [mon].[ProjectDetail]\n // GROUP BY YEAR([CreatedAt])\n $result = [];\n $this->db->select(\"YEAR([CreatedAt]) as year, count(ApiKey) as count\");\n $this->db->from($this->TBL_SDEVICEPROFILE);\n $this->db->group_by('YEAR([CreatedAt])');\n $q = $this->db->get();\n return $q->result_array();\n }", "function _getAverageByMonth($year, $sql, $format=0)\r\n\t{\r\n\t\tglobal $langs;\r\n\r\n\t\t$result=array();\r\n\t\t$res=array();\r\n\r\n\t\tdol_syslog(get_class($this).'::'.__FUNCTION__.\"\", LOG_DEBUG);\r\n\t\t$resql=$this->db->query($sql);\r\n\t\tif ($resql)\r\n\t\t{\r\n\t\t\t$num = $this->db->num_rows($resql);\r\n\t\t\t$i = 0; $j = 0;\r\n\t\t\twhile ($i < $num)\r\n\t\t\t{\r\n\t\t \t\t$row = $this->db->fetch_row($resql);\r\n\t\t \t\t$j = $row[0] * 1;\r\n\t\t \t\t$result[$j] = $row[1];\r\n\t\t \t\t$i++;\r\n\t\t \t}\r\n\t\t \t$this->db->free($resql);\r\n\t\t}\r\n else dol_print_error($this->db);\r\n\r\n\t\tfor ($i = 1 ; $i < 13 ; $i++)\r\n\t\t{\r\n\t\t\t$res[$i] = (isset($result[$i])?$result[$i]:0);\r\n\t\t}\r\n\r\n\t\t$data = array();\r\n\r\n\t\tfor ($i = 1 ; $i < 13 ; $i++)\r\n\t\t{\r\n\t\t\t$month='unknown';\r\n\t\t\tif ($format == 0) $month=$langs->transnoentitiesnoconv('MonthShort'.sprintf(\"%02d\", $i));\r\n\t\t\telseif ($format == 1) $month=$i;\r\n\t\t\telseif ($format == 2) $month=$langs->transnoentitiesnoconv('MonthVeryShort'.sprintf(\"%02d\", $i));\r\n\t\t\t//$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),($format?\"%m\":\"%b\"));\r\n\t\t\t//$month=dol_substr($month,0,3);\r\n\t\t\t$data[$i-1] = array($month, $res[$i]);\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "public function getEstimateDataByMonth($stories) {\n\n $aggEstimates = array();\n foreach($stories AS $story) {\n\n // Grab the date of the story and put it into a \n // [year][month][estimate] = counter\n list($year, $month, $dayTime) = explode(\"-\", $story['created_at']);\n\n // Does the year exist?\n if (!isset($aggEstimates[$year])) \n $aggEstimates[$year] = null;\n\n // Does the month exist?\n if (!isset($aggEstimates[$year][$month])) \n $aggEstimates[$year][$month] = null;\n\n // Does the estimate exist?\n $est = round($story['score_50']);\n if (!isset($aggEstimates[$year][$month][$est])) \n $aggEstimates[$year][$month][$est] = 0;\n \n $aggEstimates[$year][$month][$est]++;\n \n }\n\n $new = $aggEstimates;\n $aggEstimates = array();\n foreach($new AS $year => $month) {\n ksort($month);\n foreach($month AS $monthNo => $estimates) {\n ksort($estimates);\n $aggEstimates[$year][$monthNo] = $estimates;\n }\n }\n ksort($aggEstimates);\n return $aggEstimates;\n }", "public function getMonths()\r\n\t{\r\n \t$months = array();\r\n\t\t\r\n\t\tfor($i = 1; $i <= 12; $i++)\r\n\t\t{\r\n\t\t\t$label = ($i < 10) ? (\"0\" . $i) : $i;\r\n\t\t\t\r\n\t\t\t$months[] = array(\"num\" => $i, \"label\" => $this->htmlEscape($label));\r\n\t\t}\r\n\t\t\r\n\t\treturn $months;\r\n\t}", "private function grab_data(){\n\t\t$y=0;\n\t\tfor($i=$this->startingmonth;$i>=0;$i--){\n\t\t\t$this->searchmonth = date(\"n\")-$i;\n\t\t\t$this->searchyear = date(\"Y\");\n\t\t\tif(0 >= $this->searchmonth){\n\t\t\t\twhile(0 >= $this->searchmonth){\n\t\t\t\t\t$this->searchmonth += 12;\n\t\t\t\t\t$this->searchyear--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->count_chrono_records();\n\t\t\t$this->monthlyrecordvolume[$i] = intval($this->volume_of_records_in_timerange);\n\t\t\tif(0==$this->max_month_value or $this->monthlyrecordvolume[$i] > $this->max_month_value){\n\t\t\t\t$this->max_month_value = $this->monthlyrecordvolume[$i];\n\t\t\t}\n\t\t\t$this->monthaggregator += $this->monthlyrecordvolume[$i];\n\t\t\t\n\t\t\t$this->count_months_recorded_this_year++;\n\t\t\tif(12 == $this->searchmonth or 0 == $i ){\n\t\t\t\t$this->ave_this_year[$y]['volume'] = intval($this->monthaggregator / $this->count_months_recorded_this_year);\n\t\t\t\t$this->ave_this_year[$y]['month'] = $i;\n\t\t\t\t$this->ave_this_year[$y]['year'] = $this->searchyear;\n\t\t\t\t$this->monthaggregator = 0;\n\t\t\t\t$this->count_months_recorded_this_year = 0;\n\t\t\t\t$y++;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "function _getAmountByMonth($year, $sql, $format=0)\r\n\t{\r\n\t\tglobal $langs;\r\n\r\n\t\t$result=array();\r\n\t\t$res=array();\r\n\r\n\t\tdol_syslog(get_class($this).'::'.__FUNCTION__.\"\", LOG_DEBUG);\r\n\r\n\t\t$resql=$this->db->query($sql);\r\n\t\tif ($resql)\r\n\t\t{\r\n\t\t\t$num = $this->db->num_rows($resql);\r\n\t\t\t$i = 0;\r\n\t\t\twhile ($i < $num)\r\n\t\t \t{\r\n\t\t \t\t$row = $this->db->fetch_row($resql);\r\n\t\t \t\t$j = $row[0] * 1;\r\n\t\t \t\t$result[$j] = $row[1];\r\n\t\t \t\t$i++;\r\n\t\t \t}\r\n\t\t \t$this->db->free($resql);\r\n\t\t}\r\n else dol_print_error($this->db);\r\n\r\n\t\tfor ($i = 1 ; $i < 13 ; $i++)\r\n\t\t{\r\n\t\t\t$res[$i] = (int) round((isset($result[$i])?$result[$i]:0));\r\n\t\t}\r\n\r\n\t\t$data = array();\r\n\r\n\t\tfor ($i = 1 ; $i < 13 ; $i++)\r\n\t\t{\r\n\t\t\t$month='unknown';\r\n\t\t\tif ($format == 0) $month=$langs->transnoentitiesnoconv('MonthShort'.sprintf(\"%02d\", $i));\r\n\t\t\telseif ($format == 1) $month=$i;\r\n\t\t\telseif ($format == 2) $month=$langs->transnoentitiesnoconv('MonthVeryShort'.sprintf(\"%02d\", $i));\r\n\t\t\t//$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),($format?\"%m\":\"%b\"));\r\n\t\t\t//$month=dol_substr($month,0,3);\r\n\t\t\t$data[$i-1] = array($month, $res[$i]);\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "public function categories()\n {\n $catsArray = [];\n $countCat = [];\n $lastMonCounts = [];\n $currentMonCounts = [];\n $countCatNew = [];\n $currentMonth = date('F');\n $lastMonth = Date(\"F\", strtotime(\"first day of last month\"));\n // die(Date(\"F\", strtotime(\"first day of next month\")));\n $categories = $this->notesModel->getCategories();\n\n foreach ($categories as $key) {\n array_push($catsArray, $key->category);\n $lastMonResult = json_decode(json_encode($this->notesModel->getMonthlyCounts($key->category, $lastMonth)), true);\n $curMonResult = json_decode(json_encode($this->notesModel->getMonthlyCounts($key->category, $currentMonth)), true);\n array_push($countCat, $this->notesModel->getCategoryCount($key->category));\n array_push($lastMonCounts, $lastMonResult['monthly_counts']);\n array_push($currentMonCounts, $curMonResult['monthly_counts']);\n };\n foreach ($countCat as $key) {\n array_push($countCatNew, $key->no_of_notes);\n }\n function strToNum($value)\n {\n return empty($value) ? 0 : intval($value);\n }\n $lastCountsNew = array_map('strToNum', $lastMonCounts);\n $curCountsNew = array_map('strToNum', $currentMonCounts);\n\n $data = [\n 'categories' => $catsArray,\n 'countCat' => $countCatNew,\n 'lastMonCounts' => $lastCountsNew,\n 'currentMonCounts' => $curCountsNew,\n ];\n // die(print_r($data['categories'][0]->category));\n echo json_encode($data);\n }", "function getreportYearfn($year)\n\t{\n\t\t$customerid=\"SELECT count(customer_id) as cou,month from customer_general_detail where year = '$year' GROUP BY month\";\n\t\t$customeriddata = $this->get_results($customerid);\n\t\treturn $customeriddata;\n\t}", "function get_years_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('Y')] = $fecha->format('Y');\n }\n return $result;\n}", "public function getMonthlyViewsCount(?int $year = null) : array {\n\n $binds = [];\n $sql = 'SELECT \n p.profile_id,\n p.profile_name, \n YEAR(v.date) AS year, \n MONTH(v.date) AS month, \n SUM(v.views) AS sum_views\n FROM \n profiles p\n LEFT JOIN \n views v ON v.profile_id = p.profile_id';\n\n if ($year != null) {\n $sql .= ' WHERE YEAR(v.date) = :year';\n $binds['year'] = $year;\n }\n\n $sql .= '\n GROUP BY \n p.profile_id, p.profile_name, year, month\n ORDER BY \n p.profile_name, year, month';\n\n $stmt = $this->db->prepare($sql);\n $stmt->execute($binds);\n return $stmt->fetchAll();\n\n }", "function get_month_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('m')] = month_converter($fecha->format('m'));\n }\n return $result;\n}", "public function getYears()\r\n\t{\r\n \t$years = array();\r\n\t\t\r\n\t\t$initYear = (int) date(\"Y\");\r\n\t\t\r\n\t\tfor($i = $initYear; $i <= $initYear + 10; $i++)\r\n\t\t{\r\n\t\t\t$years[] = array(\"num\" => $i, \"label\" => $i);\r\n\t\t}\r\n\t\t\r\n\t\treturn $years;\r\n\t}" ]
[ "0.6927135", "0.64077973", "0.6244798", "0.61899984", "0.61556554", "0.6109561", "0.6095441", "0.60229987", "0.6020714", "0.5993763", "0.58583415", "0.5840325", "0.5838804", "0.5833816", "0.5798698", "0.57857996", "0.57696384", "0.57665646", "0.5762026", "0.571803", "0.57113147", "0.56904703", "0.5685835", "0.56712115", "0.5668757", "0.5658509", "0.565039", "0.5642645", "0.5628421", "0.55663896" ]
0.7354749
0
Return one page of order entries
public function getOnePageOfOrderEntries($params, $where = null) { $pageNumber = isset($params['page']) ? $params['page'] : 1; if (empty($pageNumber)) {$pageNumber = 1;} $limit = isset($params['limit']) ? $params['limit'] : null; if (empty($limit)) {$limit = null;} if (!isset($params['sort'])) { $sort = 'id'; } else { $sort = $params['sort'] . ' ' . $params['dir']; } $query = $this->select(); if ($where) { $query->where($where); } $query->order($sort); $paginator = new Zend_Paginator( new Zend_Paginator_Adapter_DbTableSelect($query) ); $paginator->setItemCountPerPage($limit); $paginator->setCurrentPageNumber($pageNumber); $rows = []; foreach ($paginator as $record) { $rows[] = $record->toArray(); } $page = ['rows' => $rows, 'total' => $paginator->getTotalItemCount()]; return $page; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAllOrdersDescPaginated();", "public function index()\n {\n return Order::paginate(5);\n }", "function getOrderings() ;", "function geneshop_my_orders_page($account) {\n drupal_set_title(t(\"@name's Order History\", array('@name' => format_username($account))), PASS_THROUGH);\n $build = array();\n $query = db_select('node', 'n')->extend('PagerDefault');\n $nids = $query->fields('n', array('nid', 'sticky', 'created'))->condition('type', geneshop_ORDER_NODETYPE)->condition('uid', $account->uid)->condition('status', 1)->orderBy('created', 'DESC')->limit(variable_get('default_nodes_main', 10))->addTag('node_access')->execute()->fetchCol();\n if (!empty($nids)) {\n $nodes = node_load_multiple($nids);\n $build += node_view_multiple($nodes);\n $build['pager'] = array(\n '#theme' => 'pager',\n '#weight' => 5,\n );\n }\n else {\n drupal_set_message(t('You have no orders for this account.'));\n }\n return $build;\n}", "public function getPaginated();", "public function index()\n {\n return OrderCollection::collection(Order::paginate(10));\n }", "public function getMainPageList()\r\n {\r\n $q = $this->createQuery('c')\r\n ->orderBy('ordered');\r\n return $q->execute();\r\n }", "function select_all_orders($pageNum) {\n global $db;\n\n $query = \"SELECT * FROM orders ORDER BY order_date LIMIT \".($pageNum-1).\",1\";\n $statement = $db->prepare($query);\n try {\n $statement->execute();\n } catch (Exception $ex) {\n //********************************************\n }\n $orders = $statement->fetchAll();\n $statement->closeCursor();\n return $orders;\n}", "function getOrder();", "public function index()\n {\n //\n return OrderResource::collection(Order::paginate());\n }", "public function getFirstPage();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "function getPageData($startRow, $orderBys = null)\n{\n global $dbh;\n\n $SQL = $this->getListSQL();\n $SQL .= $this->getOrderBySQL($orderBys);\n $SQL .= \" LIMIT $startRow, {$this->rowsPerPage}\";\n\n $result = $dbh->getAll($SQL, DB_FETCHMODE_ASSOC);\n dbErrorCheck($result);\n\n if( $this->useListSequence ){\n $this->saveListSequence($result, $startRow);\n }\n\n return $result;\n}", "public function getOrderings() {}", "public function getOrderings();", "abstract public function getPaginate($premiereEntree, $messageTotal, $where);", "public function writeRecords_pages_order() {}", "public function listAction($order)\n {\n $page = $this->get('request')->get('page', 1);\n $perPage = 10;\n\n $entities = $this->repo->getPaginatedList($order, $page, $perPage);\n\n return array(\n 'paginator' => $entities,\n );\n }", "function get_order()\n{\n\n}", "public function do_paging()\n {\n }", "function page_handler() {\n\t\tprint '<div class=\"wrap\">\n\t\t\t<ul>';\n\t\t\n\t\t$first_query = new WP_Query();\n\t\t\n\t\t// Query all orders\n\t\t$first_query->query(array(\n\t\t\t'post_type' => 'shop_order',\n\t\t\t'posts_per_page' => '-1'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$not_alive = array();\n\t\t\n\t\twhile ($first_query->have_posts()) : $first_query->the_post();\n\t\t\t\n\t\t\t// Finds all orders lacking signs of life\n\t\t\tif ( !is_object_in_term( get_the_ID(), 'shop_order_status' ) ) :\n\t\t\t\t$not_alive[] = get_the_ID();\n\t\t\tendif;\n\t\t\n\t\tendwhile;\n\t\t\n\t\t$second_query = new WP_Query();\n\t\t\n\t\t// Query all orders BUT those contained in the $not_alive array\n\t\t$second_query->query(array(\n\t\t\t'post_type' => 'shop_order',\n\t\t\t'post__in' => $not_alive,\n\t\t\t'posts_per_page' => '-1'\n\t\t\t)\n\t\t);\n\t\t\n\t\twhile ($second_query->have_posts()) : $second_query->the_post();\n\t\t\t\n\t\t\tglobal $wpdb;\n\n\t\t\t$offset = '0';\n\t\t\n\t\t\tdo {\n\t\t\t\tif ( $offset != '0' ) {\n\t\t\t\t\t$db_offset = \" OFFSET \" . $offset;\n\t\t\t\t} else {\n\t\t\t\t\t$db_offset = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Check comments until a solid match is found\n\t\t\t\t// The Query\n\t\t\t\t$comments = $wpdb->get_results (\"SELECT *\n\t\t\t\t\tFROM $wpdb->comments\n\t\t\t\t\tWHERE comment_approved = '1' AND comment_type = 'order_note' AND comment_post_ID=\".get_the_ID().\"\n\t\t\t\t\tORDER BY comment_date_gmt DESC\n\t\t\t\t\tLIMIT 1\" . $db_offset);\n\n\t\t\t\t// Looping through comments to find last true indication of life\n\t\t\t\tif ( $comments ) {\n\t\t\t\t\tforeach ( $comments as $comment ) {\n\n\t\t\t\t\t\t$vital_check = preg_match(\"/.*Order status changed from .* to (.*)./\", $comment->comment_content);\n\t\t\t\t\t\t$vital_status = preg_replace(\"/.*Order status changed from .* to (.*)./\", \"$1\", $comment->comment_content);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Check if comment is a match to Woo template\n\t\t\t\t\t\tif ( $vital_check == '1' ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Extract $vital_status\n\t\t\t\t\t\t\t$order = new WC_Order(get_the_ID());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Update order status with extracted $vital_status\n\t\t\t\t\t\t\t$order->update_status($vital_status, 'Revitalized!');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '<li>Order #'.get_the_ID().' has been revitalized, due to its previously logged state of \"'.$vital_status.'\"!';\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$offset++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\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\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\twhile ($vital_check === '0');\n\t\t\n\t\tendwhile;\n\t\t\n\t\tprint '</ul>\n\t\t</div>';\n\t}", "function page($num = 1)\n {\n // retrieve all data from history table per sorting\n $source = $this->factory->sortAll($this->sort);\n $records = array(); // start with an empty extract\n\n // use a foreach loop, because the record indices may not be sequential\n $index = 0; // where are we in the tasks list\n $count = 0; // how many items have we added to the extract\n $start = ($num - 1) * $this->itemsPerPage;\n \n foreach($source as $record) {\n if ($index++ >= $start) {\n $records[] = $record;\n $count++;\n }\n if ($count >= $this->itemsPerPage) break;\n }\n \n $this->data['pagination'] = $this->pagenav($num);\n $this->showPage($records);\n }", "function getOrder()\n {\n return 20;\n }", "function getOrder()\n {\n return 20;\n }", "public function getByPage($pageNo) {}" ]
[ "0.66023403", "0.6132431", "0.612481", "0.58969814", "0.5876828", "0.5854071", "0.58467335", "0.5836994", "0.5828445", "0.5794937", "0.5775735", "0.57602185", "0.57602185", "0.57602185", "0.57602185", "0.57602185", "0.57602185", "0.575228", "0.5691405", "0.56791544", "0.5668754", "0.5628684", "0.5628302", "0.55825365", "0.5576227", "0.55640346", "0.5561839", "0.55261666", "0.55261666", "0.5506263" ]
0.62987506
1
Test that the request object extends the abstract
public function testConstruct() { $request = $this->createRequest(); $this->assertInstanceOf('Nimbles\Core\Request\RequestAbstract', $request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function is_base_request()\n {\n }", "abstract public function request();", "public function isRequest();", "public function testToRequest(): void\n {\n $request = new Request([\n 'banana' => 'strawberry',\n ]);\n $this->assertInstanceOf(IllRequest::class, $request->toRequest());\n }", "public function onInheritanceFromRequest($req) {\n\t}", "public function testNewInstanceWithDefaultArguments(): void\n {\n $this->assertInstanceOf(Request::class, self::$request);\n }", "public function testRequestIsPassedCorrectly()\n {\n $this->assertPropertySame('request', $this->request);\n }", "abstract protected function requestClass(): string;", "public function testCreateRequest() {\n\t\t$uri = 'http://www.php.net';\n\t\t$request = new HttpWebRequest($uri);\n\t\t\n\t\t// make sure it's the correct type/sub-type\n\t\t$this->assertTrue($request instanceof WebRequest);\n\t\t$this->assertTrue($request instanceof HttpWebRequest);\n\t\t\n\t\t// check to see if the uri was properly set\n\t\t$this->assertEquals($uri, $request->requestUri);\n\t}", "public function test_psr7_request(): void {\n\n\t\t$request = HTTP_Helper::request(\n\t\t\t'GET',\n\t\t\t'https://google.com'\n\t\t);\n\n\t\t$this->assertInstanceOf( RequestInterface::class, $request );\n\t\t$this->assertEquals( 'GET', $request->getMethod() );\n\t\t$this->assertInstanceOf( UriInterface::class, $request->getUri() );\n\t\t$this->assertEquals( 'google.com', $request->getUri()->getHost() );\n\t}", "abstract public function processRequest();", "public abstract function processRequest();", "function is_request($meta = array())\n {\n }", "abstract public function initFromRequest(\\App\\Request $request);", "public function testInit()\n {\n $request = new Request();\n $obj = $request->init();\n $this->assertEquals($request, $obj);\n }", "abstract public function verifyRequest(): void;", "abstract public function verifyRequest(): void;", "protected function _request() {}", "public function testGetRequest()\n {\n $viewCounterServiceMock = $this->getMockBuilder(ViewCounter::class)\n ->setConstructorArgs([$this->counterManagerMock, $this->requestStackMock, $this->viewcounterConfigMock])\n ->getMock();\n\n $this->requestStackMock\n ->expects($this->once())\n ->method('getCurrentRequest')\n ->with()\n ->willReturn($this->request);\n\n $request = $this->invokeMethod($viewCounterServiceMock, 'getRequest', []);\n\n $this->assertTrue($request instanceof Request);\n }", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function testRequest() {\n $params = array('type'=>'categorie-name',\n 'search'=>'android');\n $this->assertType(PHPUnit_Framework_Constraint_IsType::TYPE_OBJECT, $this->object->request('get-product-categories', $params));\n }", "public function __construct(AbstractRequest $request)\n {\n $this->_request = $request;\n }", "public function testGetNewInterRequestObject()\n {\n $value = $this->class->get_new_inter_request_object(array());\n\n $this->assertInstanceOf('Lunr\\Corona\\InterRequest', $value);\n }", "public function filter_extends_filters_abstract()\n {\n $this->assertTrue(get_parent_class(new UserFilters(request())) === FiltersAbstract::class);\n }", "public function testImplementsAbstractController(): void\n {\n $controller = new UserController($this->request, $this->userService);\n\n $this->assertInstanceOf(AbstractController::class, $controller);\n }", "protected abstract function handleRequest();", "public function getRequest(): RequestInterface;" ]
[ "0.68234825", "0.65541375", "0.6515897", "0.642222", "0.63653684", "0.6318197", "0.6315014", "0.6287202", "0.6258766", "0.6159344", "0.6150151", "0.6033908", "0.6005173", "0.60037893", "0.5980461", "0.5972225", "0.5972225", "0.5960055", "0.5947187", "0.5937627", "0.5937627", "0.5937627", "0.5937627", "0.59271336", "0.5915367", "0.5876263", "0.5874224", "0.58123255", "0.5812138", "0.58096343" ]
0.71765363
0
Tests using the session, when accessing via request, the session should be read only
public function testSession() { static::$_session = array( 'test1' => 'abc', 'test2' => 123 ); $request = $this->createRequest(); $this->assertInstanceOf('Nimbles\Http\Session', $request->getSession()); $this->assertInstanceOf('Nimbles\Http\Session', $request->session); $this->assertEquals('abc', $request->getSession('test1')); $this->assertEquals('abc', $request->session->read('test1')); $this->assertEquals(123, $request->getSession('test2')); $this->assertNull($request->getSession('test3')); $request->getSession()->write('test3', 'def'); $this->assertNull($request->getSession('test3')); $request->getSession()->clear(); $this->assertEquals('abc', $request->getSession('test1')); $this->assertEquals(123, $request->getSession('test2')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetSession()\n {\n $this->assertEquals('session value', $this->_req->getSession('my_test_session'));\n }", "function testGetUserBySession() {\n $this->assertFalse(Sessions::getUserBySession());\n }", "public function hasSession() {}", "function sys_session_test(){\n session_name(\"MELOLSESSION\");\n session_start();\n if (isset($_SESSION[\"userId\"]) && isset($_SESSION[\"sessionId\"]) && isset($_REQUEST[\"sessionId\"])) {\n if ($_SESSION[\"sessionId\"] == $_REQUEST[\"sessionId\"]) {\n return TRUE;\n }\n }\n return FALSE;\n}", "public function sessionDummy()\n {\n return true;\n }", "public function testSessionHttpServer(): void\n {\n $this->session(['foo' => 'session data']);\n $this->get('/request_action/session_test');\n $this->assertResponseOk();\n $this->assertResponseContains('session data');\n $this->assertHeader('X-Middleware', 'true');\n }", "public function testGetSession()\n {\n $response = $this->loginAsRole(Role::ADMIN)\n ->get($this->url('sessions/1'));\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'name',\n 'school_id',\n 'start_date',\n 'end_date'\n ]);\n }", "public function getSession() {}", "function testSet() {\n\n\t\tsession_start();\n\n\t\techo $_SESSION['sessionID'];\n\t\t\n\t\tif(!isset($_SESSION['sessionID'])){\n\t\t\techo \"out\";\n\t\t\texit;\n\t\t}\n\n\t\techo \"in\";\n\t}", "abstract protected function getSession();", "public function testReadingSession()\n {\n // Get session\n $session = $this->getWorkingReader()->getSession();\n\n //-- Validate\n $this->assertSame(Session::TYPE_RACE, $session->getType());\n $this->assertSame('Quick Race', $session->getName());\n $this->assertSame(5, $session->getMaxLaps());\n $this->assertSame(30, $session->getMaxMinutes());\n $this->assertSame(5, $session->getLastedLaps());\n }", "protected static function isBackendSession() {}", "public function testArrayAccess() {\n\t\t$session = $this->getSession();\n\t\t$this->assertFalse(isset($session['test']), 'Test key is set for new empty session');\n\t\t$this->assertNull($session['test'], 'Not set key is not null');\n\t\t$session['test'] = 'testValue';\n\t\t$this->assertTrue(isset($session['test']), 'Test key is not set');\n\t\t$this->assertSame('testValue', $session['test'], 'Test key is not correctly set');\n\t\tunset($session['test']);\n\t\t$this->assertFalse(isset($session['test']), 'Test key is set after deleting');\n\t\t$this->assertNull($session['test'], 'Deleted key is not null');\n\t}", "public static function use_sessions()\n {\n \\Session::started() or \\Session::load();\n }", "public function getSession();", "public function testGetSessionDefault()\n {\n $val = $this->_req->getSession('DOESNT_EXIST', 'default value');\n $this->assertEquals('default value', $val);\n }", "public function testIndexStatus(){\n\n $user = factory(User::class)->create();\n\n $this->actingAs($user)->withSession(['foo' => 'bar'])->visit('admin/price/')->see(\"Price List\")\n ;\n\n }", "public function testGetSessionArray()\n {\n $expected = array('my_test_session' => 'session value', \n 'my_other_session' => 'session stuff');\n $this->assertEquals($expected, $this->_req->getSession());\n }", "protected function initializeSession() {}", "function loadSession() {}", "function setMockSession() {\n if (!class_exists('\\RightNow\\Libraries\\MockSession')) {\n Mock::generate('\\RightNow\\Libraries\\Session');\n }\n $session = new \\RightNow\\Libraries\\MockSession;\n $this->realSession = $this->CI->session;\n $this->CI->session = $session;\n $session->setSessionData(array('sessionID' => 'garbage'));\n }", "protected function _session() {\n\t\treturn $this->_crud()->Session;\n\t}", "function checkSession()\n {\n if(isset($_COOKIE['sessionId']))\n {\n $response = callApi('GET', 'session', ['sessionid' => $_COOKIE['sessionId']]);\n if($response['code'] == '200')\n return true;\n else\n return false;\n }\n }", "public function get_test_php_sessions()\n {\n }", "public function testNotLoggedIn()\n {\n $this->sessionInfo['logged_in'] = false;\n $this->sessionInfo['token'] = 'foo';\n\n $this->session($this->sessionInfo);\n\n $response = $this->call('GET', '/api/user');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $decoded = json_decode($response->getContent());\n\n $this->assertEquals('error', $decoded->status);\n }", "public function setUp()\n {\n parent::setUp();\n // Avoid \"Session store not set on request.\" - Exception!\n Session::setDefaultDriver('array');\n $this->manager = app('session');\n\n $user = new User;\n $user->id = 77;\n \t$user->fullname = \"Jack Robinson\";\n \t$user->phone = \"+2348022007561\";\n \t$user->email = \"[email protected]\";\n\n \t$request = new Request();\n $request->setSession($this->manager->driver());\n $request->session()->set('patient', $this->user);\n\n $session = $request->session()->get('patient');\n\n }", "public function testRunningInSafeMode()\n\t{\n\t\t$_GET['safe_mode'] = '1';\n\n\t\t$this->restartApplication();\n\n\t\t$this->call('orchestra::credential@login', array(), 'GET');\n\t\t$this->assertEquals('Y', \\Session::get('safe_mode'));\n\n\t\t$_GET['safe_mode'] = '0';\n\n\t\t$this->restartApplication();\n\n\t\t$this->call('orchestra::credential@login', array(), 'GET');\n\t\t$this->assertNull(\\Session::get('safe_mode'));\n\t}", "protected static function isFrontendSession() {}", "function sessionSet(){\r\n\t\tif(isset($_SESSION[\"$this->session_name\"])) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function setUpSession() \n {\n exec('mysqldump -u '.env('DB_USERNAME').' test | mysql -u '.env('DB_USERNAME').' test_testing');\n\n $this->amOnPage('/');\n $this->setCookie('selenium_request', 'true');\n }" ]
[ "0.75726557", "0.7043142", "0.6947678", "0.6880947", "0.68456274", "0.6824789", "0.65769595", "0.6544459", "0.6535287", "0.6527015", "0.6481161", "0.6432103", "0.63958305", "0.63890475", "0.6377414", "0.6365313", "0.63555497", "0.6343835", "0.6342051", "0.63329786", "0.62902445", "0.6287952", "0.6278471", "0.62624675", "0.62589425", "0.625803", "0.6237665", "0.62367517", "0.62359333", "0.6218602" ]
0.7436899
1
Tests getting the port
public function testGetPort() { static::$_server = array( 'SERVER_PORT' => '80' ); $request = $this->createRequest(); $this->assertEquals(80, $request->getPort()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_getport_is_returning_the_correct_value(): void\n {\n $expected = 896;\n $actual = $this->secureRequest->getPort();\n $this->assertEquals($expected, $actual);\n }", "public function getPort() {}", "final public function getPort(): int {}", "protected function getConfiguredPort() {}", "public function getPort(): int\n {\n }", "public function getPort();", "public function getPort();", "public function getPort();", "public function getPort();", "public function getPort(): int;", "public function getPort():? int;", "protected function getConfiguredOrDefaultPort() {}", "public function port() : ?int;", "public function testWithPort()\n {\n $uri = $this->getUriForTest();\n $uriPort = $uri->withPort(4040);\n\n $this->assertEquals(null, $uri->getPort());\n $this->assertEquals(4040, $uriPort->getPort());\n }", "public function testStringPort()\n {\n $this->client->configure(array(\n 'port' => 'not-integer'\n ));\n }", "static public function getPort() {\n\t\treturn self::port;\n\t}", "public function testStringPort()\n {\n $this->client->configure([\n 'port' => 'not-integer',\n ]);\n }", "public function port($port);", "public function port()\n {\n }", "public function testPort0()\n {\n $this->client->configure(array(\n 'port' => 0\n ));\n\n $this->assertEquals($this->client->getPort(), 0);\n }", "public function testWithPortInvalid()\n {\n $uri = $this->getUriForTest();\n $uri->withPort(-1);\n }", "function is_port($port) {\n\tif (!is_numericint($port))\n\treturn false;\n\n\tif (($port < 1) || ($port > 65535))\n\treturn false;\n\telse\n\treturn true;\n}", "public function hasPort(){\n return $this->_has(12);\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }" ]
[ "0.7995592", "0.7878456", "0.76549435", "0.75793535", "0.7575332", "0.7500126", "0.7500126", "0.7500126", "0.7500126", "0.74999326", "0.74018097", "0.73659337", "0.7318871", "0.72774947", "0.72529423", "0.7196392", "0.7187571", "0.710005", "0.7051977", "0.7046147", "0.6994843", "0.6898399", "0.6887895", "0.68851066", "0.68851066", "0.68851066", "0.68851066", "0.68851066", "0.68851066", "0.68851066" ]
0.8006574
0
Tests that the body of the request is retrieved correctly
public function testGetBody() { $request = $this->createRequest(); static::setInput('hello world'); $this->assertEquals('hello world', $request->getBody()); $this->assertEquals('hello world', $request->body); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetRequest()\n {\n $response= $this->apiObject->getRequest();\n $request=$response->getBody()->getContents();\n $this->assertMatchesJsonSnapshot($request);\n echo('\n El request recibido:\n '.$request);\n }", "abstract public function getRequestBody();", "public static function getRequestBody() {}", "public function testGetBody()\n {\n $xml = '<people type=\"array\"><person><id>1</id></person></people>';\n $req = new Mad_Controller_Request_Mock();\n $req->setBody($xml);\n\n $this->assertEquals($xml, $req->getBody());\n }", "private function testResponseBody($body)\n {\n\n if ( empty($body) ) {\n\n throw (new LarastackPaystackException());\n }\n\n $bodyArray = json_decode($body, true);\n\n if ( empty($bodyArray['status']) || !$bodyArray['status'] || empty($bodyArray['data'])) {\n\n throw (new LarastackPaystackException());\n }\n\n return $bodyArray['data'];\n }", "public function getBody()\n {\n $body = json_decode($this->body, true);\n\n dd($body);\n }", "protected function getBody()\n {\n $body = file_get_contents('php://input');\n json_decode($body);\n if(json_last_error() == JSON_ERROR_NONE){\n return json_decode($body);\n }else{\n return false;\n }\n }", "public function getParsedBody() {}", "public function testInputDataHttpServer(): void\n {\n $this->post('/request_action/input_test', '{\"hello\":\"world\"}');\n if ($this->_response->getBody()->isSeekable()) {\n $this->_response->getBody()->rewind();\n }\n $this->assertSame('world', $this->_response->getBody()->getContents());\n $this->assertHeader('X-Middleware', 'true');\n }", "#[Pure]\nfunction http_get_request_body() {}", "public function testGetRawBody0()\n{\n\n $actual = $this->sqsJob->getRawBody();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testSimpleExtractionFromRequest()\n {\n $queryData = ['a' => 1, 'b' => 2];\n $requestData = ['a' => 2, 'b' => 4, 'c' => 8];\n $contentData = ['b' => 3, 'c' => 6, 'd' => 9];\n $request = $this->createRequest($queryData, $requestData, $contentData);\n\n $this->assertEquals($requestData, $this->extractParameters($request, null, 'request'));\n }", "public function getParsedBody();", "public function getBody() : string\n {\n if ($this->requestMethod !== \"POST\" && $this->requestMethod !== \"PUT\" && $this->requestMethod !== \"DELETE\")\n throw new \\InvalidArgumentException(\"Body is only availabe on POST/PUT requests.\");\n return file_get_contents(\"php://input\");\n }", "public function testRequestIsPassedCorrectly()\n {\n $this->assertPropertySame('request', $this->request);\n }", "public function testValidRequest()\n {\n $this->client->{$this->method}(\n $this->endpoint,\n $this->getValidData(),\n $this->requestHeaders\n );\n $this->assertResponseCode(200, 299);\n }", "public static function getRequestBodyStream() {}", "function http_get_body(){\n\n // read content from body\n $content = file_get_contents('php://input');\n\n // check content encoding\n switch(http_get_content_encoding()){\n\n // json content encoding\n case \"json\": {\n\n // return content as json\n return json_decode($content);\n }\n\n // xml content encoding\n case \"xml\": {\n\n // return content as xml\n return new SimpleXMLElement($content);\n }\n }\n}", "public function test_happy_flow_get()\n {\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $_GET['sp-entity-id'] = 'http://mock-sp';\n\n $request = new Request($_GET, $_POST, [], [], [], $_SERVER);\n\n $this->assertTrue($this->validator->isValid($request));\n }", "public function testProperties(): void\n {\n $body = new RequestBodyObject();\n\n $url = new UrlObject();\n $formParameter = new FormParameterObject();\n $file = new FileObject();\n\n $body->setDisabled(false);\n $body->setMode('file');\n $body->setRaw('test-raw');\n $body->setUrl($url);\n $body->setFormParameter($formParameter);\n $body->setFile($file);\n\n $this->assertProperties($body, [\n 'isDisabled' => false,\n 'getMode' => 'file',\n 'getRaw' => 'test-raw',\n 'getUrl' => $url,\n 'getFormParameter' => $formParameter,\n 'getFile' => $file\n ]);\n }", "public function testResponseGet()\n {\n $result = json_decode($this->body, true);\n\n $this->assertEquals($this->response->get('Model'), $result['Model']);\n $this->assertEquals($this->response->get('RequestId'), $result['RequestId']);\n $this->assertEquals($this->response->get('Inexistence'), null);\n $this->assertEquals($this->response->get('Inexistence', 'Inexistence'), 'Inexistence');\n }", "static function body()\n\t{\n\t\treturn file_get_contents('php://input');\n\t}", "public function getRawBody();", "public function testToArray(): void\n {\n $file = new FileObject();\n $url = new UrlObject();\n $formParameter = new FormParameterObject();\n\n $body = new RequestBodyObject([\n 'disabled' => false,\n 'file' => $file,\n 'form_parameter' => $formParameter,\n 'mode' => 'file',\n 'raw' => 'test-raw',\n 'url' => $url\n ]);\n\n self::assertEquals([\n 'disabled' => false,\n 'file' => $file,\n 'formdata' => $formParameter,\n 'mode' => 'file',\n 'raw' => 'test-raw',\n 'urlencoded' => $url\n ], $body->toArray());\n }", "public function getBody() {}", "public function getBody(): string;", "public function getBody(): string;", "protected function getRequestBody()\n\t{\n\t\treturn $this->request->getContent();\n\t}", "public function getBodyObject()\r\n {\r\n }", "public function getBodyContents()\n {\n return ($this->payload != null) \n ? $this->payload : URLUtils::formURLEncodeMap($this->bodyParams); \n }" ]
[ "0.72822946", "0.71747833", "0.7147613", "0.7130142", "0.6728743", "0.6632701", "0.66032916", "0.65649486", "0.65515965", "0.649139", "0.6465092", "0.6458552", "0.6427771", "0.6362577", "0.6361816", "0.63154215", "0.6249263", "0.62427676", "0.62036306", "0.6162646", "0.6147145", "0.61433464", "0.61410934", "0.6107866", "0.61008", "0.61001426", "0.61001426", "0.60933304", "0.60762316", "0.60009384" ]
0.84744406
0
Data provider for request uri
public function requestUriProvider() { return array( array(array( // apache and lighttpd 'server' => array( 'REQUEST_URI' => '/module/controller/action', ), )), array(array( // iis 'server' => array( 'HTTP_X_REWRITE_URL' => '/module/controller/action', ), )), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requestUri() {}", "public function uri();", "public function uri();", "public function uri();", "abstract public function defaultReturnUrlDataProvider();", "protected function get_uri()\n {\n }", "public function getRequestUri() {}", "abstract public function getUri();", "abstract protected function getUri(): string;", "private function getUri(){\n return $this->uri = parse_url($_SERVER['REQUEST_URI']);\n }", "public function get_uri()\n {\n }", "public function uri($uri);", "public function getRequestData();", "public function get($uri);", "public function getViewData( $data, $uri=null ) {\n\t\treturn $data;\n\t}", "public function getUri() {}", "public function getUri() {}", "public function uriFor(string $name, array $data = [], array $queryData = []):string;", "public function provider_url()\n\t{\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'foo/bar',\n\t\t\t\tarray(),\n\t\t\t\t'http',\n\t\t\t\tTRUE,\n\t\t\t\t'http://localhost/kohana/foo/bar'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'foo',\n\t\t\t\tarray('action' => 'bar'),\n\t\t\t\t'http',\n\t\t\t\tTRUE,\n\t\t\t\t'http://localhost/kohana/foo/bar'\n\t\t\t),\n\t\t);\n\t}", "public function getQueryDataProvider() {}", "abstract protected function uri($uri);", "public function getUri()\n {\n }", "public function getUri()\n {\n }", "abstract protected function buildSpecificRequestUri();", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "abstract protected function getDataProvider();", "private function __construct() {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n $this->data = $_GET;\n } else {\n if (isset($_SERVER['HTTP_CONTENT_TYPE'])) {\n $contentType = $_SERVER['HTTP_CONTENT_TYPE'];\n if (strpos($contentType, ';') !== false) {\n $split = explode(';', $contentType);\n $contentType = trim($split[0]);\n $enc = trim($split[1]);\n }\n if ($contentType == 'application/x-www-form-urlencoded') {\n $this->data = $_POST;\n } else if ($contentType == 'application/json') {\n $json = file_get_contents('php://input');\n $this->data = json_decode($json, true);\n }\n }\n }\n if (strpos($_SERVER['REQUEST_URI'], '/api/') === 0) {\n $this->route = explode('/', $_SERVER['REQUEST_URI']);\n }\n }" ]
[ "0.6164993", "0.58355623", "0.58355623", "0.58355623", "0.5817619", "0.57942075", "0.5786084", "0.5744322", "0.56760424", "0.5617566", "0.5568506", "0.5568264", "0.5548408", "0.55432004", "0.5542756", "0.5539684", "0.5539684", "0.55318815", "0.5513079", "0.5492381", "0.5475437", "0.54678845", "0.54678845", "0.5464788", "0.54403317", "0.54403317", "0.54403317", "0.54403317", "0.54394907", "0.54394794" ]
0.59148395
1
Data provider for headers
public function headerProvider() { return array( array('User-Agent', 'test'), array('X-Custom', 'value'), array('Accept', 'text/plain'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHeaderData() {}", "public function getHeaders()\n {\n }", "public function getHeaders()\n {\n }", "public abstract function getHeaders();", "public function getHeaders() {}", "public function get_headers()\n {\n }", "public function get_headers()\n {\n }", "public function get_headers()\n {\n }", "abstract public function getHeaders();", "public function setHeaders()\n {\n }", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "public function getHeaders();", "protected function makeHeader()\n {\n }", "abstract public function SetHeaders();", "public function getHeaders ();", "abstract public function header($name, $value);", "public function getAdditionalHeaderData() {}", "protected function _initHeaders()\n {\n $headers = new DataHolder();\n\n foreach ($_SERVER as $key => $value)\n {\n if (strpos($key, 'HTTP_') === 0)\n {\n $headers->set(substr($key, 5), $value);\n }\n elseif (in_array($key, array('CONTENT_LENGTH', 'CONTENT_TYPE')))\n {\n $headers->set($key, $value);\n }\n }\n\n $this->set('_headers', $headers);\n }", "public function setHeader($key,$val){ return $this->headers->set($key,$val); }", "public function getHeader($headerName);", "public function getCustomHeaders()\n {\n }", "public function withHeader($name, $value)\n {\n }" ]
[ "0.68964887", "0.6823706", "0.6823706", "0.6798505", "0.6778691", "0.676379", "0.67631537", "0.67631537", "0.6751685", "0.67475873", "0.66890407", "0.66890407", "0.66890407", "0.66890407", "0.66890407", "0.66890407", "0.66890407", "0.66890407", "0.66890407", "0.66890407", "0.6684859", "0.66842264", "0.6675723", "0.66407514", "0.6567569", "0.6559434", "0.65366507", "0.6512292", "0.65003765", "0.64462423" ]
0.74517184
0
Index page for Admin Teams
public function index() { return view('admin::management.admin_teams_manager.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function index()\n\t{\n\t\t$teams = $this->teams->retrieve_with_field();\n\n\t\t$data = array(\n\t\t\t'title' => 'Teams',\n\t\t\t'teams' => $teams,\n\t\t\t'js' => array(''),\n\t\t\t'css' => array('/styles/admin.css'),\n\t\t\t'sidenav' => self::$user_links\n\t\t);\n\n\t\t$this->load->view('admin/show_all_teams.php', $data);\n\t}", "public function index()\n {\n $teams=Teams::where('id', '!=', 1)->where('delete', '!=', 1)->get();\n return view(\"admin.teams.index\", compact('teams'));\n }", "public function index()\n {\n $page_title = \"Manage Team\";\n $team = Team::all();\n return view('admin.team.index', compact('page_title', 'team'));\n }", "public function index()\n {\n $teams = Teams::get();\n $teams = $this->subSqlStr($teams);\n return view('admin.team',compact('teams'));\n }", "public function index()\n {\n Gate::authorize('teams');\n\n $teams = Team::paginate();\n return view('admin.teams.index',[\n 'teams' => $teams,\n ]);\n }", "public function index()\n {\n $team = Team::all();\n return view('admin.team.index')->with('team',$team);\n }", "public function index()\n {\n //\n\n return view('admin.team.index')->withEntries(Team::orderByDesc('id')->get());\n }", "public function index()\n {\n //\n\n $teams = Team::all();\n\n return view('admin.teams.index', compact('teams'));\n }", "public function index()\n {\n $teams = Team::all();\n return view('admin.team.index',compact('teams'));\n }", "public function index()\n {\n return view('teams.index', ['teams' => HelpdeskTeam::all()]);\n }", "public function index()\n {\n $teams = Team::all();\n $choice = Choice::first();\n return view(\"pages.admin.home.team.index\", compact(\"teams\", \"choice\"));\n }", "public function index()\n {\n $teams = Team::paginate(6);\n return view('admin.about.team.index',compact('teams'));\n }", "public function index()\n {\n return view('backend.team.index');\n }", "public function index()\n {\n return view('backend.team.index');\n }", "public function indexAction(){\n $user = $this->getUser();\n\n if($user->getRole()->getRole() === 'ROLE_EMPLOYEE'){\n $teams = $user->getTeams();\n }else if($user->getRole()->getRole() === 'ROLE_MANAGER'){\n $teams = $user->getManagedTeams();\n }else if($user->getRole()->getRole() === 'ROLE_ADMIN'){\n $em = $this->getDoctrine()->getManager();\n $teams = $em->getRepository('UserBundle:Team')->findAll();\n }else{\n $teams = null;\n }\n\n return $this->render('UserBundle:Team:table.html.twig', [\n 'teams' => $teams,\n ]);\n }", "public function actionTeams()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('teams');\n\t}", "public function index()\n\t{\n\t\techo '<h3>Exams :</h3>';\n\t\techo '<a href=\"' . site_url(\"admin/createExam\") . '\" > Create Exam </a> - ';\n\t\techo '<a href=\"' . site_url(\"admin/deleteExam\") . '\" > Delete Exam </a> - ';\n\t\techo '<a href=\"' . site_url(\"admin/renameExam\") . '\" > Rename Exam </a>';\n\t\t\n\t\techo '<h3>Users :</h3>';\n\t\techo '<a href=\"' . site_url(\"admin/createUser\") . '\" > Create User </a> - ';\n\t\techo '<a href=\"' . site_url(\"admin/suspendUser\") . '\" > Suspend User </a> - ';\n\t\techo '<a href=\"' . site_url(\"admin/activateUser\") . '\" > Activate User </a>';\n\t}", "public function index()\n {\n return view('employees::teams.index');\n }", "public function index()\n {\n $people = People::paginate(15);\n return view('admin.pages.team.index')\n ->with('people', $people);\n }", "public function index()\n {\n $teammembers = $this->teammemberRepository->getTeammembers();\n\n return view('admin.teammember.index', compact('teammembers'));\n }", "public function index()\n {\n \n try {\n\n // fetching team members\n $team_members = TeamMembers::select('id', 'first_name', 'last_name', 'image','designation', 'designation', 'status','created_at')->get();\n \n return view('admin.team.list-team-member')->with('team_members',$team_members->toArray());\n\n } catch (\\Exception $e) {\n print_r($e->getMessage());\n }\n\n }", "public function index()\n {\n $authUser = \\Auth::user();\n $userId = $authUser['id'];\n\n $teamList = BdTeam::with(['bdTeamMembers', 'department']);\n if($userId != 13) {\n $teamList->where(['created_by' => $userId]);\n }\n $teamList = $teamList->orderBy('id', 'desc')->get();\n $teamList = $teamList->all();\n\n return view('bd_team.index', compact('teamList', 'authUser'));\n }", "public function index()\n {\n $db = team::all();\n $count = $db->count();\n return view('admin.pages.about.team.index',compact('db','count'));\n }", "public function index()\n {\n return view('pages.teams.teams');\n }", "public function index()\n {\n $teams = team::all();\n \n\n return view('/teamindex', compact('teams'));\n }", "public function index()\n {\n return view('teams.index');\n }", "public function index(){\n $nbrPag = 20;\n $teams = Team::orderBy('league_id')->whereHas('players', function($query){\n $query->where('activity', '=', 1);\n })->has('players', '>', 0)->paginate($nbrPag);\n\n if(!Input::get('page')){\n $page = 0;\n } else {\n $page = Input::get('page') * $nbrPag - $nbrPag;\n }\n return view('admin.players.index', compact('teams', 'page'));\n }", "public function index()\n {\n $this->groups = Team::all();\n return view('admin.teams.index', $this->data);\n }", "public function index()\n {\n access([\"can-owner\", \"can-host\", \"can-manager\"]);\n\n $teams = Team::all();\n $operators = Operator::all();\n $cities = City::all();\n\n return view(\"teams.index\", [\n 'teams' => $teams,\n 'operators' => $operators,\n 'cities' => $cities\n ]);\n }", "public function indexAdmin()\n {\n \t$meetings=ceremony::all();\n \treturn view('admin.yigincaq.index',compact('meetings'));\n }" ]
[ "0.7514271", "0.74876475", "0.7446683", "0.7314998", "0.72911364", "0.7218733", "0.7192002", "0.71891284", "0.71735555", "0.71319366", "0.7106088", "0.7044672", "0.7031703", "0.7031703", "0.7021351", "0.6980214", "0.69531024", "0.6950973", "0.69330543", "0.69053555", "0.6882386", "0.68696433", "0.6867598", "0.68659383", "0.6864723", "0.6856985", "0.6849629", "0.683314", "0.68270934", "0.68065304" ]
0.7571364
0
INPUT : $students Array OUTPUT : Return an Array of student names (String)
function getStudentNames($students) { $arr = []; // Part A // YOUR CODE GOES HERE foreach ($students as $student_arr) { if (isset($student_arr["name"])) array_push($arr, $student_arr["name"]); } return $arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_group_student_names( $group_id ) {\n\t$uc_students = get_post_meta( $group_id, 'students', true );\n\n\t$i = 0;\n\t$student_names = '';\n\twhile ( $i < count($uc_students) ) {\n\t\t$student_names .= get_student_name( $uc_students[$i] );\n\t\t$i++;\n\t\tif ( $i < count($uc_students) )\n\t\t\t$student_names .= ', ';\n\t}\n\treturn $student_names;\n}", "public function getStudents(): array\n {\n \n return $this->students;\n }", "public static function getStudents() {\n\t\t$idm = PSU::get('idmobject');\n\n\t\t$search = array(\n\t\t\tarray('pa.attribute' => 'els_student'),\n\t\t\tarray('pa.type_id' => '2')\n\t\t);\n\n\t\t$return = 'i.pid,i.psu_id,i.username,i.first_name,i.last_name,l.start_date,l.end_date';\n\n\t\t$students = $idm->getUsersByAttribute( $search, 'AND', $return );\n\n\t\tarray_walk( $students, array('ELS', 'dates2timestamp') );\n\t\tarray_walk( $students, array('ELS', 'load_psuperson') );\n\t\t\n\t\tusort( $students, array('ELS', 'student_sort') );\n\n\t\treturn $students;\n\t}", "protected /*array<string,mixed>*/ function getStudentName(/*int*/ $studentid)\n\t{\n\t\t$student = $this->getStudent($studentid);\n\t\treturn $student['last_name'].', '.$student['first_name'].' ('.$student['netid'].') (Table '.$student['table'].')';\n\t}", "public function getStudyNameAttribute() : array\n {\n return array_map(fn (Study $study) : string => $study->study(), $this->studies);\n }", "public function get_students_list(){\n return $this->n->get_list_from_db();\n }", "public function students() {\n return $this->_students;\n }", "public function get_student_name($user_id) {\n return Arr::get($this->_students, $user_id);\n }", "public static function getStudents($vueFormat = true)\n {\n $entities = [];\n $entities = Student::active()->select(['first_name', 'last_name', 'id'])->get();\n if (!$vueFormat) {\n $_entities = [];\n foreach ($entities as $key => $value) {\n $_entities[$value->id] = $value->full_name;\n }\n\n return $_entities;\n }\n\n return self::vueDropdown($entities, 'id', 'full_name');\n }", "public static function getNames() {\n $contactArray = X2Model::model('Contacts')->findAll();\n $names = array(0 => 'None');\n foreach ($contactArray as $user) {\n $first = $user->firstName;\n $last = $user->lastName;\n $name = $first . ' ' . $last;\n $names[$user->id] = $name;\n }\n return $names;\n }", "public function getStudentName()\n {\n return $this->workStudent->first_name . \" \" . $this->workStudent->last_name;\n }", "function getStudents() {\n $students = array();\n\n // Add first student into the students array.\n $first = new Student();\n $first->surname = \"Doe\";\n $first->first_name = \"John\";\n $first->add_email('home','[email protected]');\n $first->add_email('work','[email protected]');\n $first->add_grade(65);\n $first->add_grade(75);\n $first->add_grade(55);\n $students['j123'] = $first; \n\n // Add seconde student into the students array.\n $second = new Student();\n $second->surname = \"Einstein\";\n $second->first_name = \"Albert\";\n $second->add_email('home','[email protected]');\n $second->add_email('work1','[email protected]');\n $second->add_email('work2','[email protected]');\n $second->add_grade(95);\n $second->add_grade(80);\n $second->add_grade(50);\n $students['a456'] = $second;\n\n\n // Add my info into the students array.\n $me = new Student();\n $me->surname = \"Tan\";\n $me->first_name = \"Hai Hua\";\n $me->add_email('school', '[email protected]');\n $me->add_grade(90);\n $students['b721'] = $me;\n\n\n // Add random generated students to the array\n $num = mt_rand(1, 10);\n for ($i = 0; $i < $num; ++$i) {\n $student = new Student();\n $student->surname = Helper::rand_name(10);\n $student->first_name = Helper::rand_name(10);\n $student->add_email('school', $student->first_name . '@.my.bcit.ca');\n $student->add_grade(mt_rand(0,100));\n $student->add_grade(mt_rand(0,100));\n $student->add_grade(mt_rand(0,100));\n $students['k' . mt_rand(100,999)] = $student;\n }\n\n return $students;\n }", "function studentNameSearch($sessionID, $name){\r\n\t\t$name = str_replace(' ', '%', $name);\r\n\t\t$results = array();\r\n\t\tfor($i=0; $i<sizeof($name); $i++){\r\n\t\t\t$query = \"SELECT ID, CONCAT(FIRST_NAME, ' ', MIDDLE_NAME, ' ', LAST_NAME) AS FullName FROM X_PNSY_STUDENT WHERE\r\n\t\t\t\t\tCONCAT(FIRST_NAME, ' ', MIDDLE_NAME, ' ', LAST_NAME) LIKE '%$name%'\";\r\n\t\t\t\t$result = mysql_query($query);\r\n\t\t\t\t//Cycles through the rows of $result and puts them into $results in the proper format.\r\n\t\t\t\tfor($j=0; $thisResult = mysql_fetch_assoc($result); $j++){\r\n\t\t\t\t\tif(!array_key_exists($thisResult['ID'], $results)){\r\n\t\t\t\t\t\t$results[$thisResult['ID']] = $thisResult['FullName'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn $results;\r\n\t}", "public function studentList($array=null){\n\t\tglobal $conn;\n\n\t\tif ( isset($array[\"order\"]) && $array[\"order\"] !== \"\" && $array !== null ) {\n\t\t\t$order = $array[\"order\"];\n\t\t}else{\n\t\t\t$order = \"asc\";\n\t\t}\n\n\t\tif ( isset($array[\"sort\"]) && $array[\"sort\"] !== \"\" && $array !== null ) {\n\t\t\t$sort = $array[\"sort\"];\n\t\t}else{\n\t\t\t$sort = \"id_student\";\n\t\t}\n\n\t\t$sql = \"select * from student order by \".$sort.\" \".$order.\" ;\";\n\n\t\t$result = $conn->query($sql);\n\t\t$myData = [];\n\t\tif ($result->num_rows > 0) {\n\t\t // output data of each row\n\t\t while($row = $result->fetch_assoc()) {\n\t\t $myData[] = $row;\n\t\t }\n\t\t}\n\t\treturn $myData;\n\t}", "public function getAllStudent(){\n\n\t\treturn array(\n\t\t\t\"1\"=> new Entity_Student(1,\"pham van thao\",23,\"tlu\"),\n\t\t\t\"2\"=> new Entity_Student(2,\"pham van phen\",24,\"tlu\"),\n\t\t\t\"3\"=> new Entity_Student(3,\"pham van to\",25\"tlu\"),\n\t\t\t\"4\"=> new Entity_Student(4,\"pham van\",26,\"tlu\"),\n\n\t\t);\n\t}", "function get_smsstudents($inputarray = array()) {\n $college_id = isset($inputarray['college_id']) ? $inputarray['college_id'] : '';\n $course_id = isset($inputarray['course_id']) ? $inputarray['course_id'] : '';\n $branch_id = isset($inputarray['branch_id']) ? $inputarray['branch_id'] : '';\n $semister_id = isset($inputarray['semister_id']) ? $inputarray['semister_id'] : '';\n $section_id = isset($inputarray['section_id']) ? $inputarray['section_id'] : '';\n $religion = isset($inputarray['religion']) ? strtolower($inputarray['religion']) : '';\n\n $sql = \" select sr.*, users.users_type_id, users.username, users.`password` , users.email, users.id as users_id ,users.status\n\t\t\t from users\n\t\t\t inner join student_records as sr on sr.user_id=users.id\n\t\t\t inner join student_semisters as ss on ss.user_id=sr.user_id\n\t\t\t where users.users_type_id='1' and users.status='1' and ss.is_current='1' and sr.college_id = '\" . $college_id . \"' \n\t\t\t and sr.course_id = '\" . $course_id . \"' and sr.branch_id = '\" . $branch_id . \"' and ss.semister_id = '\" . $semister_id . \"'\n\t\t\t and sr.section_id='\" . $section_id . \"' \";\n if (!empty($religion)) {\n $sql .= \" and sr.religion='\" . $religion . \"' \";\n }\n\n $sql .= \" ORDER BY username \";\n\n $res = $this->db->query($sql);\n return $res->result();\n }", "public function searchStudent($name){\n // foreach ($this->students as $student) {\n // ($student == $name) ? $result = $name.\" is in the list\":$result = $name.\" Not Found\";\n // }\n\n // check is name foun will retrun found message\n $array = $name.\" Not Found\";\n if(in_array($name, $this-> students)){\n $array = $name.\" is in the list\";\n }\n return $array;\n }", "public function authors_name() {\n $authors = $this -> author;\n $res = [];\n\n foreach($authors as $author) {\n array_push($res, $author->name . ' ' . $author -> surname);\n }\n\n return $res;\n }", "public function get_students_list_select(){\n\t\t$this->verify();\n\t\t$students=$this->admin_model->getStudentlistSELECT2($_GET['search']);\n\t\tforeach ($students as $key => $value) {\n\t\t\t$data[] = array('id' => $value['ADMISSION_NUMBER'], 'text' => $value['NAME']);\t\t\t \t\n \t\t}\n\t\techo json_encode($data);\n\t}", "public function getStudyNameList() {\n return $this->_get(9);\n }", "function getUsersFormatted(){\r\n $data=new \\Cars\\Data\\Common($this->app);\r\n $output = array();\r\n $char = 'A';\r\n while($char >= 'A' && $char <= 'Z' && strlen($char) == 1){\r\n $output[$char] = $data->getUsersByLastNameInit($char);\r\n $char++;\r\n }\r\n\r\n\r\n return $output;\r\n }", "public static function exam_wise_students($exams) {\n $arr = array();\n foreach ($exams as $exam) {\n $users = $exam->course->users->find_all()->as_array('id');\n $arr[$exam->id] = array_keys($users);\n }\n return $arr;\n }", "function get_smsstudents_by_ids($inputarray = array()) {\n $sql = \"select * from student_records where id in(\" . implode(',', $inputarray) . \")\";\n //log_message('error', 'get_smsstudents_by_ids '.$sql);\t\t\n $res = $this->db->query($sql);\n return $res->result();\n }", "public function getNames();", "function get_student_name($class_id)\n\t\t{\n\t\t\t$get_student_list = $this->db->get_where('student' , array('class_id' => $class_id))->result_array();\n\t\t\techo '<option value=\"\">Select student</option>';\n\t\t\tforeach ($get_student_list as $row_value)\n\t\t\t{\n\t\t\t\techo '<option value=\"' . $row_value['name'].' '.$row_value['father_name'].'\">' . $row_value['name'] . '</option>';\n\t\t\t}\n\t\t}", "function fnArrayStudent(){\n $ds = [\n \"S01\"=>\"Nguyen Ngoc Thach\",\n \"S02\"=>\"Quach Gia Lam\",\n \"S03\"=>\"Nguyen Toan Thang\",\n \"S04\"=>\"Dao Cong Duong\",\n \"S05\"=>\"Bui Quoc Tuan\"\n ];\n\n echo \"<h3>Danh sach sinh vien</h3>\";\n echo \"<table class='table table-hover table-stripped'>\";\n echo \"<thead><tr><th>ID</th><th>Student name</th></tr></thead>\";\n echo \"<tbody>\";\n foreach($ds as $ms=>$tenSV){\n echo \"<tr>\";\n echo \"<td>$ms</td><td>$tenSV</td>\";\n echo \"</tr>\";\n }\n echo \"</tbody>\";\n echo \"</table>\";\n }", "public static function getAllNames() {\n\t\t$contactArray = X2Model::model('Contacts')->findAll($condition='visibility=1');\n\t\t$names=array(0=>'None');\n\t\tforeach($contactArray as $user){\n\t\t\t$first = $user->firstName;\n\t\t\t$last = $user->lastName;\n\t\t\t$name = $first . ' ' . $last;\n\t\t\t$names[$user->id]=$name;\n\t\t}\n\t\treturn $names;\n\t}", "function languagelesson_get_students($courseid)\n{\n\tglobal $DB;\n\t\n\t// Pull the context value for input courseid.\n\t$context = context_course::instance($courseid);\n $allusers = get_enrolled_users($context, 'mod/languagelesson:submit', 0, 'u.id, u.firstname, u.lastname, u.email, u.picture');\n \n $getteachers = get_enrolled_users($context, 'mod/languagelesson:manage', 0, 'u.id');\n $getgraders = get_enrolled_users($context, 'mod/languagelesson:grade', 0, 'u.id');\n \n \n $teachers = array();\n \n foreach ($getteachers as $thisteacher) {\n $teachers[] = $thisteacher->id;\n }\n foreach ($getgraders as $thisgrader) {\n $teachers[] = $thisgrader->id;\n }\n sort($teachers);\n \n // Remove all of the teachers those with manage or grade capabilities from the list.\n foreach ($allusers as $oneuser) {\n foreach ($teachers as $teacherid) {\n if ($oneuser->id == $teacherid) {\n unset($allusers[$oneuser->id]);\n }\n }\n } \n\treturn $allusers;\n}", "function getUsernames(){\n $arr = array();\n for($x=0;$x<count($this->names);$x++){\n array_push($arr,$this->names[$x]);\n }\n return $arr;\n }", "public function getStudents($univid) { //$univid is formal Argument\r\n\t\t//2. Build The Query\r\n\t\t\r\n $this->db->select('student_name,stu_enroll_no')->from('students');\r\n \r\n $this->db->where('university_id', $univid);\r\n \r\n\t\t//3. Execute the query\r\n $query = $this->db->get();\r\n\t\t\r\n\t\t//4. Return the result\r\n return $query->result_array(); \r\n }" ]
[ "0.70306975", "0.6579975", "0.63303775", "0.63256615", "0.63032025", "0.6245081", "0.6180414", "0.61148536", "0.59291774", "0.59237725", "0.58872175", "0.5886358", "0.5884633", "0.5880944", "0.58615124", "0.5853843", "0.5846839", "0.5746795", "0.57008266", "0.5672646", "0.5649606", "0.564753", "0.5620598", "0.5589867", "0.5588825", "0.55264133", "0.5521836", "0.5514156", "0.5504847", "0.55015516" ]
0.7735139
0
/ static convenience functions, for easier use as: $var = Settings::read('icode'); $int = Settings::readi('icode'); $date = Settings::readd('icode'); Settings::write('icode', $var);
public static function read($icode){ return fw::model('Settings')->getValue($icode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function define_my_settings();", "function register_setting($key, $value)\n{\n csSettings::set($key, $value);\n}", "function save_settings( $setting, $value ){\n //global $disp_body;\n\n //ensure paths use forward slashes\n if( $setting === 'CIFS_SHARE' || $setting === 'CIFS_MOUNT' ){\n $value = str_replace('\\\\', '/', $value);\n }\n\n //only store the password if it is not empty\n $setting_part = substr( $setting, -9);\n if( $setting_part === '_PASSWORD' && $value == '' ){\n //write old password to $value to keep the old one\n $value = $_SESSION['settings.conf'][$setting];\n }\n\n //escape slashes for 'sed' in pia-settings\n $value = str_replace(array('\\\\','/'), array('\\\\\\\\','\\\\/'), $value);\n\n $k = escapeshellarg($setting);\n $v = escapeshellarg($value);\n exec(\"/usr/local/pia/pia-settings $k $v\");\n //$disp_body .= \"$k is now $v<br>\\n\"; //dev stuff\n\n //clear to force a reload\n unset($_SESSION['settings.conf']);\n }", "private function _settings()\n\t{\n\t\tif(Utils::config('timestamps') or Utils::config('t'))\n\t\t\t$this->_timestamps = \"\\tpublic static \\$timestamps = true;\\n\\n\";\n\t}", "function saveVariables( $aForm, $sFile, $sVariable = 'config' ){\n if( is_file( $sFile ) && strstr( $sFile, '.php' ) ){\n $aFile = file( $sFile );\n $iCount = count( $aFile );\n $rFile = fopen( $sFile, 'w' );\n\n if( isset( $aForm['page_search'] ) && isset( $aForm['start_page'] ) && $aForm['start_page'] == $aForm['page_search'] ){\n $aForm['page_search'] = '';\n }\n\n for( $i = 0; $i < $iCount; $i++ ){\n foreach( $aForm as $sKey => $sValue ){\n if( preg_match( '/'.$sVariable.\"\\['\".$sKey.\"'\\]\".' = /', $aFile[$i] ) && strstr( $aFile[$i], '=' ) ){\n $mEndOfLine = strstr( $aFile[$i], '; //' );\n if( empty( $mEndOfLine ) ){\n $mEndOfLine = ';';\n }\n $sValue = changeSpecialChars( trim( str_replace( '\"', '&quot;', $sValue ) ) );\n if( preg_match( '/^(true|false|null)$/', $sValue ) ){\n $aFile[$i] = \"\\$\".$sVariable.\"['\".$sKey.\"'] = \".$sValue.$mEndOfLine;\n }\n else\n $aFile[$i] = \"\\$\".$sVariable.\"['\".$sKey.\"'] = \\\"\".$sValue.\"\\\"\".$mEndOfLine;\n }\n } // end foreach\n\n fwrite( $rFile, rtrim( $aFile[$i] ).( $iCount == ( $i + 1 ) ? null : \"\\r\\n\" ) );\n\n } // end for\n fclose( $rFile );\n }\n}", "function rst_settings()\n{\n require_once('inc/inc.rst-settings.php');\n}", "function get_settings($in)\n{\n if (is_file($in))\n return include $in;\n return false;\n}", "public function getBasicSettingsValues()\n\t{\n\t\t$values = array();\n\n\t\t$values[\"webspace_dir\"] = getcwd().\"/data\";\n\t\t$values[\"data_dir\"] = $this->setup->ini->readVariable(\"clients\",\"datadir\");\n\t\t$values[\"convert_path\"] = $this->setup->ini->readVariable(\"tools\",\"convert\");\n\t\t$values[\"zip_path\"] = $this->setup->ini->readVariable(\"tools\",\"zip\");\n\t\t$values[\"unzip_path\"] = $this->setup->ini->readVariable(\"tools\",\"unzip\");\n\t\t$values[\"ghostscript_path\"] = $this->setup->ini->readVariable(\"tools\",\"ghostscript\");\n\t\t$values[\"java_path\"] = $this->setup->ini->readVariable(\"tools\",\"java\");\n\t\t$values[\"htmldoc_path\"] = $this->setup->ini->readVariable(\"tools\",\"htmldoc\");\n\t\t//$values[\"mkisofs_path\"] = $this->setup->ini->readVariable(\"tools\",\"mkisofs\");\n\t\t$values[\"ffmpeg_path\"] = $this->setup->ini->readVariable(\"tools\",\"ffmpeg\");\n\t\t$values[\"latex_url\"] = $this->setup->ini->readVariable(\"tools\",\"latex\");\n\t\t$values[\"fop_path\"] = $this->setup->ini->readVariable(\"tools\",\"fop\");\n\t\t$values[\"vscanner_type\"] = $this->setup->ini->readVariable(\"tools\", \"vscantype\");\n\t\t$values[\"scan_command\"] = $this->setup->ini->readVariable(\"tools\", \"scancommand\");\n\t\t$values[\"clean_command\"] = $this->setup->ini->readVariable(\"tools\", \"cleancommand\");\n\t\t$values[\"log_path\"] = $this->setup->ini->readVariable(\"log\",\"path\").\"/\".\n\t\t\t$this->setup->ini->readVariable(\"log\",\"file\");\n\t\t$values[\"chk_log_status\"] = !$this->setup->ini->readVariable(\"log\",\"enabled\");\n\t\t$values[\"time_zone\"] = $this->setup->ini->readVariable(\"server\", \"timezone\");\n\t\t\n\t\t// https settings\n\t\t$values[\"auto_https_detect_enabled\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_enabled\");\n\t\t$values[\"auto_https_detect_header_name\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_header_name\");\n\t\t$values[\"auto_https_detect_header_value\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_header_value\");\n\n\t\t$this->form->setValuesByArray($values);\n\t}", "abstract protected function getSetting() ;", "function write_setting($data) {\n return '';\n }", "function iniwrite() {\n\t global $setini;\n\t\n\t $ini = $this->gtk_path . \"webos.ini\"; \t//echo $ini; \n\t \n if ($fp = fopen ($ini , \"wb\")) {\n\t\t\n\t\t\t\t $tow = serialize($setini) . \"<@>\";\t \n\t\t\t\t\t \n fwrite ($fp, $tow);\n fclose ($fp);\n\t\t\t\t \n\t\t $this->set_console_message(\"Writing ini settings successfully.\");\t\t\t\t \n\t\t\t\t return (true);\n\t }\n\t else {\n\t\t $this->set_console_message(\"Ini setting NOT saved !!!\");\t\t\n\t\t\t\t return (false);\n\t\t}\t\t\n\t}", "abstract public function settings(): array;", "function update_setting($name, $value)\n {\n }", "function wp_is_ini_value_changeable($setting)\n {\n }", "function save_settings() {\n\t\t$this->update_option( static::SETTINGS_KEY, $this->settings );\n\t}", "function saveVariables( $aForm, $sFile, $sVariable = 'config' ){\n if( is_file( $sFile ) && strstr( $sFile, '.php' ) ){\n $aFile = file( $sFile );\n $iCount = count( $aFile );\n $rFile = fopen( $sFile, 'w' );\n\n for( $i = 0; $i < $iCount; $i++ ){\n foreach( $aForm as $sKey => $sValue ){\n if( preg_match( '/'.$sVariable.\"\\['\".$sKey.\"'\\]\".' /', $aFile[$i] ) && strstr( $aFile[$i], '=' ) ){\n $sValue = str_replace( '\\n', '|n|', changeSpecialChars( $sValue ) );\n\n $sValue = stripslashes( $sKey == 'logo' ? str_replace( '\"', '\\'', $sValue ) : str_replace( '\"', '&quot;', $sValue ) );\n if( preg_match( '/^(true|false|null)$/', $sValue ) == true ){\n $aFile[$i] = \"\\$\".$sVariable.\"['\".$sKey.\"'] = \".$sValue.\";\";\n }\n else\n $aFile[$i] = \"\\$\".$sVariable.\"['\".$sKey.\"'] = \\\"\".str_replace( '|n|', '\\n', $sValue ).\"\\\";\";\n }\n } // end foreach\n\n fwrite( $rFile, rtrim( $aFile[$i] ).( $iCount == ( $i + 1 ) ? null : \"\\r\\n\" ) );\n\n } // end for\n fclose( $rFile );\n }\n}", "function Settings_API($load_settings=true)\n\t{\n\t\t$this->ConfigFile = SENDSTUDIO_INCLUDES_DIRECTORY . '/config.php';\n\t\t$this->WhiteLabelCache = IEM_InterspireStash::getInstance();\n\n\t\tif ($load_settings) {\n\t\t\t$db = $this->GetDb();\n\t\t\t$this->LoadSettings();\n\t\t}\n\t}", "function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}", "private function load_settings() {\n\t\t\n\t}", "function settings_rewrite( $SETTINGS, $DB, $PLUGINS, $constants = array( ) ){\n\n require_once HOME . '_inc/function/defaults.php';\n\n $constants = defaults_constants( $constants );\n\n $Plugins = Plugins::getInstance( );\n\n\t/**\n\t * calculate plugin dependencies\n\t */\n\t$plugins = array( );\n\tforeach( $PLUGINS as $p_name => $version ){\n\n\t\t$plugin = $Plugins->plugins( $p_name );\n\t\tif( !$plugin )\n\t\t\trequire HOME . '_plugins/' . $p_name . '/plugin.php';\t\n\n\t\tarray_push(\n\t\t\t$plugins,\n\t\t\tarray(\n\t\t\t\t'sys_name' => $p_name,\n\t\t\t\t'name' => $plugin[ 'name' ],\n\t\t\t\t'version' => $plugin[ 'version' ],\n\t\t\t\t'dependencies' => @$plugin[ 'dependencies' ]\n\t\t\t)\n\t\t);\n\t}\n $PLUGINS = resolve_dependencies( $plugins, $PLUGINS );\n\n\t/**\n * plugins - filter the settings, constants and plugins arrays \n */\n list( $SETTINGS, $constants, $PLUGINS ) = $Plugins->filter( 'general', 'filter_settings', array( $SETTINGS, $constants, $PLUGINS ) );\n\n $filecontents = defaults_settings_content( $SETTINGS, $DB, $PLUGINS, $constants );\n\n\t/**\n\t * write file or throw error\n\t */\n\tfile_put_contents( HOME . '.settings.php', $filecontents )\n\t\tor error(\n\t\t\t'You must grant <i>0777</i> write access to the <i>' . HOME . \n\t\t\t'</i> directory for <a href=\"http://furasta.org\">Furasta.Org</a> to function correctly.' .\n\t\t\t'Please do so then reload this page to save the settings.'\n\t\t\t,'Runtime Error'\n\t\t);\n\n\treturn htaccess_rewrite( );\n\n}", "abstract protected function loadSettings();", "function get_setting($name)\n {\n }", "public function saveSettings(){\n\n $vars = $this->getAllSubmittedVariablesByName();\n\n $vars['email'] = $this->email;\n $vars['firstname'] = $this->firstname;\n $vars['lastname'] = $this->lastname;\n $vars['real_name'] = $this->firstname .' ' .$this->lastname;\n $vars['phone'] = $this->phone;\n\n $vars['name'] = $this->firstname;\n $vars['surname'] = $this->lastname;\n $vars['screen_name'] = $this->firstname;\n\n\n $vars['about_my_artwork'] = $this->getSubmittedVariableByName('about_my_artwork');\n $vars['what_i_like_to_do'] = $this->getSubmittedVariableByName('what_i_like_to_do');\n $vars['experience'] = $this->getSubmittedVariableByName('experience');\n $vars['instructions'] = $this->getSubmittedVariableByName('instructions');\n $vars['aftercare'] = $this->getSubmittedVariableByName('aftercare');\n $vars['apprenticeship'] = $this->getSubmittedVariableByName('apprenticeship');\n\n $this->saveNamedVariables($vars);\n }", "abstract public function get_settings();", "function ini_safe_set($key, $value)\n{\n // some hosts disable ini_set for security \n // lets check so see if its disabled\n if(($disable_functions = ini_get('disable_functions')) !== false) {\n // if it is disabled then return as there is nothing we can do\n if(strpos($disable_functions, 'ini_set') !== false) {\n return false;\n }\n }\n\n // set it and return true if the result is not equal to false\n return (ini_set($key, $value) != false);\n}", "public function save_var_settings($settings) {\n\t\treturn $this->save_settings($settings);\n\t}", "function ini_set(string $option, string $value): string\n{\n error_clear_last();\n $safeResult = \\ini_set($option, $value);\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n return $safeResult;\n}", "function get_settings($option)\n {\n }", "abstract public function getSettings();", "function setVar($varname,$value)\n {\n $temp_path = 'tmp/'; // for Unix server\n $strvalue = serialize($value);\n // generate a storeable representation of\n // the value, with it's type and structure\n $file_pointer = fopen($temp_path . $varname, 'w');\n if(!(fwrite($file_pointer,$strvalue)))\n {\n return false; //success\n }\n else\n {\n return true; //not able to write file\n }\n }" ]
[ "0.5931988", "0.5711913", "0.5665766", "0.55426794", "0.5498261", "0.5474244", "0.54460394", "0.54395825", "0.5398371", "0.53870445", "0.53859854", "0.5326814", "0.53218484", "0.5319932", "0.53043395", "0.52959144", "0.52428955", "0.52346885", "0.52236426", "0.5218476", "0.5179876", "0.51751995", "0.5165533", "0.51625925", "0.5156011", "0.5117604", "0.51139265", "0.51124597", "0.50919795", "0.50641" ]
0.57606953
1
Get the dynamic contact_person_title attribute
public function getContactPersonTitleAttribute() { return $this->contactPerson ? $this->contactPerson->role : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_title() {\n\t\treturn $this->get_mapped_property('title');\n }", "function title( $contentObjectAttribute, $name = null )\n {\n $content = $contentObjectAttribute->content();\n return $content['value'];\n }", "public function title() { \n $title = $this->content()->get('title');\n if($title != '') {\n return $title;\n } else {\n $title->value = $this->uid();\n return $title;\n }\n }", "function title( $contentObjectAttribute, $name = null )\n {\n $content = $contentObjectAttribute->content();\n $result = \"\";\n if ( $content instanceof xrowGISPosition )\n {\n $attributeArray = array( \n 'country' , \n 'state' , \n 'zip' , \n 'district' , \n 'city' , \n 'street' , \n 'latitude' , \n 'longitude' \n );\n foreach ( $attributeArray as $key )\n {\n $result .= \" \" . $content->$key;\n }\n }\n return trim( $result );\n }", "private function generate_title()\r\n\t\t{\r\n\t\t\treturn $this->c_title;\r\n\t\t}", "function getPersonFirstName()\n {\n return $this->getValueByFieldName('person_fname');\n }", "public function getTitle()\n {\n if ($this->isPermit()) {\n $addresses = $this->getField('objectaddresses');\n if ($addresses != false) {\n $location = $addresses[0]['zipcode'];\n $location .= ' ' . $addresses[0]['addressnumber'];\n $location .= $addresses[0]['addressnumberadditional'];\n $location .= ' ' . $addresses[0]['city'];\n $result = sprintf(\n '%s %s %s',\n $this->getField('producttype'),\n $this->getField('productactivities'),\n $location\n );\n } else {\n $result = sprintf(\n '%s %s',\n $this->getField('producttype'),\n $this->getField('productactivities')\n );\n }\n } else {\n $result = $this->getField('title');\n }\n return $result;\n }", "public function getDisplayField()\n {\n foreach(['title', 'name'] as $attribute) {\n if ($this->hasAttribute($attribute)) {\n return $this->getAttribute($attribute);\n }\n }\n\n $pk = $this->getPrimaryKey();\n if (is_array($pk))\n {\n $pk = print_r($pk, true);\n }\n\n\n return \"No title for \" . get_class($this) . \"($pk)\";\n }", "public function getTitle()\n {\n return $this->data['fields']['title'];\n }", "public function title () {\n return ($this->first_name or $this->last_name) ? $this->first_name . ' ' . $this->last_name : $this->email;\n }", "public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}", "public function get_title()\n {\n return $this->get_default_property(self::PROPERTY_TITLE);\n }", "function fetch_faculty_title($title, $id) {\n if(get_post_type($id) == 'faculty') {\n $name = get_field('name', $id);\n $name = $name[0];\n $title = $name['last'].', '.$name['first'];\n }\n return $title;\n}", "function title( &$contentObjectAttribute )\n {\n $object = $this->objectAttributeContent( $contentObjectAttribute );\n if ( is_object ($object) )\n {\n return $object->attribute( 'name' );\n }\n return false;\n }", "public function getTitle()\n {\n if (!isset($this->data['fields']['title'])) {\n if ($this->isNew()) {\n $this->data['fields']['title'] = null;\n } elseif (!isset($this->data['fields']) || !array_key_exists('title', $this->data['fields'])) {\n $this->addFieldCache('title');\n $data = $this->getRepository()->getCollection()->findOne(array('_id' => $this->getId()), array('title' => 1));\n if (isset($data['title'])) {\n $this->data['fields']['title'] = (string) $data['title'];\n } else {\n $this->data['fields']['title'] = null;\n }\n }\n }\n\n return $this->data['fields']['title'];\n }", "public function metaTitle()\n\t{\n\t\treturn ($this->title == '') ? $this->name : $this->title;\n\t}", "public function getTitle()\n {\n if (array_key_exists(\"title\", $this->_propDict)) {\n return $this->_propDict[\"title\"];\n } else {\n return null;\n }\n }", "public function getTitle()\n {\n if (array_key_exists(\"title\", $this->_propDict)) {\n return $this->_propDict[\"title\"];\n } else {\n return null;\n }\n }", "public function title()\n {\n return $this->{static::$title};\n }", "public function getTitle(): string\n {\n return$this->attrs['title'] ?? '';\n }", "public function get_title();", "public function getDisplayNameAttribute()\n {\n return str_limit($this->attributes['title']);\n }", "public function getMetaTitle();", "public function getTitle() {\r\n\tif (!is_null($this->title))\r\n\t return $this->title;\r\n\telse\r\n\t return $this->name;\r\n }", "public abstract function getTitleFieldName();", "public function getTitle()\n {\n return $this->getData('title');\n }", "function get_contact_name( $cid ){\n if(empty($cid)){\n return \"Null\";\n }\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'id' => $cid\n );\n $aContact = civicrm_api('Contact', 'get', $params);\n if( $aContact['is_error'] != 1 && $aContact['count']!= 0 ){\n \n /* $name = sprintf( \"<a href='civicrm/contact/view?reset=1&cid=%d'>%s</a>\"\n , $cid\n , $aContact['values'][0]['display_name']\n );\n \n */\n $name = $aContact['values'][0]['display_name'];\n }\n return $name; \n }", "public function getName()\r\n\t{\r\n\t\tif ($this->def->getField(\"name\"))\r\n\t\t\treturn $this->getValue(\"name\");\r\n\t\tif ($this->def->getField(\"title\"))\r\n\t\t\treturn $this->getValue(\"title\");\r\n\t\tif ($this->def->getField(\"subject\"))\r\n\t\t\treturn $this->getValue(\"subject\");\r\n\t\tif ($this->def->getField(\"full_name\"))\r\n\t\t\treturn $this->getValue(\"full_name\");\r\n\t\tif ($this->def->getField(\"first_name\"))\r\n\t\t\treturn $this->getValue(\"first_name\");\r\n\r\n\t\treturn $this->getId();\r\n\t}", "public function getContactName()\n {\n return $this->contactName;\n }", "public function getTitleField()\n {\n return !$this->title ?: $this->title->getName();\n }" ]
[ "0.6601463", "0.6491276", "0.64342755", "0.63133115", "0.6276941", "0.627448", "0.6271542", "0.62488955", "0.6227408", "0.619967", "0.61827224", "0.61270964", "0.6102998", "0.6096244", "0.60848504", "0.60625774", "0.6048876", "0.6048876", "0.6031329", "0.6016919", "0.6007098", "0.59893954", "0.59740025", "0.5971937", "0.59718823", "0.5956756", "0.595001", "0.59332615", "0.5912891", "0.59071076" ]
0.703518
0
Accessor for open_date attribute
public function getOpenDateAttribute($date) { return $date ? Carbon::parse($date) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOpenDate() {\n\t\treturn $this->data_array['open_date'];\n\t}", "public function setOpenDateAttribute($date)\n {\n $this->attributes['open_date'] = $date ? Carbon::parse($date) : null;\n }", "public function getOpendate()\n {\n return $this->_opendate;\n }", "public function getDate() {\n return @$this->attributes['date'];\n }", "public function getDate() { return $this->date; }", "public function getOpenBetaDate();", "function getDate() {\n return $this->date;\n }", "public function getDate()\r\n {\r\n return $this->date;\r\n }", "public function getIssueDate()\n {\n return $this->issueDate;\n }", "public function getDate()\n {\n return $this->date;\n }", "function getDate( )\r\n\t{\r\n\t\treturn $this->date;\r\n\t}", "public function getDate()\n {\n return $this->_date;\n }", "public function getDate(){\n\t\treturn $this->_date;\n\t}", "public function getDate()\n {\n if (!isset($this->_date)) {\n throw new \\LogicException('Missing property _date');\n }\n return $this->_date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }" ]
[ "0.80150354", "0.73169804", "0.696345", "0.68872076", "0.6631332", "0.6610958", "0.64985543", "0.63983303", "0.6390778", "0.63734436", "0.63685805", "0.6362527", "0.63585854", "0.634004", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073", "0.6310073" ]
0.7663086
1
Mutator for open_date attribute
public function setOpenDateAttribute($date) { $this->attributes['open_date'] = $date ? Carbon::parse($date) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOpenDate() {\n\t\treturn $this->data_array['open_date'];\n\t}", "public function getOpenDateAttribute($date)\n {\n return $date ? Carbon::parse($date) : null;\n }", "public function setModDate($date) {}", "public function setDate($date);", "public function setOpen($open) {}", "public function setOpen($open) {}", "public function getOpendate()\n {\n return $this->_opendate;\n }", "private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}", "public function setDate($value) {\n\t\t$this->_date = $value;\n\t}", "public function setOpenBetaDate(\\DateTime $openBetaDate);", "public function setPublishedAtAttribute($date){ //guarda el campo published_at como si fuera una instancia de Carbon para que se guarde con hora\n \t$this->attributes['published_at']=Carbon::parse($date); \n }", "private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}", "public function setDateAttribute($date)\n {\n \t$this->attributes['date'] = Carbon::parse($date);\n }", "public function updateDate( Inx_Api_Recipient_Attribute $attr, $sValue );", "public function setDateAttribute($value)\n {\n $this->attributes['date'] = Carbon::parse($value)->format('Y-m-d');\n }", "public function set_approved_date( $date ) {\n\t\t$this->set_prop( 'approved_date', $date ) ;\n\t}", "public function setDate($date)\n {\n $this->date = $date;\n \n return $this;\n }", "public function setDate($date){\n\t\t$this->date = $date;\n\t}", "public function getOpenBetaDate();", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "private function updatePublishOnDate()\n {\n $this->owner->PublishOnDate = $this->owner->DesiredPublishDate;\n // Remove the DesiredPublishDate.\n $this->owner->DesiredPublishDate = null;\n }", "public function getDate() { return $this->date; }", "protected function _syncModDate() {}", "public function setOpendate($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->_opendate !== $v) {\n $this->_opendate = $v;\n $this->modifiedColumns[IssuesTableMap::COL__OPENDATE] = true;\n }\n\n return $this;\n }", "public function setOpenNow($value)\n {\n return $this->set('OpenNow', $value);\n }", "public function setOpenNow($value)\n {\n return $this->set('OpenNow', $value);\n }", "public function setOpenNow($value)\n {\n return $this->set('OpenNow', $value);\n }", "public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }", "public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }" ]
[ "0.681569", "0.6785898", "0.6510898", "0.646738", "0.64538765", "0.64537984", "0.6318102", "0.6214314", "0.6205586", "0.618598", "0.61786693", "0.6113981", "0.6052205", "0.6009255", "0.6003837", "0.59999603", "0.59823465", "0.59552974", "0.5945108", "0.5889146", "0.5889146", "0.58888155", "0.58812624", "0.5874716", "0.5870432", "0.5866153", "0.5866153", "0.58651453", "0.58572966", "0.58572966" ]
0.77807766
0
Helper to generate a random WKT string Try to keeps values sane, no shape is more than 100km across
function wkt_generate() { $types = array( 'point', 'linestring', 'polygon', 'multipoint', 'multilinestring', 'multipolygon', ); // don't always generate the same type shuffle($types); $type = $types[0]; $func = 'wkt_generate_' . $type; if (method_exists($this, $func)) { $wkt = $this->$func(); return drupal_strtoupper($type) . ' (' . $wkt . ')'; } return 'POINT (0 0)'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wkt() {\n $wkt_string = '';\n $wkt = 'LINESTRING(';\n for ($i = 0; $i < count($this->geometries); $i++) {\n if (count($this->geometries[i]['coords']) === 0) {\n return 'LINESTRING(empty)';\n } else {\n $coords = $this->geometries[i]['coords'];\n foreach ($coords as $c) {\n $wkt .= $c[0] . ' ' . $c[1] . ',';\n }\n $wkt_string .= substr($wkt, 0, -1) . ')';\n }\n }\n return $wkt_string;\n }", "function GenerateWord() {\n $nb = rand(3, 10);\n $w = '';\n for ($i = 1; $i <= $nb; $i++)\n $w .= chr(rand(ord('a'), ord('z')));\n return $w;\n }", "public function wktGenerateGeometry();", "function GenerateWord()\n{\n $nb=rand(3,10);\n $w='';\n for($i=1;$i<=$nb;$i++)\n $w.=chr(rand(ord('a'),ord('z')));\n return $w;\n}", "private function createRandomString() {\n\t\t$characters = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$res = '';\n\t\tfor ($i = 0; $i < 20; $i++) {\n\t\t\t$res .= $characters[mt_rand(0, strlen($characters) - 1)];\n\t\t}\n\t\treturn $res;\n\t}", "public function generateWkt(array $gis_data, $index, $empty = '')\n {\n $no_of_lines = isset($gis_data[$index]['POLYGON']['no_of_lines'])\n ? $gis_data[$index]['POLYGON']['no_of_lines'] : 1;\n if ($no_of_lines < 1) {\n $no_of_lines = 1;\n }\n\n $wkt = 'POLYGON(';\n for ($i = 0; $i < $no_of_lines; $i++) {\n $no_of_points = isset($gis_data[$index]['POLYGON'][$i]['no_of_points'])\n ? $gis_data[$index]['POLYGON'][$i]['no_of_points'] : 4;\n if ($no_of_points < 4) {\n $no_of_points = 4;\n }\n $wkt .= '(';\n for ($j = 0; $j < $no_of_points; $j++) {\n $wkt .= ((isset($gis_data[$index]['POLYGON'][$i][$j]['x'])\n && trim($gis_data[$index]['POLYGON'][$i][$j]['x']) != '')\n ? $gis_data[$index]['POLYGON'][$i][$j]['x'] : $empty)\n . ' ' . ((isset($gis_data[$index]['POLYGON'][$i][$j]['y'])\n && trim($gis_data[$index]['POLYGON'][$i][$j]['y']) != '')\n ? $gis_data[$index]['POLYGON'][$i][$j]['y'] : $empty) . ',';\n }\n $wkt\n =\n mb_substr(\n $wkt,\n 0,\n mb_strlen($wkt) - 1\n );\n $wkt .= '),';\n }\n $wkt\n =\n mb_substr(\n $wkt,\n 0,\n mb_strlen($wkt) - 1\n );\n $wkt .= ')';\n\n return $wkt;\n }", "function random_string( )\n {\n $character_set_array = array( );\n $character_set_array[ ] = array( 'count' => 7, 'characters' => 'abcdefghijklmnopqrstuvwxyz' );\n $character_set_array[ ] = array( 'count' => 1, 'characters' => '0123456789' );\n $temp_array = array( );\n foreach ( $character_set_array as $character_set )\n {\n for ( $i = 0; $i < $character_set[ 'count' ]; $i++ )\n {\n $temp_array[ ] = $character_set[ 'characters' ][ rand( 0, strlen( $character_set[ 'characters' ] ) - 1 ) ];\n }\n }\n shuffle( $temp_array );\n return implode( '', $temp_array );\n }", "public function generateWord()\n {\n $word = '';\n $wordLen = $this->getWordLen();\n $vowels = $this->_useNumbers ? self::$VN : self::$V;\n $consonants = $this->_useNumbers ? self::$CN : self::$C;\n\n $totIndexCon = count($consonants) - 1;\n $totIndexVow = count($vowels) - 1;\n for ($i=0; $i < $wordLen; $i = $i + 2) {\n // generate word with mix of vowels and consonants\n $consonant = $consonants[mt_rand(0, $totIndexCon)];\n $vowel = $vowels[mt_rand(0, $totIndexVow)];\n $word .= $consonant . $vowel;\n }\n\n if (strlen($word) > $wordLen) {\n $word = substr($word, 0, $wordLen);\n }\n\n return $word;\n }", "function random_string()\n\t{\n\t\t$character_set_array = array();\n\t\t$character_set_array[] = array('count' => 10, 'characters' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\t\t$character_set_array[] = array('count' => 10, 'characters' => '0123456789');\n\t\t$temp_array = array();\n\t\tforeach ($character_set_array as $character_set) {\n\t\t\tfor ($i = 0; $i < $character_set['count']; $i++) {\n\t\t\t\t$temp_array[] = $character_set['characters'][rand(0, strlen($character_set['characters']) - 1)];\n\t\t\t}\n\t\t}\n\t\tshuffle($temp_array);\n\t\treturn implode('', $temp_array);\n\t}", "public function wktGeneratePoint(array $point = NULL);", "function genRandomString() {\n //credits: http://bit.ly/a9rDYd\n $length = 50;\n $characters = \"0123456789abcdef\"; \n for ($p = 0; $p < $length ; $p++) {\n $string .= $characters[mt_rand(0, strlen($characters))];\n }\n\n return $string;\n }", "protected function _generateWord()\n {\n $word = '';\n $wordLen = $this->getWordlen();\n $vowels = $this->_useNumbers ? self::$VN : self::$V;\n $consonants = $this->_useNumbers ? self::$CN : self::$C;\n\n $totIndexCon = count($consonants) - 1;\n $totIndexVow = count($vowels) - 1;\n for ($i=0; $i < $wordLen; $i = $i + 2) {\n // generate word with mix of vowels and consonants\n $consonant = $consonants[Zend_Crypt_Math::randInteger(0, $totIndexCon, true)];\n $vowel = $vowels[Zend_Crypt_Math::randInteger(0, $totIndexVow, true)];\n $word .= $consonant . $vowel;\n }\n\n if (strlen($word) > $wordLen) {\n $word = substr($word, 0, $wordLen);\n }\n\n return $word;\n }", "function tck_rnd_string( $str, $length, $type, $charlist ) {\n if ( $type == 0 ) {\n if ( strpos($str, tck_get_prefix(0)) !== false || strpos($str, tck_get_prefix(1)) !== false ) {\n $charlist = str_replace(tck_get_prefix(0), '', $charlist);\n $charlist = str_replace(tck_get_prefix(1), '', $charlist);\n $str = substr(str_shuffle($charlist), 0, $length);\n }\n }\n \n return $str;\n }", "function getRandomString($lenght = 5, $smallLetters = true, $bigLetters = true, $numbers = true)\n{\n $material = array();\n if(true === $smallLetters) {\n $material = array_merge($material, range('a', 'z'));\n }\n if(true === $bigLetters) {\n $material = array_merge($material, range('A', 'Z'));\n } \n if(true === $numbers) {\n $material = array_merge($material, range('0', '9'));\n } \n $randomString = ''; \n for ($i = 0; $i < $lenght; $i++) { \n $randomString .= $material[mt_rand(0, count($material)-1)]; \n } \n return $randomString; \n}", "private static function generateBoundary() {\n\t\treturn \"-----=\".md5(uniqid(mt_rand(), 1));\n\t}", "public function createRandString(){\n\n $new = '';\n srand((double)microtime() * 1000000);\n $char_list = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $char_list .= \"abcdefghijklmnopqrstuvwxyz\";\n $char_list .= \"1234567890\";\n\n for ($i = 0; $i < 8; $i++) {\n\n $new .= substr($char_list, (rand() % (strlen($char_list))), 1);\n\n }\n\n return $new;\n\n }", "function generate_random_string($name_length = 8) \n\t{\n\t\t$alpha_numeric = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\treturn substr(str_shuffle($alpha_numeric), 0, $name_length);\n\t}", "function wkt_generate_multilinestring() {\n $start = $this->random_point();\n $num = $this->dd_generate(1, 3, TRUE);\n $lines[] = $this->wkt_generate_linestring($start);\n for ($i = 0; $i < $num; $i += 1) {\n $diff = $this->random_point();\n $start[0] += $diff[0] / 100;\n $start[1] += $diff[1] / 100;\n $lines[] = $this->wkt_generate_linestring($start);\n }\n return '(' . implode('), (', $lines) . ')';\n }", "public static function generatePassword() {\n\t\t$consonants = array (\n\t\t\t\t\"b\",\n\t\t\t\t\"c\",\n\t\t\t\t\"d\",\n\t\t\t\t\"f\",\n\t\t\t\t\"g\",\n\t\t\t\t\"h\",\n\t\t\t\t\"j\",\n\t\t\t\t\"k\",\n\t\t\t\t\"l\",\n\t\t\t\t\"m\",\n\t\t\t\t\"n\",\n\t\t\t\t\"p\",\n\t\t\t\t\"r\",\n\t\t\t\t\"s\",\n\t\t\t\t\"t\",\n\t\t\t\t\"v\",\n\t\t\t\t\"w\",\n\t\t\t\t\"x\",\n\t\t\t\t\"y\",\n\t\t\t\t\"z\" \n\t\t);\n\t\t$vocals = array (\n\t\t\t\t\"a\",\n\t\t\t\t\"e\",\n\t\t\t\t\"i\",\n\t\t\t\t\"o\",\n\t\t\t\t\"u\" \n\t\t);\n\t\t\n\t\t$password = '';\n\t\t\n\t\tsrand ( ( double ) microtime () * 1000000 );\n\t\tfor($i = 1; $i <= 4; $i ++) {\n\t\t\t$password .= $consonants [rand ( 0, 19 )];\n\t\t\t$password .= $vocals [rand ( 0, 4 )];\n\t\t}\n\t\t$password .= rand ( 0, 9 );\n\t\t\n\t\treturn $password;\n\t}", "private function generateString() :string\n {\n $chromosome = '';\n\n for ($i = 0; $i < Settings::CHROMOSOME_SIZE; $i++) {\n $chromosome = $chromosome . $this->genes[$this->getRandomPosition()];\n }\n\n return $chromosome;\n }", "function generate_random_string($name_length = 8) {\n $alpha_numeric = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n return substr(str_shuffle($alpha_numeric), 0, $name_length);\n }", "function wpbm_generate_random_string( $length ){\n $string = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $random_string = '';\n for ( $i = 1; $i <= $length; $i ++ ) {\n $random_string .= $string[ rand( 0, 61 ) ];\n }\n return $random_string;\n }", "function gen_rand_string($num_chars = 8)\n{\n\t$rand_str = unique_id();\n\t$rand_str = str_replace('0', 'Z', strtoupper(base_convert($rand_str, 16, 35)));\n\n\treturn substr($rand_str, 0, $num_chars);\n}", "function random_str($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')\n{\n $str = '';\n $max = mb_strlen($keyspace, '8bit') - 1; //lunghezza $keyspace, 8bit è codifica della stringa\n for ($i = 0; $i < $length; ++$i) {\n $str .= $keyspace[random_int(0, $max)];\n }\n return $str;\n}", "public function randomString(){\n $alpha = \"abcdefghijklmnopqrstuvwxyz\";\n $alpha_upper = strtoupper($alpha);\n $numeric = \"0123456789\";\n $special = \".-+=_,!@$#*%<>[]{}\";\n $chars = $alpha . $alpha_upper . $numeric; \n $pw = ''; \n $chars = str_shuffle($chars);\n $pw = substr($chars, 8,8);\n return $pw;\n }", "function posListToWKT($posList, $order) {\n\n /*\n * Explode posList into the $coordinates array\n * Note the trim() to avoid weird results :)\n */\n $posList = preg_replace('!\\s+!', ' ', $posList);\n $coordinates = explode(' ', trim($posList));\n $count = count($coordinates);\n $polygon = '';\n\n /*\n * Parse each coordinates\n */\n for ($i = 0; $i < $count; $i = $i + 2) {\n\n /*\n * Case 1 : coordinates order is latitude then longitude\n */\n if ($order === \"LATLON\") {\n $polygon .= ((float)$coordinates[$i + 1]) . ' ' . ((float)$coordinates[$i]) . ',';\n }\n /*\n * Case 2 : coordinates order is longitude then latitude\n */\n else {\n $polygon .= ((float)$coordinates[$i]) . ' ' . ((float)$coordinates[$i + 1]) . ',';\n }\n }\n\n // Substring to remove the last ',' character\n return 'POLYGON((' . substr($polygon, 0, -1) . '))';\n}", "function fixtures_generate_data( string $type ,\n int $min ,\n int $max ,\n bool $no_periods = false ,\n bool $no_spaces = false ) : string\n{\n // Don't generate aything if the min/max values are incorrect\n if($max < 1 || $min > $max)\n return '';\n\n // Random int between $min and $max\n if($type === 'int')\n return mt_rand($min, $max);\n\n // Random string of digits\n if($type === 'digits')\n {\n $digits = '';\n $max_length = mt_rand($min, $max);\n for ($i = 0; $i < $max_length; $i++)\n $digits .= mt_rand(0,9);\n return $digits;\n }\n\n // Random string\n if($type === 'string')\n {\n $characters = \"aaaaaabcdeeeeeeefghiiiiiijkllmmnnoooooopqrrsssttuuvwxyz\";\n if(!$no_spaces)\n $characters .= \" \";\n $max_length = mt_rand($min, $max);\n $string = '';\n for ($i = 0; $i < $max_length; $i++)\n $string .= $characters[mt_rand(0, (strlen($characters) - 1))];\n return $string;\n }\n\n // Random paragraph\n if($type === 'sentence')\n {\n $sentence = ucfirst(fixtures_lorem_ipsum(mt_rand($min, $max), 1));\n return ($no_periods) ? $sentence : $sentence.'.';\n }\n\n // Random text\n if($type === 'text')\n {\n $text = '';\n $max_length = mt_rand($min, $max);\n for ($i = 0; $i < $max_length; $i++)\n {\n $text .= ($i) ? '\\r\\n\\r\\n' : '';\n $text .= ucfirst(fixtures_lorem_ipsum(mt_rand(100, 400), 1)).'.';\n }\n return $text;\n }\n}", "function generateFeatureName($feature_type) {\n\twriteLog(\"generateFeatureName()\");\n\t\n\tsrand();\n\t$syllables = rand(2,4);\n\twriteLog(\"generateFeatureName(): Type: \" . $feature_type);\n\t$name = \"\";\n\t\n\tfor ($s = 0; $s < $syllables; $s++) {\n\t\t\n\t\t$consonant = \"a\";\n\t\twhile ($consonant == \"a\" || $consonant == \"e\"|| $consonant == \"i\" || $consonant == \"o\" || $consonant == \"u\") {\n\t\t\t$consonant = chr(rand(97, 122));\n\t\t}\n\t\twriteLog(\"generateFeatureName(): Consonant: \" . $consonant);\n\t\t\n\t\t$vowel = \"x\";\n\t\twhile ($vowel != \"a\" && $vowel != \"e\" && $vowel != \"i\" && $vowel != \"o\" && $vowel != \"u\") {\n\t\t\t$vowel = chr(rand(97, 122));\n\t\t}\n\t\twriteLog(\"generateFeatureName(): Vowel: \" . $vowel);\n\t\t\n\t\t$name = $name . $consonant . $vowel;\n\t\t$consonant = \"a\";\n\t\t$vowel = \"x\";\n\t\t\n\t}\n\t\n\t$name = $name . \" \" . $feature_type;\n\t\n\twriteLog(\"generateFeatureName(): Name: \" . $name);\n\t\n\treturn ucwords($name);\n\t\n}", "function random_string(int $length, bool $puncted = false): string\n{\n return Strings::random($length, $puncted);\n}", "function createRand()\n{\n\t$up = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\t$down = \"abcdefghijklmnopqrstuvwxyz\";\n\t$num = \"1234567890\";\n\t$upRand = str_shuffle($up) . str_shuffle($up);\n\t$downRand = str_shuffle($down) . str_shuffle($down);\n\t$numRand = str_shuffle($num) . str_shuffle($num);\n\t$randStr1 = str_shuffle($upRand.$downRand.$numRand);\n\t$randStr2 = str_shuffle($upRand.$downRand.$numRand);\n\t$randStrFull = str_shuffle($randStr1.$randStr2);\n\t$randStrFinal = str_shuffle(substr($randStrFull,0,8));\n\treturn $randStrFinal;\n}" ]
[ "0.6305082", "0.6034616", "0.59992707", "0.5904042", "0.57367915", "0.5662001", "0.56549805", "0.5563936", "0.550679", "0.55066264", "0.55014354", "0.54956836", "0.5422564", "0.5392293", "0.53797483", "0.5377782", "0.5359167", "0.5356885", "0.5356478", "0.53319204", "0.53249115", "0.53137946", "0.53093463", "0.52979636", "0.5292056", "0.52840245", "0.527966", "0.52694154", "0.5250067", "0.524995" ]
0.7097173
0
Set the value of idreevext.
public function setIdreevext($idreevext) { $this->idreevext = $idreevext; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setid_exp($val)\n { $this->id_exp=$val;}", "function setid_exp($val)\n { $this->id_exp=$val;}", "function setid_exp($val)\n { $this->id_exp=$val;}", "public function setidExamen($Valor){\r\n $this->idExamen = trim($Valor);\r\n }", "public function getIdreevext()\n {\n return $this->idreevext;\n }", "public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }", "function setId($id) {\r\n\t\t$this->setAttributeNS(self :: TEXT, 'text:id', $id);\r\n\t}", "private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}", "public function setLeafId ($value)\r\n\t{\r\n\t\t$this->leafId = $value;\r\n\t}", "public function setLeafId($value) {\r\n\t\t$this->leafId = $value;\r\n\t}", "function SetId($value) { $this->id=$value; }", "public function setIdVit($id){\n\t\t$this->id = $id;\n\t}", "public function setLeafIdTemp($value) {\r\n\t\t$this->leafIdTemp = $value;\r\n\t}", "public function setNodeId($id);", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "function set_id( $id ){\n\t\t$this->id = $id;\n\t\t// this is add request. so number is 0\n\t\tif( $this->id == $this->id_base ){\n\t\t\t$this->number = 0;\n\t\t\t$this->is_new = true;\n\t\t}\n\t\t// parse number\n\t\telse{\n\t\t\t$this->number = str_replace($this->id_base.'-', '', $this->id);\n\n\t\t\t// load instance data\n\t\t\t$this->instance = jcf_field_settings_get( $this->id );\n\t\t\tif( !empty($this->instance) ){\n\t\t\t\t$this->slug = $this->instance['slug'];\n\t\t\t}\n\t\t}\n\t}", "public function setID($id){\n $this->ID = $id;\n }", "public function setValue($value) {\n $this->node->setAttribute('value', iconv(xp::ENCODING, 'utf-8', $value));\n }", "function setIdentifier($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }", "public function setID($id) {\n $this->id = $id; \n }", "function setId($id)\n {\n $this->_id = $id;\n $this->_extension = null;\n }", "public function setId($valor){\n\t\t\t$this->id = $valor;\n\t\t}", "public function setId($x) { $this->id = $x; }", "public function set($id, $value);", "public function set($id, $value);", "public function setId($id)\n {\n\n $this->idKey = $id;\n $this->context->element = $id;\n\n }", "public function setID($id){\n $this->id = $id;\n }", "public function set_id($setid){\n $this->id = $setid;\n }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}" ]
[ "0.6885448", "0.68168837", "0.68168837", "0.6225238", "0.6004441", "0.5813483", "0.58005536", "0.5741478", "0.57302153", "0.5723305", "0.5696193", "0.5683559", "0.5655526", "0.5621757", "0.55848926", "0.55758977", "0.5569538", "0.5569384", "0.55664283", "0.5560925", "0.5545762", "0.55424184", "0.55392206", "0.55391395", "0.55391395", "0.5535528", "0.55312544", "0.5526074", "0.5525884", "0.551665" ]
0.7278928
0
Get the value of idreevext.
public function getIdreevext() { return $this->idreevext; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Public function get_ididtypeexp()\n\t\t{\n\t\t\tReturn $this ->idtypeexp;\n\t\t}", "function getid_exp()\n { return $this->id_exp;}", "function getid_exp()\n { return $this->id_exp;}", "function getid_exp()\n { return $this->id_exp;}", "public function getValueIdentifier(): string;", "public function getIdVit(){\n\t\treturn ($this->id);\n\t}", "public function getValueId()\n {\n return $this->valueId;\n }", "public function getVarighet()\n {\n return $this->getTid();\n }", "function getValNode(){\n\t\t$clase=$this->nmclass;\n\t\t$node=$this->anode;\n\t\t$valor=$this->nodos[$clase][$node];\n\n\t\tif($valor!=''){\n\t\t\treturn $valor;\n\t\t}\n\t\telse{\n\t\t\treturn -1;\n\t\t}\n\t}", "public function getTxtVal()\n {\n $rows = $this->getTreeRows();\n \n $tree = $this->generatePageTree($rows);\n \n return $this->tree_full_path;\n }", "function getGuid() {\n\t return $this->node->getText();\n\t}", "public function getVatID(): ?string;", "public function getValue() : string {\n\t\treturn $this->token;\n\t}", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function value($id)\n\t{\n\t\treturn $this->connection()->get(\"element/$id/value\");\n\t}", "public function getId() : string\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }", "function get_value_edit()\n\t{\n\t\treturn $this->value;\n\t}", "public function getTreeId() {}", "public function getid(){\n\t\t\treturn $this->id;\n\t\t}", "public function getValeur()\n {\n return $this->valeur;\n }", "function getValue() {\n global ${$this->name}, ${$this->name.\"_name\"}, ${$this->name.\"_old\"}; // ${$this->name} = ${\"surname\"} = $surname\n $ext=substr(${$this->name.\"_name\"},-3);\n if ($ext==\"\") $ext=${$this->name.\"_old\"};\n if ($ext==\"\") $ext=$this->value;\n return $ext;\n }", "public function getId() : string{\n return $this->id;\n }", "public function getId() : string{\n return $this->id;\n }", "function getID() {\n\t\treturn $this->data_array['id'];\n\t}", "public function getID() : string;", "function get() {\n if (!empty($this->_id)) {\n return $this->_id;\n }\n return '';\n }", "public function getId() {\n\t\treturn $this -> data['id'];\n\t}", "public function getID(): string;", "public function getElementId() {}", "public function getId()\n { return $this->getAttribute('id'); }" ]
[ "0.6589508", "0.6485974", "0.64740366", "0.64740366", "0.63102365", "0.62715966", "0.6199353", "0.6197915", "0.6048775", "0.60483843", "0.59944594", "0.5978289", "0.5975757", "0.59104896", "0.5901982", "0.5901641", "0.5873187", "0.58712727", "0.58508873", "0.5835513", "0.5835243", "0.5835215", "0.5835215", "0.5822428", "0.58166224", "0.58148175", "0.5778074", "0.5767907", "0.5767422", "0.5749334" ]
0.8024223
0
Get the value of ubicacion.
public function getUbicacion() { return $this->ubicacion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_ubicacion()\n {\n $usuario = consultas::get_pf();\n $dep = consultas::get_dep_habilitada();\n if($usuario == 'acor_mesa')\n {\n if($dep['id_dep'] == 3)\n { //-- 3:Mesa de EyS --//\n $datos['motivo'] = 'and m1.id_motivo = 10'; //-- 10: Salida de Mesa de EyS --//\n $datos['ubicacion'] = 'DPTO. MESA DE EyS';\n $datos['ubi'] = 5;\n $datos['id_motivo'] = '10';\n }\n }elseif($usuario == 'acor_carga')\n {\n if($dep['id_dep'] == 1)\n { //-- 1:Gestion de deudas --//\n $datos['motivo'] = 'and m1.id_motivo = 11'; //-- 10: Salida de Gestion de deudas --//\n $datos['ubicacion'] = 'DIR. GESTION DE DEUDAS';\n $datos['ubi'] = 6;\n $datos['id_motivo'] = '11';\n }\n elseif($dep['id_dep'] == 2)\n { //-- 2:Procuracion y legales --//\n $datos['motivo'] = 'and m1.id_motivo = 12'; //-- 10: Salida de Procuracion y legales --//\n $datos['ubicacion'] = 'DIR. PROCURACION Y LEGALES';\n $datos['ubi'] = 7;\n $datos['id_motivo'] = '12';\n }\n }\n return $datos;\n }", "public function getValor(){\n return $this->_data['valor'];\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValoracion() {\n return $this->valoracion;\n }", "public function getCodUbicacion()\n {\n return $this->codUbicacion;\n }", "public function get_valor() {\n\t\t\n\t\t$ar_list_of_values\t= $this->get_ar_list_of_values();\n\t\t$dato \t\t\t\t= $this->get_dato();\n\t\t\n\t\tif (is_array ($ar_list_of_values)) foreach ($ar_list_of_values as $value => $rotulo) {\n\t\t\t\t\t\t\t\t\t\n\t\t\tif( $dato == $value ) {\n\t\t\t\t\n\t\t\t\t$this->valor = $rotulo; \n\t\t\t\t\n\t\t\t\treturn $this->valor;\n\t\t\t}\n\t\t\t#echo \"<br> - $dato - $value => $rotulo \";\n\t\t}\t\t\t\t\t\n\t}", "public function getTxDireccionUbicacion()\n\t{\n\t\treturn $this->tx_direccion_ubicacion;\n\t}", "public function obtenerValor() {\n return $this->valor;\n }", "public function getUbicacionLugar()\n {\n return $this->ubicacion_lugar;\n }", "function get_tarifKilometrique() {\n return $this->tarifKilometrique;\n }", "public function get_valor() {\n\t\t\n\t\t$dato = self::get_dato();\n\t\t/*\n\t\t$separator = ' , ';\n\t\tif($this->modo=='list') $separator = '<br>';\n\n\t\tif (is_array($valor)) {\n\t\t\t# return \"Not string value\";\n\t\t\t$string \t= '';\n\t\t\t$n \t\t\t= count($valor);\n\t\t\tforeach ($valor as $key => $value) {\n\n\t\t\t\tif(is_array($value)) $value = print_r($value,true);\n\t\t\t\t$string .= \"$key : $value\".$separator;\n\t\t\t}\n\t\t\t$string = substr($string, 0,-4);\n\t\t\treturn $string;\n\n\t\t}else{\n\t\t\t\n\t\t\treturn $valor;\n\t\t}\n\t\t*/\n\t\tif(isset($dato['counter'])) {\n\t\t\t$valor = $this->tipo.'-'.$dato['counter'];\n\t\t}else{\n\t\t\t$valor = $this->tipo;\n\t\t}\n\n\t\treturn $valor;\n\t}", "public function getValorPis()\n {\n return $this->valorPis;\n }", "public function gerencial_valorInventario(){\n\t\t\n\t\t$resultado = 0;\n\t\t\n\t\t$query = \"SELECT cantidad, idProducto\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_productos_sucursal\";\n\t\t\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n \tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n \t\n\t\t\t\t$idproducto = $filas['idProducto'];\n\t\t\t\t$cantidad\t= $filas['cantidad']; \n\t\t\t\t\n\t\t\t\t$query2 = \"SELECT precio \n\t\t\t\t\t\t\tFROM tb_productos WHERE idProducto = '$idproducto'\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($res2 = $conexion->query($query2)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t while ($filas2 = $res2->fetch_assoc()) {\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t$precio = str_replace('.', '',$filas2['precio']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$subtotal = $precio * $cantidad;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $resultado = $resultado + $subtotal;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\n } \n \n }//fin if\n\t\t\n return $resultado;\t\n\t\t\n\t}", "public function getCodiceFiscale(){ return $this->codiceFiscale;}", "public function getProd_niche () {\n\t$preValue = $this->preGetValue(\"prod_niche\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"prod_niche\")->preGetData($this);\n\treturn $data;\n}", "public function getValorInventario()\n {\n return $this->valorInventario;\n }", "public function getUltimaCarga()\n {\n return $this->ultima_carga;\n }", "public function getValeur() {\n return floatval($this->valeur);\n }", "public function getPrix_unitaire()\n {\n return $this->prix_unitaire;\n }", "public function getNumerocarte()\n {\n return $this->numerocarte;\n }", "public function getPaiementEnEuro() {\n return $this->paiementEnEuro;\n }", "public function getValue() {\n\n\t\treturn trim(\n\t\t\tfile_get_contents(\n\t\t\t\tself::PINDIR.'/gpio'.$this->iPinNumber.'/value'\n\t\t\t)\n\t\t);\n\t}", "public function getPico();", "public function getCodice() \n\t{\n return $this->codice;\n }", "private function getCodigoPresupuestarioInmuebleUrbano()\r\n\t\t{\r\n\t\t\t$codigoPresupuesto['codigo'] = '301020500';\r\n\t\t\treturn $codigo = self::getCodigoPresupuestarioByCodigo($codigoPresupuesto['codigo']);\r\n\t\t}", "public function getPrezzo() {\n return number_format((float)$this->prezzo, 2, ',', '');\n }", "public function getCodice()\n {\n return $this->codice;\n }", "public function getQuantity(): float;", "public function getValue()\n {\n return $this->getOriginData('value');\n }" ]
[ "0.6577382", "0.6303181", "0.6133031", "0.6133031", "0.6125839", "0.6061697", "0.59556115", "0.59310496", "0.59006804", "0.589204", "0.58556926", "0.5822034", "0.57913905", "0.57847756", "0.5716602", "0.5688839", "0.5681292", "0.56684625", "0.56446207", "0.5643767", "0.56104875", "0.55999815", "0.5578177", "0.5560116", "0.55536765", "0.55374706", "0.5527359", "0.5525626", "0.5517721", "0.5503283" ]
0.72926635
1
Set the value of ubicacion_lugar.
public function setUbicacionLugar($ubicacion_lugar) { $this->ubicacion_lugar = $ubicacion_lugar; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUbicacionLugar()\n {\n return $this->ubicacion_lugar;\n }", "public function setSlugAttribute($value) {\n $this->attributes['slug'] = Str::slug($this->titre);\n }", "public function set_atletas_talla_ropa_buzo($atletas_talla_ropa_buzo) {\n $atletas_talla_ropa_u = strtoupper($atletas_talla_ropa_buzo);\n\n if (in_array($atletas_talla_ropa_u, AtletasModel::$_TALLAS_ROPA)) {\n $this->atletas_talla_ropa_buzo = $atletas_talla_ropa_u;\n } else {\n $this->atletas_talla_ropa_buzo = '??';\n }\n }", "public function setSlugValue(Slug $value)\n {\n $this->{$this->slugField()} = $value;\n }", "public static function Slug($IdNoticia, $Titulo, $IdEditoria){\n\t\t\t//$obj->buscarEditoria(1, $IdEditoria);\n\t\t\t//$editoria = preg_replace(\"{[^a-z0-9]}\", \"\", Url::_RewriteString($obj->getNome()));\n\t\t\t$editoria = \"noticia\";\n\t\t\t\n\t\t\treturn $editoria.\"-$IdNoticia-\".Url::_RewriteString($Titulo);\n\t\t}", "public function setSlugAttribute($value)\n {\n $slug = Str::slug($value, '-', 'ar');\n \n $isSlugExists = static::where('slug', $slug)->exists();\n \n if ($isSlugExists) {\n $id = Arr::first(explode('-', $this->attributes['id']));\n $slug = \"$slug-{$id}\"; \n }\n\n $this->attributes['slug'] = $slug;\n }", "public function setArl_nombre($arl_nombre){\n $this->arl_nombre = $arl_nombre;\n }", "public static function setRuolo($pagina) {\r\n $operatore = $_SESSION[\"op\"];\r\n $ruolo = $operatore->getFunzione();\r\n\r\n switch ($ruolo) {\r\n case OperatoreFactory::admin():\r\n $pagina->setLeftBarFile(\"./view/amministratore/menuAmministratore.php\");\r\n break;\r\n case OperatoreFactory::operatore():\r\n $pagina->setLeftBarFile(\"./view/operatore/menuOperatore.php\");\r\n break;\r\n case OperatoreFactory::protocollo():\r\n $pagina->setLeftBarFile(\"./view/protocollo/menuProtocollo.php\");\r\n break;\r\n case OperatoreFactory::responsabile():\r\n $pagina->setLeftBarFile(\"./view/responsabile/menuResponsabile.php\");\r\n break;\r\n default :\r\n $pagina->setLeftBarFile(\"./view/errorMenu.php\");\r\n }\r\n }", "public function setRuolo($ruolo) {\n switch ($ruolo) {\n case self::Venditore:\n\t\t\t\t$this->ruolo = $ruolo;\n return true;\n case self::Compratore:\n $this->ruolo = $ruolo;\n return true;\n default:\n return false;\n }\n }", "public function setUbicacion($data)\n {\n\n if ($this->_ubicacion != $data) {\n $this->_logChange('ubicacion');\n }\n\n if ($data instanceof \\Zend_Db_Expr) {\n $this->_ubicacion = $data;\n } else if (!is_null($data)) {\n if (!in_array($data, $this->_ubicacionAcceptedValues) && !empty($data)) {\n throw new \\InvalidArgumentException(_('Invalid value for ubicacion'));\n }\n $this->_ubicacion = (string) $data;\n } else {\n $this->_ubicacion = $data;\n }\n return $this;\n }", "function setModificarJugador($id,$nombre,$url_img){\n\t$this->nombre = $nombre;\n\t$this->id = $id;\n\t$this->url_img = $url_img;\n}", "public function setTanggalLahirAttribute($value)\n {\n if (strlen($value)) {\n $this->attributes['tanggal_lahir'] = $value;\n } else {\n $this->attributes['tanggal_lahir'] = null;\n }\n }", "public function setListar($value)\n\t{\n\t\t$this->listar = $value;\n\t}", "function set_ubicacion(){\n\n\t\tif($this->input->post('id')){\n\t\t\t\n\t\t\t$id = $this->input->post('id',true);\n\n\t\t\t$user = $this->session->userdata('cliente_id');\n\n\t\t\tif($id != 1 AND $id != 2){\n\t\t\t\techo json_encode(array('res' => 'error'));\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t//Verificar si ya tiene la ubicacion colocada para no volver a mostrar \n\n\t\t\t$cliente = applib::get_table_field(applib::$clientes_table,array('id' => $user),'*');\n\t\t\t\n\t\t\tif($cliente['lugar'] != null){\n\t\t\t\techo json_encode(array('res' => 'error'));\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t//Colocar ubicacion del proyecto para filtrar\n\n\t\t\tapplib::update(array('id' => $user),applib::$clientes_table,array('lugar' => $id));\n\n\t\t\techo json_encode(array('res' => 'success'));\n\t\t}\n\t}", "function setUrlUIAnterior($url) {\n $this->urlUIAnterior = $url;\n }", "public function setJmlJambanLG($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->jml_jamban_l_g !== $v) {\n $this->jml_jamban_l_g = $v;\n $this->modifiedColumns[] = SanitasiPeer::JML_JAMBAN_L_G;\n }\n\n\n return $this;\n }", "public function setSlug($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->slug !== $v) {\n\t\t\t$this->slug = $v;\n\t\t\t$this->modifiedColumns[] = CidadePeer::SLUG;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setLoueur($loueur)\n {\n $this->loueur = $loueur;\n\n return $this;\n }", "public function setArreglo( $registro )\n { return $this->getArreglo( $registro ); }", "public function setArreglo( $registro )\n { return $this->getArreglo( $registro ); }", "public function setUbicacion($ubicacion)\n {\n $this->ubicacion = $ubicacion;\n\n return $this;\n }", "public function setUbicacion($ubicacion)\n {\n $this->ubicacion = $ubicacion;\n\n return $this;\n }", "public function setLargura($iLargura, $sUnidade = \"px\") \r\n\t{\r\n\t\t$this->iLargura = $iLargura;\r\n\t\t$this->sUnidadeLargura = $sUnidade;\r\n\t}", "public function setSlug($slug);", "public function setSlug($slug);", "public function setSlug($slug);", "public function testSetBureauDistributeur() {\n\n $obj = new Collaborateurs();\n\n $obj->setBureauDistributeur(\"bureauDistributeur\");\n $this->assertEquals(\"bureauDistributeur\", $obj->getBureauDistributeur());\n }", "public function setSlug ($value) {\n\t\n\t\t// check for a value\n\t\tif ($value == \"\") {\n\t\t\t$this->setMessage(LANG_INVALID.\" \".LANG_URL);\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$id = ($this->pageID) ? $this->pageID : 0;\n\t\t\t$parent = ($this->pageParent) ? $this->pageParent : 0;\n\t\t\t$pageModel = new PagesModel();\n\t\t\t$this->setData(\"pageSlug\", $pageModel->validateSlug($value, $id, $parent));\n\t\t\treturn true;\n\t\t}\n\t}", "public function setJmlJambanLpG($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->jml_jamban_lp_g !== $v) {\n $this->jml_jamban_lp_g = $v;\n $this->modifiedColumns[] = SanitasiPeer::JML_JAMBAN_LP_G;\n }\n\n\n return $this;\n }", "function set_categorie($categorie){\n if($categorie == \"vin\" || $categorie == \"eau\" || $categorie == \"jus\"){\n $this->categorie = $categorie;\n }else{\n $this->erreur(\"La categorie doit être : vin, eau ou jus. Or c'est : \".$categorie.\"<br>\");\n }\n }" ]
[ "0.6037762", "0.5145679", "0.49458802", "0.4919725", "0.48326263", "0.47729024", "0.4758893", "0.47262627", "0.4710221", "0.47008646", "0.468209", "0.4676038", "0.46743947", "0.46565852", "0.4655925", "0.4638332", "0.46326086", "0.46310472", "0.46256366", "0.46256366", "0.4624177", "0.4624177", "0.45379427", "0.4537841", "0.4537841", "0.4537841", "0.45128393", "0.45066875", "0.4499966", "0.44961601" ]
0.71171075
0
Get the value of ubicacion_lugar.
public function getUbicacionLugar() { return $this->ubicacion_lugar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUbicacionLugar($ubicacion_lugar)\n {\n $this->ubicacion_lugar = $ubicacion_lugar;\n\n return $this;\n }", "function Get_NombreCancha($identificador)\n{\n global $conexion;\n $valor = mysqli_fetch_array(consultar(\"SELECT nombre\n FROM tb_lugares WHERE id_lugar=$identificador\"));\n \n return $valor['nombre'];\n}", "public function getUbicacion()\n {\n return $this->ubicacion;\n }", "public function getUbicacion()\n {\n return $this->ubicacion;\n }", "public function getLieu(): string\r\n {\r\n return $this->Lieu;\r\n }", "public function getLoueur()\n {\n return $this->loueur;\n }", "public function getUslugis()\n {\n return $this->hasOne(Uslugi::className(), ['id_uslugi' => 'id_uslugis']);\n }", "public function getSlug()\n {\n if ($this->hasLocalizedSlug()) {\n //Cast model slug to propert type\n $slug = $this->getValue('slug');\n $slug = is_array($slug) ? $slug : (array) json_decode($slug);\n\n $lang = Localization::get();\n\n //Return selected language slug\n if (array_key_exists($lang->slug, $slug) && $slug[$lang->slug]) {\n return $slug[$lang->slug];\n }\n\n $default = Localization::getFirstLanguage();\n\n //Return default slug value\n if ($default->getKey() != $lang->getKey() && array_key_exists($default->slug, $slug) && $slug[$default->slug]) {\n return $slug[$default->slug];\n }\n\n //Return one of set slug from any language\n foreach (Localization::getLanguages() as $lang) {\n if (array_key_exists($lang->slug, $slug) && $slug[$lang->slug]) {\n return $slug[$lang->slug];\n }\n }\n\n //If languages has been hidden, and no slug has been defined from any known language\n //we can return any existing\n return array_values($slug)[0] ?? null;\n }\n\n return $this->slug;\n }", "public function getRubrique(): ?string\n {\n return $this->rubrique;\n }", "function get_lugar_sede($id_sede,$id_lugar) {\n $this->db->where('id_sede =', $id_sede);\n $this->db->where('id_lugar_sede =', $id_lugar);\n $query = $this->db->get('lugares');\n return $query->row();\n }", "public function getSlug()\n {\n return $this->getValue('nb_catalog_item_lang_slug');\n }", "public function getLibelle()\n {\n return $this->libelle;\n }", "public function getLibelle()\n {\n return $this->libelle;\n }", "public function getLibelle()\n {\n return $this->libelle;\n }", "private function getCodigoPresupuestarioInmuebleUrbano()\r\n\t\t{\r\n\t\t\t$codigoPresupuesto['codigo'] = '301020500';\r\n\t\t\treturn $codigo = self::getCodigoPresupuestarioByCodigo($codigoPresupuesto['codigo']);\r\n\t\t}", "public function getUrlLien(): string\r\n {\r\n return $this->urlLien;\r\n }", "public function getArl_nombre(){\n return $this->arl_nombre;\n }", "public function getLuasTapakBangunan()\n {\n return $this->luas_tapak_bangunan;\n }", "public function getNameLukasBodnariuc(): string{\r\n return $this->nameLukasBodnariuc . \" \" . $this->surnameLukasBodnariuc;\r\n }", "public function getRuolo() {\n return $this->ruolo;\n }", "public function getNomAlternatif()\n {\n $this->logDebug(\" [\".__FUNCTION__.\"] /Ligne: \".__LINE__.\"/ DEBUT; \");\n\n $strNomAlter = \"\";\n \n if ($this->getId() == Budget_typeTable::RESTITUE)\n {\n $strNomAlter = libelle('msg_libelle_restitution');\n } else\n {\n $strNomAlter = libelle('msg_libelle_allocation');\n }\n\n $this->logDebug(\" [\".__FUNCTION__.\"] /Ligne: \".__LINE__.\"/ FIN; \");\n\n return $strNomAlter;\n }", "public function id_nilai_alternatif()\n {\n $q = $this->db->query(\"select MAX(RIGHT(id_nilai_alternatif,5)) as id_max from tbl_nilai_alternatif\");\n $id = \"\";\n if ($q->num_rows() > 0) {\n foreach ($q->result() as $k) {\n $tmp = ((int) $k->id_max) + 1;\n $id = sprintf(\"%05s\", $tmp);\n }\n } else {\n $id = \"00001\";\n }\n return \"NAL-\" . $id;\n }", "public function recupererNombreDeMembreMax(string $LibelleCompetition)\n {\n $req = $this->getBdd()->prepare(\"SELECT jury.nombre_membre as nb from jury JOIN competition on competition.id = jury.id_competition where competition.libelle = ?\");\n $req->execute(array($LibelleCompetition));\n $result = $req->fetch();\n var_dump($result);\n return $result['nb'];\n }", "function get_tarifKilometrique() {\n return $this->tarifKilometrique;\n }", "public function getSlug()\n {\n return $this->__get(self::FIELD_SLUG);\n }", "private function getLigado()\n {\n return $this->ligado;\n }", "public function getAuteurLivre()\n {\n return $this->auteurLivre;\n }", "public function getIdlivro()\n {\n return $this->idlivro;\n }", "public function getSlug()\n {\n return $this->getCurrentTranslation()->getSlug() ?: 'n-a';\n }", "public function getJmlJambanLpG()\n {\n return $this->jml_jamban_lp_g;\n }" ]
[ "0.623128", "0.55721927", "0.5562899", "0.5562899", "0.55535555", "0.5519875", "0.5313222", "0.5300338", "0.5299393", "0.52624273", "0.5251565", "0.5206117", "0.5206117", "0.5206117", "0.5192006", "0.5165309", "0.5114181", "0.5100139", "0.509185", "0.50883687", "0.5062936", "0.503883", "0.50314575", "0.50313395", "0.5021709", "0.50192255", "0.49946633", "0.49847355", "0.49741656", "0.4971214" ]
0.74349856
0
Set the value of sello.
public function setSello($sello) { $this->sello = $sello; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSello()\n {\n return $this->sello;\n }", "public function setSelectedValue($value);", "public function setSelection(?FilterValue $selection): void\n {\n $this->selection = $selection;\n }", "public function setSelect($select);", "function __set($modelo, $valor)\n\t{\n\t\t$this->modelo = $modelo;\n\t}", "function setSelected($selected) {\r\n if ($this->list) {\n if ($selected) {\n $this->list->selectOption($this);\n } else {\n $this->list->deselectOption($this);\n }\n }\n }", "public function setSelection() {\n\n if(is_numeric($this->selection_count) && $this->selection_count > 0)\n {\n\n $sp = \"api_Common_GetSelection\";\n $params = [\n \"UserID\" => $this->user->getId()\n ,\"PageID\" => $this->page_id\n ,\"SelectionID\" => $this->selection_id\n ];\n\n $this->selection = $this->mp->storedProcedure($sp, $params)->getTable(0);\n\n }\n\n return $this;\n }", "public function setSelectedItem($name,$value) {\n $this->addHiddenField('on0',$name);\n $this->addHiddenField('os0',$value);\n }", "public function set_value($value) {\n\n // Is the select multiple?\n $multiple = $this->field->hasAttribute('multiple');\n $singleselect = ($this->field->hasClass('singleselect') || $this->field->hasClass('urlselect'));\n\n // Here we select the option(s).\n if ($multiple) {\n // Split and decode values. Comma separated list of values allowed. With valuable commas escaped with backslash.\n $options = preg_replace('/\\\\\\,/', ',', preg_split('/(?<!\\\\\\),/', trim($value)));\n // This is a multiple select, let's pass the multiple flag after first option.\n $afterfirstoption = false;\n foreach ($options as $option) {\n $this->field->selectOption(trim($option), $afterfirstoption);\n $afterfirstoption = true;\n }\n } else {\n // By default, assume the passed value is a non-multiple option.\n $this->field->selectOption(trim($value));\n }\n\n // Wait for all the possible AJAX requests that have been\n // already triggered by selectOption() to be finished.\n if ($this->running_javascript()) {\n // Trigger change event and click on first skip link, as some OS/browsers (Phantomjs, Mac-FF),\n // don't close select option field and trigger event.\n if (!$singleselect) {\n $dialoguexpath = \"//div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue-focused ')]\";\n if (!$node = $this->session->getDriver()->find($dialoguexpath)) {\n $script = \"Syn.trigger('change', {}, {{ELEMENT}})\";\n try {\n $driver = $this->session->getDriver();\n if ($driver instanceof \\Moodle\\BehatExtension\\Driver\\MoodleSelenium2Driver) {\n $driver->triggerSynScript($this->field->getXpath(), $script);\n }\n $driver->click('//body//div[@class=\"skiplinks\"]');\n } catch (\\Exception $e) {\n return;\n }\n } else {\n try {\n $this->session->getDriver()->click($dialoguexpath);\n } catch (\\Exception $e) {\n return;\n }\n }\n }\n $this->session->wait(behat_base::get_timeout() * 1000, behat_base::PAGE_READY_JS);\n }\n }", "public function testSetSelected()\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 testSetSelectionFournisseur() {\n\n $obj = new Collaborateurs();\n\n $obj->setSelectionFournisseur(\"selectionFournisseur\");\n $this->assertEquals(\"selectionFournisseur\", $obj->getSelectionFournisseur());\n }", "abstract public function parserSetOption($opt, $val);", "function select_option()\r\n{}", "public function set( $option, $value );", "function SetSessionDropDownValue($sv, $parm) {\n\t\t$_SESSION['sv_deals_details_' . $parm] = $sv;\n\t}", "public function testSetSelCliCollab() {\n\n $obj = new Collaborateurs();\n\n $obj->setSelCliCollab(true);\n $this->assertEquals(true, $obj->getSelCliCollab());\n }", "public function setSelect($mirrorId = NULL) {\n\t\tif (is_null($mirrorId)) {\n\t\t\t$this->isRandomSelection = TRUE;\n\t\t} else {\n\t\t\tif (is_int($mirrorId) && $mirrorId >= 1 && $mirrorId <= count($this->mirrors)) {\n\t\t\t\t$this->currentMirror = $mirrorId - 1;\n\t\t\t}\n\t\t}\n\t}", "private function setPageSelect()\n {\n $GLOBALS['TSFE']->sys_page = Tx_Smarty_Service_Compatibility::makeInstance('t3lib_pageSelect');\n $GLOBALS['TSFE']->sys_page->versioningPreview = false;\n $GLOBALS['TSFE']->sys_page->versioningWorkspaceId = false;\n $GLOBALS['TSFE']->where_hid_del = ' AND pages.deleted=0';\n $GLOBALS['TSFE']->sys_page->init(false);\n $GLOBALS['TSFE']->sys_page->where_hid_del .= ' AND pages.doktype<200';\n $GLOBALS['TSFE']->sys_page->where_groupAccess\n = $GLOBALS['TSFE']->sys_page->getMultipleGroupsWhereClause('pages.fe_group', 'pages');\n }", "public function llamadaSeleccionada( $contacto ) {\n $this->setComando(\"LLAMADAS:SEL\",$contacto);\n }", "function SetSessionDropDownValue($sv, $parm) {\n\t\t$_SESSION['sv_dealers_reports_' . $parm] = $sv;\n\t}", "public function setup_selected() {\n\t}", "public function testSetSelFrnCollab() {\n\n $obj = new Collaborateurs();\n\n $obj->setSelFrnCollab(true);\n $this->assertEquals(true, $obj->getSelFrnCollab());\n }", "public function set($s) {\r\n\t\t$this->current = $s;\r\n\t}", "public function testSetSelectionClient() {\n\n $obj = new Collaborateurs();\n\n $obj->setSelectionClient(\"selectionClient\");\n $this->assertEquals(\"selectionClient\", $obj->getSelectionClient());\n }", "function setLeja($_leja){\r\n $this->leja=$_leja;\r\n }", "function mSELECT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$SELECT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:116:3: ( 'select' ) \n // Tokenizer11.g:117:3: 'select' \n {\n $this->matchString(\"select\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function selOperator($selboxid, $opval) {\n\tglobal $trs;\n\techo \"<SELECT ID=$selboxid CLASS=selope>\\n\";\n\techo \"<OPTION VALUE='eq'\";\n\tif ($opval == \"eq\") {\n\t\techo \" SELECTED\";\n\t}\n\techo \"> = </OPTION>\\n\";\n\techo \"<OPTION VALUE='gt'\";\n\tif ($opval == \"gt\") {\n\t\techo \" SELECTED\";\n\t}\n\techo \"> &gt; </OPTION>\\n\";\n\techo \"<OPTION VALUE='lt'\";\n\tif ($opval == \"lt\") {\n\t\techo \" SELECTED\";\n\t}\n\techo \"> &lt; </OPTION>\\n\";\n\techo \"<OPTION VALUE='dx'\";\n\tif ($opval == \"dx\") {\n\t\techo \" SELECTED\";\n\t}\n\techo \">\" . $trs[\"op_dx\"] . \"</OPTION>\\n\";\n\techo \"</SELECT>\\n\";\n\t\n\techo \"<SCRIPT>\\$(\\\"#$selboxid\\\").selectmenu({width : 'auto'});</SCRIPT>\\n\";\n}", "protected function getSelectedValue() {}", "public function setVal($val){\n\t\t\t$this->_val = $val;\n\t\t}", "public function setListar($value)\n\t{\n\t\t$this->listar = $value;\n\t}" ]
[ "0.63304245", "0.5807434", "0.55175644", "0.5515794", "0.5488576", "0.53979456", "0.5384474", "0.538411", "0.5373435", "0.5353351", "0.534887", "0.52631354", "0.52240914", "0.5222219", "0.5209941", "0.51794404", "0.51688194", "0.5096457", "0.50768954", "0.50678724", "0.5059663", "0.5057363", "0.50408405", "0.50299484", "0.4982768", "0.4963692", "0.49606472", "0.496061", "0.4946161", "0.49316084" ]
0.65138483
0
Get the value of sello.
public function getSello() { return $this->sello; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSelected() {}", "public function getSelected() {}", "protected function getSelectedValue() {}", "public function get_value() {\n return $this->get_selected_options();\n }", "function get_selected()\n {\n }", "function get_row_sub_value($selector)\n{\n}", "public function getSelected()\n {\n return $this->selected;\n }", "public function getSelected()\n {\n return $this->selected;\n }", "public function getSelectionId()\n {\n return $this->selection_id;\n }", "function getPara($para,$value)\n{\n\t\t$str9=\"select \".$value.\" from options where name='\".$para.\"'\";\n\t\t$result9=mysql_query($str9) or die(mysql_error());\n\t\t$row9=mysql_fetch_array($result9);\n\t\t$t=$row9[$value]; \n\t\tmysql_free_result($result9);\n\t\treturn $t;\n}", "private function getSelectedValueFromSelect(Crawler $select)\n {\n return $select->element()->selectedValues();\n }", "function getSelectedValue ( $cd, $str )\n {\n $sql = \"SELECT \".$str.\" FROM Qst WHERE cd = \".$cd.\";\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $row = $stm->fetch(PDO::FETCH_ASSOC);\n return $row[$str];\n }", "public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}", "public function value()\n {\n return $this->app->input->get('option');\n }", "public function getSelector() {\n return $this->response[\"error\"][\"args\"][1];\n }", "function select() {\n\t\t$raw = shmop_read($this -> id, 0, $this -> size);\n\t\tif ($this -> raw === false) {\n\t\t\t$this -> val = unserialize($raw);\n\n\t\t} else {\n\t\t\t$i = strpos($raw, \"\\0\");\n\t\t\tif ($i === false) {\n\t\t\t\t$this -> val = $raw;\n\t\t\t}\n\t\t\t$this -> val = substr($raw, 0, $i);\n\n\t\t}\n\n\t\treturn $this -> val;\n\n\t}", "public function getSelectedElement() {\n $value = null;\n\n if(($selectedIndex = $this->getSelectedIndex()) >= 0) {\n $value = $this->model->getElementAt($selectedIndex);\n }\n\n return $value;\n }", "public function getSelectedIndex() {\n return wb_get_selected($this->controlID);\n }", "function getValNode(){\n\t\t$clase=$this->nmclass;\n\t\t$node=$this->anode;\n\t\t$valor=$this->nodos[$clase][$node];\n\n\t\tif($valor!=''){\n\t\t\treturn $valor;\n\t\t}\n\t\telse{\n\t\t\treturn -1;\n\t\t}\n\t}", "public function getSelectValue(Classes\\getSelectValueRequest $arg) {\n\t\treturn $this->makeSoapCall(\"getSelectValue\", $arg);\n\t}", "static function select_value($sql, $params = array()) {\n $sth = static::execute($sql, $params);\n\n $result = $sth->fetch();\n\n if ($result === false) {\n return null;\n } else {\n return array_shift($result);\n }\n }", "public function getSelect();", "public function getSelect();", "public function getSelected(){\n\t\tif(count($this->selected) == 0){\n\t\t\treturn false;\n\t\t}elseif(count($this->selected) == 1){\n\t\t\treturn $this->selected[0];\n\t\t}else{\n\t\t\t$options = array();\n\t\t\tforeach($this->selected as $key){\n\t\t\t\t$options[] = $this->options[$key];\n\t\t\t}\n\t\t\treturn $options;\n\t\t}\n\t}", "public function getSelection(): ?FilterValue\n {\n return $this->selection;\n }", "public function getSelection()\n {\n if( count($this->selection) === 0 ) {\n $this->setSelection();\n }\n return $this->selection;\n\n }", "public function getSelect() {\r\n return $this->_select;\r\n }", "function getValue() {\n\t\treturn $this->sValue;\n\t}", "function getValue(){\r\n\t\treturn $this->value;\r\n\t}", "public function getQSelo()\n {\n return $this->qSelo;\n }" ]
[ "0.6334542", "0.6334542", "0.63337886", "0.631297", "0.61618686", "0.6120975", "0.59983075", "0.59983075", "0.59582776", "0.57944804", "0.5782223", "0.5778463", "0.57723373", "0.57586753", "0.57356316", "0.5723842", "0.5657574", "0.5653187", "0.5647564", "0.5634387", "0.5616691", "0.5608677", "0.5608677", "0.5582794", "0.55611104", "0.5529978", "0.54929453", "0.5483302", "0.5480231", "0.5463788" ]
0.79327035
0
Get the value of nemotecnia.
public function getNemotecnia() { return $this->nemotecnia; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNiche_code () {\n\t$preValue = $this->preGetValue(\"niche_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->niche_code;\n\treturn $data;\n}", "public function getNValue() {}", "public function obtenerValor() {\n return $this->valor;\n }", "public function getNossoNumero();", "public function getNetValue()\n {\n return $this->netValue;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getNprcifecha()\n {\n return $this->nprcifecha;\n }", "function getValNode(){\n\t\t$clase=$this->nmclass;\n\t\t$node=$this->anode;\n\t\t$valor=$this->nodos[$clase][$node];\n\n\t\tif($valor!=''){\n\t\t\treturn $valor;\n\t\t}\n\t\telse{\n\t\t\treturn -1;\n\t\t}\n\t}", "public function getValue();", "public function getValue();" ]
[ "0.642976", "0.6421447", "0.6395026", "0.63858616", "0.6271816", "0.62452567", "0.62452567", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.62151086", "0.6212925", "0.6212925", "0.6212925", "0.6212925", "0.6212925", "0.62051094", "0.6163385", "0.61586785", "0.61586785" ]
0.6570487
0
Set the value of ultima_carga.
public function setUltimaCarga($ultima_carga) { $this->ultima_carga = $ultima_carga; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUltimaCarga()\n {\n return $this->ultima_carga;\n }", "public function setValor($valor)\n {\n $this->valor = $valor;\n }", "public function setEscalaValor( $escalaValor ){\n\t\t\t$this->escalaValor = $escalaValor ;\n\t\t}", "public function calidadImagen($valor){\r\n\t\tif ($valor>=0&&$valor<=100) {\r\n\t\t\t$this->calidadImagen=$valor;\r\n\t\t}else{\r\n\t\t\t$this->calidadImagen=100;\r\n\t\t}\r\n\t}", "public function setVida($valor){\n $this->vida=$valor;\n }", "public function SetIdConvocatoria($valor){\n\t\t $this->id_convocatoria= $valor;\n\t }", "public function setCarrera($carrera) {\n $this->carrera = $carrera;\n }", "function setSumarPais(){\n\t\t$this->cantidad_paises++;\n\t}", "private function cargarDatosValores(){\n\n\t\t$colaboradores = $this->user_model->getPagination(null);\n\n\t\tforeach ($colaboradores as $colaborador){\n\t\t\t\n\t\t\t$this->valores_model->create_actividades_mes($colaborador->id,1);\n\t\t\t\t$this->valores_model->create_actividades_mes($colaborador->id,2);\n\t\t\t\t\t$this->valores_model->create_actividades_mes($colaborador->id,3);\n\t\t\t\t\t\t$this->valores_model->create_actividades_mes($colaborador->id,4);\n\t\t\t\t\t\t\t$this->valores_model->create_actividades_mes($colaborador->id,5);\n\t\t\t\t\t\t\t\t$this->valores_model->create_actividades_mes($colaborador->id,6);\n\t\t}\n\t}", "public function cortesia()\n {\n $this->costo = 0;\n }", "public function setMontacargasC($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->montacargas_c !== $v) {\n $this->montacargas_c = $v;\n $this->modifiedColumns[] = MontacargasPeer::MONTACARGAS_C;\n }\n\n\n return $this;\n }", "protected function setVida() {\n $this->vida = 200;\n }", "public function otorgarPrestamo(){\n $fecha = date('d-m-y');\n $this->setFechaOtorgado($fecha);\n $cantidadCuotas = $this->getCantidadCuotas();\n $monto = $this->getMonto();\n $colObjCuota = array();\n for($i=0; $i<$cantidadCuotas; $i++){\n $montoCuota = $monto / $cantidadCuotas;\n $montoInteres = $this->calcularInteresPrestamo($i);\n $colObjCuota[$i] = new Cuota($i, $montoCuota, $montoInteres);\n }\n $this->setColObjCuota($colObjCuota);\n }", "public function setMontacargasCiclosiniciales($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (int) $v;\n }\n\n if ($this->montacargas_ciclosiniciales !== $v) {\n $this->montacargas_ciclosiniciales = $v;\n $this->modifiedColumns[] = MontacargasPeer::MONTACARGAS_CICLOSINICIALES;\n }\n\n\n return $this;\n }", "function setCausaleEvasione($codice)\n {\n $this->cauEvasione = $codice; \n }", "public static function calculaVenda()\n {\n Marca::query()->update([\n 'dataultimacompra' => null,\n 'itensabaixominimo' => null,\n 'itensacimamaximo' => null,\n 'vendabimestrevalor' => null,\n 'vendasemestrevalor' => null,\n 'vendaanovalor' => null,\n 'vendaanopercentual' => null,\n ]);\n\n // Monta classificacao ABC\n $totalvendaano_geral = Marca::sum('vendaanovalor');\n $totalvendaano = Marca::where('abcignorar', '=', false)->sum('vendaanovalor');\n $posicao = 0;\n $percentual_acumulado = 0;\n\n foreach (Marca::orderByRaw('vendaanovalor DESC NULLS LAST')->orderBy('marca', 'ASC')->get() as $marca) {\n $abccategoria = 0;\n $abcposicao = null;\n\n if (!$marca->abcignorar) {\n $posicao++;\n $abcposicao = $posicao;\n $percentual_acumulado += (($marca->vendaanovalor / $totalvendaano) * 100);\n if ($percentual_acumulado <= 20) {\n $abccategoria = 3;\n } elseif ($percentual_acumulado <= 50) {\n $abccategoria = 2;\n } elseif ($percentual_acumulado <= 90) {\n $abccategoria = 1;\n } else {\n $abccategoria = 0;\n }\n }\n\n $marca->update([\n 'abccategoria' => $abccategoria,\n 'abcposicao' => $abcposicao,\n 'vendaanopercentual' => (($marca->vendaanovalor / $totalvendaano_geral) * 100),\n ]);\n\n $afetados++;\n }\n\n return $afetados;\n }", "public function setFechaInicialAttribute($value)\n {\n return $this->attributes['fecha_inicial'] = date($this->setDateFormatTarifasVehiculo,strtotime(Carbon::createFromFormat('d/m/Y', $value)->toDateTimeString()));\n }", "public function setValorAttribute($value)\n {\n $this->attributes['valor'] = str_replace(\",\", \".\", str_replace(\".\", \"\", $value));\n }", "public function setCargaMaxima($cargaMaxima)\n {\n $this->cargaMaxima = $cargaMaxima;\n\n return $this;\n }", "public function setFechaCargueAttribute($value)\n {\n $string_date = ($value instanceof DateTime) ? $value->format('Y-m-d') : $value;\n $this->attributes['fecha_cargue'] = date('Y-m-d', strtotime($string_date === NULL ? '' : $string_date));\n }", "function carregaValors($id,$autor){\t\r\n\t\t\t\t$this->set_aut_idautor($id);\r\n\t\t\t\t$this->set_aut_autor($autor);\r\n\t\t}", "protected function calidadImagenDefaut(){\r\n\t\t$this->calidadImagen=100;\r\n\t}", "function setComprobantePagoARegistroPago() {\n\t\tglobal $bd;\t\t\n\t\tglobal $x_correlativo_comprobante;\n\t\t$correlatico_comprobante = $x_correlativo_comprobante;\n\t\t$x_array_comprobante = $_POST['p_comprobante'];\n\t\t$id_registro_pago = $_POST['idregistro_pago'];\n\n\t\t$idtipo_comprobante_serie = $x_array_comprobante['idtipo_comprobante_serie'];\n\t\t\n\t\t$sqlrp=\"update registro_pago set idtipo_comprobante_serie=\".$idtipo_comprobante_serie.\" where idregistro_pago=\".$id_registro_pago;\n\t\t$idregistro_pago=$bd->xConsulta_NoReturn($sqlrp);\n\t}", "public function setdia_semana($valor)\n {\n if (($valor <= 0) || ($valor > 7)) :\n echo \"Tentou atribuir {$valor} para dia da semana!\";\n die();\n endif;\n\n $this->data['dia_semana'] = $valor;\n }", "function asignar_valores(){\n\t\t$this->tabla=$_POST['tabla'];\n\t\t$this->pertenece=$_POST['pertenece'];\n\t\t$this->asunto=$_POST['asunto'];\n\t\t$this->descripcion=$_POST['contenido'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->hora=$_POST['hora'];\n\t\t$this->fechamod=$_POST['fechamod'];\n\t}", "public function getCargaMaxima()\n {\n return $this->cargaMaxima;\n }", "public function setPaginaAtual($pagina){\n $this->PaginaAtual = $pagina;\n }", "public function setValoracion($valoracion) {\n if($valoracion > 0 && $valoracion <= 10 ){\n $this->valoracion = $valoracion;\n return true;\n } else {\n return false;\n }\n }", "public function setVoti(float $voto){\n if($voto>2 && $voto <= 10 ){\n \n $this->voti[] = $voto;\n \n } else {\n\n $messaggio = new Exception(\"Il valore $voto è errato\");\n throw $messaggio;\n\n }\n }", "function asignar_valores3(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t\n\t\t$this->id=$_POST['id'];\n\t\t$this->temporada=$_POST['temporada'];\n\t\t$this->nombre=$_POST['nombre_plan'];\n\t\t$this->descripcion=$_POST['descripcion_plan'];\n\t\t$this->precio=$_POST['precio_plan'];\n\t\t$this->maxadultos=$_POST['maxadultos'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->mostrar=$_POST['publica'];\n\t\t\n\t}" ]
[ "0.63314986", "0.5678584", "0.560267", "0.5431688", "0.5347435", "0.5326011", "0.52876127", "0.52784324", "0.5265703", "0.52637476", "0.52577883", "0.5199346", "0.5178404", "0.5173059", "0.5168489", "0.5159841", "0.51488596", "0.5134402", "0.507958", "0.50773853", "0.5051547", "0.503703", "0.5028941", "0.5016078", "0.50037247", "0.49890754", "0.4978136", "0.49694055", "0.49641532", "0.4960184" ]
0.7261275
0
Get the value of ultima_carga.
public function getUltimaCarga() { return $this->ultima_carga; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCargaMaxima()\n {\n return $this->cargaMaxima;\n }", "public function setUltimaCarga($ultima_carga)\n {\n $this->ultima_carga = $ultima_carga;\n\n return $this;\n }", "public function getValorUltimaReavaliacao() {\n\n if ($this->getTotalDeReavaliacoes() > 0) {\n\n $oDaoReavaliacaoBem = db_utils::getDao(\"inventariobem\");\n\n $sWhere = \"t77_bens = {$this->getCodigoBem()} and \";\n $sWhere .= \"t75_situacao = 3 \";\n $sOrder = \"t75_dataabertura desc limit 1\";\n\n $sSqlReavaliacaoBem = $oDaoReavaliacaoBem->sql_query_inventario(null,\n \"(t77_valordepreciavel +\n t77_valorresidual) as valor \",\n $sOrder,\n $sWhere\n );\n\n $rsReavaliacaoBem = $oDaoReavaliacaoBem->sql_record($sSqlReavaliacaoBem);\n if ($oDaoReavaliacaoBem->numrows == 1) {\n return db_utils::fieldsMemory($rsReavaliacaoBem, 0)->valor;\n }\n } else {\n return $this->getValorAquisicao();\n }\n }", "public function getMontacargasC()\n {\n\n return $this->montacargas_c;\n }", "public function getValor(){\n return $this->_data['valor'];\n }", "public function getValoracion() {\n return $this->valoracion;\n }", "public function getSalarioMinimoAtual(){\r\n\t $aux = $this->getAll([\"status=1\"]);\r\n\t return $aux[0]->valor;\r\n\t}", "public function ultimoRegistro() {\n \n //FUNCION CON LA CONSULTA A REALIZAR\n $sql = \"SELECT MAX(MAQUICODIGO) AS CODIGO FROM MAQUINA\";\n $this->_conexion->ejecutar_sentencia($sql);\n return $this->_conexion->retorna_select();\n \n }", "public function gerencial_valorInventario(){\n\t\t\n\t\t$resultado = 0;\n\t\t\n\t\t$query = \"SELECT cantidad, idProducto\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_productos_sucursal\";\n\t\t\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n \tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n \t\n\t\t\t\t$idproducto = $filas['idProducto'];\n\t\t\t\t$cantidad\t= $filas['cantidad']; \n\t\t\t\t\n\t\t\t\t$query2 = \"SELECT precio \n\t\t\t\t\t\t\tFROM tb_productos WHERE idProducto = '$idproducto'\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($res2 = $conexion->query($query2)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t while ($filas2 = $res2->fetch_assoc()) {\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t$precio = str_replace('.', '',$filas2['precio']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$subtotal = $precio * $cantidad;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $resultado = $resultado + $subtotal;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\n } \n \n }//fin if\n\t\t\n return $resultado;\t\n\t\t\n\t}", "public function calcularValorLlamada();", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValorParcela()\n {\n return $this->valorParcela;\n }", "function get_convocatoria_actual_otro(){\n $actual=date('Y-m-d');\n $anio_actual= date(\"Y\", strtotime($actual));\n \n $sql=\"select id_conv from convocatoria_proyectos \"\n .\" where fec_inicio<='\".$actual.\"' and fec_fin >='\".$actual.\"'\"\n . \" and id_tipo=2\";\n $resul=toba::db('designa')->consultar($sql);\n if(count($resul)>0){\n return $resul[0]['id_conv'];\n }else \n return null;\n }", "public function getEscalaValor( ){\n\t\t\treturn $this->escalaValor;\n\t\t}", "public function obtenerValor() {\n return $this->valor;\n }", "public function getValorVenta()\n {\n return $this->valorVenta;\n }", "public function getValorInventario()\n {\n return $this->valorInventario;\n }", "public function ultimoProduto()\n {\n //$conexao = $c->conexao();\n\n $query = \"SELECT max(id)id FROM tbproduto c;\";\n $query = $this->conexao->query($query);\n $row = $query->fetch_assoc();\n\n return $row;\n }", "public function get_valor() {\n\t\t\n\t\t$dato = self::get_dato();\n\t\t/*\n\t\t$separator = ' , ';\n\t\tif($this->modo=='list') $separator = '<br>';\n\n\t\tif (is_array($valor)) {\n\t\t\t# return \"Not string value\";\n\t\t\t$string \t= '';\n\t\t\t$n \t\t\t= count($valor);\n\t\t\tforeach ($valor as $key => $value) {\n\n\t\t\t\tif(is_array($value)) $value = print_r($value,true);\n\t\t\t\t$string .= \"$key : $value\".$separator;\n\t\t\t}\n\t\t\t$string = substr($string, 0,-4);\n\t\t\treturn $string;\n\n\t\t}else{\n\t\t\t\n\t\t\treturn $valor;\n\t\t}\n\t\t*/\n\t\tif(isset($dato['counter'])) {\n\t\t\t$valor = $this->tipo.'-'.$dato['counter'];\n\t\t}else{\n\t\t\t$valor = $this->tipo;\n\t\t}\n\n\t\treturn $valor;\n\t}", "public function getValorInicial() {\n return $this->nValorInicial;\n }", "public function getValorLancar(){\n return $this->nValorLancar;\n }", "public function getCittaArrivo() {\n if (isset($_REQUEST['citta_arrivo'])) {\n return $_REQUEST['citta_arrivo'];\n } else\n return 0;\n }", "public function getCambio($moneda, $fecha){\n\n $sql = \"SELECT tc.TIPCAMC_FactorConversion FROM cji_tipocambio tc WHERE tc.TIPCAMC_Fecha BETWEEN '$fecha 00:00:00' AND '$fecha 23:59:59' AND tc.COMPP_Codigo = $this->compania AND tc.TIPCAMC_MonedaDestino = '$moneda'\";\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows() > 0){\n $tasa = $query->result();\n return $tasa[0]->TIPCAMC_FactorConversion;\n }\n else\n return 0;\n }", "public function pegaUm()\n\t{\n\t\t// return mysqli_fetch_assoc($this->resultado);\n\t\treturn $this->resultado->fetch(PDO::FETCH_ASSOC);\n\t}", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "function get_convocatoria_actual($tipo){\n $actual=date('Y-m-d');\n $anio_actual= date(\"Y\", strtotime($actual));\n switch ($tipo) {\n case 3:$id_tipo=1;//3 es reco\n break;\n default:$id_tipo=2;\n break;\n }\n $sql=\"select id_conv from convocatoria_proyectos \"\n //. \" where anio=$anio_actual and id_tipo=$id_tipo\";\n .\" where fec_inicio<='\".$actual.\"' and fec_fin >='\".$actual.\"'\"\n . \" and id_tipo=$id_tipo\";\n $resul=toba::db('designa')->consultar($sql);\n if(count($resul)>0){\n return $resul[0]['id_conv'];\n }else \n return null;\n }", "public function ultimaTerritorial()\n {\n $query = \"SELECT id_territorial,nombre_territorial FROM `territorial` ORDER BY `territorial`.`id_territorial` DESC LIMIT 1\";\n $result = mysqli_query($this->link, $query);\n $data = array();\n while ($data[] = mysqli_fetch_assoc($result));\n array_pop($data);\n return $data;\n }", "public function getValor_moeda()\n {\n return $this->valor_moeda;\n }", "public function get_valor() {\n\t\t\n\t\t$ar_list_of_values\t= $this->get_ar_list_of_values();\n\t\t$dato \t\t\t\t= $this->get_dato();\n\t\t\n\t\tif (is_array ($ar_list_of_values)) foreach ($ar_list_of_values as $value => $rotulo) {\n\t\t\t\t\t\t\t\t\t\n\t\t\tif( $dato == $value ) {\n\t\t\t\t\n\t\t\t\t$this->valor = $rotulo; \n\t\t\t\t\n\t\t\t\treturn $this->valor;\n\t\t\t}\n\t\t\t#echo \"<br> - $dato - $value => $rotulo \";\n\t\t}\t\t\t\t\t\n\t}" ]
[ "0.6484742", "0.63590187", "0.6262433", "0.6255732", "0.62440497", "0.6213362", "0.61570513", "0.6125437", "0.59932", "0.5942775", "0.59411466", "0.59411466", "0.5938758", "0.59313446", "0.59239733", "0.58884555", "0.587881", "0.586586", "0.5861279", "0.5818288", "0.5779129", "0.5764804", "0.5750299", "0.5748103", "0.5731696", "0.57223123", "0.57162285", "0.5690377", "0.56773734", "0.565877" ]
0.81332225
0
Set the value of obstaculos.
public function setObstaculos($obstaculos) { $this->obstaculos = $obstaculos; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getObstaculos()\n {\n return $this->obstaculos;\n }", "public function setObservacionesAttribute($value)\n\t{\n\t\t$this->attributes['observaciones'] = mb_strtoupper($value);\n\t}", "public function setObservacao( $observacao )\n {\n \t$this->observacao = $observacao;\n }", "function setObservaciones($observaciones) {\r\n $this->observaciones = $observaciones;\r\n }", "public function setObservacao($sObservacao){\n $this->sObservacao = $sObservacao;\n }", "public function mudarStatus(){\n //CO_STATUS = 5 se refere ao caso clinico Disponivel na base publica\n\n //busca e atualiza todos os casos clinicos que tenham CO_STATUS = 4 para o CO_STATUS = 5\n CasoClinico::where('CO_STATUS', '=', 4)->update(['CO_STATUS' => '5']);\n }", "function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}", "public function cortesia()\n {\n $this->costo = 0;\n }", "public function setCot_observaciones($cot_observaciones){\n $this->cot_observaciones = $cot_observaciones;\n }", "public function updating(AreaConhecimento $area_conhecimento)\n {\n $area_conhecimento->ativo = $area_conhecimento->ativo ?? 0;\n }", "public function setIntentos($intentos){\n $this->intentos = $intentos;\n }", "public function setByPosition($pos, $value)\n\t{\n\t\tswitch($pos) {\n\t\t\tcase 0:\n\t\t\t\t$this->setCoEquipo($value);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$this->setCoRegion($value);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->setCoNegocio($value);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->setCoDivision($value);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$this->setCoTipo($value);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$this->setCoCustodio($value);\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$this->setTxEtiquetaSti($value);\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\t$this->setCoEstado($value);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$this->setTxNombreEquipo($value);\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\t$this->setTxFunsionEquipo($value);\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\t$this->setCoSo($value);\n\t\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\t\t$this->setTxEtiquetaActivo($value);\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\t\t$this->setTxSerialHardware($value);\n\t\t\t\tbreak;\n\t\t\tcase 13:\n\t\t\t\t$this->setTxMarcaHardware($value);\n\t\t\t\tbreak;\n\t\t\tcase 14:\n\t\t\t\t$this->setTxModeloHardware($value);\n\t\t\t\tbreak;\n\t\t\tcase 15:\n\t\t\t\t$this->setCoCiudad($value);\n\t\t\t\tbreak;\n\t\t\tcase 16:\n\t\t\t\t$this->setCoEdificio($value);\n\t\t\t\tbreak;\n\t\t\tcase 17:\n\t\t\t\t$this->setTxDireccionUbicacion($value);\n\t\t\t\tbreak;\n\t\t\tcase 18:\n\t\t\t\t$this->setTxDetalleUbicacion($value);\n\t\t\t\tbreak;\n\t\t\tcase 19:\n\t\t\t\t$this->setCoCentroDato($value);\n\t\t\t\tbreak;\n\t\t\tcase 20:\n\t\t\t\t$this->setCoRack($value);\n\t\t\t\tbreak;\n\t\t\tcase 21:\n\t\t\t\t$this->setTxUbicacionLlave($value);\n\t\t\t\tbreak;\n\t\t\tcase 22:\n\t\t\t\t$this->setInRespaldoAutomatizado($value);\n\t\t\t\tbreak;\n\t\t\tcase 23:\n\t\t\t\t$this->setInBloqueoInactividad($value);\n\t\t\t\tbreak;\n\t\t\tcase 24:\n\t\t\t\t$this->setInAdiministradoresPersonalizados($value);\n\t\t\t\tbreak;\n\t\t\tcase 25:\n\t\t\t\t$this->setInPoliticaPassword($value);\n\t\t\t\tbreak;\n\t\t\tcase 26:\n\t\t\t\t$this->setInSincronizacionReloj($value);\n\t\t\t\tbreak;\n\t\t\tcase 27:\n\t\t\t\t$this->setInMonitoreado($value);\n\t\t\t\tbreak;\n\t\t\tcase 28:\n\t\t\t\t$this->setInInfActualizada($value);\n\t\t\t\tbreak;\n\t\t\tcase 29:\n\t\t\t\t$this->setInLogActivo($value);\n\t\t\t\tbreak;\n\t\t\tcase 30:\n\t\t\t\t$this->setCoNivelCriticidad($value);\n\t\t\t\tbreak;\n\t\t\tcase 31:\n\t\t\t\t$this->setTxObservaciones($value);\n\t\t\t\tbreak;\n\t\t\tcase 32:\n\t\t\t\t$this->setTxRutaRespaldoConfiguraciones($value);\n\t\t\t\tbreak;\n\t\t\tcase 33:\n\t\t\t\t$this->setCoNumInventario($value);\n\t\t\t\tbreak;\n\t\t} // switch()\n\t}", "function setSorpresa($_caja){\r\n $this->sorpresa=$_caja;\r\n }", "function __set($modelo, $valor)\n\t{\n\t\t$this->modelo = $modelo;\n\t}", "public function setOrganizations(?int $value): void {\n $this->getBackingStore()->set('organizations', $value);\n }", "protected function setOpcao($sNome, $mValor) \r\n\t{\r\n\t\t$this->aOpcoes[$sNome] = $mValor;\r\n\t}", "public function updateAtivo(Patrocinio $Patrocinio) {\n $conn = $this->conex->connectDatabase();\n if($Patrocinio->getStatus()==\"0\"){\n $Patrocinio->setStatus(\"1\");\n }\n else {\n $Patrocinio->setStatus(\"0\");\n }\n //Query de update\n $sql = \"update tbl_patrocinio set ativo=? where id_patrocinio=?\";\n $stm = $conn->prepare($sql);\n //Setando os valores\n $stm->bindValue(1, $Patrocinio->getStatus());\n $stm->bindValue(2, $Patrocinio->getId());\n //Executando a query\n $stm->execute();\n $this->conex->closeDataBase();\n }", "public function setPrejuizos_Acumulados($object){\n\t\tif($object->getrelacao_cr_db()->getCr() == '2.3.3.02') {\n\t\t\t$this->Prejuizos_Acumulados -= $object->getvalor();\n\t\t}\n\t\t\n\t\t// Debita no prejuizos acumulados.\n\t\tif($object->getrelacao_cr_db()->getDb() == '2.3.3.02') {\n\t\t\t$this->Prejuizos_Acumulados += $object->getvalor();\n\t\t}\n\t}", "function setSumarPais(){\n\t\t$this->cantidad_paises++;\n\t}", "public function setEmprestimos_Bancarios($object){\n\t\tif(substr($object->getrelacao_cr_db()->getCr(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios += $object->getvalor();\n\t\t}\n\t\t\n\t\t// Debita do emprestimo (Efetua o pagamento total ou parcial do emprestimo).\n\t\tif(substr($object->getrelacao_cr_db()->getDb(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios -= $object->getvalor();\n\t\t}\n\t}", "public function setByPosition($pos, $value)\n\t{\n\t\tswitch($pos) {\n\t\t\tcase 0:\n\t\t\t\t$this->setCoParticipante($value);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$this->setCoUsuarioElabora($value);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->setCoForense($value);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->setCoInformeRecomendaciones($value);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$this->setCoInformeIncidente($value);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$this->setCoInformeForense($value);\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$this->setCoInformeDepuracion($value);\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\t$this->setCoMantenimiento($value);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$this->setCoDoumentoNormativo($value);\n\t\t\t\tbreak;\n\t\t} // switch()\n\t}", "public function setTxObservaciones($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->tx_observaciones !== $v) {\n\t\t\t$this->tx_observaciones = $v;\n\t\t\t$this->modifiedColumns[] = C060InventarioPeer::TX_OBSERVACIONES;\n\t\t}\n\n\t\treturn $this;\n\t}", "function setStato($status)\n {\n $this->stato = $status;\n }", "public function setCot_estado($cot_estado){\n $this->cot_estado = $cot_estado;\n }", "public function edit(){\n $carros = array();\n\n $nomes[] = 'Astra';\n $nomes[] = 'Caravan';\n $nomes[] = 'Ipanema';\n $nomes[] = 'Kadett';\n $nomes[] = 'Monza';\n $nomes[] = 'Opala';\n $nomes[] = 'Veraneio';\n\n $this->set('carros',$nomes);\n }", "function setRestarPais(){\n\t\t$this->cantidad_paises--;\n\t}", "public static function updateServizi()\n {\n //arrivano i servizi modificati\n if (isset($_REQUEST['update_servizi'])) {\n $_SESSION['update_servizi'] = $_REQUEST['update_servizi'];\n }\n // effettua la registrazione dell'azienda\n $update = UtenteFactory::updateServizi();\n if ($update == 1) {\n $_SESSION['errore'] = 6;\n } elseif ($update == 0) {\n $_SESSION['errore'] = 5;\n }\n $vd = new ViewDescriptor();\n $vd->setTitolo(\"SardiniaInFood: Profilo\");\n $vd->setLogoFile(\"../view/in/logo.php\");\n $vd->setMenuFile(\"../view/in/menu_modifica_profilo.php\");\n $vd->setContentFile(\"../view/in/azienda/modifica_servizi.php\");\n $vd->setErrorFile(\"../view/in/error_in.php\");\n $vd->setFooterFile(\"../view/in/footer_empty.php\");\n \n require_once '../view/Master.php';\n }", "public function setListar($value)\n\t{\n\t\t$this->listar = $value;\n\t}", "public function buscarObligaciones($valor) {\n return $this->conexionObligaciones->buscar($valor, \"CARNET\", \"ASC\");\n }", "public function setObservacion($Observacion)\r\n {\r\n $this->Observacion = $Observacion;\r\n\r\n return $this;\r\n }" ]
[ "0.6220983", "0.6162618", "0.59482956", "0.59216595", "0.5631759", "0.55945915", "0.5564325", "0.5384262", "0.5372312", "0.525373", "0.5240773", "0.5212396", "0.5153227", "0.5122069", "0.51148236", "0.51033217", "0.507673", "0.5052149", "0.50516367", "0.50332904", "0.5023979", "0.5021607", "0.5019468", "0.50168145", "0.49760956", "0.4958774", "0.49289423", "0.49147022", "0.49056637", "0.48721272" ]
0.6789048
0
Get the value of obstaculos.
public function getObstaculos() { return $this->obstaculos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCot_observaciones(){\n return $this->cot_observaciones;\n }", "public function getObservacao(){\n return $this->sObservacao;\n }", "protected function getOpcoes() \r\n\t{\r\n\t\treturn $this->aOpcoes;\r\n\t}", "public function getObservacao()\n {\n return $this->observacao;\n }", "public function getObservacion()\r\n {\r\n return $this->Observacion;\r\n }", "public function getCot_estado(){\n return $this->cot_estado;\n }", "public function getAtivo()\n {\n return $this->ativo;\n }", "public function getAtivo()\n {\n return $this->ativo;\n }", "public function getAtivo()\n {\n return $this->ativo;\n }", "public function somarValores()\n {\n return $this->bd->sum($this->tabela, \"valor\");\n }", "public function buscarObligaciones($valor) {\n return $this->conexionObligaciones->buscar($valor, \"CARNET\", \"ASC\");\n }", "public function getVehiculosCreados()\n {\n return $this->vehiculosCreados;\n }", "public function getListadoObligacioness() {\n return $this->conexionObligaciones->listaLlaves(\"CARNET\", \"ASC\");\n }", "public function getOCUPACION()\r\n {\r\n return $this->OCUPACION;\r\n }", "public function getAtivo()\n\t{\n\t\treturn $this->ativo;\n\t}", "private function verLoMasBuscado ()\r\n {\r\n $tags = new DiccionarioTag();\r\n return $tags->getLoMasBuscado();\r\n }", "public function get_valor() {\n\t\t\n\t\t$ar_list_of_values\t= $this->get_ar_list_of_values();\n\t\t$dato \t\t\t\t= $this->get_dato();\n\t\t\n\t\tif (is_array ($ar_list_of_values)) foreach ($ar_list_of_values as $value => $rotulo) {\n\t\t\t\t\t\t\t\t\t\n\t\t\tif( $dato == $value ) {\n\t\t\t\t\n\t\t\t\t$this->valor = $rotulo; \n\t\t\t\t\n\t\t\t\treturn $this->valor;\n\t\t\t}\n\t\t\t#echo \"<br> - $dato - $value => $rotulo \";\n\t\t}\t\t\t\t\t\n\t}", "public function getAtocom()\n {\n return $this->atocom;\n }", "public function getSectoreconomicoAccion()\n\t{\n\t\treturn $this->sectoreconomicoAccion;\n\t}", "public function getOpis()\n {\n return $this->opis;\n }", "public function getValue()\n {\n return $this->objects;\n }", "public function getcontrole_aulas()\n {\n return $this->controle_aulas;\n }", "public function getCosto()\n {\n return $this->costo;\n }", "public function setObstaculos($obstaculos)\n {\n $this->obstaculos = $obstaculos;\n\n return $this;\n }", "public function getSencillos()\n {\n return $this->sencillos;\n }", "function getObservaciones() {\r\n return $this->observaciones;\r\n }", "public function get_valor() {\n\t\t\n\t\t$dato = self::get_dato();\n\t\t/*\n\t\t$separator = ' , ';\n\t\tif($this->modo=='list') $separator = '<br>';\n\n\t\tif (is_array($valor)) {\n\t\t\t# return \"Not string value\";\n\t\t\t$string \t= '';\n\t\t\t$n \t\t\t= count($valor);\n\t\t\tforeach ($valor as $key => $value) {\n\n\t\t\t\tif(is_array($value)) $value = print_r($value,true);\n\t\t\t\t$string .= \"$key : $value\".$separator;\n\t\t\t}\n\t\t\t$string = substr($string, 0,-4);\n\t\t\treturn $string;\n\n\t\t}else{\n\t\t\t\n\t\t\treturn $valor;\n\t\t}\n\t\t*/\n\t\tif(isset($dato['counter'])) {\n\t\t\t$valor = $this->tipo.'-'.$dato['counter'];\n\t\t}else{\n\t\t\t$valor = $this->tipo;\n\t\t}\n\n\t\treturn $valor;\n\t}", "public function getProdutos()\n {\n return $this->produtos;\n }", "public function getValorInventario()\n {\n return $this->valorInventario;\n }", "public function getCittaArrivo() {\n if (isset($_REQUEST['citta_arrivo'])) {\n return $_REQUEST['citta_arrivo'];\n } else\n return 0;\n }" ]
[ "0.6479409", "0.6451691", "0.62739384", "0.617748", "0.61759734", "0.599547", "0.5985156", "0.5985156", "0.5985156", "0.59491277", "0.59355354", "0.59142995", "0.59053075", "0.5896911", "0.5872419", "0.58461213", "0.57853746", "0.57657754", "0.57656413", "0.57489264", "0.5746778", "0.574549", "0.5689673", "0.5680437", "0.563297", "0.5627372", "0.56173974", "0.559808", "0.55943334", "0.5575827" ]
0.79224384
0
Get the value of ruedas.
public function getRuedas() { return $this->ruedas; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRuedas(){\r\n\t\t\treturn $this->ruedas;\r\n\t\t}", "public function getRut()\n {\n return $this->rut;\n }", "public function getRut(): array\n {\n return $this->rut;\n }", "final public function getValue($rsq) {\n\n if (is_string($rsq)) {\n $rsq = $this->query($rsq);\n }\n\n if ($rsq) {\n $r = $this->getRow($rsq, 'num');\n return $r[0];\n }\n }", "public function getR() {\n return $this->y;\n }", "public function getTotalRawTime()\n {\n return floatval(\n round($this->start->diffInMinutes($this->end) / 60, 5)\n );\n }", "public function getValue()\n {\n return (float) $this->value;\n }", "public function getTotalValue(): float\n {\n return $this->totalValue;\n }", "public function getRun()\n {\n return array_sum($this->_totalTime);\n }", "public function getSum()\n {\n return array_sum($this->values);\n }", "private function getRadianValue(Measurement $angle): float\n {\n return $angle->convertTo(UnitAngle::radians())->value();\n }", "public function getRunAsArray()\n {\n return $this->_totalTime;\n }", "public function getresistanceValue()\n {\n return $this->value;\n }", "public function get_rainmeters() {\n\t\t//Returns true or false. Values are set in $rainmeters.\n\t\treturn $this->_get_rainmeters();\n\t}", "public function getRainUnit() {\n return $this->cRainUnit;\n }", "public function getDur() {\n\t\treturn $this->dur;\n\t}", "public function getRevenue()\n {\n $order = $this->checkoutSession->getLastRealOrder();\n\n return $order->getData('total_due');\n }", "public function get_valor() {\n\t\t\n\t\t$ar_list_of_values\t= $this->get_ar_list_of_values();\n\t\t$dato \t\t\t\t= $this->get_dato();\n\t\t\n\t\tif (is_array ($ar_list_of_values)) foreach ($ar_list_of_values as $value => $rotulo) {\n\t\t\t\t\t\t\t\t\t\n\t\t\tif( $dato == $value ) {\n\t\t\t\t\n\t\t\t\t$this->valor = $rotulo; \n\t\t\t\t\n\t\t\t\treturn $this->valor;\n\t\t\t}\n\t\t\t#echo \"<br> - $dato - $value => $rotulo \";\n\t\t}\t\t\t\t\t\n\t}", "public function getTotalPracRechazadas() {\n return $this->totalPracRechazadas;\n }", "public function getSum(): float;", "public function getVal()\n {\n return $this->val_arr;\n }", "public function getUnitValue(): float\n\t{\n\t\treturn $this->unitValue;\n\t}", "public function getResult(): float\n {\n return $this->result;\n }", "public function getInputRainUnit() {\n return $this->cInputRainUnit;\n }", "public function get_uvmeters() {\n\t\t//Returns true or false. Values are set in $uvmeters.\n\t\treturn $this->_get_uvmeters();\n\t}", "public function somarValores()\n {\n return $this->bd->sum($this->tabela, \"valor\");\n }", "public function getRrAcquis(): ?float {\n return $this->rrAcquis;\n }", "public function getRtime() {\n\t\treturn $this->rtime;\n\t}", "public function getNValue() {}", "public function getResponseRateValue()\n {\n return isset($this->ResponseRateValue) ? $this->ResponseRateValue : null;\n }" ]
[ "0.6970173", "0.6071464", "0.5815043", "0.5787635", "0.55069786", "0.5465796", "0.53694826", "0.53281754", "0.53098536", "0.5300082", "0.529827", "0.5294834", "0.52669823", "0.52635026", "0.5217152", "0.5205744", "0.5175358", "0.5170617", "0.51068556", "0.5101553", "0.5100669", "0.50949687", "0.5087386", "0.5079746", "0.50706303", "0.50637656", "0.5063037", "0.5051036", "0.50288117", "0.50134706" ]
0.679418
1
Set the value of senalamientos.
public function setSenalamientos($senalamientos) { $this->senalamientos = $senalamientos; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSenalamientos()\n {\n return $this->senalamientos;\n }", "public function setKinoseiShokuhinAttribute($value) {\n \t$this->attributes['kinosei_shokuhin'] = implode(',', $value);\n }", "function setCli_senha($cli_senha) {\n //O md5 vai criptografar a senha\n //$this->cli_senha = md5($cli_senha); \n //$this->cli_senha = hash('SHA512', $cli_senha);// SHA512 e uma senha com 128 digitos\n $this->cli_senha = Sistema::Criptografia($cli_senha);\n \n \n }", "public function setSenha($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->senha !== $v) {\n\t\t\t$this->senha = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::SENHA;\n\t\t}\n\n\t\treturn $this;\n\t}", "function setSorpresa($_caja){\r\n $this->sorpresa=$_caja;\r\n }", "private function setSesion($usuario)\n {\n if( !$this->session->userdata('logged_in') ){\n $sesion = array(\n 'id' => $usuario->id,\n 'logged_in' => TRUE,\n 'ciudad' => $usuario->ciudad,\n 'UsuarioTipo_id' => $usuario->UsuarioTipo_id\n );\n if($sesion['UsuarioTipo_id']==5){\n $profesor = $this->m_profesores->getsalon($usuario->login);\n $sesion['salon'] = $profesor->salon;\n }\n $this->session->set_userdata($sesion);\n }\n }", "function setActa($sacta = '')\n {\n $this->sacta = $sacta;\n }", "function setActa($sacta = '')\n {\n $this->sacta = $sacta;\n }", "public function getSenha(){\n return $this->senha;\n }", "public function set_atletas_sexo($atletas_sexo) {\n if ($atletas_sexo != 'M' && $atletas_sexo != 'm') {\n $this->atletas_sexo = 'F';\n } else {\n $this->atletas_sexo = 'M';\n }\n }", "public function setSitoWeb($sito_web)\n\t\t{\n\t\t$this->sito_web = $sito_web;\n\t\t}", "public function setSalaire($salaire)\n {\n $this->salaire = $salaire;\n }", "public function sets(array $atributos){\n\t\tforeach ($atributos as $atributo=>$valor){\n\t\t\tswitch ($atributo){\n\t\t\t\tcase 'senha':\t $this->$atributo = sha1($_POST[$atributo]); break;\n\t\t\t\tdefault:\t\t $this->$atributo = $_POST[$atributo];break;\n\t\t\t}\n\t\t}\n\t}", "public function altSenha()\n {\n $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT);\n if (!empty($this->Dados['AltSenha']))\n {\n unset($this->Dados['AltSenha']);\n $altSenhaBd = new \\App\\adms\\Models\\AdmsAlterarSenha();\n $altSenhaBd->altSenha($this->Dados);\n if ($altSenhaBd->getResultado()) {\n\n $UrlDestino = URLADM . 'ver-perfil/perfil';\n header(\"Location: $UrlDestino\");\n\n }\n else {\n\n $listarMenu = new \\App\\adms\\Models\\AdmsMenu();\n $this->Dados['menu'] = $listarMenu->itemMenu();\n\n $carregarView = new \\Core\\ConfigView(\"adms/Views/usuario/alterarSenha\", $this->Dados);\n $carregarView->renderizar();\n\n }\n\n }\n else {\n\n $listarMenu = new \\App\\adms\\Models\\AdmsMenu();\n $this->Dados['menu'] = $listarMenu->itemMenu();\n\n $carregarView = new \\Core\\ConfigView(\"adms/Views/usuario/alterarSenha\", $this->Dados);\n $carregarView->renderizar();\n\n\n }\n\n\n\n }", "function setSwimMeet($swimmeet)\r\n {\r\n $this->_swimmeet = $swimmeet ;\r\n }", "function setUsers($users) {\n if (is_array($users)) {\n $users = implode(',', $users);\n }\n $this->users = $users;\n }", "public function getSenha()\n {\n return $this->senha;\n }", "public function getSenha()\n {\n return $this->senha;\n }", "public function getSenha()\n {\n return $this->senha;\n }", "public function getSenha()\n {\n return $this->senha;\n }", "public function set() {\n if (!isset($_SESSION[\"session\"])) {\n show_404();\n }\n\n $respuesta = \"\";\n\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n if (isset($_POST[\"c1\"], $_POST[\"c2\"], $_POST[\"c3\"], $_POST[\"c4\"], $_POST[\"c5\"], $_POST[\"c6\"], $_POST[\"c7\"])) {\n\n\n #capturar datos \n $documento = $this->test_input($_POST[\"c1\"]);\n $nombre = $this->test_input($_POST[\"c2\"]);\n $rol = $this->test_input($_POST[\"c3\"]);\n $correo = $this->test_input($_POST[\"c4\"]);\n $contra = $this->test_input($_POST[\"c5\"]);\n $direccion = $this->test_input($_POST[\"c6\"]);\n $telefono = $this->test_input($_POST[\"c7\"]);\n\n //----------------------------------------------------\n #limpiarlos \n //----------------------------------------------------\n //---------------------------------------------------\n #comprobar que no se repita cedula y correo \n $objModelo = new UsuarioModelo();\n $resultado = $objModelo->comprobarDocCorreo($documento, $correo);\n if (count($resultado) > 0) {\n $respuesta = \"Error, Documento o Correo ya existen\";\n } else {\n #Guardar datos \n $respuesta = $objModelo->insert($documento, $nombre, $rol, $correo, $contra, $direccion, $telefono);\n if ($respuesta) {\n $respuesta = \"Usuario creado exitosamente\";\n }\n }\n \n }\n }\n\n #llenar array datos\n $datos[\"respuesta\"] = $respuesta;\n \n #llamar a la vista\n $this->load->view('plantillas/Cabecera');\n $this->load->view('back/UsuarioSet', $datos);\n $this->load->view('plantillas/Pie');\n }", "public function setSuelo_idsuelo($suelo_idsuelo){\n $this->suelo_idsuelo = $suelo_idsuelo;\n }", "function setAukstis($x) {\n $this->aukstis = $x; // privaciai reiksmei priskiriam kintamaji, kuris bus kazkuom pakeistas\n }", "public function getSenha()\n\t{\n\t\treturn $this->senha;\n\t}", "function set(Profesor $profesor){\n $parametrosSet=array();\n $parametrosSet['tel']=$profesor->getTelefono();\n $parametrosSet['nombre']=$profesor->getNombre();\n $parametrosSet['apellido']=$profesor->getApellido();\n $parametrosSet['clave']=$profesor->getClave();\n $parametrosSet['activo']=$profesor->getActivo();\n $parametrosSet['administrador']=$profesor->getAdministrador();\n $parametrosSet['email']=$profesor->getEmail();\n $parametrosWhere = array();\n $parametrosWhere['tel'] = $profesor->getTelefono();\n return $this->bd->update($this->tabla, $parametrosSet, $parametrosWhere);\n \n }", "public function setSearchKanyoAttribute($value) {\n \t$this->attributes['search_kanyo'] = implode(',', $value);\n }", "public function alterarSenhaAction() {\n \n $formSenha = new Form_Salao_Senha();\n $formSenha->submit->setLabel(\"Alterar Senha\");\n $this->view->form = $formSenha;\n \n if ($this->getRequest()->isPost() && $formSenha->isValid($this->getRequest()->getPost())) {\n \n $autenticacao_senha_atual = $formSenha->getValue(\"autenticacao_senha_atual\");\n $autenticacao_senha = $formSenha->getValue(\"autenticacao_senha\");\n $autenticacao_senha_repetir = $formSenha->getValue(\"autenticacao_senha_repetir\");\n \n if ($autenticacao_senha === $autenticacao_senha_repetir) {\n \n try {\n $modelAutenticacao = new Model_DbTable_Autenticacao();\n $adpter = $modelAutenticacao->getDefaultAdapter();\n $where = $adpter->quoteInto(\"autenticacao_email = ?\", Zend_Auth::getInstance()->getIdentity()->autenticacao_email);\n $update = array(\n 'autenticacao_senha' => md5($autenticacao_senha)\n );\n $modelAutenticacao->update($update, $where);\n \n $this->_helper->flashMessenger->addMessage(array(\n 'success' => 'Senha alterada com sucesso!'\n ));\n \n $this->_redirect('salao/');\n \n } catch (Exception $ex) {\n\n }\n \n } else {\n $this->_helper->flashMessenger->addMessage(array(\n 'danger' => 'A repetição da senha é diferente da senha digitada!'\n ));\n $this->_redirect('salao/config/alterar-senha');\n }\n \n }\n \n }", "public function setIdusuario($value){\n $this->idusuario = $value;\n }", "public function setTokenSenha($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->token_senha !== $v) {\n\t\t\t$this->token_senha = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::TOKEN_SENHA;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setProyectorMuteado( $muteado ) {\n $this->proyector_muteatu=$muteado;\n \n\tif($muteado){\n\t $this->proyector_pizarra->mutear();\n\t}else{\n\t $this->proyector_pizarra->desmutear();\n\t}\n\t$this->enviarComandoMute();\n //$this->activarPantalla();\n }" ]
[ "0.6566053", "0.59533155", "0.5923462", "0.58537394", "0.5829918", "0.56695664", "0.5499926", "0.5499926", "0.54376364", "0.538597", "0.53750044", "0.5349478", "0.5303382", "0.5302118", "0.5290931", "0.5275466", "0.52609384", "0.52609384", "0.52609384", "0.52609384", "0.5254595", "0.5213967", "0.5211533", "0.5200545", "0.5175772", "0.5172474", "0.5171452", "0.51672435", "0.51555485", "0.5154341" ]
0.67107004
0
Get the value of senalamientos.
public function getSenalamientos() { return $this->senalamientos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSenha(){\n return $this->senha;\n }", "public function getSenha()\n {\n return $this->senha;\n }", "public function getSenha()\n {\n return $this->senha;\n }", "public function getSenha()\n {\n return $this->senha;\n }", "public function getSenha()\n {\n return $this->senha;\n }", "public function getSenha()\n\t{\n\t\treturn $this->senha;\n\t}", "public function getTokenSenha()\n\t{\n\t\treturn $this->token_senha;\n\t}", "public function getSenhaAdmin(){\n\t\t\treturn $this-> senha_admin;\n\t\t}", "public function getSukunimi(){\n return $this->sukunimi;\n }", "public function getSenhaProfessor()\r\n {\r\n return $this->senhaProfessor;\r\n }", "public function use_obtener_sucursal_actual(){\n $sucursal_actual = $this->ci->session->userdata('sucursal');//sucursal_id sid\n $usuario = $this->ci->arixkernel->select_one_content('numero, nombre','config.sucursales', array('sucursal_id' => $sucursal_actual));\n return $usuario;\n }", "public function getSuelo_idsuelo(){\n return $this->suelo_idsuelo;\n }", "public function getToiletSiswaPerempuan()\n {\n return $this->toilet_siswa_perempuan;\n }", "public static function getSeniorStaff(){\n $senior = YumUser::model()->findAll('id IN (1,8,11)');\n return CHtml::listData($senior, 'id', 'username');\n }", "public function getSalaire()\n {\n return $this->salaire;\n }", "public function getSalaire()\n {\n return $this->salaire;\n }", "public function getSucursal()\n {\n return $this->sucursal;\n }", "public function valorpasaje();", "public function getAMelibatkanSanitasiSiswa()\n {\n return $this->a_melibatkan_sanitasi_siswa;\n }", "function getSorpresa(){\r\n return $this->sorpresa;\r\n }", "public function getSECUENCIAL()\r\n {\r\n return $this->SECUENCIAL;\r\n }", "public function poliSesuaiJadwal()\n {\n $poliTujuan = JadwalDokter::where('kd_poli',$this->kodePoli())->where('hari_kerja', $this->dayToHari())->first();\n $poliSesuaiJadwal = $poliTujuan->poli['nm_poli'];\n return $poliSesuaiJadwal;\n }", "private function socioLoguedo()\n {\n $socio = Auth()->user()->Socio;\n // STRTPUPPER - Transforma un string A mayusciula\n $patrocinador = strtoupper($socio->nombresSocio . ' ' . $socio->apellidoPaternoSocio . ' ' . $socio->apellidoMaternoSocio);\n return $patrocinador;\n }", "public function getSalons()\r\n {\r\n return $this->salons;\r\n }", "public function getSens() {\n return $this->sens;\n }", "public function getStamina()\n {\n return $this->getXml()->getElementsByTagName('StaminaSkill')->item(0)->nodeValue;\n }", "public function getAsientos(){ return $this->asientos;}", "public function getNombre_sala()\n {\n return $this->nombre_sala;\n }", "public function getAKemitraanSanSwasta()\n {\n return $this->a_kemitraan_san_swasta;\n }", "public function getTIPO_SANGUINEO()\r\n {\r\n return $this->TIPO_SANGUINEO;\r\n }" ]
[ "0.7195093", "0.7119711", "0.7119711", "0.7119711", "0.7119711", "0.7076725", "0.6382938", "0.6368121", "0.6317262", "0.6264009", "0.61144257", "0.59345067", "0.5910968", "0.59104353", "0.58592665", "0.58592665", "0.5832153", "0.5811388", "0.5780429", "0.57673883", "0.5733344", "0.5716495", "0.57158697", "0.5707419", "0.56909066", "0.56867474", "0.5675875", "0.56729686", "0.5616387", "0.5584287" ]
0.78849196
0
Set the value of danos.
public function setDanos($danos) { $this->danos = $danos; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDados($d){\n\t\t$this->dados = $d;\n\t}", "protected function setVida() {\n $this->vida = 200;\n }", "public function setVida($valor){\n $this->vida=$valor;\n }", "public function setInstance(DobleOS $os);", "protected function doSet($value)\n {\n }", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "public function setValorDiaria($valorDiaria)\n {\n $this->valorDiaria = $valorDiaria;\n\n \n\n }", "public function setNerve($value)\n {\n $this->nerve = $value;\n }", "function setSoporte($soporte) {\r\n $this->soporte = $soporte;\r\n }", "public function setValue($value)\n {\n $value = arr::get($value, 'value', NULL);\n\n if ($value !== NULL)\n {\n //pokud prisla prazdna hodnota, tak do modelu ukladam NULL\n if (empty($value))\n {\n $value = NULL;\n }\n\n parent::setValue($value);\n }\n }", "function setValue($value) {\n $this->value = $value;\n }", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function getDanos()\n {\n return $this->danos;\n }", "public function setEdad($valor){\n\t\t\t$this->edad = $valor;\n\t\t}", "function setSuperada($bsuperada = 'f')\n {\n $this->bsuperada = $bsuperada;\n }", "public function setdia_semana($valor)\n {\n if (($valor <= 0) || ($valor > 7)) :\n echo \"Tentou atribuir {$valor} para dia da semana!\";\n die();\n endif;\n\n $this->data['dia_semana'] = $valor;\n }", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "public function setValue($value){\n $this->_value = $value;\n }" ]
[ "0.61246985", "0.60416", "0.59048545", "0.57893616", "0.5762632", "0.5621915", "0.56176287", "0.5563497", "0.5555149", "0.5554704", "0.55324835", "0.552063", "0.552063", "0.552063", "0.552063", "0.552063", "0.552063", "0.552063", "0.552063", "0.552063", "0.552063", "0.552063", "0.55206186", "0.55206186", "0.55005205", "0.5495994", "0.54942805", "0.5448756", "0.54243946", "0.5422619" ]
0.6355969
0
Get the value of danos.
public function getDanos() { return $this->danos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_valor() {\n\t\t\n\t\t$ar_list_of_values\t= $this->get_ar_list_of_values();\n\t\t$dato \t\t\t\t= $this->get_dato();\n\t\t\n\t\tif (is_array ($ar_list_of_values)) foreach ($ar_list_of_values as $value => $rotulo) {\n\t\t\t\t\t\t\t\t\t\n\t\t\tif( $dato == $value ) {\n\t\t\t\t\n\t\t\t\t$this->valor = $rotulo; \n\t\t\t\t\n\t\t\t\treturn $this->valor;\n\t\t\t}\n\t\t\t#echo \"<br> - $dato - $value => $rotulo \";\n\t\t}\t\t\t\t\t\n\t}", "public function getDyna()\n {\n return $this->get(self::_DYNA);\n }", "public function getDyna()\n {\n return $this->get(self::_DYNA);\n }", "public function getDyna()\n {\n return $this->get(self::_DYNA);\n }", "public function getDyna()\n {\n return $this->get(self::_DYNA);\n }", "public function getDyna()\n {\n return $this->get(self::_DYNA);\n }", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValor(){\n return $this->_data['valor'];\n }", "public function get_valor() {\n\t\t\n\t\t$dato = self::get_dato();\n\t\t/*\n\t\t$separator = ' , ';\n\t\tif($this->modo=='list') $separator = '<br>';\n\n\t\tif (is_array($valor)) {\n\t\t\t# return \"Not string value\";\n\t\t\t$string \t= '';\n\t\t\t$n \t\t\t= count($valor);\n\t\t\tforeach ($valor as $key => $value) {\n\n\t\t\t\tif(is_array($value)) $value = print_r($value,true);\n\t\t\t\t$string .= \"$key : $value\".$separator;\n\t\t\t}\n\t\t\t$string = substr($string, 0,-4);\n\t\t\treturn $string;\n\n\t\t}else{\n\t\t\t\n\t\t\treturn $valor;\n\t\t}\n\t\t*/\n\t\tif(isset($dato['counter'])) {\n\t\t\t$valor = $this->tipo.'-'.$dato['counter'];\n\t\t}else{\n\t\t\t$valor = $this->tipo;\n\t\t}\n\n\t\treturn $valor;\n\t}", "public function getValue();", "public function getValue();", "public function getValue();" ]
[ "0.63192356", "0.5875379", "0.5875379", "0.5875379", "0.5875379", "0.5875379", "0.58709145", "0.58709145", "0.58709145", "0.58709145", "0.58709145", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.58708566", "0.5851336", "0.58382523", "0.58287907", "0.58287907", "0.58287907" ]
0.70327616
0
A sub property of result. The review that resulted in the performing of the action.
public function resultReview($value) { $this->setProperty('resultReview', $value); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReviewstate() {}", "public function get_review() {\n return $this->targets;\n }", "public function getReview()\n {\n return $this->review;\n }", "public function _getReportedResult() {\n\t\treturn $this->_reportedResult;\n\t}", "public function getReviewText() : string {\n\t\treturn ($this->reviewText);\n\t}", "public function getTestResult()\n {\n return $this->_testResult;\n }", "private function reviewDestiny()\n {\n $this->setExpectations();\n return $this->reviewTicket();\n }", "public function getHumanReviewOperation()\n {\n return $this->human_review_operation;\n }", "public function _getTestResult1() {\n\t\treturn $this->_testResult1;\n\t}", "public function getRemarketingActionResult()\n {\n return $this->readOneof(43);\n }", "public function getResult()\n {\n return $this->information[ self::INFORMATION_RESULT ];\n }", "public function getReview(){\r\n\t\treturn $this->SupportReviews();\r\n\t}", "public function isReviewed() {\n\t\t$this->getReviewed();\n\t}", "public function getExplanation(){\n\t\treturn $this->_explanation;\n\t}", "public function _getTestResult2() {\n\t\treturn $this->_testResult2;\n\t}", "public function getResult()\n {\n if ( $this->analysisResult == null )\n {\n $this->analyze();\n }\n return $this->analysisResult;\n }", "private function evaluateThisResult($result, $data){\n\t\t\t//Test to make sure this result has everything we need.\n\n\t\t\tif(array_key_exists('action', $result)){\n\t\t\t\treturn (bool) $this->processResult($result, $data);\n\t\t\t} else {\n\t\t\t\treturn (bool) false;\n\t\t\t}\n\t\t}", "public function getModifyResult(){\n \n return $this->modify_result;\n \n }", "public function getExplanation() \n {\n return $this->explanation;\n }", "protected function getResult()\n {\n return $this->getOwningAnalyser()->getResult();\n }", "public function submitUserReview($result) {\n\t\t\treturn $this->submitReview($result, 0);\n\t\t}", "public function getLastReviewed()\n {\n return $this->lastReviewed;\n }", "public function getPotherinreview()\n {\n return $this->potherinreview;\n }", "public function getRESULT()\n {\n return $this->RESULT;\n }", "public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}", "public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}", "public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}", "public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}", "public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}", "public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}" ]
[ "0.61537766", "0.600622", "0.59492135", "0.585063", "0.57784796", "0.5736593", "0.5701577", "0.56882864", "0.5675858", "0.56165534", "0.5592192", "0.55617815", "0.5557047", "0.5548995", "0.5513296", "0.5498537", "0.5466284", "0.5455885", "0.54222786", "0.5401238", "0.5374018", "0.53537935", "0.53519195", "0.5341768", "0.5337705", "0.5337705", "0.5337705", "0.5337705", "0.5337705", "0.5337705" ]
0.6474481
0
/ numOfRows() Returns the number of rows in the result set
public function numOfRows();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNumberOfRows();", "public function getNumRows();", "abstract public function getNumRows();", "abstract public function getNumRows();", "public abstract function row_count();", "function RowCount() {}", "public function numberOfRows();", "public function numRows() : int\n\t{\n\t\treturn $this->handle->numRows($this->result);\n\t}", "function NumRows() {\n\t\t\t$result = pg_num_rows($this->result);\n\t\t\treturn $result;\n\t\t}", "public function nbRows();", "public function rowCount()\n {\n return sasql_num_rows($this->result);\n }", "public abstract function GetNumRows();", "function getNumRows() {\r\n\t\t\tif($this->privateVars['resultset']) {\r\n\t\t\t\tif(@mysql_num_rows($this->privateVars['resultset']))\r\n\t\t\t\t\treturn mysql_num_rows($this->privateVars['resultset']);\r\n\t\t\t}\r\n\t\t\treturn -1;\r\n\t\t}", "function getNRows() \n { \n if($this->rsQry)\n {\n return true;\n }\n else\n {\n\t\t\t return mysql_num_rows($this->rsQry);\n }\n\t\t}", "abstract public function NumRows();", "function nbrRows() {\n return mysqli_num_rows($this->result);\n }", "function numRows()\n{\n\t$num = mysql_num_rows($this->res);\n\treturn $num;\n}", "public function getNumberOfRows()\r\n {\r\n return count($this->data);\r\n }", "public function getNumRows() {\n\t\treturn $this->_num_rows;\n\t}", "public function numRows() {\n\t\treturn $this->sth->rowCount();\n\t}", "public function rowCount();", "public function rowCount();", "public function getRowCount();", "public function getNumRows(){\n return $this->numrows;\n }", "public function get_row_count() {\n return 0;\n }", "function numRows()\n\t{\n\t\treturn $this->_num_rows;\n\t}", "public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}", "public function num_rows() {\n\t\treturn $this->GetNumRows();\n\t}", "function numrows() {\r\n\t\treturn $this->numrows;\r\n\t}", "function numRows() {\n return mysqli_num_rows ( $this->result );\n }" ]
[ "0.8467592", "0.8438362", "0.82933563", "0.82933563", "0.8287429", "0.82380205", "0.81657565", "0.81405544", "0.80881983", "0.8080471", "0.80640894", "0.8006932", "0.8000376", "0.7993607", "0.79909974", "0.7953984", "0.7951945", "0.79403627", "0.7937833", "0.79354763", "0.79338825", "0.79338825", "0.79263747", "0.7921329", "0.7912094", "0.7899881", "0.7895393", "0.7891174", "0.7881588", "0.7878475" ]
0.86040455
0
/ numOfFields() Returns the number of fields in the result set
public function numOfFields();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function numFields();", "public function numberOfFields();", "function numFields( $res );", "public function getFieldCount(): int\n {\n return oci_num_fields($this->resultID);\n }", "function numFields() {\n return mysqli_num_fields($this->result);\n }", "abstract public function getNumFields();", "function num_fields()\n\t{\n\t\treturn sqlsrv_num_fields($this->result_id);\n\t}", "public function num_fields() {\r\n return $this->num_fields;\r\n }", "function num_fields() {\r\n\t\treturn $this->dbh->num_fields();\r\n\t}", "function sql_num_fields($res)\n {\n return $res->columnCount();\n }", "function num_fields()\r\n\t{\r\n\t\tif ( is_array($this->pdo_results) ) {\r\n\t\t\treturn sizeof($this->pdo_results[$this->pdo_index]);\r\n\t\t} else {\r\n\t\t\treturn $this->result_id->columnCount();\r\n\t\t}\r\n\t}", "public function num_fields($result){\r\n\t\treturn $result->FieldCount();\r\n\t}", "public function num_fields()\r\n {\r\n return $this->num_fields;\r\n }", "function num_fields()\n\t{\n\t\treturn @mysqli_num_fields($this->result_id);\n\t}", "public function fieldCount()\n {\n return sasql_num_fields($this->connection);\n }", "function numFields(){\r\n return mysql_num_fields($this->Query_ID);\r\n }", "public function getNumFields()\n {\n return count($this->fields);\n }", "public function testResultNumFields()\n {\n \t$this->assertEquals(4, $this->conn->query('SELECT * FROM test')->numFields());\n \t$this->assertEquals(2, $this->conn->query('SELECT id, title FROM test')->numFields(), 'SELECT id, title FROM test');\n }", "public abstract function field_count();", "function FieldCount()\n\t{\n\t\treturn $this->_numOfFields;\n\t}", "public abstract function GetFieldCount();", "function numFields()\n {\n return mysql_num_fields($this->Query_ID);\n }", "public function _pseudo_numberOfFields() {\n return count($this->data);\n }", "public function getFieldCount()\n {\n return count($this->_fields);\n }", "public function getFieldCount() {}", "function num_fields()\n\t{\n\t\treturn @mysqli_num_fields($this->m_query_idD);\n\t}", "public function getFieldsCount()\n {\n $count = @oci_num_fields($this->stmt_id);\n\n // if we used a limit we subtract it\n if ($this->limit_used) {\n $count = $count - 1;\n }\n\n return $count;\n }", "function num_fields($query)\n\t{\n\t\treturn $query->columnCount();\n\t}", "public function num_fields()\n {\n return @mysql_num_fields( $this->Query_ID );\n }", "public function count()\n {\n return count($this->fields);\n }" ]
[ "0.8743242", "0.85329366", "0.8400545", "0.82697624", "0.826751", "0.8245084", "0.8190738", "0.8164909", "0.8163658", "0.81093764", "0.8102634", "0.80893534", "0.80643666", "0.8063612", "0.8055661", "0.79489857", "0.7933238", "0.7895036", "0.7879514", "0.78679794", "0.78632665", "0.7844214", "0.77854216", "0.777894", "0.77408445", "0.7739102", "0.7661968", "0.7637185", "0.763514", "0.76031715" ]
0.8552307
1
/ fetchField() Returns the next field from the result set as an object, or NULL if empty.
public function fetchField();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FetchField($fieldOffset = -1) \n\t{\n\t\tif ($fieldOffset != -1) {\n\t\t\t$this->fieldmeta_offset = $fieldOffset;\n\t\t}\n\t\t$fieldObject = false;\n\t\t$i=0;\n\t\tforeach($this->fieldmeta as $o) {\n\t\t\tif($i==$this->fieldmeta_offset) {\n\t\t\t\t$fieldObject = $o;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\t$this->fieldmeta_offset++;\n\t\treturn $fieldObject;\n\t}", "public abstract function FetchField();", "function FetchField($off = 0)\n\t{\n\n\t\t$o= new ADOFieldObject();\n\t\t$o->name = @pg_field_name($this->_queryID,$off);\n\t\t$o->type = @pg_field_type($this->_queryID,$off);\n\t\t$o->max_length = @pg_fieldsize($this->_queryID,$off);\n\t\treturn $o;\n\t}", "public function fetchField($result = false, $offset = 0){\n $this->resCalc($result);\n return mysql_fetch_field($result, $offset);\n }", "function getNextField()\n {\n if ( $this->first_field )\n {\n $this->first_field = false;\n }\n else\n {\n next( $this->mapping ); // nirvana\n }\n\n $this->current_field = current( $this->mapping );\n return $this->current_field;\n }", "public function fetchRecord()\n {\n $ret = $this->readCurrentRecord();\n if ($ret !== false) {\n $this->next();\n }\n return $ret;\n }", "function getNextField()\r\n\t{\r\n\t\tif( $this->first_field )\r\n\t\t{\r\n\t\t\t$this->first_field = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tnext( $this->mapping ); // nirvana\r\n\t\t}\r\n\t\t\r\n\t\treturn current( $this->mapping );\r\n\t}", "public function fetch_object()\n\t{\n\t\t$object = null;\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$object->$key = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$object = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $object;\n\t}", "public static function fetchValue( $rRes, $mField = 0 ) {\n\t\tif ( is_resource( $rRes ) ) {\n\t\t\tmysql_data_seek( $rRes, 0 );\t\t\t// reset pointer\n\t\t\t$aRes = mysql_fetch_array( $rRes );\n\t\t\treturn $aRes[ $mField ];\n\t\t}\n\t\treturn NULL;\n\t}", "public function fetchField(){\n $this->debugBacktrace();\n $this->fetchType = \"fetch_field\";\n return $this;\n }", "function _fetch_object()\r\n\t{\r\n\t\tif ( is_array($this->pdo_results) ) {\r\n\t\t\t$i = $this->pdo_index;\r\n\t\t\t$this->pdo_index++;\r\n\t\t\tif ( isset($this->pdo_results[$i])) {\r\n\t\t\t\t$back = '';\r\n\t\t\t\tforeach ( $this->pdo_results[$i] as $key => $val ) {\r\n\t\t\t\t\t$back->$key = $val;\r\n\t\t\t\t}\r\n\t\t\t\treturn $back;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $this->result_id->fetch(PDO::FETCH_OBJ);\r\n\t}", "function sql_fetch_field($res,$offset = 0)\n {\n $results = array();\n $obj = NULL;\n $results = $res->getColumnMeta($offset);\n foreach($results as $key=>$value) {\n $obj->$key = $value;\n }\n return $obj;\n }", "function f($field) {\n\t\treturn($this->fetchfield($field));\n\t}", "function getNextRecord() { return mysql_fetch_array( $this->recordSet ); }", "function GetField($field=0){\n\t\t\treturn @mysql_result($this->result,0,$field);\n\t\t}", "public function fetchOne() {\r\n\t\t$data = $this->fetch();\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $data ? current($data) : null;\r\n\t}", "function FetchNextObj() {}", "public function field($fieldName = '') {\n if (!empty($fieldName)) {\n $this->currentField = $fieldName;\n }\n\n if (isset($this->fields[$this->currentField])) {\n return $this->fields[$this->currentField];\n } else {\n return null;\n }\n }", "function fetch() {\n\t\t$this->i++;\n\t\treturn $this->result->fetch_object($this->class_name);\n\t}", "function db_fetch_next_row( $fetch_mode = DB_FETCHMODE_ASSOC ) {\n\n $this->pm_clear_cols();\n if( ! is_object( $this->dataset_obj )) return NULL;\n\n $this->curr_row_array = $this->dataset_obj->fetchRow( $fetch_mode );\n $this->pm_die_if_error( 'curr_row_array' );\n\n if( is_array( $this->curr_row_array )) { # Some data was retrieved\n $this->curr_rowno++;\n $this->cols_in_curr_row = count( $this->curr_row_array );\n }\n\n return $this->curr_row_array;\n }", "public function getNextRow() {\n $row = mssql_fetch_object($this->result);\n\n // Might be totally out of data, or just out of this batch - request another\n // batch and see\n if (!is_object($row)) {\n mssql_fetch_batch($this->result);\n $row = mssql_fetch_object($this->result);\n }\n if (is_object($row)) {\n return $row;\n }\n else {\n return NULL;\n }\n }", "function next_record() {\r\n\t\treturn $this->dbh->next_record();\r\n\t}", "function field($dsstr)\n{\n\t$args = func_get_args();\n\t$sql = $this->getSelectSql($dsstr, $args);\n\t$this->setLimit(1);\n\t$res = $this->query($sql);\n\t$data = $this->drv->fetch($res, 'r');\n\tif (!$data) return null;\n\treturn $data[0];\n}", "public function next () {\n next($this->__fields);\n }", "public function next()\n\t{\n\t\tif (is_a($this->rs,'iterator'))\n\t\t{\n\t\t\treturn $this->rs->next();\n\t\t}\n\t}", "public function fetch_value($name=null)\n {\n $row = $this->fetch_one();\n\n if (!$row->is_empty())\n {\n if (!is_null($name))\n return $row->$name;\n\n return $row->values()->get(0);\n }\n\n return null;\n }", "function nextResult()\n {\n return $this->dbh->nextResult($this->result);\n }", "public function next()\n\t{\n\t\tif ( $this->_result instanceof MySQLi_Result )\n\t\t\treturn $this->_result->fetch_object();\n\t\treturn false;\n\t}", "function next_record()\n\t{\n\t\t/* goto next record */\n\t\t$this->m_record = @mysqli_fetch_array($this->m_query_id, MYSQLI_ASSOC|atkconfig(\"mysqlfetchmode\"));\n\t\t$this->m_row++;\n\t\t$this->m_errno = mysqli_errno($this->m_link_id);\n\t\t$this->m_error = mysqli_error($this->m_link_id);\n\n\t\t/* are we there? */\n\t\t$result = is_array($this->m_record);\n\t\tif (!$result && $this->m_auto_free)\n\t\t{\n\t\t\t@mysqli_free_result($this->m_query_id);\n\t\t\t$this->m_query_id = 0;\n\t\t}\n\n\t\t/* return result */\n\t\treturn $result;\n\t}", "#[\\ReturnTypeWillChange]\n public function next()\n {\n $value = $this->_skipNext ? current($this->_data) : next($this->_data);\n $this->_skipNext = false;\n return key($this->_data) !== null ? $value : null;\n }" ]
[ "0.7496154", "0.675565", "0.6707491", "0.6675682", "0.65372694", "0.64107037", "0.63174355", "0.621415", "0.61930716", "0.6185163", "0.6147772", "0.6116754", "0.6105757", "0.6096552", "0.60923636", "0.60837185", "0.6058451", "0.59946454", "0.59524673", "0.5939563", "0.592966", "0.59019506", "0.5894681", "0.58775145", "0.58714324", "0.58213645", "0.58029705", "0.57832056", "0.57828856", "0.57717335" ]
0.7033241
1
/ fetchFields() Returns an array with all the fields in the result set as objects. Returns an empty array if no more fields.
public function fetchFields();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fetchFields(){\n $fields = X3::db()->fetchFields($this->modelName);\n $_res = array();\n foreach($fields as $name=>$field){\n $dataType = X3_MySQL_Command::parseMySQLField($field);\n $_res[$name] = $dataType;\n }\n return $_res;\n }", "public function fetch_fields() {}", "public function fetchFields()\n {\n $field_names = array();\n for ($c = 1, $fieldCount = $this->getFieldsCount(); $c <= $fieldCount; $c++) {\n $field_names[] = oci_field_name($this->stmt_id, $c);\n }\n return $field_names;\n }", "protected function fetch_fields()\n {\n if(empty($this->table_fields))\n {\n $fields = $this->_database->list_fields($this->table);\n foreach ($fields as $field) {\n $this->table_fields[] = $field;\n }\n }\n }", "public function field_data()\n\t{\n\t\t$retval = array();\n\t\tfor ($c = 1, $fieldCount = $this->num_fields(); $c <= $fieldCount; $c++)\n\t\t{\n\t\t\t$F\t\t\t= new stdClass();\n\t\t\t$F->name\t\t= oci_field_name($this->stmt_id, $c);\n\t\t\t$F->type\t\t= oci_field_type($this->stmt_id, $c);\n\t\t\t$F->max_length\t\t= oci_field_size($this->stmt_id, $c);\n\n\t\t\t$retval[] = $F;\n\t\t}\n\n\t\treturn $retval;\n\t}", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function list_fields()\r\n {\r\n $field_names = array();\r\n $this->resultID->field_seek(0);\r\n while ($field = $this->resultID->fetch_field())\r\n {\r\n $field_names[] = $field->name;\r\n }\r\n\r\n return $field_names;\r\n }", "public function getAllFields();", "public function fetchFieldDefinitions()\n\t\t{\n\t\t\tif( $this->fieldDefinitions )\n\t\t\t{\n\t\t\t\treturn $this->fieldDefinitions;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * remember, the model classes return a mysql resource. in this case, it is the datasources\n\t\t\t * responsibility to act upon the resultset\n\t\t\t */\n\t\t\t$fieldDefinitions = $this->getIDatasourceModel()\n\t\t\t\t->getFieldDefinitions(); \n\n\t\t\t$count = 0;\n\n\t\t\t$fieldDefs = null;\n\t\t\twhile( $fd = mysql_fetch_object($fieldDefinitions) )\n\t\t\t{ \n\t\t\t\t$fieldDefs->{$fd->name} = $fd;\n\t\t\t\t//$count++;\n\t\t\t\t//$this->cout( DRED.\" --Now doing field Def number \" . $count .NC.CLEAR.CR );\n\t\t\t} \n\n\t\t\t//echo \"\\n\\n\";\n\t\t\t$this->setFieldDefinitions( $fieldDefs );\n\t\t\treturn $this->fieldDefinitions;\n\t\t}", "private function _fields() {\n if ($this->_table() && empty($this->fields)) {\n $this->fields = $this->db->list_fields($this->_table());\n }\n return $this->fields;\n }", "public function getAllFields() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$table\t\t\t= 'tb_field';\n\t\t\t$select_what\t= 'id, vc_field AS vc_name';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_field ASC\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function fields()\n {\n return array_map(\n function (array $field) {\n return Field::fromArray($field);\n },\n $this->client->get('field')\n );\n }", "public function getAllFields()\n {\n return $this->fields;\n }", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "public function getFieldData()\n {\n $retval = array();\n for ($c = 1, $fieldCount = $this->getFieldsCount(); $c <= $fieldCount; $c++) {\n $item = array();\n $item['name'] = oci_field_name($this->stmt_id, $c);\n $item['type'] = oci_field_type($this->stmt_id, $c);\n $item['max_length'] = oci_field_size($this->stmt_id, $c);\n $retval[] = $item;\n }\n\n return $retval;\n }", "public function getFields() {\n $field = $this->get('field');\n return null !== $field ? $field : array();\n }", "private function fetchFields($selectStmt)\n {\n $metadata = $selectStmt->result_metadata();\n $fields_r = array();\n while ($field = $metadata->fetch_field()) {\n $fields_r[] = $field->name;\n }\n\n return $fields_r;\n }", "function field_data()\n\t{\n\t\t$retval = array();\n\t\tforeach(sqlsrv_field_metadata($this->result_id) as $offset => $field)\n\t\t{\n\t\t\t$F \t\t\t\t= new stdClass();\n\t\t\t$F->name \t\t= $field['Name'];\n\t\t\t$F->type \t\t= $field['Type'];\n\t\t\t$F->max_length\t= $field['Size'];\n\t\t\t$F->primary_key = 0;\n\t\t\t$F->default\t\t= '';\n\t\t\t\n\t\t\t$retval[] = $F;\n\t\t}\n\t\t\n\t\treturn $retval;\n\t}", "public function getListFields();", "function field_data()\n\t{\n\t\t$retval = array();\n\t\twhile ($field = mysqli_fetch_field($this->result_id))\n\t\t{\n\t\t\t$F\t\t\t\t= new stdClass();\n\t\t\t$F->name\t\t= $field->name;\n\t\t\t$F->type\t\t= $field->type;\n\t\t\t$F->default\t\t= $field->def;\n\t\t\t$F->max_length\t= $field->max_length;\n\t\t\t$F->primary_key = ($field->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0;\n\n\t\t\t$retval[] = $F;\n\t\t}\n\n\t\treturn $retval;\n\t}", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.invoice.fields'\n );\n return $fullResult;\n }", "public function getFields(): array;", "public function getFields(): array;" ]
[ "0.79335904", "0.7516208", "0.73847646", "0.73021424", "0.6980072", "0.69657856", "0.69657856", "0.69657856", "0.69657856", "0.69657856", "0.69657856", "0.6932441", "0.6876998", "0.6846093", "0.6842053", "0.6799855", "0.6795274", "0.67724293", "0.6765644", "0.6765644", "0.6765644", "0.67432064", "0.6741034", "0.6732182", "0.6722662", "0.668867", "0.66825366", "0.66738373", "0.6671546", "0.6671546" ]
0.8231835
0