query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Returns a list of entities using a fulltextsearch | public function findByFulltext($search, $limit = 10, $offset = 0); | [
"function elgg_tokeninput_search_all($term, $options = array()) {\n\n\t$term = sanitize_string($term);\n\n\t// replace mysql vars with escaped strings\n\t$q = str_replace(array('_', '%'), array('\\_', '\\%'), $term);\n\n\t$entities = elgg_get_config('registered_entities');\n\t$subtypes = array(0);\n\tforeach ($entities['object'] as $subtype) {\n\t\t$subtype_id = get_subtype_id('object', $subtype);\n\t\tif ($subtype_id)\n\t\t\t$subtypes[] = $subtype_id;\n\t}\n\n\t$subtypes_in = implode(',', $subtypes);\n\n\t$dbprefix = elgg_get_config('dbprefix');\n\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}users_entity ue ON ue.guid = e.guid AND e.type = 'user'\";\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}groups_entity ge ON ge.guid = e.guid AND e.type = 'group'\";\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}objects_entity oe ON oe.guid = e.guid AND e.type = 'object'\";\n\n\t$options['wheres'][] = \"(e.type = 'user' AND ue.banned = 'no' AND (ue.name LIKE '%$q%' OR ue.username LIKE '%$q%'))\n\t\t\tOR (e.type = 'group' AND ge.name LIKE '%$q%')\n\t\t\tOR (e.type = 'object' AND e.subtype IN ($subtypes_in) AND oe.title LIKE '%$q%')\";\n\n\treturn elgg_get_entities($options);\n}",
"private function getCompanies($fullText){\n //$client->post('http://httpbin.org/post', ['body' => $body]);\n\n $searchPar = ['entity_type' =>'companies_eng', 'text' => $fullText ];\n\n /* var_dump($this->getCompaniesUrl([\n //'entity_type' =>'companies_eng',\n //'text' => $fullText,\n 'apikey' => self::IDOL_KEY\n ]));die; */\n\n $response = $this->getClient()->get(\n $this->getCompaniesUrl([\n 'entity_type' =>'companies_eng',\n 'text' => $fullText,\n 'unique_entities' => 'true',\n 'apikey' => self::IDOL_KEY\n ])\n );\n\n $companies = json_decode($response->getBody() );\n\n if(!isset($companies->entities)){\n return false;\n }\n\n $companiesRes = [];\n\n foreach($companies->entities as $company){\n $companiesRes[] = $company->normalized_text;\n }\n\n return $companiesRes;\n\n }",
"private function getSearchResults($pattern, $entityClassTechnicalName){\r\n\r\n $finderName = 'fos_elastica.finder.slcore.'.$entityClassTechnicalName; \r\n $finder = $this->get($finderName); \r\n\r\n $filters = $this->em->getFilters();\r\n $filters->disable('softdeleteable');\r\n\r\n $this->get('fos_elastica.index.slcore')->refresh(); \r\n $entities = $finder->find($pattern, $this->numberOfSearchResults);\r\n\r\n $filters->enable('softdeleteable');\r\n\r\n return $entities; \r\n }",
"function analyze_entities($text)\r\n{\r\n // Create the Natural Language client\r\n $language = new LanguageClient([\r\n 'projectId' => $google_project_id,\r\n ]);\r\n\r\n // Call the analyzeEntities function\r\n $annotation = $language->analyzeEntities($text);\r\n\r\n // Print out information about each entity\r\n $entities = $annotation->entities();\r\n\t$names = array();\r\n\t\r\n foreach ($entities as $entity) {\r\n $names[] = $entity['name'];\r\n }\r\n\t\r\n\treturn $names;\r\n}",
"public function fulltext($searchWord);",
"public function testSearchEntitiesByTags()\n {\n $entities = array(\n array(\n 'entity_type' => 'forum_post',\n 'entity_id' => 1,\n 'text' => 'forum post title',\n 'tags' => array(\n 'forum_post'\n )\n ),\n array(\n 'entity_type' => 'forum_post',\n 'entity_id' => 1,\n 'text' => 'forum post body',\n 'tags' => array(\n 'forum_post'\n )\n ),\n array(\n 'entity_type' => 'forum_post',\n 'entity_id' => 2,\n 'text' => 'forum post title',\n 'tags' => array(\n 'forum_post'\n )\n ),\n array(\n 'entity_type' => 'forum_post',\n 'entity_id' => 2,\n 'text' => 'forum post body',\n 'tags' => array(\n 'forum_post'\n )\n ),\n array(\n 'entity_type' => 'forum_topic',\n 'entity_id' => 1,\n 'text' => 'forum topic title',\n 'tags' => array(\n 'forum_topic'\n )\n ),\n array(\n 'entity_type' => 'forum_category',\n 'entity_id' => 1,\n 'text' => 'forum category title',\n 'tags' => array(\n 'forum_category'\n )\n )\n );\n\n // add test entities\n foreach ($entities as $entitiy)\n {\n OW::getTextSearchManager()->\n addEntity($entitiy['entity_type'], $entitiy['entity_id'], $entitiy['text'], time(), $entitiy['tags']);\n }\n\n // search entities by tags\n $entities = OW::getTextSearchManager()->searchEntities('forum', 0, 100, array(\n 'forum_post'\n ));\n\n // did we get only forum posts?\n $this->assertInternalType('array', $entities);\n $this->assertEquals(2, count($entities));\n\n foreach ($entities as $entity) \n {\n $this->assertEquals('forum_post', $entity['entityType']);\n }\n }",
"public function getEntityList();",
"public function getSearchFulltext()\n\t {\n\t\t return $this->GetDAL()->GetFulltext(DotCoreEventDAL::EVENTS_FULLTEXT);\n\t }",
"function elgg_tokeninput_search_owned_entities($query, $options = array()) {\n\n\t$user = elgg_get_logged_in_user_entity();\n\n\t$query = sanitize_string($query);\n\n\t// replace mysql vars with escaped strings\n\t$q = str_replace(array('_', '%'), array('\\_', '\\%'), $query);\n\n\t$entities = elgg_get_config('registered_entities');\n\t$subtypes = array(0);\n\tforeach ($entities['object'] as $subtype) {\n\t\t$subtype_id = get_subtype_id('object', $subtype);\n\t\tif ($subtype_id) $subtypes[] = $subtype_id;\n\t}\n\n\t$subtypes_in = implode(',', $subtypes);\n\n\t$dbprefix = elgg_get_config('dbprefix');\n\n\t$options['types'] = array('object', 'group');\n\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}groups_entity ge ON ge.guid = e.guid AND e.type = 'group'\";\n\t$options['joins'][] = \"LEFT JOIN {$dbprefix}objects_entity oe ON oe.guid = e.guid AND e.type = 'object'\";\n\n\t$options['wheres'][] = \"(e.type = 'group' AND ge.name LIKE '%$q%')\n\t\t\tOR (e.type = 'object' AND e.subtype IN ($subtypes_in) AND oe.title LIKE '%$q%')\";\n\n\t$options['wheres'][] = \"e.owner_guid = $user->guid\";\n\t\n\treturn elgg_get_entities($options);\n\t\n\n}",
"public function getSearchEntries($search_terms)\r\n {\r\n // ensure that the search terms are not empty or consist only of whitespace\r\n if (!empty($search_terms) and !ctype_space($search_terms)) {\r\n // create an array with all of the search tokens\r\n $search_words = explode(' ', $search_terms);\r\n\r\n // remove any words from the array that are empty\r\n foreach ($search_words as $word) {\r\n if (!empty($word)) {\r\n // add % on each side of work so that we can use like keyword properly\r\n $final_search_words[] = \"%$word%\";\r\n }\r\n }\r\n\r\n // create the array of strings with the SQL where statements\r\n foreach ($final_search_words as $word) {\r\n $where_list[] = \"blog_entry.entry_title LIKE ?\";\r\n }\r\n\r\n // put the list back together into one string separated by OR\r\n $where_clause = \"WHERE \" . implode(' OR ', $where_list);\r\n\r\n // the sql statement to get all of the relevant entries from the database\r\n $sql = \"SELECT blog_entry.id, blog_entry.entry_title, substr(blog_entry.entry_text, 1, 150) AS intro, blog_entry.entry_date, blog_entry.image_url, users.username\r\n FROM blog_entry\r\n JOIN users\r\n ON blog_entry.author_id=users.user_id $where_clause \r\n ORDER BY blog_entry.entry_date DESC\";\r\n\r\n // execute the sql statement and store the result\r\n $retrieval_statement = $this->makeStatement($sql, $final_search_words);\r\n\r\n return $retrieval_statement;\r\n }\r\n // else simply return all entries if the user didn't submit a valid term\r\n else {\r\n return $this->getAllEntries();\r\n }\r\n }",
"abstract public function search($terms);",
"public function getIndexableEntities($entity): array;",
"public function searchArticles($search_term = '') {\n try {\n // Map request as query object. Search by title is currently disabled.\n // More info: https://www.mediawiki.org/wiki/API:Search\n $response = $this->client->get('', [\n 'query' => [\n 'action' => 'query',\n 'list' => 'search',\n 'utf8' => '',\n 'prop' => 'info',\n 'format' => 'json',\n 'srwhat' => 'text',\n 'srsearch' => $search_term,\n 'srlimit' => 20,\n 'sroffset' => 0,\n ],\n ]);\n $data = Json::decode($response->getBody());\n return $data;\n }\n catch (RequestException $e) {\n // Notify user about failed request.\n drupal_set_message(t('An error ocurred while attempting to fetch information from resource: \"%error\"', ['%error' => $e->getMessage()]), 'error');\n }\n }",
"function listAllWithSearch($term) \r\n {\r\n\r\n $newTerm = \"%\".$term.\"%\";\r\n\r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [\"term\"=>$newTerm];\r\n \r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches WHERE coachFName LIKE :term OR\r\n coachLName LIKE :term OR salary LIKE :term OR teamName LIKE :term \r\n OR dateStarted LIKE :term OR endOfContract LIKE :term;\", $bindParams);\r\n \r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n }",
"public function getEntities()\n {\n return $this->makeRequest('GET', 'entities');\n }",
"function getSearchedArticles($search_query)\n {\n $query = $this->createQueryBuilder('a')\n ->where('a.title LIKE :title')\n ->setParameter('title', '%'.$search_query.'%');\n\n return $query->getQuery()->getArrayResult();\n }",
"function setFullTextSearch() {\n\n\t\t\t$dbMain = db_getDBObject(DEFAULT_DB, true);\n\t\t\tif (defined(\"SELECTED_DOMAIN_ID\")) {\n\t\t\t\t$dbObj = db_getDBObjectByDomainID(SELECTED_DOMAIN_ID, $dbMain);\n\t\t\t} else {\n\t\t\t\t$dbObj = db_getDBObject();\n\t\t\t}\n\n\t\t\tunset($dbMain);\n\n\t\t\tif ($this->title) {\n\t\t\t\t$string=str_replace(\" || \", \" \", $this->title);\n $fulltextsearch_keyword[] = $string;\n $addkeyword=format_addApostWords($string);\n if ($addkeyword!='') $fulltextsearch_keyword[] =$addkeyword;\n unset($addkeyword);\n\t\t\t}\n \n $edir_languages = explode(\",\", EDIR_LANGUAGENUMBERS);\n \n foreach($edir_languages as $lang_index){\n if ($this->{\"keywords\".$lang_index}) {\n $string=str_replace(\" || \", \" \", $this->{\"keywords\".$lang_index});\n $fulltextsearch_keyword[] = $string;\n $addkeyword=format_addApostWords($string);\n if ($addkeyword!='') $fulltextsearch_keyword[] =$addkeyword;\n unset($addkeyword);\n }\n \n if ($this->{\"summarydesc\".$lang_index}) {\n $fulltextsearch_keyword[] = string_substr($this->{\"summarydesc\".$lang_index}, 0, 100);\n }\n\n }\n\n\t\t\tif ($this->address) {\n\t\t\t\t$fulltextsearch_where[] = $this->address;\n\t\t\t}\n\n\t\t\tif ($this->zip_code) {\n\t\t\t\t$fulltextsearch_where[] = $this->zip_code;\n\t\t\t}\n\n\t\t\t$_locations = explode(\",\", EDIR_LOCATIONS);\n\t\t\tforeach ($_locations as $each_location) {\n\t\t\t\tunset ($objLocation);\n\t\t\t\t$objLocationLabel = \"Location\".$each_location;\n\t\t\t\t$attributeLocation = 'location_'.$each_location;\n\t\t\t\t$objLocation = new $objLocationLabel;\n\t\t\t\t$objLocation->SetString(\"id\", $this->$attributeLocation);\n\t\t\t\t$locationsInfo = $objLocation->retrieveLocationById();\n\t\t\t\tif ($locationsInfo[\"id\"]) {\n\t\t\t\t\t$fulltextsearch_where[] = $locationsInfo[\"name\"];\n\t\t\t\t\tif ($locationsInfo[\"abbreviation\"]) {\n\t\t\t\t\t\t$fulltextsearch_where[] = $locationsInfo[\"abbreviation\"];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$categories = $this->getCategories();\n\t\t\tif ($categories) {\n\t\t\t\tforeach ($categories as $category) {\n\t\t\t\t\tunset($parents);\n\t\t\t\t\t$category_id = $category->getNumber(\"id\");\n\t\t\t\t\twhile ($category_id != 0) {\n\t\t\t\t\t\t$sql = \"SELECT * FROM ClassifiedCategory WHERE id = $category_id\";\n\t\t\t\t\t\t$result = $dbObj->query($sql);\n\t\t\t\t\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t\t\t\t\t$category_info = mysql_fetch_assoc($result);\n\t\t\t\t\t\t\t$langs = explode(\",\", $category_info[\"lang\"]);\n if (is_array($langs) && $langs[0]){\n $langObj = new Lang();\n foreach($langs as $lang){\n if ($lang){\n $lang_id = $langObj->returnLangId($lang); \n\n if ($category_info[\"enabled\"] == \"y\") {\n if ($category_info[\"title\".$lang_id]) {\n $fulltextsearch_keyword[] = $category_info[\"title\".$lang_id];\n }\n\n if ($category_info[\"keywords\".$lang_id]) {\n $fulltextsearch_keyword[] = $category_info[\"keywords\".$lang_id];\n }\n }\n } \n } \n }\n\t\t\t\t\t\t\t$category_id = $category_info[\"category_id\"];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$category_id = 0;\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\tif (is_array($fulltextsearch_keyword)) {\n\t\t\t\t$fulltextsearch_keyword_sql = db_formatString(implode(\" \", $fulltextsearch_keyword));\n\t\t\t\t$sql = \"UPDATE Classified SET fulltextsearch_keyword = $fulltextsearch_keyword_sql WHERE id = $this->id\";\n\t\t\t\t$result = $dbObj->query($sql);\n\t\t\t}\n\t\t\tif (is_array($fulltextsearch_where)) {\n\t\t\t\t$fulltextsearch_where_sql = db_formatString(implode(\" \", $fulltextsearch_where));\n\t\t\t\t$sql = \"UPDATE Classified SET fulltextsearch_where = $fulltextsearch_where_sql WHERE id = $this->id\";\n\t\t\t\t$result = $dbObj->query($sql);\n\t\t\t}\n\n\t\t}",
"protected static function getExpressEntities()\n {\n $entityManager = \\Core::make(EntityManagerInterface::class);\n $repo = $entityManager->getRepository('\\Concrete\\Core\\Entity\\Express\\Entity');\n $entities = $repo->findBy(array('include_in_public_list' => true));\n return $entities;\n }",
"public function fulltextQuery($query)\n\t{\n\t\tif(($search = $this->searchEngine()) === null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t$rs = $search->query($query);\n\t\t$rs['storableClass'] = 'TroveObject';\n\t\tforeach($rs['list'] as $k => $entry)\n\t\t{\n\t\t\t$rs['list'][$k] = $this->dataForUUID($entry['uuid']);\n\t\t}\n\t\t$set = new StaticStorableSet($this, $rs);\n\t\treturn $set;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given a user ID return connections connections ids | function getConnectionsConnectionsIds($userConnections){
$userConnectionsConnections=[];
foreach($userConnections as $k=>$v){
array_push($userConnectionsConnections,getConnectionsFromUserId($v));
}
return $userConnectionsConnections;
} | [
"function getConnectionsFromUserID($userID){\n require \"includes/dbh-inc.php\";\n $userConnectionsIDs = [];\n $sql = \"SELECT Connections.UserB_Id\n FROM Connections\n WHERE Connections.UserA_Id = {$userID};\";\n $result = $conn->query($sql);\n if($result->num_rows > 0){\n while($row = $result->fetch_assoc()){\n array_push($userConnectionsIDs,$row['UserB_Id']);\n }\n }\n \n return $userConnectionsIDs;\n}",
"function getConnectedUserIdsOfUsers($ids) {\n\t$userids = idsToArray($ids);\n\n\t// Get users that they have a connection TO\n\t//SELECT connectionid FROM connections WHERE type = 'user' AND (userid = 2 OR userid = 5)\n\t$sql = \"SELECT connectionid FROM connections WHERE type = 'user' AND (\";\n\tforeach($userids as $userid) {\n\t\t$sql .= 'userid = ' . $userid;\n\t\tif (end($userids) != $userid) { $sql .= \" OR \"; }\n\t}\n\t$sql .= \")\";\n\t$connectionIds = queryColumn($sql);\n\n\treturn $connectionIds;\n}",
"function getConnectedUserIdsToUsers($ids) {\n\t$userids = idsToArray($ids);\n\n\t// Get users that they have a connection FROM\n\t//SELECT userid FROM connections WHERE type = 'user' AND (connectionid = 4)\n\t$sql = \"SELECT userid FROM connections WHERE type = 'user' AND (\";\n\tforeach($userids as $userid) {\n\t\t$sql .= 'connectionid = ' . $userid;\n\t\tif (end($userids) != $userid) { $sql .= \" OR \"; }\n\t}\n\t$sql .= \");\";\n\t$connectionIds = queryColumn($sql);\n\n\treturn $connectionIds;\n}",
"public static function get_user_connections(){\n\n\t\t$user = wp_get_current_user();\n\t\t$res = get_user_meta(\n\t\t\t$user->ID, \n\t\t\tAPI_Con_Model::$meta_keys['user_connections'],\n\t\t\ttrue\n\t\t);\n\n\t\tif ( !$res )\n\t\t\treturn array();\n\t\treturn $res;\n\t}",
"public function listConnectionsIds()\n {\n return $this->_procFunc(\"listConnectionsIds\");\n }",
"function getConnectedUserIdsOfStudents($ids) {\n\t$userids = idsToArray($ids);\n\n\t// Get user ids from connection table\n\t//SELECT connectionid FROM connections WHERE type = 'student' AND (connectionid = 2 OR connectionid = 5)\n\t$sql = \"SELECT userid FROM connections WHERE type = 'student' AND (\";\n\tforeach($userids as $userid) {\n\t\t$sql .= 'connectionid = ' . $userid;\n\t\tif (end($userids) != $userid) { $sql .= \" OR \"; }\n\t}\n\t$sql .= \");\";\n\t$connections = queryColumn($sql);\n\n\treturn $connections;\n}",
"public function getAssignableConnections() {\n\t\treturn Yii::app()->db->createCommand()\n\t\t\t->select('connectionID, IPAddress, username')\n\t\t\t->from('tbl_connection')\n\t\t\t->where('connectionID NOT IN (SELECT connectionID FROM tbl_user_connection WHERE userID = :userID)', array(':userID' => $this->userID))\n\t\t\t->order(array('IPAddress', 'username'))\n\t\t\t->queryAll();\n\t}",
"public static function getUserDelegatedIds($user_id)\n {\n return ServerDelegation::where('user_id', $user_id)->select('server_id')->get()->toArray();\n }",
"function updateConnections($uid)\n\t{\n\t\t$conn = connect(\"127.0.0.1\", \"5000\", \"root\", \"\");\n\t\t$memcached = initMemcached();\n\t\t\n\t\t$userConnections = array();\n\n\t\t// Query connections table\n\t\t$query = \"Select conn_user1 as connectedUser from connections where conn_user2 = $uid UNION \".\n\t\t \t\t \"Select conn_user2 as connectedUser from connections where conn_user1 = $uid\";\n\t\t$result = mysqli_query($conn, $query) or die(\"Query Execution failed: \".mysqli_error($conn));\n\t\twhile($connectedUser = mysqli_fetch_array($result, MYSQL_ASSOC))\n\t\t\t$userConnections[] = getUserInfo($connectedUser[\"connectedUser\"]);\n\n\t\t$memcached->set(md5(\"user-connections-\".$uid), $userConnections);\n\t\tmysqli_close($conn);\n\n\t\treturn $userConnections;\n\t}",
"public function GetCurrentConnectionIDs(){\n $args=\"\";\n $filter=\"ConnectionIDs\";\n return $this->BASE->Upnp($this->SERVICEURL,$this->SERVICE,'GetCurrentConnectionIDs',$args,$filter);\n }",
"static public function connections() {\n\t\t$connections\t= array();\n\t\t$list\t\t\t= static::connection_list();\n\t\tforeach ($list as $id)\n\t\t\t$connections[$id] = static::cn($id);\n\t\treturn $connections;\n\t}",
"public function getUserIds();",
"public function GetCurrentConnectionIDs(){\n if (!$this->GetOnlineState()) return null;\n $filter=array('ConnectionIDs');\n return self::Call('ConnectionManager','GetCurrentConnectionIDs',null,$filter);;\n }",
"public function getConnectedUsers(){\n\t\t$uarr = array();\n\t\tforeach($this->users as $user){\n\t\t\t$uarr[$user->id] = $user->name;\n\t\t}\n\t\treturn $uarr;\n\t}",
"public function getPublicConnections();",
"public function getConnectedUsers()\n {\n $users = $this->sendRequest('connected_users', []);\n\n return isset($users['connected_users']) ? $users['connected_users'] : [];\n }",
"public static function getAllConnectedUsers(){\n\t\treturn UserDBHandler::getAllConnectedUsers();\n\t}",
"public function getConnections()\n {\n $connections = array();\n foreach ($this->connections as $name => $id) {\n $connections[$name] = $this->container->get($id);\n }\n\n return $connections;\n }",
"public static function getConnections () {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate MYSQL for float | public function generateMySQL($param) {
$size = $this->getSize($param["params"]);
$size = ($size == "") ? "(11)" : "($size)";
$null = $this->getNull($param["params"]);
$null = ($null == true) ? "NULL" : "NOT NULL";
$default = $this->getDefault($param["params"]);
$default = ($default == "") ? "" : "DEFAULT '$default'";
return "`" . $param['name'] . "` FLOAT$size $null $default";
} | [
"function getFloat($column_name) {}",
"function SetColFormatFloat($col, $width=-1, $precision=-1){}",
"function escapeFloat4Sql($f){\n\t\treturn (string)$f;\n\t}",
"protected function getDecimalSql($value)\n {\n return (float) $value;\n }",
"function writeFloat(){\r\n\t\tdie('Not implemented');\r\n\t}",
"function floatval($var) {}",
"function numero_mysql($numero)\r\n{ \r\n return number_format($numero,2,'.',','); \r\n}",
"protected function type_float(Fluent $column)\n\t{\n\t\treturn \"float({$column->total}, {$column->places})\";\n\t}",
"public function writeFloat($num){ }",
"function setBigFloat($index, $value)\n\t{\n\t\tif( $value === NULL ){\n\t\t\t$v = \"NULL\";\n\t\t} else {\n\t\t\t$v = $value->__toString();\n\t\t\t$scale = $value->scale() + 1;\n\t\t\tif( $scale == strlen($v) ){\n\t\t\t\t$precision = 0;\n\t\t\t} else {\n\t\t\t\t$precision = strlen($v) - $scale - 1;\n\t\t\t\t$scale += $precision;\n\t\t\t}\n\t\t\t$v = \"cast('$v' as DECIMAL($scale,$precision))\";\n\t\t}\n\t\t$this->setParameter($index, $v);\n\t}",
"private function columnFloat($fieldName)\n {\n $this->table->addColumn($fieldName, 'float', ['default' => 0]);\n }",
"function TempToDB($conn,$T){\r\n $c_f = settings($conn, 'c_f');\r\n if($c_f==1 || $c_f=='1'){\r\n return round(($T-32)*5/9,1);\r\n }\r\n return round($T,1);\r\n}",
"public function toSQL()\n {\n return DB::Raw('POINT(' . $this->getLongitude() . ', ' . $this->getLatitude() . ')');\n }",
"protected function type_float(Fluent $column)\n\t{\n\t\treturn 'float';\n\t}",
"public function asFloat() {}",
"function _db_create_field_sql($name, $spec) {\n $sql = \"`\". $name .\"` \". $spec['mysql_type'];\n\n if (isset($spec['length'])) {\n $sql .= '('. $spec['length'] .')';\n }\n else if (isset($spec['precision']) && isset($spec['scale'])) {\n $sql .= '('. $spec['precision'] .', '. $spec['scale'] .')';\n }\n\n if (!empty($spec['unsigned'])) {\n $sql .= ' unsigned';\n }\n\n if (!empty($spec['not null'])) {\n $sql .= ' NOT NULL';\n }\n\n if (!empty($spec['auto_increment'])) {\n $sql .= ' auto_increment';\n }\n\n if (isset($spec['default'])) {\n if (is_string($spec['default'])) {\n $spec['default'] = \"'\". $spec['default'] .\"'\";\n }\n\n $sql .= ' DEFAULT '. $spec['default'];\n }\n\n if (empty($spec['not null']) && !isset($spec['default'])) {\n $sql .= ' DEFAULT NULL';\n }\n\n return $sql;\n}",
"function gmp_init_float($value)\n{\n if (is_int($value))\n {\n return $value;\n }\n if (is_float($value))\n {\n return sprintf(\"%.0f\", $value);\n }\n if (strpos($value, '.') !== FALSE)\n {\n // Return int part of string\n list($value) = explode('.', $value);\n return $value;\n }\n\n return \"$value\";\n}",
"function setBigFloat($index, $value)\n\t{\n\t\tif( $value === NULL )\n\t\t\t$v = \"NULL\";\n\t\telse\n\t\t\t$v = \"'\" . $value->__toString() . \"'\";\n\t\t$this->setParameter($index, $v);\n\t}",
"function Float($val)\n{\n return new Float($val);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update company member table and set permission values | function set_company_member_permission($user_id, $company_id, $values) {
echo "<pre>";
print_r($values);
exit();
$data = $this->get_company_member_data($user_id, $company_id);
if ($data) {
$original_values = !empty($data['permissions']) && $data['permissions'] != 'null' ? json_decode(stripslashes($data['permissions']), TRUE) : array();
$new_values = array_merge($original_values, $values);
$this->db->where('id', $data['id']);
$res = $this->db->update($this->company_member_table, array('permissions' => json_encode($new_values)));
if ($res) {
return true;
}
}
return false;
} | [
"function ncn_admin_assign_member_to_am($member_id, $am_uid)\n{\n// $query = \"UPDATE member_id_pool SET am_uid=$am_uid WHERE member_id='$member_id'\";\n $result = db_query('UPDATE {member_id_pool} SET am_uid=:a WHERE member_id=:b',\n array(':a'=>$am_uid ,':b'=>$member_id));\n if ($result->rowCount()==0)\n {\n return FALSE;\n }\n\n ncn_admin_check_am_auto_assign_row($am_uid);\n ncn_admin_update_am_auto_assign_row($am_uid);\n return TRUE;\n}",
"function updateMember($member_id, $name, $email, $company_id){\n\t\t$sql = \"UPDATE members SET name='$name', email='$email', company_id='$company_id' WHERE member_id='$member_id'\";\n\t\t$this->conn->query($sql);\n\t}",
"public function updatePermissions() {\n\n // check that required parameters are defined\n $params = $this->subsetArray($this->_params, [\"user_id\",\n \"target_id\", \"network\", \"permissions\"]);\n\n if ($params['target_id'] == \"admin\") {\n throw new Exception(\"Cannot change permissions for admin\");\n }\n\n $targetid = $params['target_id'];\n $newperm = (int) $params['permissions'];\n\n // get the netid that matches the network name\n $netid = $this->getNetworkId($params['network']);\n\n // get permissions for the asking user\n // only curators and admin can update permissions \n $uperm = $this->getUserPermissions($netid, $this->_uid);\n if ($uperm < NC_PERM_CURATE) {\n throw new Exception(\"Insufficient permissions\");\n }\n\n // make sure the target user exists and the permisions are valid\n if ($newperm < NC_PERM_NONE || $newperm > NC_PERM_CURATE) {\n throw new Exception(\"Invalid permission code $newperm\");\n }\n if ($targetid == \"guest\" && $newperm > NC_PERM_VIEW) {\n throw new Exception(\"Guest user cannot have high permissions\");\n }\n $sql = \"SELECT user_id, user_firstname, user_middlename, user_lastname \n FROM \" . NC_TABLE_USERS . \" WHERE user_id = ?\";\n $stmt = $this->qPE($sql, [$targetid]);\n $result = $stmt->fetch();\n if (!$result) {\n throw new Exception(\"Target user does not exist\");\n }\n $userinfo = array();\n $userinfo[$targetid] = $result;\n $userinfo[$targetid]['permissions'] = $newperm;\n\n // make sure the new permission is different from the existing value\n $targetperm = $this->getUserPermissions($netid, $targetid);\n if ($targetperm === $newperm) {\n throw new Exception(\"Permissions do not need updating\");\n }\n\n // if reached here, all is well. Update the permissions code \n $sql = \"INSERT INTO \" . NC_TABLE_PERMISSIONS . \" \n (user_id, network_id, permissions) VALUES \n (?, ?, ?) ON DUPLICATE KEY UPDATE permissions = ?\";\n $stmt = $this->qPE($sql, [$targetid, $netid, $newperm, $newperm]);\n\n // log the activity \n $this->logActivity($this->_uid, $netid, \"updated permissions for user\", $targetid, $newperm);\n $this->sendUpdatePermissionsEmail($netid);\n\n return $userinfo;\n }",
"public function updatePermissions()\n {\n if ($this->isHiringOrganization()) {\n $organization = $this->getParent();\n $owner = $organization->getUser();\n\n $this->setUser($owner);\n } else {\n $organization = $this;\n }\n\n /* @var $employees null | ArrayCollection | \\Doctrine\\ODM\\MongoDB\\PersistentCollection */\n $employees = $organization->getEmployees();\n\n $perms = $this->getPermissions();\n\n foreach ($employees as $emp) {\n /* @var $emp \\Organizations\\Entity\\Employee */\n $perms->grant($emp->getUser(), PermissionsInterface::PERMISSION_CHANGE, false);\n }\n $perms->build();\n }",
"public function testUpdateSiteMembershipRequestForPerson()\n {\n }",
"function aconnect_update_meeting_perm($aconnect, $meetingscoid, $perm) {\n $params = array('action' => 'permissions-update',\n 'acl-id' => $meetingscoid,\n 'principal-id' => 'public-access',\n );\n\n switch ($perm) {\n case ADOBE_MEETPERM_PUBLIC:\n $params['permission-id'] = 'view-hidden';\n break;\n case ADOBE_MEETPERM_PROTECTED:\n $params['permission-id'] = 'remove';\n break;\n case ADOBE_MEETPERM_PRIVATE:\n default:\n $params['permission-id'] = 'denied';\n break;\n }\n\n $aconnect->create_request($params);\n\n if ($aconnect->call_success()) {\n return true;\n } else {\n return false;\n }\n\n\n }",
"function update_accessright()\n {\n $parameter_array = $this->get_parameter_array();\n parent::update($this->id, 'ssi', $parameter_array);\n }",
"public function update() {\n if(!$this->request->is('restful')) {\n $targetCoPersonId = $this->request->data['CoGroupMember']['co_person_id'];\n $userCoPersonId = $this->Session->read('Auth.User.co_person_id');\n $requesterIsAdmin = $this->Role->isCoAdmin($userCoPersonId, $this->cur_co['Co']['id'])\n || $this->Role->identifierIsCmpAdmin($this->Session->read('Auth.User.username'));\n \n try {\n $this->CoGroupMember->updateMemberships($targetCoPersonId,\n $this->request->data['CoGroupMember']['rows'],\n $userCoPersonId,\n $requesterIsAdmin);\n \n $this->Flash->set(_txt('rs.saved'), array('key' => 'success'));\n }\n catch(Exception $e) {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n }\n \n // Issue redirect\n $redir = array();\n $redir['controller'] = 'co_groups';\n $redir['action'] = 'select';\n $redir['co'] = $this->cur_co['Co']['id'];\n\n // If the current user is not the same as the target CO Person for whom\n // memberships are being managed then include the copersonid parameter.\n if($targetCoPersonId != $userCoPersonId) {\n $redir['copersonid'] = $targetCoPersonId;\n }\n\n $this->redirect($redir);\n }\n }",
"public function testUpdatePrivilege2()\n {\n }",
"public function testUpdatePrivilege3()\n {\n }",
"public function update_role() {\n\t\t$table = new cli\\Table();\n\t\t$table->setHeaders( [ 'No Change', 'Upgrade', 'Resign' ] );\n\t\t$body = capitalp_update_bulk_role();\n\t\t$table->addRow( $body );\n\t\t$table->display();\n\t\tWP_CLI::success( sprintf( 'Above is the CCP %d members status.', $body[0] + $body[1] + $body[2] ) );\n\t}",
"public function updatePermission()\n {\n $permArray = array();\n $menuArray = array();\n $currentUserRole = Auth::user()->user_role;\n $roleList = DB::table('roles')->select('id','permission')->get();\n try {\n $menuArray = $this->fetchMenu();\n foreach($roleList as $role){\n $roleID = $role->id;\n $permission = trim($role->permission);\n if ($roleID == 1 || $permission==\"\") {\n $trigger = true;\n $resp = (object)$this->setPermSuperAdmin(array(), $menuArray, 0, $trigger);\n $permArray = json_encode($resp);\n $roleobj = Role::find($roleID);\n $roleinfo = array();\n $roleinfo['permission'] = $permArray;\n $roleobj->fill($roleinfo)->update();\n\n }else{\n $currentPermissionArr = $this->permissionArrRedefine($permission);\n $resp = (object)$this->setPerm(array(), $menuArray, 0, $currentPermissionArr);\n $permArray = json_encode($resp);\n $roleobj = Role::find($roleID);\n\n $roleinfo = array();\n $roleinfo['permission'] = $permArray;\n $roleobj->fill($roleinfo)->update();\n }\n }\n\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n\n return true;\n }",
"private function update_permitted()\n {\n $this->logopen_ispermit();\n\n foreach($this->supportgroups as $key => $garbage) {\n $this->supportgroups[$key][\"permitted\"] =\n $this->is_permitted($this->supportgroups[$key][\"name\"]);\n\n $this->logwrite_ispermit(\"is_permitted: \" .\n $this->supportgroups[$key][\"name\"] . \" \" .\n (($this->supportgroups[$key][\"permitted\"] ==1) ?\n \"permitted.\" : \"not permitted.\") . \"\\n\");\n }\n\n $this->logclose_ispermit();\n }",
"function update_permissions()\n\t{\n\t\taccess_control($this, array('admin'));\n\n\t\t# Get the passed details into the url data array if any\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't'));\n\t\t# Pick all assigned data\n\t\t$data = assign_to_data($urldata);\n\n\t\tif(!empty($data['i'])){\n\t\t\t$result = $this->db->query($this->Query_reader->get_query_by_code('get_group_permissions', array('groupid'=>decryptValue($data['i'])) ));\n\t\t\t$the_permissions_list = $result->result_array();\n\t\t\t$data['permissions_list'] = array();\n\t\t\tforeach($the_permissions_list AS $permission_row){\n\t\t\t\tarray_push($data['permissions_list'], $permission_row['permissionid']);\n\t\t\t}\n\n\n\t\t\t$data['groupdetails'] = $this->Query_reader->get_row_as_array('get_group_by_id', array('groupid'=>decryptValue($data['i']) ));\n\t\t\t$usertype = ($this->session->userdata('isadmin') == 'Y')? \"admin\": \"\";\n\t\t\t$result = $this->db->query($this->Query_reader->get_query_by_code('get_all_permissions', array('accesslist'=>\"'\".$usertype.\"'\") ));\n\t\t\t$data['all_permissions'] = $result->result_array();\n\n\t\t\t#put all permissions in a manageable array\n\t\t\t$data['all_permissions_list'] = array();\n\t\t\tforeach($data['all_permissions'] AS $thepermission){\n\t\t\t\tarray_push($data['all_permissions_list'], $thepermission['id']);\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($data['t']) && $data['t'] == 'super'){\n\t\t\t$tstr = \"/t/super\";\n\t\t}else{\n\t\t\t$tstr = \"\";\n\t\t}\n\n\t\tif($this->input->post('updatepermissions'))\n\t\t{\n\t\t\tif(!empty($_POST['permissions'])){\n\t\t\t\t$result_array = array();\n\t\t\t\t#First delete all permissions from the access table\n\t\t\t\t$delresult = $this->db->query($this->Query_reader->get_query_by_code('delete_group_permissions', array('groupid'=>$_POST['editid']) ));\n\n\t\t\t\tarray_push($result_array, $delresult);\n\n\t\t\t\tforeach($_POST['permissions'] AS $permissionid)\n\t\t\t\t{\n\t\t\t\t\t$insresult = $this->db->query($this->Query_reader->get_query_by_code('add_group_permission', array('groupid'=>$_POST['editid'], 'permissionid'=>$permissionid, 'author'=>$this->session->userdata('userid')) ));\n\t\t\t\t\tarray_push($result_array, $insresult);\n\t\t\t\t}\n\n\t\t\t\tif(get_decision($result_array)){\n\t\t\t\t\t$this->session->set_userdata('pgroup', \"The Group permissions have been assigned.\");\n\t\t\t\t\tredirect(\"admin/manage_user_groups/m/pgroup\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(empty($result) || !$result)\n\t\t{\n\t\t\tif(empty($_POST['permissions']))\n\t\t\t{\n\t\t\t\t$this->session->set_userdata('puser', \"WARNING: No permissions are assigned to the group.\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->session->set_userdata('puser', \"ERROR: The group permissions could not be assigned.\");\n\t\t\t}\n\t\t\tredirect(base_url().\"admin/manage_user_groups/m/puser\");\n\t\t}\n\n\t\t$data['view_to_load'] = 'users/user_group_permissions_v';\n\t\t$data['page_title'] = 'User group permissions ' . (!empty($data['groupdetails']['groupname'])?\n\t\t\t\t\t\t\t'for user group ['. $data['groupdetails']['groupname'] . ']' : '');\n\t\t$data['current_menu'] = 'user_groups';\n\t\t$data['search_url'] = '';\n\t\t$data['form_title'] = 'User group permissions ' . (!empty($data['groupdetails']['groupname'])?\n\t\t\t\t\t\t\t'for user group <i>['. $data['groupdetails']['groupname'] . ']</i>' : '');;\n\n\t\t$this->load->view('dashboard_v', $data);\n\n\t}",
"function trailsforthepeople_db_update_2002() {\n\t$db = db_connect();\n\n\t$sql = 'ALTER TABLE contributors ADD COLUMN allow_trails bool NOT NULL DEFAULT false;';\n\t$result = pg_query($db, $sql)\n\t\tor exit(\"Error running query.\");\n\n\t$sql = 'UPDATE contributors SET allow_trails=TRUE WHERE admin=true;';\n\n\t$result = pg_query($db, $sql) or exit(\"Error running query.\");\n}",
"function eventUpdatePermissions(){\n\t\tif(!security::hasAccess(\"Edit Permissions\"))\n\t\t\treturn;\n\n\t\tglobal $sql;\n\t\t//iterate through all the groups, finding which permissions where\n\t\t//checked of for each\n\t\t$userGroups = security::getUserGroups();\n\t\tforeach($userGroups as $userGroup){\n\t\t\t//permissions for this group (array of permission ids)\n\t\t\t$permissions = $this->getData(\"permissions_\".$userGroup->id);\n\t\t\tif(!is_array($permissions)) {\n\t\t\t\t$permissions = array();\n\t\t\t}\n\t\t\t//update the group in the database\n\t\t\t$userGroup->permissions = implode(\",\",$permissions);\n\t\t\t$userGroup->save();\n\n\t\t}\n\t\t$this->setEventResult(true, \"Updated\" );\n\t}",
"public function assignNewAdmin( $member );",
"public static function setContractorId() {\n\n $sql = \"UPDATE contractor SET users_id='8' WHERE id='3'\";\n self::insert($sql);\n\n\n }",
"public function setMembers(CompanyMembership $members);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the current node is a sibling of a supplied node. (Both have the same direct parent) | public function is_sibling($target)
{
if ( ! ($target instanceof $this))
{
$target = self::factory($this->_object_name, $target);
}
if ((int) $this->pk() === (int) $target->pk())
return FALSE;
return ((int) $this->{$this->_parent_column} === (int) $target->{$target->_parent_column});
} | [
"public function isSiblingOf($node)\n {\n $this->checkNotNewModel(); \n $owner = $this->owner;\n if ($this->isRoot() || $node->isRoot()) {\n return $owner === $node;\n }\n return $owner->{$this->getPathFieldName()} == $node->{$this->getPathFieldName()};\n }",
"public function hasSiblings () {}",
"public function hasSiblings() {}",
"public function hasPrevSibling();",
"public function hasNextSibling()\n {\n return $this->isValidNode($this->getNextSibling()); \n }",
"public static function hasNextSibling(NodeObject $node, PropelPDO $con = null);",
"public function hasSiblings( ) {\n\n\t\treturn ( $this->_Parent->childCount > 1 );\n\t}",
"public function hasPrevSiblings();",
"public function hasSiblings() {\n $result = false;\n $children = null;\n $name = $this->_getName();\n $parentColumn = $this->_parentColumn;\n $idColumn = $this->_idColumn;\n\n if ($this->hasParent()) {\n $parent = $this->getParent();\n if ($parent!==null) {\n $id = $parent->$idColumn;\n $myId = $this->$idColumn;\n\n $children = $name->count('*',array(\n array (\n \"name\" => $parentColumn,\n \"operator\" => \"=\",\n \"value\" => $id\n ),\n array (\n \"name\" => $idColumn,\n \"operator\" => \"<>\",\n \"value\" => $myId\n )\n ));\n if ($children>0) {\n $result = true;\n }\n }\n }\n return $result;\n }",
"abstract public function isSiblingOf( $child1Id, $child2Id );",
"abstract public function isSiblingOf($child1Id, $child2Id);",
"public function hasNextSibling();",
"public static function hasPrevSibling(NodeObject $node, PropelPDO $con = null)\n\t{\n\t\treturn sfAssetFolderPeer::isValid(sfAssetFolderPeer::retrievePrevSibling($node, $con));\n\t}",
"public function hasPrevTextOrInlineSibling(DOMNode $node): bool{\n\t\t\tif (property_exists($node, \"previousSibling\")){\n\t\t\t\t$prevSibling = $node->previousSibling;\n\t\t\t}\n\n\t\t\tif (isset($prevSibling)){\n\t\t\t\tif ($prevSibling->nodeType === XML_TEXT_NODE){\n\t\t\t\t\tif (trim($prevSibling->textContent) !== \"\"){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t$this->nodeSettings->isInlineElement($prevSibling->nodeName)\n\t\t\t\t\t||\n\t\t\t\t\t$this->nodeSettings->isInlineSelfClosingElement($prevSibling->nodeName)\n\t\t\t\t){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}",
"public function isPrevSiblingOf(ElementInterface $element): bool;",
"public function isNextSiblingOf(ElementInterface $element): bool;",
"public function moveAsPrevSiblingOf(\\App\\DomainObject\\Node $node);",
"public function adjacentSibling($direction = 1);",
"function make_previous_sibling_of($object, $node)\n\t{\n\t\tif ( ! $this->is_root($node) )\n\t\t{\n\t\t\treturn $this->_moveSubtree($object, $node, $node->{$this->_leftindex});\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fungsi Add To Cart | function add_to_cart(){
$data = array(
'id' => $this->input->post('for_id'),
'name' => $this->input->post('title'),
'price' => $this->input->post('price'),
'qty' => $this->input->post('quantity'),
//cart sesion dari controller cart
);
$this->cart->insert($data);
echo $this->show_cart(); //tampilkan cart setelah added
} | [
"private function addToCart() {\n\t}",
"public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"function add_to_cart(){\n\t\t$data = array(\n\t\t\t'id' => $this->input->post('produk_id'), \n\t\t\t'name' => $this->input->post('produk_nama'), \n\t\t\t'price' => $this->input->post('produk_harga'),\n\t\t\t'price_before' => $this->input->post('produk_harga_origin'), \n\t\t\t'qty' => $this->input->post('qty') , \n\t\t\t'gbr' => $this->input->post('gambar'),\n\t\t);\n\t\t$this->cart->insert($data);\n\t\techo $this->show_cart(); //tampilkan cart setelah added\n\t}",
"public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }",
"public function createCart();",
"public function addCartItem()\r\n\t\t{\r\n\t\t\tif(isset($_GET['pid'])) {\r\n\t\t\t\r\n\t\t\t\t$product_id = $_GET['pid'];\r\n\t\t\t\t\r\n\t\t\t\t//check that product ID is valid number\r\n\t\t\t\tif(!is_numeric($product_id)) {\r\n\t\t\t\t\techo \"Invalid product ID\";\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$productData = $this->store_m->getSingleProduct($product_id);\r\n\t\t\t\t\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'id' => $product_id,\r\n\t\t\t\t\t'qty' => '1',\r\n\t\t\t\t\t'price' => $productData['0']['price'],\r\n\t\t\t\t\t'name' => $productData['0']['name'],\r\n\t\t\t\t\t'options' => array('sku' => $productData['0']['code'], 'photo' => $productData['0']['photo'])\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$this->cart->insert($data);\r\n\t\t\t\tredirect('store', 'refresh');\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\techo \"No Product Found.\";\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t}",
"public function createCartItem();",
"public function addOneToCart() {\n $idProduct = Tools::getValue('id_product');\n $idProductAttribute = Tools::getValue('id_product_attribute');\n $qty = Tools::getValue('qty');\n \n $this->updateProductInCart($idProduct, $idProductAttribute, $qty);\n\n $this->indexFullListProduct();\n }",
"public function addProductToCartByUser(){\n\t\t\t $product_code=$_POST['product-code'];\n $shopId=\"666666\";\n $updateIf=\"yes\";\n $stockAct=$_POST['product-stock']-$_POST['quantity'];\n\t\t\t $this->productActController->updateStock($stockAct,$product_code);\n\t\t\t\t$new_product=array('user_id'=>$_SESSION[\"name\"],'product_id'=>$product_code,'shop_id'=>$shopId,'cant'=>$_POST['quantity'],'um'=>$_POST['product-um']);\n \t\t\t$this->cart->insert($new_product);\n\n\t\t\t\t//find the new register\n\t\t\t\t$addedCart=$this->cart->getNameById($product_code,$table_work);\n\t\t\t\t//ShoppingCart::setTable('product_cart');\n\t\t\t\t$mensaggeAddedCart=\"Was an error inserting data\";\n\t\t\t\tRedirect::to(\"/products\")->with([\n\t\t\t\t\t'message'=>$addedCart[0][\"name\"],\n\t\t\t\t])->do();\n\t\t}",
"function addToCart()\n{\n\t$cf = new Fwcore();\n\t\n\t$data = array();\n\t$data['auth_token'] = isset($_POST['auth_token']) ? $_POST['auth_token'] : '';\n\t$data['app_id'] = isset($_POST['app_id']) ? $_POST['app_id'] : '';\n\t$data['cart_data'] = isset($_POST['cart_data']) ? $_POST['cart_data'] : '';\n\t$data['email'] = isset($_POST['email']) ? $_POST['email'] : '';\n\t$data['device_id'] = isset($_POST['device_id']) ? $_POST['device_id'] : '';\n\t$cf->addToCart($data);\n}",
"public function add() {\n\t\tif (!$this->request->is('get')) {\n\t\t\tif ($this->Cart->add($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__d('cart', 'New cart created'));\n\t\t\t\t$this->redirect(array('action' => 'view', $this->Cart->data['Cart']['id']));\n\t\t\t}\n\t\t}\n\t}",
"public function addCartId($cart_id);",
"public function add_cart($data)\n {\n $id = 0;\n $quantity = 1;\n\n if(isset($data[2]))\n $id = $data[2];\n\n if(isset($data[3]))\n $quantity = $data[3];\n\n // search if cart does not have this item already\n // if it has update it\n // else add it\n if($this -> search_cart($id) === false)\n {\n $prod['id'] = $id;\n $prod['quantity'] = $quantity;\n $_SESSION['cart'][] = $prod;\n\n $msg = \"Product is added to the cart\";\n echo json_encode($msg);\n }else echo json_encode(\"Already added\");\n\n }",
"function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }",
"public function addItemsToCartNewAction()\n {\n $decoded = $this->get('webservice.helper')->processRequest($this->getRequest());\n\n $user = array_key_exists('auth_token', $decoded) ? $this->get('webservice.helper')->findUserByAuthToken($decoded['auth_token']) : null;\n if ($user) {\n $items = isset($decoded[\"items\"]) ? $decoded[\"items\"] : \"0\";\n if ($items != 0) {\n //$this->container->get('cart.helper.cart')->removeUserCart($user);\n foreach ($items as $detail) {\n /*Remove From Wish list*/\n $this->container->get('cart.helper.wishlist')->removeWishlistByItem($user, $detail[\"item_id\"]);\n $this->container->get('cart.helper.cart')->fillCartforService($detail[\"item_id\"], $user, $detail[\"quantity\"]);\n }\n $resp = 'Items has been added to Cart Successfully';\n $res = $this->get('webservice.helper')->response_array(true, $resp);\n } else {\n $res = $this->get('webservice.helper')->response_array(false, 'Array Item not found');\n }\n } else {\n $res = $this->get('webservice.helper')->response_array(false, 'User not authenticated.');\n }\n return new Response($res);\n\n }",
"public function addToCart()\n { \n // is the request ajax?\n if( $this->request->is('ajax') ) {\n // get parameters (product id and wanted amount)\n $id = $this->request->data('id');\n $amount = $this->request->data('amount');\n $msg = \"cant add\";\n // get the product\n $product = TableRegistry::get('product')->find()->where(['id'=>$id])->first();\n // get the cart\n $cart = $this->getRequest()->getSession()->read('cart');\n // if trying to add 0 or negative amount of items to cart, remove the item compleately from the cart\n if($amount<1){\n $cart[\"$id\"] = null;\n unset($cart[\"$id\"]);\n } else {\n // try to add the item to the cart if there is enough of the product available\n if(isset($cart[\"$id\"])){\n if($product->amount>=($cart[\"$id\"]+$amount)){\n $cart[\"$id\"] += $amount;\n $msg = \"Added to cart\";\n }\n } else {\n if($product->amount>=$amount){\n $cart[\"$id\"] = $amount;\n $msg = \"Added to cart\";\n } \n }\n }\n // update the cart\n $this->getRequest()->getSession()->write('cart',$cart);\n echo json_encode([\"msg\"=>$msg,\"amount\"=>$product->amount-$cart[\"$id\"]]);\n return;\n }\n }",
"public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n\n $cart->addProduct($product, $params);\n if (!empty($related)) {\n $cart->addProductsByIds(explode(',', $related));\n }\n\n $cart->save();\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError()){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n //tobihille: CHANGE:\n // if IE and error > redirect to cart to show messages\n // user can go back in browser after reading message\n // if we don't do this, user does not get message \"quantity not sufficent\"\n $option_enabled = Mage::getStoreConfig('system/aoe_static/redirect_ie_cart_on_error');\n if ( stripos(Mage::app()->getRequest()->getServer('HTTP_USER_AGENT'), 'Trident') !== false &&\n !empty($option_enabled)\n )\n {\n $this->getResponse()->setRedirect( Mage::helper('checkout/cart')->getCartUrl() );\n }\n else\n {\n $this->getResponse()->setRedirect($url);\n }\n //tobihille: ENDCHANGE\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }",
"public function addItem(Cart $cart, CartItem $item);",
"public function addItem($id,$phone)\n{\n\n//$price = (int)str_replace(\"$\",\"\",$phone->price);//converts the price value back to string.\n //$quantity= $phone->id;\n\t$price = $phone->price; \n\t$name = $phone->name;\n\t$image = $phone->image;\n //$num = $phone->id;\n\n//First check if the phone is in the previous cart or not\n if(array_key_exists($id,$this->items))\n {\n //$productToAdd = $this->items[$id];\n $productToAdd = $items[$id]; //added\n $productToAdd['num']++;\n }\n else //if it is the first time the user is adding the item to the cart\n {\n $productToAdd = ['num' => 1, 'price'=>$price, 'name'=>$name,'image'=>$image]; \n }\n $this->items[$id] = $productToAdd;\n $this->totalQuantity++;\n $this->totalPrice = $this->totalPrice + $price;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get reverse path to current path part. | public function getReversePath()
{
return $this->pageContext->getReversePath();
} | [
"public function\t\t\tgetReversePath()\n\t{\n\t\treturn is_null($this->remainPath) ? \"\" : \\net\\dryuf\\core\\StringUtil::replaceRegExp(\\net\\dryuf\\core\\StringUtil::replaceRegExp($this->remainPath, \"[^/]+/\", \"../\"), \"[^/]+\\$\", \"\");\n\t}",
"public function getRelativePath()\n\t{\n\t\t$baseName = $this->initialPath->getName();\n\t\t$parts = explode($baseName, $this->currentPath->getName());\n\t\t$relPath = str_replace(Enviroment::getDirectorySeparator(), '/', $parts[1]);\n\n\t\tif(!preg_match('#^/#', $relPath))\n\t\t\t$relPath = '/' . $relPath;\n\n\t\treturn $relPath;\n\t}",
"public function current_path()\n\t{\n\t\t$url = parse_url($this->connection()->get('url'));\n\n\t\treturn $url['path'].(isset($url['query']) ? '?'.$url['query'] : '');\n\t}",
"public function getReverse()\n\t{\n\t\treturn (new Path())\n\t\t\t->setSegments(array_reverse($this->segments))\n\t\t\t->setSeparator($this->separator);\n\t}",
"public function getCurrentPath()\n {\n $result = '';\n \n $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? \"https://\" : \"http://\";\n $currentUrl = $protocol . $_SERVER['SERVER_NAME'];\n if ($_SERVER['SERVER_PORT'] !== '') {\n $currentUrl .= ':' . $_SERVER['SERVER_PORT'];\n }\n $currentUrl .= $_SERVER['REQUEST_URI'];\n \n // Remove the extra parameters\n $position = strrpos($currentUrl, '?');\n \n if ($position !== false) {\n $currentUrl = substr($currentUrl, 0, $position);\n }\n \n // Remove the file name\n $position = strrpos($currentUrl, '/', -0); \n \n if ($position !== false) {\n $currentUrl = substr($currentUrl, 0, $position + 1);\n }\n \n return $currentUrl;\n }",
"public function getFullPath()\n {\n $parentPath = $this->context->getFullPath();\n\n $fullPath = $this->getPath();\n\n if ($parentPath) {\n if (empty($fullPath)) {\n $fullPath = $parentPath;\n } else {\n $fullPath = $parentPath.'/'.$fullPath;\n }\n }\n\n return $fullPath;\n }",
"private function current_uri() {\r\n return implode('/', $this->uri->rsegments);\r\n }",
"public function getLastPathSegment(){\n $path = $this->path;\n if(strrpos($path, '/') === false){\n return $path;\n }\n return substr($path, strrpos($path, '/') + 1, strlen($path));\n }",
"public function getCurrentFullPath() {}",
"protected function getCurrentUrlPath()\n {\n return explode(\"?\", \\XLite\\Core\\URLManager::getCurrentURL())[0];\n }",
"public function getCurrentRelativePath()\n {\n }",
"public function getFullPath()\n\t{\n\t\treturn Generic::getCompletePath($this->getPath(), $this->getBasename());\n\t}",
"public function getFullPath()\n {\n $path = $this->isRelativePath() ? '/' : '';\n $path .= $this->getPath();\n $path .= empty($this->components['query']) ? '' : '?'.$this->components['query'];\n $path .= empty($this->components['fragment']) ? '' : '#'.$this->components['fragment'];\n\n return $path;\n }",
"public function getInternalPath()\n {\n return empty($this->currentFolder) ? '' : $this->currentFolder.'/';\n }",
"public function fullyQualifiedPathPreservingTrailingSlash()\n {\n $fqp = $this->fullyQualifiedPath();\n\n if ((substr($this->path, strlen($this->path) - 1) == '/') && (substr($fqp, strlen($fqp) - 1) != '/')) {\n $fqp .= '/';\n }\n return $fqp;\n }",
"function get_path_relativo()\n\t{\n\t\tif (! isset($this->_path_absoluto))\n\t\t\treturn $this->_dir_actual;\n\t\t$pos = strlen($this->_path_absoluto);\n\t\t$relativo = substr($this->_dir_actual, $pos);\n\t\treturn $relativo;\n\t}",
"public static function trailBackUrl(){\n\n $count = count(self::$segments);\n\n if($count) {\n\n // If there is a trailing slash, will increase the count by 1, so the path_back can be ok\n if(preg_match('/\\/$/',self::$uri_string)) $count++;\n\n // Add another slash, but will be removed\n $path=str_repeat(\"../\",$count+1);\n\n // Remove the last slash\n $path=substr($path,0,-1);\n\n return $path;\n }\n\n }",
"public function getFinalPath();",
"function getFullPath() {\n $path = '';\n if ($p = $this->getParent())\n $path .= $p->getFullPath();\n else\n $path .= '/';\n $path .= $this->getId() . '/';\n return $path;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List all and search movies (/movies/index) | function index()
{
$search = isset($_POST["searchterm"]) ? $_POST["searchterm"] : '';
$this->set('active','list');
$this->set('search',$search);
if($search)
{
$this->set('title','Results for '.$search . ' - Netflix Movies');
$this->set('data',$this->Movie->search($search));
}
else
{
$this->set('title','All Results - Netflix Movies');
$this->set('data',$this->Movie->selectAll());
}
} | [
"public function searchMovies() {\n $query = Input::get('title');\n\n if (!$query) {\n return Redirect::back();\n }\n\n $results = [];\n $response = Tmdb::getSearchApi()->searchMovies($query);\n $num_of_pages = $response['total_pages'];\n\n if ($num_of_pages > 1) {\n for($i = 1; $i <= $num_of_pages; $i++){\n $response = Tmdb::getSearchApi()->searchMovies($query, array('page' => $i));\n $movies = $response['results'];\n foreach($movies as $movie){\n array_push($results, $movie);\n }\n }\n }\n else {\n $movies = $response['results'];\n foreach($movies as $movie){\n array_push($results, $movie);\n }\n }\n return Redirect::back()->with('search_result', $results);\n }",
"public function actionIndex()\n {\n $searchModel = new MovieSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listMovies(){\n $this->printMovieWelcomeScreen('Movie List');\n $this->getMovieList();\n\n $this->waitForReturnToMenu();\n }",
"public function showMoviesAction() : object\n {\n $db = $this->app->db;\n $page = $this->app->page;\n\n $title = \"Show movies\";\n\n if (isset($_SESSION[\"resSearchTitle\"])) {\n $resultset = $this->getSession(\"resSearchTitle\");\n $searchTitle = $this->getSession(\"searchTitle\");\n } elseif (isset($_SESSION[\"resSearchYear\"])) {\n $year1 = $this->getSession(\"year1\");\n $year2 = $this->getSession(\"year2\");\n $resultset = $this->getSession(\"resSearchYear\");\n } else {\n $sql = \"SELECT * FROM movie;\";\n $resultset = $db->executeFetchAll($sql);\n }\n\n $page->add(\"movie/sidebar\");\n $page->add(\"movie/article-header\");\n $page->add(\"movie/search-title\", [\n \"searchTitle\" => $searchTitle ?? null,\n ]);\n $page->add(\"movie/search-year\", [\n \"year1\" => $year1 ?? null,\n \"year2\" => $year2 ?? null,\n ]);\n $page->add(\"movie/show-movies\", [\n \"resultset\" => $resultset,\n ]);\n $page->add(\"movie/article-footer\");\n\n return $page->render([\n \"title\" => $title,\n ]);\n }",
"public function indexAction()\n {\n\n $em = $this->getDoctrine()->getManager();\n\n $movies = $em->getRepository('AppBundle:Movies')->findAll();\n\n return $this->render('movies/index.html.twig', array(\n 'movies' => $movies,\n ));\n }",
"public static function allMovies()\n {\n return route('movies');\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $movies = $em->getRepository('AppBundle:Movie')->findAll();\n\n return $this->render('admin/movie/index.html.twig', array(\n 'movies' => $movies,\n ));\n }",
"public function searchMovies()\n {\n }",
"public function getAllMovies()\n {\n }",
"public function movieSearch(Request $request) {\n $search = $request->input('search');\n\n $requestURL = \"http://www.myapifilms.com/imdb?title=\".urlencode($search).\"&limit=5&token=fc9e6951-2b3b-4785-9553-bfb78754c740\";\n\n $movies = json_decode(file_get_contents($requestURL), true);\n\n $movies = $this->changeToValidPosterUrl($movies);\n\n return $movies;\n }",
"public function actionIndex()\n {\n $searchModel = new FilmSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listMovies()\n {\n $pdo = $this->getPdo();\n $query = 'SELECT * FROM movies';\n\n $statement = $pdo->prepare($query);\n $statement->execute();\n return $statement->fetchAll();\n }",
"public function actionIndex()\n {\n $searchModel = new FilmSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function discoverMovies()\n {\n return $this->get('discover/movie');\n }",
"public function testListMovies()\r\n {\r\n $response = $this->get('/movies');\r\n\r\n $response->assertStatus(200)\r\n ->assertSee(e($this->movie->title))\r\n ->assertSee(e($this->movie->genre))\r\n ->assertSee(e($this->movie->actors))\r\n ->assertSee($this->movie->path());\r\n }",
"public function allMovie() {\n $movies = Movie::with('genre','cast')->get();\n return view('admin.movie.allmovies', [\n 'movies' => $movies\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new RaFilmDocumentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function displayMovies() {\n $movies = Movie::get()->sortBy('name');\n return view('movies', [ 'movies' => $movies ]);\n }",
"public function getMoviesByFullTextSearch(){\n\t\ttry {\n\t\t\t//sanitize the form data\n\t\t\t$args = array(\n\t\t\t\t'movieSearch'\t\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieTitleFilter'\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieSagaFilter'\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieArtistFilter'\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieLoanFilter'\t\t=> FILTER_SANITIZE_STRING,\n\t\t\t\t'movieStorageFilter'\t=> FILTER_SANITIZE_NUMBER_INT,\n\t\t\t\t'movieSortType'\t\t\t=> FILTER_SANITIZE_NUMBER_INT,\n\t\t\t);\n\t\t\t$filters = filter_var_array($_POST, $args);\n\n\t\t\t$filters['movieStorageFilter'] = filter_var($filters['movieStorageFilter'], FILTER_VALIDATE_INT, array('min_range' => 1));\n\t\t\t$filters['movieSortType'] = filter_var($filters['movieSortType'], FILTER_VALIDATE_INT, array('min_range' => 0, 'max-range' => 4));\n\t\t\tif( $filters['movieSortType'] === false ) $filters['movieSortType'] = 0;\n\n\t\t\t//construct the query\n\t\t\t$sql = \" SELECT *\";\n\n\t\t\t$sqlSelect = array();\n\t\t\t$sqlWhere = array();\n\t\t\t$sqlOrder = 'score DESC, ';\n\t\t\t$params = array();\n\t\t\tif( !empty($filters['movieSearch']) ){\n\t\t\t\t$sqlSelect = array(\n\t\t\t\t\t\"MATCH(movieTitle) AGAINST (:searchS)\",\n\t\t\t\t\t\"MATCH(sagaTitle) AGAINST (:searchS)\",\n\t\t\t\t\t\"MATCH(artistFullName) AGAINST (:searchS)\",\n\t\t\t\t\t\"MATCH(loanHolder) AGAINST (:searchS)\",\n\t\t\t\t);\n\t\t\t\t$sqlWhere = array(\n\t\t\t\t\t\"MATCH(movieTitle) AGAINST (:searchW)\",\n\t\t\t\t\t\"MATCH(sagaTitle) AGAINST (:searchW)\",\n\t\t\t\t\t\"MATCH(artistFullName) AGAINST (:searchW)\",\n\t\t\t\t\t\"MATCH(loanHolder) AGAINST (:searchW)\",\n\t\t\t\t);\n\t\t\t\t$params[':searchS'] = $this->prepareForFullTextQuery($filters['movieSearch']);\n\t\t\t\t$params[':searchW'] = $params[':searchS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieTitleFilter']) ){\n\t\t\t\t$sqlSelect[] = \"MATCH(movieTitle) AGAINST (:movieTitleS)\";\n\t\t\t\t$sqlWhere[] = \"MATCH(movieTitle) AGAINST (:movieTitleW)\";\n\t\t\t\t$params[':movieTitleS'] = $this->prepareForFullTextQuery($filters['movieTitleFilter']);\n\t\t\t\t$params[':movieTitleW'] = $params[':movieTitleS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieSagaFilter']) ){\n\t\t\t\t$sqlSelect[] = \"MATCH(sagaTitle) AGAINST (:sagaTitleS)\";\n\t\t\t\t$sqlWhere[] = \"MATCH(sagaTitle) AGAINST (:sagaTitleW)\";\n\t\t\t\t$params[':sagaTitleS'] = $this->prepareForFullTextQuery($filters['movieSagaFilter']);\n\t\t\t\t$params[':sagaTitleW'] = $params[':sagaTitleS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieArtistFilter']) ){\n\t\t\t\t$sqlSelect[] = \"MATCH(artistFullName) AGAINST (:artistS)\";\n\t\t\t\t$sqlWhere[] = \"MATCH(artistFullName) AGAINST (:artistW)\";\n\t\t\t\t$params[':artistS'] = $this->prepareForFullTextQuery($filters['movieArtistFilter']);\n\t\t\t\t$params[':artistW'] = $params[':artistS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieLoanFilter']) ){\n\t\t\t\t$sqlSelect[] = \"MATCH(loanHolder) AGAINST (:loanS)\";\n\t\t\t\t$sqlWhere[] = \"MATCH(loanHolder) AGAINST (:loanW)\";\n\t\t\t\t$params[':loanS'] = $this->prepareForFullTextQuery($filters['movieLoanFilter']);\n\t\t\t\t$params[':loanW'] = $params[':loanS'];\n\t\t\t}\n\t\t\tif( !empty($filters['movieStorageFilter']) ){\n\t\t\t\t$sqlWhere[] = \"storageID = :storageID\";\n\t\t\t\t$params[':storageID'] = $filters['storageID'];\n\t\t\t}\n\n\t\t\t$sql = \" SELECT mft.*, ma.*\"\n\t\t\t\t .( !empty($sqlSelect) ? ', '.implode(' + ', $sqlSelect).' AS score' : '')\n\t\t\t\t .\" FROM movies_view_ft mft\"\n\t\t\t\t .\" INNER JOIN movie_artists_view_ft maft ON movieID = maft.movieFK \"\n\t\t\t\t .\" LEFT JOIN movie_artists_view ma ON movieID = ma.movieFK \"\n\t\t\t\t .\" WHERE 1 \"\n\t\t\t\t .( !empty($sqlWhere) ? ' AND '.implode(' AND ', $sqlWhere) : '')\n\t\t\t\t .\" ORDER BY \"\n\t\t\t\t .( !empty($sqlSelect) ? $sqlOrder : '')\n\t\t\t\t .$this->_sortTypes[$filters['movieSortType']];\n\n\t\t\t//stash cache init\n\t\t\t$stashFileSystem = new StashFileSystem(array('path' => STASH_PATH));\n\t\t\tStashBox::setHandler($stashFileSystem);\n\n\t\t\tStashManager::setHandler(get_class( $this ), $stashFileSystem);\n\t\t\tif( empty($params) ) $stash = StashBox::getCache(get_class( $this ), __FUNCTION__, $sql);\n\t\t\telse $stash = StashBox::getCache(get_class( $this ), __FUNCTION__, $sql, serialize($params));\n\t\t\t$results = $stash->get();\n\t\t\tif( $stash->isMiss() ){ //cache not found, retrieve values from database and stash them\n\n\t\t\t\t//drop the temporary table if it exists\n\t\t\t\t$destroyTmpTable = $this->db->prepare(\"DROP TEMPORARY TABLE IF EXISTS movies_view_ft\");\n\t\t\t\t$destroyTmpTable->execute();\n\t\t\t\t$destroyTmpTable = $this->db->prepare(\"DROP TEMPORARY TABLE IF EXISTS movie_artists_view_ft\");\n\t\t\t\t$destroyTmpTable->execute();\n\n\t\t\t\t//create the temporary table\n\t\t\t\t$tmpTable = $this->db->prepare(\"\n\t\t\t\t\tCREATE TEMPORARY TABLE movies_view_ft AS\n\t\t\t\t\tSELECT movieID, movieTitle, movieGenre, movieMediaType, movieLength, movieDate,\n\t\t\t\t\t\t\tsagaID, sagaTitle, movieSagaPosition, movieSagaSize, sagaSearchURL,\n\t\t\t\t\t\t\tstorageID, storageRoom, storageType, storageColumn, storageLine,\n\t\t\t\t\t\t\tloanID, loanHolder, loanDate\n\t\t\t\t\tFROM movies_view\n\t\t\t\t\");\n\t\t\t\t$tmpTable->execute();\n\n\t\t\t\t//add the fulltext index\n\t\t\t\t$indexTmpTable = $this->db->prepare(\"\n\t\t\t\t\tALTER TABLE movies_view_ft ENGINE = MyISAM,\n\t\t\t\t\tADD FULLTEXT INDEX movieFT (movieTitle),\n\t\t\t\t\tADD FULLTEXT INDEX sagaFT (sagaTitle),\n\t\t\t\t\tADD FULLTEXT INDEX loanFT (loanHolder),\n\t\t\t\t\tADD INDEX storageID (storageID),\n\t\t\t\t\tADD INDEX movieID (movieID)\n\t\t\t\t\");\n\t\t\t\t$indexTmpTable->execute();\n\n\t\t\t\t//create the temporary table\n\t\t\t\t$tmpTable = $this->db->prepare(\"\n\t\t\t\t\tCREATE TEMPORARY TABLE movie_artists_view_ft AS\n\t\t\t\t\tSELECT movieFK, artistID, CONCAT(artistFirstName, ' ', artistLastName) AS artistFullName\n\t\t\t\t\tFROM movie_artists_view\n\t\t\t\t\");\n\t\t\t\t$tmpTable->execute();\n\n\t\t\t\t//add the fulltext index\n\t\t\t\t$indexTmpTable = $this->db->prepare(\"\n\t\t\t\t\tALTER TABLE movie_artists_view_ft ENGINE = MyISAM,\n\t\t\t\t\tADD FULLTEXT INDEX artistFT (artistFullName),\n\t\t\t\t\tADD INDEX movieFK (movieFK)\n\t\t\t\t\");\n\t\t\t\t$indexTmpTable->execute();\n\n\n\t\t\t\t$getMovies = $this->db->prepare($sql);\n\n\t\t\t\t$getMovies->execute( $params );\n\n\t\t\t\t$results = $this->_merge($getMovies->fetchAll());\n\n\t\t\t\tif( !empty($results) ) $stash->store($results, STASH_EXPIRE);\n\t\t\t}\n\n\t\t\treturn $results;\n\n\t\t} catch ( PDOException $e ){\n\t\t\terreur_pdo( $e, get_class( $this ), __FUNCTION__ );\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END function test_formEmail provide_formEmail() Provides data to use for testing the formEmail method of the Rx_View_Helper_FormEmail class | public function provide_formEmail ( )
{
return array(
'simple test' => array(
'expected' => '<input type="email" name="test_name" id="test_name" value="test-value" class=" input email" />',
'name' => 'test_name',
'value' => 'test-value',
),
'disabled attribute test' => array(
'expected' => '<input type="email" name="test_name" id="test_name" value="test-value" disabled="disabled" class=" input email" />',
'name' => 'test_name',
'value' => 'test-value',
array(
'disable' => true,
)
),
);
} | [
"public function validEmailValidDataProvider() {}",
"function testEmailFieldPopulation() {\n\n\t\t$this->get('EmailFieldTest_Controller');\n\t\t$this->submitForm('Form_Form', null, array(\n\t\t\t'Email' => 'test@test.com'\n\t\t));\n\n\t\t$this->assertPartialMatchBySelector('p.good',array(\n\t\t\t'Test save was successful'\n\t\t));\n\t}",
"public function test_default_html_for_email() {\n\t\t$form_id = $this->get_form_id_for_test();\n\n\t\t$atts = array(\n\t\t\t'form_id' => $form_id,\n\t\t\t'default_email' => true,\n\t\t\t'plain_text' => false,\n\t\t);\n\n\t\t$content = $this->get_formatted_content( $atts );\n\t\t$expected_content = $this->get_expected_default_html( $atts );\n\n\t\t$this->assertSame( $expected_content, $content );\n\t}",
"public function getChangeEmailForm();",
"function showEmailForm()\r\n {\r\n $data = array();\r\n $data['cmdd'] = 'send';\r\n $data['email'] = getUserField('email');\r\n //dumpvar($_REQUEST);\r\n\r\n return createPage(EMAIL_FORM_TEMPLATE, $data);\r\n }",
"public function providerTestGetUserMail()\n {\n return [\n \"Invalid selector\" => array(\"123\", false),\n \"Valid selector\" => array(\"abc\", \"test@test.test\")\n ];\n }",
"function shib_auth_custom_email() {\n $form = array();\n\n $form['custom_mail'] = array(\n '#type' => 'textfield',\n '#title' => t('E-mail'),\n '#size' => 60,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Send'),\n );\n\n return $form;\n}",
"public function testEmailAction() {\n\t\t$content = array();\n\t\t$title = 'Test e-mail configuration';\n\t\t\n\t\t$content[] = Bootstrap::row()->add(12, Bootstrap::h(1, $title));\n\t\t\n\t\t$panel = Bootstrap::panel('Send test mail')->color('blue');\n\t\t$form = BootstrapUI::form()\n\t\t\t->horizontal()\n\t\t\t->add(Bootstrap::textfield('to', null, 'to e-mail')->placeholder('your@email.com'))\n\t\t\t->addSubmit('Submit')\n\t\t\t->addButton(Bootstrap::anchor('Cancel', Url::href('system', 'alerts'))->asButton()->color('red'));\n\t\t$panel->content($form);\n\t\t$content[] = Bootstrap::row()->add(8, $panel, 2);\n\t\t\n\t\treturn View::create('base')\n\t\t\t->with('title', $title)\n\t\t\t->with('content', $content);\n\t}",
"public function test_smtp_settings()\n {\n $this->load->model('violator_m');\n $this->load->helper(array('form', 'url'));\n $this->load->library('form_validation');\n \n $this->form_validation->set_rules('email', 'Email Address', 'xss_clean');\n \n //$email_settings = $this->violator_m->get_violator_notification_email_setting_by_store($store_id);\n \n if ($this->form_validation->run() === FALSE)\n {\n // validation failed, or first load\n }\n else\n {\n \n } \n }",
"public function testEmailFieldValidators() {\n $asserts = [\n Assert\\Length::class => \"lorem-ipsum-dolor-sit-amet.consectetur-adipiscing-elit.nullam-at-nibh-ut-sem-lobortis-ullamcorper@lorem.com\",\n Assert\\Email::class => \"nairus@\"\n ];\n\n $contactMessage = new ContactMessage();\n $contactMessage->setIp(\"127.0.0.99\")\n ->setMessage(\"Lorem ipsum dolor sit amet, consectetur cras amet.\")\n ->setName(\"Son Goku\")\n ->setRequestDate(new \\DateTime());\n $this->launchAssertions($asserts, $contactMessage, \"setEmail\");\n }",
"public function prepareDataforEmail($data = array())\n { \n $params = Factory::getApplication()->getUserState('com_tkdclub.participant.itemparams', '');\n $store_data = $data['store_data'] === 1 ? $store_data = Text::_('JYES') : $store_data = Text::_('JNO');\n $field_text = '';\n\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_FIRSTNAME') . ': ' . $data['firstname'] . \"\\r\\n\";\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_LASTNAME') . ': ' . $data['lastname'] . \"\\r\\n\";\n $data['email'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_EMAIL') . ': ' . $data['email'] . \"\\r\\n\" : null;\n $data['clubname'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_CLUB') . ': ' . $data['clubname'] . \"\\r\\n\" : null;\n $data['grade'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_GRADE_EMAIL') . ': ' . $data['grade'] . \"\\r\\n\" : null;\n $data['age'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_AGE') . ': ' . $data['age'] . \"\\r\\n\" : null;\n $data['registered'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_SUM') . ': ' . $data['registered'] . \"\\r\\n\" : null;\n $data['user1'] ? $field_text .= $params->user1 . ': ' . $data['user1'] . \"\\r\\n\" : null;\n $data['user2'] ? $field_text .= $params->user2 . ': ' . $data['user2'] . \"\\r\\n\" : null;\n $data['user3'] ? $field_text .= $params->user3 . ': ' . $data['user3'] . \"\\r\\n\" : null;\n $data['user4'] ? $field_text .= $params->user4 . ': ' . $data['user4'] . \"\\r\\n\" : null;\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_PRIVACY_ACCEPTED_EMAIL') . ': ' . Text::_('JYES') . \"\\r\\n\";\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_STOREDATA_ACCEPTED_EMAIL') . ': ' . $store_data . \"\\r\\n\";\n $data['notes'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_NOTES') . ': ' . $data['notes'] . \"\\r\\n\" : null;\n $field_text .= \"\\r\\n\";\n\n return $field_text;\n }",
"public function testEmailConfirmPost()\n {\n }",
"public function validEmailInvalidDataProvider() {}",
"function bibdk_modal_heimdal_write_email_form() {\n $form_state = _bibdk_modal_set_form_state();\n\n $output = bibdk_modal_form_wrapper('bibdk_heimdal_verify_email_form', $form_state);\n\n $commands = array();\n if (empty($form_state['executed']) && empty($form_state['submitted'])) {\n $commands = $output;\n }\n elseif (empty($form_state['executed']) && !empty($form_state['submitted'])) {\n $commands[] = bibdk_modal_command_replace_form($output);\n }\n elseif (!empty($form_state['executed']) && !empty($form_state['submitted'])) {\n $commands[] = bibdk_modal_command_reload();\n $commands[] = bibdk_modal_command_dismiss();\n }\n\n bibdk_modal_deliver_output($commands);\n}",
"function email_data(){\n $config = array(\n 'protocol' => 'smtp',\n 'smtp_host' => 'ssl://smtp.gmail.com',\n 'smtp_port' => '465',\n //for example: 'smtp_user' => 'example@gmail.com ', \n 'smtp_user' => 'dissectionmailer@gmail.com ', \n //for example: 'smtp_pass' => 'your password ',\n 'smtp_pass' => '6945635415*',\n 'charset' => 'utf-8',\n 'newline' => \"\\r\\n\",\n 'mailtype' => 'html',\n 'validation' => TRUE // bool whether to validate email or not \n );\n return $config;\n }",
"public function testRegistrationEmailWrongFormat(): void { }",
"public function testCreateUserCredentialsEmail()\n {\n }",
"private function EnviarEmail(){\n \n // setando conteudo do email para avisos\t\n\n \n }",
"function ninja_forms_register_field_email_validate(){\n\t$args = array(\n\t\t'name' => __( 'Validate E-mail', 'ninja-forms' ),\n\t\t'sidebar' => 'template_fields',\n\t\t'edit_function' => 'ninja_forms_email_validate_edit',\n\t\t'edit_options' => array(\n\t\t\tarray(\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'name' => 'email',\n\t\t\t\t'default' => 1,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'send_email',\n\t\t\t\t'label' => __( 'Send a response email to this email address?', 'ninja-forms' ),\n\t\t\t),\n\t\t\t// array(\n\t\t\t// \t'type' => 'checkbox',\n\t\t\t// \t'name' => 'from_email',\n\t\t\t// \t'label' => __( 'Use this as the \"From\" email address for Administrative recipients of this form?', 'ninja-forms' ),\n\t\t\t// ),\n\t\t\tarray(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'replyto_email',\n\t\t\t\t'label' => __( 'Use this email address as the Reply-To address?', 'ninja-forms' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'name' => 'user_email',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'name' => 'user_info_field_group',\n\t\t\t\t'default' => 1,\n\t\t\t),\n\t\t),\n\t\t'display_function' => 'ninja_forms_field_email_validate_display',\n\t\t'save_function' => '',\n\t\t'group' => 'standard_fields',\n\t\t'edit_label' => true,\n\t\t'edit_label_pos' => false,\n\t\t'edit_req' => true,\n\t\t'edit_custom_class' => true,\n\t\t'edit_help' => true,\n\t\t'edit_desc' => true,\n\t\t'edit_meta' => false,\n\t\t'edit_conditional' => true,\n\t\t'conditional' => array(\n\t\t\t'value' => array(\n\t\t\t\t'type' => 'text',\n\t\t\t),\n\t\t),\n\t\t'pre_process' => 'ninja_forms_field_email_validate_pre_process',\n\t);\n\n\tninja_forms_register_field( 'Email Validation', $args );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the metricType property value. The user experience analytics metric type. | public function setMetricType(?string $value): void {
$this->getBackingStore()->set('metricType', $value);
} | [
"public function setMetricClass($type, $class)\n {\n $this->metricClasses[$type] = $class;\n }",
"public function setAnomalyType(?UserExperienceAnalyticsAnomalyType $value): void {\n $this->getBackingStore()->set('anomalyType', $value);\n }",
"public function getMetricsType()\n {\n return $this->metrics_type;\n }",
"public function set_report_type($type)\n {\n }",
"public function set_meta_type($meta_type)\r\n {\r\n $this->meta_type = $meta_type;\r\n }",
"function set_meta_type( $meta_type ) {\n\t\t$this->_meta_type = $meta_type;\n\t}",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setUserType( $userType )\n {\n $this->_daUser->setUserType( $this->getId(), $userType );\n }",
"public function getMetricType()\n {\n if (array_key_exists(\"metricType\", $this->_propDict)) {\n return $this->_propDict[\"metricType\"];\n } else {\n return null;\n }\n }",
"public function set_performance_type( $performance_type ) {\n\t\t$this->performance_type = $performance_type;\n\t}",
"public function setUsageType(string $usage_type): void\n {\n $this->_usage_type = $usage_type;\n }",
"public function setAnalysisType($type);",
"function set_user_type($user_type)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER_TYPE, $user_type);\r\n }",
"public function setUsageCalculationType(string $usage_calculation_type): void\n {\n $this->_usage_calculation_type = $usage_calculation_type;\n }",
"public function setAnnotationType($type)\n {\n $this->currentAnnotation['type'] = $type;\n }",
"public function setActionType($actionType) {\n $this->actionType = $actionType;\n }",
"public function set_type( $type ) {\n\n\t\tif ( isset( $this->options['type'] ) && $this->options['type'] === $type )\n\t\t\treturn;\n\n\t\tparent::set_type( $type );\n\n\t\t$this->options['type'] = $type;\n\n\t\t$this->clear_filesize_cache();\n\n\t}",
"public function set_type($type)\n\t{\n\t\t$this->contrib_type = $type;\n\t\t$this->type = $this->types->get($this->contrib_type);\n\t}",
"function UpdateMetric($type)\n{\n $sql = \"UPDATE heroku_7e12094ae71a8cd.metrics SET metric_value = metric_value + 1 WHERE metric_type = '{$type}'\";\n QueryTable($sql);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets query for [[MstStatus]]. | public function getMstStatus()
{
return $this->hasOne(MstStatus::className(), ['id' => 'mst_status_id']);
} | [
"public function getStatus()\n {\n return $this->queryStatus;\n }",
"public function get_mms_status()\n {\n if ($this->_mms_status && is_array($this->_mms_status)) {\n return $this->_mms_status;\n } else {\n return FALSE;\n }\n }",
"public function getStatus()\n {\n return $this->driverCommand(BaseConstants::$GET, '/status');\n }",
"function GetStatus()\r\n\t{\r\n\t\treturn $this->m_status;\r\n\t}",
"public function getAllStatus()\n\t{\n\t\treturn $this->status;\n\t}",
"private function query_status() {\n\t\tif ($this->header === true) {\n\t\t\t$status = new eyewire_status($this->status . '-header', $this->issue);\n\t\t} else {\n\t\t\t$status = new eyewire_status($this->status, $this->issue);\n\t\t}\n\t\t\n\t\t$status->get_tasks($this->user);\n\n\t\t// Prepare result object\n\t\t$result = new stdClass();\n\t\t$result->status = $this->status;\n\t\t$result->statusText = $status->Text();\n\t\t$result->header = $this->header;\n\t\t$result->issue = $this->issue;\n\t\t$result->user = $this->user;\n\t\t$result->tasks = $status->Tasks();\n\t\t$result->count = $status->Total();\n\t\t\n\t\t// Save result to request output\n\t\t$this->request->OutputType('text/json');\n\t\t$this->request->OutputReplace(json_encode($result));\n\t\t\n\t}",
"function getDetailedStatus() ;",
"public function getMdmStatus()\n {\n if (array_key_exists(\"mdmStatus\", $this->_propDict)) {\n return $this->_propDict[\"mdmStatus\"];\n } else {\n return null;\n }\n }",
"public function getStatuses(){\n if($this->mastodon_user_id > 0){\n \n //Create our object\n $http = HttpRequest::Instance($this->getApiURL());\n $statusses = $http::Get(\n \"api/v1/accounts/{$this->mastodon_user_id}/statuses\",\n null,\n $this->getHeaders()\n );\n if(is_array($statusses) && count($statusses) > 0){\n return $statusses;\n }\n \n }\n return false;\n }",
"public function getLatestStatus();",
"public function getStatus() {\n $query = $this->db->get('tb_status');\n //Retorna em formato de array\n return $query->result();\n }",
"public static function getStatuses()\n {\n $sql = 'SELECT * FROM reservation_status';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }",
"function getStatus($item_id)\t{\n\t\t$query = new Query();\n\t\t$query->sql(\"SELECT status FROM \".UT_ITE.\" WHERE id = $item_id\");\n\t\treturn $query->getQueryResult(0, \"status\"); \n\t}",
"public function getType(): string\n {\n return CoreAdminQuery::ACTION_STATUS;\n }",
"public function getStatus() {\n $this->request = new stdClass();\n $this->request->msisdnList = $this->mobile;\n\n $this->__request('getPhoneStatus');\n\n $response = new stdClass();\n $response->status = $this->response->msisdnList->classIdList->status;\n return $response;\n }",
"public function getStatus();",
"public function getStatus()\r\n {\r\n return $this->fields['Status']['value'];\r\n }",
"public function getAllMaritalStatus()\n {\n \t$sql = \"SELECT * FROM ref_marital_status ORDER BY rms_desc\";\n \t\n \t$que = $this->db->query($sql);\n \treturn $que->result_array();\n \t\n }",
"private function getAllStatus()\n {\n return $status = tb_csc_acordo_status::all();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the native translation of greaterThan token. | public function greaterThan(TokenConditionGreaterThan $token, TokenBase $previous = null) {
return "`{$token->property}` > '{$token->value}'";
} | [
"public static function greater() { return self::$gt; }",
"function gt($value)\n{\n return new Expr\\Expression('%s > ?', [$value]);\n}",
"public function greaterThanOrEquals(TokenConditionGreaterThanOrEquals $token, TokenBase $previous = null) {\n\t\treturn \"\\t{$token->property} >= {$token->value}\";\n\t}",
"public function gt($value1, $value2)\r\n {\r\n $value1 = $this->getIdentifier($value1);\r\n $value2 = $this->getIdentifier($value2);\r\n return $value1 . ' > ' . $value2;\r\n }",
"public function gt ()\n {\n return ( $this->operand > $this->validation->value );\n }",
"function mGREATER(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$GREATER;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:688:3: ( '>' ) \n // Tokenizer11.g:689:3: '>' \n {\n $this->matchChar(62); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function greaterThan($comp) {\n return $this->compare($comp, \">\");\n }",
"public function greater($b);",
"protected function _gle( $value )\n\t{\n\t\tswitch ( $value )\n\t\t{\n\t\t\tcase 'g':\n\t\t\t\t$lang = 'gt';\n\t\t\t\tbreak;\n\t\t\tcase 'l':\n\t\t\t\t$lang = 'lt';\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\t\t$lang = 'exactly';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn mb_strtolower( \\IPS\\Member::loggedIn()->language()->addToStack( $lang ) );\n\t}",
"public function visitBinaryIsGreater(Node $node);",
"function get_locale_translation_status( int $percent_translated ): string {\n\tif ( $percent_translated == 100 ) {\n\t\treturn 'translated-100';\n\t} elseif ( $percent_translated >= 95 ) {\n\t\treturn 'translated-95';\n\t} elseif ( $percent_translated >= 90 ) {\n\t\treturn 'translated-90';\n\t} elseif ( $percent_translated >= 50 ) {\n\t\treturn 'translated-50';\n\t} else {\n\t\treturn 'translated-50-less';\n\t}\n}",
"public function greaterThan($value) {\n return Restrictions::greaterThan($this->name, $value);\n }",
"public function getGreaterThanOrderID()\n {\n return $this->greaterThanOrderID;\n }",
"public function greater($b)\n {\n switch (true) {\n case $b instanceof Matrix:\n $c = $this->greaterMatrix($b);\n break;\n\n case $b instanceof ColumnVector:\n $c = $this->greaterColumnVector($b);\n break;\n\n case $b instanceof Vector:\n $c = $this->greaterVector($b);\n break;\n\n case is_int($b) or is_float($b):\n $c = $this->greaterScalar($b);\n break;\n\n default:\n throw new InvalidArgumentException('Cannot compare matrix'\n . ' to a ' . gettype($b) . '.');\n }\n\n return $c;\n }",
"public function greaterThan($value)\n {\n return $this->get() > $value;\n }",
"public static function greaterThan($version1, $version2)\n {\n return self::compare($version1, '>', $version2);\n }",
"private static function buildGreaterThan(Build $v1, Build $v2)\n {\n return $v1->getNumber() > $v2->getNumber();\n }",
"public function greaterThan($variable)\n {\n return new Operator\\GreaterThan($this, $this->asVariable($variable));\n }",
"private function getComparisonOp(?int $numValue = null): string\n {\n if ($numValue === 2) {\n return '>';\n } elseif ($numValue === 3) {\n return '<';\n } else {\n return '=';\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of segni_taglio | public function getSegni_taglio()
{
return $this->segni_taglio;
} | [
"public function get_tag();",
"public function setSegni_taglio($segni_taglio)\n {\n $this->segni_taglio = $segni_taglio;\n\n return $this;\n }",
"function tag()\n {\n return di()->get('tag');\n }",
"public function getTag()\n {\n return $this->get(self::tag);\n }",
"public function getTag ()\n {\n return $this->tag;\n }",
"public function getIdTagu()\n\t{\n\t\treturn $this->id_tagu;\n\t}",
"public function getTag()\n {\n return $this->tag;\n }",
"public function getTagValue()\n {\n return $this->tag_value;\n }",
"public function getIGetTag()\n {\n return $this->get(self::IGETTAG);\n }",
"function wl_tagline () {\n\techo $this->valores['tagline'];\n}",
"public function getIdTag()\n {\n return $this->id_tag;\n }",
"public function getTag()\n {\n }",
"public function getTagId()\r\n {\r\n return $this->tagId;\r\n }",
"public function getTagline(){\r\n\t\t\treturn $this->tagline;\r\n\t\t}",
"public function getTagId()\r\n\r\n\t{\r\n\r\n\t\treturn $this->tagId;\r\n\r\n \t}",
"public function getIdTag()\n {\n return $this->idTag;\n }",
"public function getSystemTag() {\n\t\treturn $this->tag;\n\t}",
"public function getTag()\n {\n return $this->name;\n }",
"public function getTagAsString() {\r\n\t\treturn Util::uLongToString($this->tag);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Links tag to the note | public function linkTag($tag)
{
if (empty($tag))
return false;
$tagInstance = Tag::findByName($tag);
if (is_null($tagInstance))
$tagInstance = Tag::createNew($tag);
$connection = \Yii::$app->db;
$connection->createCommand()->insert('note_tag', array(
'note_id' => $this->id,
'tag_id' => $tagInstance->id
))->execute();
} | [
"function get_tag_link($tag)\n {\n }",
"function dbt_the_LinkTag($text=\"Bookmark on del.icio.us\",$attr=\"\") {\r\n\t\tglobal $post;\r\n\t\tif($post && is_object($post) && $post->ID>0) {\r\n\t\t\tdbt_addJavaScript();\r\n\t\t\techo \"<a href=\\\"#\\\" onclick=\\\"return dbt_bookmark('\" . get_permalink($post->ID) . \"');\\\" $attr>$text</a>\";\r\n\t\t}\r\n\t}",
"public function testAddNoteLink()\n {\n }",
"public function addTag();",
"public function makeTag()\n {\n $link = $this->getCObj()->typoLink($this->_makeLabel(), $this->_makeConfig('tag'));\n if ($this->isAbsUrl() && (@simplexml_load_string($link))) {\n $link = self::parseAbsUrl($link, $this->getAbsUrlSchema());\n }\n\n return $link;\n }",
"function build_tag_link($tag)\n\t{\n\t\t$tag_link = '<a href=\"' . append_sid(CMS_PAGE_TAGS . '?mode=view&tag_text=' . urlencode($tag)) . '\">' . $tag . '</a>';\n\n\t\treturn $tag_link;\n\t}",
"function tagreplace_link($replace, $opentag, $tagoriginal, $closetag, $sign) {\n\n global $cfg, $defaults, $specialvars;\n\n $tagwert = $tagoriginal;\n // ------------------------------\n\n // tcpdf extra\n if ( $cfg[\"pdfc\"][\"state\"] == true ) {\n if ( !preg_match(\"/^http/\",$tagwert) ) {\n $tagwert = \"http://\".$_SERVER[\"SERVER_NAME\"].\"/\".$tagwert;\n }\n }\n\n if ( $sign == \"]\" ) {\n $ausgabewert = \"<a href=\\\"\".$tagwert.\"\\\" title=\\\"\".$tagwert.\"\\\">\".$tagwert.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n } else {\n $tagwerte = explode(\"]\",$tagwert,2);\n $linkwerte = explode(\";\",$tagwerte[0]);\n $href = $linkwerte[0];\n if ( !isset($tagwerte[1]) ) {\n $beschriftung = $href;\n } else {\n $beschriftung = $tagwerte[1];\n }\n\n // ziel\n if ( isset($linkwerte[1]) ) {\n $target = \" target=\\\"\".$linkwerte[1].\"\\\"\";\n } else {\n $target = null;\n }\n\n // title-tag\n if ( isset($linkwerte[2]) ) {\n $title = $linkwerte[2];\n } else {\n if ( !isset($linkwerte[1]) ) $linkwerte[1] = null;\n if ( $linkwerte[1] == \"_blank\" ) {\n $title = \"Link in neuem Fenster: \".str_replace(\"http://\",\"\",$href);\n } elseif ( !strstr($beschriftung,\"<\") ) {\n $title = $beschriftung;\n } else {\n $title = null;\n }\n }\n\n // css-klasse\n $class = \" class=\\\"link_intern\";\n if ( preg_match(\"/^http/\",$href) ) { # automatik\n $class = \" class=\\\"link_extern\";\n } elseif ( preg_match(\"/^\".str_replace(\"/\",\"\\/\",$cfg[\"file\"][\"base\"][\"webdir\"]).\".*\\.([a-zA-Z]+)/\",$href,$match) ) {\n if ( $cfg[\"file\"][\"filetyp\"][$match[1]] != \"\" ) {\n $class = \" class=\\\"link_\".$cfg[\"file\"][\"filetyp\"][$match[1]];\n }\n }\n if ( isset($linkwerte[3]) ) { # oder manuell\n $class .= \" \".$linkwerte[3];\n }\n $class .= \"\\\"\";\n\n // id\n if ( isset($linkwerte[4]) ) {\n $id = \" id=\\\"\".$linkwerte[4].\"\\\"\";\n } else {\n $id = null;\n }\n\n if ( !isset($pic) ) $pic = null;\n $ausgabewert = $pic.\"<a href=\\\"\".$href.\"\\\"\".$id.$target.\" title=\\\"\".$title.\"\\\"\".$class.\">\".$beschriftung.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n }\n\n // ------------------------------\n return $replace;\n }",
"public function addTagLink($tag)\n {\n return Horde::url('browse.php')->add(array('tag' => $tag));\n }",
"function ozh_ta_linkify_local( &$tag, $key, $nofollow ) {\r\n\t$tag = '<a href=\"'.ozh_ta_get_tag_link( $tag ).'\">#'.$tag.'</a>';\r\n}",
"function link($image,$text=\"\",$uri,$help=\"\",$helpfree=\"\",$name=\"\")\r\n {\r\n if (right::field_view($help))\r\n {\r\n $retString = \"\";\r\n if ($name) $retString .= \"<a name='anchor$name'></a>\"; // insert anchor\r\n \r\n if (right::field_edit($help)) // editable: enable edit\r\n {\r\n $retString .= \"<a href='$uri'\";\r\n \t\t if ($help or $helpfree) $retString .= help::show($help,$helpfree);\r\n $retString .= \">\";\r\n \r\n if ($image) $retString .= grafik::disp($image,$text,20);\r\n else $retString .= $text;\r\n $retString .= \"</a>\";\r\n }\r\n else\r\n {\r\n $retString .= $text;\r\n }\r\n }\r\n return ($retString);\r\n }",
"public function renderLink();",
"function tag_get_link( array $p_tag_row ) {\n\treturn sprintf(\n\t\t'<a class=\"btn btn-xs btn-primary btn-white btn-round\" href=\"tag_view_page.php?tag_id=%s\" title=\"%s\">%s</a>',\n\t\t$p_tag_row['id'],\n\t\tstring_display_line( $p_tag_row['description'] ),\n\t\tstring_display_line( $p_tag_row['name'] )\n\t);\n}",
"public function link()\n {\n }",
"function showReplyLink()\n {\n $this->out->elementStart('li', 'reply');\n \t$this->out->elementStart('a', array('href' => common_path('notice/replyat/' . $this->profile->uname),\n \t\t\t\t\t'nid' => $this->notice->id,\n 'title' => '回复'));\n \t$this->out->text('回复');\n \t$this->out->elementEnd('a'); \t\t\n \t$this->out->elementEnd('li');\n }",
"public function tag() {return 'trello';}",
"function linkTags($tags)\n{\n\t$tags = explode(\", \", $tags);\n\tforeach ($tags as $k => $tag) $tags[$k] = \"<a href='\" . makeLink(\"search\", \"?q2=tag:$tag\") . \"'>$tag</a>\";\n\treturn implode(\", \", $tags);\n}",
"function ref_shortcode($atts, $content = \"\") {\n $foot = CMOA_Footnotes::getInstance();\n $foot->addNote($content);\n $count = count($foot->getNotes());\n return $foot->mustache->render('footnote-link.html', array('count' => $count, 'content' => $content));\n}",
"function s2t_is_link_note($link)\n{\n return strpos($link['url'], $link['shorturl']) !== false;\n}",
"public function makeLinkButton() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handler: _copyMultiple If multiple arrays are passed as arguments mulitple will be returned. Otherwise _copy is used. | private static function _copyMultiple($function, $args)
{
$function(...$args);
$arrays = [];
foreach ($args as $arg) {
if (is_array($arg)) {
$arrays[] = $arg;
}
}
if (count($arrays) === 1) {
return $arrays[0];
}
return $arrays;
} | [
"public static function batchCopy() {\n $result = array();\n $copied = lC_Products_Admin::batchCopy($_GET['batch'], $_GET['new_category_id'], $_GET['copy_as']);\n if ($copied) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public function copy($ids);",
"public function testCopyMultiple()\n {\n $config = array(\n 'test1' => 'new1',\n 'test2' => 'new2',\n );\n $request = array(\n 'Attributes' => array('test1' => array('val1'), 'test2' => array('val2.1','val2.2')),\n );\n $result = self::processFilter($config, $request);\n $attributes = $result['Attributes'];\n $this->assertArrayHasKey('new1', $attributes);\n $this->assertEquals($attributes['new1'], array('val1'));\n $this->assertArrayHasKey('new2', $attributes);\n $this->assertEquals($attributes['new2'], array('val2.1','val2.2'));\n }",
"public function testImagesBatchCopy()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function array_copy( array $array ) {\n $copy = array();\n foreach( $array as $key => $val ) {\n if(is_array($val)) \n $copy[$key] = array_copy($val);\n elseif (is_object( $val )) \n $copy[$key] = clone $val;\n else \n $copy[$key] = $val;\n }\n return $copy;\n }",
"static function JoinArrays(){\n\t\t$out = array();\n\t\t$arguments = func_get_args();\n\t\tforeach($arguments as $arg){\n\t\t\tif(!isset($arg)){ continue; }\n\t\t\tif(!is_array($arg)){ $arg = array($arg); }\n\t\t\tforeach($arg as $item){\n\t\t\t\t$out[] = $item;\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}",
"protected function cloneArgumentsForQueueing(array $arguments)\n {\n return array_map(function ($a) {\n return is_object($a) ? clone $a : $a;\n }, $arguments);\n }",
"function T3COPY($source,$dest,&$filearray,$level) {\r\n\t\t\t$this->tx_cbywebdav_devlog(3,\"=== T3COPY > \".$dest.\" \".$source,\"cby_webdav\",\"COPY\");\r\n\t\t\t$t3io=$this->CFG->t3io;\r\n\t\t\t$source=$this->_slashify($source);\r\n \t$filearray[$level][$source][]=$source;\r\n\t\t\t$sourceinfo=$t3io->T3IsFile($source); \r\n\t\t\t$lvl=$level;\r\n\t\t\t$destinfo=$t3io->T3IsFile($dest);\r\n\t\t\t$file = $this->_slashify($source);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t$fileinfo=$t3io->T3IsFile($file); \r\n\t\t\t$new=!$destinfo['exists']; \t\t\t\t\t\t\r\n\t\t\t$this->tx_cbywebdav_devlog(2,\"=== T3COPY file \".serialize($fileinfo).\" files : \".serialize($files),\"cby_webdav\",\"COPY\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t//if ($fileinfo['isWebmount'] && $fileinfo['isDir']) { // Répertoire Webmount\r\n\r\n\t\t\t// we handle copy root rename here ....\r\n\t\t\t$page['title']=basename($file);\r\n\t\t\t// we handle copy root rename here ....\r\n\t\t\t$this->tx_cbywebdav_devlog(3,\"=== T3COPY fs \".$file.\" \".$source,\"cby_webdav\",\"COPY\");\r\n\t\t\t// if we are first dir to copy we take dest dir name\r\n\t\t\tif ($file==$source && $level==0 && $new){\r\n\t\t\t\t$this->tx_cbywebdav_devlog(3,\"=== T3COPY f=s \".$file.\" \".$source,\"cby_webdav\",\"COPY\");\r\n\t\t\t\t$page['title']=basename($dest);\r\n\t\t\t}\r\n\r\n\t\t\t$page['pid']=$destinfo['pid'];\r\n\t\t\tif ($destinfo['isWebmount']) $page['title']=$t3io->T3ExtractPageTitle($destinfo['uid'],$page['title']);\r\n\t\t\t//$where=\" uid='$sourceinfo[uid]' \";\r\n\t\t\t$this->tx_cbywebdav_devlog(2,\"=== T3COPY \".$this->CFG->T3DB->INSERTquery('pages',$page),\"cby_webdav\",\"COPY\");\r\n\t\t\t\t\t\r\n\t\t\t$this->CFG->T3DB->exec_INSERTquery('pages',$page); \t\t// copie récursive à mettre en place ici ...???\t\t\t\t\t\r\n\t\t\t$pid=$this->CFG->T3DB->sql_insert_id();\t\r\n\r\n\t\t\t// we copy the page content ...\r\n\t\t\t\r\n\t\t\t$this->tx_cbywebdav_devlog(2,\"=== T3COPY $source sinfo : \".serialize($sourceinfo).\" #######################\",\"cby_webdav\",\"COPY\");\r\n\t\t\t\r\n\t\t\t// We add the tt_content, could also be tt_news, users (vcf ...)\r\n\t\t\t$content['pid']=$pid;\r\n\t\t\t\r\n\t\t\t$enable=$GLOBALS['TSFE']->sys_page->enableFields('tt_content',-1,array('fe_group'=>1));\r\n\t\t\t$res=$this->CFG->T3DB->exec_SELECTquery('header','tt_content','pid='.intval($sourceinfo['uid']).$enable );\r\n\t\t\tif ($res) {\r\n\t\t\t\twhile ($row=$this->CFG->T3DB->sql_fetch_assoc($res)) {\r\n\t\t\t\t\t$file=$source.$row['header'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t$fileinfo=$t3io->T3IsFile($file);\r\n\t\t\t\t\t$destinfo=$t3io->T3IsFile($dest.'/'.$row['header']);\t\t\t\t\t\r\n\t\t\t\t\t//TODO handle upload file rename ...\r\n\t\t\t\t\t//$content['header']=basename($file);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$where=\" uid='$destinfo[uid]' \";\r\n\t\t\t\t\tif ($destinfo['isWebmount']) {\r\n\t\t\t\t\t\tif ($destinfo['uid']) {\r\n\t\t\t\t\t\t\t$this->CFG->T3DB->exec_UPDATEquery('tt_content',$where,$content); \r\n\t\t\t\t\t\t \t$this->tx_cbywebdav_devlog(2,\"=== COPY \".$this->CFG->T3DB->UPDATEquery('tt_content',$where,$content),\"cby_webdav\",\"COPY\");\r\n\t\t\t\t\t\t} else {\t\r\n \t\t\t\t\t\t\t$content['header']=basename($file); \r\n\t\t\t\t\t\t\t$this->CFG->T3DB->exec_INSERTquery('tt_content',$content); \t\r\n\t\t\t\t\t\t \t$this->tx_cbywebdav_devlog(2,\"=== COPY \".$this->CFG->T3DB->INSERTquery('tt_content',$content),\"cby_webdav\",\"COPY\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// We get the directories (pages)....(should be a recursive call here ...\r\n\t\t\t$enable=$GLOBALS['TSFE']->sys_page->enableFields('pages',-1,array('fe_group'=>1));\r\n\t\t\t$res=$this->CFG->T3DB->exec_SELECTquery('title','pages','pid='.intval($sourceinfo['uid']).$enable );\r\n\t\t\tif ($res) {\r\n\t\t\t\twhile ($row=$this->CFG->T3DB->sql_fetch_assoc($res)) {\r\n\t\t\t\t\t$this->T3COPY($source.$row['title'].'/',$dest.'/'.$page['title'],$filearray,$level+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->tx_cbywebdav_devlog(2,\"=== T3COPY files:\" .serialize($filearray).\" #######################\",\"cby_webdav\",\"COPY\");\r\n }",
"function _arrayMergeMixed() {\n $array = [];\n foreach (func_get_args() as $arg) {\n if (is_array($arg)) {\n $array = _flattenArray($arg);\n } else if ($arg) {\n $array [] = $arg;\n }\n }\n return $array;\n}",
"public function testDataSetsBatchCopy()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testPrivateImagesBatchCopy()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public static function dataProviderCopyMove(): array\n {\n return [\n [\n [\n 'operation' => 'copy',\n 'fileNames' => [\n 'some_file_1',\n 'some_file_2',\n ],\n 'filePaths' => [\n '/some_dir/some_file_1',\n '/some_dir/some_file_2',\n ],\n 'responseCode' => 200,\n 'assert' => true,\n ],\n ],\n [\n [\n 'operation' => 'copy',\n 'fileNames' => [\n 'some_file_1',\n 'some_file_2',\n ],\n 'filePaths' => [\n '/some_dir/some_file_1',\n '/some_other_invalid_dir/some_file_2',\n ],\n 'responseCode' => 200,\n 'assert' => false // because the files are in different folders which is illegal\n ],\n ],\n [\n [\n 'operation' => 'move',\n 'fileNames' => [\n 'some_file_1',\n 'some_file_2',\n ],\n 'filePaths' => [\n '/some_dir/some_file_1',\n '/some_dir/some_file_2',\n ],\n 'responseCode' => 200,\n 'assert' => true,\n ],\n ],\n [\n [\n 'operation' => 'move',\n 'fileNames' => [\n 'some_file_1',\n 'some_file_2',\n ],\n 'filePaths' => [\n '/some_dir/some_file_1',\n '/some_other_invalid_dir/some_file_2',\n ],\n 'responseCode' => 200,\n 'assert' => false // because the files are in different folders which is illegal\n ],\n ],\n ];\n }",
"function concat() {\n $arrs = func_get_args();\n return apply('array_merge', $arrs);\n}",
"public function getArrayCopy()\n {\n \treturn get_object_vars($this);\n }",
"function &array_copy(array &$array) {\n\t\t$copy = array();\n\n\t\t$keys = array_keys($array);\n\t\t$vals = array_values($array);\n\t\t$count = count($keys);\n\n\t\tfor($i = 0; $i < $count; ++$i) {\n\n\t\t\t// assume scalar / immediate\n\t\t\t$val = $vals[$i];\n\n\t\t\tif(is_object($val))\n\t\t\t\t$val = clone $val;\n\t\t\telse if(is_array($val))\n\t\t\t\t$val = &$this->deepCopy($val);\n\n\t\t\t// make the copy\n\t\t\t$copy[$keys[$i]] = &$val;\n\t\t}\n\n\t\treturn $copy;\n\t}",
"function SetMultiPaste($multiPaste){}",
"function makeArray()\n {\n return func_get_args();\n }",
"function addtoarray_single($array1, $array2)\n{\n //\n if (is_array($array2))\n {\n foreach ($array2 as $ar)\n {\n if ($ar && $ar !== null)\n {\n $array1[]=$ar;\n }\n }\n }\n return $array1;\n}",
"function arrayUnion()\n{\n\t$args = func_get_args();\n\t//if only 1 arg, use arrays in this arg \n\tif(count($args) == 1)\n\t\t$args = reset($args);\n\n\t$result = array();\n\tforeach($args as $ar)\n\t\tforeach ($ar as $key => $value)\n\t\t\t$result[$key] = $value;\n\n\treturn $result;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test for new lines removal. | public function testNewLines()
{
$this->assertEquals('testnewlines', $this->getSlugger()->slugify("test\nnew\rlines\n\r"));
} | [
"function line_endings_cleanup() {\n\tglobal $fcontents;\n\n\t$ct = preg_match(\"/\\r\\n(\\r\\n)+/\", $fcontents);\n\t$ct += preg_match(\"/\\r\\r+/\", $fcontents);\n\t$ct += preg_match(\"/\\n\\n+/\", $fcontents);\n\tif ($ct>0) {\n\t\t$fcontents = preg_replace(array(\"/(\\r\\n)+/\", \"/\\r+/\", \"/\\n+/\"), array(\"\\r\\n\", \"\\r\", \"\\n\"), $fcontents);\n\t\treturn true;\n\t}\n\telse return false;\n}",
"function need_line_endings_cleanup() {\n\tglobal $fcontents;\n\n\t$ct = preg_match(\"/\\r\\n(\\r\\n)+/\", $fcontents);\n\t$ct += preg_match(\"/\\r\\r+/\", $fcontents);\n\t$ct += preg_match(\"/\\n\\n+/\", $fcontents);\n\tif ($ct>0) {\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function testNewlines() {\n $this->assertEquals(\"Testing\\rCarriage\\rReturns\", Sanitize::newlines(\"Testing\\rCarriage\\r\\rReturns\"));\n $this->assertEquals(\"Testing\\r\\rCarriage\\rReturns\", Sanitize::newlines(\"Testing\\r\\rCarriage\\r\\r\\rReturns\", array('limit' => 3)));\n $this->assertEquals(\"TestingCarriageReturns\", Sanitize::newlines(\"Testing\\r\\rCarriage\\r\\r\\rReturns\", array('limit' => 0)));\n\n $this->assertEquals(\"Testing\\nLine\\nFeeds\", Sanitize::newlines(\"Testing\\nLine\\n\\nFeeds\"));\n $this->assertEquals(\"Testing\\nLine\\n\\nFeeds\", Sanitize::newlines(\"Testing\\n\\n\\nLine\\n\\nFeeds\", array('limit' => 3)));\n $this->assertEquals(\"TestingLineFeeds\", Sanitize::newlines(\"Testing\\n\\nLine\\n\\nFeeds\", array('limit' => 0)));\n\n $this->assertEquals(\"Testing\\r\\nBoth\\r\\nLineFeeds\\r\\n\\r\\nAnd\\r\\nCarriageReturns\", Sanitize::newlines(\"Testing\\r\\nBoth\\r\\r\\n\\nLineFeeds\\r\\n\\r\\r\\n\\nAnd\\r\\nCarriageReturns\"));\n $this->assertEquals(\"Testing\\r\\nBoth\\r\\nLineFeeds\\r\\nAnd\\r\\nCarriageReturns\", Sanitize::newlines(\"Testing\\r\\nBoth\\r\\n\\r\\nLineFeeds\\r\\n\\r\\n\\r\\nAnd\\r\\nCarriageReturns\"));\n $this->assertEquals(\"Testing\\r\\nBoth\\r\\n\\r\\nLineFeeds\\r\\n\\r\\n\\r\\nAnd\\r\\nCarriageReturns\", Sanitize::newlines(\"Testing\\r\\nBoth\\r\\n\\r\\nLineFeeds\\r\\n\\r\\n\\r\\nAnd\\r\\nCarriageReturns\", array('crlf' => false)));\n }",
"function _trim_newlines($code)\n\t{\n\t\t$code = preg_replace(\"/^\\n{1,}/s\", \"\", $code );\n\t\t$code = preg_replace(\"/\\n{1,}$/s\", \"\", $code );\n\t\treturn $code;\n\t}",
"function remove_new_lines($raw){\n\t\t$newlines = array(\"\\t\",\"\\n\",\"\\r\",\"\\x20\\x20\",\"\\0\",\"\\x0B\");\n\t\treturn str_replace($newlines, \"\", html_entity_decode($raw));\n\t}",
"protected function removeNewLines(&$html) {\n\t\t$splitArray = array(\n\t\t\t'textarea',\n\t\t\t'pre'\n\t\t); // eventuell auch: span, script, style\n\t\t$peaces = preg_split('#(<(' . implode('|', $splitArray) . ').*>.*</\\2>)#Uis', $html, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t$html = \"\";\n\t\tfor ($i = 0; $i < count($peaces); $i++) {\n\t\t\tif (($i + 1) % 3 == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$html .= (($i - 1) % 3 != 0) ? $this->killLineBreaks($peaces[$i]) : $peaces[$i];\n\t\t}\n\t}",
"function atNewline(): bool\n {\n return $this->char === \"\\n\" && $this->lastChar !== \"\\r\" || $this->char === \"\\r\";\n }",
"function _strip_newlines($html, $data, $url) {\n\t\tif (false !== strpos ( $html, \"\\n\" ))\n\t\t\t$html = str_replace ( array (\"\\r\\n\", \"\\n\" ), '', $html );\n\t\t\n\t\treturn $html;\n\t}",
"static function cleanNewLines($string) {\n\n $string = preg_replace(\"/\\r\\n/\", \" \", $string);\n $string = preg_replace(\"/\\n/\", \" \", $string);\n $string = preg_replace(\"/\\r/\", \" \", $string);\n return $string;\n }",
"function parse_whitespace_newlines($text, $do_nl2br = true)\n\t{\n\t\t// don't do new lines!\n\t\treturn parent::parse_whitespace_newlines($text, false);\n\t}",
"public function testNewlineOnlyInsertsIgnored()\n {\n $result = null;\n\n try {\n $quill = new QuillRender($this->delta_bug_101);\n $result = $quill->render();\n } catch (\\Exception $e) {\n $this->fail(__METHOD__ . 'failure, ' . $e->getMessage());\n }\n\n $this->assertEquals(\n $this->expected_bug_101,\n trim($result),\n __METHOD__ . ' newline only inserts ignored failure'\n );\n }",
"function testRemoveEmptyLines()\r\n {\r\n $this->assertIdentical(\r\n StringUtility::removeEmptyLines(\r\n \" \t\\n\t\t\t\t\\r\\n\t\t\\r\\n\t\\n \"\r\n ),\r\n ''\r\n );\r\n\r\n $this->assertIdentical(\r\n StringUtility::removeEmptyLines(\r\n \" \t\\n\t\t\tWill Buckner\t\\r\\n\t\t\\r\\n\t\\n \"\r\n ),\r\n 'Will Buckner'\r\n );\r\n\r\n $this->assertIdentical(\r\n StringUtility::removeEmptyLines(\"\\n\\r\\n\\r\\n\\n\"),\r\n ''\r\n );\r\n\r\n $this->assertNotIdentical(\r\n StringUtility::removeEmptyLines(\"\\n\\ra\\n\\r\\n\\n\"),\r\n ''\r\n );\r\n }",
"public function test_tokenizeHTML_removeNewline()\n {\n $this->config->set('Core.NormalizeNewlines', true);\n $this->assertTokenization(\n \"plain\\rtext\\r\\n\",\n array(\n new HTMLPurifier_Token_Text(\"plain\\ntext\\n\")\n )\n );\n }",
"public function checkCRLF(&$text)\n {\n $text = preg_replace(\"#(\\r\\n|\\r|\\n)#\", \"\\r\\n\", $text);\n }",
"protected function addMissingNewLine(): void\n {\n $last = end($this->ops);\n\n if ($last === false) {\n return;\n }\n\n $insert = $last->getInsert();\n\n if ($insert === self::LINE_SEPARATOR) {\n return;\n }\n\n if (is_string($insert) && str_ends_with($insert, self::LINE_SEPARATOR)) {\n $last->setInsert(substr($insert, 0, -1));\n }\n\n $this->ops[] = DeltaOp::text(self::LINE_SEPARATOR);\n }",
"public function testCanCreateLineBreak()\n {\n $newlineTest = new Newline();\n $nl = $newlineTest->nl;\n $this->assertEquals(\"\\n\", $nl);\n }",
"static function blankNewlines( $text )\n {\n return preg_replace( \"/\\r\\n|\\r|\\n/\", ' ', $text );\n }",
"public function testMultilineRecordsCollapseOntoSingleLine()\n {\n $zone = file_get_contents(__DIR__.'/Resources/testCollapseMultilines_sample.txt');\n $expectation = str_replace(\"\\r\\n\", \"\\n\", file_get_contents(__DIR__.'/Resources/testCollapseMultilines_expectation.txt'));\n $this->assertEquals($expectation, Normaliser::normalise($zone));\n }",
"public function isNewline() {\n\t\treturn $this->newline;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve home_enabled in json format | public function get_home()
{
$obj = new View();
if (! $this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
return;
}
$queryobj = new Icloud_model();
$sql = "SELECT COUNT(1) as total,
COUNT(CASE WHEN `home_enabled` = 1 THEN 1 END) AS 'yes',
COUNT(CASE WHEN `home_enabled` = 0 THEN 1 END) AS 'no'
from icloud
LEFT JOIN reportdata USING (serial_number)
WHERE
".get_machine_group_filter('');
$obj->view('json', array('msg' => current($queryobj->query($sql))));
} | [
"function getEnabled() {\n\t\treturn $this->getData('enabled');\n\t}",
"public function get_vnc_enabled()\n {\n $obj = new View();\n if (! $this->authorized()) {\n $obj->view('json', array('msg' => 'Not authorized'));\n return;\n }\n \n $queryobj = new Ard_model();\n $sql = \"SELECT COUNT(1) as total,\n COUNT(CASE WHEN `vnc_enabled` = 1 THEN 1 END) AS 'yes',\n COUNT(CASE WHEN `vnc_enabled` = 0 THEN 1 END) AS 'no'\n from ard\n LEFT JOIN reportdata USING (serial_number)\n WHERE\n \".get_machine_group_filter('');\n $obj->view('json', array('msg' => current($queryobj->query($sql))));\n }",
"public function getUserSearchableSettings()\n {\n $json = array();\n $user_meta = new UserMeta();\n $user_data = $user_meta::select('profile_searchable', 'disable_account')\n ->where('user_id', Auth::user()->id)->get()->first();\n if (!empty($user_data)) {\n $json['type'] = 'success';\n if ($user_data->profile_searchable == 'true') {\n $json['profile_searchable'] = 'true';\n }\n if ($user_data->disable_account == 'true') {\n $json['disable_account'] = 'true';\n }\n } else {\n $json['type'] = 'error';\n }\n return $json;\n }",
"public function getHomePageFeaturedEnabled()\n {\n return $this->homePageFeaturedEnabled;\n }",
"public function getEnabled();",
"private function get_enabled()\n\t{\n\t\t$query = $this->db->query('\n\t\t\tSELECT *\n\t\t\tFROM ' . $this->db->dbprefix('plugins') . '\n\t\t\tWHERE enabled = 1\n\t\t');\n\n\t\treturn $query->result();\n\t}",
"public function get_visible_in_rest_api() {\n\t\treturn $this->visible_in_rest_api;\n\t}",
"public function authGetEnableAction()\n {\n $result = $this->backend->auth_getenable();\n $this->processUnnormalBackendResult($result);\n\n $this->apiOk(array(\n 'enable' => $result['data'],\n ), 'get auth enable status successfully');\n }",
"public function getUserHomeInfo()\r\n {\r\n $home_info = [\r\n 'homeAddress' => '魔都',\r\n 'homeNumber' =>'029-8848888',\r\n ];\r\n return $home_info;\r\n }",
"public function isRecommendationEnabledOnHome() {\n return $this->isEnabled()\n && $this->getApiToken()\n && $this->getRecommendationConfig('home/enabled')\n && $this->getRecommendationConfig('home/endpoint');\n }",
"public function get_enabled_features() {\n $responsedata = new stdClass();\n\n // Make request to get the enabled features on the account.\n try {\n $endpoint = TURNITINSIM_ENDPOINT_GET_FEATURES_ENABLED;\n $response = $this->tsrequest->send_request($endpoint, json_encode(array()), 'GET');\n $responsedata = json_decode($response);\n\n // Latest version retrieved.\n if ($responsedata->httpstatus == TURNITINSIM_HTTP_OK) {\n mtrace(get_string('taskoutputenabledfeaturesretrieved', 'plagiarism_turnitinsim'));\n return $responsedata;\n }\n\n mtrace(get_string('taskoutputenabledfeaturesnotretrieved', 'plagiarism_turnitinsim'));\n return $responsedata;\n\n } catch (Exception $e) {\n $this->tsrequest->handle_exception($e, 'taskoutputenabledfeaturesretrievalfailure');\n return $responsedata;\n }\n }",
"public function getEnabled()\n {\n if ($this->model->where('is_disabled', '=', 0)->get())\n return $this->model->where('is_disabled', '=', 0)->get();\n else return [];\n }",
"protected static function get_enabled()\n\t{\n\t\treturn \\DB::select()\n\t\t\t->from('plugins')\n\t\t\t->where('enabled', 1)\n\t\t\t->execute()\n\t\t\t->as_array();\n\t}",
"public function getAllEnabled()\n\t{\n\t\treturn $this->findBy(array('is_enabled' => true));\n\t}",
"public function enabled()\n {\n return $this->getByEnabled(true);\n }",
"public function getAvailableStatuses()\n {\n $statuses = new Varien_Object(array(\n self::STATUS_ENABLED => Mage::helper('mybrand')->__('Enabled'),\n self::STATUS_DISABLED => Mage::helper('mybrand')->__('Disabled'),\n ));\n\n Mage::dispatchEvent('mybrand_manufacturer_get_available_statuses', array('statuses' => $statuses));\n\n return $statuses->getData();\n }",
"public function getAccountEnabled()\n {\n return $this->getProperty(\"AccountEnabled\");\n }",
"public function getEnabledApis () {\n $result = [];\n $apis = $this->apiModel::all()->toArray();\n if ($apis) {\n foreach ($apis as $api) {\n $result[$api['id']] = $api['name'];\n }\n }\n\n return $this->enabledApis = $result;\n }",
"public function getAvailableStatuses()\n {\n $statuses = new Varien_Object(array(\n self::STATUS_ENABLED => Mage::helper('profile')->__('Enabled'),\n self::STATUS_DISABLED => Mage::helper('profile')->__('Disabled'),\n ));\n\n Mage::dispatchEvent('profile_get_available_statuses', array('statuses' => $statuses));\n\n return $statuses->getData();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if bcmath extension is loaded | public function checkBcMath()
{
return extension_loaded('bcmath') ? 2 : 1;
} | [
"public static function isBcMathAvailable()\n {\n return extension_loaded(static::EXTENSION_BCMATH);\n }",
"static protected function _useBCMath()\n {\n if (!function_exists('bccomp')) {\n throw new \\LogicException('BC Math extension currently is required', 1405066207);\n }\n\n return true;\n }",
"private static function bcExists()\r\n {\r\n if(self::$bcExists) return self::$bcExists;\r\n\r\n if(!extension_loaded('bcmath')){\r\n self::$bcExists = FALSE;\r\n exit(\"bcmath extention required\\nFile: \" . basename(__FILE__) . \"\\nLine: \" . __LINE__ . \"\\n\");\r\n } else {\r\n self::$bcExists = TRUE;\r\n }\r\n return self::$bcExists;\r\n }",
"private function checkIfBcmodIsAvailable(): bool\n {\n return function_exists('bcmod');\n }",
"private function _checkGdLibrary(){\n if (extension_loaded('gd') && function_exists('gd_info')) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"protected function crc32cExtensionLoaded()\n {\n return extension_loaded('crc32c');\n }",
"function extension_loaded($name)\n{\n if ($name === 'gmp' && SignerTest::$disableGmp) {\n return false;\n }\n\n return \\extension_loaded($name);\n}",
"public static function checkGd()\n {\n return extension_loaded(\"gd\");\n }",
"private static function loadExtension()\n\t{\n\t\t// Is bz2 extension loaded? If not try to load it\n\t\tif (!extension_loaded('bz2'))\n\t\t{\n\t\t\tif (TPATH_ISWIN)\n\t\t\t{\n\t\t\t\t@ dl('php_bz2.dll');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t@ dl('bz2.so');\n\t\t\t}\n\t\t}\n\t}",
"public function testIfNeededExtensionsAreLoaded()\n {\n $needed = \\P7TriviaGame\\Core\\System::REQUIRED_PECL_LIB;\n\n for($i=0;$i<count($needed);$i++) {\n $this->assertTrue(in_array($needed[$i], get_loaded_extensions() ));\n }\n\n }",
"function checkExtensionLoad($name)\n{\n if (extension_loaded($name)) {\n return true;\n }\n return false;\n}",
"function lynkff_checkGd(){\r\n\tif(extension_loaded('gd')){\r\n\treturn true;\r\n\t}\t\r\n\telse{\r\n\t\treturn false;\r\n\t\t}\r\n}",
"function mcrypt_loaded($show_error=false) {\r\n if ((extension_loaded('mcrypt') || (function_exists('dl') && dl(((PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '') . (null ? null : 'mcrypt') . '.' . PHP_SHLIB_SUFFIX))) != 1) {\r\n\t\tif ($show_error) {\r\n\t\t\texit('<div class=\"red\"><b>ERROR:</b><br>The \"mcrypt\" PHP extension is not loaded but is required for encryption/decryption.<br>\r\n\t\t\t\t Please install the PHP extension \"mcrypt\" on your server, reboot your server, and then reload this page.</div>');\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t} else {\r\n\t\treturn true;\r\n\t}\r\n}",
"private function checkExtensionLoaded() {\n\t\tif (!extension_loaded('curl') ) {\n\t\t\techo \"===========================================\\n\";\n\t\t\techo \"curl extension is required!\\n\";\n\t\t\techo \"===========================================\\n\";\n\t\t\texit;\n\t\t}\t\n\t}",
"private static function checkModule()\n\t{\n\t\tif(extension_loaded('imagick')) return 'imagick';\n\t\treturn 'gd';\n\t}",
"function checkForLDAPExtension()\r\n{\r\n return extension_loaded(\"ldap\");\r\n}",
"protected function isCryptLoaded() {\n\n if (!function_exists('crypt')) {\n\n trigger_error(sprintf('%s Expects crypt loaded.', __METHOD__));\n return FALSE;\n }\n return TRUE;\n }",
"public function isExtensionLoaded($ext='gd') { \n return extension_loaded($ext); \n }",
"private function extensionCheck()\n {\n // Check for required PHP extensions\n $required_extensions = ['PDO', 'curl', 'gd', 'json', 'openssl', 'mbstring'];\n $missing = [];\n foreach ($required_extensions as $extension) {\n if (!extension_loaded($extension)) {\n $missing[] = $extension;\n }\n }\n if (count($missing)) {\n asort($missing);\n $this->console->error('Extension required: ' . implode(', ', $missing));\n $this->errors = true;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Category widget for unresolved / resolved posts | function jl_unresolved_posts_cat_register_widget() {
register_widget( 'jl_unresolved_posts_cat_widget' );
} | [
"private function getPostCategory()\n\t{\n\t\t$default_category=$this->pluginOptions['default_category'];\n\n\t\t$this->categoriesStringToArray();\n\n\t\t$categories=$this->feed_item->categories;\n\n\t\t$this->feed_item->category=$default_category;\n\n\t\tif(count($categories)==0&&count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t$this->feed_item->category='';\n\t\t\t//\n\t\t}\n\t\telse if(count($categories)==0)\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tif($k=='')\n\t\t\t\t{\n\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t//\n\t\t}\n\t\t/* */\n\t\telse\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tforeach($categories as $cat)\n\t\t\t\t{\n\t\t\t\t\tif($cat==$k||$k=='')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\t}\n\t\t\t\t\tif($cat==$k)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function widget($args, $instance) {\n $categories = get_categories(array(\"include\" => \"35, 9\", \"hide_empty\" => 0));\n // if there are any categories (!)\n if ($categories) {\n // Loop through them and display\n foreach ($categories as $category) {\n echo '<div class = \"maincats\"><a href = ' . home_url() . '/category/' . $category->category_nicename . '>'\n . $category->name . '</a></div>';\n }\n }\n }",
"function fc_load_widget() {\n register_widget( 'fajar_categories_widget' );\n}",
"function lsx_post_meta_category() {\n\t\t$post_categories = wp_get_post_categories( get_the_ID() );\n\t\t$cats = array();\n\n\t\tforeach ( $post_categories as $c ) {\n\t\t\t$cat = get_category( $c );\n\t\t\t/* Translators: %s: category name */\n\t\t\t$cats[] = '<a href=\"' . esc_url( get_category_link( $cat->term_id ) ) . '\" title=\"' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '\">' . $cat->name . '</a>';\n\t\t}\n\n\t\tif ( ! empty( $cats ) ) {\n\t\t\t?>\n\t\t\t<span class=\"post-meta-categories\"><span><?php esc_html_e( 'Posted in: ', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span>\n\t\t\t<?php\n\t\t}\n\t}",
"function widget_get_category()\n{\n $categories = BlogManager::getCategoryBlogCount();\n return $categories;\n}",
"function widget($args, $instance) {\n\tglobal $post;\n\t$post_old = $post; // Save the post object.\n\t\n\techo '<div class=\"cat_news_box fix\">';\n\t\n\t// Widget title\n\techo '<h4 class=\"headbar\">';\n\t\techo '<a href=\"' . get_category_link($instance[\"cat\"]) . '\">' . get_cat_name($instance[\"cat\"]) . '</a>';\n\techo '</h4>';\n\n\t// First of Post list START\n $first_cat_posts = new WP_Query( array('post_type' => 'post', 'showposts' =>1, 'cat' => $instance[\"cat\"], 'orderby' => 'date', 'order' => 'DESC' ) ); \n\t\n\techo '<div class=\"cat_main\">';\n\twhile ( $first_cat_posts->have_posts() )\n\t{\n\t\t$first_cat_posts->the_post();\n\t?>\n\t\t<h2 class=\"title\"><a href=\"<?php the_permalink(); ?>\" rel=\"bookmark\" title=\"\"><?php the_title(); ?></a></h2>\n\t\t<div class=\"additional_info\"><?php the_time('F j, Y, g:i A') ?> </span></div>\n\t\t<div class=\"content fix\">\n\t\t\t<?php\n\t\t\tif ( has_post_thumbnail() ) {\n\t\t\tthe_post_thumbnail('post-thumb', array('class' => 'sidebar_cat_image', 'alt' => ''));\n\t\t\t}\n\t\t\t?>\t\n\t\t\t<a href=\"<?php the_permalink(); ?>\" class=\"content_right\"><?php echo excerpt(40); ?></a>\n\t\t</div>\n\t\t<div class=\"bottom\">\n\t\t\t<a class=\"comment\" href=\"<?php comments_link(); ?>\" title=\"comment\"><i class=\"fa fa-comment\"></i><span><?php comments_number( '০', '১', '%' ); ?></span></a>\n\t\t\t<div class=\"holder\"><a href=\"<?php the_permalink(); ?>\" class=\"more_link\">বিস্তারিত</a></div>\n\t\t</div>\t\t\n\t<?php\n\t}\t\n\techo '</div>';\t\n\t// First of Post list END\t\t\n\t\n\n\t// Rest of Post list START\n $more_cat_posts = new WP_Query( array('post_type' => 'post', 'showposts' =>$instance[\"num\"], 'cat' => $instance[\"cat\"], 'offset'=>1, 'orderby' => 'date', 'order' => 'DESC' ) ); \n\n\techo '<div class=\"cat_more\">';\n\techo \"<ul>\\n\";\n\twhile ( $more_cat_posts->have_posts() )\n\t{\n\t\t$more_cat_posts->the_post();\n\t?>\n\t\t<li>\n\t\t\t<?php\n\t\t\tif ( has_post_thumbnail() ) {\n\t\t\tthe_post_thumbnail('post-thumb', array('class' => 'cat_more_image', 'alt' => ''));\n\t\t\t}\n\t\t\t?>\t\n\t\t\t<a href=\"<?php the_permalink(); ?>\" rel=\"bookmark\" title=\"\"><?php the_title(); ?></a>\n\t\t</li>\n\t<?php\n\t}\n\techo \"</ul>\\n\";\n\techo '</div>';\n\t// Rest of Post list END\n\t?>\t\n\t<div class=\"footbar\"><a class=\"more_link\" href=\"<?php echo get_category_link($instance[\"cat\"]) ?>\">আরও</a></div>\t\n\t<?php\n\techo '</div>';\n\t$post = $post_old; // Restore the post object.\n}",
"public function category()\n {\n $posts = $this->Post->getAll();\n $category = $this->Category->find($_GET['id']);\n if ($category === false) {\n $this->notFound();\n }\n $articles = $this->Post->firstByCategory($_GET['id']);\n if ($articles === false) {\n $this->notFound();\n }\n $categories = $this->Category->getAll();\n $this->render('posts.category', compact('articles', 'posts', 'categories', 'category'));\n }",
"public function display_category()\n {}",
"static function add_no_issue_cats(): void {\r\n\t\tself::add_acf_field(self::no_issue_cats, [\r\n\t\t\t'label' => 'For these categories, do not attach posts to a specific'\r\n\t\t\t\t. ' issue.<br><em>The post will then link to the volume, but' .\r\n\t\t\t ' not vice versa.</em>',\r\n\t\t\t'type' => 'taxonomy',\r\n\t\t\t'instructions' => '',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '75',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'taxonomy' => 'category',\r\n\t\t\t'field_type' => 'multi_select',\r\n\t\t\t'allow_null' => 0,\r\n\t\t\t'add_term' => 0,\r\n\t\t\t'save_terms' => 0,\r\n\t\t\t'load_terms' => 0,\r\n\t\t\t'return_format' => 'id',\r\n\t\t\t'ajax' => 0\r\n\t\t]);\r\n\t}",
"function kapee_template_loop_post_category() {\n\t\tget_template_part( 'template-parts/post-loop/category' );\t\t\n\t}",
"public function setup_category_posts_boxes() {\n\t\t\tadd_meta_box(\n\t\t\t\t'master-add-category-posts-metabox',\n\t\t\t\t__( 'All Posts In Category', 'easy-custom-sidebars' ),\n\t\t\t\tarray( $this, 'render_category_post_meta_box' ),\n\t\t\t\t$this->plugin_screen_hook_suffix,\n\t\t\t\t'side',\n\t\t\t\t'default'\n\t\t\t);\n\t\t}",
"public function action_category() {\n\t\tKohana::$log->add(Kohana::DEBUG,\n\t\t\t'Executing Controller_Blog::action_category');\n\t\t$this->template->content = View::factory('blog/front/list')\n\t\t\t->bind('legend', $legend)\n\t\t\t->bind('articles', $articles)\n\t\t\t->bind('pagination', $pagination);\n\n\t\t$category = $this->request->param('name');\n\t\t$search = Sprig::factory('blog_search');\n\t\t$articles = $search->search_by_category($category);\n\t\t$pagination = $search->pagination;\n\t\t$legend = __(':name Articles', array(':name'=>ucfirst($category)));\n\t}",
"function widget_mdv_most_commented_per_cat($args) {\r\n\t extract($args);\r\n\r\n\tif (is_category() ) { \r\n\t\t\r\n\t\t$cat_id = get_query_var('cat');\r\n\r\n\t // Fetch our parameters\r\n\t $bfa_pic_options = get_option('widget_mdv_most_commented_per_cat');\r\n\t $bfa_pic_title = $bfa_pic_options['bfa_pic_title'];\r\n\t $bfa_pic_no_posts = $bfa_pic_options['bfa_pic_no_posts'];\r\n\t $bfa_pic_duration = $bfa_pic_options['bfa_pic_duration'];\r\n\t $bfa_pic_min_amount_comments = $bfa_pic_options['bfa_pic_min_amount_comments'];\r\n\t $bfa_pic_prepend_cat_title = $bfa_pic_options['bfa_pic_prepend_cat_title']; \r\n\t $bfa_pic_append_cat_title = $bfa_pic_options['bfa_pic_append_cat_title'];\r\n\t \r\n\t $current_cat_title = htmlentities(single_cat_title('', false),ENT_QUOTES);\r\n\t if ($bfa_pic_prepend_cat_title == \"on\" ) { $bfa_pic_title = $current_cat_title . \" \" . $bfa_pic_title; }\r\n\t if ($bfa_pic_append_cat_title == \"on\" ) { $bfa_pic_title = $bfa_pic_title . \" \" . $current_cat_title; }\t \r\n\t \t \r\n\t global $wpdb;\r\n\r\n\r\n\t\t$bfa_pic_request = \"SELECT DISTINCT ID, post_title, comment_count FROM $wpdb->posts as p\";\r\n\t\t$bfa_pic_request .= \" INNER JOIN $wpdb->term_relationships AS tr ON\";\r\n\t\t$bfa_pic_request .= \" (p.ID = tr.object_id AND\";\r\n\t\t$bfa_pic_request .= \" tr.term_taxonomy_id = $cat_id )\";\r\n\t\t$bfa_pic_request .= \" INNER JOIN $wpdb->term_taxonomy AS tt ON\";\r\n\t\t$bfa_pic_request .= \" (tr.term_taxonomy_id = tt.term_taxonomy_id AND\";\r\n\t\t$bfa_pic_request .= \" taxonomy = 'category')\";\r\n\t\t$bfa_pic_request .= \" WHERE post_status = 'publish' AND comment_count >= $bfa_pic_min_amount_comments\";\r\n\t\t$bfa_pic_request .= \" AND post_password =''\";\r\n\t\r\n\t\tif ($bfa_pic_duration !=\"\") $bfa_pic_request .= \" AND DATE_SUB(CURDATE(),INTERVAL \".$bfa_pic_duration.\" DAY) < post_date \";\r\n\t\r\n\t\t$bfa_pic_request .= \" ORDER BY comment_count DESC LIMIT $bfa_pic_no_posts\";\r\n\t\t$bfa_pic_posts = $wpdb->get_results($bfa_pic_request);\r\n\r\n\t\tif ($bfa_pic_posts) {\r\n\t\t\t$widget_mdv_most_commented_per_cat = '';\r\n\t\t\tforeach ($bfa_pic_posts as $bfa_pic_post) {\r\n\t\t\t\t$bfa_pic_post_title = stripslashes($bfa_pic_post->post_title);\r\n\t\t\t\t$bfa_pic_comment_count = $bfa_pic_post->comment_count;\r\n\t\t\t\t$bfa_pic_permalink = get_permalink($bfa_pic_post->ID);\r\n\t\t\t\t$widget_mdv_most_commented_per_cat .= '<li><a href=\"' . $bfa_pic_permalink . '\" title=\"' . $bfa_pic_post_title.'\">' . $bfa_pic_post_title . ' (' . $bfa_pic_comment_count . ')</a></li>';\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$widget_mdv_most_commented_per_cat = \"None found\";\r\n\t\t}\r\n\t\r\n\r\n if ($widget_mdv_most_commented_per_cat != \"None found\") {\r\n echo $before_widget . $before_title . $bfa_pic_title . $after_title;\t\r\n echo \"<ul>\" . $widget_mdv_most_commented_per_cat . \"</ul>\";\r\n echo $after_widget;\r\n } else { return $widget_mdv_most_commented_per_cat; }\r\n}\r\n}",
"function sheru_posts($args) {\n echo $args['before_widget'];\n echo $args['before_title'] . 'My Unique Widget' . $args['after_title'];\n echo $args['after_widget'];\n\n echo \"Your Widget Test\";\n\n $slug = \"blog\";\n\n $args = array(\n 'posts_per_page' => 5,\n 'category__not_in' => array( sheru_get_category_id_from_slug( $slug ) )\n );\n\n $sheru_posts = new WP_Query($args);\n\n if($sheru_posts->have_posts() ) :\n echo '<ul>';\n while ( $sheru_posts->have_posts() ) : $sheru_posts->the_post();\n echo '<li>';\n echo '<a href=\"'.the_permalink().'\">';\n the_title();\n echo '</a>';\n echo '</li>';\n endwhile;\n echo '</ul>';\n endif;\n\n}",
"function wp_ajax_press_this_add_category()\n {\n }",
"function uwmadison_categorized_blog() {\n if ( false === ( $all_the_cool_cats = get_transient( 'uwmadison_categories' ) ) ) {\n // Create an array of all the categories that are attached to posts.\n $all_the_cool_cats = get_categories( array(\n 'fields' => 'ids',\n // We only need to know if there is more than one category.\n 'number' => 2,\n ) );\n\n // Count the number of categories that are attached to the posts.\n $all_the_cool_cats = count( $all_the_cool_cats );\n\n set_transient( 'uwmadison_categories', $all_the_cool_cats );\n }\n\n if ( $all_the_cool_cats > 1 ) {\n // This blog has more than 1 category so uwmadison_categorized_blog should return true.\n return true;\n } else {\n // This blog has only 1 category so uwmadison_categorized_blog should return false.\n return false;\n }\n}",
"function bunchy_render_entry_categories( $args = array() ) {\n\techo bunchy_capture_entry_categories( $args );\n}",
"function kapee_template_portfolio_loop_categories() {\n\t\tget_template_part( 'template-parts/portfolio-loop/category' );\t\t\n\t}",
"public function getCategories()\n {\n return ['my-widgets'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get specific employee data by his Desktime email. | public function getEmployeeByEmail($email) {
$result = new \stdClass();
$result->pass = FALSE;
$all_employees = $this->all();
if (($all_employees->pass) && isset($all_employees->body->employees)) {
$employees = reset($all_employees->body->employees);
if (count($employees) > 0) {
foreach ($employees as $employee) {
if ($email == $employee->email) {
$result->pass = TRUE;
$result->data = $employee;
break;
}
}
}
}
return $result;
} | [
"public function getEmployeeByEmail(Request $request) \n {\n $employee = Employees::getEmployeeByEmail($request->input('email'));\n $employee = $this->generateEmployeeData($employee); \n\n return $employee;\n }",
"public function getEmployeeByEmail($email){\n\t\t\n\t\t$this->db->where('email', $email);\n\t\t$rows = $this->db->get('employee');\n\t\t\n\t\tif($rows->num_rows() > 0){\n\t\t\treturn new Employee($rows->first_row());\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}",
"function viewEmployee ($single_employee_email) {\n\n\t\t$return_employee_record = \"SELECT `user_name`, `email`, `address`, `image_location` FROM `users` WHERE `email` = '$single_employee_email'\";\n\n\t\t$employee_data = mysqli_query($this -> conn, $return_employee_record);\n\n\t\tif($employee_data) {\n\n\t\t\twhile ($employee_row = mysqli_fetch_row($employee_data)) {\n\t\t\t\t\n\t\t\t\t $employee_result = $employee_row;\n\n\t\t\t}\n\n\t\t\treturn $employee_result;\n\n\t\t}\n\n\t\tmysqli_close($this -> conn);\n\n\t}",
"public function getEmail($id,$email);",
"function getUserDetails($email){\n \n $this->rk->where(\"email\",$email);\n $this->rk->where(\"status\",0);\n $query = $this->rk->get(\"users\");\n \n return $query;\n \n }",
"public function userdeatils_email($hfemail)\n\t{\n\t\t$db = Zend_Db_Table::getDefaultAdapter();\n\t\t \n\t\t$sql ='select hf_id,hf_facility_suffix,hf_facility_name,hf_facility_lname,hf_address,hf_state,hf_city,hf_zip,hf_country,reg_date from hosted_facilities where hf_email=\"'.$hfemail.'\"';\n\t\treturn $db->fetchRow($sql);\n\t}",
"function readByEmail()\n {\n\n // query to read single record\n $query = \"SELECT * FROM \" . $this->table_name . \" r \n WHERE r.email = ? LIMIT 0,1\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // sanitize\n $this->email = htmlspecialchars(strip_tags($this->email));\n\n // bind id of restaurant to be updated\n $stmt->bindParam(1, $this->email);\n\n // execute query\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->name = $row['name'];\n $this->email = $row['email'];\n $this->urlName = $row['urlName'];\n $this->address = $row['address'];\n $this->admin = $row['admin'];\n $this->token = $row['token'];\n }",
"public function getEmployeeForCheckExists($email)\n\t{\n\t\t$result = $this->myPdoObj\n\t\t\t->select('name_employee, mail_employee')\n\t\t\t->table('employee')\n\t\t\t->where(array('mail_employee' => $email), array('='))\n\t\t\t->query()\n\t\t\t->commit();\n\n\t\treturn $result;\n\t}",
"function get_member_detail_by_email($email)\n {\n $data = $this->make_request('members/email/'.$email, 'GET');\n return $data;\n }",
"function getUserBasicInfoByEmail($emailId = null){\n \n $UsersModel = TableRegistry::get('Users'); \n $getUserData = $UsersModel->find('all')->select(['id','role_id','firstname','lastname','email','phone_number'])->where(['Users.email' => $emailId])->hydrate('false')->first();\n return $getUserData;\n }",
"public function getByEmail($email='') {\n\t\t\n\t\t//\tValidate email:\n\t\t\t$email = $this->validate($email, 'EMAIL');\n\t\t\tif ($email === false) { return false;}\n\t\t\t$email =strtolower($email);\n\t\t\n\t\t//\tGet record from user-table:\n\t\t\t$options = array();\n\t\t\t$options['where'] = '`email`=\"'.$email.'\"';\n\t\t\t$records = $this->active_table->select_all($options);\n\t\t\t\n\t\t\t\n\t\t\t$aR = count($records) === 1? $records[0] : false;\n\t\t\tif ($aR == false ) {return false;}\n\t\t\t\n\t\t//\tAdd respond_date:\n\t\t\t$date = new DateTime($aR['updateRequest']);\n\t\t\t$date->add(new DateInterval('PT'.TIMESLOT.'H'));\n\t\t\t$aR['respond_date'] =$date->format('j-M-Y, H:i');\n\t\t\t\n\t\t//\tAdd fullname:\n\t\t\t$full_name = array();\n\t\t\t$name = array_key_exists('firstName', $aR)? trim($aR['firstName'])\t\t: \"\";\n\t\t\tif ( strlen($name) > 0) {\n\t\t\t\t$full_name[] = $name;\n\t\t\t}\n\t\t\t$name = array_key_exists('midName', $aR)? trim($aR['midName'])\t\t: \"\";\n\t\t\tif ( strlen($name) > 0) {\n\t\t\t\t$full_name[] = $name;\n\t\t\t}\n\t\t\t$name = array_key_exists('lastName', $aR)? trim($aR['lastName'])\t\t: \"\";\n\t\t\tif ( strlen($name) > 0) {\n\t\t\t\t$full_name[] = $name;\n\t\t\t}\n\t\t\t$aR['full_name'] = implode(' ',$full_name);\n\t\t\t\n\t\t\treturn $aR;\n\t\t\t\n\t}",
"function getUserInfoByEmail($email=null){\n\t\t$CI\t= & get_instance();\n\t\ttry{\n\t\t\tif(!empty($email)){\n\t\t\t\t$result\t\t= $CI->db->where('qw_users.email',$email)->select('qw_users.*')\n\t\t\t\t\t\t->get('qw.qw_users')->row();\n\t\t\t\tif($result){\n\t\t\t\t\treturn $result;\n\t\t\t\t}return false;\n\t\t\t}return false;\n\t\t}catch(Exception\t$ex){\n\t\t\tlog_message('error','Unable to get user info based on user email '.$ex->getMessage());\n\t\t}\n\t}",
"public function getByemail($email, $passwd = NULL)\n\t{\n\t \tif (!Validate::isEmail($email) || ($passwd != NULL && !Validate::isPasswd($passwd)))\n\t \t\tdie(Tools::displayError());\n\n\t\t$result = DB::GetRow('\n\t\tSELECT * \n\t\tFROM `employee`\n\t\tWHERE `active` = 1\n\t\tAND `email` = \\''.$email.'\\'\n\t\t'.($passwd ? 'AND `passwd` = \\''.Tools::encrypt($passwd).'\\'' : ''));\n\t\tif (!$result)\n\t\t\treturn false;\n\t\t$this->id = $result['id_employee'];\n\t\t$this->id_profile = $result['id_profile'];\n\t\tforeach ($result as $key => $value)\n\t\t\tif (key_exists($key, $this))\n\t\t\t\t$this->{$key} = $value;\n\t\treturn $this;\n\t}",
"function searchForPersonByEmail($email) {\n $searchItems = array(\n 'term='.$email,\n \"field=email\",\n \"exact_match=true\"\n );\n $searchString = implode ('&', $searchItems);\n $searchResults = searchForPerson($searchString);\n\n // Person ID of 0 === non-existing user\n $person = array(\"id\" => 0, \"name\" => \"\");\n if ($searchResults[\"success\"]) {\n $emailMatches = $searchResults[\"data\"][\"items\"];\n if (count($emailMatches) > 0) {\n $person = $emailMatches[0][\"item\"];\n }\n }\n return $person;\n }",
"public function getUserByEmail($email);",
"public function infoPorEmail($email){ \r\n $consulta = $this->conexion->prepare(\"select idUsuario,nombre,apellido1,apellido2,email,telefono,contrasena,foto FROM \".$this->table.\" WHERE email= :email \" );\r\n $consulta->execute(array('email'=>$email));\r\n $usuario= $consulta->fetchAll();\r\n $this->conexion=null;\r\n return $usuario;\r\n }",
"public function getStaffByEmail($email) {\n $this->select->reset();\n $this->select->from($this);\n $this->select->where('email = ?', $email);\n return $this->fetchRow($this->select);\n }",
"public function _searchByEmail($email) { \n \n $url = \"https://crm.zoho.com/crm/private/json/Accounts/searchRecords\"; \n $params = 'authtoken='.$this->authToken.'&scope=crmapi&newFormat=2&criteria=(Correo electrónico:\"'.$email.'\")'; \n $response = json_decode($this->_curl($url, $params), true); \n if (isset($response['response']['result']['Accounts']['row']['FL'])){\n $data = $response['response']['result']['Accounts']['row']['FL'];\n $idGlobal = $this->_content($data, 'Account Number');\n $this->_zohoAccountToDB($data, $idGlobal); \n return $idGlobal;\n }else{\n $url = \"https://crm.zoho.com/crm/private/json/Contacts/searchRecords\"; \n $params = 'authtoken='.$this->authToken.'&scope=crmapi&newFormat=2&criteria=(Email:\"'.$email.'\")'; \n $response = json_decode($this->_curl($url, $params), true); \n\n if (isset($response['response']['result']['Contacts']['row']['FL'])){\n $data = $response['response']['result']['Contacts']['row']['FL'];\n $accountId = $this->_content($data, 'ACCOUNTID');\n\n $url = \"https://crm.zoho.com/crm/private/json/Accounts/getRecordById\"; \n $params = 'authtoken='.$this->authToken.'&scope=crmapi&newFormat=2&id='.$accountId; \n $response = json_decode($this->_curl($url, $params), true); \n\n if (isset($response['response']['result']['Accounts']['row']['FL'])){\n $data = $response['response']['result']['Accounts']['row']['FL']; \n $idGlobal = $this->_content($data, 'Account Number');\n $this->_zohoAccountToDB($data, $idGlobal); \n return $idGlobal; \n } \n } \n }\n return \"\";\n }",
"function getEmployeePrivateDataFromUser($employeeFirstname, $employeeLastname){\n $employeesData = $this->exportEmployeesPrivateData();\n foreach($employeesData as $employee){\n if(($employee['employeeFirstName'] == $employeeFirstname) && ($employee['employeeSurname'] == $employeeLastname)){\n return $employee;\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [podtdesc2] column value. | public function getPodtdesc2()
{
return $this->podtdesc2;
} | [
"public function getDesc2()\n {\n return $this->desc2;\n }",
"public function getOedtdesc2()\n {\n return $this->oedtdesc2;\n }",
"public function getPodtdesc1()\n {\n return $this->podtdesc1;\n }",
"public function getOedhdesc2()\n {\n return $this->oedhdesc2;\n }",
"public function setPodtdesc2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->podtdesc2 !== $v) {\n $this->podtdesc2 = $v;\n $this->modifiedColumns[EditPoDetailTableMap::COL_PODTDESC2] = true;\n }\n\n return $this;\n }",
"public function setPodtdesc2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->podtdesc2 !== $v) {\n $this->podtdesc2 = $v;\n $this->modifiedColumns[PurchaseOrderDetailTableMap::COL_PODTDESC2] = true;\n }\n\n return $this;\n }",
"public function getIntbconfusedesc2()\n {\n return $this->intbconfusedesc2;\n }",
"public function getDescription2()\n {\n return $this->description2;\n }",
"public function getPanell2c2() {\n return $this->get(self::PANELL2C2);\n }",
"public function getHeading2() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(9, $this->_result)) return (string) $this->_result[9];\n\t\t\telse parent::throwGetColException('Not set PagesModel::getHeading2', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From PagesModel::getHeading2', __LINE__, __FILE__);\n\t}",
"public function getOehddiscpct2()\n {\n return $this->oehddiscpct2;\n }",
"public function getVal2()\r\n {\r\n return $this->val2;\r\n }",
"public function getProduct_desc () {\n\t$preValue = $this->preGetValue(\"product_desc\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_desc\")->preGetData($this);\n\treturn $data;\n}",
"public function setOedtdesc2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oedtdesc2 !== $v) {\n $this->oedtdesc2 = $v;\n $this->modifiedColumns[SoDetailTableMap::COL_OEDTDESC2] = true;\n }\n\n return $this;\n }",
"public function getDescription1()\n {\n return $this->description1;\n }",
"public function getDescription1Unwrapped()\n {\n return $this->readWrapperValue(\"description1\");\n }",
"public function getOedhacdisc2()\n {\n return $this->oedhacdisc2;\n }",
"public function getField2()\n {\n return $this->data['fields']['field2'];\n }",
"public function getHeading2() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(6, $this->_result)) return (string) $this->_result[6];\n\t\t\telse parent::throwGetColException('Not set CampaignPagesModel::getHeading2', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From CampaignPagesModel::getHeading2', __LINE__, __FILE__);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renders a closing option group tag | public static function renderOptionGroupClose(){
self::out(
self::closeTag('optgroup')
);
} | [
"protected function endOptgroup()\n {\n $this->html .= $this->indent(1, \"</optgroup>\");\n $this->optlevel -= 1;\n }",
"public function end_el(&$output, $item, $depth){\n $output .= \"</option>\\n\";\n }",
"public function end_el(&$output, $item, $depth = 0, $args = array()){\n $output .= \"</option>\\n\";\n }",
"public function end_el(&$output, $item, $depth = 0, $args = array()) {\r\n\t\t$output .= \"</option>\\n\";\r\n\t}",
"function optgroup( $vContent = NULL, $aAttrs = array() )\n\t{\n\t\t$bHasEnd = TRUE;\n\t\treturn $this->_create_tag( __FUNCTION__, $aAttrs, $bHasEnd, $vContent );\n\t}",
"function option_group_tag($label, $options, $attributes = null) {\n if(is_array($attributes)) {\n $attributes['label'] = $label;\n } else {\n $attributes = array('label' => $label);\n } // if\n \n $output = open_html_tag('optgroup', $attributes) . \"\\n\";\n if(is_array($options)) {\n foreach($options as $option) {\n $output .= $option . \"\\n\";\n } // foreach\n } // if\n return $output . close_html_tag('optgroup') . \"\\n\";\n }",
"public function end_widget_options() {\n\t\t?>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"public function close_group() {\n\t\t$this->group = null;\n\t\t$this->required = false;\n\t\t$this->disabled = false;\n\t\treturn \"</div>\\n\";\n\t}",
"function Coption(){\r\n \r\n print('</option>');\r\n \r\n }",
"public function optionGroup();",
"public function render_options_dropdown_optgroup($args = array())\n {\n printf(\n '<select id=\"%s\" name=\"woochimp_options[%s]\" class=\"woochimp-field\">',\n $args['name'],\n $args['name']\n );\n\n foreach ($this->options[$args['name']] as $optgroup) {\n\n printf(\n '<optgroup label=\"%s\">',\n $optgroup['title']\n );\n\n foreach ($optgroup['children'] as $value => $title) {\n\n printf(\n '<option value=\"%s\" %s %s>%s</option>',\n $value,\n selected($value, $args['options'][$args['name']], false),\n ($value === 0 ? 'disabled=\"disabled\"' : ''),\n $title\n );\n }\n\n echo '</optgroup>';\n }\n\n echo '</select>';\n }",
"public function selectEnd() {\r\n return '</select>';\r\n }",
"Protected Function renderOptionTags($options, $nestingLevel = 1) {\n\t\t$content = '';\n\t\tForEach ($options As $option) {\n\t\t\tIf ($option['_isRoot']) {\n\t\t\t\t$content .= '<optgroup label=\"' . htmlspecialchars($option['name']) . '\">' . chr(10);\n\t\t\t\t$content .= $this->renderOptionTags($option['_children'], $nestingLevel + 1);\n\t\t\t\t$content .= '</optgroup>';\n\t\t\t} Else {\n\t\t\t\t$isSelected = $this->isSelected($option['uid']);\n\t\t\t\t$indent = ($nestingLevel - 1) * 20;\n\t\t\t\t$style = 'padding-left: ' . $indent . 'px;';\n\t\t\t\t$content .= '<option style=\"' . $style . '\" value=\"' . $option['uid'] . '\" ' . ($isSelected ? 'selected=\"selected\"' : '') . '>' . htmlspecialchars($option['name']) . '</option>' . chr(10);\n\t\t\t\t$content .= $this->renderOptionTags($option['_children'], $nestingLevel + 1);\n\t\t\t}\n\t\t}\n\t\tReturn $content;\n\t}",
"protected function _radioGroupEnd()\n {\n return '</div>';\n }",
"public function testRenderOptionGroups(): void\n {\n $select = new SelectBoxWidget($this->templates);\n $data = [\n 'name' => 'Birds[name]',\n 'options' => [\n 'Mammal' => [\n 'beaver' => 'Beaver',\n 'elk' => 'Elk',\n ],\n 'Bird' => [\n 'budgie' => 'Budgie',\n 'eagle' => 'Eagle',\n ],\n ],\n ];\n $result = $select->render($data, $this->context);\n $expected = [\n 'select' => [\n 'name' => 'Birds[name]',\n ],\n ['optgroup' => ['label' => 'Mammal']],\n ['option' => ['value' => 'beaver']],\n 'Beaver',\n '/option',\n ['option' => ['value' => 'elk']],\n 'Elk',\n '/option',\n '/optgroup',\n ['optgroup' => ['label' => 'Bird']],\n ['option' => ['value' => 'budgie']],\n 'Budgie',\n '/option',\n ['option' => ['value' => 'eagle']],\n 'Eagle',\n '/option',\n '/optgroup',\n '/select',\n ];\n $this->assertHtml($expected, $result);\n }",
"private function SelectClose( $tag )\r\n\t{\r\n\t\t$this->appendHTML( \" </select>\" );\r\n\t\t$this->appendBreak( $tag );\r\n\t}",
"function balise_select_optgroup($datas)\n{\n\t$balise = '<select name=\"'.$datas['name'].'\" id=\"'.$datas['name'].'\" class=\"'.$datas['class'].'\" tabindex=\"'.$datas['tabindex'].'\">';\n\t$old_theme = \"\";\n\t$compteur = 0;\n\tfor($i=0; $i<count($datas['value']); $i++)\n\t{\n\t\t$new_theme = $datas['value'][$i]['theme'];\n\t\tif ($old_theme != $new_theme)\n\t\t{\n\t\t\tif ($compteur > 0)\n\t\t\t{\n\t\t\t\t$balise .= '</optgroup>';\n\t\t\t}\n\t\t\t$balise .= '<optgroup label=\"'.$new_theme.'\">';\n\t\t}\n\t\t$balise .= '<option value=\"'.$datas['value'][$i]['entite'].'\"';\n\t\tif ($datas['value'][$i]['entite'] == $datas['default'])\n\t\t{\n\t\t\t$balise .= ' selected=\"selected\" ';\n\t\t}\n\t\t$balise .= '>'.$datas['value'][$i]['nom'].'</option>';\n\t\t$compteur = 1;\n\t\t$old_theme = $new_theme;\n\t}\n\t$balise .= '</optgroup>';\n\t$balise .= '</select>';\n\treturn $balise;\n}",
"public function getOptionGroupDescription()\n {\n return '';\n }",
"function endGroup()\n {\n $this->_indent = substr($this->_indent, 0, -4);\n $this->_addElement('</g>');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter for deleted files. | public function getDeletedFiles(): Collection
{
return $this->files->filter(function (File $file) {
return $file->getStatus() === File::FILE_DELETED;
});
} | [
"public function _get_deleted() {\n\t\treturn $this->_deleted;\n\t}",
"public function get_deleted()\n {\n return $this->deleted;\n }",
"public function getDeleted()\n {\n return $this->deleted;\n }",
"public function getdeleted()\n {\n return $this->deleted;\n }",
"function get_deleted(){\n return $this->deleted;\n }",
"public function delete()\n {\n // delete the file (and previous versions of files)\n $filesToDelete = array();\n $storageFolder = $this->getStorageFolder();\n\n if (file_exists($storageFolder)) {\n if ($handle = opendir($storageFolder)) {\n while (false !== ($entry = readdir($handle))) {\n // only delete if filename starts the the relevant ID\n if (strpos($entry, $this->ID.'~') === 0) {\n $filesToDelete[] = $entry;\n }\n }\n\n closedir($handle);\n\n //delete all this files that have the id of this document\n foreach ($filesToDelete as $file) {\n $filePath = $storageFolder .DIRECTORY_SEPARATOR . $file;\n\n if (is_file($filePath)) {\n unlink($filePath);\n }\n }\n }\n }\n\n // get rid of any versions have saved for this DMSDocument, too\n if (DMSDocument_versions::$enable_versions) {\n $versions = $this->getVersions();\n\n if ($versions->Count() > 0) {\n foreach ($versions as $v) {\n $v->delete();\n }\n }\n }\n\n return parent::delete();\n }",
"public function getOldFiles();",
"public function getDeleted() {\n\t\t$v = $this->getField('deleted');\n\t\treturn $v === null ? null : (int) $v;\n\t}",
"public function getAllDeleted();",
"public function provideDelete()\n {\n return [\n 'file exists' => [\n 'exists' => true,\n 'filename' => implode(DIRECTORY_SEPARATOR, [ROOT, 'tests', '_file', '.test']),\n ],\n ];\n }",
"public function getFiles()\n {\n \treturn $this->addedFiles;\n }",
"final public function getDeletedCount() {}",
"public function getDeletedOids() {\n \treturn $this->deletedOids;\n }",
"public static function files()\n {\n return Files::_get();\n }",
"public function getDelete()\r\n {\r\n return $this->delete;\r\n }",
"abstract protected function getFilesToDelete(AbstractAdapter $source);",
"public function getDeletedAttribute();",
"public function getDelete()\n {\n return $this->delete;\n }",
"function getFiles(){\n\t\treturn $this->used_files;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get country by ip | function get_country_by_ip($user_ip='')
{
if ($user_ip)
{ // Запрос на получение страны по IP
$url = "http://ip-to-country.webhosting.info/node/view/36";
$ch = @curl_init();
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, "ip_address=$user_ip&submit=Find+Country"); // add POST fields
$result = curl_exec($ch); // run the whole process
curl_close($ch);
preg_match("/IP Address(.*?)belongs to(.*?)\./i", $result, $matches);
if (strlen($matches[2])>0)
{
$matches[2]=strip_tags($matches[2]);
if (!ereg('Dont', $matches[2])) $country=$matches[2]; else $country="Unknown";
} else $country="Unknown";
return trim($country);
}
else return;
} | [
"public function getCountryForIp(string $ip) : IpInfo;",
"function skyGetCountry($ip=''){\n\tglobal $getCountryByIpClass;\n\tif(!$ip)\n\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t$getCountryByIpClass->set_ip($ip);\n\t$getCountryByIpClass->dist_ip();\n\t$getCountryByIpClass->count_ip();\n\t$info = $getCountryByIpClass->search_country();\n\treturn $info['2letters_country'];\n}",
"public static function getCountryByIp($ip) {\n $url = 'http://api.hostip.info/?ip=' . $ip;\n $xml = file_get_contents($url);\n $doc = new DOMDocument();\n $doc->loadXML($xml);\n $countryName = $doc->getElementsByTagName(\"countryName\")->item(0)->nodeValue;\n return $countryName;\n }",
"function get_countryname_by_ip($ip = false)\n{\n $data = get_geo_location_by_ip($ip);\n if(avail($data, 'countryName'))\n return $data->countryName;\n return false;\n}",
"function getCountryFromIp() {\n\n\n //error_log(\"getting country for your IP\");\n\n \n\n $ch = curl_init('http://geoip.nekudo.com/api/' . $_SERVER['REMOTE_ADDR']);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n\n $geoip = json_decode($result);\n \n if ($geoip) {\n $countryCode = $geoip->country->code;\n return $countryCode;\n\n \n }\n else {\n // No results returned from the API\n // return country US\n //error_log(\"no results from API, call getCountyFromURL\");\n \n return \"US\";\n }\n}",
"protected function getUserCountry(){\n\t\t$ip = $this->getUserIP();\n\t\t$json = file_get_contents(\"http://ipinfo.io/\".$ip);\n \t$details = json_decode($json);\n \t$country = $details->country;\n \treturn $country;\n\t}",
"private function fetch_country_code($ip) {\n\t\t$content = @file_get_contents(\"http://freegeoip.net/json/\" + $ip);\n\n\t\tif ($content === FALSE) {\n\t\t\t// Looks like we had a problem with the API.\n\t\t\treturn \"ERROR\";\n\t\t} else {\n\t\t\t$json = json_decode($content, TRUE);\n\t\t\treturn $json[\"country_code\"];\n\t\t}\n\t}",
"public static function getCountryFromWebservice ($ip = ''){\r\n\t\treturn (self::getWebservice($ip, self::WEBSERVICE_COUNTRY, self::WEBSERVICE_BACKUP_COUNTRY));\r\n\t}",
"function getCountryByIP($ip) {\n if (isset($ip) && $ip != '') {\n if (extension_loaded('geoip')) {\n if (geoip_db_avail(GEOIP_COUNTRY_EDITION)) {\n return @geoip_country_code_by_name($ip);\n }\n } else {\n if (include_once(PAPAYA_INCLUDE_PATH.'external/geoip/geoip.inc')) {\n $gi = geoip_open(PAPAYA_INCLUDE_PATH.'external/geoip/geoip.dat', GEOIP_STANDARD);\n $country = geoip_country_code_by_addr($gi, $ip);\n geoip_close($gi);\n return $country;\n }\n }\n }\n return FALSE;\n }",
"function Ip2Country($ip)\r\n{\r\n\tglobal $GEOIP_COUNTRY_NAMES;\r\n\tglobal $GEOIP_COUNTRY_CODES;\r\n\t$country = array();\r\n\t$country[0] = 'unknown';\r\n\t$country[1] = 'Unknown';\r\n\t$gi = geoip_open(\"../classes/admin/geoIp/GeoIP.dat\",GEOIP_STANDARD);\r\n\t$country_code = geoip_country_code_by_addr($gi, $ip);\r\n\tgeoip_close($gi);\r\n\tif($country_code)\r\n\t{\r\n\t\t$country_index = array_search($country_code, $GEOIP_COUNTRY_CODES);\r\n\t\t$country[0] = strtolower($country_code);\r\n\t\t$country[1] = $GEOIP_COUNTRY_NAMES[$country_index];\r\n\t}\r\n\treturn $country;\r\n}",
"public static function CLbyIP() {\n $ip = getSQL('SELECT i.country, c.name FROM ip2nation4 AS i, country_codes AS c WHERE INET_ATON(\"'.$_SERVER['REMOTE_ADDR'].'\") BETWEEN ip_from AND ip_to AND i.country = c.code2 LIMIT 1');\n $cntry = \"\";\n if (isset($ip[0]) && count($ip[0]) > 0) {\n $_SESSION['nation'] = $ip[0]['country'];\n \n $cntry = strtolower($ip[0]['country']);\n self::$countryIP = $ip[0]['name'];\n \n switch ($cntry) {\n case strpos('de,at', $cntry):\n $result = array('country' => 'de', 'lang' => 'de');\n break; \n case 'nl':\n $result = array('country' => 'nl', 'lang' => 'nl');\n break;\n case 'be':\n $result = array('country' => 'be', 'lang' => 'nl');\n break;\n case 'fr':\n $result = array('country' => 'be', 'lang' => 'fr');\n break;\n case strpos('ar,bo,cl,do,ec,gt,hn,co,cr,cu,mx,ni,pa,py,pe,sv,uy,ve', $cntry):\n $result = array('country' => 'mx', 'lang' => 'es');\n break;\n case 'es':\n $result = array('country' => 'es', 'lang' => 'es');\n break;\n case strpos('ag,bs,bb,bz,br,dm,gd,gy,ht,jm,sr,lc,kn,vc,tt,us', $cntry):\n $result = array('country' => 'us', 'lang' => 'ae');\n break;\n case 'ca':\n $result = array('country' => 'ca', 'lang' => 'ae');\n break;\n case strpos('au,nz,nf,fj,nc,pg,sb,vu,ck,pf,nu,ws,tk,to,tv', $cntry):\n $result = array('country' => 'au', 'lang' => 'en');\n break;\n case strpos('ao,bw,ls,mg,mw,mz,na,sz,zm,zw,za', $cntry):\n $result = array('country' => 'za', 'lang' => 'en');\n break;\n case strpos('cz,sk', $cntry):\n $result = array('country' => 'cz', 'lang' => 'cs');\n break;\n case 'tr':\n $result = array('country' => 'tr', 'lang' => 'tr');\n break;\n case strpos('cn,my,jp,ph,tw,hk,sg,bn,tl,la,mm,th,vn,cx,cc', $cntry):\n $result = array('country' => 'sg', 'lang' => 'en');\n break;\n case 'cn':\n $result = array('country' => 'cn', 'lang' => 'cn');\n break;\n case 'ie':\n $result = array('country' => 'ie', 'lang' => 'en');\n break; \n case 'it':\n $result = array('country' => 'it', 'lang' => 'it');\n break; \n default:\n $result = array('country' => 'gb', 'lang' => 'en');\n break;\n }\n } else {\n $result = array('country' => 'gb', 'lang' => 'en');\n }\n return $result;\n }",
"private function getCountryIdByIp()\n {\n try {\n $countryId = $this->geoIpAdapter->getCountryCode($this->request->getClientIp());\n } catch (\\Exception $e) {\n $countryId = null;\n }\n return $countryId;\n }",
"function get_countryname_by_ip()\n{\n//\t// maxmind installed as server module?\n//\tif(isset($_SERVER[\"GEOIP_COUNTRY_CODE\"]))\n//\t\treturn $_SERVER[\"GEOIP_COUNTRY_CODE\"];\n\tif( function_exists('geoip_open') )\n\t{\n\t\t$gi = geoip_open($GLOBALS['CONFIG']['geoip']['city_dat_file'],GEOIP_STANDARD);\n\t\t$country_name = geoip_country_name_by_name($gi,Wdf::$ClientIP);\n\t\tgeoip_close($gi);\n\t}\n\telse\n\t\t$country_name = geoip_country_name_by_name(Wdf::$ClientIP);\n\n\treturn $country_name;\n}",
"function ip_visitor_country()\n{\n\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n $country = \"Unknown\";\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client;\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward;\n }\n else\n {\n $ip = $remote;\n }\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://www.geoplugin.net/json.gp?ip=\".$ip);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n $ip_data_in = curl_exec($ch); // string\n curl_close($ch);\n\n $ip_data = json_decode($ip_data_in,true);\n $ip_data = str_replace('"', '\"', $ip_data); // for PHP 5.2 see stackoverflow.com/questions/3110487/\n\n if($ip_data && $ip_data['geoplugin_countryName'] != null) {\n $country = $ip_data['geoplugin_countryName'];\n }\n\n return $country;\n}",
"private static function IpToLocator($ip) {\n $reader = new Reader('/usr/local/share/GeoIP/GeoLite2-Country.mmdb');\n\n // Get the record of the corrsponding ip\n // The country can still be unknown e.g. if the $ip is a link local ipv6\n // address, so if the $record throws a 'GeoIp2\\Exception\\AddressNotFoundException'\n // Set the country to Unknown.\n try {\n $record = $reader->country($ip);\n $country = $record->country->name;\n\n // Country does exists, so now find the city\n $city = self::IpToCity($ip);\n\n // City can be empty, we rather return Unknown\n if ($city == '') {\n $city = \"Unknown\";\n }\n\n // Only in this case we can return a country and city\n return $country.\".\".$city;\n } catch (GeoIp2\\Exception\\AddressNotFoundException $e) {\n // No country found, hence city makes no sense either\n return $country = \"Unknown\";\n }\n }",
"function countryCityFromIP($ipAddr)\n\t{\n\t //Developed by Roshan Bhattarai \n\t //Visit http://roshanbh.com.np for this script and more.\n\t \n\t //verify the IP address for the \n\t ip2long($ipAddr)== -1 || ip2long($ipAddr) === false ? trigger_error(\"Invalid IP\", E_USER_ERROR) : \"\";\n\t // This notice MUST stay intact for legal use\n\t $ipDetail=array(); //initialize a blank array\n\t //get the XML result from hostip.info\n\t $xml = file_get_contents(\"http://api.hostip.info/?ip=\".$ipAddr);\n\t //get the city name inside the node <gml:name> and </gml:name>\n\t preg_match(\"@<Hostip>(\\s)*<gml:name>(.*?)</gml:name>@si\",$xml,$match);\n\t //assing the city name to the array\n\t $ipDetail['city']=$match[2]; \n\t $lokasi = $ipDetail['city'];\n\t //get the country name inside the node <countryName> and </countryName>\n\t preg_match(\"@<countryName>(.*?)</countryName>@si\",$xml,$matches);\n\t //assign the country name to the $ipDetail array \n\t $ipDetail['country']=$matches[1];\n\t //get the country name inside the node <countryName> and </countryName>\n\t preg_match(\"@<countryAbbrev>(.*?)</countryAbbrev>@si\",$xml,$cc_match);\n\t $ipDetail['country_code']=$cc_match[1]; //assing the country code to array\n\t //return the array containing city, country and country code\n\t return $lokasi;\n\t}",
"public function getCity(string $ip);",
"public function getCountryName($ip=null) {\r\r\n\t\tif (!$this->database)\r\r\n\t\t\treturn geoip_country_name_by_name($this->currentIp($ip));\r\r\n\t\treturn geoip_country_name_by_addr($this->database, $this->currentIp($ip));\r\r\n\t}",
"function get_ip_country($domain,$proxy='')\n\t{\n\n\t\t$domain=str_replace(\"www.\",\"\",$domain);\n\t\t$domain=str_replace(\"http://\",\"\",$domain);\n\t\t$domain=str_replace(\"https://\",\"\",$domain);\n\t\t$domain=str_replace(\"/\",\"\",$domain);\n\t\t$domain=strtolower($domain);\n\t\t$domain_ip\t= gethostbyname($domain);\n\t\t$response=$this->ip_information($domain_ip);\n\n\t\treturn $response;\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the setCpteCollectifFrn() method. | public function testSetCpteCollectifFrn() {
$obj = new Constantes();
$obj->setCpteCollectifFrn("cpteCollectifFrn");
$this->assertEquals("cpteCollectifFrn", $obj->getCpteCollectifFrn());
} | [
"public function testSetCollectif() {\n\n $obj = new Clients();\n\n $obj->setCollectif(\"collectif\");\n $this->assertEquals(\"collectif\", $obj->getCollectif());\n }",
"public function testSetNumCptCollectif() {\n\n $obj = new Clients();\n\n $obj->setNumCptCollectif(\"numCptCollectif\");\n $this->assertEquals(\"numCptCollectif\", $obj->getNumCptCollectif());\n }",
"public function testSetCollectifClientFin() {\n\n $obj = new Dossier2();\n\n $obj->setCollectifClientFin(\"collectifClientFin\");\n $this->assertEquals(\"collectifClientFin\", $obj->getCollectifClientFin());\n }",
"public function testSetChampsCritereAffaire6() {\n\n $obj = new Constantes();\n\n $obj->setChampsCritereAffaire6(\"champsCritereAffaire6\");\n $this->assertEquals(\"champsCritereAffaire6\", $obj->getChampsCritereAffaire6());\n }",
"public function testSetChampsCritereAffaire7() {\n\n $obj = new Constantes();\n\n $obj->setChampsCritereAffaire7(\"champsCritereAffaire7\");\n $this->assertEquals(\"champsCritereAffaire7\", $obj->getChampsCritereAffaire7());\n }",
"public function testSetVisualisationFicheCabinet() {\n\n $obj = new Collaborateurs();\n\n $obj->setVisualisationFicheCabinet(true);\n $this->assertEquals(true, $obj->getVisualisationFicheCabinet());\n }",
"public function testSetFichierLicence() {\n\n $obj = new Produits();\n\n $obj->setFichierLicence(\"fichierLicence\");\n $this->assertEquals(\"fichierLicence\", $obj->getFichierLicence());\n }",
"public function testSetPjMailCLiDucsEdi() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setPjMailCLiDucsEdi(true);\n $this->assertEquals(true, $obj->getPjMailCLiDucsEdi());\n }",
"public function testSetCodeAffaire() {\n\n $obj = new CriteresChantier();\n\n $obj->setCodeAffaire(\"codeAffaire\");\n $this->assertEquals(\"codeAffaire\", $obj->getCodeAffaire());\n }",
"public function testSetCicePjMailCliDucsEdi() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setCicePjMailCliDucsEdi(true);\n $this->assertEquals(true, $obj->getCicePjMailCliDucsEdi());\n }",
"public function testSetCodeAffaire() {\n\n $obj = new FichesControlesEntetes();\n\n $obj->setCodeAffaire(\"codeAffaire\");\n $this->assertEquals(\"codeAffaire\", $obj->getCodeAffaire());\n }",
"public function setCompteCollectifVente(?string $compteCollectifVente): Constantes {\n $this->compteCollectifVente = $compteCollectifVente;\n return $this;\n }",
"public function testSetActivationLstRestriFrn() {\n\n $obj = new Confidentialite();\n\n $obj->setActivationLstRestriFrn(10);\n $this->assertEquals(10, $obj->getActivationLstRestriFrn());\n }",
"public function testSetTexteF() {\n\n $obj = new CriteresLibres();\n\n $obj->setTexteF(\"texteF\");\n $this->assertEquals(\"texteF\", $obj->getTexteF());\n }",
"public function setCollectifComptable($collectifComptable) {\n $this->collectifComptable = $collectifComptable;\n return $this;\n }",
"public function testSetFctInterrogationCpt() {\n\n $obj = new iComptaDroits();\n\n $obj->setFctInterrogationCpt(true);\n $this->assertEquals(true, $obj->getFctInterrogationCpt());\n }",
"public function testSetRffCptRegul() {\n\n $obj = new Dossier2();\n\n $obj->setRffCptRegul(\"rffCptRegul\");\n $this->assertEquals(\"rffCptRegul\", $obj->getRffCptRegul());\n }",
"public function testSetAfficher() {\n\n $obj = new RegroupementEdBulEntete();\n\n $obj->setAfficher(true);\n $this->assertEquals(true, $obj->getAfficher());\n }",
"public function testSetCivilite() {\n\n $obj = new DevisCommercialEntetes();\n\n $obj->setCivilite(\"civilite\");\n $this->assertEquals(\"civilite\", $obj->getCivilite());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the list of KYC documents for the contractor record. | public function kycDocuments()
{
return $this->hasMany(KycDocument::class);
} | [
"public function documents()\n {\n return $this->hasMany(KycDocuments::class, 'kyc_verification_id');\n }",
"function getdocuments($ClientID){\n $table = TableRegistry::get(\"documents\");\n return $table->find('all', array('conditions' => array('client_id'=>$ClientID)));\n }",
"public function getDocuments();",
"public function get_document_list() {\n $returnArr['status'] = '0';\n $returnArr['response'] = '';\n try {\n\t\t\t$documentsArr = array();\n\t\t\t$getDocuments = $this->app_model->get_all_details(DOCUMENTS,array('status' =>\"Active\"));\n\t\t\tif($getDocuments->num_rows()>0){\n\t\t\t\tforeach($getDocuments->result() as $doc){\n\t\t\t\t\t$documentsArr[] = array(\"id\"=>(string)$doc->_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\"=>(string)$doc->name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"category\"=>(string)$doc->category,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"is_req\"=>(string)$doc->hasReq,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"is_exp\"=>(string)$doc->hasExp\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$returnArr['status'] = '1';\n\t\t\t$returnArr['response'] = array(\"documents\"=>$documentsArr);\n } catch (MongoException $ex) {\n $returnArr['response'] = $this->format_string(\"Error in connection\", \"error_in_connection\");\n }\n $json_encode = json_encode($returnArr, JSON_PRETTY_PRINT);\n echo $this->cleanString($json_encode);\n }",
"function get_documents($cust_id){\n global $connection;\n $query = \"SELECT id FROM documents WHERE FK_cust_id = $cust_id\";\n $result = mysqli_query($connection, $query);\n confirmQResult($result);\n $list = array();\n while($row = mysqli_fetch_assoc($result)){\n $doc_id = $row['id'];\n $doc = get_document($doc_id);\n array_push($list, $doc);\n }\n return $list;\n }",
"public function get_document_list()\n {\n $query = $this->db->get('document');\n return $query->result_array();\n }",
"public function get_docs() {\n\n\t\tif ( file_exists( $this->settings['cache_file'] ) ) {\n\t\t\t$docs = json_decode( file_get_contents( $this->settings['cache_file'] ), true );\n\t\t}\n\n\t\tclearstatcache();\n\n\t\tif (\n\t\t\tempty( $docs ) ||\n\t\t\t(int) filemtime( $this->settings['cache_file'] ) + $this->settings['cache_ttl'] > time()\n\t\t) {\n\t\t\t// This code should execute once when the method called the first time,\n\t\t\t// Next update_docs() should be executed by schedule.\n\t\t\t$docs = $this->update_docs();\n\t\t}\n\n\t\t// Store in class private variable for further use.\n\t\t$this->docs = ! empty( $docs ) ? $docs : [];\n\n\t\treturn $this->docs;\n\t}",
"public function getDocuments() {\n\t\t$user = $this->auth->user();\n\n\t\tif(!$user) {\n\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\"code\" => 401,\n\t\t\t\t\"message\" => \"Permisos denegados para el cliente\",\n\t\t\t\t\"response\" => null\n\t\t\t]);\n\t\t} else {\n\t\t\t$documents = Documents::where('id_user', $user->id)->where('status', '1')->get(['id', 'folio', 'location', 'type', 'alias', 'notes', 'subtype', 'picture_path', 'expedition', 'expiration', 'created_at']);\n\n\t\t\tif($documents->count()) {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 200,\n\t\t\t\t\t\"message\" => \"Listado de documentos\",\n\t\t\t\t\t\"response\" => array(\"documents\" => $documents)\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 202,\n\t\t\t\t\t\"message\" => \"No se encontraron documentos\",\n\t\t\t\t\t\"response\" => null\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}",
"public function getDocuments()\n {\n return Controllers\\Documents::getInstance();\n }",
"public function getDocuments()\n {\n # GET /accounts/{accountId}/envelopes/{envelopeId}/documents\n }",
"function get_contract_documents()\n {\n $this->load_relationship('contracts_documents');\n $query_array = $this->contracts_documents->getQuery(array('return_as_array' => true));\n $query = <<<KGB\n SELECT documents.*,\n\t\t\t\tdocuments.document_revision_id AS latest_revision_id,\n\t\t\t\tfor_latest_revision.revision AS latest_revision_name,\n\t\t\t\tfor_selected_revision.revision AS selected_revision_name,\n\t\t\t\tlinked_documents.document_revision_id AS selected_revision_id,\n\t\t\t\tcontracts.status AS contract_status,\n\t\t\t\tfor_selected_revision.filename AS selected_revision_filename,\n\t\t\t\tlinked_documents.id AS linked_id,\n\t\t\t\tcontracts.name AS contract_name\n\nKGB;\n\n $query .= $query_array['from'];\n $query .= <<<CIA\n\t\t\tLEFT JOIN documents ON documents.id = linked_documents.document_id\n\t\t\tLEFT JOIN document_revisions for_latest_revision\n\t\t\t\tON for_latest_revision.id = documents.document_revision_id\n\t\t\tINNER JOIN contracts \n\t\t\t\tON contracts.id = linked_documents.parent_id\n\t\t\tLEFT JOIN document_revisions for_selected_revision \n\t\t\t\tON for_selected_revision.id = linked_documents.document_revision_id\n\nCIA;\n $query .= $query_array['where'];\n return $query;\n }",
"public function getDocumentList()\n {\n $allComments = $this->getList(null, null);\n $documents = array();\n foreach ($allComments as $key => $comment) {\n if (empty($documents[$comment['document_id']])) {\n $document = DocumentModel::fromId($comment['document_id']);\n $documents[$document->getId()] = $document;\n }\n }\n\n return $documents;\n }",
"public function kycDocument()\n {\n return $this->hasMany(KycDocument::class, 'user_id');\n }",
"public function getDocuments()\n {\n return $this->documents;\n }",
"public function allDocs()\n {\n $docs = Doc::where(['owner_id' => Auth::id()])->orderBy('updated_at', 'desc')->get();\n return (new SuccessResponse($docs))->send();\n }",
"public function getCompanyDocuments()\n {\n return $this->hasMany(CompanyDocument::className(), ['company_id' => 'id']);\n }",
"public function getDocs()\n {\n return $this->docs;\n }",
"public function documents()\n {\n $data['employee'] = $this->employee->load('documents');\n\n return view('employee.documents', $data);\n }",
"public function getDocsRetrieved()\n {\n return $this->get(self::DOCS_RETRIEVED);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sanitize the value by replacing special chars with their html unicode equivalent | protected function sanitizeHtmlencode($value)
{
return filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS);
} | [
"function replace_special_characters($value)\n {\n // Detecta a codificação da string.\n $originalEncode = mb_detect_encoding($value);\n\n // Resgata os caracteres que serão substituídos.\n $toSearch = config('constant.specialCharacter.search');\n $toReplace = config('constant.specialCharacter.replace');\n\n // Converte a codificação para ISO-8859-1.\n $toSearch = mb_convert_encoding($toSearch, \"ISO-8859-1\");\n $toReplace = mb_convert_encoding($toReplace, \"ISO-8859-1\");\n $value = mb_convert_encoding($value, \"ISO-8859-1\");\n\n // Substitui os caracteres.\n $value = strtr($value, $toSearch, $toReplace);\n\n // Converte a codificação da string para o formato original.\n $value = mb_convert_encoding($value, $originalEncode);\n\n return $value;\n }",
"private function sspecialchars($value)\n {\n return filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS);\n }",
"function unsanitizeText($text) { \n\t\t$text = stripcslashes($text); \n\t\t$text = str_replace(\"'\", \"'\", $text); \n\t\t$text = str_replace(\">\", \">\", $text); \n\t\t$text = str_replace(\""\", \"\\\"\", $text); \n\t\t$text = str_replace(\"<\", \"<\", $text); \n return $text; \n}",
"private function decode_special_characters( $value ) {\n\t\treturn (string) htmlspecialchars_decode( $value, ENT_QUOTES );\n\t}",
"function xss_clean(string $xss_string) {\n //Convert all characters to HTML entities\n return htmlentities($xss_string, ENT_QUOTES | ENT_IGNORE);\n}",
"function remove_special_chars($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }",
"function sanitiseString($dirty){\n $dirty = filter_var($dirty, FILTER_SANITIZE_FULL_SPECIAL_CHARS);\n $clean = filter_var($dirty, FILTER_SANITIZE_STRING);\n return $clean;\n }",
"function sanitize_html_string($string)\n{\n $pattern[0] = '/\\&/';\n $pattern[1] = '/</';\n $pattern[2] = \"/>/\";\n $pattern[3] = '/\\n/';\n $pattern[4] = '/\"/';\n $pattern[5] = \"/'/\";\n $pattern[6] = \"/%/\";\n $pattern[7] = '/\\(/';\n $pattern[8] = '/\\)/';\n $pattern[9] = '/\\+/';\n $pattern[10] = '/-/';\n $replacement[0] = '&';\n $replacement[1] = '<';\n $replacement[2] = '>';\n $replacement[3] = '<br>';\n $replacement[4] = '"';\n $replacement[5] = ''';\n $replacement[6] = '%';\n $replacement[7] = '(';\n $replacement[8] = ')';\n $replacement[9] = '+';\n $replacement[10] = '-';\n return preg_replace($pattern, $replacement, $string);\n}",
"private function sanitize() {}",
"function scrub_out($string) {\n\n return htmlentities($string, ENT_QUOTES, Config::get('site_charset'));\n\n}",
"function reverse_sanitize($str){\n\t\t return htmlspecialchars_decode($str);\n\t\t}",
"protected function encodeSpecials() : string\n {\n $value = $this->getValue();\n $regex = '(\\'|\"|\\\\x00|\\\\\\\\(?![\\\\\\\\NGETHLnlr]))';\n\n return (string) preg_replace($regex, '\\\\\\\\$0', $value);\n }",
"protected function normalizeStringValueForHtml($value)\r\n\t\t{\r\n\t\t\treturn htmlentities(utf8_decode(utf8_decode($value)));\r\n\t\t}",
"function skyre_sanitize_nohtml($input) {\n return wp_filter_nohtml_kses($input);\n}",
"function sanitize_alpha ( $mValue )\n{\n return preg_replace('/[^\\w\\x80-\\xff]/', '', $mValue);\n}",
"function sanitizeForHTTP($value)\n{\n\treturn str_replace(array(\"\\r\", \"\\n\", \"%0a\", \"%0d\", \"%0A\", \"%0D\"), \"\", $value);\n}",
"function makeMODxSafe($value) {\n\t\t$value = (strpos($value,\"<\") !== FALSE) ? \"<pre>\".htmlentities($value).\"</pre>\" : $value;\n\t\t$value = str_replace(\"[\",\"[\",$value);\n\t\t$value = str_replace(\"]\",\"]\",$value);\n\t\t$value = str_replace(\"{\",\"{\",$value);\n\t\t$value = str_replace(\"}\",\"}\",$value);\n\t\treturn $value;\n\t}",
"function ldapspecialchars($string) {\r\n $sanitized=array('\\\\' => '\\5c',\r\n '*' => '\\2a',\r\n '(' => '\\28',\r\n ')' => '\\29',\r\n \"\\x00\" => '\\00');\r\n\r\n return str_replace(array_keys($sanitized),array_values($sanitized),$string);\r\n}",
"private function contraXSS($unsafe) {\r\n return htmlspecialchars($unsafe);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for chatbotChatbotIDExpressionsGet Returns all training Expression. | public function testChatbotChatbotIDExpressionsGet()
{
} | [
"public function getExpression();",
"public function testChatbotChatbotIDExpressionsExpressionIDDelete()\n {\n }",
"public function getExpressions()\n {\n return $this->expressions;\n }",
"public function getExpressionList()\n {\n return $this->expressions;\n }",
"public function getITailorExp()\n {\n return $this->get(self::ITAILOREXP);\n }",
"function get_interview_evaluation($id)\n {\n return $this->db->get_where('interview_evaluation',array('id'=>$id))->row_array();\n }",
"function get_identifier_expression() {\n\t\t$this->debug->show('<br>Class MyObject Method get_identifier_expression', MyObject::$write_debug);\n\t\t$where = array();\n\t\tif ($this->identifier_type == 'array' AND getType($this->identifier) == 'array') {\n\t\t\t$this->debug->show('<br>identifier: ' . print_r($this->identifier, true), MyObject::$write_debug);\n\t\t\t$where = array_map(\n\t\t\t\tfunction($id) {\n\t\t\t\t\t$quote = ($id['type'] == 'text' ? \"'\" : \"\");\n\t\t\t\t\treturn $id['key'] . \" = \" . $quote . $this->get($id['key']) . $quote;\n\t\t\t\t},\n\t\t\t\tarray_filter(\n\t\t\t\t\t$this->identifier,\n\t\t\t\t\tfunction($id) {\n\t\t\t\t\t\treturn in_array($id['key'], $this->getKeys()) AND $this->get($id['key']) != null AND $this->get($id['key']) != '';\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\tif (\n\t\t\t\tin_array($this->identifier, $this->getKeys()) AND\n\t\t\t\t$this->get($this->identifier) != null AND\n\t\t\t\t$this->get($this->identifier) != ''\n\t\t\t) {\n\t\t\t\t$quote = ($this->identifier_type == 'text' ? \"'\" : \"\");\n\t\t\t\t$where = array($this->identifier . \" = \" . $quote . $this->get($this->identifier) . $quote);\n\t\t\t}\n\t\t}\n\t\treturn implode(' AND ', $where);\n\t}",
"public function getExpressionList()\n {\n return $this->expressionList;\n }",
"public function getParameterExpressions();",
"public function expressionFunction();",
"public function expression($string)\n {\n $apiResponse = new \\StdClass();\n $variables = new \\stdClass();\n //$variables->input = $this->cleanText($string);\n $variables->input = $this->cleanText($string);\n //get metrics\n $this->gResponse = $this->client->response($this->queryExpressions, $variables);\n if ($this->gResponse->hasErrors()) {\n $apiResponse = $this->gResponse->errors();\n } else {\n $apiResponse = $this->gResponse->expressions->analytics;\n }\n\n // AI/2019-06-25: Removing affect analysis\n //affectExpr\n // if ($affectVal != '') {\n // $variables->parameters = json_encode($affectVal);\n // }\n\n // $this->gResponse = $this->client->response($this->queryAffectExpression, $variables);\n // if ($this->gResponse->hasErrors()) {\n // $affectResponse = $this->gResponse->errors();\n // } else {\n // $affectResponse = $this->gResponse->affectExpressions->analytics;\n // if (isset($apiResponse[0]->affect) && isset($affectResponse[0]->affect)) {\n // $apiResponse[0]->affect = $affectResponse[0]->affect;\n // }\n // }\n //print_r($apiResponse);\n\n return $apiResponse;\n }",
"public function getEvaluatedExpressions()\n {\n return $this->evaluated_expressions;\n }",
"private function getExerciseIdsMultiplePass($arrFilteredExIds = false){\n\t\t//debug\n\t\t$this->trace(__LINE__, __FUNCTION__);\n\t\t//la clause pour les different type\n\t\t$arrExerciseIds = array();\n\t\t//la query de base pour la table keyword\n\t\t$strBaseQuery = 'SELECT idKeyword FROM keyword WHERE idLicence IN (0,'.$this->idLicence.') ';\n\t\t//la locale\n\t\tif($this->strUserLocale == 'en_US'){\n\t\t\t$strBaseQuery .= ' AND locale = \"en_US\" ';\n\t\t}else{\n\t\t\t$strBaseQuery .= ' AND locale IN (\"en_US\",\"'.$this->strUserLocale.'\") ';\n\t\t\t}\n\t\t//\n\t\t$bFirstRun = true;\t\n\t\tforeach($this->arrKeywords as $k=>$v){\n\t\t\t//where\n\t\t\t$strWhereClause = $this->wordPermutationForSQL('keyword', array($v));\n\t\t\t//modified accent\n\t\t\tif(in_array($this->strUserLocale, $this->arrTryWithAccentLocale)){\n\t\t\t\t$strWhereClause = $this->modifyAccentQueryLike($strWhereClause);\n\t\t\t\t}\n\t\t\t//query\n\t\t\t$query = $strBaseQuery.' AND ('.$strWhereClause.');';\n\t\t\t//debug\n\t\t\t$this->trace(__LINE__,__FUNCTION__,array(\n\t\t\t\t'$query' => $query\n\t\t\t\t));\n\t\t\t//\n\t\t\t$arrKeywordIds = array();\n\t\t\t//prepare db\n\t\t\t$rs = $this->reg->get('db')->query($query);\n\t\t\tif($rs && $rs->num_rows){\n\t\t\t\tforeach($rs->rows as $k2=>$v2){\n\t\t\t\t\t//on push les ids\n\t\t\t\t\tarray_push($arrKeywordIds, $v2['idKeyword']);\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t//clean\n\t\t\tunset($query, $rs, $k2, $v2);\n\t\t\t//minor check\n\t\t\tif(count($arrKeywordIds)){\n\t\t\t\t$query = 'SELECT DISTINCT(idExercise) FROM keyword_exercise WHERE idKeyword IN ('.implode(',', array_values($arrKeywordIds)).');';\n\t\t\t\t//debug\n\t\t\t\t$this->trace(__LINE__,__FUNCTION__,array(\n\t\t\t\t\t'$query' => $query\n\t\t\t\t\t));\t\n\t\t\t\t//\n\t\t\t\t$arrTmpExerciseIds = array();\n\t\t\t\t//prepare db\n\t\t\t\t$rs = $this->reg->get('db')->query($query);\n\t\t\t\tif($rs && $rs->num_rows){\n\t\t\t\t\tforeach($rs->rows as $k2=>$v2){\n\t\t\t\t\t\t//on push les ids\n\t\t\t\t\t\tarray_push($arrTmpExerciseIds, $v2['idExercise']);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\t\t\t\t//clean\n\t\t\t\tunset($query, $rs, $k2, $v2);\n\t\t\t\t//on intersect\n\t\t\t\t//si vide alors on arrete et on reset\n\t\t\t\tif(count($arrTmpExerciseIds)){\n\t\t\t\t\tif($bFirstRun){\n\t\t\t\t\t\t$arrExerciseIds = $arrTmpExerciseIds;\n\t\t\t\t\t\t$bFirstRun = false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$arrExerciseIds = array_intersect($arrExerciseIds, $arrTmpExerciseIds);\n\t\t\t\t\t\tif(!count($arrExerciseIds)){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$arrExerciseIds = array();\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$arrExerciseIds = array();\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t//minor check\n\t\tif(count($arrExerciseIds)){\n\t\t\t//on flip pour ramener uniquement les cle\n\t\t\t$arrExerciseIds = array_flip($arrExerciseIds);\n\t\t\t}\n\t\t//debug\n\t\t$this->trace(__LINE__,__FUNCTION__,array(\n\t\t\t'count($arrExerciseIds)' => count($arrExerciseIds),\n\t\t\t//'$arrExerciseIds' => $arrExerciseIds,\n\t\t\t));\n\t\t//return \n\t\treturn $arrExerciseIds;\t\n\t\t}",
"public function expressionsDataProvider()\n {\n return [\n [2, '1+1'],\n [21, '1+2*5*2'],\n [8, '3*3+1-2'],\n [0, '3/3+1-2'],\n [25, '4+5+8*2']\n\n ];\n }",
"public function getExploitations(){\n\t\t$response = $this->sendAuthRequest(\"getexploitations\");\n\t\t\n\t\t$exploitations = array();\n\t\tfor ($i = 0; isset($response[\"planet$i\"]); $i++){\n\t\t\t$exploitation = new Exploitation();\n\t\t\t$exploitation->setPlanetName($response[\"planet$i\"]);\n\t\t\t$exploitation->setPlanetId($response[\"planetid$i\"]);\n\t\t\t$exploitation->setExploits($response[\"nbexp$i\"]);\n\t\t\t$exploitation->setInPipe($response[\"inpipe$i\"]);\n\t\t\t$exploitation->setToBeDemolished($response[\"tobedem$i\"]);\n\t\t\t$exploitation->setOnSale($response[\"nbonsale$i\"]);\n\t\t\t$exploitation->setSellPrice($response[\"sellprice$i\"]);\n\t\t\t$exploitation->setRentability($response[\"rentability$i\"]);\n\t\t\t$exploitations[] = $exploitation;\n\t\t}\n\t\treturn $exploitations;\n\t}",
"public function experiments () {\r\n return $this->request_json ('/exp') ;\r\n }",
"public static function provideExpressions(): array\n {\n return [\n [\n 'f(x) = (phi ^ x - (1 - phi) ^ x) / sqrt(5)',\n [\n new Token('f', 0, Token::IDENTIFIER ),\n new Token('(', 1, Token::PARENTHESIS | Token::OPEN ),\n new Token('x', 2, Token::IDENTIFIER ),\n new Token(')', 3, Token::PARENTHESIS | Token::CLOSE ),\n new Token('=', 5, Token::OPERATOR | Token::LEFT ),\n new Token('(', 7, Token::PARENTHESIS | Token::OPEN ),\n new Token('phi', 8, Token::IDENTIFIER ),\n new Token('^', 12, Token::OPERATOR | Token::LEFT ),\n new Token('x', 14, Token::IDENTIFIER ),\n new Token('-', 16, Token::OPERATOR | Token::RIGHT ),\n new Token('(', 18, Token::PARENTHESIS | Token::OPEN ),\n new Token('1', 19, Token::NUMBER ),\n new Token('-', 21, Token::OPERATOR | Token::RIGHT ),\n new Token('phi', 23, Token::IDENTIFIER ),\n new Token(')', 26, Token::PARENTHESIS | Token::CLOSE ),\n new Token('^', 28, Token::OPERATOR | Token::LEFT ),\n new Token('x', 30, Token::IDENTIFIER ),\n new Token(')', 31, Token::PARENTHESIS | Token::CLOSE ),\n new Token('/', 33, Token::OPERATOR | Token::RIGHT ),\n new Token('sqrt', 35, Token::IDENTIFIER ),\n new Token('(', 39, Token::PARENTHESIS | Token::OPEN ),\n new Token('5', 40, Token::NUMBER ),\n new Token(')', 41, Token::PARENTHESIS | Token::CLOSE ),\n new Token('', -1, Token::EOS ),\n ]\n ],\n ];\n }",
"public function getExpression(): string;",
"public function evaluaciones($id) {\n return Cliente::find($id)->evaluaciones;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get MAC addresses of the gateway | public function getMacAddresses() {
$addresses = [];
$lsInterfaces = $this->commandManager->send('ls /sys/class/net | awk \'{ print $0 }\'', true);
$interfaces = explode(PHP_EOL, $lsInterfaces);
foreach ($interfaces as $interface) {
if ($interface === 'lo') {
continue;
}
$cmd = 'cat /sys/class/net/' . $interface . '/address';
$addresses[$interface] = $this->commandManager->send($cmd, true);
}
return $addresses;
} | [
"public function macAddresses(){\n\t\treturn $this->macAddresses;\n\t}",
"public function getMacAddresses() {\n return $this->callSyncStrip('get_macs', array($this->vmName));\n }",
"public function getMaclist()\n {\n $result = $this->client->GetMaclist();\n if ($this->errorHandling($result, 'Could not get MAC list from FRITZ!Box')) {\n return;\n }\n\n return $result;\n }",
"public function getMacAddress()\n\t\t{\n\n\t\t\treturn shell_exec(\"cat /sys/class/net/$(ip route show default | awk '/default/ {print $5}')/address\");\n\n\t\t}",
"function get_mac($ip) {\r\n $ip = trim($ip);\r\n shell_exec($GLOBALS[\"ping\"].\" \".$ip);\r\n $arp = shell_exec($GLOBALS[\"arp\"]);\r\n $arp = explode(\"\\n\", $arp);\r\n foreach($arp as $line) {\r\n if(ereg(\": $ip ---\", $line)) { return(\"This is your adapter, to find MAC try \\\"ipconfig /all\\\"\"); }\r\n if(ereg(\" $ip \", $line)) {\r\n //echo($line.\"\\n\"); //Debug\r\n $line = explode($ip, $line);\r\n $line = trim($line[1]);\r\n $line = explode(\"dynamic\", $line);\r\n $line = trim($line[0]);\r\n //echo($line.\"\\n\"); //Debug\r\n return($line);\r\n }\r\n }\r\n return(\"Not found. Couldn't broadcast to IP.\");\r\n}",
"function getMacsToConnect() {\n return $this->portMacs;\n }",
"public function getApMac()\n {\n return $this->get(self::AP_MAC);\n }",
"public function get_mac_via_ssh($ip) {\n // Copy over getmac.vbs\n $command = \"if WScript.Arguments.Count = 0 Then Wscript.Quit 2001 \\n\";\n $command .= \"Dim ObjWMI: Set ObjWMI = GetObject(\\\"winmgmts:{impersonationLevel=impersonate}!\\\\\\\\.\\\\root\\\\cimv2\\\") \\n\";\n $command .= \"Dim colItems : Set NICS = ObjWMI.ExecQuery(\\\"Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True\\\") \\n\";\n $command .= \"Dim adapterCFG, IPaddr \\n\";\n $command .= \"For each adapterCFG in NICS 'Loop through adapters and get needed information.... \\n\";\n $command .= \" For Each IPaddr in adapterCFG.IPAddress \\n\";\n $command .= \" if WScript.Arguments.Item(0) = IPaddr Then \\n\";\n $command .= \" WScript.Echo adapterCFG.MACAddress \\n\";\n $command .= \" End if \\n\";\n $command .= \" Next \\n\";\n $command .= \"Next \\n\";\n $command .= \"WScript.Quit 2001 \\n\";\n\n $file = './uploads/getmac.vbs';\n\n file_put_contents($file, $command);\n\n $output = array(\n 'status' => \"Sending getmac.vbs to: \".$ip,\n 'output' => shell_exec('scp -i ./certs/labmgr -o StrictHostKeyChecking=no -o ConnectTimeout=1 '.$file.' IBM_USER@' . $ip. ':/cygdrive/c/temp/'),\n 'cmd' => $file,\n 'exit_status' => ''\n );\n unlink($file);\n \n $output = array(\n 'status' => \"ssh to machine to get MAC address: \".$ip,\n 'output' => exec('ssh -i ./certs/labmgr -o \"StrictHostKeyChecking no\" -o \"ConnectTimeout = 1\" IBM_USER@' . $ip .' \"cscript //nologo C:/temp/getmac.vbs ' . $ip.'\"', $cmd_output, $exit_status),\n 'cmd_output' => $cmd_output,\n 'exit_status' => $exit_status\n );\n\n if(!empty($cmd_output[0]) && $cmd_output[0] != 'entries') {\n return $cmd_output[0];\n } else {\n return 'Unable to get MAC Address.';\n }\n\n }",
"public function getMacAddress() : string\n {\n return $this->macAddress;\n }",
"private static function get_mac_classic()\n {\n ob_start();\n // Turn on output buffering\n system('ipconfig/all');\n //Execute external program to display output\n $mycom = ob_get_contents();\n // Capture the output into a variable\n ob_clean();\n // Clean (erase) the output buffer\n $pmac = strpos($mycom, 'Physical');\n // Find the position of Physical text\n $mac = substr($mycom, ($pmac + 36), 17);\n // Get Physical Address\n return $mac;\n }",
"private function extract_unique_mac_address()\n {\n $l_return = [];\n if (isset($this->m_data[C__CATG__NETWORK]) && count($this->m_data[C__CATG__NETWORK]))\n {\n foreach ($this->m_data[C__CATG__NETWORK] AS $l_port)\n {\n if (!array_search($l_port['mac'], $l_return)) $l_return[] = $l_port['mac'];\n } // foreach\n } // if\n return $l_return;\n }",
"public function getMac()\n {\n return $this->get(self::MAC);\n }",
"public function get_gateways()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $routeinfo = array();\n $shell = new Shell();\n\n // Try multi-WAN tables first\n //--------------------------\n\n $shell->execute(self::CMD_IP, 'route show table 250');\n $output = $shell->get_output();\n\n if (! empty($output)) {\n foreach ($output as $line) {\n if (preg_match('/^\\s*nexthop/', $line)) {\n $line = preg_replace('/\\s+/', ' ', $line);\n $parts = explode(' ', trim($line));\n if ($parts[5]) {\n $routeinfo[$parts[2]] = $parts[4];\n }\n }\n }\n }\n\n // Fallback to single WAN route table\n //----------------------------------\n\n $shell->execute(self::CMD_IP, 'route');\n $output = $shell->get_output();\n\n if (! empty($output)) {\n foreach ($output as $line) {\n $matches = array();\n if (preg_match('/^default\\s+via\\s+([0-9\\.]*).*dev\\s+([\\w]*)/', $line, $matches)) {\n $routeinfo[$matches[1]] = $matches[2];\n } elseif (preg_match('/^([0-9\\.]*)\\s+via\\s+([0-9\\.]*).*dev\\s+([\\w+]*)/', $line, $matches)) {\n $routeinfo[$matches[2]] = $matches[3];\n }\n }\n }\n\n return $routeinfo;\n }",
"public static function macAddressWindows()\n {\n ob_start(); // Turn on output buffering\n system('ipconfig /all'); //Execute external program to display output\n $mycom=ob_get_contents(); // Capture the output into a variable\n ob_clean(); // Clean (erase) the output buffer\n $findme = \"Physical\";\n $pmac = strpos($mycom, $findme); // Find the position of Physical text\n $mac=substr($mycom,($pmac+36),17); // Get Physical Address\n $hasil = strtolower(str_replace('-',':',$mac));\n $hasil = Afis::enkripsi($hasil);\n return $hasil;\n }",
"protected function nextMAC()\n {\n $mac_ip = [];\n $allMAC = [];\n $nextMAC = '';\n //Pool of MAC addresses starts from this MAC\n $mac = $this->parameters->mac;\n //Pool of IP addresses starts from this IP\n $ip = $this->parameters->ip;\n //Total number of MAC and IP addresses\n $total = $this->parameters->total;\n\n for ($i = 0; $i < $total; $i++) {\n $mac_ip[$this->parameters->mac_ip . dechex($mac)] = $this->parameters->host_ip . $ip;\n $ip++;\n $mac++;\n }\n try {\n $this->virtualEnv->loginInstance();\n $instances = $this->virtualEnv->listInstances();\n foreach ($instances as $instance) {\n $config = $this->virtualEnv->getInstanceConfig($instance['vmid']);\n if (isset($config[\"net0\"])) {\n $macN = strtolower($this->getMAC($config[\"net0\"]));\n $allMAC[] = $macN;\n }\n }\n\n foreach ($mac_ip as $mac => $ip) {\n $mac = strtolower($mac);\n if (!in_array($mac, $allMAC)) {\n $nextMAC = $mac;\n break;\n }\n }\n if (empty($nextMAC)) {\n throw new \\Exception(\"Don't have free ip\");\n } else {\n $nextIP = $mac_ip[$nextMAC];\n $message = ['message' => ['nextMAC' => $nextMAC, 'nextIP' => $nextIP]];\n }\n\n return $message;\n\n } catch (\\Exception $e) {\n $this->view_log->addInfo($e->getMessage() . ' line: ' . $e->getLine());\n throw $e;\n }\n\n }",
"public function getARPTable(): array;",
"public function mac_address(){\n\t\t // Turn on output buffering \n\t\t // ob_start(); \n\t\t // //mendapatkan detail ipconfing menggunakan CMD \n\t\t // system('ipconfig /all'); \n\t\t // // mendapatkan output kedalam variable \n\t\t // $mycom=ob_get_contents(); \n\t\t // // membersihkan output buffer \n\t\t // ob_clean(); \n\t\t // $findme = \"Physical\"; \n\t\t // // mencari perangkat fisik | menemukan posisi text perangkat fisik \n\t\t // //Search the \"Physical\" | Find the position of Physical text \n\t\t // $pmac = strpos($mycom, $findme); \n\t\t // // mendapatkan alamat peragkat fisik \n\t\t // $mac=substr($mycom,($pmac+36),17); \n\t\t // //menampilkan Mac Address \n\t\t // return $mac; \n\n \t\n\nob_start();\n system('getmac');\n $Content = ob_get_contents();\n ob_clean();\n return substr($Content, strpos($Content,'\\\\')-20, 17);\n\n\t}",
"public function calculateMac() {}",
"public function GetMacFilterList()\n\t{\n\t\t// http://dev.freebox.fr/sdk/os/wifi/#get-the-mac-filter-list\n\t\t$appURL = \"2/wifi/mac_filter/\";\n\t\treturn $this->GetDatas($appURL);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
concatenate name and welcome message | function concatenate_name($fname, $welcome_message) {
if (empty($fname)) {
return false;
} else {
return $welcome_message. $fname;
}
} | [
"public function welcomeMessage(){\n\n // TODO: change message string concatenation\n $current_user = \\Drupal::currentuser();\n\n // Generate customized welcome message with username and current date.\n $welcome_message = 'Hello ' . $current_user->getDisplayName() . '</br>';\n $welcome_message .= 'Today is ' . date(\"l M d, Y G:i\", time());\n\n return $welcome_message;\n }",
"private function welcomeMessage()\n {\n $message = <<<EOD\n===================================\n****** {$this->gameTitle} ******\n===================================\nEOD;\n $this->displayMessage($message);\n }",
"private function writeWelcome()\n {\n $message = sprintf(\n \"<info>%s</info> - %s <comment>%s</comment>.\\n\",\n Trans::__('nut.greeting'),\n Trans::__('nut.version'),\n Version::VERSION\n );\n $this->io->text($message);\n }",
"private function getWelcomeMsg() {\n $msg = \"\";\n $logged_in = \\Drupal::currentUser()->isAuthenticated();\n if($logged_in) {\n $this->getCurrentUserName();\n $msg = \"Welcome, \" . $this->getCurrentUserName() . \"!\";\n } else {\n $msg = \"<a href='user/login' class='menu__link menu__link--link is-active'>Log In</a>\";\n }\n return $msg;\n }",
"public function actionGenerateWelcomeMessage()\n {\n $welcomeMessage = array();\n $welcomeMessage['sender'] = $this->botName;\n $welcomeMessage['message'] = 'Hey there, we are ready to rumble!';\n return $welcomeMessage;\n }",
"public function greet()\n {\n if ($this->security->isAuthenticated())\n {\n $identity = $this->security->getIdentity();\n return \"Welcome, \" . $identity->givenName;\n }\n else\n {\n return \"Welcome, visitor\";\n }\n }",
"function welcome($user)\r\n {\r\n\t $hour = date('H'); \r\n\t $greeting = ($hour<12) ? \r\n\t '<br>Good Morning' : '<br>Good Day'; \r\n\t $greeting.=$user; \r\n\t return $greeting; \r\n }",
"public static function welcome_text() {\n\n\t\t// Switch welcome text based on whether this is a new installation or not.\n\t\t$welcome_text = ( self::is_new_install() )\n\t\t\t? esc_html__( 'Thank you for installing Envira! Envira provides great gallery features for your WordPress site!', 'envira-gallery' )\n\t\t\t/* translators: %s: version */\n\t\t\t: esc_html__( 'Thank you for updating! Envira %s has many recent improvements that you will enjoy.', 'envira-gallery' );\n\n\t\t?>\n\t\t<?php /* translators: %s: version */ ?>\n\t\t<h1 class=\"welcome-header\"><?php printf( esc_html__( 'Welcome to %1$s Envira Gallery %2$s', 'envira-gallery' ), '<span class=\"envira-leaf\"></span> ', esc_html( self::display_version() ) ); ?></h1>\n\n\t\t<div class=\"about-text\">\n\t\t\t<?php\n\t\t\tif ( self::is_new_install() ) {\n\t\t\t\techo esc_html( $welcome_text );\n\t\t\t} else {\n\t\t\t\tprintf( $welcome_text, self::display_version() ); // @codingStandardsIgnoreLine\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\n\t\t<?php\n\t}",
"function acpperms_xml_show_welcome()\n\t{\n\t\t//-------------------------------\n\t\t// INIT\n\t\t//-------------------------------\n\t\t\n\t\t$content = '';\n\t\t\n\t\t//-------------------------------\n\t\t// Check...\n\t\t//-------------------------------\n\t\t\n\t\treturn $this->html->acp_xml_welcome( $this->member_info );\n\t}",
"public function greetUser($name) {\n return \"Hello, \" . $name;\n }",
"public function getWelcomeCookieMsg()\r\n {\r\n return \"Welcome back with cookie\";\r\n }",
"public function outputUsername()\n\t{\n\t\techo App::e($this->username);\n\t}",
"function say_goodbye() {\n return \"Goodbye, {$this->name} {$this->lastname}!\";\n }",
"protected function welcome()\n {\n $this->info('>> Welcome to '.$this->appName.' autosetup <<');\n }",
"function sc_chat_render_welcome_msg( $input ) { \r\r\n\t\r\r\n\t// Get options\r\r\n\t$opts = sc_chat_get_options(); \r\r\n\r\r\n\t?>\r\r\n\t\r\r\n\t<textarea name=\"sc_chat_opts[welcome_msg]\" style=\"width:250px;\"><?php echo $opts['welcome_msg']; ?></textarea>\r\r\n\r\r\n<?php }",
"function welcome_message_login()\r\n{\r\n\tglobal $SITEURL;\r\n\t$Feul = new Feul;\r\n\tif(isset($_SESSION['LoggedIn']))\r\n\t{\r\n\t\t$name = $_SESSION['Username'];\r\n\t\t//Display Welcome Message\r\n\t\t$welcome_box = '<div class=\"user_login_welcome_box_container\"><span class=\\\"user-login-welcome-label\\\">'. i18n_r(THISFILE_UL.'/WELCOME') .' </span>'.$name.'</div>';\r\n\r\n\t\t//Display Logout Link\r\n\t\t$logout_link = '<a href=\"'.$SITEURL.'?logout=yes\" class=\"user-login-logout-link\">'. i18n_r(THISFILE_UL.'/LOGOUT') .'</a>';\r\n\t\techo $Feul->getData('welcomebox').$welcome_box.$logout_link ;\r\n\t}\r\n}",
"private function printWelcome()\n {\n print \"\n ______ __ _ \n / __/ /___ _____ _____/ /( )___ \n _\\ \\/ __/ // / _ `/ __/ __//(_-< \n /___/\\__/\\_,_/\\_,_/_/ \\__/ /___/ \n ___ __ __ ___ \n / _ \\___ ____ ____ _____ _______/ / / |/ /__ ____ ___ ____ ____ ____\n / ___/ _ `(_-<(_-< |/|/ / _ \\/ __/ _ / / /|_/ / _ `/ _ \\/ _ `/ _ `/ -_) __/\n /_/ \\_,_/___/___/__,__/\\___/_/ \\_,_/ /_/ /_/\\_,_/_//_/\\_,_/\\_, /\\__/_/ \n /___/ \" . PHP_EOL;\n }",
"public function dashboard_welcome_metabox_header() {\r\n\t\t/* Translators: %s: username */\r\n\t\t$title = sprintf( __( 'Welcome %s', 'wphb' ), Utils::get_current_user_name() );\r\n\t\t$this->view( 'dashboard/welcome/meta-box-header', compact( 'title' ) );\r\n\t}",
"public function dashboard_welcome_metabox_header() {\r\n\t\t/* Translators: %s: username */\r\n\t\t$title = sprintf( __( 'Welcome %s', 'wphb' ), wphb_get_current_user_info() );\r\n\t\t$this->view( 'dashboard/welcome/meta-box-header', compact( 'title' ) );\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getMarkerName:Fixes marker names with prepended and appended hash marks | function getMarkerName( $markerName ) {
// Fix subpart name if TYPO tags were not inserted
return $markerName = strrpos( $markerName, '###') ? strtoupper( $markerName ) : '###'.strtoupper( $markerName ).'###';
} | [
"private function createMarkerNameWithoutHashes($markerName, $prefix = '') {\n\t\t// If a prefix is provided, uppercases it and separates it with an\n\t\t// underscore.\n\t\tif (!empty($prefix)) {\n\t\t\t$prefix .= '_';\n\t\t}\n\n\t\treturn strtoupper($prefix . trim($markerName));\n\t}",
"public function getMarker(){\n\t\treturn 'marker'.(++$this->marker);\n\t}",
"protected function getter_prefix()\n\t{\n\t\treturn preg_replace(\"/\\\\.?\".preg_quote(\"[\".self::MARKER_ZONE.\"]\").\"$/\", \"\", $this->name);\n\t}",
"function parityTuningMarkerTidy($name) {\n// ~~~~~~~~~~~~~~~~~~~~~~\n\tif (startsWith($name, PARITY_TUNING_FILE_PREFIX)) {\n\t\t$name = str_replace(PARITY_TUNING_FILE_PREFIX, '', $name) . ' marker file ';\n\t}\n\treturn $name;\n}",
"public function getDetachedMarker($name);",
"function zip_entry_name($zip_entry)\n {\n return $zip_entry[1] . $zip_entry[0];\n }",
"function iconSpace( & $marker )\n\t{\n\t\t// lookup icon between <a ...> and </a> or standalone in marker\n\t\t// add space\n\t\t$search\t\t\t\t\t= '#(<a[^>]+>)?(<img[^>]+>)(</a>)?#i';\n\t\t$replace\t\t\t\t= '\\1\\2\\3 ';\n\n\t\t$marker\t\t\t\t\t= preg_replace( $search, $replace, $marker );\n\t}",
"function replace_marker($marker, $value){\n\t\t$this->content = str_replace(\"###\".$marker.\"###\", $value, $this->content);\n\t}",
"function getMarkerParts($marker)\n\t{\n\t\t$parts = array( 'name' => '', 'attr' => '');\n\n\t\t$start = strpos($marker, 'SM_');\n\t\tif ($start === false)\n\t\t\treturn false;\n\n\t\t$start += strlen('SM_');\n\t\t$end = strrpos($marker, '_');\n\n\t\tif ($end === false) {\n\t\t\t$parts[\"name\"] = substr($marker, $start);\n\t\t\t$parts[\"attr\"] = \"VALUE\";\n\t\t} \n\t\telse {\n\t\t\t$parts[\"name\"] = substr($marker, $start, $end - $start);\n\t\t\t$parts[\"attr\"] = substr($marker, $end + 1);\n\n\t\t\t// checks whether the attribute ends with a number and extracts it\n\t\t\t// allows us to have multiple selects with the same name\n\t\t\t//$matches = array();\n\t\t\tpreg_match('/^(\\w*)(\\d+)$/', $parts['attr'], $matches);\n\t\t\tif (count($matches) > 0)\n\t\t\t\t$parts['attr'] = $matches[1];\n\t\t}\n\t\treturn $parts;\n\t}",
"public function substituteMarker($name, $value) {\n\t\t/* For each marker, only substitute if the field is registered as a marker. This approach has shown to\n\t\t speed up things quite a bit. */\n\n\t\t$value = strip_tags($value);\n\n\t\tif (in_array($name, $this->htmlAdvancedMarkers)) {\n\t\t\t$this->html = tx_tcdirectmail_mailer::advancedSubstituteMarker($this->html, $name, htmlspecialchars($value));\n\t\t}\n\n\t\tif (in_array($name, $this->plainAdvancedMarkers)) {\n\t\t\t$this->plain = tx_tcdirectmail_mailer::advancedSubstituteMarker($this->plain, $name, $value);\n\t\t}\n\n\t\tif (in_array($name, $this->titleAdvancedMarkers)) {\n\t\t\t$this->title = tx_tcdirectmail_mailer::advancedSubstituteMarker($this->title, $name, $value);\n\t\t}\n\n\t\tif (in_array($name, $this->htmlMarkers)) {\n\t\t\t$this->html = str_replace(\"###$name###\", htmlspecialchars($value), $this->html);\n\t\t}\n\n\t\tif (in_array($name, $this->plainMarkers)) {\n\t\t\t$this->plain = str_replace(\"###$name###\", $value, $this->plain);\n\t\t}\n\n\t\tif (in_array($name, $this->titleMarkers)) {\n\t\t\t$this->title = str_replace(\"###$name###\", $value, $this->title);\n\t\t}\n\t}",
"public function getMarker($marker){\n\t\t$this->marker = $marker;\n\t}",
"private function extractMarkerData() {\n\n\t\t$hash = md5( serialize( $this->getMarkers() ) );\n\n\t\tif ( $hash == $this->marker_data_hash ) {\n\t\t\treturn true;\n\t\t}\n\n\t \tforeach( $this->markers as $marker_id => $marker ) {\n\t\t\tif ( $marker->icon instanceof \\PHPGoogleMaps\\Overlay\\MarkerIcon ) {\n\t\t\t\tif ( ( $icon_id = array_search( $marker->icon, $this->marker_icons ) ) !== false ) {\n\t\t \t\t\t$marker->_icon_id = $icon_id;\n\t \t\t\t}\n\t \t\t\telse {\n\t\t \t\t\t$this->marker_icons[] = $marker->icon;\n\t\t \t\t\t$marker->_icon_id = count( $this->marker_icons ) - 1;\n\t \t\t\t}\n\t\t\t\tif ( $marker->shadow instanceof \\PHPGoogleMaps\\Overlay\\MarkerIcon ) {\n\t\t\t\t\tif ( ( $shadow_id = array_search( $marker->shadow, $this->marker_icons ) ) !== false ) {\n\t\t \t\t\t\t$marker->_shadow_id = count( $this->marker_icons ) - 1;\n\t\t \t\t\t}\n\t\t \t\t\telse {\n\t\t\t \t\t\t$this->marker_icons[] = $marker->shadow;\n\t\t\t\t\t\t$marker->_shadow_id = count( $this->marker_icons ) - 1;\n\t\t \t\t\t}\n\t\t\t\t}\n\t\t\t}\n \t\t\tif ( $marker->shape instanceof \\PHPGoogleMaps\\Overlay\\MarkerShape ) {\n\t\t\t\tif ( ( $shape_id = array_search( $marker->shape, $this->marker_shapes ) ) !== false ) {\n\t\t\t\t\t$marker->_shape_id = $shape_id;\n\t \t\t\t}\n\t \t\t\telse {\n\t\t \t\t\t$this->marker_shapes[] = $marker->shape;\n\t\t\t\t\t$marker->_shape_id = count( $this->marker_shapes ) - 1;\n\t \t\t\t}\n \t\t\t}\n \t\t\tforeach ( $marker->groups as $marker_group ) {\n \t\t\t\tif ( isset( $this->marker_groups[ $marker_group->var_name ] ) ) {\n \t\t\t\t\t$this->marker_groups[ $marker_group->var_name ]['markers'][] = $marker_id;\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\t$this->marker_groups[ $marker_group->var_name ] = array(\n \t\t\t\t\t\t'id'\t\t=> count( $this->marker_groups ),\n \t\t\t\t\t\t'name'\t\t=> $marker_group->name,\n \t\t\t\t\t\t'markers'\t=> array( $marker_id )\n \t\t\t\t\t);\n \t\t\t\t}\n\t\t\t}\n\t \t}\n\t \t$this->marker_data_hash = md5( serialize( $this->getMarkers() ) );\n\n\t}",
"public function addMarkersToMap()\r\n {\r\n if ($this->marker_collection === null) return;\r\n $g = 0;\r\n $output = '';\r\n for ($collection = $this->marker_collection, $collection->reset(); !$collection->isDone(); $collection->next()) {\r\n $output .= $this->getMarkerMarkup($g, $collection->current());\r\n $g++;\r\n }\r\n return $output;\r\n }",
"function getFileName($isMarker, $msg)\n\t{\n\t\treturn Configure::read('QRMaker.docroot') . '/' . ($isMarker ? 'ar_' : 'qr_') . $msg . '.png';\n\t}",
"function replaceMarker($template,$markerArray){\n\t\tforeach ( $markerArray as $key => $value) {\n $template = str_replace( '###'.$key.'###', $value, $template);\n }\n\t\t return $template;\n\t}",
"public function coordinateName() : string\n {\n $name = 'XY';\n\n if ($this->hasZ) {\n $name .= 'Z';\n }\n\n if ($this->hasM) {\n $name .= 'M';\n }\n\n return $name;\n }",
"public function prepareNameForAvatar(): string\n {\n return str_replace(' ', '+', $this->name);\n }",
"public function substituteMarkerDataProvider() {}",
"public function getMarkerFactoryClassStr();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the user can delete the time. | public function delete(User $user, Time $time)
{
return $user->id === $time->checkPoint->run->creator_id;
} | [
"public function allowDeletion() {\n return !$this->getReservedHoursCount();\n }",
"function canDelete($user) {\n if($this->getIsDefault()) {\n return false; // Default time report cannot be deleted\n } // if\n \treturn $user->isAdministrator() || ($user->getSystemPermission('use_time_reports') && $user->getSystemPermission('manage_time_reports'));\n }",
"public function canDelete()\n {\n if ($this->created_by == Yii::$app->user->id) {\n return true;\n }\n\n return false;\n }",
"public function canDelete(): bool\n {\n if (Auth::getLoggedInUserId() == $this->user_id || Auth::isAdmin()) {\n return true;\n }\n\n return false;\n }",
"function hasDeletePermission()\r\n {\r\n $attributes['uid'] = getFromSession('uid');\r\n $thisUser = new User($attributes);\r\n $userType = $thisUser->getUserType();\r\n \r\n if($userType == 'Unpreviledged')\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }",
"function canDelete($user) {\n $project = $this->getProject();\n if(!instance_of($project, 'Project')) {\n return false;\n } // if\n \n if($user->isProjectManager() || $user->isProjectLeader($this->getProject())) {\n return true; // administrators and project managers have all permissions\n } // if\n \n if(($this->getVisibility() < VISIBILITY_NORMAL) && !$user->canSeePrivate()) {\n return false;\n } // if\n \n if($this->permission_name && $user->getProjectPermission($this->permission_name, $project) >= PROJECT_PERMISSION_MANAGE) {\n return true;\n } // if\n \n // Author in the next three hours\n if($this->getCreatedById() == $user->getId()) {\n $created_on = $this->getCreatedOn();\n return time() < ($created_on->getTimestamp() + 10800);\n } // if\n \n return false;\n }",
"function user_deletion_allowed($user)\r\n {\r\n //A check to not delete a user when he's an active teacher\r\n $courses = WeblcmsDataManager :: get_instance()->count_courses(new EqualityCondition(Course :: PROPERTY_TITULAR, $user->get_id()));\r\n if ($courses > 0)\r\n {\r\n return false;\r\n }\r\n return true;\r\n }",
"function current_user_can_delete() {\n\t\treturn false;\n\t}",
"function canDelete(User $user) {\n return $user->canManageTrash();\n }",
"public function delete()\n {\n return auth()->user()->can('user_delete');\n }",
"public function canDelete()\n {\n return !$this->isAssigned();\n //nikto ho este neriesil\n }",
"function canDeleteItem() {\n\n if (!Session::haveAccessToEntity($this->getEntityID())) {\n return false;\n }\n\n // user can delete his ticket if no action on it\n if ($_SESSION[\"glpiactiveprofile\"][\"interface\"] == \"helpdesk\"\n && (!($this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || $this->fields[\"users_id_recipient\"] === Session::getLoginUserID())\n || $this->numberOfFollowups() > 0\n || $this->numberOfTasks() > 0\n || $this->fields[\"date\"] != $this->fields[\"date_mod\"])) {\n return false;\n }\n\n return static::canDelete();\n }",
"public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }",
"public function canDelete() {\n return !$this->anySubmissions() && !$this->anyManualGrades() && !$this->anyTeams();\n }",
"protected function __canDelete() {\r\n\t\t\tif ($this->userId < 1 || !LoginKeyProviders::validValue($this->provider->getValue())) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}",
"public function isScheduledForDeletion();",
"public function isDeleteAllowed()\n {\n return $this->isAllowedAction('delete');\n }",
"public function canDelete() {\n $query = 'SELECT * FROM ' . ROSTERSOFTEAMSOFSEASONS . ' WHERE playerID=' . $this->get_playerID();\n $result = mysql_query($query) or die(\"sp_clubs (Line \" . __LINE__ . \"): \" . mysql_errno() . \": \" . mysql_error());\n if ($result && mysql_num_rows($result) > 0) {\n return false;\n } else {\n return true;\n }\n }",
"public static function delete($timeID) {\n\t\t$db = new DB();\n\t\t$statement = $db->prepare(SQL_STATISTICTIME_DELETE);\n\t\t$statement->bind_param(\"i\", $timeID);\n\t\t$statement->execute();\n\t\t$db->close();\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the engagement_rating_stars column Example usage: $query>filterByEngagementRatingStars(1234); // WHERE engagement_rating_stars = 1234 $query>filterByEngagementRatingStars(array(12, 34)); // WHERE engagement_rating_stars IN (12, 34) $query>filterByEngagementRatingStars(array('min' => 12)); // WHERE engagement_rating_stars >= 12 $query>filterByEngagementRatingStars(array('max' => 12)); // WHERE engagement_rating_stars | public function filterByEngagementRatingStars($engagementRatingStars = null, $comparison = null)
{
if (is_array($engagementRatingStars)) {
$useMinMax = false;
if (isset($engagementRatingStars['min'])) {
$this->addUsingAlias(PressContactPeer::ENGAGEMENT_RATING_STARS, $engagementRatingStars['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($engagementRatingStars['max'])) {
$this->addUsingAlias(PressContactPeer::ENGAGEMENT_RATING_STARS, $engagementRatingStars['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PressContactPeer::ENGAGEMENT_RATING_STARS, $engagementRatingStars, $comparison);
} | [
"public function rating_filter_meta_query() {\n\t\treturn array();\n\t}",
"public function filterByStarred($starred = null, $comparison = null)\n\t{\n\t\tif (is_array($starred)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($starred['min'])) {\n\t\t\t\t$this->addUsingAlias(StuffPeer::STARRED, $starred['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($starred['max'])) {\n\t\t\t\t$this->addUsingAlias(StuffPeer::STARRED, $starred['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(StuffPeer::STARRED, $starred, $comparison);\n\t}",
"public function addGalaxyFilter($galaxy)\n\t{\n\t\t$this->getSelect()->where(array(\"g\" => \"galaxy\"), $galaxy);\n\t\treturn $this;\n\t}",
"public function scopeFilterByRating($query, $filter) {\n if(isset($filter)) {\n return $query->whereIn('rating', array_values($filter));\n } else {\n return $query;\n }\n }",
"public function filterByRating($rating = null, $comparison = null)\n {\n if (is_array($rating)) {\n $useMinMax = false;\n if (isset($rating['min'])) {\n $this->addUsingAlias(UserPeer::USER_RATING, $rating['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($rating['max'])) {\n $this->addUsingAlias(UserPeer::USER_RATING, $rating['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserPeer::USER_RATING, $rating, $comparison);\n }",
"function setRevenueFilter($min) {\n $this->WHERE['rev_avg >= '] = $min;\n }",
"public function filterByStartdateAssig($startdateAssig = null, $comparison = null)\n\t{\n\t\tif (is_array($startdateAssig)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($startdateAssig['min'])) {\n\t\t\t\t$this->addUsingAlias(WikiConfPeer::STARTDATE_ASSIG, $startdateAssig['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($startdateAssig['max'])) {\n\t\t\t\t$this->addUsingAlias(WikiConfPeer::STARTDATE_ASSIG, $startdateAssig['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(WikiConfPeer::STARTDATE_ASSIG, $startdateAssig, $comparison);\n\t}",
"public function filterByStartdt($startdt = null, $comparison = null)\n {\n if (is_array($startdt)) {\n $useMinMax = false;\n if (isset($startdt['min'])) {\n $this->addUsingAlias(EmployeeTableMap::COL_STARTDT, $startdt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($startdt['max'])) {\n $this->addUsingAlias(EmployeeTableMap::COL_STARTDT, $startdt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EmployeeTableMap::COL_STARTDT, $startdt, $comparison);\n }",
"public function filterByStartdate($startdate = null, $comparison = null)\r\n\t{\r\n\t\tif (is_array($startdate)) {\r\n\t\t\t$useMinMax = false;\r\n\t\t\tif (isset($startdate['min'])) {\r\n\t\t\t\t$this->addUsingAlias(ThemePeer::STARTDATE, $startdate['min'], Criteria::GREATER_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif (isset($startdate['max'])) {\r\n\t\t\t\t$this->addUsingAlias(ThemePeer::STARTDATE, $startdate['max'], Criteria::LESS_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif ($useMinMax) {\r\n\t\t\t\treturn $this;\r\n\t\t\t}\r\n\t\t\tif (null === $comparison) {\r\n\t\t\t\t$comparison = Criteria::IN;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->addUsingAlias(ThemePeer::STARTDATE, $startdate, $comparison);\r\n\t}",
"static function hotelWithRating($rating){\n $query = DB::table('hotel')\n ->where('rating', $rating)\n ->get();\n\n return $query;\n }",
"public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(SchoolClassPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(SchoolClassPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolClassPeer::UPDATED_BY, $updatedBy, $comparison);\n }",
"private function minimumRate($array, $minRate){\n switch($minRate){\n case \"1\":\n $new = array_filter($array, function ($var) {\n return ($var['rating'] >= \"1\");\n });\n return $new;\n break;\n case '2':\n $new = array_filter($array, function ($var) {\n return ($var['rating'] >= '2');\n });\n return $new;\n break;\n case '3':\n $new = array_filter($array, function ($var) {\n return ($var['rating'] >= '3');\n });\n return $new;\n break;\n case '4':\n $new = array_filter($array, function ($var) {\n return ($var['rating'] >= '4');\n });\n return $new;\n break;\n case '5':\n $new = array_filter($array, function ($var) {\n return ($var['rating'] == '5');\n });\n return $new;\n break; \n default:\n return \"There is no such rating\";\n \n }\n }",
"public function filterByNumRatings($numRatings = null, $comparison = null)\n {\n if (is_array($numRatings))\n {\n $useMinMax = false;\n if (isset($numRatings['min']))\n {\n $this->addUsingAlias(CollectionPeer::NUM_RATINGS, $numRatings['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($numRatings['max']))\n {\n $this->addUsingAlias(CollectionPeer::NUM_RATINGS, $numRatings['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax)\n {\n return $this;\n }\n if (null === $comparison)\n {\n $comparison = Criteria::IN;\n }\n }\n return $this->addUsingAlias(CollectionPeer::NUM_RATINGS, $numRatings, $comparison);\n }",
"public function filterByRating($rating = null, $comparison = null)\n {\n if (is_array($rating)) {\n $useMinMax = false;\n if (isset($rating['min'])) {\n $this->addUsingAlias(UserratingTableMap::COL_RATING, $rating['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($rating['max'])) {\n $this->addUsingAlias(UserratingTableMap::COL_RATING, $rating['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserratingTableMap::COL_RATING, $rating, $comparison);\n }",
"function ws_std_image_sql_filter( $params, $tbl_name='' )\n{\n $clauses = array();\n if ( is_numeric($params['f_min_rate']) )\n {\n $clauses[] = $tbl_name.'rating_score>='.$params['f_min_rate'];\n }\n if ( is_numeric($params['f_max_rate']) )\n {\n $clauses[] = $tbl_name.'rating_score<='.$params['f_max_rate'];\n }\n if ( is_numeric($params['f_min_hit']) )\n {\n $clauses[] = $tbl_name.'hit>='.$params['f_min_hit'];\n }\n if ( is_numeric($params['f_max_hit']) )\n {\n $clauses[] = $tbl_name.'hit<='.$params['f_max_hit'];\n }\n if ( isset($params['f_min_date_available']) )\n {\n $clauses[] = $tbl_name.\"date_available>='\".$params['f_min_date_available'].\"'\";\n }\n if ( isset($params['f_max_date_available']) )\n {\n $clauses[] = $tbl_name.\"date_available<'\".$params['f_max_date_available'].\"'\";\n }\n if ( isset($params['f_min_date_created']) )\n {\n $clauses[] = $tbl_name.\"date_creation>='\".$params['f_min_date_created'].\"'\";\n }\n if ( isset($params['f_max_date_created']) )\n {\n $clauses[] = $tbl_name.\"date_creation<'\".$params['f_max_date_created'].\"'\";\n }\n if ( is_numeric($params['f_min_ratio']) )\n {\n $clauses[] = $tbl_name.'width/'.$tbl_name.'height>='.$params['f_min_ratio'];\n }\n if ( is_numeric($params['f_max_ratio']) )\n {\n $clauses[] = $tbl_name.'width/'.$tbl_name.'height<='.$params['f_max_ratio'];\n }\n if (is_numeric($params['f_max_level']) )\n {\n $clauses[] = $tbl_name.'level <= '.$params['f_max_level'];\n }\n return $clauses;\n}",
"public function provide_scaleFilter ( )\n {\n return array(\n array(\n 1\n ),\n );\n\n }",
"public function filterByRating($rating = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($rating)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $rating)) {\n $rating = str_replace('*', '%', $rating);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TVShowTableMap::RATING, $rating, $comparison);\n }",
"private function filterbyfuel ($query,Request $request){\n\n if (isset($request->search)) {\n $query->where('vehicle.vehicle_name', 'LIKE', \"%{$request->search}%\");\n \n }\n if (isset($request->type)) {\n $query->where(DB::raw(\"'fuel'\"), '=', $request->type);\n }\n\n if (isset($request->mincost)) {\n \n $query->where('fuel_entries.cost', '>' , $request->mincost);\n }\n if (isset($request->maxcost)) {\n $query->where('fuel_entries.cost', '<' , $request->maxcost);\n \n }\n if (isset($request->mindate)) {\n $query->whereDate('fuel_entries.entry_date', '>' , $request->mindate);\n \n }\n if (isset($request->maxdate)) {\n $query->whereDate('fuel_entries.entry_date', '<' , $request->maxdate);\n \n }\n\n }",
"public function filterByScreenWidth($screenWidth = null, $comparison = null)\n {\n if (is_array($screenWidth)) {\n $useMinMax = false;\n if (isset($screenWidth['min'])) {\n $this->addUsingAlias(AnalyticPeer::SCREEN_WIDTH, $screenWidth['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($screenWidth['max'])) {\n $this->addUsingAlias(AnalyticPeer::SCREEN_WIDTH, $screenWidth['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AnalyticPeer::SCREEN_WIDTH, $screenWidth, $comparison);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return hash with all users of a Region with a role | public function getRegionRoleList($prmRegionId)
{
$myData = array();
$sQuery = '
SELECT
RegionAuth.UserId,
RegionAuth.AuthAuxValue AS UserRole,
User.UserFullName AS UserName,
User.UserEMail
FROM RegionAuth
INNER JOIN User ON RegionAuth.UserId=User.UserId AND User.UserActive>0
WHERE
RegionAuth.AuthKey="ROLE" AND
RegionAuth.AuthAuxValue != "NONE" AND
RegionAuth.RegionId=:RegionId
ORDER BY User.UserFullName
';
$sth = $this->q->core->prepare($sQuery);
$sth->bindParam(':RegionId', $prmRegionId, PDO::PARAM_STR);
try {
$sth->execute();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
$sKey = $row['UserId'];
$myData[$sKey] = $row;
}
$sth->closeCursor();
} catch (Exception $e) {
showErrorMsg(debug_backtrace(), $e, '');
}
return $myData;
} | [
"protected function getUserRoleList()\n {\n $myData = array();\n $sQuery = \"SELECT RegionAuth.*,Region.RegionLabel FROM RegionAuth,Region WHERE \" .\n \" (RegionAuth.RegionId = Region.RegionId) \" .\n \" AND (UserId='\" . $this->UserId . \"') \" .\n \" AND AuthKey='ROLE'\" .\n \" ORDER BY RegionAuth.RegionId\";\n $sth = $this->q->core->prepare($sQuery);\n try {\n $this->q->core->beginTransaction();\n $sth->execute();\n $this->q->core->commit();\n while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {\n $sKey = $row['RegionId'];\n $sValue = $row['AuthAuxValue'];\n $myData[$sKey]['Role'] = $row['AuthAuxValue'];\n $myData[$sKey]['RegionLabel'] = $row['RegionLabel'];\n }\n $sth->closeCursor();\n } catch (Exception $e) {\n $this->q->core->rollBack();\n showErrorMsg(debug_backtrace(), $e, '');\n }\n return $myData;\n }",
"function intervention_get_users_in_role($role) {\n\n $result = db_select('users_roles', 'ur')\n ->fields('ur')\n ->condition('ur.rid', $role->rid, '=')\n ->execute();\n foreach ($result as $record) {\n $uids[] = $record->uid;\n };\n\n return $uids;\n}",
"function buggm_get_user_ids_by_role($role){\n $ids=array();\n $users=get_users(array('role'=>$role));\n foreach((array)$users as $user){\n $ids[]=$user->ID;\n }\n return $ids;\n}",
"function bbp_get_user_role_map()\n{\n}",
"public static function getUsersForRegion ($r_name){\n\n $region_id = Region::getRegionIdFromName($r_name);\n\n $query = \"select user_id from \" . User::DBTABLE . \" where id in \" . \"(select distinct u_id from \" . UserPred::USER_PRED_TABLE . \" where r_id= $region_id)\";\n\n $resultSet = DBAccess::runQuery($query);\n\n if ($resultSet == NULL || $resultSet == False) {\n echo \"Unable to access database\";\n return NULL;\n }\n\n # Loop through all the regions\n $rows = mysqli_num_rows($resultSet);\n if ($rows == 0)\n return NULL;\n\n // $user_list => list of users\n $user_list = [];\n for($i = 0; $i < $rows; $i++) {\n $row = mysqli_fetch_assoc($resultSet);\n $user_list[] = $row[\"user_id\"];\n }\n return $user_list;\n }",
"public function getUserRoles();",
"public function getUserRegions()\n {\n return $this->hasMany(UserRegion::class, ['user_id' => 'id']);\n }",
"public static function getUserAllByrole($rolename)\n {\t\t\t \t\n\t\t$Roleusers = \\Yii::$app->authManager->getUserIdsByRole($rolename);\t\t\n\t\t$data = User::find()->where(['IN', 'id', $Roleusers])->andWhere(['status'=>10])->all();\n\t\treturn $data;\n }",
"public function allWithRole(): array\n {\n $sql = \"SELECT u.id, u.firstname, u.lastname, r.name role_name FROM `user` u LEFT JOIN `role` r ON u.role_id = r.id\" ;\n return $this->pdo->query($sql)->fetchAll();\n }",
"function get_all_userids_with_role($role) {\n global $wpdb;\n $userids_in_role = array();\n \n if ( $userids = $this->get_all_user_ids() ) {\n foreach($userids as $userid) {\n $user = new WP_User($userid);\n $user->roles = $this->fill_array_keys_with_true( $user->roles );\n if ( in_array($role, array_keys($user->roles))) {\n $userids_in_role[]=$userid;\n }\n }\n }\n return $userids_in_role;\n }",
"public function rolesForUser();",
"private function get_roles_hash() {\n\t\treturn md5( wp_json_encode( $this->user_roles ) );\n\t}",
"function _esi__get_roles_hash($rids) {\n $seed = _esi__get_seed_key();\n $hash = implode(':', $rids);\n $hash = md5($seed . md5($hash));\n return $hash;\n}",
"public function listAllowedRegions() {\r\n\t\t$r = new Region();\r\n if($this->isSuperAdmin())\r\n return $r->getList('', '', 'ORDER BY t.name');\r\n else\r\n return $r->getList('JOIN sys_region_users sru ON sru.region = t.id', 'WHERE sru.bo_user = '.$this->id, 'ORDER BY t.name');\r\n\t}",
"public function getUserIdsByRole($roleName)\n {\n }",
"function get_users_by_region($is_active=false,$region=false,$orderby = false,$sortby = \"DESC\",$slimit=false,$elimit=false)\n{\n\t\t\t$user_info=array();\n\n\t\t\tif($orderby){\n\t\t\t\t$orderby = \t\"order by $orderby $sortby\";\n\t\t\t}\n\t\t\tif($region) {\n\t\t\t\t$region = \"and city = '\".$region.\"'\";\n\t\t\t}\n\t\t\tif($elimit){\n\t\t\t\t$elimit = \"LIMIT $slimit, $elimit\";\n\t\t\t}\t\t\t\n\t\t\tif($is_active) //for active users only\n\t\t\t{\n\t\t\t\t$sql=\"select * from users where is_active=1 $region $orderby $elimit\";\n\t\t\t}\n\t\t\telse //for inactive users only\n\t\t\t{\n\t\t\t\t$sql=\"select * from users where is_active=0 $region $orderby $elimit\";\n\t\t\t}\n\t\t\t$result=Execute_command($sql);\n\t\t\t//echo $sql;\n\t\t\ttry\n\t\t\t{\t\twhile($record=mysql_fetch_array($result))\n\t\t\t\t\t{\n\t\t\t\t\t\t$user_info[]=$record;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\t$_SESSION['mysql_eror']=$result;\n\t\t\t}\n\t\n\n\treturn $user_info;\n}",
"function et_get_user_fields_by_role($role = 'all'){\n\tglobal $et_global;\n\t$user_fields = $et_global['user_fields'];\n\n}",
"public function getAllRoleData()\n {\n $roleData = [];\n\n foreach ($this->userContexts as $userContext) {\n $roleData[] = $userContext->getRoleData();\n }\n\n return $roleData;\n }",
"function getRoleUsers()\n\t{\n\t\tif ($this->roleUsers == null)\n\t\t{\n\t\t\t$roleUserMapper = new RoleUserMapper();\n\t\t\t$this->roleUsers = $roleUserMapper->findByRoleId($this->getId());\n\t\t}\n\t\t\n\t\treturn $this->roleUsers;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates hyperlink from text. | public function hyperlink(&$text)
{
// match protocol://address/path/file.extension?some=variable&another=asf%
$text = preg_replace('/\s(([a-zA-Z]+:\/\/)([a-z][a-z0-9_\..-]*[a-z]{2,6})([a-zA-Z0-9\/*-?&%]*))\s/i', ' <a href="$1">$3</a> ', $text);
// match www.something.domain/path/file.extension?some=variable&another=asf%
$text = preg_replace('/\s(www\.([a-z][a-z0-9_\..-]*[a-z]{2,6})([a-zA-Z0-9\/*-?&%]*))\s/i', ' <a href="http://$1">$2</a> ', $text);
return $text;
} | [
"public static function makeClickable($text) {\n return preg_replace_callback(\n '#\\bhttps?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#', \n create_function(\n '$matches',\n 'return \"<a href=\\'{$matches[0]}\\'>{$matches[0]}</a>\";'\n ),\n $text\n );\n}",
"public static function makeUrlClickable($text) {\n\t\treturn preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href=\"$1\" target=\"_blank\">$1</a>', $text);\n\t}",
"private static function makeLinksClickable($text){\n return preg_replace(\n '!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;/=]+)!i', \"<center><a target='_blank' style='text-decoration: underline; cursor: pointer;' href='$1'><button style='background: \".$GLOBALS['primary_colour'].\"; border: 0; padding: 5px; width: 75px; color: white; margin: 20px 0;'>Link</button></a></center>\",\n $text\n );\n }",
"function link_souce($text){\n\n if(post::isValidURL($text)){\n $text = '<a href=\"'.$text.'\">'.$text.'</a>';\n } \n return $text;\n }",
"function MakeClickable($text) {\n return preg_replace_callback(\n '#\\b(?<![href|src]=[\\'\"])https?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#',\n create_function(\n '$matches',\n 'return \"<a href=\\'{$matches[0]}\\'>{$matches[0]}</a>\";'\n ),\n $text\n );\n}",
"function &makeClickable( &$text ) {\n $patterns = array( \"/(^|[^]_a-z0-9-=\\\"'\\/])([a-z]+?):\\/\\/([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/])www\\.([a-z0-9\\-]+)\\.([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/])ftp\\.([a-z0-9\\-]+)\\.([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/:\\.])([a-z0-9\\-_\\.]+?)@([^, \\r\\n\\\"\\(\\)'<>\\[\\]]+)/i\" );\n $replacements = array( \"\\\\1<a href=\\\"\\\\2://\\\\3\\\" target=\\\"_blank\\\">\\\\2://\\\\3</a>\", \"\\\\1<a href=\\\"http://www.\\\\2.\\\\3\\\" target=\\\"_blank\\\">www.\\\\2.\\\\3</a>\", \"\\\\1<a href=\\\"ftp://ftp.\\\\2.\\\\3\\\" target=\\\"_blank\\\">ftp.\\\\2.\\\\3</a>\", \"\\\\1<a href=\\\"mailto:\\\\2@\\\\3\\\">\\\\2@\\\\3</a>\" );\n $text = preg_replace( $patterns, $replacements, $text );\n return $text;\n }",
"function render_link($text, $url) {\n return \"<a href=\\\"$url\\\">$text</a>\";\n }",
"function CreateLink($text, $link)\n\t{\n\t\tCreateRowHeader();\n\t\techo \"\t<div class=\\\"col-sm-12\\\">\\n\";\n\t\techo \" <p class=\\\"lead\\\"><a href=\\\"\" . $link . \"\\\">\" . $text . \"</a></p>\\n\";\n\t\techo \" </div>\\n\";\n\t\techo \"</div>\\n\";\n\t}",
"private function make_clickable($text) {\r\n return preg_replace_callback(\r\n '#\\b(?<![href|src]=[\\'\"])https?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#', create_function(\r\n '$matches', 'return \"<a href=\\'{$matches[0]}\\'>{$matches[0]}</a>\";'\r\n ), $text\r\n );\r\n }",
"public static function toLink( $text ) {\n\n $source = [\n '/á/i', '/é/i', '/ű|ú|ü/i', '/ő|ó|ö/i', '/í/i', // accented characters\n '/[\\s]+/', // whitespaces\n '/[^\\w\\+]+/iu', // special characters\n '/[\\-]+/i', // shrink multiple separators\n '/[\\+]+/i',\n '/(\\-\\+)|(\\+\\-)/i' // change the separators next to each other\n ];\n $target = [ 'a', 'e', 'u', 'o', 'i', '+', '-', '-', '+', '+' ];\n\n // convert text\n $text = mb_convert_case( $text, MB_CASE_LOWER, 'UTF-8' ); // lowercase\n $text = preg_replace( $source, $target, $text ); // change the chars\n $text = trim( $text, ' -+' ); // trim special chars the beginning or end of the string\n\n return $text;\n }",
"function make_clickable($text) {\n return preg_replace_callback(\n '#\\b(?<![href|src]=[\\'\"])https?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#',\n create_function(\n '$matches',\n 'return \"<a href=\\'{$matches[0]}\\'>{$matches[0]}</a>\";'\n ),\n $text\n );\n}",
"public function create_links ($text, $field_type = \"varchar\") {\n // create links only for varchar fields\n if (strpos($field_type, \"varchar\")!==false) {\n \t\t// regular expression\n \t\t$reg_exUrl = \"#(http|https|ftp|ftps|telnet|ssh)://\\S+[^\\s.,>)\\];'\\\"!?]#\";\n\n \t\t// Check if there is a url in the text\n \t\tif(preg_match($reg_exUrl, $text, $url)) {\n \t // make the urls hyper links\n \t $text = preg_replace($reg_exUrl, \"<a href='{$url[0]}' target='_blank'>{$url[0]}</a> \", $text);\n \t\t}\n }\n // return text\n return $text;\n\t}",
"private function makeLinkClickableInJson($text) {\n $text = html_entity_decode($text);\n $text = \" \" . $text;\n $text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)', '<a href=\"\\\\1\" target=_blank>\\\\1</a>', $text);\n $text = eregi_replace('(((f|ht){1}tps://)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)', '<a href=\"\\\\1\" target=_blank>\\\\1</a>', $text);\n $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\\+.~#?&//=]+)', '\\\\1<a href=\"http://\\\\2\" target=_blank>\\\\2</a>', $text);\n $text = eregi_replace('([_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3})', '<a href=\"mailto:\\\\1\" target=_blank>\\\\1</a>', $text);\n return $text;\n }",
"function __makeClickableLinks($text) { \n\t\t$text = preg_replace(\"#(^|[\\n ])([\\w]+?://[\\w]+[^ \\\"\\n\\r\\t< ]*)#\", \"\\\\1<a rel=\\\"nofollow\\\" href=\\\"\\\\2\\\" target=\\\"_blank\\\">\\\\2</a>\", $text);\n\t\t$text = preg_replace(\"#(^|[\\n ])((www|ftp)\\.[^ \\\"\\t\\n\\r< ]*)#\", \"\\\\1<a rel=\\\"nofollow\\\" href=\\\"http://\\\\2\\\" target=\\\"_blank\\\">\\\\2</a>\", $text);\n\t\t$text = preg_replace(\"/@(\\w+)/\", \"<a rel=\\\"nofollow\\\" href=\\\"http://www.twitter.com/\\\\1\\\" target=\\\"_blank\\\">@\\\\1</a>\", $text);\n\t\t$text = preg_replace(\"/#(\\w+)/\", \"<a rel=\\\"nofollow\\\" href=\\\"?q=/tags/\\\\1\\\" target=\\\"_blank\\\">#\\\\1</a>\", $text);\n\t\t$text = preg_replace(\"/>>([0-9]+)\\b/i\", \"<a rel=\\\"nofollow\\\" href=\\\"#\\\\1\\\" >>>\\\\1</a>\", $text);\n\t\t//$text = preg_replace(\"/\\/\\/(\\w+)/\", \"<span style='color:green;font-style:bold;'>//\\\\1</span>\", $text);\n\t\treturn $text; \n\t}",
"public function format_text_to_links( $text ) {\r\n\t\tif( empty( $text ) ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t $text = preg_replace( \"/(^|[\\n ])([\\w]*?)((ht|f)tp(s)?:\\/\\/[\\w]+[^ \\,\\\"\\n\\r\\t<]*)/is\", \"$1$2<a href=\\\"$3\\\" >$3</a>\", $text );\r\n\t $text = preg_replace( \"/(^|[\\n ])([\\w]*?)((www|ftp)\\.[^ \\,\\\"\\t\\n\\r<]*)/is\", \"$1$2<a href=\\\"http://$3\\\" >$3</a>\", $text );\r\n\t $text = preg_replace( \"/(^|[\\n ])([a-z0-9&\\-_\\.]+?)@([\\w\\-]+\\.([\\w\\-\\.]+)+)/i\", \"$1<a href=\\\"mailto:$2@$3\\\">$2@$3</a>\", $text );\r\n\t \r\n\t\treturn $text;\r\n\t}",
"public static function link($url, $text = '')\n {\n if ($url[0] === '/')\n $url = self::getURLScheme() . $_SERVER['HTTP_HOST'] . $url;\n\n if ($text === '')\n $text = $url;\n\n return '<a href=\"' . $url . '\">' . $text . '</a>';\n }",
"private function createLink()\n\t{\n\t\treturn \"<a href=\\\"\".$this->properties['link'].\"\\\" class='\".implode(' ', $this->properties['classes']).\"'>\".$this->properties['text'].\"</a>\";\n\t}",
"function url_to_htmllink($text) {\n $newtext = eregi_replace(\"([^=.'\\\"])http://([^ \\n\\r]*)\", \"\\\\1<a href=\\\"http://\\\\2\\\">\\\\2</a>\", $text);\n return $newtext;\n}",
"function create_external_link($url, $linkText, $attributes = NULL)\n\t{\n\n\t\treturn '<a href=\"' . $url . '\" target=\"_blank\"' . (isset($attributes) ? ' ' . HTML::attributes($attributes) : NULL). '>' . $linkText . '</a>';\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cette fonction va afficher l'article dans la page | function afficherArticle() {
} | [
"public function articleAcceuilAction() {\n \n $rArticle = $this->getDoctrine()\n ->getManager()\n ->getRepository('SoleilSiteEftBundle:Articles')\n ->findOneBy(array('categorie' => 1));\n \n //je balance cette rubrique a la vue listeBlogs\n return $this->render('SoleilSiteEftBundle:Articles:articleAcceuil.html.twig',\n array('article' => $rArticle));\n }",
"function topten_articles_periode($periode) {\r\n\tglobal $couleur_claire;\r\n\r\n\tif ($periode == '8') {\r\n\t\t$top = $GLOBALS['actijour']['nbl_topsem'];\r\n\t} elseif ($periode == '30') {\r\n\t\t$top = $GLOBALS['actijour']['nbl_topmois'];\r\n\t} else {\r\n\t\t$top = '10';\r\n\t}\r\n\r\n\t$q = sql_select(\"sva.id_article, SUM(sva.visites) AS volume, \r\n\t\t\t\tMAX(sva.visites) AS picvis, sa.statut, sa.titre, sa.visites \r\n\t\t\t\tFROM spip_visites_articles sva \r\n\t\t\t\tLEFT JOIN spip_articles sa ON sva.id_article=sa.id_article \r\n\t\t\t\tWHERE sa.statut='publie' AND sva.date > DATE_SUB(NOW(),INTERVAL $periode DAY) \r\n\t\t\t\tGROUP BY sva.id_article \r\n\t\t\t\tORDER BY volume DESC \r\n\t\t\t\tLIMIT 0,$top\"\r\n\t);\r\n\t$ifond = 0;\r\n\t$aff = '';\r\n\r\n\t$aff .= debut_cadre_relief(\"article-24.gif\", true)\r\n\t\t. \"<table align='center' border='0' cellpadding='2' cellspacing='1' width='100%'>\\n\"\r\n\t\t. \"<tr><td colspan='5' class='cart_titre_bold verdana3'>\" . _T('actijour:top_ten_article_' . $periode . '_j')\r\n\t\t. \"</td></tr>\";\r\n\r\n\t$aff .= \"<tr class='legend_topten'><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td></tr>\\n\";\r\n\r\n\twhile ($row = sql_fetch($q)) {\r\n\t\t$ifond = $ifond ^ 1;\r\n\t\t$couleur = ($ifond) ? $couleur_claire : '#FFFFFF';\r\n\r\n\t\t$aff .= \"<tr bgcolor='$couleur'><td width='7%'>\\n\"\r\n\t\t\t. \"<div align='right' class='verdana2'>\"\r\n\t\t\t. affiche_lien_graph($row['id_article'], $row['titre'], $row['statut'], 'spip')\r\n\t\t\t. \"</div></td>\\n\"\r\n\t\t\t. \"<td width='70%'>\\n<div align='left' class='verdana2'><b>\"\r\n\t\t\t. affiche_lien_graph($row['id_article'], $row['titre'], $row['statut'])\r\n\t\t\t. \"</b></div></td>\\n\"\r\n\t\t\t. \"<td width='6%'>\\n<div align='right' class='verdana1' style='margin-right:3px;'><b>\"\r\n\t\t\t. $row['volume'] . \"</b></div></td>\\n\"\r\n\t\t\t. \"<td width='7%'>\\n<div align='right' class='verdana1' style='margin-right:3px;'><b>\"\r\n\t\t\t. $row['picvis'] . \"</b></div>\\n</td>\\n\"\r\n\t\t\t. \"<td width='10%'>\\n<div align='right' class='verdana1' style='margin-right:3px;'><b>\"\r\n\t\t\t. $row['visites'] . \"</b></div>\\n</td>\\n</tr>\\n\";\r\n\t}\r\n\t$aff .= \"</table>\";\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}",
"function topten_articles_periode($periode) {\r\n\tglobal $couleur_claire;\r\n\t\r\n\tif($periode=='8') {\r\n\t\t$top = $GLOBALS['actijour']['nbl_topsem'];\r\n\t}\r\n\telseif($periode=='30') {\r\n\t\t\t$top = $GLOBALS['actijour']['nbl_topmois'];\r\n\t}\r\n\telse { $top='10'; }\r\n\r\n\t$q=sql_select(\"sva.id_article, SUM(sva.visites) AS volume, \r\n\t\t\t\tMAX(sva.visites) AS picvis, sa.statut, sa.titre, sa.visites \r\n\t\t\t\tFROM spip_visites_articles sva \r\n\t\t\t\tLEFT JOIN spip_articles sa ON sva.id_article=sa.id_article \r\n\t\t\t\tWHERE sa.statut='publie' AND sva.date > DATE_SUB(NOW(),INTERVAL $periode DAY) \r\n\t\t\t\tGROUP BY sva.id_article \r\n\t\t\t\tORDER BY volume DESC \r\n\t\t\t\tLIMIT 0,$top\"\r\n\t\t\t\t);\r\n\t$ifond = 0;\r\n\t$aff='';\r\n\t\r\n\t$aff.= debut_cadre_relief(\"article-24.gif\",true)\r\n\t. \"<table align='center' border='0' cellpadding='2' cellspacing='1' width='100%'>\\n\"\r\n\t. \"<tr><td colspan='5' class='cart_titre_bold verdana3'>\"._T('acjr:top_ten_article_'.$periode.'_j')\r\n\t. \"</td></tr>\";\r\n\t\r\n\t$aff.=\"<tr class='legend_topten'><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td></tr>\\n\";\r\n\t\r\n\twhile ($row = sql_fetch($q)) {\r\n\t\t$ifond = $ifond ^ 1;\r\n\t\t$couleur = ($ifond) ? $couleur_claire : '#FFFFFF';\r\n\t\t\r\n\t\t$aff.= \"<tr bgcolor='$couleur'><td width='7%'>\\n\"\r\n\t\t\t. \"<div align='right' class='verdana2'>\"\r\n\t\t\t. affiche_lien_graph($row['id_article'],$row['titre'],$row['statut'],'spip')\r\n\t\t\t. \"</div></td>\\n\"\r\n\t\t\t. \"<td width='70%'>\\n<div align='left' class='verdana2'><b>\"\r\n\t\t\t. affiche_lien_graph($row['id_article'],$row['titre'],$row['statut'])\r\n\t\t\t. \"</b></div></td>\\n\"\r\n\t\t\t. \"<td width='6%'>\\n<div align='right' class='verdana1' style='margin-right:3px;'><b>\"\r\n\t\t\t. $row['volume'].\"</b></div></td>\\n\"\r\n\t\t\t. \"<td width='7%'>\\n<div align='right' class='verdana1' style='margin-right:3px;'><b>\"\r\n\t\t\t. $row['picvis'].\"</b></div>\\n</td>\\n\"\r\n\t\t\t. \"<td width='10%'>\\n<div align='right' class='verdana1' style='margin-right:3px;'><b>\"\r\n\t\t\t. $row['visites'].\"</b></div>\\n</td>\\n</tr>\\n\";\r\n\t}\r\n\t$aff.= \"</table>\";\r\n\t$aff.= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}",
"function modifierArticle() {\n\t}",
"function afficher_derniers_articles(){\n\t\tglobal $logger;\n\t\tif($logger){// si connecté, affiche article public et privé\n\t\t\t$requete = 'SELECT * FROM articles ORDER BY date DESC';\n\t\t}else{// sinon que public\n\t\t\t$requete = 'SELECT * FROM articles WHERE statut=\"0\" ORDER BY date DESC';\n\t\t}\n\t\t$donnees = connexion( $requete);\n\t\t$res = \"\";\n\t\t\n\t\tif(mysql_num_rows($donnees) < 1){\n\t\t\treturn \"<div>Aucun article récent trouvé</div>\";\n\t\t}else{\n\t\t\tfor($i =1; $i <= 4; $i++){\n\t\t\t\tif($ligne = mysql_fetch_assoc($donnees)){\n\t\t\t\t\t$res .= \"<article>\n\t\t\t\t\t\t\t\t<a href='index.php?where=article&id={$ligne['id']}'><header>{$ligne['titre']}</header></a>\n\t\t\t\t\t\t\t\t<div class='article_auteur'>\n\t\t\t\t\t\t\t\t\t<img src='ressources/auteur.png' title='Auteur' alt='Auteur'>\n\t\t\t\t\t\t\t\t\tAuteur: <a href='index.php?where=profil&id={$ligne['auteur']}'>\";\n\t\t\t\t\t$res .= \t\tnom_auteur($ligne[\"auteur\"]);\t\n\t\t\t\t\t$res .= \t'</a></div>\n\t\t\t\t\t\t\t<div class=\"article_date\">Le '.conversion_date($ligne['date']).'</div>\n\t\t\t\t\t\t\t<p>'.taille_description($ligne['text'], $ligne['id']).'</p>';\n\t\t\t\t\t$res .= \tarticle_statut($ligne['statut']);\n\t\t\t\t\t$res .= \"</article>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}",
"function aed_afficher_fiche_objet($flux){\n $type = $flux['args']['type'];\n\n if ($type=='article'){\n\t$id_article= _request('id_article');\n\t$row = sql_fetsel(\"*\", \"spip_articles\", \"id_article=$id_article\");\n\t\n\t$contexte = array(\n\t\t'icone_retour'=>icone_inline(_T('icone_retour'), $oups, \"article-24.gif\", \"rien.gif\",$GLOBALS['spip_lang_left']),\n\t\t'redirect'=>generer_url_ecrire(\"articles\"),\n\t\t'titre'=>$row['titre'],\n\t\t'new'=>$new?$new:$id_article,\n\t\t'id_rubrique'=>$row['id_rubrique'],\n\t\t'id_secteur'=>$row['id_secteur'],\n\t\t'config_fonc'=>'articles_edit_config',\n\t\t// passer row si c'est le retablissement d'une version anterieure\n\t\t'row'=> $id_version\n\t\t? $row\n\t\t: null\n\t\t);\n\t\n\t$formulaire=recuperer_fond('prive/editer/article_mod',$contexte);\n\t\n\t$flux['data'] =preg_replace('/<div id=\\'props\\' class=\\'tabs-container\\'>/',$formulaire.'<div id=\"props\" class=\"tabs-container\">',$flux['data']);\t\n\t}\nreturn $flux;\n}",
"function posts_proposes_attente_moderation() {\n\tglobal $spip_lang_left;\n\n\tspipbb_log(\"entree\",1,\"posts_proposes_attente_moderation\");\n\t/* c: 7/2/8 compatibilite pg_sql\n\t$result = sql_query (\"SELECT SQL_CALC_FOUND_ROWS id_forum, titre, id_thread\n\t\t\t\t\t\t\tFROM spip_forum WHERE statut='prop'\n\t\t\t\t\t\t\tORDER BY date_heure LIMIT 0,10\");\n\t*/\n\t$compte = sql_fetsel(\"COUNT(*) AS total\", \"spip_forum\", \"statut='prop'\", \"\", \"\", \"0,10\");\n\n\t// récup nombre total d'entrées de $result (mysql 4.0.0 mini)\n\t//$ttligne= sql_query(\"SELECT FOUND_ROWS()\");\n\t//list($nbrprop) = @spip_fetch_array($ttligne);\n\tif (isset($compte['total'])) $nbrprop=$compte['total'];\n\t\telse $nbrprop=0;\n\n\t$result = sql_select(array(\"id_forum\",\"titre\",\"id_thread\"), // rows\n\t\t\t\t\t\t\"spip_forum\", // from\n\t\t\t\t\t\t\"statut='prop'\", //where\n\t\t\t\t\t\t\"\", // groupby\n\t\t\t\t\t\tarray(\"date_heure\"), // orderby\n\t\t\t\t\t\t\"0,10\"); // limit\n\n\t$aff='';\n\tif($nbrprop) {\n\t\t$aff.= \"<br />\"\n\t\t\t. \"\\n<div class='bandeau_rubriques' style='z-index: 1;'>\"\n\t\t\t. bandeau_titre_boite2(_T('spipbb:poste_valide'),\"gaf_p_prop.gif\",'','',false)\n\t\t\t. \"<div class='plan-articles'>\";\n\n\t\twhile($row = sql_fetch($result))\n\t\t\t{\n\t\t\t$idprop=$row['id_forum'];\n\t\t\t$titreprop=$row['titre'];\n\t\t\t$idthread=$row['id_thread'];\n\t\t\t$urlprop = url_post_tranche($idprop, $idthread);\n\t\t\t$ico_prop = ($idprop==$idthread) ? \"gaf_sujet-12.gif\" : \"gaf_post-12.gif\" ;\n\t\t\t$aff.= \"<a href='\".$urlprop.\"'>\".couper($titreprop,30).\"</a>\\n\";\n\t\t\t}\n\n\t\tif($nbrprop>10) { $aff.= _T('spipbb:etplus'); }\n\t\t$aff.= \"</div></div>\\n\";\n\t}\n\treturn $aff;\n}",
"function index($page, $nombre_article) {\n $index = (($page - 1) * $nombre_article);\n return $index;\n}",
"public function pagesArticles(){\n\n $sql1 =\"SELECT COUNT(id) as nbArt FROM articles\";\n\n $query = $this->pdo-> prepare($sql1);\n $query->execute();\n\n $data = $query->fetch(PDO::FETCH_ASSOC);\n\n $nbArt = $data['nbArt'];\n $perPage = 5;\n $cPage =1;\n $nbPage = ceil($nbArt/$perPage);\n\n if(isset($_GET['p']) && $_GET['p']>0 && $_GET['p']<= $nbPage){\n\n $cPage = $_GET['p'];\n }\n else{\n $cPage =1;\n }\n\n $sql2 = \"SELECT * FROM `articles` WHERE `date` ORDER BY date DESC LIMIT \".(($cPage-1)*$perPage).\",$perPage\";\n\n $query = $this->pdo-> prepare($sql2);\n $query->execute();\n\n $article = $query->fetchAll(PDO::FETCH_ASSOC);\n\n foreach($article as $articles) {\n\n $_GET['id'] = @$articles['id'];\n\n echo '<h2>' . ucfirst($articles['titre']) . '</h2>\n <p>' . substr($articles['article'], 0, 150) . '...</p>\n <a href=\"article.php?id=' . $_GET['id'] . '\"><i class=\"fas fa-arrow-right\"></i> Lire l\\'article en entier !</a>\n <p><u> Posté le : ' . $articles['date'] . '</u></p><hr><br>';\n }\n\n for($i=1; $i<=$nbPage; $i++){\n\n if($i==$cPage){\n echo \"<a class='nPagesA'>$i</a>\";\n }\n else{\n echo \" <a class='nPages' href=\\\"articles.php?p=$i\\\">$i</a> \";\n }\n }\n }",
"public function article($idArticle){\n \n require_once(dirname(__DIR__, 1).'/includes/TwigConfig.php');\n require_once(dirname(__DIR__, 1).'/database.php');\n \n //Récupération du contenu de l'article, de l'utilisateur et des commentaires de l'article pour l'affichage\n $articleRepository=$entityManager->getRepository('Article');\n $article = $articleRepository->find($idArticle);\n $user=$article->getUser();\n $commentaires=$article->getCommentaires();\n echo $twig->render('article.twig',['article'=>$article,'commentaires'=>$commentaires,'user'=>$user]);\n }",
"public function pageStatiqueAction()\n\t{\n\t\n\t}",
"function sogd_view_article($more)\n{\n global $post;\n return '… <a class=\"ssod-view-article\" href=\"' . get_permalink($post->ID) . '\">Les innlegg</a>';\n}",
"public function Voir() {\n\n $this->show('article/voir', [\"articleTrois\" => \"<p>testlayout\", \"articleQuatre\" => \"testDeux</p>\"]);\n }",
"function meteo($saison) {\n $article = 'en';\n if ($saison == 'Printemps') {\n $article = 'au';\n }\n // TODO : ternaire pour le fun\n echo \"Nous sommes $article $saison<br>\";\n}",
"public function afficheArticle($aArticles=Array()) {\n ?>\n <article>\n \n <div class=\"row\">\n \n <!-- - - - - - - - - - Colonne de gauche (MENU DES ARTICLES) -->\n <div class=\"col-sm-2 visible-lg\">\n <div class=\"panel panel-default \">\n \n <div class=\"panel-heading\" >Les inventions</div> \n <div class=\"panel-body\">\n <ul class=\"nav nav-stacked\">\n <li><a href=\"index.php?p=articles&cat=1\">Santé</a></li>\n <li><a href=\"index.php?p=articles&cat=2\">Environnement</a></li>\n <li><a href=\"index.php?p=articles&cat=3\">Éducation</a></li>\n <li><a href=\"index.php?p=articles&cat=4\">Technologie</a></li>\n <li><a href=\"index.php?p=articles&cat=5\">Ingénierie</a></li>\n <li><a href=\"index.php?p=articles&cat=6\">Insolite</a></li>\n </ul>\n </div><!-- fin du panel body -->\n </div><!-- fin du panel heading -->\n </div><!-- fin de la colonne du menu des articles -->\n <!-- - - - - - - - - Colonne de droite (ARTICLE À AFFICHER) -->\n <?php\n if(count($aArticles) >0)\n { ?>\n <div class=\"col-sm-10\">\n <div class=\"panel panel-default\">\n \n <div class=\"panel-heading\">Catégorie : <?= $aArticles['categorie_titre'];?>\n\n </div>\n\n <div class=\"panel-body m-panel-body\">\n\n <div class=\"row m-panel-body\">\n\n <!-- Afficher l'image -->\n <?php $src=\"./img/articles/\".$aArticles['article_image'];?>\n <img src=\"<?= $src;?>\" class=\"img-responsive pull-right\" alt=\"<?php echo $aArticles['article_titre'];?>\">\n \n <!-- Afficher date de soumission -->\n Date de soumission : <?= strftime(\"%Y/%m/%d\",strtotime($aArticles['art_date_soumis'])) . \"\\n\"; ?><br />\n \n <!-- Mettre \"OUI\" si invention brevetée -->\n <?php \n if ($aArticles['brevet_ID'] != NULL) {?> \n BREVET : OUI<br/>\n <?php\n } \n else {?>\n BREVET : NON<br/><?php \n }\n\n if ($aArticles['financement_ID'] == NULL) {?> \n <!-- Mettre OUI si cherche financement -->\n CHERCHE FINANCEMENT : OUI<br/>\n <?php\n } \n else {?>\n CHERCHE FINANCEMENT : NON<br/><?php \n }?>\n <!-- MIMI : À FAIRE \n <!--<a class=\"btn btn-default btn-financer\" href=\"#\" >Je veux FINANCER ce projet</a> <br /> -->\n <?php\n echo \"<h2>\".$aArticles['article_titre'] .\"</h2>\";\n echo \"<p>\".$aArticles['article_contenu'] .\"</p>\";\n ?>\n <p>Auxerunt haec vulgi sordidioris audaciam, quod cum ingravesceret penuria commeatuum, famis et furoris inpulsu Eubuli cuiusdam inter suos clari domum ambitiosam ignibus subditis inflammavit rectoremque ut sibi iudicio imperiali addictum calcibus incessens et pugnis conculcans seminecem laniatu miserando discerpsit. post cuius lacrimosum interitum in unius exitio quisque imaginem periculi sui considerans documento recenti similia formidabat.\n </p>\n\n <p>Thalassius vero ea tempestate praefectus praetorio praesens ipse quoque adrogantis ingenii, considerans incitationem eius ad multorum augeri discrimina, non maturitate vel consiliis mitigabat, ut aliquotiens celsae potestates iras principum molliverunt, sed adversando iurgandoque cum parum congrueret, eum ad rabiem potius evibrabat, Augustum actus eius exaggerando creberrime docens, idque, incertum qua mente, ne lateret adfectans. quibus mox Caesar acrius efferatus, velut contumaciae quoddam vexillum altius erigens, sine respectu salutis alienae vel suae ad vertenda opposita instar rapidi fluminis irrevocabili impetu ferebatur.\n </p>\n\n <p>Auxerunt haec vulgi sordidioris audaciam, quod cum ingravesceret penuria commeatuum, famis et furoris inpulsu Eubuli cuiusdam inter suos clari domum ambitiosam ignibus subditis inflammavit rectoremque ut sibi iudicio imperiali addictum calcibus incessens et pugnis conculcans seminecem laniatu miserando discerpsit. post cuius lacrimosum interitum in unius exitio quisque imaginem periculi sui considerans documento recenti similia formidabat.\n </p>\n </div><!-- fin du \"row\" -->\n </div><!-- fin du panel body -->\n </div><!-- fin du panel -->\n </div><!-- fin de la colonne du menu des articles -->\n <?php\n }\n else\n {\n ?>\n <p>Aucun article correspondant</p>\n <?php \n }\n ?>\n\n </article>\n <?php\n \n }",
"public function recette()\n {\n $this->render('recettes');\n }",
"function sort_artcl_by_pg ($per_page) {\n\t$pages_query = mysql_query(\"SELECT COUNT(`artcl_id`) FROM `articles`\");\n\t$pages = ceil(mysql_result($pages_query, 0) / $per_page);\n\t\n\treturn $pages;\n}",
"function montant_panier()\n{\n /* On initialise le montant */\n $montant = 0;\n /* Comptage des articles du panier */\n $nb_articles = count($_SESSION['panier']['id_article']);\n /* On va calculer le total par article */\n for($i = 0; $i < $nb_articles; $i++)\n {\n $montant += $_SESSION['panier']['qte'][$i] * $_SESSION['panier']['prix'][$i];\n }\n /* On retourne le résultat */\n return $montant;\n}",
"function modif_langue_articles($id_article, $id_rubrique, $changer_lang)\n{\n if ($GLOBALS['meta']['multi_articles'] == 'oui') {\n\tlist($langue_parent) = spip_fetch_array(spip_query(\"SELECT lang FROM spip_rubriques WHERE id_rubrique=\" . $id_rubrique),SPIP_NUM);\n\n\tif ($changer_lang) {\n\t\tif ($changer_lang != \"herit\")\n\t\t\tspip_query(\"UPDATE spip_articles SET lang='\".addslashes($changer_lang).\"', langue_choisie='oui', date_modif=NOW() WHERE id_article=$id_article\");\n\t\telse\n\t\t\tspip_query(\"UPDATE spip_articles SET lang='\".addslashes($langue_parent).\"', langue_choisie='non', date_modif=NOW() WHERE id_article=$id_article\");\n\t}\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Download all the maps from the modified countries | function downloadAndResizeMaps(){
//There are 216 countries so we need a offset of 200 the second time
$modifiedCountries = $this->getModifiedCountries(0);
if(count($modifiedCountries) == 200){
$modifiedCountries = array_merge($modifiedCountries, $this->getModifiedCountries(200));
}
$countryMapsUrls = $this->getCountryMapsUrls($modifiedCountries);
foreach ($countryMapsUrls as $key => $countryMapsUrl) {
echo 'Download:'.$key.PHP_EOL;
$this->saveImage($this->resize($countryMapsUrl), $key.".png");
}
} | [
"protected function set_countries_map() {\n $this->partial(\"Importing country-to-continent map ...\");\n $this->countries = json_decode(file_get_contents($this->get_continents_url()), true);\n ksort($this->countries);\n $this->success(\"OK\");\n }",
"function download_maps($locations)\n\t{\n\t\tlog_message('debug', '_data/download_maps:: [1] locations='.json_encode($locations));\n\t\t$results = array();\n\t\tforeach($locations AS $location){\n\t\t\t$fileName = download_from_url(\"http://maps.googleapis.com/maps/api/staticmap?center=\"\n\t\t\t\t\t.$location['latitude'].\",\".$location['longitude'].\"&zoom=15&size=400x125&markers=icon:http://pro-fe-web1.clout.com/assets/images/map_marker.png|\"\n\t\t\t\t\t.$location['latitude'].\",\".$location['longitude'], FALSE, 'name', $location['file_name']);\n\t\t\t\n\t\t\tarray_push($results, !empty($fileName));\n\t\t}\n\t\t\n\t\tlog_message('debug', '_data/download_maps:: [2] results='.json_encode($results));\n\t\treturn get_decision($results);\n\t}",
"private function requestCountries() {\n\t\t$this->broker = new APIBroker;\n\t\t$this->fileReader = new FileReader(REQUESTS . '/static-data.xml');\n\t\t$requestParams = [\n\t\t\t'%username%' => API_USERNAME,\n\t\t\t'%password%' => API_PASSWORD,\n\t\t\t'%code%' => API_CODE,\n\t\t\t'%source%' => API_SOURCE,\n\t\t\t'%action%' => 'getallcountries',\n\t\t];\n\t\t$request = str_replace(array_keys($requestParams), array_values($requestParams), $this->fileReader->readfile());\n\t\treturn $this->extractCountries($this->broker->doRequest(trim($request), 'getallcountries'));\n\t}",
"function pfblockerng_get_countries() {\n\tglobal $g, $pfb;\n\n\t$files = array (\t'Africa'\t\t=> \"{$pfb['ccdir']}/Africa_v4.txt\",\n\t\t\t\t'Asia'\t\t\t=> \"{$pfb['ccdir']}/Asia_v4.txt\",\n\t\t\t\t'Europe'\t\t=> \"{$pfb['ccdir']}/Europe_v4.txt\",\n\t\t\t\t'North America'\t\t=> \"{$pfb['ccdir']}/North_America_v4.txt\",\n\t\t\t\t'Oceania'\t\t=> \"{$pfb['ccdir']}/Oceania_v4.txt\",\n\t\t\t\t'South America'\t\t=> \"{$pfb['ccdir']}/South_America_v4.txt\",\n\t\t\t\t'Proxy and Satellite'\t=> \"{$pfb['ccdir']}/Proxy_Satellite_v4.txt\"\n\t\t\t\t);\n\n\t// Collect data to generate new continent XML files.\n\t$log = \" Building pfBlockerNG XML Files \\n\";\n\tif (!$g['pfblockerng_install']) {\n\t\tprint $log;\n\t}\n\tpfb_logger(\"{$log}\", 3);\n\n\tforeach ($files as $cont => $file) {\n\t\t// Process the following for IPv4 and IPv6\n\t\tforeach (array('4', '6') as $type) {\n\t\t\t$log = \" IPv{$type} {$cont}\\n\";\n\t\t\tif (!$g['pfblockerng_install']) {\n\t\t\t\tprint $log;\n\t\t\t}\n\t\t\tpfb_logger(\"{$log}\", 3);\n\n\t\t\tif ($type == '6') {\n\t\t\t\t$file = str_replace('v4', 'v6', $file);\n\t\t\t}\n\t\t\t$convert\t\t= explode(\"\\n\", file_get_contents($file));\n\t\t\t$cont_name\t\t= str_replace(' ', '', $cont);\n\t\t\t$cont_name_lower\t= strtolower($cont_name);\n\t\t\t$active\t\t\t= array(\"$cont\" => '<active/>');\n\t\t\t$lastkey\t\t= count($convert) - 1;\n\t\t\t$pfb['complete']\t= FALSE;\n\t\t\t$keycount\t\t= 1;\n\t\t\t$total\t\t\t= 0;\n\t\t\t$xml_data\t\t= '';\n\n\t\t\tforeach ($convert as $line) {\n\t\t\t\tif (substr($line, 0, 1) == '#') {\n\t\t\t\t\tif ($pfb['complete']) {\n\t\t\t\t\t\t${'coptions' . $type}[] = \"{$country}-{$isocode} ({$total})</name><value>{$isocode}</value></option>\";\n\t\t\t\t\t\t// Only collect IPv4 for Reputation Tab\n\t\t\t\t\t\tif ($type == '4') {\n\t\t\t\t\t\t\t$roptions4[] = \"{$country}-{$isocode} ({$total})</name><value>{$isocode}</value></option>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Save ISO data\n\t\t\t\t\t\t@file_put_contents(\"{$pfb['ccdir']}/{$isocode}_v{$type}.txt\", $xml_data, LOCK_EX);\n\n\t\t\t\t\t\t// Clear variables and restart Continent collection process\n\t\t\t\t\t\tunset($total, $xml_data);\n\t\t\t\t\t\t$pfb['complete'] = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\t// Don't collect Countries with null data\n\t\t\t\t\tif (strpos($line, 'Total Networks: 0') !== FALSE) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (strpos($line, 'Country: ') !== FALSE) {\n\t\t\t\t\t\t$country = str_replace('# Country: ', '', $line);\n\t\t\t\t\t}\n\t\t\t\t\tif (strpos($line, 'ISO Code: ') !== FALSE) {\n\t\t\t\t\t\t$isocode = str_replace('# ISO Code: ', '', $line);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telseif (substr($line, 0, 1) != '#') {\n\t\t\t\t\t$total++;\n\t\t\t\t\tif (!empty($line)) {\n\t\t\t\t\t\t$xml_data .= \"{$line}\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t$pfb['complete'] = TRUE;\n\t\t\t\t}\n\n\t\t\t\t// Save last EOF ISO IP data\n\t\t\t\tif ($keycount == $lastkey) {\n\t\t\t\t\t// Don't collect Countries with null data\n\t\t\t\t\tif (strpos($line, 'Total Networks: 0') !== FALSE) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t${'coptions' . $type}[] = \"{$country}-{$isocode} ({$total})</name><value>{$isocode}</value></option>\";\n\t\t\t\t\tif ($type == '4') {\n\t\t\t\t\t\t$roptions4[] = \"{$country}-{$isocode} ({$total})</name><value>{$isocode}</value></option>\";\n\t\t\t\t\t}\n\t\t\t\t\t@file_put_contents(\"{$pfb['ccdir']}/{$isocode}_v{$type}.txt\", $xml_data, LOCK_EX);\n\t\t\t\t\tunset($total, $xml_data);\n\t\t\t\t}\n\t\t\t\t$keycount++;\n\t\t\t}\n\t\t\tunset ($ips, $convert);\n\n\t\t\t// Sort IP Countries alphabetically and build XML <option> data for Continents tab\n\t\t\tif (!empty(${'coptions' . $type})) {\n\t\t\t\tsort(${'coptions' . $type}, SORT_STRING);\n\t\t\t\t${'ftotal' . $type} = count(${'coptions' . $type});\n\t\t\t\t$count = 1;\n\t\t\t\t${'options' . $type} = '';\n\n\t\t\t\tforeach (${'coptions' . $type} as $option) {\n\t\t\t\t\tif ($count == 1) {\n\t\t\t\t\t\t${'options' . $type} .= \"\\t<option><name>{$option}\\n\";\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (${'ftotal' . $type} == $count) {\n\t\t\t\t\t\t${'options' . $type} .= \"\\t\\t\\t\\t<option><name>{$option}\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t${'options' . $type} .= \"\\t\\t\\t\\t<option><name>{$option}\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset(${'coptions' . $type});\n\t\t}\n\n$xml = <<<EOF\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE packagegui SYSTEM \"../schema/packages.dtd\">\n<?xml-stylesheet type=\"text/xsl\" href=\"../xsl/package.xsl\"?>\n<packagegui>\n\t<copyright>\n\t<![CDATA[\n/* ========================================================================== */\n/*\n\tpfblockerng_{$cont_name}.xml\n\n\tpfBlockerNG\n\tCopyright (C) 2015 BBcan177@gmail.com\n\tAll rights reserved.\n\n\tBased upon pfblocker for pfSense\n\tCopyright (C) 2011 Marcello Coutinho\n\tAll rights reserved.\n*/\n/* ========================================================================== */\n/*\n\tRedistribution and use in source and binary forms, with or without\n\tmodification, are permitted provided that the following conditions are met:\n\n\n\t1. Redistributions of source code must retain the above copyright notice,\n\t this list of conditions and the following disclaimer.\n\n\t2. Redistributions in binary form must reproduce the above copyright\n\t notice, this list of conditions and the following disclaimer in the\n\t documentation and/or other materials provided with the distribution.\n\n\n\tTHIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESS OR IMPLIED WARRANTIES,\n\tINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n\tAND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n\tAUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n\tOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n\tSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n\tINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n\tCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n\tARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n\tPOSSIBILITY OF SUCH DAMAGE.\n*/\n/* ========================================================================== */\n]]>\n\t</copyright>\n\t<description>Describe your package here</description>\n\t<requirements>Describe your package requirements here</requirements>\n\t<faq>Currently there are no FAQ items provided.</faq>\n\t<name>pfblockerng{$cont_name_lower}</name>\n\t<version>1.0</version>\n\t<title>pfBlockerNG: {$cont}</title>\n\t<include_file>/usr/local/pkg/pfblockerng/pfblockerng.inc</include_file>\n\t<addedit_string>pfBlockerNG: Save {$cont} settings</addedit_string>\n\t<menu>\n\t\t<name>pfBlockerNG: {$cont_name}</name>\n\t\t<tooltiptext>Configure pfBlockerNG</tooltiptext>\n\t\t<section>Firewall</section>\n\t\t<url>pkg_edit.php?xml=pfblockerng_{$cont_name_lower}.xml</url>\n\t</menu>\n\t\t<tabs>\n\t\t<tab>\n\t\t\t<text>General</text>\n\t\t\t<url>/pkg_edit.php?xml=pfblockerng.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Update</text>\n\t\t\t<url>/pfblockerng/pfblockerng_update.php</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Alerts</text>\n\t\t\t<url>/pfblockerng/pfblockerng_alerts.php</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Reputation</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_reputation.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>IPv4</text>\n\t\t\t<url>/pkg.php?xml=/pfblockerng/pfblockerng_v4lists.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>IPv6</text>\n\t\t\t<url>/pkg.php?xml=/pfblockerng/pfblockerng_v6lists.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>DNSBL</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_dnsbl.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Country</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_top20.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Top 20</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_top20.xml</url>\n\t\t\t<tab_level>2</tab_level>\n\t\t\t{$active['top']}\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Africa</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_Africa.xml</url>\n\t\t\t<tab_level>2</tab_level>\n\t\t\t{$active['Africa']}\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Asia</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_Asia.xml</url>\n\t\t\t<tab_level>2</tab_level>\n\t\t\t{$active['Asia']}\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Europe</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_Europe.xml</url>\n\t\t\t<tab_level>2</tab_level>\n\t\t\t{$active['Europe']}\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>North America</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_NorthAmerica.xml</url>\n\t\t\t<tab_level>2</tab_level>\n\t\t\t{$active['North America']}\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Oceania</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_Oceania.xml</url>\n\t\t\t<tab_level>2</tab_level>\n\t\t\t{$active['Oceania']}\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>South America</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_SouthAmerica.xml</url>\n\t\t\t<tab_level>2</tab_level>\n\t\t\t{$active['South America']}\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Proxy and Satellite</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_ProxyandSatellite.xml</url>\n\t\t\t<tab_level>2</tab_level>\n\t\t\t{$active['Proxy and Satellite']}\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Logs</text>\n\t\t\t<url>/pfblockerng/pfblockerng_log.php</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Sync</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_sync.xml</url>\n\t\t</tab>\n\t\t</tabs>\n\t<fields>\n\t\t<field>\n\t\t\t<name><![CDATA[Continent {$cont}  (Geolite Data by MaxMind Inc. - ISO 3166)]]></name>\n\t\t\t<type>listtopic</type>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>LINKS</fielddescr>\n\t\t\t<description><![CDATA[<a href=\"/firewall_aliases.php\">Firewall Alias</a> \n\t\t\t\t<a href=\"/firewall_rules.php\">Firewall Rules</a> <a href=\"diag_logs_filter.php\">Firewall Logs</a>]]>\n\t\t\t</description>\n\t\t\t<type>info</type>\n\t\t</field>\n\t\t<field>\n\t\t\t<fieldname>countries4</fieldname>\n\t\t\t<fielddescr><![CDATA[<strong><center>Countries</center></strong><br />\n\t\t\t\t<center>Use CTRL + CLICK to select/unselect countries</center>]]>\n\t\t\t</fielddescr>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t${'options4'}\n\t\t\t</options>\n\t\t\t<size>${'ftotal4'}</size>\n\t\t\t<multiple/>\n\nEOF;\n\n// Adjust combinefields variable if IPv6 is empty.\nif (!empty (${'options6'})) {\n\t$xml .= <<<EOF\n\t\t\t<description><![CDATA[<center><br />IPv4 Countries</center>]]></description>\n\t\t\t<usecolspan2/>\n\t\t\t<combinefields>begin</combinefields>\n\t\t</field>\n\nEOF;\n} else {\n\t$xml .= <<<EOF\n\t\t\t<description><![CDATA[<br />IPv4 Countries]]></description>\n\t\t</field>\n\nEOF;\n}\n\n// Skip IPv6 when Null data found\nif (!empty (${'options6'})) {\n\t$xml .= <<<EOF\n\t\t<field>\n\t\t\t<fieldname>countries6</fieldname>\n\t\t\t<description><![CDATA[<br /><center>IPv6 Countries</center>]]></description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t${'options6'}\n\t\t\t</options>\n\t\t\t<size>${'ftotal6'}</size>\n\t\t\t<multiple/>\n\t\t\t<usecolspan2/>\n\t\t\t<dontdisplayname/>\n\t\t\t<combinefields>end</combinefields>\n\t\t</field>\n\nEOF;\n}\n\n$xml .= <<<EOF\n\t\t<field>\n\t\t\t<fielddescr>List Action</fielddescr>\n\t\t\t<description><![CDATA[<br />Default: <strong>Disabled</strong><br /><br />\n\t\t\t\tSelect the <strong>Action</strong> for Firewall Rules on lists you have selected.<br /><br />\n\t\t\t\t<strong><u>'Disabled' Rules:</u></strong> Disables selection and does nothing to selected Alias.<br /><br />\n\n\t\t\t\t<strong><u>'Deny' Rules:</u></strong><br />\n\t\t\t\t'Deny' rules create high priority 'block' or 'reject' rules on the stated interfaces. They don't change the 'pass' rules on other\n\t\t\t\tinterfaces. Typical uses of 'Deny' rules are:<br />\n\t\t\t\t<ul><li><strong>Deny Both</strong> - blocks all traffic in both directions, if the source or destination IP is in the block list</li>\n\t\t\t\t<li><strong>Deny Inbound/Deny Outbound</strong> - blocks all traffic in one direction <u>unless</u> it is part of a session started by\n\t\t\t\ttraffic sent in the other direction. Does not affect traffic in the other direction. </li>\n\t\t\t\t<li>One way 'Deny' rules can be used to selectively block <u>unsolicited</u> incoming (new session) packets in one direction, while\n\t\t\t\tstill allowing <u>deliberate</u> outgoing sessions to be created in the other direction.</li></ul>\n\t\t\t\t<strong><u>'Permit' Rules:</u></strong><br />\n\t\t\t\t'Permit' rules create high priority 'pass' rules on the stated interfaces. They are the opposite of Deny rules, and don't create\n\t\t\t\tany 'blocking' effect anywhere. They have priority over all Deny rules. Typical uses of 'Permit' rules are:<br />\n\t\t\t\t<ul><li><strong>To ensure</strong> that traffic to/from the listed IPs will <u>always</u> be allowed in the stated directions. They\n\t\t\t\toverride <u>almost all other</u> Firewall rules on the stated interfaces.</li>\n\t\t\t\t<li><strong>To act as a whitelist</strong> for Deny rule exceptions, for example if a large IP range or pre-created blocklist blocks a\n\t\t\t\tfew IPs that should be accessible.</li></ul>\n\t\t\t\t<strong><u>'Match' Rules:</u></strong><br />\n\t\t\t\t'Match' or 'Log' only the traffic on the stated interfaces. This does not Block or Reject. It just Logs the traffic.\n\t\t\t\t<ul><li><strong>Match Both</strong> - Matches all traffic in both directions, if the source or destination IP is in the list.</li>\n\t\t\t\t<li><strong>Match Inbound/Match Outbound</strong> - Matches all traffic in one direction only.</li></ul>\n\t\t\t\t<strong><u>'Alias' Rules:</u></strong><br />\n\t\t\t\t<strong>'Alias'</strong> rules create an <a href=\"/firewall_aliases.php\">alias</a> for the list (and do nothing else).\n\t\t\t\tThis enables a pfBlockerNG list to be used by name, in any firewall rule or pfSense function, as desired.\n\t\t\t\t<ul><li><strong>Options  - Alias Deny, Alias Permit, Alias Match, Alias Native</strong></li><br />\n\t\t\t\t<li>'Alias Deny' can use De-Duplication and Reputation Processes if configured.</li><br />\n\t\t\t\t<li>'Alias Permit' and 'Alias Match' will be saved in the Same folder as the other Permit/Match Auto-Rules</li><br />\n\t\t\t\t<li>'Alias Native' lists are kept in their Native format without any modifications.</li></ul>\n\t\t\t\t<font color='red'>Note: </font><ul>When manually creating 'Alias' type firewall rules; <strong>Do not add</strong> (pfB_) to the\n\t\t\t\tstart of the rule description, use (pfb_) (Lowercase prefix). Manually created 'Alias' rules with 'pfB_' in the\n\t\t\t\tdescription will be auto-removed by package when 'Auto' rules are defined.</ul>]]>\n\t\t\t</description>\n\t\t\t<fieldname>action</fieldname>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>Disabled</name><value>Disabled</value></option>\n\t\t\t\t<option><name>Deny Inbound</name><value>Deny_Inbound</value></option>\n\t\t\t\t<option><name>Deny Outbound</name><value>Deny_Outbound</value></option>\n\t\t\t\t<option><name>Deny Both</name><value>Deny_Both</value></option>\n\t\t\t\t<option><name>Permit Inbound</name><value>Permit_Inbound</value></option>\n\t\t\t\t<option><name>Permit Outbound</name><value>Permit_Outbound</value></option>\n\t\t\t\t<option><name>Permit Both</name><value>Permit_Both</value></option>\n\t\t\t\t<option><name>Match Inbound</name><value>Match_Inbound</value></option>\n\t\t\t\t<option><name>Match Outbound</name><value>Match_Outbound</value></option>\n\t\t\t\t<option><name>Match Both</name><value>Match_Both</value></option>\n\t\t\t\t<option><name>Alias Deny</name><value>Alias_Deny</value></option>\n\t\t\t\t<option><name>Alias Permit</name><value>Alias_Permit</value></option>\n\t\t\t\t<option><name>Alias Match</name><value>Alias_Match</value></option>\n\t\t\t\t<option><name>Alias Native</name><value>Alias_Native</value></option>\n\t\t\t</options>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>Enable Logging</fielddescr>\n\t\t\t<fieldname>aliaslog</fieldname>\n\t\t\t<description><![CDATA[Default: <strong>Enable</strong><br />\n\t\t\t\tSelect - Logging to Status: System Logs: FIREWALL ( Log )<br />\n\t\t\t\tThis can be overriden by the 'Global Logging' Option in the General Tab.]]>\n\t\t\t</description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>Enable</name><value>enabled</value></option>\n\t\t\t\t<option><name>Disable</name><value>disabled</value></option>\n\t\t\t</options>\n\t\t</field>\n\t\t<field>\n\t\t\t<name>Advanced Inbound Firewall Rule Settings</name>\n\t\t\t<type>listtopic</type>\n\t\t</field>\n\t\t<field>\n\t\t\t<type>info</type>\n\t\t\t<description><![CDATA[<font color='red'>Note: </font>In general, Auto-Rules are created as follows:<br />\n\t\t\t\t<ul>Inbound  - 'any' port, 'any' protocol and 'any' destination<br />\n\t\t\t\tOutbound - 'any' port, 'any' protocol and 'any' destination address in the lists</ul>\n\t\t\t\tConfiguring the Adv. Inbound Rule settings, will allow for more customization of the Inbound Auto-Rules.<br />\n\t\t\t\t<strong>Select the pfSense 'Port' and/or 'Destination' Alias below:</strong>]]>\n\t\t\t</description>\n\t\t</field>\n\t\t<field>\n\t\t\t<fieldname>autoports</fieldname>\n\t\t\t<fielddescr>Enable Custom Port</fielddescr>\n\t\t\t<type>checkbox</type>\n\t\t\t<enablefields>aliasports</enablefields>\n\t\t\t<usecolspan2/>\n\t\t\t<combinefields>begin</combinefields>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>Define Alias</fielddescr>\n\t\t\t<fieldname>aliasports</fieldname>\n\t\t\t<description><![CDATA[<a href=\"/firewall_aliases.php?tab=port\">Click Here to add/edit Aliases</a>\n\t\t\t\tDo not manually enter port numbers. <br />Do not use 'pfB_' in the Port Alias name.]]>\n\t\t\t</description>\n\t\t\t<size>21</size>\n\t\t\t<type>aliases</type>\n\t\t\t<typealiases>port</typealiases>\n\t\t\t<dontdisplayname/>\n\t\t\t<usecolspan2/>\n\t\t\t<combinefields>end</combinefields>\n\t\t</field>\n\t\t<field>\n\t\t\t<fieldname>autodest</fieldname>\n\t\t\t<fielddescr>Enable Custom Destination</fielddescr>\n\t\t\t<type>checkbox</type>\n\t\t\t<enablefields>aliasdest,autonot</enablefields>\n\t\t\t<usecolspan2/>\n\t\t\t<combinefields>begin</combinefields>\n\t\t</field>\n\t\t<field>\n\t\t\t<fieldname>aliasdest</fieldname>\n\t\t\t<description><![CDATA[<a href=\"/firewall_aliases.php?tab=ip\">Click Here to add/edit Aliases</a>\n\t\t\t\tDo not manually enter Addresses(es). <br />Do not use 'pfB_' in the 'IP Network Type' Alias name.]]>\n\t\t\t</description>\n\t\t\t<size>21</size>\n\t\t\t<type>aliases</type>\n\t\t\t<typealiases>network</typealiases>\n\t\t\t<dontdisplayname/>\n\t\t\t<usecolspan2/>\n\t\t\t<combinefields/>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>Invert</fielddescr>\n\t\t\t<fieldname>autonot</fieldname>\n\t\t\t<description><![CDATA[<div style=\"padding-left: 22px;\"><strong>Invert</strong> - Option to invert the sense of the match.<br />\n\t\t\t\tie - Not (!) Destination Address(es)</div>]]>\n\t\t\t</description>\n\t\t\t<type>checkbox</type>\n\t\t\t<dontdisplayname/>\n\t\t\t<usecolspan2/>\n\t\t\t<combinefields>end</combinefields>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>Custom Protocol</fielddescr>\n\t\t\t<fieldname>autoproto</fieldname>\n\t\t\t<description><![CDATA[<strong>Default: any</strong><br />Select the Protocol used for Inbound Firewall Rule(s).<br />\n\t\t\t\tDo not use 'any' with Adv. Inbound Rules as it will bypass these settings!]]></description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>any</name><value></value></option>\n\t\t\t\t<option><name>TCP</name><value>tcp</value></option>\n\t\t\t\t<option><name>UDP</name><value>udp</value></option>\n\t\t\t\t<option><name>TCP/UDP</name><value>tcp/udp</value></option>\n\t\t\t</options>\n\t\t\t<size>4</size>\n\t\t\t<default_value></default_value>\n\t\t</field>\n\t\t<field>\n\t\t\t<name><![CDATA[<center>Click to SAVE Settings and/or Rule Edits.   Changes are Applied via CRON or\n\t\t\t\t'Force Update'</center>]]></name>\n\t\t\t<type>listtopic</type>\n\t\t</field>\n\t</fields>\n\t<custom_php_validation_command>\n\t\tpfblockerng_validate_input(\\$_POST, \\$input_errors);\n\t</custom_php_validation_command>\n\t<custom_php_resync_config_command>\n\t\tglobal \\$pfb;\n\t\t\\$pfb['save'] = TRUE;\n\t\tsync_package_pfblockerng();\n\t</custom_php_resync_config_command>\n</packagegui>\nEOF;\n\n\t\t// Update each Continent XML file.\n\t\t@file_put_contents('/usr/local/pkg/pfblockerng/pfblockerng_'.$cont_name.'.xml', $xml,LOCK_EX);\n\n\t\t// Unset Arrays\n\t\tunset (${'options4'}, ${'options6'}, $xml);\n\n\t}\t// End foreach 'Six Continents and Proxy/Satellite' update XML process\n\n\t// Sort Countries IPv4 alphabetically and build XML <option> data for Reputation tab (IPv6 not used by ET IQRisk)\n\n\tsort($roptions4, SORT_STRING);\n\t$eoa = count($roptions4);\n\t$etoptions = '';\n\t$count = 1;\n\n\tforeach ($roptions4 as $option4) {\n\t\tif ($count == 1) {\n\t\t\t$et_options .= \"\\t<option><name>{$option4}\\n\"; $count++; continue;\n\t\t}\n\t\tif ($eoa == $count) {\n\t\t\t$et_options .= \"\\t\\t\\t\\t<option><name>{$option4}\";\n\t\t} else {\n\t\t\t$et_options .= \"\\t\\t\\t\\t<option><name>{$option4}\\n\";\n\t\t}\n\t\t$count++;\n\t}\n\n// Update pfBlockerNG_Reputation.xml file with Country Code changes\n\n$xmlrep = <<<EOF\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE packagegui SYSTEM \"../schema/packages.dtd\">\n<?xml-stylesheet type=\"text/xsl\" href=\"../xsl/package.xsl\"?>\n<packagegui>\n\t<copyright>\n\t<![CDATA[\n/* ========================================================================== */\n/*\n\tpfBlockerNG_Reputation.xml\n\n\tpfBlockerNG\n\tCopyright (C) 2015 BBcan177@gmail.com\n\tAll rights reserved.\n\n\tBased upon pfblocker for pfSense\n\tCopyright (C) 2011 Marcello Coutinho\n\tAll rights reserved.\n\n*/\n/* ========================================================================== */\n/*\n\tRedistribution and use in source and binary forms, with or without\n\tmodification, are permitted provided that the following conditions are met:\n\n\n\t1. Redistributions of source code must retain the above copyright notice,\n\t this list of conditions and the following disclaimer.\n\n\t2. Redistributions in binary form must reproduce the above copyright\n\t notice, this list of conditions and the following disclaimer in the\n\t documentation and/or other materials provided with the distribution.\n\n\tTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,\n\tINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n\tAND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n\tAUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n\tOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n\tSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n\tINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n\tCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n\tARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n\tPOSSIBILITY OF SUCH DAMAGE.\n*/\n\t]]>\n\t</copyright>\n\t<description>Describe your package here</description>\n\t<requirements>Describe your package requirements here</requirements>\n\t<faq>Currently there are no FAQ items provided.</faq>\n\t<name>pfblockerngreputation</name>\n\t<version>1.0</version>\n\t<title>pfBlockerNG: IPv4 Reputation</title>\n\t<include_file>/usr/local/pkg/pfblockerng/pfblockerng.inc</include_file>\n\t<addedit_string>pfBlockerNG: Save Reputation Settings</addedit_string>\n\t<menu>\n\t\t<name>pfBlockerNG</name>\n\t\t<tooltiptext>Configure pfblockerNG</tooltiptext>\n\t\t<section>Firewall</section>\n\t\t<url>pkg_edit.php?xml=pfblockerng.xml</url>\n\t</menu>\n\t<tabs>\n\t\t<tab>\n\t\t\t<text>General</text>\n\t\t\t<url>/pkg_edit.php?xml=pfblockerng.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Update</text>\n\t\t\t<url>/pfblockerng/pfblockerng_update.php</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Alerts</text>\n\t\t\t<url>/pfblockerng/pfblockerng_alerts.php</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Reputation</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_reputation.xml</url>\n\t\t\t<active/>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>IPv4</text>\n\t\t\t<url>/pkg.php?xml=/pfblockerng/pfblockerng_v4lists.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>IPv6</text>\n\t\t\t<url>/pkg.php?xml=/pfblockerng/pfblockerng_v6lists.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>DNSBL</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_dnsbl.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Country</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_top20.xml</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Logs</text>\n\t\t\t<url>/pfblockerng/pfblockerng_log.php</url>\n\t\t</tab>\n\t\t<tab>\n\t\t\t<text>Sync</text>\n\t\t\t<url>/pkg_edit.php?xml=/pfblockerng/pfblockerng_sync.xml</url>\n\t\t</tab>\n\t</tabs>\n\t<fields>\n\t\t<field>\n\t\t\t<name>IPv4 Reputation Preface</name>\n\t\t\t<type>listtopic</type>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>LINKS</fielddescr>\n\t\t\t<description><![CDATA[<a href=\"/firewall_aliases.php\">Firewall Alias</a> \n\t\t\t\t<a href=\"/firewall_rules.php\">Firewall Rules</a> <a href=\"diag_logs_filter.php\">Firewall Logs</a>]]>\n\t\t\t</description>\n\t\t\t<type>info</type>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr><![CDATA[<strong>Why Reputation Matters:</strong>]]></fielddescr>\n\t\t\t<type>info</type>\n\t\t\t<description><![CDATA[By Enabling '<strong>Reputation</strong>', each Blocklist will be analyzed for Repeat Offenders in each IP Range.\n\t\t\t\t<ul>Example:  x.x.x.1, x.x.x.2, x.x.x.3, x.x.x.4, x.x.x.5<br />\n\t\t\t\tNo. of <strong> Repeat Offending IPs </strong> [ <strong>5</strong> ], in a Blocklist within the same IP Range.</ul>\n\t\t\t\tWith '<strong>Reputation</strong> enabled, these 5 IPs will be removed and a single\n\t\t\t\t<strong>x.x.x.0/24</strong> Block is used.<br />\n\t\t\t\tThis will completely Block/Reject this particular range from your Firewall.<br /><br />\n\t\t\t\tSelecting Blocklists from various Threat Sources will help to highlight Repeat Offending IP Ranges,<br />\n\t\t\t\tIts Important to select a Broad Range of Blocklists that cover different types of Malicious Activity.<br /><br />\n\t\t\t\tYou *may* experience some False Positives. Add any False Positive IPs manually to the<br />\n\t\t\t\t<strong>pfBlockerNGSuppress Alias</strong> or use the \"+\" suppression Icon in the Alerts TAB<br /><br />\n\t\t\t\tTo help mitigate False Positives 'Countries' can be '<strong>Excluded</strong>' from this Process. (Refer to Country Code Settings)\n\t\t\t\t<br /><br />Enabling <strong>De-Duplication</strong> is highly recommended before utilizing 'Reputation' processes.]]>\n\t\t\t</description>\n\t\t</field>\n\t\t<field>\n\t\t\t<name>Reputation Settings:</name>\n\t\t\t<type>listtopic</type>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr><![CDATA[<br /><strong>Individual List Reputation</strong><br /><br />]]></fielddescr>\n\t\t\t<type>info</type>\n\t\t\t<description></description>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr><![CDATA[Enable Max]]></fielddescr>\n\t\t\t<fieldname>enable_rep</fieldname>\n\t\t\t<type>checkbox</type>\n\t\t\t<description><![CDATA[Enables Search for Repeat Offenders in a /24 Range on <strong>Each Individual Blocklist</strong>]]></description>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr><![CDATA[ [ <strong>Max</strong> ] Setting]]></fielddescr>\n\t\t\t<fieldname>p24_max_var</fieldname>\n\t\t\t<description><![CDATA[Default: <strong>5</strong><br />\n\t\t\t\tMaximum number of Repeat Offenders allowed in a Single IP Range]]></description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>5</name><value>5</value></option>\n\t\t\t\t<option><name>10</name><value>10</value></option>\n\t\t\t\t<option><name>15</name><value>15</value></option>\n\t\t\t\t<option><name>20</name><value>20</value></option>\n\t\t\t\t<option><name>25</name><value>25</value></option>\n\t\t\t\t<option><name>50</name><value>50</value></option>\n\t\t\t</options>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr><![CDATA[<br /><strong>Collective List Reputation</strong><br /><br />]]></fielddescr>\n\t\t\t<type>info</type>\n\t\t\t<description></description>\n\t\t</field>\n\t\t<field>\n\t\t\t<type>info</type>\n\t\t\t<description><![CDATA[Once all Blocklists are Downloaded, these two 'additional' processes <strong>[ pMax ] and [ dMax ]</strong><br />\n\t\t\t\tCan be used to Further analyze for Repeat Offenders.<br />\n\t\t\t\t<ul>Analyzing All Blocklists as a Whole:</ul>\n\t\t\t\t<ul><strong>[ pMax ]</strong> will analyze for Repeat Offenders in each IP Range but will not use the Country Exclusion.<br />\n\t\t\t\tDefault is 50 IPs in any Range. Having 50 Repeat Offenders IPs in any Range will Block the entire Range.<br /><br /></ul>\n\t\t\t\t<ul><strong>[ dMax ]</strong> will analyze for Repeat Offenders in each IP Range. Country Exclusions will be applied.<br />\n\t\t\t\tDefault is 5 IPs in any Range.</ul>\n\t\t\t\tNote: <strong>MAX</strong> performs on individual Blocklists, while <strong>pMAX / dMAX</strong>\n\t\t\t\tperform on all Lists together.<br />]]>\n\t\t\t</description>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>Enable pMAX</fielddescr>\n\t\t\t<fieldname>enable_pdup</fieldname>\n\t\t\t<type>checkbox</type>\n\t\t\t<description><![CDATA[Enables Search for Repeat Offenders in All BlockLists, <strong>Without</strong> Country Code Exclusion]]>\n\t\t\t</description>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr><![CDATA[ [ <strong>pMax</strong> ] Setting]]></fielddescr>\n\t\t\t<fieldname>p24_pmax_var</fieldname>\n\t\t\t<description><![CDATA[Default: <strong>50</strong><br />Maximum number of Repeat Offenders]]></description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>50</name><value>50</value></option>\n\t\t\t\t<option><name>25</name><value>25</value></option>\n\t\t\t\t<option><name>20</name><value>20</value></option>\n\t\t\t\t<option><name>15</name><value>15</value></option>\n\t\t\t\t<option><name>10</name><value>10</value></option>\n\t\t\t\t<option><name>5</name><value>5</value></option>\n\t\t\t</options>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>Enable dMAX</fielddescr>\n\t\t\t<fieldname>enable_dedup</fieldname>\n\t\t\t<type>checkbox</type>\n\t\t\t<description><![CDATA[Enables Search for Repeat Offenders in All BlockLists <strong>Using</strong> Country Code Exclusion]]>\n\t\t\t</description>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr><![CDATA[ [ <strong>dMax</strong> ] Setting]]></fielddescr>\n\t\t\t<fieldname>p24_dmax_var</fieldname>\n\t\t\t<description><![CDATA[Default: <strong>5</strong><br />\n\t\t\t\tMaximum number of Repeat Offenders]]></description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>5</name><value>5</value></option>\n\t\t\t\t<option><name>10</name><value>10</value></option>\n\t\t\t\t<option><name>15</name><value>15</value></option>\n\t\t\t\t<option><name>20</name><value>20</value></option>\n\t\t\t\t<option><name>25</name><value>25</value></option>\n\t\t\t\t<option><name>50</name><value>50</value></option>\n\t\t\t</options>\n\t\t</field>\n\t\t<field>\n\t\t\t<name>Country Code Settings (max/dMax)</name>\n\t\t\t<type>listtopic</type>\n\t\t</field>\n\t\t<field>\n\t\t\t<type>info</type>\n\t\t\t<description><![CDATA[When performing Queries for Repeat Offenders, you can choose to <strong>ignore</strong> Repeat Offenders in select\n\t\t\t\tCountries. The Original Blocklisted IPs remain intact. All other Repeat Offending Country Ranges will be processed.<br /><br />\n\t\t\t\tDefine Repeat Offending Ranges [ <strong>Action</strong> ] Available settings are:<br />\n\t\t\t\t<ul><strong>Ignore</strong>: Repeat Offenders that are in the 'ccwhite' category will be 'Ignored' (Default)</ul>\n\t\t\t\t<ul><strong>Block:</strong> Repeat Offenders are set to Block the entire Repeat Offending Range(s)</ul>\n\t\t\t\t<ul><strong>Match:</strong> Repeat Offenders are added to a 'Match' List which can be used in a Floating Match Rule<br />\n\t\t\t\tSelecting 'Match' will consume more processing time, so only select this option if you enable Rules for it.</ul>\n\t\t\t\t'<strong>ccwhite</strong>' are Countries that are Selected to be excluded from the Repeat Offenders Search.<br />\n\t\t\t\t'<strong>ccblack</strong>' are all other Countries that are not selected.<br /><br />\n\t\t\t\tTo use '<strong>Match</strong>' Lists, Create a new 'Alias'\n\t\t\t\tand select one of the <strong>Action 'Match'</strong> Formats and<br /> enter the 'Localfile' as:\n\t\t\t\t<ul>/var/db/pfblockerng/match/matchdedup.txt</ul>]]>\n\t\t\t</description>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>ccwhite Action:</fielddescr>\n\t\t\t<fieldname>ccwhite</fieldname>\n\t\t\t<description><![CDATA[Default: <strong>Ignore</strong><br />\n\t\t\t\tSelect the 'Action' format for ccwhite]]>\n\t\t\t</description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>Ignore</name><value>ignore</value></option>\n\t\t\t\t<option><name>Match</name><value>match</value></option>\n\t\t\t</options>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>ccblack Action:</fielddescr>\n\t\t\t<fieldname>ccblack</fieldname>\n\t\t\t<description><![CDATA[Default: <strong>Block</strong><br />\n\t\t\t\tSelect the 'Action' format for ccblack]]>\n\t\t\t</description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>Block</name><value>block</value></option>\n\t\t\t\t<option><name>Match</name><value>match</value></option>\n\t\t\t</options>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr><![CDATA[<br /><strong>IPv4</strong><br />Country Exclusion<br />\n\t\t\t\t<br />Geolite Data by: <br />MaxMind Inc. (ISO 3166)]]></fielddescr>\n\t\t\t<fieldname>ccexclude</fieldname>\n\t\t\t<description>\n\t\t\t\t<![CDATA[Select Countries you want to <strong>Exclude</strong> from the Reputation Process.<br />\n\t\t\t\t<strong>Use CTRL + CLICK to select/unselect countries</strong>]]>\n\t\t\t</description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t{$et_options}\n\t\t\t</options>\n\t\t\t<size>20</size>\n\t\t\t<multiple/>\n\t\t</field>\n\t\t<field>\n\t\t\t<name>Proofpoint ET IQRISK IPv4 Reputation</name>\n\t\t\t<type>listtopic</type>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>Subscription Pro. Blocklist</fielddescr>\n\t\t\t<type>info</type>\n\t\t\t<description><![CDATA[<strong>Proofpoint ET IQRisk</strong> is a Subscription Professional Reputation List.<br /><br />\n\t\t\t\t\t<strong>The URL must include the name 'iprepdata.txt' for the filename.</strong><br />\n\t\t\t\t\tET IQRisk Blocklist must be entered in the Lists Tab using the following example:\n\t\t\t\t\t<ul>https://rules.emergingthreatspro.com/XXXXXXXXXXXXXXXX/reputation/iprepdata.txt.gz</ul>\n\t\t\t\t\tSelect the <strong>ET IQRisk'</strong> format. The URL should use the .gz File Type.<br />\n\t\t\t\t\tEnter your \"ETPRO\" code in URL. Further information can be found @\n\t\t\t\t\t<a target=\"_blank\" href=\"http://emergingthreats.net/solutions/iqrisk-suite/\">ET IQRisk IP Reputation</a><br /><br />\n\t\t\t\t\tTo use <strong>'Match'</strong> Lists, Create a new 'Alias' and select one of the <strong>\n\t\t\t\t\tAction 'Match'</strong> Formats and <br />\n\t\t\t\t\tenter the 'Localfile' as: <ul>/var/db/pfblockerng/match/ETMatch.txt</ul>\n\t\t\t\t\tET IQRisk Individual Match Lists can be found in the following folder:<br />\n\t\t\t\t\t<ul>/var/db/pfblockerng/ET</ul> ]]>\n\t\t\t</description>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>ET IQRisk Header Name</fielddescr>\n\t\t\t<fieldname>et_header</fieldname>\n\t\t\t<type>input</type>\n\t\t\t<description><![CDATA[Enter the 'Header Name' referenced in the IPv4 List TAB for ET IQRisk IPRep.<br />\n\t\t\t\tThis will be used to improve the Alerts TAB reporting for ET IPRep.]]>\n\t\t\t</description>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>ET IQRISK BLOCK LISTS</fielddescr>\n\t\t\t<fieldname>etblock</fieldname>\n\t\t\t<description>\n\t\t\t\t<![CDATA[Select Lists you want to BLOCK.<br />\n\t\t\t\t<strong>Use CTRL + CLICK to select/unselect Categories</strong>\n\t\t\t\t<br /><br />Any Changes will take effect at the Next Scheduled CRON Task]]>\n\t\t\t</description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>ET CNC</name><value>ET_Cnc</value></option>\n\t\t\t\t<option><name>ET BOT</name><value>ET_Bot</value></option>\n\t\t\t\t<option><name>ET SPAM</name><value>ET_Spam</value></option>\n\t\t\t\t<option><name>ET DROP</name><value>ET_Drop</value></option>\n\t\t\t\t<option><name>ET Spyware CNC</name><value>ET_Spywarecnc</value></option>\n\t\t\t\t<option><name>ET Online Gaming</name><value>ET_Onlinegaming</value></option>\n\t\t\t\t<option><name>ET DrivebySRC</name><value>ET_Drivebysrc</value></option>\n\t\t\t\t<option><name>ET Chat Server</name><value>ET_Chatserver</value></option>\n\t\t\t\t<option><name>ET TOR Node</name><value>ET_Tornode</value></option>\n\t\t\t\t<option><name>ET Compromised</name><value>ET_Compromised</value></option>\n\t\t\t\t<option><name>ET P2P</name><value>ET_P2P</value></option>\n\t\t\t\t<option><name>ET Proxy</name><value>ET_Proxy</value></option>\n\t\t\t\t<option><name>ET IP Check</name><value>ET_Ipcheck</value></option>\n\t\t\t\t<option><name>ET Utility</name><value>ET_Utility</value></option>\n\t\t\t\t<option><name>ET DOS</name><value>ET_DDos</value></option>\n\t\t\t\t<option><name>ET Scanner</name><value>ET_Scanner</value></option>\n\t\t\t\t<option><name>ET Brute</name><value>ET_Brute</value></option>\n\t\t\t\t<option><name>ET Fake AV</name><value>ET_Fakeav</value></option>\n\t\t\t\t<option><name>ET DYN DNS</name><value>ET_Dyndns</value></option>\n\t\t\t\t<option><name>ET Undersireable</name><value>ET_Undesireable</value></option>\n\t\t\t\t<option><name>ET Abuse TLD</name><value>ET_Abusedtld</value></option>\n\t\t\t\t<option><name>ET SelfSigned SSL</name><value>ET_Selfsignedssl</value></option>\n\t\t\t\t<option><name>ET Blackhole</name><value>ET_Blackhole</value></option>\n\t\t\t\t<option><name>ET RAS</name><value>ET_RAS</value></option>\n\t\t\t\t<option><name>ET P2P CNC</name><value>ET_P2Pcnc</value></option>\n\t\t\t\t<option><name>ET Shared Hosting</name><value>ET_Sharedhosting</value></option>\n\t\t\t\t<option><name>ET Parking</name><value>ET_Parking</value></option>\n\t\t\t\t<option><name>ET VPN</name><value>ET_VPN</value></option>\n\t\t\t\t<option><name>ET EXE Source</name><value>ET_Exesource</value></option>\n\t\t\t\t<option><name>ET Mobile CNC</name><value>ET_Mobilecnc</value></option>\n\t\t\t\t<option><name>ET Mobile Spyware</name><value>ET_Mobilespyware</value></option>\n\t\t\t\t<option><name>ET Skype Node</name><value>ET_Skypenode</value></option>\n\t\t\t\t<option><name>ET Bitcoin</name><value>ET_Bitcoin</value></option>\n\t\t\t\t<option><name>ET DOS Attack</name><value>ET_DDosattack</value></option>\n\t\t\t\t<option><name>Unknown</name><value>ET_Unknown</value></option>\n\t\t\t</options>\n\t\t\t<size>35</size>\n\t\t\t<multiple/>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>ET IQRISK Match LISTS</fielddescr>\n\t\t\t<fieldname>etmatch</fieldname>\n\t\t\t<description>\n\t\t\t\t<![CDATA[Select Lists you want to MATCH.<br />\n\t\t\t\t<strong>Use CTRL + CLICK to select/unselect Categories</strong>\n\t\t\t\t<br /><br />Any Changes will take effect at the Next Scheduled CRON Task]]>\n\t\t\t</description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>ET CNC</name><value>ET_Cnc</value></option>\n\t\t\t\t<option><name>ET BOT</name><value>ET_Bot</value></option>\n\t\t\t\t<option><name>ET SPAM</name><value>ET_Spam</value></option>\n\t\t\t\t<option><name>ET DROP</name><value>ET_Drop</value></option>\n\t\t\t\t<option><name>ET Spyware CNC</name><value>ET_Spywarecnc</value></option>\n\t\t\t\t<option><name>ET Online Gaming</name><value>ET_Onlinegaming</value></option>\n\t\t\t\t<option><name>ET DrivebySRC</name><value>ET_Drivebysrc</value></option>\n\t\t\t\t<option><name>ET Chat Server</name><value>ET_Chatserver</value></option>\n\t\t\t\t<option><name>ET TOR Node</name><value>ET_Tornode</value></option>\n\t\t\t\t<option><name>ET Compromised</name><value>ET_Compromised</value></option>\n\t\t\t\t<option><name>ET P2P</name><value>ET_P2P</value></option>\n\t\t\t\t<option><name>ET Proxy</name><value>ET_Proxy</value></option>\n\t\t\t\t<option><name>ET IP Check</name><value>ET_Ipcheck</value></option>\n\t\t\t\t<option><name>ET Utility</name><value>ET_Utility</value></option>\n\t\t\t\t<option><name>ET DOS</name><value>ET_DDos</value></option>\n\t\t\t\t<option><name>ET Scanner</name><value>ET_Scanner</value></option>\n\t\t\t\t<option><name>ET Brute</name><value>ET_Brute</value></option>\n\t\t\t\t<option><name>ET Fake AV</name><value>ET_Fakeav</value></option>\n\t\t\t\t<option><name>ET DYN DNS</name><value>ET_Dyndns</value></option>\n\t\t\t\t<option><name>ET Undersireable</name><value>ET_Undesireable</value></option>\n\t\t\t\t<option><name>ET Abuse TLD</name><value>ET_Abusedtld</value></option>\n\t\t\t\t<option><name>ET SelfSigned SSL</name><value>ET_Selfsignedssl</value></option>\n\t\t\t\t<option><name>ET Blackhole</name><value>ET_Blackhole</value></option>\n\t\t\t\t<option><name>ET RAS</name><value>ET_RAS</value></option>\n\t\t\t\t<option><name>ET P2P CNC</name><value>ET_P2Pcnc</value></option>\n\t\t\t\t<option><name>ET Shared Hosting</name><value>ET_Sharedhosting</value></option>\n\t\t\t\t<option><name>ET Parking</name><value>ET_Parking</value></option>\n\t\t\t\t<option><name>ET VPN</name><value>ET_VPN</value></option>\n\t\t\t\t<option><name>ET EXE Source</name><value>ET_Exesource</value></option>\n\t\t\t\t<option><name>ET Mobile CNC</name><value>ET_Mobilecnc</value></option>\n\t\t\t\t<option><name>ET Mobile Spyware</name><value>ET_Mobilespyware</value></option>\n\t\t\t\t<option><name>ET Skype Node</name><value>ET_Skypenode</value></option>\n\t\t\t\t<option><name>ET Bitcoin</name><value>ET_Bitcoin</value></option>\n\t\t\t\t<option><name>ET DOS Attack</name><value>ET_DDosattack</value></option>\n\t\t\t\t<option><name>Unknown</name><value>ET_Unknown</value></option>\n\t\t\t</options>\n\t\t\t<size>35</size>\n\t\t\t<multiple/>\n\t\t</field>\n\t\t<field>\n\t\t\t<fielddescr>Update ET Categories</fielddescr>\n\t\t\t<fieldname>et_update</fieldname>\n\t\t\t<description><![CDATA[Default: <strong>Disable</strong><br />\n\t\t\t\tSelect - Enable ET Update if Category Changes are Made.<br />\n\t\t\t\tYou can perform a 'Force Update' to enable these changes.<br />\n\t\t\t\tCron will also resync this list at the next Scheduled Update.]]>\n\t\t\t</description>\n\t\t\t<type>select</type>\n\t\t\t<options>\n\t\t\t\t<option><name>Disable</name><value>disabled</value></option>\n\t\t\t\t<option><name>Enable</name><value>enabled</value></option>\n\t\t\t</options>\n\t\t</field>\n\t\t<field>\n\t\t\t<name><![CDATA[<center>Click to SAVE Settings and/or Rule Edits.   Changes are Applied via CRON or\n\t\t\t\t'Force Update'</center>]]></name>\n\t\t\t<type>listtopic</type>\n\t\t</field>\n\t</fields>\n\t<custom_php_validation_command>\n\t\tpfblockerng_validate_input(\\$_POST, \\$input_errors);\n\t</custom_php_validation_command>\n\t<custom_php_resync_config_command>\n\t\tglobal \\$pfb;\n\t\t\\$pfb['save'] = TRUE;\n\t\tsync_package_pfblockerng();\n\t</custom_php_resync_config_command>\n</packagegui>\nEOF;\n\t$log = \" Saving pfBlockerNG Reputation TAB\\n\";\n\tif (!$g['pfblockerng_install']) {\n\t\tprint $log;\n\t}\n\tpfb_logger(\"{$log}\", 3);\n\n\t// Save pfBlockerng_reputation.xml file\n\t@file_put_contents('/usr/local/pkg/pfblockerng/pfblockerng_reputation.xml', $xmlrep, LOCK_EX);\n\n\t$now = date('m/d/y G.i:s', time());\n\t$log = \"Country Code Update Ended - [ NOW ]\\n\\n\";\n\tif (!$g['pfblockerng_install']) {\n\t\tprint \"Country Code Update Ended - [ $now ]\\n\\n\";\n\t}\n\tpfb_logger(\"{$log}\", 3);\n\n\t// Unset arrays\n\tunset ($roptions4, $et_options, $xmlrep);\n}",
"function pfblockerng_uc_countries() {\n\tglobal $g, $pfb;\n\n\t// Create folders if not exist\n\t$folder_array = array (\"{$pfb['dbdir']}\", \"{$pfb['logdir']}\", \"{$pfb['ccdir']}\");\n\tforeach ($folder_array as $folder) {\n\t\tsafe_mkdir (\"{$folder}\", 0755);\n\t}\n\n\t$log = \"Country code update Start [ NOW ]\\n\";\n\tpfb_logger(\"{$log}\", 4);\n\n\t$maxmind_cont = \"{$pfb['geoipshare']}/GeoLite2-Country-Locations-{$pfb['maxmind_locale']}.csv\";\n\tif (!file_exists($maxmind_cont)) {\n\t\t$log = \" [ MAXMIND UPDATE FAIL, Language File Missing, using previous Country code database ] [ NOW ]\\n\";\n\t\tpfb_logger(\"{$log}\", 4); \n\t\treturn;\n\t}\n\n\t// Save Date/Time stamp to MaxMind version file\n\t$local_tds\t = @gmdate('D, d M Y H:i:s T', @filemtime($maxmind_cont));\n\t$maxmind_ver\t = \"MaxMind GeoLite2 Date/Time Stamp\\n\";\n\t$maxmind_ver\t.= \"Last-Modified: {$local_tds}\\n\";\n\t@file_put_contents(\"{$pfb['logdir']}/maxmind_ver\", $maxmind_ver, LOCK_EX);\n\n\t// Collect ISO codes for each Continent\n\t$log = \" Converting MaxMind Country databases for pfBlockerNG.\\n\";\n\tpfb_logger(\"{$log}\", 4);\n\n\t// Remove any previous working files\n\trmdir_recursive(\"{$pfb['ccdir_tmp']}\");\n\tsafe_mkdir(\"{$pfb['ccdir_tmp']}\");\n\n\trmdir_recursive(\"{$pfb['ccdir']}\");\n\tsafe_mkdir(\"{$pfb['ccdir']}\");\n\n\t$pfb_geoip = array();\n\n\t$top_20 = array('CN', 'RU', 'JP', 'UA', 'GB', 'DE', 'BR', 'FR', 'IN', 'TR',\n\t\t\t'IT', 'KR', 'PL', 'ES', 'VN', 'AR', 'CO', 'TW', 'MX', 'CL');\n\n\t// Read GeoLite2 database and create array by geoname_ids\n\tif (($handle = @fopen(\"{$maxmind_cont}\", 'r')) !== FALSE) {\n\t\twhile (($cc = @fgetcsv($handle)) !== FALSE) {\n\n\t\t\tif ($cc[0] == 'geoname_id') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/*\tSample MaxMind lines:\n\t\t\t\tgeoname_id,locale_code,continent_code,continent_name,country_iso_code,country_name\n\t\t\t\t49518,en,AF,Africa,RW,Rwanda\t*/\n\n\t\t\tif (!empty($cc[0]) && !empty($cc[1]) && !empty($cc[2]) && !empty($cc[3]) && !empty($cc[4]) && !empty($cc[5])) {\n\t\t\t\t$pfb_geoip['country'][$cc[0]] = array('id' => $cc[0], 'continent' => $cc[3], 'name' => $cc[5], 'iso' => array(\"{$cc[4]}\"));\n\n\t\t\t\t// Collect English Continent name for filenames only\n\t\t\t\tif ($cc[1] != 'en') {\n\t\t\t\t\t$geoip_en\t= str_replace(\"Locations-{$pfb['maxmind_locale']}\", 'Locations-en', $maxmind_cont);\n\t\t\t\t\t$continent_en\t= exec(\"{$pfb['grep']} -m1 ',en,{$cc[2]}' {$geoip_en} | {$pfb['cut']} -d',' -f4\");\n\t\t\t\t} else {\n\t\t\t\t\t$continent_en\t= \"{$cc[3]}\";\n\t\t\t\t}\n\t\t\t\t$continent_en = str_replace(array(' ', '\"'), array('_', ''), $continent_en);\n\t\t\t\t$pfb_geoip['country'][$cc[0]]['continent_en'] = \"{$continent_en}\";\n\n\t\t\t\t// Collect data for TOP 20 tab\n\t\t\t\tif (in_array($cc[4], $top_20)) {\n\t\t\t\t\t$order = array_keys($top_20, $cc[4]);\n\t\t\t\t\t$top20 = 'A' . str_pad($order[0], 5, '0', STR_PAD_LEFT);\n\t\t\t\t\t$pfb_geoip['country'][$top20] = array('name' => $cc[5], 'iso' => $cc[4], 'id' => $cc[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tunset($cc);\n\t\t@fclose($handle);\n\t}\n\n\t// Add 'Proxy and Satellite' geoname_ids\n\t$pfb_geoip['country']['proxy']\t\t= array('continent' => 'Proxy and Satellite', 'name' => 'Proxy', 'iso' => array('A1'),\n\t\t\t\t\t\t\t'continent_en' => 'Proxy_and_Satellite');\n\t$pfb_geoip['country']['satellite']\t= array('continent' => 'Proxy and Satellite', 'name' => 'Satellite', 'iso' => array('A2'),\n\t\t\t\t\t\t\t'continent_en' => 'Proxy_and_Satellite');\n\n\t// Add 'Asia/Europe' undefined geoname_ids\n\t$pfb_geoip['country']['6255147']\t= array('continent' => 'Asia', 'name' => 'AA ASIA UNDEFINED', 'iso' => array('6255147'),\n\t\t\t\t\t\t\t'continent_en' => 'Asia');\n\t$pfb_geoip['country']['6255148']\t= array('continent' => 'Europe', 'name' => 'AA EUROPE UNDEFINED', 'iso' => array('6255148'),\n\t\t\t\t\t\t\t'continent_en' => 'Europe');\n\n\tksort($pfb_geoip['country'], SORT_NATURAL);\n\n\t// Collect Country ISO data and sort to Continent arrays (IPv4 and IPv6)\n\tforeach (array('4', '6') as $type) {\n\t\n\t\t$log = \" Processing ISO IPv{$type} Continent/Country Data [ NOW ]\\n\";\n\t\tpfb_logger(\"{$log}\", 4);\n\n\t\t$geoip_dup = 0;\t\t// Count of Geoname_ids which have both a different 'Registered and Represented' geoname_id\n\n\t\t$maxmind_cc = \"{$pfb['geoipshare']}/GeoLite2-Country-Blocks-IPv{$type}.csv\";\n\t\tif (($handle = @fopen(\"{$maxmind_cc}\", 'r')) !== FALSE) {\n\t\t\twhile (($cc = @fgetcsv($handle)) !== FALSE) {\n\n\t\t\t\t/*\tSample lines:\n\t\t\t\t\tNetwork,geoname_id,registered_country_geoname_id,represented_country_geoname_id,is_anonymous_proxy,is_satellite_provider\n\t\t\t\t\t1.0.0.0/24,2077456,2077456,,0,0\t\t*/\n\n\t\t\t\tif ($cc[0] == 'network') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$iso = $iso_rep = '';\n\n\t\t\t\t// Is Anonymous Proxy?\n\t\t\t\tif ($cc[4] == 1) {\n\n\t\t\t\t\tif (!empty($cc[1])) {\n\t\t\t\t\t\t$iso = \"A1_{$pfb_geoip['country']['proxy']['iso'][0]}\";\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($cc[2]) && $cc[1] != $cc[2]) {\n\t\t\t\t\t\t$geoip_dup++;\n\t\t\t\t\t\t$iso_rep = \"A1_{$pfb_geoip['country'][$cc[2]]['iso'][0]}_rep\";\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($cc[1]) && empty($cc[2])) {\n\t\t\t\t\t\t$iso = 'A1';\n\t\t\t\t\t}\n\t\t\t\t\t$cc[2] = 'proxy';\t// Re-define variable\n\t\t\t\t}\n\n\t\t\t\t// Is Satellite Provider?\n\t\t\t\telseif ($cc[5] == 1) {\n\n\t\t\t\t\tif (!empty($cc[1])) {\n\t\t\t\t\t\t$iso = \"A2_{$pfb_geoip['country']['satellite']['iso'][0]}\";\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($cc[2]) && $cc[1] != $cc[2]) {\n\t\t\t\t\t\t$geoip_dup++;\n\t\t\t\t\t\t$iso_rep = \"A2_{$pfb_geoip['country'][$cc[2]]['iso'][0]}_rep\";\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($cc[1]) && empty($cc[2])) {\n\t\t\t\t\t\t$iso = 'A2';\n\t\t\t\t\t}\n\t\t\t\t\t$cc[2] = 'satellite';\t// Re-define variable\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!empty($cc[1])) {\n\t\t\t\t\t\t$iso = \"{$pfb_geoip['country'][$cc[1]]['iso'][0]}\";\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($cc[2]) && $cc[1] != $cc[2]) {\n\t\t\t\t\t\t$geoip_dup++;\n\t\t\t\t\t\t$iso_rep = \"{$pfb_geoip['country'][$cc[2]]['iso'][0]}_rep\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add 'ISO Represented' to Country ISO list\n\t\t\t\tif (!empty($iso_rep) && !empty($cc[2])) {\n\n\t\t\t\t\t// Only add if not existing\n\t\t\t\t\tif (!isset($pfb_geoip['country'][$cc[2]]) || !in_array($iso_rep, $pfb_geoip['country'][$cc[2]]['iso'])) {\n\t\t\t\t\t\t$pfb_geoip['country'][$cc[2]]['iso'][] = \"{$iso_rep}\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add placeholder for 'undefined ISO Represented' to Country ISO list\n\t\t\t\telseif ($type == '4' && empty($iso_rep)) {\n\n\t\t\t\t\tforeach (array('' => $cc[1], 'A1_' => 'proxy', 'A2_' => 'satellite') as $reptype => $iso_placeholder) {\n\n\t\t\t\t\t\tif (!empty($cc[1])) {\n\t\t\t\t\t\t\t$iso_rep_placeholder = \"{$reptype}{$pfb_geoip['country'][$cc[1]]['iso'][0]}_rep\";\n\n\t\t\t\t\t\t\t// Only add if not existing\n\t\t\t\t\t\t\tif (!isset($pfb_geoip['country'][$iso_placeholder])\n\t\t\t\t\t\t\t || !in_array($iso_rep_placeholder, $pfb_geoip['country'][$iso_placeholder]['iso'])) {\n\n\t\t\t\t\t\t\t\t$pfb_geoip['country'][$iso_placeholder]['iso'][] = \"{$iso_rep_placeholder}\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n\t\t\t\t// Save 'ISO Registered Network' to ISO file\n\t\t\t\tif (!empty($iso) && !empty($cc[0])) {\n\t\t\t\t\t$file = \"{$pfb['ccdir_tmp']}/{$iso}_v{$type}.txt\";\n\t\t\t\t\t@file_put_contents(\"{$file}\", \"{$cc[0]}\\n\", FILE_APPEND | LOCK_EX);\n\t\t\t\t}\n\n\t\t\t\t// Save ISO 'Represented Network' to ISO file\n\t\t\t\tif (!empty($iso_rep) && !empty($cc[0])) {\n\t\t\t\t\t$file = \"{$pfb['ccdir_tmp']}/{$iso_rep}_v{$type}.txt\";\n\t\t\t\t\t@file_put_contents(\"{$file}\", \"{$cc[0]}\\n\", FILE_APPEND | LOCK_EX);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Report number of Geoname_ids which have both a different 'Registered and Represented' geoname_id\n\t\t\tif ($geoip_dup != 0) {\n\t\t\t\t@file_put_contents(\"{$pfb['logdir']}/maxmind_ver\", \"Duplicate Represented IP{$type} Networks: {$geoip_dup}\\n\", FILE_APPEND | LOCK_EX);\n\t\t\t}\n\n\t\t\t// Create Continent txt files\n\t\t\tif (!empty($pfb_geoip['country'])) {\n\t\t\t\tforeach ($pfb_geoip['country'] as $key => $geoip) {\n\n\t\t\t\t\t// Save 'TOP 20' data\n\t\t\t\t\tif (strpos($key, 'A000') !== FALSE) {\n\t\t\t\t\t\t$pfb_file = \"{$pfb['ccdir']}/Top_20_v{$type}.info\";\n\n\t\t\t\t\t\tif (!file_exists($pfb_file)) {\n\t\t\t\t\t\t\t$header = '# Generated from MaxMind Inc. on: ' . date('m/d/y G:i:s', time()) . \"\\n\";\n\t\t\t\t\t\t\t$header .= \"# Continent IPv{$type}: TopSpammers\\n\";\n\t\t\t\t\t\t\t$header .= \"# Continent en: TopSpammers\\n\";\n\t\t\t\t\t\t\t@file_put_contents($pfb_file, $header, LOCK_EX);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$iso_header = \"# Country: {$geoip['name']} ({$geoip['id']})\\n\";\n\t\t\t\t\t\t$iso_header .= \"# ISO Code: {$geoip['iso']}\\n\";\n\t\t\t\t\t\t$iso_header .= \"# Total Networks: Top20\\n\";\n\t\t\t\t\t\t$iso_header .= \"Top20\\n\";\n\n\t\t\t\t\t\t// Add any 'TOP 20' Represented ISOs Networks\n\t\t\t\t\t\tif (file_exists(\"{$pfb['ccdir_tmp']}/{$geoip['iso']}_rep_v{$type}.txt\")) {\n\t\t\t\t\t\t\t$iso_header .= \"# Country: {$geoip['name']} ({$geoip['id']})\\n\";\n\t\t\t\t\t\t\t$iso_header .= \"# ISO Code: {$geoip['iso']}_rep\\n\";\n\t\t\t\t\t\t\t$iso_header .= \"# Total Networks: Top20\\n\";\n\t\t\t\t\t\t\t$iso_header .= \"Top20\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@file_put_contents($pfb_file, $iso_header, FILE_APPEND | LOCK_EX);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (!empty($geoip['continent_en'])) {\n\n\t\t\t\t\t\t\t$pfb_file = \"{$pfb['ccdir']}/{$geoip['continent_en']}_v{$type}.txt\";\n\t\t\t\t\t\t\tif (!file_exists($pfb_file)) {\n\t\t\t\t\t\t\t\t$header = '# Generated from MaxMind Inc. on: ' . date('m/d/y G:i:s', time()) . \"\\n\";\n\t\t\t\t\t\t\t\t$header .= \"# Continent IPv{$type}: {$geoip['continent']}\\n\";\n\t\t\t\t\t\t\t\t$header .= \"# Continent en: {$geoip['continent_en']}\\n\";\n\t\t\t\t\t\t\t\t@file_put_contents($pfb_file, $header, LOCK_EX);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!empty($geoip['iso'])) {\n\t\t\t\t\t\t\t\tforeach ($geoip['iso'] as $iso) {\n\n\t\t\t\t\t\t\t\t\t$iso_file = \"{$pfb['ccdir_tmp']}/{$iso}_v{$type}.txt\";\n\t\t\t\t\t\t\t\t\t$geoip_id = '';\n\t\t\t\t\t\t\t\t\tif (!empty($geoip['id'])) {\n\t\t\t\t\t\t\t\t\t\t$geoip_id = \" [{$geoip['id']}]\";\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (file_exists($iso_file)) {\n\t\t\t\t\t\t\t\t\t\t$networks = exec(\"{$pfb['grep']} -c ^ {$iso_file} 2>&1\");\n\t\t\t\t\t\t\t\t\t\t$iso_header = \"# Country: {$geoip['name']}{$geoip_id}\\n\";\n\t\t\t\t\t\t\t\t\t\t$iso_header .= \"# ISO Code: {$iso}\\n\";\n\t\t\t\t\t\t\t\t\t\t$iso_header .= \"# Total Networks: {$networks}\\n\";\n\t\t\t\t\t\t\t\t\t\t@file_put_contents($pfb_file, $iso_header, FILE_APPEND | LOCK_EX);\n\n\t\t\t\t\t\t\t\t\t\t// Concat ISO Networks to Continent file\n\t\t\t\t\t\t\t\t\t\texec(\"{$pfb['cat']} {$iso_file} >> {$pfb_file} 2>&1\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// Create placeholder file for undefined 'ISO Represented'\n\t\t\t\t\t\t\t\t\t\t$iso_header = \"# Country: {$geoip['name']}{$geoip_id}\\n\";\n\t\t\t\t\t\t\t\t\t\t$iso_header .= \"# ISO Code: {$iso}\\n\";\n\t\t\t\t\t\t\t\t\t\t$iso_header .= \"# Total Networks: NA\\n\";\n\t\t\t\t\t\t\t\t\t\t@file_put_contents($pfb_file, $iso_header, FILE_APPEND | LOCK_EX);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reset ISOs to original setting (Remove any Represented ISOs)\n\t\t\t\t\t\t\t\t$pfb_geoip['country'][$key]['iso'] = array($pfb_geoip['country'][$key]['iso'][0]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$log = \"\\n Missing ISO data: {$geoip['continent']}\";\n\t\t\t\t\t\t\t\tpfb_logger(\"{$log}\", 4);\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\t$log = \"\\n Failed to create Continent file: {$geoip['continent']}\";\n\t\t\t\t\t\t\tpfb_logger(\"{$log}\", 4);\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\tunset($cc);\n\t\t\t@fclose($handle);\n\t\t}\n\t\telse {\n\t\t\t$log = \"\\n Failed to load file: {$maxmind_cc}\\n\";\n\t\t\tpfb_logger(\"{$log}\", 4);\n\t\t}\n\t}\n\tunset($pfb_geoip);\n\trmdir_recursive(\"{$pfb['ccdir_tmp']}\");\n}",
"private function mapLLjssTileLayerGoogleMaps()\n {\n $this->mapLLjssTileLayerGoogleMapsHybrid();\n $this->mapLLjssTileLayerGoogleMapsRoadmap();\n $this->mapLLjssTileLayerGoogleMapsSatellite();\n $this->mapLLjssTileLayerGoogleMapsTerrain();\n }",
"function pull_store_maps()\n\t{\n\t\tlog_message('debug', 'Map_cron/pull_store_maps:: [1] ');\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\t# extract and breakdown passed details into a usable array\n\t\tif(!empty($data['locations'])) {\n\t\t\t$this->load->model('_data');\n\t\t\t$locations = array();\n\t\t\t$rawLocations = explode('__',$data['locations']);\n\t\t\tlog_message('debug', 'Map_cron/pull_store_maps:: [2] locations='.json_encode($rawLocations));\n\t\t\t\n\t\t\tforeach($rawLocations AS $row){\n\t\t\t\t$locationParts = explode('_',$row);\n\t\t\t\tif(count($locationParts) == 3) array_push($locations, array('latitude'=>$locationParts[1],'longitude'=>$locationParts[0],'file_name'=>'banner_'.$locationParts[2].'.png'));\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($locations)) $result = $this->_data->download_maps($locations); \n\t\t}\n\t\t\n\t\tlog_message('debug', 'Map_cron/pull_store_maps:: [3] '.(!empty($result) && $result? 'SUCCESS': 'FAIL'));\n\t\techo (!empty($result) && $result);\n\t}",
"static function ajax_get_maps_list() {\n $saved_maps = get_option(WF_GMP_MAPS_KEY);\n\n if (is_array($saved_maps)) {\n $maps = array_keys($saved_maps);\n } else {\n $maps = array();\n }\n\n die(json_encode($maps));\n }",
"public function getUrlDownloadFiles()\n {\n // Create directory if not yet\n if (!file_exists($this->dataLocalPath)) {\n mkdir($this->dataLocalPath);\n mkdir($this->dataLocalPath . DS . 'cache');\n } elseif (!file_exists($this->dataLocalPath . DS . 'cache')) {\n mkdir($this->dataLocalPath . DS . 'cache');\n }\n\n // Generate URLs array\n $urls = array('alternateNames' => self::GEONAMES_DUMP_URL . self::ALTERNATE_NAMES_FILE);\n foreach ($this->countries as &$country) {\n $urls[$country] = self::GEONAMES_DUMP_URL . $country . '.zip';\n $this->throwExceptionIfUrlCountryNoExist($urls[$country]);\n }\n\n return $urls;\n }",
"public function getAllWorldMaps() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t= $GLOBALS['db'];\n\t\t\t// Query\n\t\t\t$return\t= $db->getAllRows_Arr('tb_areamap', 'id, vc_name', \"id_areatype = 4\");\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"private function get_countries_and_states()\n {\n }",
"function view_maps()\n {\n $page = $this->page;\n \n $this->load->model('worldmodel');\n $page['maps'] = $this->worldmodel->get_all();\n \n $page['content'] = 'map_view_all';\n $this->load->view('template', $page);\n \n }",
"function google_maps_location() {\n $item = osc_item();\n osc_google_maps_header();\n require 'map.php';\n }",
"function ocworld_map_script()\n{\n\trequire_code('ocworld');\n\n\t$realm=get_param_integer('realm',NULL);\n\tdownload_map_wrap(get_member(),$realm);\n}",
"function export(array $countries, array $onlyThose = [])\n{\n $hostname = basename(getcwd());\n @mkdir('actual');\n// @mkdir('actual/questionnaire');\n @mkdir('actual/country');\n\n foreach ($countries as $country) {\n $id = $country['id'];\n $name = $country['name'];\n $path = $country['path'];\n\n if ($onlyThose && array_search($name, $onlyThose) === false) {\n continue;\n }\n\n if (!$path || $path == 'region') {\n continue;\n }\n\n echo $path . PHP_EOL;\n\n// echo `wget -O \"actual/questionnaire/$name - Water.csv\" \"http://$hostname/api/table/questionnaire/foo.csv?country=$id&filterSet=2\"`;\n// echo `wget -O \"actual/questionnaire/$name - Sanitation.csv\" \"http://$hostname/api/table/questionnaire/foo.csv?country=$id&filterSet=5\"`;\n\n echo `wget -O \"actual/country/$name - Water.csv\" \"http://$hostname/api/table/country/foo.csv?filters=261,262,263,264,265&geonames=$id&years=1980-2015\"`;\n echo `wget -O \"actual/country/$name - Sanitation.csv\" \"http://$hostname/api/table/country/foo.csv?filters=352,353,354,355,356,357&geonames=$id&years=1980-2015\"`;\n }\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 function get_for_browse_countries(){\n $country_name = NULL;\n $sql = \"SELECT * from travelimagedetails GROUP by CountryCodeISO\";\n $countrycodes = $this->query($sql);\n while($country = $countrycodes->fetch()){\n $sql = \"select * from geocountries where ISO ='\" . $country[\"CountryCodeISO\"]. \"'\";\n $result = $this->query($sql);\n $countrynames = $result->fetch();\n echo \"<option value='\". $countrynames[\"ISO\"] .\"'> \". $countrynames[\"CountryName\"] .\" </option>\";\n } \n }",
"public function getAllCountries();",
"public function getRegions($country = false) {\n \n $timer = Debug::GetTimer();\n \n $return = false;\n $mckey = ($country) ? \"railpage:locations.regions.country=\" . $country : \"railpage:locations.regions\";\n \n if ($return = $this->Memcached->fetch($mckey)) {\n return $return;\n }\n \n $return = array(); \n \n if ($country) {\n foreach ($this->db->fetchAll(\"SELECT DISTINCT region FROM location WHERE country = ? AND active = 1 ORDER BY region ASC\", $country) as $row) {\n \n $woe = Place::getWOEData($country);\n if (isset($woe['places']['place'][0])) {\n $return[$country]['woe'] = $woe['places']['place'][0];\n }\n \n $datarow = array(\n \"region\" => $row['region'],\n \"url\" => $this->makeRegionPermalink($country, $row['region']),\n \"count\" => $this->db->fetchOne(\"SELECT COUNT(id) FROM location WHERE country = ? AND region = ?\", array($country, $row['region'])),\n );\n \n $woe = Place::getWOEData($row['region'] . \",\" . $country); \n if (isset($woe['places']['place'][0])) {\n $datarow['woe'] = $woe['places']['place'][0];\n }\n \n $return[$country]['children'][] = $datarow;\n }\n \n $this->Memcached->save($mckey, $return, strtotime(\"+1 day\"));\n \n Debug::LogEvent(__METHOD__ . \"(\" . $country . \")\", $timer);\n \n return $return;\n }\n \n $query = \"SELECT DISTINCT l.region, l.country, g.country_name, g.region_name \n FROM location AS l \n LEFT JOIN geoplace AS g ON l.geoplace = g.id \n WHERE l.active = 1 \n GROUP BY l.country \n ORDER BY l.region DESC\";\n \n foreach ($this->db->fetchAll($query) as $row) {\n if (empty($row['country'])) {\n continue;\n }\n \n $return[$row['country']]['woe'] = array(\n \"country\" => $row['country_name']\n );\n \n if (empty($return[$row['country']]['woe']['country'])) {\n $woe = Place::getWOEData(strtoupper($row['region']));\n $return[$row['country']]['woe'] = array(\n \"country\" => $woe['places']['place'][0]['country']\n );\n }\n \n $return[$row['country']]['children'][] = $row['region']; \n }\n \n // Cache it\n $this->Memcached->save($mckey, $return, strtotime(\"+1 day\"));\n \n Debug::LogEvent(__METHOD__ . \"(\" . $country . \")\", $timer);\n \n return $return;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setOehdstctry() Set the value of [oehdstcity] column. | public function setOehdstcity($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->oehdstcity !== $v) {
$this->oehdstcity = $v;
$this->modifiedColumns[SalesOrderTableMap::COL_OEHDSTCITY] = true;
}
return $this;
} | [
"function setCity($s)\n\t{\n\t\t$this->Info['City'] = $s;\n\t\tupdateTableByClient('ClientContact', 'City', $s, $this->Clientname);\n\t}",
"public function setCity( $city );",
"function setCity($city)\n {\n $this->__city = $city ;\n }",
"public function setCity($city) { $this->city = $city ; }",
"public function set_city($city) {\r\n $this->city = $city;\r\n }",
"public function setCity($city) { $this->city = $city; }",
"public function getOehdstcity()\n {\n return $this->oehdstcity;\n }",
"function setCity($city) {\n\t\t$this->m_city = $city;\n\t}",
"function setCustomerCity($value)\n {\n $this->setAttribute(\"Customer::City\", $value);\n }",
"public function setCity($city)\n {\n $this->city = $city;\n }",
"public function setCity( string $city )\n\t{\n\t\t$this->city = $city;\n\t}",
"public function setCity($city)\n {\n $this->city = $city;\n }",
"public function set_city(City $object)\n {\n $this->city = $object;\n $this->city_id = $object->id;\n }",
"public function setOrginCity($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->orgin_city !== $v) {\n\t\t\t$this->orgin_city = $v;\n\t\t\t$this->modifiedColumns[] = ItineraryPeer::ORGIN_CITY;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function testCanSetAndGetCity()\n {\n $mockCity = 'Corpus Christi';\n\n $this->dataCenter->setCity($mockCity);\n\n $this->assertEquals($mockCity, $this->dataCenter->getCity());\n }",
"public function test_set_address_city(){\n $this->address->setCity('Vantaa');\n $this->assertEquals($this->address->getCity(), 'Vantaa');\n }",
"public function testCanSetAndGetCity()\n {\n $mockCity = 'Corpus Christi';\n\n $this->nationalDataCenter->setCity($mockCity);\n\n $this->assertEquals($mockCity, $this->nationalDataCenter->getCity());\n }",
"private function setGeoCity($string){\n\t\t$this->set_prop('l_geo_city',trim($string));\n\t\tunset($string);\n\t}",
"public function setShippingCity()\n\t{\n\t\t// Ensure we have an argument to work with\n\t\t\t\tif (func_num_args()<1)\n\t\t{\n\t\t\t$this->error[]=\"Invalid number of arguments in function '\".__FUNCTION__.\"()'\";\n\t\t\treturn;\n\t\t}\n\t\t$value=func_get_arg(0);\n\t\t$this->shippingCity = $this->dom->createElement('city',substr($value,0,40));\n\t\treturn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Descripcion: funcion getEstados, asigna un array con datos de estados de Mexico, los guarda en la variable $this>estados | public function getEstados(){
$this->estados = array(
array('id' => 'MEX-AGS','value' => 'AGS', 'label' => 'Aguascalientes'),
array('id' => 'MEX-BCN','value' => 'BCN', 'label' => 'Baja California Norte'),
array('id' => 'MEX-BCS','value' => 'BCS', 'label' => 'Baja California Sur'),
array('id' => 'MEX-CAM','value' => 'CAM', 'label' => 'Campeche'),
array('id' => 'MEX-CHIS','value' => 'CHIS', 'label' => 'Chiapas'),
array('id' => 'MEX-CHIH','value' => 'CHIH', 'label' => 'Chihuahua'),
array('id' => 'MEX-COAH','value' => 'COAH', 'label' => 'Coahuila'),
array('id' => 'MEX-COL','value' => 'COL', 'label' => 'Colima'),
array('id' => 'MEX-DF','value' => 'DF', 'label' => 'Distrito Federal'),
array('id' => 'MEX-DGO','value' => 'DGO', 'label' => 'Durango'),
array('id' => 'MEX-GTO','value' => 'GTO', 'label' => 'Guanajuato'),
array('id' => 'MEX-GRO','value' => 'GRO', 'label' => 'Guerrero'),
array('id' => 'MEX-HGO','value' => 'HGO', 'label' => 'Hidalgo'),
array('id' => 'MEX-JAL','value' => 'JAL', 'label' => 'Jalisco'),
array('id' => 'MEX-EDM','value' => 'EDM', 'label' => 'México - Estado de'),
array('id' => 'MEX-MICH','value' => 'MICH', 'label' => 'Michoacán'),
array('id' => 'MEX-MOR','value' => 'MOR', 'label' => 'Morelos'),
array('id' => 'MEX-NAY','value' => 'NAY', 'label' => 'Nayarit'),
array('id' => 'MEX-NL','value' => 'NL', 'label' => 'Nuevo León'),
array('id' => 'MEX-OAX','value' => 'OAX', 'label' => 'Oaxaca'),
array('id' => 'MEX-PUE','value' => 'PUE', 'label' => 'Puebla'),
array('id' => 'MEX-QRO','value' => 'QRO', 'label' => 'Querétaro'),
array('id' => 'MEX-QROO','value' => 'QROO', 'label' => 'Quintana Roo'),
array('id' => 'MEX-SLP','value' => 'SLP', 'label' => 'San Luis Potosí'),
array('id' => 'MEX-SIN','value' => 'SIN', 'label' => 'Sinaloa'),
array('id' => 'MEX-SON','value' => 'SON', 'label' => 'Sonora'),
array('id' => 'MEX-TAB','value' => 'TAB', 'label' => 'Tabasco'),
array('id' => 'MEX-TAMPS','value' => 'TAMPS', 'label' => 'Tamaulipas'),
array('id' => 'MEX-TLAX','value' => 'TLAX', 'label' => 'Tlaxcala'),
array('id' => 'MEX-VER','value' => 'VER', 'label' => 'Veracruz'),
array('id' => 'MEX-YUC','value' => 'YUC', 'label' => 'Yucatán'),
array('id' => 'MEX-ZAC','value' => 'ZAC', 'label' => 'Zacatecas'),
);
} | [
"private function getEstados(){\n\n\t\t//Solicita os dados dos idiomas\n\t\t$recordset = $this->Delegator('ConcreteCadastro', 'getEstados');\n\t\t\n\t\t//Associa os dados na view\n\t\t$this->View()->assign('estados',$recordset);\n\t}",
"public function getEstados()\n {\n //Retorna os dados dos Contatoss\n return TableFactory::getInstance('CepUf')->getEstados();\n }",
"public function getEstadosVinculados() {\n \n $oDaoCadEnderEstado = new cl_cadenderestado();\n $sWhereCadEnderEstado = \"db71_cadenderpais = {$this->getSequencial()}\";\n $sSqlCadEnderEstado = $oDaoCadEnderEstado->sql_query(null, \"db71_sequencial\", \"db71_sequencial\", $sWhereCadEnderEstado);\n $rsCadEnderEstado = $oDaoCadEnderEstado->sql_record($sSqlCadEnderEstado);\n $iTotalCadEnderEstado = $oDaoCadEnderEstado->numrows;\n \n if ($iTotalCadEnderEstado > 0) {\n \n for ($iContador = 0; $iContador < $iTotalCadEnderEstado; $iContador++) {\n \n $iCadEnderEstado = db_utils::fieldsMemory($rsCadEnderEstado, $iContador)->db71_sequencial;\n $oEstado = new Estado($iCadEnderEstado);\n $this->aEstados[] = $oEstado;\n }\n }\n \n return $this->aEstados;\n }",
"public function get_estados()\n {\n // loads the associated object\n if (empty($this->estados))\n $this->estados = new estados($this->estados_servico);\n \n // returns the associated object\n return $this->estados;\n }",
"public function selecionarEstados() {\n $estados = array();\n $conexao = getDatabaseConnection();\n $result = $conexao->query(\"SELECT * FROM tbl_estado\");\n while ($data = $result->fetch_array()) {\n $estados[] = $data;\n }\n \n $conexao->close();\n return $estados;\n }",
"public function getArrayEstados()\n {\n $estados= $this->getEntityManager()\n ->createQuery('SELECT e.id, e.estado \n FROM SisproBundle:Estado e \n ORDER BY e.estado ASC')\n ->getResult();\n \n if (count($estados)==0) return array('0'=>'');\n \n $a=array('0'); $b=array('[Seleccione]');\n \n foreach ($estados as $fila)\n {\n array_push($a,$fila['id']);\n array_push($b,$fila['estado']);\n } \n $estados=array_combine($a,$b);\n //ksort($estados); \n return $estados;\n }",
"public function setListadoestanterialibres() {\n global $conexion;\n $orden = \"SELECT * FROM estanteria WHERE lejasocupadas<nlejas\";\n $resultado = $conexion->query($orden);\n if ($resultado->num_rows > 0) {\n $fila = $resultado->fetch_array();\n $array = array();\n while ($fila) {\n $estanteria = new estanteria($fila['codigo'], $fila['nlejas'], $fila['lejasocupadas'], $fila['numero'], $fila['pasillo'], $fila['material']);\n $estanteria->setId($fila['id']);\n array_push($array, $estanteria);\n\n $fila = $resultado->fetch_array();\n }\n return $array;\n } else {\n return null;\n }\n $conexion->close();\n }",
"public function getEstados()\n {\n return [\n 'En revisión' => 'En revisión',\n 'Aceptado' => 'Aceptado',\n 'Rechazado' => 'Rechazado',\n 'Solucionado' => 'Solucionado',\n ];\n }",
"function get_all_estudiantes(){\n $estudiantes = $this->db->query(\n \"SELECT *\n FROM estudiante\n ORDER BY estudiante_apellidos\"\n )->result_array();\n return $estudiantes;\n }",
"function getEstadosTurno($estado=\"\"){\n\n\t\tswitch ($estado) {\n\t\t\tcase TURNO_ASIGNADO:\n\t\t\t\treturn [\n\t\t\t\t\t\t [ \"id\" => TURNO_EN_PROGRESO, \t\"nombre\" =>\t\"En progreso\" ],\n\t\t\t\t\t\t [ \"id\" => TURNO_CANCELADO, \t\"nombre\" =>\t\"Cancelado\" ] \t \n\t\t\t\t\t ];\n\t\t\t\tbreak;\n\t\t\tcase TURNO_EN_PROGRESO:\n\t\t\t\treturn [\n\t\t\t\t\t\t [ \"id\" => TURNO_EN_PROGRESO, \t\"nombre\" =>\t\"En progreso\" ],\n\t\t\t\t\t\t [ \"id\" => TURNO_CUMPLIDO, \t\t\"nombre\" =>\t\"Cumplido\" ]\n\t\t\t\t\t ];\n\t\t\t\tbreak;\n\t\t\tcase TURNO_CUMPLIDO:\n\t\t\t\treturn [\t\t\t\t\t\t \n\t\t\t\t\t\t [ \"id\" => TURNO_CUMPLIDO, \t\t\"nombre\" =>\t\"Cumplido\" ]\n\t\t\t\t\t ];\n\t\t\t\tbreak;\n\t\t\tcase TURNO_CANCELADO:\n\t\t\t\treturn [\t\t\t\t\t\t \n\t\t\t\t\t\t [ \"id\" => TURNO_CANCELADO, \t\"nombre\" =>\t\"Cancelado\" ]\n\t\t\t\t\t ];\n\t\t\t\tbreak;\t\t\t\n\t\t\tdefault:\n\t\t\t\treturn [\n\t\t\t\t\t\t [ \"id\" => TURNO_EN_PROGRESO, \t\"nombre\" =>\t\"En progreso\" ]\t \n\t\t\t\t\t ];\t\t\t\t\n\t\t}\t\n\n\n}",
"public function ObtenerEstadosFactura(){\r\n return $this->estadoFacturaRepositorio->ObtenerEstadosFactura();\r\n }",
"function estadosDoNorte() {\n\t\treturn $this->_estadosPorRegiao ( array (\n\t\t\t\t'AC',\n\t\t\t\t'AP',\n\t\t\t\t'AM',\n\t\t\t\t'PA',\n\t\t\t\t'RO',\n\t\t\t\t'RR',\n\t\t\t\t'TO' \n\t\t) );\n\t}",
"public function getEstudiantesfecha()\n\t{\n\t\treturn $this->estudiantesfecha;\n\t}",
"function getEstadosParqueo()\n{\n return array(\n array('codigo' => 'AVL', 'valor' => 'Disponible'),\n array('codigo' => 'OCP', 'valor' => 'Ocupado'),\n array('codigo' => 'RSV', 'valor' => 'Reservado'),\n );\n}",
"public function EstadosFiliados(){\n require_once('model/filiado_class.php');\n $class = new Acompanhante();\n \n $rs = $class->SelectEstadosFiliados();\n return $rs;\n \n }",
"function buscarEstudiantesInscritos() {\r\n \r\n $variablesEstudiantesInscritos = array( 'codProyecto' => $this->codProyecto,\r\n 'codEspacio'=> $this->codEspacio,\r\n 'grupo'=> $this->grupo,\r\n 'ano' => $this->ano,\r\n 'periodo' => $this->periodo);\r\n $cadena_sql = $this->sql->cadena_sql(\"buscarEstudiantesInscritos\", $variablesEstudiantesInscritos);\r\n $arreglo_estudiantesInscritos = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\r\n return $arreglo_estudiantesInscritos;\r\n }",
"public function Get_Esta()\n {\n\t\t\t$empr_id = empresa();\n\t\t\t$url = AJST.'/services/asp/ALMDataService/establecimientos/empresa/'.$empr_id;\n $array = $this->rest->callAPI(\"GET\",$url);\n $resp = json_decode($array['data']);\n return $resp->establecimientos->establecimiento;\n\t}",
"public function listaEstudianteBecasAvancemos() {\n $datos = array();\n //enlisto todas las cedulas de estudiantes becados\n $listaEstudianteBecas = $this->db->select(\"SELECT ced_estudiante, (ingreso1+ingreso2+ingreso3+ingreso4)/totalMiembros promedioIngresos \"\n . \"FROM sipce_estudiante_beca \"\n . \"WHERE annio = \" . $this->datosSistema[0]['annio_lectivo'] . \" \"\n . \"AND becaAvancemos = 1 \"\n . \"ORDER BY promedioIngresos ASC\");\n foreach ($listaEstudianteBecas as $lista => $value) {\n //Cedula\n $estudiante['ced_estudiante'] = $value['ced_estudiante'];\n\n //verifico si el estudiante posee especialidad\n $consultaEstudianteEspecialidad = $this->db->select(\"SELECT * FROM sipce_especialidad_estudiante WHERE ced_estudiante = '\" . $value['ced_estudiante'] . \"' \");\n\n if ($consultaEstudianteEspecialidad != null) {\n $resultado = $this->db->select(\"SELECT e.cedula,e.apellido1,e.apellido2,e.nombre,e.domicilio,e.telefonoCelular,eb.distancia,eb.id_consecutivo,eb.numeroRuta,\"\n . \"d.Distrito,c.Canton,pro.nombreProvincia,g.nivel,esp.nombreEspecialidad,eb.ingreso1,eb.ingreso2,eb.ingreso3,eb.ingreso4,eb.totalMiembros,eb.ced_encargadoCheque,eb.parentesco \"\n . \"FROM sipce_estudiante as e, sipce_grupos as g, sipce_distritos as d,sipce_cantones as c,sipce_provincias as pro, sipce_especialidad as esp, \"\n . \"sipce_especialidad_estudiante as ee, sipce_estudiante_beca as eb \"\n . \"WHERE e.cedula = g.ced_estudiante \"\n . \"AND e.cedula = ee.ced_estudiante \"\n . \"AND e.cedula = eb.ced_estudiante \"\n . \"AND e.cedula = '\" . $value['ced_estudiante'] . \"' \"\n . \"AND e.IdDistrito = d.IdDistrito \"\n . \"AND c.IdCanton = d.IdCanton \"\n . \"AND pro.IdProvincia = c.IdProvincia \"\n . \"AND esp.codigoEspecialidad = ee.cod_especialidad \"\n . \"AND g.annio = \" . $this->datosSistema[0]['annio_lectivo'] . \" \"\n . \"AND eb.annio = \" . $this->datosSistema[0]['annio_lectivo'] . \" \");\n if ($resultado != null) {\n $estudiante['id_consecutivo'] = $resultado[0]['id_consecutivo'];\n $estudiante['apellido1'] = $resultado[0]['apellido1'];\n $estudiante['apellido2'] = $resultado[0]['apellido2'];\n $estudiante['nombre'] = $resultado[0]['nombre'];\n $estudiante['nivel'] = $resultado[0]['nivel'];\n $estudiante['telefonoEstudiante'] = $resultado[0]['telefonoCelular'];\n $estudiante['ingreso1'] = $resultado[0]['ingreso1'];\n $estudiante['ingreso2'] = $resultado[0]['ingreso2'];\n $estudiante['ingreso3'] = $resultado[0]['ingreso3'];\n $estudiante['ingreso4'] = $resultado[0]['ingreso4'];\n $subTotal = $resultado[0]['ingreso1'] + $resultado[0]['ingreso2'] + $resultado[0]['ingreso3'] + $resultado[0]['ingreso4'];\n $descuento = $subTotal * 0.1034;\n $total = $subTotal - $descuento;\n $perCapita = round($total / $resultado[0]['totalMiembros'], 0);\n $estudiante['perCapita'] = $perCapita;\n $estudiante['totalMiembros'] = $resultado[0]['totalMiembros'];\n $estudiante['ced_encargadoCheque'] = $resultado[0]['ced_encargadoCheque'];\n $estudiante['parentesco'] = $resultado[0]['parentesco'];\n $estudiante['nombreProvincia'] = $resultado[0]['nombreProvincia'];\n $estudiante['nombreCanton'] = $resultado[0]['Canton'];\n $estudiante['nombreDistrito'] = $resultado[0]['Distrito'];\n $estudiante['direccion'] = $resultado[0]['domicilio'];\n }\n } else {\n $resultado = $this->db->select(\"SELECT e.cedula,e.apellido1,e.apellido2,e.nombre,e.domicilio,e.telefonoCelular,eb.distancia,eb.id_consecutivo,eb.numeroRuta,\"\n . \"d.Distrito,c.Canton,pro.nombreProvincia,g.nivel,eb.ingreso1,eb.ingreso2,eb.ingreso3,eb.ingreso4,eb.totalMiembros,eb.ced_encargadoCheque,eb.parentesco \"\n . \"FROM sipce_estudiante as e, sipce_grupos as g, sipce_distritos as d,sipce_cantones as c,sipce_provincias as pro, sipce_estudiante_beca as eb \"\n . \"WHERE e.cedula = g.ced_estudiante \"\n . \"AND e.cedula = eb.ced_estudiante \"\n . \"AND e.cedula = '\" . $value['ced_estudiante'] . \"' \"\n . \"AND e.IdDistrito = d.IdDistrito \"\n . \"AND c.IdCanton = d.IdCanton \"\n . \"AND pro.IdProvincia = c.IdProvincia \"\n . \"AND g.annio = \" . $this->datosSistema[0]['annio_lectivo'] . \" \");\n\n if ($resultado != null) {\n $estudiante['id_consecutivo'] = $resultado[0]['id_consecutivo'];\n $estudiante['apellido1'] = $resultado[0]['apellido1'];\n $estudiante['apellido2'] = $resultado[0]['apellido2'];\n $estudiante['nombre'] = $resultado[0]['nombre'];\n $estudiante['nivel'] = $resultado[0]['nivel'];\n $estudiante['telefonoEstudiante'] = $resultado[0]['telefonoCelular'];\n $estudiante['ingreso1'] = $resultado[0]['ingreso1'];\n $estudiante['ingreso2'] = $resultado[0]['ingreso2'];\n $estudiante['ingreso3'] = $resultado[0]['ingreso3'];\n $estudiante['ingreso4'] = $resultado[0]['ingreso4'];\n $subTotal = $resultado[0]['ingreso1'] + $resultado[0]['ingreso2'] + $resultado[0]['ingreso3'] + $resultado[0]['ingreso4'];\n $descuento = $subTotal * 0.1034;\n $total = $subTotal - $descuento;\n $perCapita = round($total / $resultado[0]['totalMiembros'], 0);\n $estudiante['perCapita'] = $perCapita;\n $estudiante['totalMiembros'] = $resultado[0]['totalMiembros'];\n $estudiante['ced_encargadoCheque'] = $resultado[0]['ced_encargadoCheque'];\n $estudiante['parentesco'] = $resultado[0]['parentesco'];\n $estudiante['nombreProvincia'] = $resultado[0]['nombreProvincia'];\n $estudiante['nombreCanton'] = $resultado[0]['Canton'];\n $estudiante['nombreDistrito'] = $resultado[0]['Distrito'];\n $estudiante['direccion'] = $resultado[0]['domicilio'];\n }\n }\n //verifico el encargado de cangear cheques\n if ($resultado != null) {\n if ($estudiante['parentesco'] == 'Padre') {\n\n $consultaEstudiantePadre = $this->db->select(\"SELECT * \n FROM sipce_padre \n WHERE ced_estudiante = '\" . $value['ced_estudiante'] . \"' \n AND ced_padre = '\" . $estudiante['ced_encargadoCheque'] . \"'\");\n if ($consultaEstudiantePadre != null) {\n //Cargo datos del padre en el array\n $estudiante['nombre_encargado'] = $consultaEstudiantePadre[0]['nombre_padre'];\n $estudiante['apellido1_encargado'] = $consultaEstudiantePadre[0]['apellido1_padre'];\n $estudiante['apellido2_encargado'] = $consultaEstudiantePadre[0]['apellido2_padre'];\n $estudiante['telefonoCelularEncargado'] = $consultaEstudiantePadre[0]['telefonoCelPadre'];\n $estudiante['telefonoCasaEncargado'] = $consultaEstudiantePadre[0]['telefonoCasaPadre'];\n }\n } elseif ($estudiante['parentesco'] == 'Madre') {\n $consultaEstudianteMadre = $this->db->select(\"SELECT * \n FROM sipce_madre \n WHERE ced_estudiante = '\" . $value['ced_estudiante'] . \"' \n AND ced_madre = '\" . $estudiante['ced_encargadoCheque'] . \"'\");\n\n if ($consultaEstudianteMadre != null) {\n //Cargo datos de la madre en el array\n $estudiante['nombre_encargado'] = $consultaEstudianteMadre[0]['nombre_madre'];\n $estudiante['apellido1_encargado'] = $consultaEstudianteMadre[0]['apellido1_madre'];\n $estudiante['apellido2_encargado'] = $consultaEstudianteMadre[0]['apellido2_madre'];\n $estudiante['telefonoCelularEncargado'] = $consultaEstudianteMadre[0]['telefonoCelMadre'];\n $estudiante['telefonoCasaEncargado'] = $consultaEstudianteMadre[0]['telefonoCasaMadre'];\n }\n } elseif ($estudiante['parentesco'] == 'Otro') {\n $consultaEstudianteEncargado = $this->db->select(\"SELECT * \n FROM sipce_encargado \n WHERE ced_estudiante = '\" . $value['ced_estudiante'] . \"' \n AND ced_encargado = '\" . $estudiante['ced_encargadoCheque'] . \"' \n AND parentesco = 'Otro'\");\n\n if ($consultaEstudianteEncargado != null) {\n //Cargo datos en un array\n $estudiante['nombre_encargado'] = $consultaEstudianteEncargado[0]['nombre_encargado'];\n $estudiante['apellido1_encargado'] = $consultaEstudianteEncargado[0]['apellido1_encargado'];\n $estudiante['apellido2_encargado'] = $consultaEstudianteEncargado[0]['apellido2_encargado'];\n $estudiante['telefonoCelularEncargado'] = $consultaEstudianteEncargado[0]['telefonoCelularEncargado'];\n $estudiante['telefonoCasaEncargado'] = $consultaEstudianteEncargado[0]['telefonoCasaEncargado'];\n }\n } else {\n //Cargo datos en un array\n $estudiante['nombre_encargado'] = null;\n $estudiante['apellido1_encargado'] = null;\n $estudiante['apellido2_encargado'] = null;\n $estudiante['telefonoCelularEncargado'] = null;\n $estudiante['telefonoCasaEncargado'] = null;\n }\n }\n $datos[] = $estudiante;\n $estudiante = \"\";\n }\n return $datos;\n }",
"public function buscar_estudiantes()\n\t{\n\t\t$area = $this->input->post('area');\n\t\t$array = explode(\",\", $area);//convertimos el estring en un array\n\t\t$fecha = date('Y-m-d');\n\t\t$anio = date('Y-00-00');\n\n\t\tif ($array[0] == 'diversificado') {\n\t\t\t$data['estudiante'] = $this->Cuadros_model->findCuadrosEstudiantesC($array[1], $fecha, $anio);\n\t\t} else {\n\t\t\t//se verifica si es el nivel básico por madurez\n\t\t\tif ($array[0] == 'básico madurez') {\n\t\t\t\t$data['estudiante'] = $this->Cuadros_model->findCuadrosEstudiantesM($array[1], $fecha, $anio);\n\t\t\t} else {//de lo contrario se carga a los estudiantes de otro nivel\n\t\t\t\t$data['estudiante'] = $this->Cuadros_model->findCuadrosEstudiantes($array[1], $fecha, $anio);\n\t\t\t}\n\n\t\t}\n\n\t\t$data['titulo'] = 'Notas Evaluacion Estudiante';\n\t\t$data['activo'] = 'notas';\n\t\t$this->load->view('plantilla/header', $data);\n\t\t$this->load->view('notas/eestudiante', $data);\n\t\t$this->load->view('plantilla/footer');\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all of the customers that are assigned this tag. | public function customers()
{
return $this->morphedByMany(App\Customer::class, 'taggable');
} | [
"protected function getAllCustomers()\n {\n return Mage::getModel('customer/customer')\n ->getCollection()\n ->addAttributeToSelect('*');\n }",
"public function getCustomers()\n {\n if (array_key_exists(\"customers\", $this->_propDict)) {\n return $this->_propDict[\"customers\"];\n } else {\n return null;\n }\n }",
"public function getCustomerCollection()\n {\n $customerCollection = $this->_customerCollection->create()\n ->addFieldToFilter('entity_id', ['neq' => $this->_walletHelper->getCustomerId()]);\n return $customerCollection;\n }",
"function getSpecificCustomers() {\n\t\treturn $this->_specificCustomers;\n\t}",
"public function getCustomerCompanies()\n {\n return $this->customerCompanies;\n }",
"public function getCustomers()\n {\n $role = Role::where('name', 'customer')->first();\n return $role->users;\n }",
"public function getCustomers()\n {\n try {\n $response = $this->api->rest(\n 'GET',\n self::CUSTOMERS_PATH\n );\n if (!empty($response) && $response->response->getstatusCode() == 200) {\n $customers = $response->body->customers;\n if (!empty($customers)) {\n $customers = json_decode(json_encode($customers), true);\n }\n }\n return $customers;\n } catch(\\Exception $e) {\n return [];\n }\n }",
"public function loadCustomerData() {\n return $this->customersController->getCustomer($this->customerId);\n }",
"public static function get_customers()\n {\n $customer = new Customer();\n $Customers = array();\n try {\n $stmt = $customer->read();\n $count = $stmt->rowCount();\n if ($count > 0) {\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n extract($row);\n $p = (object) array(\n \"CustomerID\" => (int) $CustomerID,\n \"FirstName\" => $FirstName,\n \"LastName\" => $LastName,\n \"PhoneNumber\" => $PhoneNumber,\n \"Color\" => $Color,\n \"Notes\" => $Notes,\n \"Active\" =>boolval($Active)\n );\n\n array_push($Customers, $p);\n }\n }\n BookingService::array_sort_by_column($Customers, 'FirstName', SORT_ASC);\n return $Customers;\n } catch (Exception $e) {\n throw $e;\n }\n }",
"public function getPersonalCustomers(): array\n {\n $params = [\n 'verb' => 'listcustomers',\n ];\n\n $response = $this->requester->request($params);\n $json = $this->getJson($response->body);\n\n $result = [];\n\n foreach ($json['data'] as $data) {\n $customer = new Customer($data);\n if (null !== $customer->getIdentifier()) {\n $result[] = $customer;\n }\n }\n\n return $result;\n }",
"public function getCustomerList(){\n\t\tglobal $database;\n\t\t$result = $database->query(\"SELECT * FROM customers\", null, 'FETCH_ASSOC_ALL');\n\t\treturn $result;\n\t}",
"public function listCustomers()\n {\n return $this->request('GET', '/customers');\n }",
"public function getAllCustomers(){\n\t\t$ts_uniqueArray = array();\n\t\t$sql = \"SELECT oc.email, CONCAT(oc.firstname,' ',oc.lastname) as name, oc.customer_id FROM \".DB_PREFIX.\"customer oc UNION SELECT c.email, c.name, c.customer_id FROM \".DB_PREFIX.\"ts_customers c \";\n\t\t\n\t\t$sql .= $this->TsLoader->TsHelper->getFilterData(false);\n\t\t$result = $this->db->query($sql)->rows;\n\t\tforeach ($result as $key => $value) {\n\t\t\t$ts_uniqueArray[$value['email']] = $value;\t\t\n\t\t}\n\treturn $ts_uniqueArray;\n\t\t\n\t}",
"public function GetUnprocessedCustomers()\n {\n return $this->GetCustomers(false);\n }",
"public function getSelectedCustomers()\n\t{\n\t\tif (!$this->hasSelectedCustomers()) {\n\t\t\t$customers = array();\n\t\t\tforeach ($this->getSelectedCustomersCollection() as $customer) {\n\t\t\t\t$customers[] = $customer;\n\t\t\t}\n\t\t\t$this->setSelectedCustomers($customers);\n\t\t}\n\t\treturn $this->getData('selected_customers');\n\t}",
"public function getCustomerNames()\n {\n return $this->QUOTE->getCustomerNames();\n }",
"public function get_custumers()\n\t {\n\t\t// \t\tloads the associated object\n\t\t if (empty($this->custumers))\n\t\t $this->custumers = new custumers($this->custumers_id);\n\t\t\n\t\t// \t\treturns the associated object\n\t\t return $this->custumers;\n\t}",
"public function getSelectedCustomers()\n {\n if (!$this->hasSelectedCustomers()) {\n $customers = array();\n foreach ($this->getSelectedCustomersCollection() as $customer) {\n $customers[] = $customer;\n }\n $this->setSelectedCustomers($customers);\n }\n return $this->getData('selected_customers');\n }",
"public function getCustomerNames()\n {\n return $this->DBI->getCustomerNames();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var_dump(div_11("3948601239", 1)); Division by 11 rule | function div_11($string, $debug = false) {
$result = null;
$plus = true;
$sum = 0;
$chars = str_split($string);
foreach($chars as $char) {
if($plus) {
$sum += (int)$char;
print_r($sum);
$plus = false;
}
else {
$sum -= (int)$char;
$plus= true;
}
if($debug) {
var_dump("Starting: ".$string);
var_dump("Char: ".$char);
var_dump("Sum: ".$sum);
var_dump("Plus: ".$plus);
}
}
if($sum == 0) {
$result = true;
}
else {
if(strlen(abs($sum)) > 2) {
$result = div_11($sum, $debug);
}
else {
$result = mod($sum, 11);
}
}
return $result;
} | [
"function div_13($string, $debug = false) {\n\t\n\t$result = null;\n\t\n\t$last = last_x($string, 1);\n\t$four_last = last_x_times($string, 1, 9);\n\t\n\t$front_chunk = substr($string, 0, strlen($string)-1);\n\t\n\t$result_sub = $front_chunk - $four_last;\n\t\n\tif($debug) {\n\t\tvar_dump(\"Starting: \".$string);\n\t\tvar_dump(\"Last: \".$last);\n\t\tvar_dump(\"Four times Last: \".$four_last);\n\t\tvar_dump(\"Front chunk: \".$front_chunk);\n\t\tvar_dump(\"Front chunk - Four times Last: \".$result_sub);\n\t}\n\t\n\tif($result_sub == 0) {\n\t\t$result = true;\n\t}\n\telse {\n\t\tif(strlen(abs($result_sub)) > 2) {\n\t\t\t$result = div_13($result_sub, $debug);\n\t\t}\n\t\telse {\n\t\t\t$result = mod($result_sub, 13);\n\t\t}\n\t}\n\n\treturn $result;\n}",
"public function test_division_with_a_really_large_and_precise_answer()\n {\n $result = Math::divide('1000000000000000', '3', 9);\n $this->assertSame('333333333333333.333333333', $result);\n }",
"function gmp_divexact($n, $d)\n{\n}",
"function DVModulo11($strValor) {\n\n $intSoma = 0;\n $bytMultiplicador = 2;\n\n for ($i = strlen($strValor) -1; $i >= 0; $i--) {\n $intSoma += substr($strValor, $i, 1) * $bytMultiplicador;\n\n if ($bytMultiplicador++ == 9) $bytMultiplicador = 2;\n\n }\n\n $intDigito = $intSoma % 11;\n\n if ($intDigito == 10) {\n $intDigito = 1;\n\n } else if ($intDigito == 1 || $intDigito == 0) {\n $intDigito = 0;\n\n } else {\n $intDigito = 11 - $intDigito;\n }\n\n return $intDigito;\n\n}",
"function isSumDivides($N) \r\n{ \r\n $temp = $N; \r\n \r\n $sum = 0; \r\n \r\n // Calculate sum of all of \r\n // digits of N \r\n while ($temp) \r\n { \r\n $sum += $temp % 10; \r\n $temp = (int)$temp / 10; \r\n } \r\n \r\n if ($N % $sum == 0) \r\n return 1; \r\n else\r\n return 0; \r\n}",
"function digitoVerificador($num){\n\t $resto = modulo11($num,9,1);\n\t $digito = 11 - $resto;\n return ($digito > 9) ? 0 : $digito;\n}",
"function div($num1, $num2){\n return $num1 / $num2;\n}",
"public function testMod11Method()\n {\n $this->assertTrue(Utils::mod11('1912763608957'));\n }",
"function intdiv_alt($a, $b){\n return ($a - $a % $b) / $b;\n}",
"function bcdiv ($left_operand, $right_operand, $scale = null) {}",
"function bc_div ($left_operand, $right_operand, $scale = null)\n{\n return bcdiv($left_operand, $right_operand, $scale);\n}",
"function division($a, $b) { \n\tif($b == 0) return 0;\n\treturn $a/$b;\n}",
"public function divide($number);",
"function div_odd($string, $divisor, $debug = false) {\n\n\t\t// Defaults\n\t\t$factor = null; // Factor\n\t\t$m = null;\n\t\t$t = null;\n\n\t\t//Resolve q\n\t\t$q = last_x($string, 1);\n\n\t\t//Resolve t\n\t\t$t = substr($string, 0, strlen($string)-1);\n\n\t\t// Divisor last int for Factor mapping\n\t\t$divisor_last_int = last_x($divisor, 1);\n\n\t\t// Factor mapping\n\t\tswitch($divisor_last_int) {\n\t\t\tcase 1: $factor = 9; break;\n\t\t\tcase 3: $factor = 3; break;\n\t\t\tcase 7: $factor = 7; break;\n\t\t\tcase 9: $factor = 1; break;\n\t\t\tdefault: $factor = null; break;\n\t\t}\n\n\t\t//Resolve m\n\t\t$m = (($divisor * $factor) + 1)/10;\n\n\t\t$res = ($m * $q) + $t;\n\n\t\t// Debugging\n\t\tif($debug) {\n\t\t\tvar_dump(\"D: \".$divisor);\n\t\t\tvar_dump(\"Q: \".$q);\n\t\t\tvar_dump(\"M: \".$m);\n\t\t\tvar_dump(\"T: \".$t);\n\t\t\tvar_dump(\"R: \".$res);\n\t\t}\n\n\t\tif(strlen($res) > strlen($divisor)+1) {\n\t\t\t//Recursion\n\t\t\t$result = self::div_odd($res, $divisor, $debug);\n\t\t}\n\t\telse {\n\t\t\t//Mod limit 2^32 = 4.294.967.296\n\t\t\t$result = mod($res, $divisor);\n\t\t}\n\t\treturn $result;\n\t}",
"function div2($a, $b){\r\n return $a/$b;\r\n }",
"function pe028(){\r\n\r\n// $s=$a=$b=$c=$d=0;\r\n// for($n=1;$n<1001/2;$n+=1){\r\n// $a=4*$n*$n-2*$n+1; // 3\r\n// $b=4*$n*$n+0*$n+1; // 5\r\n// $c=4*$n*$n+2*$n+1; // 7\r\n// $d=4*$n*$n+4*$n+1; // 9\r\n// $s+=$a+$b+$c+$d;\r\n// }\r\n// echo \"s:$s\\n\";\r\n\r\n$s=$a=0;\r\nfor($n=1;$n<1001/2;$n+=1){\r\n$a=16*$n*$n+4*$n+4; // 4(4n^2+n+1)\r\n$s+=$a;\r\n}\r\necho \"s:$s\\n\";\r\n\r\n$s=0;\r\n$n=(int)(1001/2);\r\n$s=(16*$n*$n*$n+30*$n*$n+26*$n)/3;\r\necho \"s:$s\\n\";\r\n\r\n}",
"function findDigits($n)\n{\n $temp = $n;\n $digits = [];\n $divisibleCount = 0;\n for ($i = 0; $i < strlen($n); $i++) {\n $digits[] = $temp % 10;\n $temp = $temp / 10;\n }\n for ($i = 0; $i < count($digits); $i++) {\n if ($digits[$i] && $n % $digits[$i] == 0) {\n $divisibleCount++;\n }\n }\n return $divisibleCount;\n}",
"function mod10($id) {\n\t\tif (!ctype_digit($id))\n\t\t\treturn FALSE;\n\t\t$id=strrev($id);\n\t\t$sum=0;\n\t\tfor ($i=0,$l=strlen($id);$i<$l;++$i)\n\t\t\t$sum+=$id[$i]+$i%2*(($id[$i]>4)*-4+$id[$i]%5);\n\t\treturn !($sum%10);\n\t}",
"function _safe_divide($x, $y)\n {\n if (MATH_BIGINTEGER_BASE === 26) {\n return (int) ($x / $y);\n }\n\n // MATH_BIGINTEGER_BASE === 31\n return ($x - ($x % $y)) / $y;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Devuelve los id_sorteos activos | public function getSorteos(){
//Preparacion del query
$sql = "SELECT id_sorteo FROM `sorteos` WHERE status=1 AND zodiacal = 0";
// echo $sql;
return $this->vConexion->ExecuteQuery($sql);
} | [
"public function getSorteoId()\r\n {\r\n return $this->sorteo_id;\r\n }",
"public function sortIdejaAktuelno() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $idejaModel=new IdejaModel();\n $ideje=$idejaModel->dohvati_najaktuelnije_ideje(); \n $data['ideje']=$ideje;\n $this->prikaz('pregled_ideja', $data); \n }",
"public function GetSorteos(){\r\n\t\t\r\n\t\t//Preparacion del query\r\n\t\t$sql = \"SELECT * FROM sorteos WHERE status = 1 ORDER BY hora_sorteo , zodiacal, nombre_sorteo ASC \";\r\n\t\t$sql = \"SELECT * FROM sorteos WHERE id_turno =1 AND STATUS =1 ORDER BY id_loteria, zodiacal, nombre_sorteo ASC \"; \r\n\t\treturn $this->vConexion->ExecuteQuery($sql);\r\n\t}",
"function listeSorts($typeSort=array(), $sous_typeSort =array(), $typeMagie=1) {\r\n\t\t\tglobal $liste_type_cible;\r\n\t\t\tglobal $liste_pis_actions;\r\n\t\t\tglobal $liste_pas_actions;\r\n\t\t\tglobal $db;\r\n\t\t\t$SQL= \"Select T1.id_clef as idselect, \";\r\n\t\t\t$SQL.=\"concat(concat(concat(concat(concat(concat(concat(concat(concat(\";\r\n\t\t\t$SQL.=\"concat(concat(concat(concat(T1.id_clef,'-'),T2.nom),'-'),T2.sous_type)\";\r\n\t\t\t$SQL.=\",'(Cout en PA '), case when T2.coutpa is null then '\".$liste_pas_actions[\"Magie\"].\"' else T2.coutpa end), \r\n\t\t\t', Cout en PI '), case when T2.coutpi is null then '\".$liste_pis_actions[\"Magie\"].\"' else T2.coutpi end),\r\n\t\t\t', Cout en PO '), T2.coutpo),', Cout en PV '), T2.coutpv), ')')\";\r\n\t\t\t$SQL.=\" as labselect \".\r\n\t\t\t//T1.id_clef, '-' ) , T2.nom ) , '-' ) , T2.sous_type ) \r\n\t\t\t//, '(Cout en PA' ) , T2.coutpa ) , ', Cout en PI' ) , T2.coutpi ) , ')' ) AS labselect\r\n\t\t\t\" from \".NOM_TABLE_PERSOMAGIE.\" T1, \".NOM_TABLE_MAGIE.\" T2 \".\r\n\t\t\t\" WHERE T1.id_magie = T2.id_magie AND T1.id_perso = \".$this->ID;\r\n\t\t\tif ($typeSort <>array())\t{\r\n\t\t\t\t $SQL.=\" AND ( T2.type = '\".$typeSort[0].\"'\";\r\n\t\t\t\t$i=1;\r\n\t\t\t\twhile ($i<count($typeSort)) {\r\n\t\t\t\t \t$SQL.= \" OR T2.type = '\".$typeSort[$i].\"'\";\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\t\r\n\t\t\t\t \r\n\t\t\t\t $SQL.=\" )\";\r\n\t\t\t}\t \r\n\r\n\t\t\tif ($sous_typeSort <>array())\t{\r\n\t\t\t\t\r\n\t\t\t\t $SQL.=\" AND ( T2.sous_type = '\".$sous_typeSort[0].\"'\";\r\n\t\t\t\t$i=1;\r\n\t\t\t\twhile ($i<count($sous_typeSort)) {\r\n\t\t\t\t \t$SQL.= \" OR T2.sous_type = '\".$sous_typeSort[$i].\"'\";\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\t\r\n\t\t\t\t \r\n\t\t\t\t $SQL.=\" )\";\r\n\t\t\t}\r\n\r\n\t\t\tswitch($typeMagie) {\r\n\t\t\t\tcase 1:\t \t\t\r\n\t\t\t\t\t$SQL.=\" and sortdistant =0 and (typecible =1 or typecible =3)\" ;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\t \t\t\r\n\t\t\t\t\t$SQL.=\" and typecible=2\";\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t\tcase 3:\t \t\t\r\n\t\t\t\t\t$SQL.=\" and sortdistant =1 and (typecible =1)\";\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t}\t\t\t\t\t\t\t\r\n\r\n\t\t\treturn $SQL;\r\n\t\t}",
"public function GetSorteos(){\r\n\r\n\t\t//Preparacion del query\r\n\t\t$sql = \"SELECT * FROM sorteos WHERE status = 1 ORDER BY zodiacal, hora_sorteo, nombre_sorteo ASC \";\r\n\t\treturn $this->vConexion->ExecuteQuery($sql);\r\n\t}",
"public function setOrderBy();",
"public function changeSmartphoneSortingAction(){\n\t\t$smartphoneContents = $this->smartphoneContentRepository->findAllRecordsInPidSortedByDefaultSorting(t3lib_div::GPVar('id'));\n\n\t\t$tx_t3mobile_web_t3mobilemodule1 = t3lib_div::_GP('tx_t3mobile_web_t3mobilemodule1');\n\t\t$i = 0;\n\t\tforeach ($smartphoneContents as $smartphoneContent){\n\t\t\t$smartphoneContent->setSmartphoneSorting($tx_t3mobile_web_t3mobilemodule1['sortingArray'][$i]);\n\t\t\t$i ++;\n\t\t}\n\t\t$this->redirect('admin');\n\t}",
"public function sortPredvidjanjeNajteze() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_najteza_predvidjanja(); \n $data['predvidjanja']=$predvidjanja;\n $this->prikaz('pregled_predvidjanja', $data); \n }",
"public function sortPredvidjanjeNovo() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_najnovija_predvidjanja(); \n $data['predvidjanja']=$predvidjanja;\n $this->prikaz('pregled_predvidjanja', $data); \n }",
"function SetUpSortOrder() {\r\n\r\n\t\t// Check for \"order\" parameter\r\n\t\tif (@$_GET[\"order\"] <> \"\") {\r\n\t\t\t$this->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\r\n\t\t\t$this->CurrentOrderType = @$_GET[\"ordertype\"];\r\n\t\t\t$this->UpdateSort($this->id_matricula); // id_matricula\r\n\t\t\t$this->UpdateSort($this->id_afiliado); // id_afiliado\r\n\t\t\t$this->UpdateSort($this->tipo_matri); // tipo_matri\r\n\t\t\t$this->UpdateSort($this->id_plan); // id_plan\r\n\t\t\t$this->UpdateSort($this->valor_matri); // valor_matri\r\n\t\t\t$this->UpdateSort($this->valor_men_matri); // valor_men_matri\r\n\t\t\t$this->UpdateSort($this->conv_matri); // conv_matri\r\n\t\t\t$this->UpdateSort($this->id_empleado); // id_empleado\r\n\t\t\t$this->UpdateSort($this->doc4_matri); // doc4_matri\r\n\t\t\t$this->setStartRecordNumber(1); // Reset start position\r\n\t\t}\r\n\t}",
"function my_edit_dane_demograficzne_load() {\n\tadd_filter( 'request', 'my_sort_dane_demograficzne' );\n}",
"function GetSorteobyDia($id_sorteo){\r\n\t\t//AND id_dias_semana LIKE '%\".date(\"w\").\"%'\r\n\t\t$sql = \"SELECT id_loteria, id_tipo_sorteo FROM sorteos WHERE id_dias_semana LIKE '%\".date(\"w\").\"%' AND id_sorteo=\".$id_sorteo;\r\n\t\t$result= $this->vConexion->ExecuteQuery($sql);\r\n\t\t$numero=$this->vConexion->GetNumberRows($result);\r\n\t\tif($numero<1)\r\n\t\treturn 0;\r\n\t\telse\r\n\t\treturn 1;\r\n\t\t//$id_tipo_sorteo= $row[\"id_tipo_sorteo\"];\r\n\t\t\t\r\n\t}",
"public function listarAvionSel(){\n $sql=\"SELECT id,placa from avion where estado='disponible'\";\n $this->objCon->Execute($sql);\n }",
"public function setSort()\r {\r if ($this->sortAttribute !== false) {\r $sortAttribute = $this->sortAttribute;\r foreach ($this->models as $index => $model) {\r $model->$sortAttribute = $index;\r }\r }\r }",
"public function getSortMenu();",
"function LoadSortOrder() {\n\t\tglobal $rpt_booking;\n\t\t$sOrderBy = $rpt_booking->getSessionOrderBy(); // Get order by from Session\n\t\tif ($sOrderBy == \"\") {\n\t\t\tif ($rpt_booking->SqlOrderBy() <> \"\") {\n\t\t\t\t$sOrderBy = $rpt_booking->SqlOrderBy();\n\t\t\t\t$rpt_booking->setSessionOrderBy($sOrderBy);\n\t\t\t\t$rpt_booking->arrival->setSort(\"ASC\");\n\t\t\t\t$rpt_booking->kode->setSort(\"ASC\");\n\t\t\t}\n\t\t}\n\t}",
"public function sortir_new(){\r\n\t\tglobal $conn;\r\n\t\t$query =$conn->prepare(\"INSERT INTO sortir(id_films,type_sortie_films, date_sortie) VALUES (:id_films,:type_sortie_films,:date_sortie)\");\r\n\t\t$query->execute(array(\"id_films\" =>$this->id_films, \"type_sortie_films\" =>$this->type_sortie_films, \"date_sortie\" =>$this->date_sortie));\r\n\t}",
"function reorder() {\n\t\tglobal $wpdb;\n\t\tparse_str($_REQUEST['sort'], $sort);\n\t\tif(empty($sort['textbin'])) return false;\n\t\tforeach($sort['textbin'] as $ord => $id) {\n\t\t\t$item = $this->read($id, 'ID');\n\t\t\tif($item) {\n\t\t\t\t$update = \"UPDATE {$this->table_name} SET ord=$ord WHERE id={$item->ID}\";\n\t\t\t\t$wpdb->query($update);\n\t\t\t}\n\t\t}\n\t\tdie();\n\t}",
"private function get_row_action_sort_order()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test cases for ::testNodeStatusActions. | public function nodeStatusActionsTestCases() {
return [
'Moderated bundle shows warning (publish action)' => [
'node_publish_action',
'moderated_bundle',
TRUE,
// If the node starts out unpublished, the action should not work.
FALSE,
FALSE,
],
'Moderated bundle shows warning (unpublish action)' => [
'node_unpublish_action',
'moderated_bundle',
TRUE,
// If the node starts out published, the action should not work.
TRUE,
TRUE,
],
'Normal bundle works (publish action)' => [
'node_publish_action',
'standard_bundle',
FALSE,
// If the node starts out unpublished, the action should work.
FALSE,
TRUE,
],
'Normal bundle works (unpublish action)' => [
'node_unpublish_action',
'standard_bundle',
FALSE,
// If the node starts out published, the action should work.
TRUE,
FALSE,
],
];
} | [
"public function testNodeStatus() {\n $this->assertCount(2, $this->items, '2 nodes in the index.');\n $this->processor->preprocessIndexItems($this->items);\n $this->assertCount(1, $this->items, 'An item was removed from the items list.');\n $published_nid = 'entity:node' . IndexInterface::DATASOURCE_ID_SEPARATOR . '2:en';\n $this->assertTrue(isset($this->items[$published_nid]), 'Correct item was removed.');\n }",
"public function testReplaceCoreV1NodeStatus()\n {\n\n }",
"public function testRetrieveNodeStatus()\n {\n // stub `get http client` method from `client` mock\n $this->client->expects($this->once())\n ->method('getHttpClient')\n ->will($this->returnValue($this->httpClient));\n\n // mock `response`\n $response = $this->createMock('\\GuzzleHttp\\Psr7\\Response');\n\n // stub `get` method from `http client` mock\n $this->httpClient->expects($this->once())\n ->method('get')\n ->with(\n $this->equalTo('/status?'),\n $this->equalTo(['Content-Type' => 'application/x-www-form-urlencoded'])\n )\n ->will($this->returnValue($response));\n\n $node = new Node($this->client);\n $node->retrieveNodeStatus();\n }",
"public function testTestStatus()\n {\n // create review record for change 1\n $this->createChange();\n $review = Review::createFromChange('1')->save();\n\n // ensure starting test status of null.\n $this->assertSame($review->get('testStatus'), null);\n\n // dispatch and check output\n $this->dispatch('/reviews/2/tests/fail/' . $review->getToken());\n $result = $this->getResult();\n $review = Review::fetch(2, $this->p4);\n $this->assertRoute('review-tests');\n $this->assertResponseStatusCode(200);\n $this->assertSame(true, $result->getVariable('isValid'));\n $this->assertSame('fail', $review->get('testStatus'));\n }",
"public function testPingTreeUpdateTargets()\n {\n }",
"public function testGetStatus()\n {\n $status = new EvangelistStatus(\"andela-vdugeri\");\n\n $noOfRepo = $status->getNumberOfRepos();\n $result = $status->getStatus();\n\n if ($noOfRepo < 5) {\n $this->assertRegexp('/Prodigal Evangelist/', $result);\n } elseif ($noOfRepo >= 5 && $noOfRepo <= 10) {\n $this->assertRegexp('/Junior Evangelist/', $result);\n } elseif ($noOfRepo >= 11 && $noOfRepo <= 20) {\n $this->assertRegexp('/Associate Evangelist/', $result);\n } elseif ($noOfRepo > 20) {\n $this->assertRegexp('/Senior Evangelist/', $result);\n }\n }",
"public function testPingTreeTargetGetCurrentCounts()\n {\n }",
"public function testGetNodeEventLog()\n {\n }",
"public function testRTRCheckCommandStatus()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testStatus() {\n $response = $this->runApp('GET', '/status');\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertStringContainsString('responseStatus', (string) $response->getBody());\n $this->assertStringContainsString('success', (string) $response->getBody());\n $this->assertStringContainsString('version', (string) $response->getBody());\n $this->assertStringContainsString('time', (string) $response->getBody());\n $this->assertStringContainsString('db', (string) $response->getBody());\n $this->assertStringNotContainsString('ERROR', (string) $response->getBody());\n $this->assertStringNotContainsString('Failed', (string) $response->getBody());\n }",
"public function testGetContentmanagementStatusStatusId()\n {\n }",
"public function testPingTreeTargetResetCount()\n {\n }",
"public function testPingTreeResetCount()\n {\n }",
"public function testStatuses() {\n $tasks = $this->CI->tasks->all();\n $complete = $this->getStatusCount($tasks, 2);\n $incomplete = $this->getStatusCount($tasks, 1);\n \n $this->assertGreaterThan($complete, $incomplete);\n \n }",
"public function testPingTreeTargetPost()\n {\n }",
"public function testUserStatus()\n {\n }",
"public function testStatusReport() {\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('admin/reports/status');\n\n $this->assertText('Scheduler Time Check');\n $this->assertText('In most cases the server time should match Coordinated Universal Time (UTC) / Greenwich Mean Time (GMT)');\n\n $admin_regional_settings = Url::fromRoute('system.regional_settings');\n $this->assertLink('changed by admin users');\n $this->assertLinkByHref($admin_regional_settings->toString());\n\n $account_edit = Url::fromRoute('entity.user.edit_form', ['user' => $this->adminUser->id()]);\n $this->assertLink('user account');\n $this->assertLinkByHref($account_edit->toString());\n }",
"public function test_is_status_valid()\n {\n $this->assertTrue($this->invoke_is_status_valid(Request::STATUS_OK));\n }",
"public function testDeleteNodes()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Testing of RequestParser interceptor | public function testParserOnPreParse()
{
$provider = new RequestProvider('{"jsonrpc": "2.0", "method": "User.getOne", "params": {"id": 999}, "id": 10}');
$server = new Server();
$server->setRequestProvider($provider);
// Add custom mapper
$mapper = new Mapper();
$server->setMapper($mapper);
$server->getRequestParser()->onPreParse()
->add(Interceptor::createWith(function (ParserContainer $container) {
$parser = $container->getParser();
$request = $container->getValue();
$request['params']['id'] = 777;
return new ParserContainer($parser, $request);
}));
// Create instance of handlers
$repository = new UserRepository();
$response = $server->addHandler($repository)->execute();
$this->assertEquals('{"jsonrpc":"2.0","result":{"id":777,"email":"unknown@empire.com","name":"unknown"},"id":10}', $response);
} | [
"public function testJsonRequestParser()\n {\n $request = Request::create(\n '/test',\n 'POST',\n [],\n [],\n [],\n ['CONTENT_TYPE' => 'application/json'],\n '{\"key1\":\"value1\",\"key2\":\"value2\"}'\n );\n\n $app = new Application();\n $app['request'] = $request;\n $app->register(new JsonRequestParser());\n $app->post('/test', function () { return 'test'; });\n $result = $app->handle($app['request']);\n\n $this->assertEquals('value1', $app['request']->request->get('key1'));\n $this->assertEquals('value2', $app['request']->request->get('key2'));\n $this->assertEquals('test', $result->getContent());\n }",
"public function createRequestParser();",
"public function processTestingRequest() {\n\n $this->request = RestUtility::processRequest(false);\n $this->post = $this->request->getRequestVars();\n\n $this->checkAuthentication();\n $this->handleEndpoint();\n //$this->handleResponse();\n }",
"public function parseRequest($request);",
"abstract protected function parse_request();",
"public function testReaderRequestKey()\n {\n $listener = $this\n ->getMockBuilder(RedirectListener::class)\n ->onlyMethods(['_request'])\n ->disableoriginalConstructor()\n ->getMock();\n\n $listener->setup();\n\n $subject = new Subject();\n $request = (new ServerRequest())->withParam('action', 'index');\n\n $listener->expects($this->any())->method('_request')->will($this->returnValue($request));\n\n $reader = $listener->reader('request.key');\n $result = $reader($subject, 'action');\n $this->assertEquals('index', $result);\n\n $result = $reader($subject, 'something_wrong');\n $this->assertNull($result);\n }",
"public function testPostRequestDetails()\n {\n }",
"public function testReaderRequestQuery()\n {\n $listener = $this\n ->getMockBuilder(RedirectListener::class)\n ->onlyMethods(['_request'])\n ->disableoriginalConstructor()\n ->getMock();\n\n $listener->setup();\n\n $subject = new Subject();\n $request = (new ServerRequest())->withQueryParams(['hello' => 'world']);\n\n $listener->expects($this->any())->method('_request')->will($this->returnValue($request));\n\n $reader = $listener->reader('request.query');\n $result = $reader($subject, 'hello');\n $this->assertEquals('world', $result);\n\n $result = $reader($subject, 'something_wrong');\n $this->assertNull($result);\n }",
"public function testRequestToken()\n {\n }",
"public function testParseFailureWithRequestModifiers()\n {\n $parser = new Parser();\n $parseContext = new ParseContext();\n $parseResult = $parser->parse(\n FilePath::parse('foo.webunit'),\n [\n 'with-post-parameter Foo=Bar',\n '',\n 'put https://example.com/',\n 'with-post-parameter',\n ' with-post-parameter Foo ',\n 'With-post-parameter =',\n ' with-post-parameter = Bar ',\n 'with-post-file',\n ' With-Post-File Foo',\n ' With-Post-File =',\n 'with-post-file = Bar',\n \"with-post-file File = F\\0oo\",\n 'with-post-file File1=' . str_replace('\\\\', '\\\\\\\\', __DIR__) . '/../Helpers/TestFiles/not-found.txt',\n '',\n 'GET https://example.com/',\n 'with-post-parameter Foo=Bar',\n 'with-post-file File1=' . str_replace('\\\\', '\\\\\\\\', __DIR__) . '/../Helpers/TestFiles/helloworld.txt',\n '',\n 'POST https://example.com/',\n ' With-raw-content ',\n '',\n 'get https://example.com/',\n 'with-raw-content <Foo>Bar</Foo>',\n 'With-Header',\n ' with-header Foo',\n 'with-header :Bar',\n ],\n $parseContext,\n );\n $testSuite = $parseResult->getTestSuite();\n $testCases = $testSuite->getTestCases();\n $parseErrors = $parseResult->getParseErrors();\n\n self::assertSame(4, count($testCases));\n self::assertSame('https://example.com/', $testCases[0]->getUrl()->__toString());\n self::assertSame(1, count($testCases[0]->getAsserts()));\n self::assertInstanceOf(DefaultAssert::class, $testCases[0]->getAsserts()[0]);\n self::assertSame('https://example.com/', $testCases[1]->getUrl()->__toString());\n self::assertSame(1, count($testCases[1]->getAsserts()));\n self::assertInstanceOf(DefaultAssert::class, $testCases[1]->getAsserts()[0]);\n self::assertSame('https://example.com/', $testCases[2]->getUrl()->__toString());\n self::assertSame(1, count($testCases[2]->getAsserts()));\n self::assertInstanceOf(DefaultAssert::class, $testCases[2]->getAsserts()[0]);\n self::assertSame('https://example.com/', $testCases[3]->getUrl()->__toString());\n self::assertSame(1, count($testCases[3]->getAsserts()));\n self::assertInstanceOf(DefaultAssert::class, $testCases[3]->getAsserts()[0]);\n\n self::assertSame(18, count($parseErrors));\n self::assertSame('foo.webunit:1: Undefined test case: Test case is not defined for request modifier \"with-post-parameter\".', $parseErrors[0]->__toString());\n self::assertSame('foo.webunit:4: Missing argument: Missing parameter name and value for request modifier \"with-post-parameter\".', $parseErrors[1]->__toString());\n self::assertSame('foo.webunit:5: Missing argument: Missing parameter value for request modifier \"with-post-parameter\".', $parseErrors[2]->__toString());\n self::assertSame('foo.webunit:6: Missing argument: Missing parameter name for request modifier \"with-post-parameter\".', $parseErrors[3]->__toString());\n self::assertSame('foo.webunit:7: Missing argument: Missing parameter name for request modifier \"with-post-parameter\".', $parseErrors[4]->__toString());\n self::assertSame('foo.webunit:8: Missing argument: Missing parameter name and value for request modifier \"with-post-file\".', $parseErrors[5]->__toString());\n self::assertSame('foo.webunit:9: Missing argument: Missing parameter value for request modifier \"with-post-file\".', $parseErrors[6]->__toString());\n self::assertSame('foo.webunit:10: Missing argument: Missing parameter name for request modifier \"with-post-file\".', $parseErrors[7]->__toString());\n self::assertSame('foo.webunit:11: Missing argument: Missing parameter name for request modifier \"with-post-file\".', $parseErrors[8]->__toString());\n self::assertSame(\"foo.webunit:12: Invalid argument: File path \\\"F\\0oo\\\" is not valid for request modifier \\\"with-post-file\\\".\", $parseErrors[9]->__toString());\n self::assertSame('foo.webunit:13: Invalid argument: File \"' . __DIR__ . '/../Helpers/TestFiles/not-found.txt\" was not found for request modifier \"with-post-file\".', $parseErrors[10]->__toString());\n self::assertSame('foo.webunit:16: Invalid request modifier: Request modifier \"with-post-parameter\" is not allowed for request method \"GET\".', $parseErrors[11]->__toString());\n self::assertSame('foo.webunit:17: Invalid request modifier: Request modifier \"with-post-file\" is not allowed for request method \"GET\".', $parseErrors[12]->__toString());\n self::assertSame('foo.webunit:20: Missing argument: Missing content for request modifier \"with-raw-content\".', $parseErrors[13]->__toString());\n self::assertSame('foo.webunit:23: Invalid request modifier: Request modifier \"with-raw-content\" is not allowed for request method \"GET\".', $parseErrors[14]->__toString());\n self::assertSame('foo.webunit:24: Missing argument: Missing header name and value for request modifier \"with-header\".', $parseErrors[15]->__toString());\n self::assertSame('foo.webunit:25: Missing argument: Missing header value for request modifier \"with-header\".', $parseErrors[16]->__toString());\n self::assertSame('foo.webunit:26: Missing argument: Missing header name for request modifier \"with-header\".', $parseErrors[17]->__toString());\n\n self::assertFalse($parseResult->isSuccess());\n }",
"public function testReplaceHTTPRequestRule()\n {\n }",
"public function test_getTagRequest() {\n\n }",
"public function testGetTokenRequestor()\n {\n }",
"public function testCustomArgsDetector(): void\n {\n $request = new ServerRequest();\n $request->addDetector('controller', function ($request, $name) {\n return $request->getParam('controller') === $name;\n });\n\n $request = $request->withParam('controller', 'cake');\n $this->assertTrue($request->is('controller', 'cake'));\n $this->assertFalse($request->is('controller', 'nonExistingController'));\n $this->assertTrue($request->isController('cake'));\n $this->assertFalse($request->isController('nonExistingController'));\n }",
"public function interceptRequest(HttpRequest $request);",
"public function setUp()\n {\n $this->interceptor = new XhrParamsInterceptor();\n }",
"public function testRequestUri() {\n $parser = new Parser();\n $request = new Request();\n\n $parser->request($request);\n\n $this->assertNull($parser->requestUri());\n $this->assertEquals('first', $parser->requestUri('first'));\n $this->assertEquals('first', $parser->requestUri());\n $this->assertEquals('second', $parser->requestUri('second'));\n $this->assertEquals('second', $parser->requestUri());\n }",
"public function testFromRequestHeader() {\n\t\t$test_header = 'OAuth realm=\"\",oauth_foo=bar,oauth_baz=\"blargh\"';\n\t\tself::build_request('POST', 'http://testbed/test', array(), $test_header);\n\n\t\t$request = Auth_OAuth_RequestImpl::fromRequest();\n\n\t\t$this->assertEquals('POST', $request->getMethod());\n\t\t$this->assertEquals('http://testbed/test', $request->getRequestUrl());\n\t\t$this->assertEquals(array('oauth_foo'=>'bar','oauth_baz'=>'blargh'), $request->getParameters(), 'Failed to split auth-header correctly');\n\t}",
"public function testMiddlewareIsProcessed()\n {\n $response = $this->getMockBuilder(ResponseInterface::class)\n ->getMock();\n $middleware = $this->getMockBuilder(MiddlewareInterface::class)\n ->getMock();\n $stack = $this->getMockBuilder(MiddlewareStackInterface::class)\n ->getMock();\n $stack->expects($this->once())\n ->method('next')\n ->willReturn($middleware);\n $request = $this->getMockBuilder(ServerRequestInterface::class)\n ->getMock();\n $handler = new RequestHandler($response, $stack);\n $middleware->expects($this->once())\n ->method('process')\n ->with($request, $handler)\n ->willReturn($response);\n $actual = $handler->handle($request);\n $this->assertEquals($response, $actual);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set $_FBLoginUrl to $inFBLoginUrl | function setFBLoginUrl($inFBLoginUrl) {
if ( $inFBLoginUrl !== $this->_FBLoginUrl ) {
$this->_FBLoginUrl = $inFBLoginUrl;
$this->setModified();
}
return $this;
} | [
"public function executeFb($request){\n//$this->loginUrl = $this->helper->getLoginUrl();\n}",
"protected function setLoginUrl()\n {\n $userModule = Yii::$app->getModule('user');\n if ($userModule->enableRememberLoginPage) {\n $cookieName = $userModule->originCookieName;\n if (Yii::$app->getRequest()->cookies[$cookieName]) {\n $origin = Yii::$app->getRequest()->cookies->getValue($cookieName);\n $this->loginUrl = base64_decode($origin);\n }\n }\n }",
"public function setFacebookLogin($isLoging){\n \n $this->_facebok_login = $isLoging;\n }",
"public function setFacebookUrl(?string $facebookUrl): void\n {\n $this->facebookUrl['value'] = $facebookUrl;\n }",
"public function setFacebookUrl(?string $facebookUrl): void\n {\n $this->facebookUrl = $facebookUrl;\n }",
"public function facebook ()\n\t\t{\n\t\t\t$redirect_login = $this->fb->getRedirectLoginHelper();\n\t\t\t$permissions = $this->scope;\n\t\t\t$login_url = $redirect_login->getLoginUrl( $this->login_url, $permissions );\n\n\t\t\tif ( $this->generate_url )\n\t\t\t\treturn $login_url;\n\t\t\telse\n\t\t\t\tredirect( $login_url );\n\t\t}",
"protected function setLoginUrl($loginUrl)\n {\n $this->loginUrl = $loginUrl;\n }",
"protected function _getCallbackUrlForLoginPage() {\n $request = $this->getRequest();\n $callbackUrlDefault = $request->getScheme() . '://' . $request->getHttpHost() . $request->getRequestUri();\n $callbackUrl = $request->getParam('continue', $callbackUrlDefault);\n return $callbackUrl;\n }",
"public function set_login_url($url)\n {\n $this->login_url = $url;\n }",
"public function login_url()\n {\n // Login type must be web, else return empty string\n if ($this->config->item('facebook_login_type') != 'web')\n {\n return '';\n }\n // Create login url\n return $this->helper->getLoginUrl($this->config->item('facebook_login_redirect_url'), $this->config->item('facebook_permissions'));\n }",
"public function grabFacebookTestUserLoginUrl()\n {\n return $this->testUser['login_url'];\n }",
"function login() {\n if(!$this->uid && !strpos($_SERVER[\"HTTP_REFERER\"], 'facebook')) {\n $args = array('scope' => $permissions);\n $url = $this->facebook->getLoginUrl($args);\n if(!$_GET['state']) js_redirect_to($url);\n }\n }",
"public function getFacebookConnectUrl()\n {\n\n $fb = new Facebook([\n 'app_id' => $this->facebook_app_id,\n 'app_secret' => $this->facebook_app_secret,\n 'default_graph_version' => 'v2.2',\n ]);\n $helper = $fb->getRedirectLoginHelper();\n $permissions = ['email'];\n $fallback_url = $this->urlGenerator->generate('mo_facebook_fallback', array(), UrlGeneratorInterface::ABSOLUTE_URL);\n $loginUrl = $helper->getLoginUrl($fallback_url, $permissions);\n\n return $loginUrl;\n }",
"public function login_url() {\n // Login type must be web login, else return empty string\n if ($this->helpertype !='login') {\n return ''; \n }\n return $this->helper->getLoginUrl(\n base_url() . $this->config->item('facebook_redirectUri'), \n $this->config->item('facebook_permissions')); \n }",
"public function setLoginUrl($val)\n {\n $this->_propDict[\"loginUrl\"] = $val;\n return $this;\n }",
"function shibboleth_login_url( $login_url ) {\n\t$default = shibboleth_getoption( 'shibboleth_default_to_shib_login' );\n\n\tif ( $default ) {\n\t\t$login_url = add_query_arg( 'action', 'shibboleth', $login_url );\n\t}\n\treturn $login_url;\n}",
"public function actionFacebook() {\n if(isset($_SESSION['send_request_to_fb'])){\n unset($_SESSION['send_request_to_fb']);\n $this->route->redirect('social/facebook_callback/');\n }\n $_SESSION['id_object'] = $this->route->getVar('id_object', 0);\n $social = slSocial::getConfig();\n $fb_login_url = 'http://www.facebook.com/dialog/oauth/?client_id='.$social['FB_APP_ID']\n .'&redirect_uri='.slRouter::getBaseUrl().'social/facebook_callback/'\n .'&display=popup'\n .'&scope='.$social['SETTINGS_FB'];\n\n $_SESSION['send_request_to_fb'] = true;\n header('Location: '.$fb_login_url);\n die();\n }",
"function requestUserLogInFromFacebook (){\n\t\tinclude ($_SERVER['DOCUMENT_ROOT'] . '_inc/controller/fb/requestUserLogInFromFacebook.fb.inc.php');\n\t}",
"public function getUserFacebookUrl()\n\t{\n\t\treturn $this->user_facebook_url;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches all the pending invites related to a particular child hash. | public function get_pending_invites(Request $request, $hash) {
try {
if ($hash) {
$child = Child::where('hash', $hash)
->whereIn('id', Child::accessibleChildren())
->first();
if (!$child) {
return response('The child data does not exist.', 404);
}
return \App\CaretakerInvite::where('child_id', $child->id)
->where('has_accepted', 0)
->get();
}
} catch (\Exception $e) {
return response($e->getMessage(), 400);
}
} | [
"public function get_all_invited(Request $request){\n \t$id = $request->input(\"id\");\n if(!isset($id) || $id === ''){\n $ret = array(\n \"success\"=>false,\n \"msg\"=>'The id was not recieved.'\n );\n die(json_encode($ret));\n }\n $cur = User::where('id',$id)->first();\n if(is_null($cur)){ //user not found\n $ret = array(\n \"success\"=>false,\n \"msg\"=>\"The id ({$id}) provided was not found in the database.\"\n );\n die(json_encode($ret));\n }\n \t$invites = FriendsInvite::where(['user'=>$id, 'status'=>'pending'])->pluck('invited_fb_id')->all();\n die(json_encode($invites));\n }",
"public function pendingInvitations()\n {\n return $this->invitations()->where('status', 'pending');\n }",
"public function getInvitethechildren()\n {\n return $this->hasMany(Invitethechild::className(), ['child_id' => 'id']);\n }",
"public function findInviteRequests()\n {\n return $this->repository->findBy(array('deletedAt' => null));\n }",
"public function all()\n {\n return Invite::all();\n }",
"public function getInvited()\n {\n return $this->buildall(\"FacebookBasicUser\", $this->api->api(\"/{$this->id}/invited\")); \n }",
"public function invitationPending()\n {\n return $this->invitations()->where('status', 'pending');\n }",
"function get_pending_invites() {\n\t$invites = get_site_transient( 'gh_invites', false );\n\tif ( false === $invites ) {\n\t\t$invites = api( '/orgs/{ORG}/invitations' );\n\n\t\tset_site_transient( 'gh_invites', $invites, 5 * MINUTE_IN_SECONDS );\n\t}\n\n\tif ( is_wp_error( $invites ) ) {\n\t\treturn [];\n\t}\n\n\treturn $invites;\n}",
"public function getBillingChildren() {\n $sql = \"select child as childId from billing_merge where kind = 'rest' and parent = \" . $this->getId();\n return $this->getAdapter()\n ->query($sql)\n ->fetchAll();\n }",
"public function loadUserChallengeInvitations($base)\n {\n $query=\"Select * from challenge_invitation where invitation_user_number=\".$this->user_number;\n $data=$base->fetch_all_array($query);\n if(!empty($data))\n {\n foreach($data as $row)\n {\n $number=$row['invitation_challenge_number'];\n $challenge=new Challenge();\n $challenge->setChallenge_number($number);\n $challenge->loadChallenge($base);\n $invitation=new Challenge_inviattion();\n $invitation->setInvitation_user($this);\n $invitation->setInvitation_challenge($challenge);\n $invitation->loadChallenge_invitation($base);\n $this->theUserChallengeInvitations[]=$invitation;\n }\n }\n }",
"public function invitationsReceived() {\n return $this->hasMany('App\\Invitation', 'target_to', 'user_id');\n }",
"public function getPendingRelRequests(Member $member);",
"public function getInvited()\r\n\t{\r\n\t\t$sql = \"SELECT p.* FROM profile p, event_attendees WHERE p.user_id=a.user_id AND a.status='invited' AND a.event_id=\" . $this->ID;\r\n\t\t$cache = $this->registry->getObject('db')->cacheQuery( $sql );\r\n\t\treturn $cache;\r\n\t}",
"public function getInvites()\n {\n return $this->hasMany(Invite::className(), ['user_id' => 'id']);\n }",
"public static function findAllPendingInHours( $hours ) {\n\t\tglobal $wpdb;\n\t\t$table_appointments = $wpdb->prefix . self::$table_appointments;\n\t\t$table_staffs = $wpdb->prefix . self::$table_staffs;\n\t\t$table_services = $wpdb->prefix . self::$table_services;\n\t\t$table_customers = $wpdb->prefix . self::$table_customers;\n\t\t$table_sent_notifications = $wpdb->prefix . self::$table_sent_notifications;\n\n\t\t$sql = \"SELECT a.id, a.start_datetime, \n\t\t\t\t\ta.end_datetime, a.staff_id, a.note, b.full_name as staff_name,\n\t\t\t\t\ta.service_id, c.title as service_title, c.duration, a.price, \n\t\t\t\t\tc.color, a.customer_id, d.full_name as customer_name,\n\t\t\t\t\td.phone as customer_phone, d.email as customer_email,\n\t\t\t\t\ta.is_paid\n\t\t\t\t\tFROM $table_appointments a\n\t\t\t\t\tLEFT JOIN $table_staffs b ON a.staff_id = b.id\n\t\t\t\t\tLEFT JOIN $table_services c ON a.service_id = c.id\n\t\t\t\t\tLEFT JOIN $table_customers d ON a.customer_id = d.id\n\t\t\t\t\tLEFT JOIN $table_sent_notifications e ON a.id = e.ref_id\n\t\t\t\t\tWHERE \n\t\t\t\t\ta.start_datetime <= DATE_ADD(NOW(), INTERVAL $hours HOUR)\n\t\t\t\t\tAND a.start_datetime >= NOW()\n\t\t\t\t\tAND e.ref_id is null\n\t\t\t\t\tORDER BY a.start_datetime ASC\";\n\n\t\t$results = $wpdb->get_results( $sql );\n\n\t\treturn $results;\n\t}",
"private function fetchChildEvents() {\n\t\t$this->childEvents = Event::find( array( 'parent_ID' => $this->getID() ) );\n\t}",
"public function getInvitees(): \\yii\\db\\ActiveQuery\n {\n return $this->hasMany(Invitee::class, ['voting_id' => 'id']);\n }",
"public function invites()\n {\n return $this->hasMany(EventInvite::class);\n }",
"public function getConfirmedInvitations()\n {\n $criteria = Criteria::create();\n $criteria->andWhere(Criteria::expr()->eq('status', Invitation::STATUS_CONFIRMED));\n\n return $this->invitations->matching($criteria);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all importable address formats. | public function getImportableAddressFormats(); | [
"function getAddressFormatList() {\n\t\t$query = \"SELECT `address_summary` FROM `'.BIT_DB_PREFIX.'address_format`\n\t\t\t\t ORDER BY `address_summary`\";\n\t\t$result = $this->mDb->query($query);\n\t\t$ret = array();\n\n\t\twhile ($res = $result->fetchRow()) {\n\t\t\t$ret[] = trim($res[\"address_summary\"]);\n\t\t}\n\t\treturn $ret;\n\t}",
"public static function getAllFormats()\n {\n return array(self::CCNN,\n self::IDDCCNN,\n self::NDDNN,\n self::NN,\n self::SN);\n }",
"function zen_get_address_formats() {\r\n global $db;\r\n $address_format_values = $db->Execute(\"select address_format_id\r\n from \" . TABLE_ADDRESS_FORMAT . \"\r\n order by address_format_id\");\r\n\r\n $address_format_array = array();\r\n while (!$address_format_values->EOF) {\r\n $address_format_array[] = array('id' => $address_format_values->fields['address_format_id'],\r\n 'text' => $address_format_values->fields['address_format_id']);\r\n $address_format_values->MoveNext();\r\n }\r\n return $address_format_array;\r\n}",
"function getImportFormatList()\n {\n return array('0' => 'Select format from the list', 'XML' => 'XML', 'CSV' => 'CSV', 'Iron Search XML' => 'Iron Search XML');\n }",
"public function get_address_formats() {\r\n\t\tif ( ! isset( $this->address_formats ) ) {\r\n\r\n\t\t\t// Common formats\r\n\t\t\t$postcode_before_city = \"{company}\\n{name}\\n{address_1}\\n{address_2}\\n{postcode} {city}\\n{country}\";\r\n\r\n\t\t\t// Define address formats\r\n\t\t\t$this->address_formats = apply_filters('charitable_localisation_address_formats', array(\r\n\t\t\t\t'default' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{city}\\n{state}\\n{postcode}\\n{country}\",\r\n\t\t\t\t'AU' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{city} {state} {postcode}\\n{country}\",\r\n\t\t\t\t'AT' => $postcode_before_city,\r\n\t\t\t\t'BE' => $postcode_before_city,\r\n\t\t\t\t'CA' => \"{company}\\n{name}\\n{address_1}\\n{address_2}\\n{city} {state} {postcode}\\n{country}\",\r\n\t\t\t\t'CH' => $postcode_before_city,\r\n\t\t\t\t'CN' => \"{country} {postcode}\\n{state}, {city}, {address_2}, {address_1}\\n{company}\\n{name}\",\r\n\t\t\t\t'CZ' => $postcode_before_city,\r\n\t\t\t\t'DE' => $postcode_before_city,\r\n\t\t\t\t'EE' => $postcode_before_city,\r\n\t\t\t\t'FI' => $postcode_before_city,\r\n\t\t\t\t'DK' => $postcode_before_city,\r\n\t\t\t\t'FR' => \"{company}\\n{name}\\n{address_1}\\n{address_2}\\n{postcode} {city_upper}\\n{country}\",\r\n\t\t\t\t'HK' => \"{company}\\n{first_name} {last_name_upper}\\n{address_1}\\n{address_2}\\n{city_upper}\\n{state_upper}\\n{country}\",\r\n\t\t\t\t'HU' => \"{name}\\n{company}\\n{city}\\n{address_1}\\n{address_2}\\n{postcode}\\n{country}\",\r\n\t\t\t\t'IS' => $postcode_before_city,\r\n\t\t\t\t'IT' => \"{company}\\n{name}\\n{address_1}\\n{address_2}\\n{postcode}\\n{city}\\n{state_upper}\\n{country}\",\r\n\t\t\t\t'JP' => \"{postcode}\\n{state}{city}{address_1}\\n{address_2}\\n{company}\\n{last_name} {first_name}\\n {country}\",\r\n\t\t\t\t'TW' => \"{postcode}\\n{city}{address_2}\\n{address_1}\\n{company}\\n{last_name} {first_name}\\n {country}\",\r\n\t\t\t\t'LI' => $postcode_before_city,\r\n\t\t\t\t'NL' => $postcode_before_city,\r\n\t\t\t\t'NZ' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{city} {postcode}\\n{country}\",\r\n\t\t\t\t'NO' => $postcode_before_city,\r\n\t\t\t\t'PL' => $postcode_before_city,\r\n\t\t\t\t'SK' => $postcode_before_city,\r\n\t\t\t\t'SI' => $postcode_before_city,\r\n\t\t\t\t'ES' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{postcode} {city}\\n{state}\\n{country}\",\r\n\t\t\t\t'SE' => $postcode_before_city,\r\n\t\t\t\t'TR' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{postcode} {city} {state}\\n{country}\",\r\n\t\t\t\t'US' => \"{name}\\n{company}\\n{address_1}\\n{address_2}\\n{city}, {state_code} {postcode}\\n{country}\",\r\n\t\t\t\t'VN' => \"{name}\\n{company}\\n{address_1}\\n{city}\\n{country}\",\r\n\t\t\t));\r\n\t\t\r\n\t\t}\r\n\r\n\t\treturn $this->address_formats;\r\n\t}",
"function tep_get_address_formats() {\n $address_format_query = tep_db_query(\"select address_format_id from \" . TABLE_ADDRESS_FORMAT . \" order by address_format_id\");\n $address_format_array = array();\n while ($address_format_values = tep_db_fetch_array($address_format_query)) {\n $address_format_array[] = array('id' => $address_format_values['address_format_id'],\n 'text' => $address_format_values['address_format_id']);\n }\n return $address_format_array;\n }",
"function wpsl_get_address_formats() {\n\n $address_formats = array(\n 'city_state_zip' => __( '(city) (state) (zip code)', 'wpsl' ),\n 'city_comma_state_zip' => __( '(city), (state) (zip code)', 'wpsl' ),\n 'city_zip' => __( '(city) (zip code)', 'wpsl' ),\n 'city_comma_zip' => __( '(city), (zip code)', 'wpsl' ),\n 'zip_city_state' => __( '(zip code) (city) (state)', 'wpsl' ),\n 'zip_city' => __( '(zip code) (city)', 'wpsl' )\n );\n\n return apply_filters( 'wpsl_address_formats', $address_formats );\n}",
"public static function getAllRequestGetMapFormats(){\n return array(\n \"image/png\",\n \"image/gif\",\n \"image/png; mode=24bit\",\n \"image/jpeg\",\n \"image/wbmp\",\n \"image/tiff\"\n );\n }",
"public static function getAvailableFormats()\n {\n return static::$formats;\n }",
"public function getExportFormats();",
"public function getAddressTypes()\n {\n return $this->_addressTypes;\n }",
"function getAvailableImportTypes()\r\n {\r\n return array('BibTeX'=>'BibTeX','ris'=>'ris','refer'=>'refer');\r\n }",
"public static function getAllRequestGetFeatureinfoFormats(){\n return array(\n \"text/html\",\n \"text/plain\",\n \"application/vnd__ogc__gml\"\n );\n }",
"public function getFormats();",
"public function getFormats(): array {\n $meta = $this->getMetadata();\n $formats = [];\n foreach ($meta->all($this->getRepo()->getSchema()->dissService->returnFormat) as $i) {\n $formats[] = new Format((string) $i);\n }\n return $formats;\n }",
"private static function getFormats()\n {\n // Return in-cache formats.\n if (self::$formats) {\n return self::$formats;\n }\n\n // Load formats and return.\n return self::$formats = json_decode(file_get_contents(__DIR__ . '/../../res/formats.json'), true);\n }",
"public function getImportMimeTypes() {\n\t\treturn array_keys($this->info['IMPORT']);\n\t}",
"public static function getNumberFormats()\n\t{\n\t\t$possibleFormats = array();\n\n\t\t// loop available formats\n\t\tforeach((array) self::getModuleSetting('core', 'number_formats') as $format => $example)\n\t\t{\n\t\t\t// reformat array\n\t\t\t$possibleFormats[$format] = $example;\n\t\t}\n\n\t\treturn $possibleFormats;\n\t}",
"public function getSupportedFormats();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate the CSV for graphs | public function generateCSV($graph) {
$pretty = array(
'_total' => 'All Sources',
'null' => 'Unknown',
'category' => 'Category Browse',
'search' => 'Search Results',
'collection' => 'Collections',
'recommended' => 'Featured Page',
'homepagebrowse' => 'Homepage (Browse)',
'homepagepromo' => 'Homepage (Promo)',
'api' => 'API / Add-ons Manager',
'sharingapi' => 'Add-on Collector',
'addondetail' => 'Add-on Details',
'external' => 'External Sources',
'developers' => 'Meet the Developers',
'installservice' => 'Install Service',
'fxcustomization' => 'Firefox Customization Page',
'oftenusedwith' => 'Often Used With',
'similarcollections' => 'Similar Collections',
'userprofile' => 'User Profile',
'email' => 'Email Sharing',
'rockyourfirefox' => 'Rock Your Firefox',
'mostshared' => 'Most Shared Box',
'fxfirstrun' => 'Firefox Firstrun',
'fxwhatsnew' => 'Firefox Updated',
'creatured' => 'Category Features',
'version-history' => 'Version History',
'addon-detail-version' => 'Add-on Details (Version Area)',
'discovery-pane' => '(Old) Discovery Pane',
'discovery-pane-details' => '(Old) Discovery Pane Details',
'discovery-details' => 'Discovery Pane Details',
'discovery-learnmore' => 'Discovery Pane Learn More'
);
if ($graph == 'current') {
echo "Label,Count\n";
$_values = $this->db->query_stats("SELECT sources FROM {$this->table} ORDER BY date DESC LIMIT 1");
$values = mysql_fetch_array($_values, MYSQL_ASSOC);
$values = json_decode($values['sources'], true);
foreach ($values as $column => $value) {
if (in_array($column, array('total'))) continue;
if (!empty($pretty[$column]))
echo "{$pretty[$column]},{$value}\n";
else
echo "{$column},{$value}\n";
}
}
elseif ($graph == 'history') {
$headers = array();
$sources = array();
$dates = $this->db->query_stats("SELECT date, total, sources FROM {$this->table} ORDER BY date");
while ($date = mysql_fetch_array($dates, MYSQL_ASSOC)) {
$sources[$date['date']] = json_decode($date['sources'], true);
$sources[$date['date']]['_total'] = $date['total'];
$headers = array_merge($headers, array_keys($sources[$date['date']]));
}
$headers = array_unique($headers);
sort($headers);
echo "Date";
foreach ($headers as $header) {
if (!empty($pretty[$header]))
echo ",{$pretty[$header]}";
else
echo ",{$header}";
}
echo "\n";
foreach ($sources as $date => $source) {
echo $date;
foreach ($headers as $header) {
if (empty($source[$header]))
echo ",0";
else
echo ",{$source[$header]}";
}
echo "\n";
}
}
} | [
"public function generateCSV($graph) {\n $columns = array(\n 'total' => 'All Methods',\n 'featured' => 'Featured',\n 'addon' => 'Add-on Details',\n 'search' => 'Search',\n 'guidsearch' => 'GUID Search'\n );\n \n if ($graph == 'current') {\n echo \"Label,Count\\n\";\n\n $_values = $this->db->query_stats(\"SELECT featured, addon, search, guidsearch FROM {$this->table} ORDER BY date DESC LIMIT 1\");\n $values = mysql_fetch_array($_values, MYSQL_ASSOC);\n \n foreach ($values as $column => $value) {\n echo \"{$columns[$column]},{$value}\\n\";\n }\n }\n elseif ($graph == 'history') {\n echo \"Date,\".implode(',', $columns).\"\\n\";\n\n $dates = $this->db->query_stats(\"SELECT date, \".implode(', ', array_keys($columns)).\" FROM {$this->table} ORDER BY date\");\n while ($date = mysql_fetch_array($dates, MYSQL_ASSOC)) {\n echo implode(',', $date).\"\\n\";\n }\n }\n }",
"public function generateCSV($graph) {\n $columns = array(\n 'total' => 'Total Add-ons',\n 'about' => 'About Dialog',\n 'options' => 'Preferences Dialog',\n 'toolbar' => 'Toolbar',\n 'toolbarbutton' => 'Toolbar Button',\n 'mainmenu' => 'Main Menu Command',\n 'contextmenu' => 'Context Menu Command',\n 'sidebar' => 'Sidebar'\n );\n \n if ($graph == 'current') {\n echo \"Label,Count\\n\";\n \n $_values = $this->db->query_stats(\"SELECT \".implode(', ', array_keys($columns)).\" FROM {$this->table} ORDER BY date DESC LIMIT 1\");\n $values = mysql_fetch_array($_values, MYSQL_ASSOC);\n \n foreach ($values as $column => $value) {\n if (in_array($column, array('total'))) continue;\n \n echo \"{$columns[$column]},{$value}\\n\";\n }\n }\n elseif ($graph == 'history') {\n echo \"Date,\".implode(',', $columns).\"\\n\";\n\n $dates = $this->db->query_stats(\"SELECT date, \".implode(', ', array_keys($columns)).\" FROM {$this->table} ORDER BY date\");\n while ($date = mysql_fetch_array($dates, MYSQL_ASSOC)) {\n echo implode(',', $date).\"\\n\";\n }\n }\n }",
"public function generateCSV($graph) {\n $api = array(\n 'pane' => 'Pane Views',\n 'details' => 'Details Page Views'\n );\n $sources = array(\n 'discovery-details' => 'Downloads from Details',\n 'discovery-learnmore' => 'Downloads from Learn More',\n 'discovery-promo' => 'Downloads from Promos',\n 'discovery-featured' => 'Downloads from Featured',\n 'discovery-upandcoming' => 'Downloads from Up & Coming',\n 'discovery-personalrec' => 'Downloads from Personalized Recs'\n );\n\n if ($graph == 'current') {\n echo \"Label,Count\\n\";\n\n $_values = $this->db->query_stats(\"SELECT pane, details FROM {$this->table} ORDER BY date DESC LIMIT 1\");\n $values = mysql_fetch_array($_values, MYSQL_ASSOC);\n\n foreach ($values as $column => $value) {\n echo \"{$columns[$column]},{$value}\\n\";\n }\n }\n elseif ($graph == 'history') {\n echo \"Date,\".implode(',', $api).','.implode(',', $sources).\",Pane Downloads (All)\\n\";\n\n $dates = $this->db->query_stats(\"SELECT d.date, d.pane, d.details, ads.sources FROM {$this->table} AS d LEFT JOIN addons_downloads_sources AS ads ON ads.date = d.date ORDER BY d.date\");\n while ($date = mysql_fetch_array($dates, MYSQL_ASSOC)) {\n echo \"{$date['date']},{$date['pane']},{$date['details']}\";\n \n $_source = json_decode($date['sources'], true);\n // Merge old sources\n $_source['discovery-learnmore'] += $_source['discovery-pane'];\n $_source['discovery-details'] += $_source['discovery-pane-details'];\n $total = 0;\n \n foreach ($sources as $source => $desc) {\n if (!empty($_source[$source])) {\n $total += $_source[$source];\n echo \",{$_source[$source]}\";\n }\n else\n echo \",0\";\n }\n echo \",{$total}\\n\";\n }\n }\n }",
"private function generateCSV()\n {\n $type = $this->type;\n $items = \\DB::table($this->project['id'] . '_usage')\n ->select('timestamp', $type)\n ->latest('timestamp')\n ->limit(2000)\n ->get()\n ->toArray();\n $this->last_point = $items[0]->timestamp;\n $items = array_reverse($items);\n $file = fopen('r/' . $this->csv_file, 'a+');\n fputcsv($file, array($type));\n $count = 0;\n $total = 0;\n foreach ($items as $item) {\n $count++;\n $total += $item->$type;\n if ($count == 10) {\n fputcsv($file, array(number_format($total / 10, 2) ));\n $total = 0;\n $count = 0;\n }\n }\n fclose($file);\n }",
"function toCSV()\r\n {\r\n $dg =& $this->_dg;\r\n\r\n // Get the data to be rendered\r\n $dg->fetchDataSource();\r\n \r\n // Check to see if column headers exist, if not create them\r\n // This must follow after any fetch method call\r\n $dg->_setDefaultHeaders();\r\n \r\n $i = 0;\r\n foreach ($this->_dg->columnSet as $column) {\r\n if ($i > 0) {\r\n $csv .= $this->delimiter . ' ';\r\n }\r\n $csv .= $column->columnName;\r\n $i++;\r\n }\r\n $csv .= \"\\n\";\r\n \r\n foreach ($this->_dg->recordSet as $row) {\r\n $i = 0;\r\n foreach ($this->_dg->columnSet as $column) {\r\n // Build Content\r\n if ($column->formatter != null) {\r\n $content = $column->formatter($row);\r\n } elseif ($column->fieldName == null) {\r\n if ($column->autoFillValue != null) {\r\n $content = $column->autoFillValue;\r\n } else {\r\n $content = $column->columnName;\r\n }\r\n } else {\r\n $content = $row[$column->fieldName];\r\n }\r\n\r\n // Implement Delimiter\r\n if ($i > 0) {\r\n $csv .= $this->delimiter . ' ';\r\n }\r\n \r\n // Add content to CSV\r\n if ($this->useQuotes) {\r\n $csv .= '\"' . $content . '\"';\r\n } else {\r\n $csv .= $content;\r\n }\r\n $i++;\r\n }\r\n\r\n $csv .= \"\\n\";\r\n }\r\n\r\n return $csv;\r\n }",
"public function graph_csv1()\n\t{\n $sql = 'SELECT tahun, (nilaikontrak/1000000000) AS nilaikontrak FROM '.env('DB_CONTRACT').'.vlelang_bypaket ORDER BY tahun ASC';\n $rs1 = DB::select($sql);\n\n $rowdata = array();\n $data = array();\n\n foreach($rs1 as $row) {\n array_push($data, array($row->tahun));\n }\n array_push($rowdata, array(\"name\"=>\"Year\", \"data\"=> $data));\n\n $data = array();\n foreach($rs1 as $row) {\n array_push($data, array((float)$row->nilaikontrak));\n }\n array_push($rowdata, array(\"name\"=>\"Lelang\", \"data\"=> $data));\n\n $sql = 'SELECT tahun, (nilaikontrak/1000000000) AS nilaikontrak FROM '.env('DB_CONTRACT').'.vpl_bypaket ORDER BY tahun ASC';\n $rs1 = DB::select($sql);\n\n $data = array();\n foreach($rs1 as $row) {\n array_push($data, array((float)$row->nilaikontrak));\n }\n array_push($rowdata, array(\"name\"=>\"Pengadaan Langsung\", \"data\"=> $data));\n $results = $rowdata;\n\n //return $results;\n //return $this->download_nested_array_csv('lelang',$results);\n return $this->download_nested_array_csv('lelang',$this->graph1_array());\n\t}",
"public function generateCsv()\n\t{\n\t\t$doc = new CsvDocument(array(\"Member Name\",\"Email Address\",\"Alternate Email\"));\n\t\tforeach($this->emailList as $record)\n\t\t{\n\t\t\t$doc->addRow(array(\n\t\t\t\t$record->name,\n\t\t\t\t$record->emailAddress, \n\t\t\t\t$record->alternateEmail\n\t\t\t));\n\t\t}\n\n\t\t$filename = \"svenskaklubben_maillist_\" . date(\"d-m-Y_G-i\");\n\t\theader(\"Content-type: application/csv\");\n\t\theader(\"Content-Disposition: attachment; filename={$filename}.csv\");\n\t\theader(\"Pragma: no-cache\");\n\t\theader(\"Expires: 0\");\n\n\t\techo $doc->getDocument();\n\t\texit; //premature exit so the templates aren't appended to the document\n\t}",
"public function buildCsv()\n\t{\n\t\t$fp = fopen('php://output', 'w');\n\n\t\t// Necessary to stop \"£\" displaying as \"£\" in Excel\n\t\tfputs($fp, \"\\xef\\xbb\\xbf\");\n\n\t\t$this->decorator->getListingModelsChunked(200, function($models) use ($fp) {\n\t\t\tforeach($models as $instance) {\n\t\t\t\t$columns = $this->getColumnsFromInstance($instance);\n\t\t\t\tif ( ! $this->headings) {\n\t\t\t\t\tfputcsv($fp, array_keys($columns));\n\t\t\t\t\t$this->headings = true;\n\t\t\t\t}\n\t\t\t\tfputcsv($fp, $columns);\n\t\t\t}\n\t\t});\n\n\t\tfclose($fp);\n\t}",
"public function getVisitorcsv()\n {\n \t$this->Checklogin();\n \t$resultVisitor=$this->visitor_model->getAllVisitors();\n \n \t$contents='\"Id\",\"Customer Name\",\"Mobile No\",\"Email Id\",\"Business Name\",\"Location\",\"Registration On\",\"Last Revisit\"';\n \n \t$contents.=\"\\n\";\n \tfor($i=0;$i < count($resultVisitor);$i ++)\n \t{\n \t\t$j=$i+1;\n \t\t$contents.='\"' . $resultVisitor[$i]->vis_id_pk . '\",\"' . $resultVisitor[$i]->vis_firstName.\" \".$resultVisitor[$i]->vis_lastName . '\",\"' . $resultVisitor[$i]->vis_mobile . '\",\"' . $resultVisitor[$i]->vis_email . '\",\"' . $resultVisitor[$i]->vis_businessName . '\" ,\"' . $resultVisitor[$i]->cty_name . '\",\"' . $resultVisitor[$i]->vis_createdDate . '\",\"' . $resultVisitor[$i]->vl_visitDate . '\"';\n \t\t$contents.=\"\\n\";\n \t}\n \n \t$contents=strip_tags($contents);\n \n \t// header to make force download the file\n \tHeader(\"Content-Disposition: attachment; filename=Visitor.csv\");\n \tprint $contents;\n \texit();\n \n \n \t\n }",
"function generateCharts() {\r\n\t}",
"public function csv_export() {\n\t$export = \"\";\n\t$order_id = null;\n\t$order_ids = array();\n\t$headers = array();\n\t$products = array();\n\t$summaries = array();\n\tforeach ($this->records as $record) {\n\t $order_id = $record[\"order_id\"];\n\t $order_ids[] = $order_id;\n\t if(!isset($headers[$order_id])) {\n\t\t$headers[$order_id] = $this->build_order_header($record);\n\t }\n\t $products[$order_id] = (isset($products[$order_id]) ? $products[$order_id] : '').$this->build_order_product_line($record);\n\t if(!isset($summaries[$order_id])) {\n\t\t$summaries[$order_id] = $this->build_order_summary($record);\n\t }\n\t}\n\t$order_ids = array_unique($order_ids);\n\tforeach($order_ids as $oid) {\n\t $export .= $headers[$oid].$products[$oid].$summaries[$oid];\n\t}\n\n\treturn $export;\n }",
"public function generate()\n {\n\n $data[] = 'field_name,field_label,instrument_name,current_value,new_value,current_label,new_label';\n foreach ($this->getProject()->metadata as $name => $field) {\n $pointer = 0;\n if (!in_array($field['element_type'],\n array('select', 'checkbox'))) {\n continue;\n }\n\n $instrument = $field['form_name'];\n $labels = parseEnum($field['element_enum']);\n foreach ($labels as $key => $label) {\n $data[] = '' . $name . ',,' . $instrument . ',' . $key . ',,\"' . $label . '\",';\n }\n }\n $this->downloadCSVFile('sample_data.csv', $data);\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n }",
"function generate_product_report_csv($c_data=array()){\r\r\n\t\t\r\r\n\t\tApp::import('Helper','csv');\r\r\n\t\t$csv = new csvHelper();\r\r\n\t\t$line = array('Product','Product Code','Status','created');\r\r\n\t\t$csv->addRow($line);\r\r\n\t\tif(!empty($c_data)){\r\r\n\t\t\t$status = array('Deactive','Active');\r\r\n\t\t\t$status_sold = array(1=>\"Yes\",0=>\"No\");\r\r\n\t\t\t\r\r\n\t\t\tforeach($c_data as $data){\r\r\n\t\t\t$line = array($data['Product']['title'],$data['Product']['product_code'],$status[$data['Product']['is_active']],$data['Product']['created']);\r\r\n\t\t\t$csv->addRow($line);\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t}\r\r\n\t\techo $csv->render(\"product_report\".date(\"d/M/Y\"));\r\r\n\t\texit();\r\r\n\t}",
"public function csv();",
"function generate_coupon_report_csv($c_data=array(),$b_data=array(),$p_data=array()){\n\t\t\n\t\tApp::import('Helper','csv');\n\t\t$csv = new csvHelper();\n\t\t$line = array('Product','Product Code','Batch','Coupon Id','Sold','Sale Time');\n\t\t$csv->addRow($line);\n\t\tif(!empty($c_data)){\n\t\t\t\n\t\t\t$status_sold = array(1=>\"Yes\",0=>\"No\");\n\t\t\t\n\t\t\tforeach($c_data as $data){\n\t\t\t$sale_time = ($data['Coupon']['is_sold'] == \"1\")?$data['Coupon']['modified']:\"Not yet\";\n\t\t\t$line = array(preg_replace(\"/&#?[a-z0-9]+;/i\",\"\",$p_data[$data['Coupon']['product_code']]),$data['Coupon']['product_code'],$b_data[$data['Coupon']['batch_id']],$data['Coupon']['coupon_id'],$status_sold[$data['Coupon']['is_sold']],$sale_time);\n\t\t\t$csv->addRow($line);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $csv->render(\"coupon_report\".date(\"d/M/Y\"));\n\t\texit();\n\t}",
"protected function createPagesCsv()\n {\n // TODO: Implement createPagesCsv() method.\n }",
"public function createCSV() {\n $head = [\n 'サロンID',\n 'サロン名',\n 'オーナー名',\n 'Facebook URL',\n 'ユーザーID',\n 'ユーザー名',\n date('Y').'年'.date('m').'月決済金額'\n ];\n\n $users = User::select('users.id as user_id', 'users.name', 'users.salon_id', 'payments.amount')\n ->leftJoin('payments', 'users.id', '=', 'payments.user_id')\n ->where('payments.payment_for', date('Ym'))\n ->where(function($query) {\n $query->whereNull('users.deleted_at')\n ->orWhere('users.deleted_at', '>=', strtotime(date('Ym').'01 00:00:00'));\n })\n ->orderBy('users.salon_id', 'asc')\n ->orderBy('amount')\n ->orderBy('user_id', 'asc')\n ->get();\n\n $info = [];\n\n foreach($users as $user) {\n $info[] = [\n 'salon_id' => $user->salon_id?? 'NULL',\n 'salon_name' => $user->salon->name?? 'NULL',\n 'owner_name' => $user->salon->owner->owner_name ?? 'NULL',\n 'facebook' => $user->salon->facebook?? 'NULL',\n 'userId' => $user->user_id,\n 'userName' => $user->name,\n 'payment' => $user->amount?? ''\n ];\n }\n\n $f = fopen('php://output', 'w');\n if($f) {\n mb_convert_variables('SJIS', 'UTF-8', $head);\n fputcsv($f, $head);\n foreach($info as $inf) {\n mb_convert_variables('SJIS', 'UTF-8', $inf);\n fputcsv($f, $inf);\n }\n }\n fclose($f);\n }",
"private function tracking_menu_export_csv()\n {\n\n //verify capability\n if ( ! current_user_can(get_option($this->shared->get('slug') . \"_capabilities_tracking_menu\"))) {\n die();\n }\n\n //Set the PHP \"Max Execution Time\" and \"Memory Limit\" based on the values defined in the options\n $this->shared->set_met_and_ml();\n\n //get the data from the db table\n global $wpdb;\n $table_name = $wpdb->prefix . $this->shared->get('slug') . \"_tracking\";\n $results = $wpdb->get_results(\"SELECT * FROM $table_name ORDER BY date DESC\", ARRAY_A);\n\n //if there are data generate the csv header and content\n if (count($results) > 0) {\n\n $csv_content = '';\n $new_line = \"\\n\";\n\n //set the csv header\n header('Content-Encoding: UTF-8');\n header('Content-type: text/csv; charset=UTF-8');\n header(\"Content-Disposition: attachment; filename=tracking-\" . time() . \".csv\");\n header(\"Pragma: no-cache\");\n header(\"Expires: 0\");\n\n //set headings\n $csv_content .= '\"' . $this->esc_csv(__('Tracking ID', 'daam')) . '\",';\n $csv_content .= '\"' . $this->esc_csv(__('User IP', 'daam')) . '\",';\n $csv_content .= '\"' . $this->esc_csv(__('Date', 'daam')) . '\",';\n $csv_content .= '\"' . $this->esc_csv(__('Autolink', 'daam')) . '\",';\n $csv_content .= '\"' . $this->esc_csv(__('Post', 'daam')) . '\"';\n $csv_content .= $new_line;\n\n //set column content\n foreach ($results as $result) {\n\n $csv_content .= '\"' . $this->esc_csv($result['tracking_id']) . '\",';\n $csv_content .= '\"' . $this->esc_csv(stripslashes($result['user_ip'])) . '\",';\n $csv_content .= '\"' . $this->esc_csv(mysql2date(get_option('date_format'), $result['date'])) . '\",';\n\n $autolink_obj = $this->shared->get_autolink_object($result['autolink_id']);\n if (isset($autolink_obj->name)) {\n $csv_content .= '\"' . $this->esc_csv(stripslashes($autolink_obj->name)) . '\",';\n } else {\n $csv_content .= '\"' . esc_attr__('Not Available', 'daam') . '\",';\n }\n\n if (get_post_status($result['post_id']) !== false) {\n $csv_content .= '\"' . $this->esc_csv(get_post_field('post_title', $result['post_id'], 'raw')) . '\"';\n } else {\n $csv_content .= '\"' . esc_attr__('Not Available', 'daam') . '\"';\n }\n\n $csv_content .= $new_line;\n\n }\n\n } else {\n return false;\n }\n\n echo $csv_content;\n die();\n\n }",
"public function csv_export() {\n $export = \"ORDER NUMBER|DATE OF ORDER|CLIENT|TM ID|SKU|QUANTITY|PRICE|LOT#|DELIVERY|ADDRESS|OBSERVATIONS|\\n\";\n foreach ($this->records as $record) {\n $export .= implode(\"|\", $record) . \"|\\n\";\n }\n return $export;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts the code which failed as denoted by $startCursor and $endCursor and display the exact column were it happened. The cursor $markCursor is used to mark where the error occured, it will displayed using a ^ character. | private function getAstNodeFailure( $startCursor, $endCursor, $markCursor )
{
$code = substr( $startCursor->text,
$startCursor->position - $startCursor->column,
$endCursor->position - $startCursor->position + $startCursor->column );
// Include some code which appears after the failure points, max 10 characters
$extraAstNode = substr( $startCursor->text,
$endCursor->position,
$markCursor->position - $endCursor->position + 10 );
$eolPos = strpos( $extraAstNode, "\n" );
if ( $eolPos !== false )
{
$extraAstNode = substr( $extraAstNode, 0, $eolPos );
}
$code .= $extraAstNode;
$code .= "\n";
if ( $markCursor->column > 0 )
{
$code .= str_repeat( " ", $markCursor->column );
}
$code .= "^";
return $code;
} | [
"private function getErrorPosition(): string\n {\n if ($this->displayErrorLine) {\n $pieces = preg_split('/\\\\r\\\\n|\\\\n\\\\r|\\\\n|\\\\r/', substr($this->data, 0, $this->position));\n $line = count($pieces);\n $column = strlen(end($pieces));\n\n return \" at line {$line} column {$column}\";\n }\n\n return \" at byte {$this->position}\";\n }",
"public function getErrorCursorH(): int\n {\n if ($this->captureAnsi(\"\\e[6n\", true) === null) {\n throw Exceptional::Runtime(\n 'Unable to detect cursor position'\n );\n }\n\n return $this->getErrorCursor()[1];\n }",
"public function getErrorCursorV(): int\n {\n return $this->getErrorCursor()[0];\n }",
"private function charAtCursor(Cursor $cursor): string\n {\n return $this->grid[$cursor->row()][$cursor->col()];\n }",
"private function validateCursorCount($cursor, $count){\n\t\t// Prep Variables\n\t\t$offset = intval(base64_decode($cursor));\n\t\t$count = intval($count);\n\n\t\tif(is_int($offset) && $offset >= 0){\n\t\t\tif(is_int($count)){\n\t\t\t\t// Within Limits?\n\t\t\t\t$numBrewers = $this->countBrewers();\n\t\t\t\tif($offset > $numBrewers){\n\t\t\t\t\t// Outside Range\n\t\t\t\t\t$this->error = true;\n\t\t\t\t\t$this->errorMsg = 'Sorry, the cursor value you supplied is outside our data range.';\n\t\t\t\t\t$this->responseCode = 400;\n\n\t\t\t\t\t// Log Error\n\t\t\t\t\t$errorLog = new LogError();\n\t\t\t\t\t$errorLog->errorNumber = 96;\n\t\t\t\t\t$errorLog->errorMsg = 'Offset value outside range';\n\t\t\t\t\t$errorLog->badData = \"Offset: $offset / numBrewers: $numBrewers\";\n\t\t\t\t\t$errorLog->filename = $this->filename;\n\t\t\t\t\t$errorLog->write();\n\t\t\t\t}\n\n\t\t\t\tif($count > 1000000 || $count < 1){\n\t\t\t\t\t// Outside Range\n\t\t\t\t\t$this->error = true;\n\t\t\t\t\t$this->errorMsg = 'Sorry, the count value you specified is outside our acceptable range. The range we will accept is [1, 1,000,000].';\n\t\t\t\t\t$this->responseCode = 400;\n\n\t\t\t\t\t// Log Error\n\t\t\t\t\t$errorLog = new LogError();\n\t\t\t\t\t$errorLog->errorNumber = 97;\n\t\t\t\t\t$errorLog->errorMsg = 'Count value outside range';\n\t\t\t\t\t$errorLog->badData = $count;\n\t\t\t\t\t$errorLog->filename = $this->filename;\n\t\t\t\t\t$errorLog->write();\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t// Not an integer offset\n\t\t\t\t$this->error = true;\n\t\t\t\t$this->errorMsg = 'Sorry, the count value you supplied is invalid. Please ensure you are sending an integer value.';\n\t\t\t\t$this->responseCode = 400;\n\n\t\t\t\t// Log Error\n\t\t\t\t$errorLog = new LogError();\n\t\t\t\t$errorLog->errorNumber = 95;\n\t\t\t\t$errorLog->errorMsg = 'Non-integer count value';\n\t\t\t\t$errorLog->badData = $count;\n\t\t\t\t$errorLog->filename = $this->filename;\n\t\t\t\t$errorLog->write();\n\t\t\t}\n\t\t}else{\n\t\t\t// Not an integer offset\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Sorry, the cursor value you supplied is invalid.';\n\t\t\t$this->responseCode = 400;\n\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 94;\n\t\t\t$errorLog->errorMsg = 'Invalid cursor value';\n\t\t\t$errorLog->badData = $offset;\n\t\t\t$errorLog->filename = $this->filename;\n\t\t\t$errorLog->write();\n\t\t}\n\n\t\treturn(array($offset, $count));\n\t}",
"public function getPosition() {\n $rest = rtrim($this->scanner->checkUntil('\\r?\\n'));\n $parsed = $this->scanner->getScanned();\n $lines = explode(\"\\n\", $parsed);\n \n return array(\"lineno\" => count($lines),\n \"column\" => strlen(end($lines)),\n \"line\" => end($lines).$rest);\n }",
"public function testUpdatesColumnNumbersInErrorForFileContext()\n {\n $caughtError = null;\n\n try {\n /** @noinspection PhpUnhandledExceptionInspection */\n $source = new Source('?', 'foo.php', new SourceLocation(1, 5));\n $this->getLexer($source)->advance();\n } catch (SyntaxErrorException $e) {\n $caughtError = $e;\n }\n\n $this->assertEquals(\n \"Syntax Error: Cannot parse the unexpected character \\\"?\\\".\\n\" .\n \"\\n\" .\n \"foo.php (1:5)\\n\" .\n \"1: ?\\n\" .\n \" ^\\n\",\n (string)$caughtError\n );\n }",
"public function getCursorPosition()\n {\n return $this->cursor;\n }",
"public function getCursor(): int\n {\n return $this->cursor;\n }",
"public function getStartCursor()\n {\n return $this->str_start_cursor;\n }",
"public function getEndCursor()\n {\n return $this->end_cursor;\n }",
"public function printBrokenLocations() {\n\t\t\t$temp = $this->headBrokenLocation;\n\n\t\t\twhile ($temp != NULL) {\n\t\t\t\techo \"(\".$temp->xPos.\", \".$temp->yPos.\") \";\n\t\t\t\t$temp = $temp->next;\n\t\t\t}\n\t\t}",
"public function lastError()\n {\n if (!empty($this->_query->_ERRORS)) {\n echo '<pre>';\n echo $this->_query->_ERRORSPLAIN[ count($this->_query->_ERRORS) - 1 ];\n echo '</pre>';\n } elseif (!empty($this->_ERRORS)) {\n echo '<pre>';\n echo $this->_ERRORSPLAIN[ count($this->_ERRORS) - 1 ];\n echo '</pre>';\n }\n }",
"public function setCursor(string $cursor): void;",
"private function setCursor()\n {\n $this->tcpdf->SetXY(\n self::CURSOR_X,\n self::CURSOR_Y\n );\n }",
"public function getCursor()\n {\n return $this->cursor;\n }",
"public function cursorCommand()\n {\n $this->write('hello, this in ' . __METHOD__);\n\n // $this->output->panel($_SERVER, 'Server information', '');\n\n $this->write('this is a message text.', false);\n\n sleep(1);\n AnsiCode::make()->cursor(AnsiCode::CURSOR_BACKWARD, 6);\n\n sleep(1);\n AnsiCode::make()->cursor(AnsiCode::CURSOR_FORWARD, 3);\n\n sleep(1);\n AnsiCode::make()->cursor(AnsiCode::CURSOR_BACKWARD, 2);\n\n sleep(2);\n\n AnsiCode::make()->screen(AnsiCode::CLEAR_LINE, 3);\n\n $this->write('after 2s scroll down 3 row.');\n\n sleep(2);\n\n AnsiCode::make()->screen(AnsiCode::SCROLL_DOWN, 3);\n\n $this->write('after 3s clear screen.');\n\n sleep(3);\n\n AnsiCode::make()->screen(AnsiCode::CLEAR);\n }",
"public function setCursor($var)\n {\n GPBUtil::checkString($var, True);\n $this->cursor = $var;\n }",
"public function getCursor()\n {\n return $this->_cursor;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get CreditCardType value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0) | public function getCreditCardType()
{
return isset($this->CreditCardType) ? $this->CreditCardType : null;
} | [
"public function getCreditcardType();",
"public function getCardType(): string|null\n {\n if (!$this->hasCardType()) {\n $this->setCardType($this->getDefaultCardType());\n }\n return $this->cardType;\n }",
"public function getCardType() {\n return $this->cardType;\n }",
"public function getCardType()\n {\n return $this->_cardType;\n }",
"public function getCardType() {\n return $this->cardType;\n }",
"public function get_card_type() {\n\n\t\t// note that creditCardDetails->cardType is not used here as it is already prettified (e.g. American Express instead of amex)\n\t\treturn Framework\\SV_WC_Payment_Gateway_Helper::card_type_from_account_number( $this->get_bin() );\n\t}",
"public function getCreditTypeAttribute()\n {\n $type = @$this->attributes[\"credit_type\"] > 0 ? \"Payant\" : \"Gratuit\";\n return $type;\n }",
"public function getCardType()\n {\n if (empty($this->getOrder()->payment->paymentMethod)) {\n return null;\n }\n\n return $this->getOrder()->payment->paymentMethod->__toString();\n }",
"public function getDefaultCardType(): string|null;",
"public function get_payment_type() {\n\n\t\treturn 'credit_card' === $this->get_request()->get_order()->payment->type ? 'credit-card' : 'echeck';\n\t}",
"public function get_credit_card_integration_type() {\r\n\t\treturn $this->credit_card_integration_type;\r\n\t}",
"public function getCreditCardTypes();",
"public function get_card_type() {\n\n\t\t$card_type = ! empty( $this->token->paymentMethod->network ) ? $this->token->paymentMethod->network : 'card';\n\n\t\treturn SV_WC_Payment_Gateway_Helper::normalize_card_type( $card_type );\n\t}",
"public function get_payment_type() {\n\n\t\tif ( ! isset( $this->response_xml->transactionResponse->accountType ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn ( 'eCheck' === $this->response_xml->transactionResponse->accountType ) ? 'echeck' : 'credit-card';\n\t}",
"public function hasCardType(): bool;",
"public function getCustomerType()\n {\n if (!$content = $this->getContent()) {\n return false;\n }\n\n if (!preg_match('/\\s*(Regular|Rewards):/', $content, $matches)\n || !isset($matches[1])) {\n $this->error = self::ERR_INPUT_CUSTOMERTYPE;\n $this->errno = self::ERR_INPUT_CUSTOMERTYPE_NO;\n return false;\n }\n\n return $matches[1];\n }",
"public function get_payment_type();",
"public function getCrrType(): ?string {\n return $this->crrType;\n }",
"public function getCreditCardTypes() {\n $cardTypes = array();\n $setting = new Cart66Setting();\n $cards = Cart66Setting::getValue('auth_card_types');\n if($cards) {\n $cards = explode('~', $cards);\n if(in_array('mastercard', $cards)) {\n $cardTypes['MasterCard'] = 'mastercard';\n }\n if(in_array('visa', $cards)) {\n $cardTypes['Visa'] = 'visa';\n }\n if(in_array('amex', $cards)) {\n $cardTypes['American Express'] = 'amex';\n }\n if(in_array('discover', $cards)) {\n $cardTypes['Discover'] = 'discover';\n }\n }\n return $cardTypes;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the timeBegan property value. Time when this job run began. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z. | public function setTimeBegan(?DateTime $value): void {
$this->getBackingStore()->set('timeBegan', $value);
} | [
"public function setStartTime(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->start_time = $var;\n }",
"public function setStartedTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->started_time = $var;\n\n return $this;\n }",
"public function SetStartTime($start)\n\t{\n\t\t$this->startTime = $start;\n\t}",
"public function setStartTime() {\n\t\t$this->pg_start = $this->getStartTime();\n\t}",
"Public Function setStarttime(DateTime $start) { $this->starttime = $start; }",
"public function setLastStartedTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->last_started_time = $var;\n\n return $this;\n }",
"public function set_schedule_start_time( $timestamp ) {\n\t\t$this->schedule_start_time = $timestamp;\n\t}",
"public function setStartTime($v)\n\t{\n\t\t$this->startTime = $v;\n\t}",
"function setStartTime() {\n\t\t$this->start_time = XMLGlobal::_getMicroTime();\n\t}",
"public\r\n function setStertTime($startTime) {\r\n $this->startTime = $startTime;\r\n }",
"public function setStartTime($newStartTime) {\r\n\t\r\n\t\t$this->localStartTime = $newStartTime;\r\n\r\n\t}",
"public function setStartTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Type\\TimeOfDay::class);\n $this->start_time = $var;\n\n return $this;\n }",
"protected function setStartTime()\n {\n $date_is_valid = $this->setDate();\n $time_is_valid = $this->setTime();\n \n if ( ! $date_is_valid || ! $time_is_valid ) {\n return;\n }\n \n // Convert the separate date and time strings to a single UNIX datetime value\n $timestamp = ( strtotime( $this->date->getFormatted() ) + $this->time->getSeconds() );\n $this->data['start_time'] = date( 'Y-m-d H:i:s', $timestamp );\n $this->record->set('start_time', $this->data['start_time']);\n }",
"public function getStartTimestamp() {}",
"public function getStartTimestamp() {\n\t\t\treturn $this->startTime ?? 0;\n\t\t}",
"public function set_start_time($start_time) {\n\t\t$this->start_time = $start_time;\n\t}",
"function set_start_time($new_start_time){\n\t\t$this->start_time=$new_start_time;\n\t}",
"function setStartTime($event, $time) {\n Timer::timers($event, array(\n 'start' => $time,\n 'stopped' => false\n ));\n }",
"public function getStartedTime()\n {\n return $this->started_time;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a valid csv row from a post id | protected static function make_csv_row_from_feedback( $post_id, $fields ) {
$content_fields = self::parse_fields_from_content( $post_id );
$all_fields = array();
if ( isset( $content_fields['_feedback_all_fields'] ) )
$all_fields = $content_fields['_feedback_all_fields'];
// Overwrite the parsed content with the content we stored in post_meta in a better format.
$extra_fields = get_post_meta( $post_id, '_feedback_extra_fields', true );
foreach ( $extra_fields as $extra_field => $extra_value ) {
$all_fields[$extra_field] = $extra_value;
}
// The first element in all of the exports will be the subject
$row_items[] = $content_fields['_feedback_subject'];
// Loop the fields array in order to fill the $row_items array correctly
foreach ( $fields as $field ) {
if ( $field === __( 'Contact Form', 'jetpack' ) ) // the first field will ever be the contact form, so we can continue
continue;
elseif ( array_key_exists( $field, $all_fields ) )
$row_items[] = $all_fields[$field];
else
$row_items[] = '';
}
return $row_items;
} | [
"public function export_by_id($post_id=0){\r\n $this->check_if_active(\"export_by_id\"); \r\n\r\n check_ajax_referer( 'tmexport_form_nonce_'.$post_id, 'security' );\r\n\r\n $tm_meta= get_post_meta( $post_id , 'tm_meta' , true );\r\n \r\n if ( !empty($tm_meta) \r\n && is_array($tm_meta) \r\n && isset($tm_meta['tmfbuilder']) \r\n && is_array($tm_meta['tmfbuilder'])\r\n ){\r\n\r\n $tm_meta=$tm_meta['tmfbuilder'];\r\n \r\n $csv = new tm_convert_array_to_csv();\r\n $tm_meta=$csv->convert($tm_meta);\r\n\r\n $sitename = sanitize_key( get_bloginfo( 'name' ) );\r\n if ( ! empty( $sitename ) ){\r\n $sitename .= '.';\r\n }\r\n $filename = $sitename . 'form.' .$post_id. '.' . date( 'Y-m-d-H-i-s' ) . '.csv';\r\n \r\n if (!isset($_SESSION)){\r\n session_start();\r\n }\r\n \r\n $_SESSION[$filename]=$tm_meta;\r\n $this->download($filename);\r\n }\r\n \r\n }",
"public function test_csv_creation() {\n\t\t// Create posts.\n\t\t$post_id = wl_create_post( '', 'csv-post1', 'A post with no entities', 'publish', 'post' );\n\t\t$post_id_2 = wl_create_post( '', 'csv-post2', 'A post with no entities', 'publish', 'post' );\n\n\t\t// Create entity.\n\t\t$entity_id = wl_create_post( '', 'csv-entity1', 'An Entity', 'publish', 'entity' );\n\n\t\t// Add relation between our entity and post.\n\t\twl_core_add_relation_instance( $post_id, WL_WHAT_RELATION, $entity_id );\n\t\twl_core_add_relation_instance( $post_id_2, WL_WHAT_RELATION, $entity_id );\n\n\t\t// Get the CSV content.\n\t\tob_start();\n\t\t$this->export_service->create_csv();\n\t\t$response = ob_get_clean();\n\n\t\t// Turn the CSV back to array.\n\t\t$csv_object = str_getcsv( $response, \"\\n\" );\n\n\t\t$this->assertCount( 3, $csv_object );\n\n\t\t$this->assertEquals( 'ga:pagePath,ga:dimension1,ga:dimension2', $csv_object[0] );\n\t}",
"function oublog_get_tags_csv($postid) {\n global $CFG;\n\n $sql = \"SELECT t.tag\n FROM {$CFG->prefix}oublog_taginstances ti\n INNER JOIN {$CFG->prefix}oublog_tags t ON ti.tagid = t.id\n WHERE ti.postid = $postid \";\n\n if ($tags = get_fieldset_sql($sql)) {\n return(implode(', ', $tags));\n } else {\n return('');\n }\n}",
"public function PostCsv() {\n return Excel::download(new PostExport, 'post.csv');\n }",
"private function addCsv($id)\n {\n // add CSV file to archive\n $csv = new MakeCsv($id, $this->type);\n $this->zip->addFile($csv->filePath, $this->folder . \"/\" . $this->cleanTitle . \".csv\");\n $this->filesToDelete[] = $csv->filePath;\n }",
"public function importCSVItemPost()\n {\n checkPermission('add_post');\n $txtFileName = inputPost('txtFileName');\n $index = inputPost('index');\n $title = $this->postAdminModel->importCSVItem($txtFileName, $index);\n if (!empty($title)) {\n resetCacheDataOnChange();\n $data = [\n 'result' => 1,\n 'title' => $title,\n 'index' => $index\n ];\n echo json_encode($data);\n } else {\n $data = [\n 'result' => 0,\n 'index' => $index\n ];\n echo json_encode($data);\n }\n }",
"function fatherly_fcr_populate_data()\n{\n global $wpdb;\n $table_name = $wpdb->prefix . 'feed_content_recirculation_posts';\n $csv_file = __DIR__ . '/inc/data/popular_posts.csv';\n $csv_file_data = array_map('str_getcsv', file($csv_file));\n\n foreach ($csv_file_data as $csv_file_datum) {\n $wpdb->insert($table_name, array('post_url' => $csv_file_datum[0], 'post_id' => $csv_file_datum[1]));\n }\n}",
"function spots_imex_create_csv( $spots ) {\n \n foreach( $spots as $s ) {\n $csv .= \"\\n{$s->post_title}, {$s->post_content}, {$s->post_status}, {$s->post_name}\";\n }\n \n return $csv;\n}",
"public function export_orderitem_csv() {\n\n\t\tglobal $wpdb;\n\n\t\t// Create Temporaray CSV file\n\t\t$filename = 'wpl-ebay-orderitems-'.date_i18n( \"Y-m-d_H-i-s\" ).'.csv';\n\t\t$filepath = $filename;\n\t\t$fp = fopen( $filepath, 'w' );\n\n\t\t// Generate Header Row\n\t\t$header = array();\n\t\tarray_push( $header, \"item_id\" );\n\t\tarray_push( $header, \"title\" );\n\t\tarray_push( $header, \"sku\" );\n\t\tarray_push( $header, \"quantity\" );\n\t\tarray_push( $header, \"transaction_id\" );\n\t\tarray_push( $header, \"OrderLineItemID\" );\n\t\tarray_push( $header, \"TransactionPrice\" );\n\t\tarray_push( $header, \"OrderID\" );\n\t\tarray_push( $header, \"DateCreated\");\n\t\t\n\t\tfputcsv( $fp, $header );\n\n\t\t// Generate Data Rows\n\t\t\n\t\t$table_name = $wpdb->prefix . 'ebay_orders';\n\t\t\n\t\t$result = $wpdb->get_results( \"SELECT * FROM $table_name\" );\n\t\t\n\t\tforeach ( $result as $row ) {\n\n\t\t\t// One Order Item Per Row\n\t\t\tforeach( $this->decodeObject($row->items) as $item ) {\n\n\t\t\t\t$csv_data_row = array();\n\n\t\t\t\tarray_push( $csv_data_row, $item['item_id'] );\n\t\t\t\tarray_push( $csv_data_row, $item['title'] );\n\t\t\t\tarray_push( $csv_data_row, $item['sku'] );\n\t\t\t\tarray_push( $csv_data_row, $item['quantity'] );\n\t\t\t\tarray_push( $csv_data_row, $item['transaction_id'] );\n\t\t\t\tarray_push( $csv_data_row, $item['OrderLineItemID'] );\n\t\t\t\tarray_push( $csv_data_row, $item['TransactionPrice'] );\n\t\t\t\tarray_push( $csv_data_row, $row->order_id );\n\t\t\t\tarray_push( $csv_data_row, $row->date_created );\n\n\t\t\t\tfputcsv( $fp, $csv_data_row );\n\t\t\t}\t\t\n\n\t\t}\n\n\t\tfclose( $fp );\n\n\t\t// Download CSV\n\t\theader( 'Content-Type:application/octet-stream' );\n\t\theader( 'Content-Disposition:filename='.$filename );\n\t\theader( 'Content-Length:' . filesize( $filepath ) );\n\t\treadfile( $filepath ); \n\n\t\t// Delete temporary file\n\t\tunlink( $filepath );\n\n\t\texit;\n\t}",
"protected function createCsvFeed() {\n $feed_type = $this->createFeedTypeForCsv(['guid', 'title'], [\n 'mappings' => array_merge($this->getDefaultMappings(), [\n [\n 'target' => 'feeds_item',\n 'map' => [\n 'guid' => 'guid',\n 'url' => 'url',\n ],\n ],\n ]),\n ]);\n\n // Create a feed for the article to belong to.\n $feed = $this->createFeed($feed_type->id(), [\n 'source' => $this->resourcesPath() . '/csv/content.csv',\n ]);\n\n return $feed;\n }",
"public function csv();",
"function get_post_name($id){\r\n\r\n\tif(!file_exists(ENTRIES_PATH . $id)) return false;\r\n\t\r\n\t$file = fopen(ENTRIES_PATH . \".entries\",'rb');\r\n\twhile($line = fgetcsv($file,8192,\";\")){\r\n\t\tif($id == $line[0]){\r\n\t\t\t$name = $line[1];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\tfclose($file);\r\n\t\r\n\tif($name != null) return $name;\r\n\telse return false;\r\n}",
"private function makeHTMLCsv($fields,$data)\n { \n $csv_data = '';\n $csv_data .= '<strong>'.implode(\",\",$fields).'</strong><br>';\n foreach($data as $key=>$value)\n { \n $primary_key = $key;//just for future use\n foreach($fields as $k=>$v)\n {\n $csv_data .= ''.$value[$v].',';\n }\n $csv_data = rtrim($csv_data);\n $csv_data .= '<br>';\n } \n return $csv_data;\n }",
"private function tracking_menu_export_csv()\n {\n\n //verify capability\n if ( ! current_user_can(get_option($this->shared->get('slug') . \"_capabilities_tracking_menu\"))) {\n die();\n }\n\n //Set the PHP \"Max Execution Time\" and \"Memory Limit\" based on the values defined in the options\n $this->shared->set_met_and_ml();\n\n //get the data from the db table\n global $wpdb;\n $table_name = $wpdb->prefix . $this->shared->get('slug') . \"_tracking\";\n $results = $wpdb->get_results(\"SELECT * FROM $table_name ORDER BY date DESC\", ARRAY_A);\n\n //if there are data generate the csv header and content\n if (count($results) > 0) {\n\n $csv_content = '';\n $new_line = \"\\n\";\n\n //set the csv header\n header('Content-Encoding: UTF-8');\n header('Content-type: text/csv; charset=UTF-8');\n header(\"Content-Disposition: attachment; filename=tracking-\" . time() . \".csv\");\n header(\"Pragma: no-cache\");\n header(\"Expires: 0\");\n\n //set headings\n $csv_content .= '\"' . $this->esc_csv(__('Tracking ID', 'daam')) . '\",';\n $csv_content .= '\"' . $this->esc_csv(__('User IP', 'daam')) . '\",';\n $csv_content .= '\"' . $this->esc_csv(__('Date', 'daam')) . '\",';\n $csv_content .= '\"' . $this->esc_csv(__('Autolink', 'daam')) . '\",';\n $csv_content .= '\"' . $this->esc_csv(__('Post', 'daam')) . '\"';\n $csv_content .= $new_line;\n\n //set column content\n foreach ($results as $result) {\n\n $csv_content .= '\"' . $this->esc_csv($result['tracking_id']) . '\",';\n $csv_content .= '\"' . $this->esc_csv(stripslashes($result['user_ip'])) . '\",';\n $csv_content .= '\"' . $this->esc_csv(mysql2date(get_option('date_format'), $result['date'])) . '\",';\n\n $autolink_obj = $this->shared->get_autolink_object($result['autolink_id']);\n if (isset($autolink_obj->name)) {\n $csv_content .= '\"' . $this->esc_csv(stripslashes($autolink_obj->name)) . '\",';\n } else {\n $csv_content .= '\"' . esc_attr__('Not Available', 'daam') . '\",';\n }\n\n if (get_post_status($result['post_id']) !== false) {\n $csv_content .= '\"' . $this->esc_csv(get_post_field('post_title', $result['post_id'], 'raw')) . '\"';\n } else {\n $csv_content .= '\"' . esc_attr__('Not Available', 'daam') . '\"';\n }\n\n $csv_content .= $new_line;\n\n }\n\n } else {\n return false;\n }\n\n echo $csv_content;\n die();\n\n }",
"function generate_bulk_parent_csv($class_id = '', $section_id = '')\n\t {\n\t if ($this->session->userdata('admin_login') != 1)\n\t redirect(site_url('login'), 'refresh');\n\n\t $data['class_id'] = $class_id;\n\t $data['section_id'] = $section_id;\n\t $data['year'] = $this->db->get_where('settings', array('type'=>'running_year'))->row()->description;\n\n\t $file = fopen(\"uploads/parent_bulk.csv\", \"w\");\n\t $line = array('ParentName', 'Email', 'Password', 'Phone', 'Address', 'Profession');\n\t fputcsv($file, $line, ',');\n\t echo $file_path = base_url() . 'uploads/parent_bulk.csv';\n\t }",
"public function actionExportSubmissions($id)\r\n {\r\n\r\n try {\r\n\r\n\r\n $formModel = $this->findFormModel($id);\r\n $formDataModel = $formModel->formData;\r\n\r\n $query = FormSubmission::find()\r\n ->select(['id', 'data', 'created_at'])\r\n ->where('{{%form_submission}}.form_id=:form_id', [':form_id' => $id])\r\n ->orderBy('created_at DESC')\r\n ->with('files')\r\n ->asArray();\r\n\r\n // Create the CSV into memory\r\n $csv = Writer::createFromFileObject(new SplTempFileObject());\r\n\r\n // Insert fields names as the CSV header\r\n $labels = $formDataModel->getFieldsForEmail();\r\n $header = array_values($labels);\r\n // Add File Fields\r\n $fileFields = $formDataModel->getFileFields();\r\n $header = array_merge($header, array_values($fileFields)); // Add only labels\r\n array_unshift($header, '#');\r\n array_push($header, Yii::t('app', 'Submitted'));\r\n $keys = array_keys($labels);\r\n $csv->insertOne($header);\r\n\r\n // To iterate the row one by one\r\n $i = 1;\r\n foreach ($query->each() as $submission) {\r\n // $submission represents one row of data from the form_submission table\r\n $data = json_decode($submission['data'], true);\r\n // Stringify fields with multiple values\r\n foreach ($data as $name => &$field) {\r\n if (is_array($field)) {\r\n $field = implode(', ', $field);\r\n }\r\n }\r\n // Only take data of current fields\r\n $fields = [];\r\n $fields[\"id\"] = $i++;\r\n foreach ($keys as $key) {\r\n $fields[$key] = isset($data[$key]) ? $data[$key] : '';\r\n }\r\n // Add files\r\n $f = 0;\r\n foreach ($fileFields as $name => $label) {\r\n if (isset($submission['files'], $submission['files'][$f])) {\r\n $file = $submission['files'][$f];\r\n $fileName = $file['name'] .'.'.$file['extension'];\r\n $fields[$name] = Form::FILES_DIRECTORY . '/' . $formModel->id . '/' . $fileName;\r\n } else {\r\n $fields[$name] = '';\r\n }\r\n $f++;\r\n }\r\n\r\n $fields[\"created_at\"] = Yii::$app->formatter->asDatetime($submission['created_at']);\r\n $csv->insertOne($fields);\r\n }\r\n\r\n // Print to the output stream\r\n $csv->output($formModel->name . '.csv');\r\n\r\n } catch (\\Exception $e) {\r\n\r\n throw new Exception($e->getMessage());\r\n\r\n }\r\n\r\n }",
"public function download_csv(){\t\n\t\tConfigure::write('Post.HEADER_CSV_VIEW_POSTLIST',Hash::flatten(Configure::read('Post.HEADER_CSV_VIEW_POSTLIST')));\n\t\t$this->export(array(\n\t\t\t'fields' => array('Post.id', 'Post.title', 'Post.content', 'Blog.domain'),\n\t\t\t'order' => array('Post.id' => 'desc'),\n\t\t\t'mapHeader' => 'Post.HEADER_CSV_VIEW_POSTLIST',\n\t\t\t'filename' => date('Y-m-d-H-i-s').'_BLOGX_POSTLIST',\n\t\t\t'callbackHeader'=>'header_csv_post',\n\t\t\t'callbackRow'=>'row_csv_post',\n\t\t));\n\t}",
"public function createTempTable()\n {\n $l_header = array_filter(\n $this->m_arTableHeader,\n function ($p_val)\n {\n return !(empty($p_val) || $p_val == 'ID');\n }\n );\n\n $l_csv = \\League\\Csv\\Writer::createFromFileObject(new SplTempFileObject)\n ->setDelimiter(';')\n ->addFormatter(\n function ($p_val)\n {\n return array_map('utf8_decode', $p_val);\n }\n )\n ->insertOne(array_map('_L', array_values($l_header)));\n\n if ($this->m_resData)\n {\n $this->write_generic_category_rows($l_csv, $l_header);\n } // if\n\n // Don't use a \"else\" here in case a list displays two tables (see guest systems).\n if ($this->m_arData && is_array($this->m_arData) && count($this->m_arData))\n {\n // Right now this logic is optimized for custom categories.\n $this->write_custom_category_rows($l_csv, $l_header);\n } // if\n\n $l_csv->output($this->get_csv_filename());\n die;\n }",
"public function csv_export() {\n\t$export = \"\";\n\t$order_id = null;\n\t$order_ids = array();\n\t$headers = array();\n\t$products = array();\n\t$summaries = array();\n\tforeach ($this->records as $record) {\n\t $order_id = $record[\"order_id\"];\n\t $order_ids[] = $order_id;\n\t if(!isset($headers[$order_id])) {\n\t\t$headers[$order_id] = $this->build_order_header($record);\n\t }\n\t $products[$order_id] = (isset($products[$order_id]) ? $products[$order_id] : '').$this->build_order_product_line($record);\n\t if(!isset($summaries[$order_id])) {\n\t\t$summaries[$order_id] = $this->build_order_summary($record);\n\t }\n\t}\n\t$order_ids = array_unique($order_ids);\n\tforeach($order_ids as $oid) {\n\t $export .= $headers[$oid].$products[$oid].$summaries[$oid];\n\t}\n\n\treturn $export;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve disable order references config. | public function getShowOrderReferences()
{
return (bool) (!Mage::getStoreConfig('qquoteadv/layout/layout_disable_all_order_references', $this->getStoreId()));
} | [
"public function getConfig()\n {\n return $this->_orderConfig;\n }",
"public function getDisabledLinks()\n {\n\t\t$disabled = explode(',', Mage::getStoreConfig('faonni_accountnavigation/general/disabled_link'));\n\t\t$links = $this->getLinks();\n\t\t\n\t\tforeach($links as $key => $name){\n\t\t\tif(!in_array($key, $disabled)) unset($links[$key]);\n\t\t}\n\t\treturn $links;\n }",
"public function getDisableConditions()\n {\n $value = $this->_config->get('general/disable_conditions');\n\n if ($value === null) {\n $value = [];\n }\n\n return $value;\n }",
"public function getConfig()\n {\n return Mage::getSingleton('sales/order_config');\n }",
"function getEasychartOrderConfiguration()\n {\n $orderbook=array(); \n if (function_exists(\"get_EasychartConfiguration\"))\n {\n $orderConfig=get_EasychartConfiguration();\n if ( (is_array($orderConfig)) && (count($orderConfig)>0) ) // geht auch effizienter, siehe oben\n {\n foreach (get_EasychartConfiguration() as $index => $entry)\n {\n // parse configuration, entry ist der Input und order der angepasste Output\n configfileParser($entry, $order, [\"ORDERS\",\"Orders\",\"Order\",\"orders\" ],\"Orders\" , null); \n if ((isset($order[\"Orders\"]))===false) $order[\"Orders\"]=$entry;\n $orderbook[$index]=$order[\"Orders\"];\n }\n }\n } \n return ($orderbook);\n }",
"public function getConfig(){\r\n\t\treturn Mage::helper('ordergroove/config');\r\n\t}",
"public function getExcludedSettings() { }",
"public function getDependencyConfig()\n {\n return [\n 'aliases' => [],\n 'factories' => [\n Repository\\RepositoryLookup::class => Repository\\Factory\\RepositoryLookupFactory::class,\n ]\n ];\n }",
"protected function _getDisabledModules()\n {\n return $this->_getConfigValue('aDisabledModules');\n }",
"public function getConfig()\n {\n return $this->_addressConfig;\n }",
"protected function get_disabled_settings($settings)\n {\n }",
"public function getConfig()\n {\n return $this->_invoiceConfig;\n }",
"public function getDisableResilienceDefaults()\n {\n if (array_key_exists(\"disableResilienceDefaults\", $this->_propDict)) {\n return $this->_propDict[\"disableResilienceDefaults\"];\n } else {\n return null;\n }\n }",
"public function getDisableUdpConnections()\n {\n if (array_key_exists(\"disableUdpConnections\", $this->_propDict)) {\n return $this->_propDict[\"disableUdpConnections\"];\n } else {\n return null;\n }\n }",
"public function referenceNumberOptions() : array\n {\n return $this->referenceNumberOptions ?? $this->getDefaultReferenceNumberOptions();\n }",
"public function checkoutConfig(): array\n {\n $config = $this->arrayRecursive(\n config: $this->config,\n );\n\n // unset Payment Method\n Arr::forget($config, 'payment_method');\n\n return $config;\n }",
"public function getDependencyConfiguration()\n {\n if(!is_array($this->_dependency_configuration))\n {\n $this->_dependency_configuration = $this->getComponent()\n ->getComponentConfiguration()\n ->getDependencies();\n }\n return $this->_dependency_configuration;\n }",
"public function getEnabledRefcodes() {\n\t\t$sql = $this->db->prepare(\n\t\t\t\"SELECT\t\t*\n\t\t\tFROM\t\trefcode\n\t\t\tWHERE\t\tisDisabled = ?\"\n\t\t);\n\t\t\n\t\ttry {\n\t\t\t$sql->execute(array(0));\n\t\t}\n\t\tcatch (PDOException $e) {\n\t\t\techo $e->getMessage();\n\t\t}\n\t\t\n\t\t$refcodeList = $sql->fetchAll(PDO::FETCH_ASSOC);\n\t\t\n\t\treturn $refcodeList;\n\t}",
"public function getCheckoutConfig();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether the total auth vehicles has dropped below the number of discs added | protected function hasTotAuthVehiclesDroppedBelowDiscsCount($data)
{
$totAuthVehicles = $this->getTotAuthVehicles($data);
$totDiscs = count($data['licence']['psvDiscs']);
return $totAuthVehicles < $totDiscs;
} | [
"protected function hasTotAuthVehiclesDroppedBelowDiscsCount()\n {\n $totAuthVehicles = $this->getTotAuthVehicles($this->application);\n $totDiscs = $this->licence->getPsvDiscsNotCeasedCount();\n\n return $totAuthVehicles < $totDiscs;\n }",
"protected function hasTotAuthVehiclesDroppedBelowVehicleCount($data)\n {\n $totAuthVehicles = $this->getTotAuthVehicles($data);\n\n $totVehicles = $this->countVehicles($data['licence']['licenceVehicles']);\n\n return $totAuthVehicles < $totVehicles;\n }",
"public function isVendorCapHit()\n\t{\n\t\treturn sizeof($this->vendors) >= 12;\n\t}",
"protected function dodgeAttack()\n {\n $marker = $this->getMarker();\n\n if ($marker <= ($this->getLuck() * 100)) {\n return true;\n }\n\n return false;\n }",
"protected function hasTotAuthVehiclesIncreased($data)\n {\n $totAuthVehicles = $this->getTotAuthVehicles($data);\n $totAuthLicenceVehicles = $this->getTotAuthVehicles($data['licence']);\n\n return $totAuthVehicles > $totAuthLicenceVehicles;\n }",
"public function checkForDropTrades()\n {\n if ($this->last_rcp_update()->rcp_update_drops->count() && $this->rcp_drop_trades->count()) {\n\n // Exclude Gallup and Ras Obama drops, if applicable. These are truly only ever replaced.\n $exclusions = array(1345, 1349,);\n\n $actual_drops = $this->last_rcp_update()->rcp_update_drops->pluck('rcp_contest_pollster_id')->toArray();\n if (count($actual_drops) > 1) {\n foreach ($exclusions as $element) {\n if (in_array($element, $actual_drops)) {\n $loc = array_search($element, $actual_drops);\n unset($actual_drops[$loc]);\n }\n }\n }\n sort($actual_drops);\n\n foreach ($this->rcp_drop_trades as $dt) {\n $predicted_drops = array($dt->rcp_contest_pollster_id_1);\n if ($dt->rcp_contest_pollster_id_2) {\n $predicted_drops[] = $dt->rcp_contest_pollster_id_2;\n if ($dt->rcp_contest_pollster_id_3) {\n $predicted_drops[] = $dt->rcp_contest_pollster_id_3;\n if ($dt->rcp_contest_pollster_id_4) {\n $predicted_drops[] = $dt->rcp_contest_pollster_id_4;\n }\n }\n }\n sort($predicted_drops);\n\n if ($predicted_drops == $actual_drops) {\n $bot = new TraderBot();\n $bot->executeRcpDropTrade($dt);\n \n $dt->rcp_update_id = $this->last_rcp_update()->id;\n $dt->auto_trade_me = 0;\n $dt->save();\n }\n }\n }\n return;\n }",
"public function isExceedingCountThreshold() {\n\t\treturn $this->count >= config('passwordprotect.onfailure_captcha_counter_threshold');\n\t}",
"private function isAtCapacity(): bool\n {\n $count = count($this);\n $max = config(\"groups.max_users\");\n\n if ($max <= 0 || $max == false) {\n return false;\n }\n\n return $count >= $max;\n }",
"public function validate_deposit_count(){\n\t\t$deposits = $this->validate_count(1);\n\t\tif($deposits < 4){\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"public function hasMinimumDriveCount()\n {\n return count($this->getDrives()) >= $this->minimumDrives;\n }",
"private function isDiscountLimitReached()\n {\n return ($this->getAmount() >= $this->getDiscount()->getMinimumAmount());\n }",
"public function canRemoveConsumable(): bool\n {\n return $this->total > $this->getMin();\n }",
"protected function exceedsRateLimit() : Boolean\n {\n $count = $this->repository->count($this->event);\n $cost = $this->event->getCost();\n $limit = $this->limit->getLimit();\n\n return $count->add($cost)->greaterThan($limit);\n }",
"function guestsNeedsToBeDiscarded()\n {\n $cards = $this->guestcards->getCardsInLocation(DECK_LOC_RIVER);\n $allSuits = $this->concatenateColorsFromCards($cards);\n return count($allSuits) != count(array_unique($allSuits));\n }",
"private function hasEnoughNonGiveaways()\n {\n return $this->getCartNonGiveawayProductsAmounts() >= $this->getNonGiveawaysPerCart();\n }",
"public function validate_withdraw_count(){\n\t\t$withdraw = $this->validate_count(2);\n\t\tif($withdraw < 3){\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"public final function hasRemaining() {\n\t\treturn $this->position < $this->limit;\n\t}",
"public function hasSpace(): bool\n {\n // Is the total number of cars less than the available size\n if ($this->countCars() < self::SIZE) {\n return true;\n } else {\n return false;\n }\n }",
"protected function hasUpdatedVehicles()\n {\n return ($this->application->getLicenceVehicles()->count() > 0);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ToDo: make method editRoom() | public function editRoom(){
} | [
"public function updateRoom()\n {\n $data = $this->validate();\n\n $room = Room::find($this->roomId);\n\n if ($room) {\n\n $room->update($data);\n\n $this->reset(['label', 'description', 'cost', 'roomId']);\n \n $this->emit('hideUpsertRoomModal');\n }\n \n }",
"private function updateRoom()\n {\n $sql = \"UPDATE Rooms SET RoomName = :roomname WHERE RoomID = $this->_roomID\";\n $statement = Database::connect()->prepare($sql);\n $statement->execute([\":roomname\" => $this->_roomName]);\n }",
"public function saveNewRoom($newRoom);",
"public function testRoomEdit()\n\t{\n\t\t$client = static::createClient([], [\n\t\t\t'PHP_AUTH_USER' => $this->username,\n\t\t\t'PHP_AUTH_PW' => $this->password,\n\t\t]);\n\n\t\t$client->request('POST', '/api/room/3/edit', [\n\t\t\t'name' => 'name',\n\t\t\t'description' => 'description'\n\t\t]);\n\t\t\n\t\t$this->assertEquals(200, $client->getResponse()->getStatusCode());\n\t}",
"public function updated(Room $room)\n {\n //\n }",
"public function newRoom(){\n }",
"function update_room_info($currentRoom){\r\n\t// Get the info of the user who is making the update\r\n\t$user = retrieve_dbPersons($_SESSION['_id']);\r\n\t$name = $user->get_first_name().\" \".$user->get_last_name();\r\n\t\r\n\t// Grab all of the variables and sanitize them\r\n\t$newBeds = sanitize($_POST['beds']);\r\n\t$newCapacity = sanitize($_POST['capacity']);\r\n\t$newBath = sanitize($_POST['bath']);\r\n\tif($newBath == \"Yes\"){\r\n\t\t$newBath = \"y\";\r\n\t}else{\r\n\t\t$newBath = \"n\";\r\n\t}\r\n\t$newStatus = sanitize($_POST['status']);\r\n\t$newRoomNotes = sanitize($_POST['room_notes']);\r\n\t$newBooking = sanitize($_POST['assign_booking']);\r\n\tif($newBooking == \"Leave Room Unassigned\" ||\r\n\t\t$newBooking == \"No\"){\r\n\t\t// don't update the booking\r\n\t\t$newBooking = false;\r\n\t}\r\n\t// Now update the current room object.\r\n\t// Update the booking last\r\n\t// Note that the room class automatically updates the database\r\n\t\r\n\t\r\n\t// Only update the status if you're a volunteer or manager\r\n\t// social workers cannot edit rooms\r\n\tif($_SESSION['access_level'] == 1 ||\r\n\t\t$_SESSION['access_level'] == 3){\r\n\t\t// add a log only if the status actually changed\r\n\t\t// then update the status\r\n\t\tif($newStatus != $currentRoom->get_status() &&\r\n\t\t\t$currentRoom->get_status() != \"booked\"){\r\n\t\t\t$currentRoom->set_status($newStatus);\r\n\t\t\t// Create the log message\r\n\t\t\t$message = \"<a href='viewPerson.php?id=\".$_SESSION['_id'].\"'>\".$name.\"</a>\".\r\n\t\t\t\" has changed the status of <a href='room.php?room=\".$currentRoom->get_room_no().\"'>room \".\r\n\t\t\t$currentRoom->get_room_no().\"</a>\";\r\n\t\t\tadd_log_entry($message);\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Update everything else only if you're a manager\r\n\tif($_SESSION['access_level'] == 3){\r\n\t\t$currentRoom->set_beds($newBeds);\r\n\t\t$currentRoom->set_capacity($newCapacity);\r\n\t\t$currentRoom->set_bath($newBath);\r\n\t\t$currentRoom->set_room_notes($newRoomNotes);\r\n\t\t\r\n\t\tif($newBooking){\r\n\t\t\t// Checkout the booking if the option was selected\r\n\t\t\tif($newBooking == \"Yes\"){\r\n\t\t\t $currentRoom->set_status(\"dirty\");\r\n\t\t\t\t//retrieve the booking and check it out\r\n\t\t\t\t$newBooking = retrieve_dbBookings($currentRoom->get_booking_id());\r\n\t\t\t\tif ($newBooking) {\r\n\t\t\t\t $newBooking->check_out(date(\"y-m-d\"));\t\t\t\r\n\t\t\t\t // Add a log to show that the family was checked out\r\n\t\t\t\t // Get the info of the primary guest\r\n\t\t\t\t $pGuest = retrieve_dbPersons($newBooking->get_guest_id());\r\n\t\t\t\t if ($pGuest) {\r\n\t\t\t\t $guestName = $pGuest->get_first_name().\" \".$pGuest->get_last_name();\r\n\t\t\t\t\r\n\t\t\t\t // Create the log message\r\n\t\t\t\t $message = \"<a href='viewPerson.php?id=\".$_SESSION['_id'].\"'>\".$name.\"</a>\".\r\n\t\t\t\t\t\t\" has checked out <a href='viewPerson.php?id=\".$pGuests[0].\"'>\".\r\n\t\t\t\t $guestName.\"</a>\";\r\n\t\t\t\t add_log_entry($message);\r\n\t\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// retrieve the booking and update it\r\n\t\t\t\t$newBooking = retrieve_dbBookings($newBooking);\r\n\t\t\t\t//$newBooking->assign_room($currentRoom->get_room_no());\r\n\t\t\t\t\r\n\t\t\t\t// Add a log to show that the family was checked in\r\n\t\t\t\t// Get the info of the primary guest\r\n\t\t\t\t$pGuest = retrieve_dbPersons($newBooking->get_guest_id());\r\n\t\t\t\t$guestName = $pGuest->get_first_name().\" \".$pGuest->get_last_name();\r\n\t\t\t\t\r\n\t\t\t\t// Create the log message\r\n\t\t\t\t$message = \"<a href='viewPerson.php?id=\".$_SESSION['_id'].\"'>\".$name.\"</a>\".\r\n\t\t\t\t\" has checked in <a href='viewPerson.php?id=\".$pGuests[0].\"'>\".\r\n\t\t\t\t$guestName.\"</a>\";\r\n\t\t\t\t// quick fix: don't add a log if the check in was not successful\r\n\t\t\t\tif ($newBooking->assign_room($currentRoom->get_room_no(),date('y-m-d'))){\r\n\t\t\t\t\tadd_log_entry($message);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}",
"public function postEdit() {\n\t\t\n\t\treturn View::make('room.edit')\n\t\t\t->with('rooms', RoomType::find(Input::get('id')))\n\t\t\t->with('facilities', Facility::all())\n\t\t\t->with('services', Service::all());\n\t}",
"public function updateRoom(Room $dto): bool\n {\n }",
"public function editAction(Room $entity)\n {\n $em = $this->getDoctrine()->getManager();\n\n $editForm = $this->createForm(new RoomType(), $entity);\n $deleteForm = $this->createDeleteForm($entity->getId());\n\n return $this->render('BenLogementBundle:Room:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"function edit() {\n\n //quay tro lai trang danh sach\n }",
"public function editHostelRoomType($id) {\n global $REQUEST_DATA;\n \n return SystemDatabaseManager::getInstance()->runAutoUpdate('hostel_room_type', array('hostelRoomTypeId','roomType','roomAbbr'), array($REQUEST_DATA['hostelRoomTypeId'],$REQUEST_DATA['roomType'],$REQUEST_DATA['roomAbbr']), \"hostelRoomTypeId=$id\" );\n }",
"public function get_edit($id)\n\t{\n\t\t$view = View::make('details.edit_room');\n\t\t$view->room = Rooms::find_by_id($id);\n\t\treturn $view;\n\t}",
"private function updateRoom() {\n\t\t$db = Database::getInstance();\n\t\tif(empty($this->username))\n\t\t\treturn FALSE;\n\t\t$x = $this->curr_room->getX();\n\t\t$y = $this->curr_room->getY();\n\t\t$z = $this->curr_room->getZ();\n\t\t$coord = \"{$x}{$y}{$z}\";\n\t\t$sql = \"UPDATE users SET room_coord = $coord WHERE username = '$this->username'\";\n\t\t\n\t\tif(!$db->ExecQuery($sql))\n\t\t\treturn FALSE;\n\t}",
"public function enter_room()\n\t{\n\t\t$room_id = $this->get_field(\"room_id\");\n\t\t$username = $this->get_field(\"username\");\n\t\t$this->CHESS->enter_room($room_id, $username);\n\t}",
"public function set_room($room) {\n\t\t$this->room = $room;\n\t}",
"public function SaveRooms() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->txtHostID) $this->objRooms->HostID = $this->txtHostID->Text;\n\t\t\t\tif ($this->txtUnlockedTracks) $this->objRooms->UnlockedTracks = $this->txtUnlockedTracks->Text;\n\t\t\t\tif ($this->txtUrk) $this->objRooms->Urk = $this->txtUrk->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the Rooms object\n\t\t\t\t$this->objRooms->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"protected function edit() {\n\t}",
"public function deleteRoom(){\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return error message for pattern checks | function needErr($pat, $v) {
if (preg_match("/^$pat$/",$v))
return '';
if ($v == '')
return "missing";
return "invalid";
} | [
"public function getPatternMsg(){\n return $this->data['patternMsg'] ? $this->data['patternMsg']: 'Option -'.$this->data['arg'].' must match pattern: '. $this->data['pattern'].\"\\n\";\n }",
"public function assertErrorRegExp($pattern, $message = '')\n {\n $output = implode(PHP_EOL, $this->_err->messages());\n $this->assertRegExp($pattern, $output, $message);\n }",
"public static function getMessagePattern();",
"public static function patternError(string $pattern) : bool\n {\n /*\n To tell if the pattern has errors, we simply try to use it.\n To detect and capture the error is not so simple, especially if we want to be sociable and not\n tramp on global state (e.g., the value of $php_errormsg). So, if 'track_errors' is on, we preserve\n the $php_errormsg value and restore it later. If 'track_errors' is not on, we turn it on (because\n we need it) but turn it off when we're done.\n */\n if ($old_track = ini_get('track_errors')) $old_message = isset($php_errormsg) ? $php_errormsg : false;\n else ini_set('track_errors', 1);\n /* We're now sure that track_errors is on. */\n\n unset($php_errormsg);\n @preg_match($pattern, ''); /*actually give the pattern a try! */\n $return_value = isset($php_errormsg) ? $php_errormsg : false;\n\n /* We've now captured what we need; restore global state to what it was. */\n if ($old_track) $php_errormsg = isset($old_message) ? $old_message : false;\n else ini_set('track_errors', 0);\n return $return_value;\n }",
"public static function assertRegExp($pattern, $string, $message = '') {}",
"function _password_changer_api_check_pattern($password, $pattern, $value, $error_message = 'Password complexity error.') {\r\n\r\n //Check if password required upper case\r\n $has_item = preg_match_all($pattern, $password, $matches);\r\n \r\n //if is require and it does not have this value at lea\r\n if ($value > 0 && $has_item < $value ) {\r\n watchdog('[password_changer_api_complexity][password_changer_api_check_pattern]' ,\r\n 'Value is required and is not in the password.' .\r\n $error_message, WATCHDOG_ERROR);\r\n throw new passwordChangerApiExeption($error_message); \r\n }//if is this value is deny and it has this value throw an error\r\n elseif ($value < 0 && $has_item > 0 ) {\r\n watchdog('[password_changer_api_complexity][password_changer_api_check_pattern]',\r\n 'Value is deny and is in the password' .\r\n $error_message, WATCHDOG_ERROR);\r\n throw new passwordChangerApiExeption($error_message); \r\n }\r\n \r\n \r\n}",
"function validate( $str, $for, $regex, $err_msg ){\n\t\tif( !preg_match( $regex, $str ) ){\n\t\t\techo createJSONMessage( GENERAL_ERROR_MESSAGE, $for, $err_msg );\n\t\t\texit();\n\t\t}\n\t}",
"private function _testPattern()\n\t {\n\t\t$description = $this->_descriptor->describe(\"Restrictions/patternRestriction\");\n\t\t$this->assertEquals(true, $this->_restrictionmanager->validate(\"test@test.com\", $description[\"restrictions\"]));\n\t\t$this->assertEquals(true, $this->_restrictionmanager->validate(\"test@test.com.au\", $description[\"restrictions\"]));\n\t\t$this->assertEquals(true, $this->_restrictionmanager->validate(\"test.test@test.com.au\", $description[\"restrictions\"]));\n\t\t$this->assertEquals(true, $this->_restrictionmanager->validate(\"Test2014@test.com\", $description[\"restrictions\"]));\n\t\t$this->assertEquals(false, $this->_restrictionmanager->validate(\"Test?201.[/]4@com\", $description[\"restrictions\"]));\n\t }",
"function conduit_validate_regex($pattern) {\n restore_error_handler();\n $return = @preg_match($pattern, '');\n set_error_handler('_drupal_error_handler');\n if ($return === FALSE) {\n $error = error_get_last();\n return $error['message'];\n }\n return TRUE;\n}",
"function test_pattern1() {\r\n\t\t\r\n\t\t$pattern\t\t= 'This is my {0} message post';\r\n\t\t$charArgs\t= array(0 => 'first');\r\n\t\t$intArgs\t\t= array(1);\r\n\t\t$floatArgs\t= array(2.50);\r\n\t\t$format = new MessageFormat($pattern);\r\n\r\n\t\t//Using character replacement parameters\r\n\t\t$this->assertEquals( 'This is my first message post', \r\n\t\t\t\t\t$format->formatMsg($charArgs), \r\n\t\t\t\t \t'Error parsing message string using character replacement \r\n\t\t\t\t \tparameters');\r\n\r\n\t\t//Using integer replacement parameters\r\n\t\t$this->assertEquals( 'This is my 1 message post', \r\n\t\t\t\t\t$format->formatMsg($intArgs), \r\n\t\t\t\t \t'Error parsing message string using integer replacement \r\n\t\t\t\t \tparameters');\r\n\r\n\t\t//Using float replacement parameters\r\n\t\t$this->assertEquals( 'This is my 2.5 message post', \r\n\t\t\t\t\t$format->formatMsg($floatArgs), \r\n\t\t\t\t \t'Error parsing message string using float replacement \r\n\t\t\t\t \tparameters');\r\n\r\n\t}",
"public function testThatValidatorThrowsErrorWhenRegexPatternIsMissing()\n {\n $validator = new Regex();\n $validator->isValid('nice');\n }",
"public function assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = \"\") {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertDoesNotMatchRegularExpression', func_get_args()));\n }",
"public function assertDoesNotMatchRegularExpression($pattern, $string, $message = \"\") {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertDoesNotMatchRegularExpression', func_get_args()));\n }",
"private function getError()\n {\n \n if($this->value === null || strlen($this->value) === 0 && $this->required)\n {\n $this->error_pattern = '* field required';\n //$error_pattern = sprintf($error_pattern,$this->name, $this->value);\n \n }\n return new Exception(sprintf($this->error_pattern,$this->name, $this->value));\n\n }",
"public static function invalidPattern(string $pattern): self\n {\n return new self(\n \"Laravel Auto-Reg: The path-pattern \\\"$pattern\\\" is invalid. \"\n . \"Check the 'patterns' values in configs/\" . Settings::LARAVEL_CONFIG_NAME . \".php\"\n );\n }",
"function mcwpl_error_message() {\n\treturn 'Well, that was not it!';\n}",
"protected function _updatePatternErrorMessage ($validCharactersLabel, $startWithAlpha, $startWithNumber) {\n \n if ($this->errorType == VALIDATION_ERROR_PATTERN) {\n if ($startWithAlpha && $startWithNumber) {\n $msg = 'The string must start with a letter or a number. ';\n $msg .= 'The rest of the ';\n } elseif ($startWithAlpha) {\n $msg = 'The string must start with a letter. ';\n $msg .= 'The rest of the ';\n } elseif ($startWithNumber) {\n $msg = 'The string must start with a number. ';\n $msg .= 'The rest of the ';\n } else {\n $msg = 'The ';\n }\n \n // update the error message\n $this->errorMessage .= ' '.$msg.$validCharactersLabel;\n }\n \n }",
"function testError(){\n\t\t#mdx:8\n\t\t$field = new TextField('name');\n\t\t$field\n\t\t\t->required('Name is required!')\n\t\t\t->context(['name'=>''])\n\t\t\t->error(true);\n\t\t#/mdx echo $field\n\t\t$this->expectOutputRegex(\"/error.*Name is required.*/s\");\n\n\t\techo $field;\n\n\t}",
"public function testInvalidMaskPatternException():void{\n\t\t$this->expectException(QRCodeException::class);\n\t\t$this->expectExceptionMessage('invalid mask pattern');\n\t\t/** @phan-suppress-next-line PhanNoopNew */\n\t\tnew MaskPattern(42);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a referrer from a CalendarReferencesInterface. | public function addCalendarReferrer(CalendarReferencesInterface $node); | [
"public function addLocationReferrer(LocationReferencesInterface $node);",
"public function addEmailReferrer(EmailReferencesInterface $node);",
"public function addReference() {\n\t\t$this->_refCount ++;\n\t}",
"public function addReference()\n {\n $this->_refCount++;\n }",
"public function addReferenceInvoice(ReferenceInvoice $invoice)\n {\n array_push($this->reference_invoices, $invoice);\n }",
"function Add($ref) {\n\t\t// Expand singular -> plurals\n\t\tforeach (array(\n\t\t\t'author' => 'authors',\n\t\t\t'url' => 'urls',\n\t\t) as $single => $plural)\n\t\t\tif (isset($ref[$single])) {\n\t\t\t\t$ref[$plural] = array($ref[$single]);\n\t\t\t\tunset($ref[$single]);\n\t\t\t}\n\t\n\t\tif (isset($ref['date']))\n\t\t\t$ref['date'] = $this->ToEpoc($ref['date']);\n\n\t\t$this->refs[] = $ref;\n\t}",
"public function addEmailReference(EmailReferrersInterface $reference)\n {\n $this->assertEmailReferenceNotExists($reference);\n\n $references = $this->getEmailReferencesFromStore();\n $references->add($reference);\n\n $this->setRemoteEmailReferrer($reference);\n\n return $this;\n }",
"public function addLeagueReferrer(LeagueReferencesInterface $referrer)\n {\n $this->assertLeagueReferrerNotExists($referrer);\n\n $leagueReferrers = $this->getLeagueReferrersFromStore();\n $leagueReferrers->add($referrer);\n\n $this->setRemoteLeagueReference($referrer);\n\n return $this;\n }",
"public function addMatchReferrer(MatchReferencesInterface $referrer)\n {\n $this->assertMatchReferrerNotExists($referrer);\n\n $matchReferrers = $this->getMatchReferrersFromStore();\n $matchReferrers->add($referrer);\n\n $this->setRemoteMatchReference($referrer);\n\n return $this;\n }",
"public function adicionarReferencia($oReferencia) {\n $this->aValoresDeReferencia[] = $oReferencia;\n }",
"public function removeCalendarReferrer(CalendarReferencesInterface $node);",
"function add() {\n\t\tif ($this->data) {\n\t\t\t$ref = $this->data;\n\t\t\t$tripId = $ref['Reference']['trip_id'];\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$ref['Reference']['date_created'] = date(Configure::read('DB_DATE_FORMAT'));\t\t\t\n\t\t\t$isSaved = false;\n\t\t\tif (isset($this->data['Reference']['file'])) { //reference is a document\t\t\t\t\n\t\t\t\t\n\t\t\t\t$result = $this->Document->uploadFiles($this->Document->FILES_ROOT.'references', $ref['Reference']);\n\t\t\t\t\t\t\t\t\n\t\t\t\tif (!empty($result['errMessage'])) {\n\t\t\t\t\t$this->Session->setFlash($result['errMessage']);\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tif (isset($result['urls'][0])) {\n\t\t\t\t\t\tif (empty($ref['Reference']['name'])) {\n\t\t\t\t\t\t\t$ref['Reference']['name'] = $result['successFilenames'][0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$ref['Reference']['url'] = $result['urls'][0];\n\t\t\t\t\t\t$ref['Reference']['type'] = 'document';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$isSaved = $this->Reference->save($ref);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\t//referene is a link\n\t\t\t\t$ref['Reference']['type'] = 'link';\n\t\t\t\t\n\t\t\t\tif (empty($ref['Reference']['name'])) {\n\t\t\t\t\t$ref['Reference']['name'] = $ref['Reference']['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$isSaved = $this->Reference->save($ref);\n\t\t\t}\n\t\t\t\n\t\t\tif ($isSaved) {\n\t\t\t\t$this->Session->setFlash('Your Reference was saved.');\n\t\t\t\t$this->redirect('/references/index/'.$tripId);\n\t\t\t} else if (!$this->Session->isFlashSet()) {\n\t\t\t\t$this->Session->setFlash('Your Reference could not be saved. Please try again.');\n\t\t\t}\n\t\t}\t\t\t\n\t}",
"public function removeCalendarReferrer(CalendarReferencesInterface $referrer)\n {\n if ($this->hasCalendarReferrer($referrer)) {\n $calendarReferrers = $this->getCalendarReferrersFromStore();\n $calendarReferrers->remove($referrer);\n\n return $referrer;\n }\n\n $this->setRemoteCalendarReference($referrer);\n\n return $this;\n }",
"public function addRefereed(Xerxes_Data_Refereed $objTitle)\r\n\t{\r\n\t\t$objTitle->issn = str_replace(\"-\", \"\", $objTitle->issn);\r\n\t\t// $objTitle->timestamp = date(\"Ymd\");\r\n\t\t\r\n\t\t$this->doSimpleInsert(\"xerxes_refereed\", $objTitle);\r\n\t}",
"public function add(Marker $reference);",
"public function registerResReference(ResReferenceDescriptorInterface $resReference);",
"public function addToFlightReference(\\Devlabs91\\GenericOtaHotelApiService\\StructType\\FlightReference $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Devlabs91\\GenericOtaHotelApiService\\StructType\\FlightReference) {\n throw new \\InvalidArgumentException(sprintf('The FlightReference property can only contain items of \\Devlabs91\\GenericOtaHotelApiService\\StructType\\FlightReference, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->FlightReference[] = $item;\n return $this;\n }",
"function add_ref_data() {\n\t\trequire '../config.php';\n\t\t$con = mysqli_connect($hostname, $dbusername, $dbpassword, $dbname);\n\t\tglobal $currentfbid;\n\t\t$query = \" SELECT * FROM referrals WHERE referrer_fbid = '$referrer' \";\n\t\t$result = mysqli_query($con, $query);\n\t\t$date = date(\"Y-m-d H:i:s\"); // Set date for database\n\t\t\tif (mysqli_num_rows($result) == 0) {\n\t\t\t\t// No data was found. Add new data about referral.\n\t\t\t\tmysqli_query($con, \"INSERT INTO referrals VALUES ('','$referrer','$currentfbid','yes','$date','0')\");\n\t\t\t} else {\n\t\t\t\t// Referrer fbid exists, still need to create a new entry.\n\t\t\t\tmysqli_query($con, \"INSERT INTO referrals VALUES ('','$referrer','$currentfbid','yes','$date','0')\");\n\t\t\t\t}\n\t\tmysqli_close($con);\n\t}",
"public function addRelationship(RelationshipInterface $relationship);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the given route has name which belongs to the TwoFactor Authentication component. | protected function routeBelongsToComponent(Route $route)
{
return strpos($route->getName(), 'two_factor_auth') !== false;
} | [
"public function hasRouteName(): bool;",
"public function hasNamedRoute($name);",
"private function isRegister()\n {\n return Str::contains(Route::currentRouteName(), 'auth.');\n }",
"public function isRouteAllowed($route);",
"public function isFromRoute(): bool\n {\n return (bool) request()->route()?->getName();\n }",
"public static function route_is($name)\n\t{\n\t\treturn (is_array(static::$route->callback) and isset(static::$route->callback['name']) and static::$route->callback['name'] === $name);\n\t}",
"function is_route(string $name): bool {\n if (request()->routeIs($name)) {\n return true;\n }\n\n /** Check route with locales */\n foreach (config('translatable.locales') as $locale) {\n if (request()->routeIs(\"$locale.$name\")) {\n return true;\n }\n }\n\n return false;\n }",
"function if_route($routeNames)\n {\n return app('active')->checkRoute($routeNames);\n }",
"public function isRouteExposed(Route $route, string $name): bool;",
"public function hasRoute(): bool;",
"public function has(string $route): bool;",
"protected function isRoute($param) {\n\t\treturn array_key_exists($param,$this->routes);\n\t}",
"public function hasCurrentRoute();",
"public function hasRouteName($name)\r\n {\r\n return isset($this->routes[$name]) ? true : false;\r\n }",
"public function hasRouteName($name)\n {\n return isset($this->routes[$name]) ? true : false;\n }",
"protected function isRouteName($to) : bool\n {\n if ($to instanceof Url) {\n return false;\n }\n return strpos($to, '/') === false;\n }",
"public function checkRoute()\n\t{\n\t\t$allow=0;\n\t\tforeach ($this->allow as $key => $value) {\n\t\t\tif($this->route == $value){\n\t\t\t\t$allow=1;\n\t\t\t}\n\t\t}\n if (!$this->user->isAuthorized() && !$allow) {\n \t$this->redirect('/user/login');\n \texit();\n }\n if ($this->user->isAuthorized() && $allow) {\n \t$this->redirect('/');\n \texit();\n }\n\t}",
"public function has ( $route ) : bool;",
"public function authenticate(Route $route, UserInterface $user): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Optional. Max configurable executors. If max_executors_count > executors_count, then autoscaling is enabled. Max Executor Count should be between 2 and 1000. [Default=1000] Generated from protobuf field int32 max_executors_count = 2 [(.google.api.field_behavior) = OPTIONAL]; | public function getMaxExecutorsCount()
{
return $this->max_executors_count;
} | [
"public function setExecutorsCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->executors_count = $var;\n\n return $this;\n }",
"public function getMaxNumWorkers()\n {\n return $this->max_num_workers;\n }",
"public function setMaxInstanceCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_instance_count = $var;\n\n return $this;\n }",
"public function getMaxThreads(): int {\r\n return $this->maxThreads;\r\n }",
"public function getMaxInstances()\n {\n return $this->max_instances;\n }",
"private static function getSuspenderMaxPendingJobs()\r\n\t{\r\n\t\treturn kConf::get('suspender_max_pending_jobs');\r\n\t}",
"public function setMaxParallelTrialCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_parallel_trial_count = $var;\n\n return $this;\n }",
"public function setMaxNodeCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_node_count = $var;\n\n return $this;\n }",
"public function getMaxJobsPerProcess(): int\n {\n return $this->maxJobsPerProcess;\n }",
"function maxInstances()\n {\n $description = $this->describeAutoScalingGroup();\n $maxSize = $description[\"MaxSize\"];\n\n return $maxSize;\n }",
"public function getParallelJobs(): int\n {\n return $this->configuration['parallelJobs'] ?? self::AMOUNT_OF_PARALLEL_JOBS;\n }",
"public function setMaxRetryCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_retry_count = $var;\n\n return $this;\n }",
"public function providerSetMaxParallelism()\n {\n return array(\n array(\"auto\", 0),\n array(0, 0),\n array(-1, Wrapper::DEFAULT_MAX_PARALLELISM),\n array(1, 1),\n array('2', 2),\n array(100, 100)\n );\n }",
"public function getMaxPools() {\n\t\treturn count($this->getPools());\n\t}",
"public function getMaxResultCount()\n {\n return $this->max_result_count;\n }",
"public function setMaxInstances($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_instances = $var;\n\n return $this;\n }",
"public function getMaxPartitionsCount()\n {\n return $this->max_partitions_count;\n }",
"public function getMaximumLimit()\n {\n // get the default limit value of results per request from the config file\n return (int) $this->limit;\n }",
"public function maximum_parameter_count() { return $this->maximumArgumentCount; }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove Null from data values. trim extra spaces. remove extra zeros format floats | public function sanitizeData(&$data)
{
$not_include = ['winning_numbers', 'powerball', 'megaball', 'cash_ball', 'bonus', 'power_play'];
foreach ($data as $delta => &$row) {
if (!in_array($delta, $not_include)) {
$data->{$delta} = trim($row);
if ($row == 'NULL') {
$data->{$delta} = '';
}
if (is_numeric($row)) {
$data->{$delta} = floatval($row);
if (strpos($row, '000') > -1) {
$data->{$delta} = intval($row);
}
}
}
}
} | [
"private function hhCleanRows($rows) {\n foreach ($rows as &$row) {\n foreach ($row as &$v) {\n if (empty($v)) {\n $v = '';\n }\n elseif (is_numeric($v)) {\n $v = (float) $v;\n }\n };\n }\n\n return $rows;\n }",
"function strtoo($arr){\n if($arr !== \" \"){\n if(is_array($arr)){\n if(!empty($arr)){\n foreach($arr as $key => $value){\n if($value === \" \"){\n $arr[$key] = '0';\n }else{\n $arr[$key] = nulltostr($value);\n }\n }\n }else{ $arr = '0'; }\n }else{\n if($arr === \" \"){ $arr = '0'; }\n }\n }else{ $arr = '0'; }\n return $arr;\n}",
"function strtoo($arr){\n if($arr !== \" \"){\n if(is_array($arr)){\n if(!empty($arr)){\n foreach($arr as $key => $value){\n if($value === \" \"){\n $arr[$key] = '0';\n }else{\n $arr[$key] = $this->nulltostr($value);\n }\n }\n }else{ $arr = '0'; }\n }else{\n if($arr === \" \"){ $arr = '0'; }\n }\n }else{ $arr = '0'; }\n return $arr;\n }",
"function nulltoo($arr){\n if($arr !== null){\n if(is_array($arr)){\n if(!empty($arr)){\n foreach($arr as $key => $value){\n if($value === null){\n $arr[$key] = '0';\n }else{\n $arr[$key] = $this->nulltostr($value);\n }\n }\n }else{ $arr = '0'; }\n }else{\n if($arr === null){ $arr = '0'; }\n }\n }else{ $arr = '0'; }\n return $arr;\n }",
"public function scrubFloat(float $data) : float;",
"private function setNull() {\n foreach ($this->data as $Key => $Value):\n $this->data[$Key] = ($Value == \"\" ? null : $Value);\n endforeach;\n }",
"private function cleanExportData()\n {\n foreach ($this->data as $rowKey => $row) {\n foreach ($row as $colKey => $column) {\n $cleanValue = Html::encode(strip_tags(trim(str_replace(' ', \"\", $column))));\n $this->data[$rowKey][$colKey] = $cleanValue;\n }\n }\n }",
"function filter_array_for_null($arr_input){\n\n\n \t\t$arr_output=array(); //output array\n \t\t//creating the output array\n \t\tforeach($arr_input as $key=>$value){\n\n \t\t\tif(strlen($value)>0){ //discardinf the null or empty values\n\n \t\t\t\t$arr_output[$key]=$value;\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn $arr_output;\t\n\t}",
"function sanitizeFloat()\n\t{\n\t\t$fields = func_get_args();\n\t\t$sanitized = [];\n\n\t\tforeach ($fields as $field) {\n\t\t\t$num = filter_var($field, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n\t\t\tarray_push($sanitized, $num);\n\t\t}\n\n\t\treturn $sanitized;\n\t}",
"protected function processDataValue($value)\n {\n return ($value === null) ? null : floatval($value);\n }",
"public function testConvertNull()\n {\n $serializer = new Gson3;\n\n $deconverted = $serializer->convertNULL(NULL);\n $this->assertEquals(NULL, $deconverted, \"Incorrect deconversion for Double\");\n }",
"function ffd_trim_zeros( $price ) {\r\n\treturn preg_replace( '/' . preg_quote( ffd_get_price_decimal_separator(), '/' ) . '0++$/', '', $price );\r\n}",
"public function testCastWhitespaceToNull()\n {\n\n $record = $this->_record();\n\n // String field.\n $record->saveForm(array('fill_color' => ''));\n $this->assertNull($record->body);\n $record->saveForm(array('fill_color' => ' '));\n $this->assertNull($record->body);\n\n // Number field.\n $record->saveForm(array('max_zoom' => ''));\n $this->assertNull($record->max_zoom);\n $record->saveForm(array('max_zoom' => ' '));\n $this->assertNull($record->max_zoom);\n\n }",
"function NoNull($string){\r\n\t\t$string = preg_replace('/\\0+/', '', $string);\r\n\t\treturn preg_replace('/(\\\\\\\\0)+/', '', $string);\r\n\t}",
"function cleanToNumeric ()\r\n\t{\r\n\t\t# End if not required to enforce numeric\r\n\t\tif (!$this->arguments['enforceNumeric']) {return;}\r\n\t\t\r\n\t\t# Don't clean e-mail types\r\n\t\tif ($this->functionName == 'email') {return;}\r\n\t\t\r\n\t\t# Get the data\r\n\t\t#!# Remove these\r\n\t\t$data = $this->value;\r\n\t\t\r\n\t\t#!# Replace with something like this line? :\r\n\t\t#$this->form[$name] = preg_replace ('/[^0-9\\. ]/', '', trim ($this->form[$name]));\r\n\t\t\r\n\t\t# Strip replace windows carriage returns with a new line (multiple new lines will be stripped later)\r\n\t\t$data = str_replace (\"\\r\\n\", \"\\n\", $data);\r\n\t\t# Turn commas into spaces\r\n\t\t$data = str_replace (',', ' ', $data);\r\n\t\t# Strip non-numeric characters\r\n\t\t$data = preg_replace (\"/[^-0-9\\.\\n\\t ]/\", '', $data);\r\n\t\t# Replace tabs and duplicated spaces with a single space\r\n\t\t$data = str_replace (\"\\t\", ' ', $data);\r\n\t\t# Replace tabs and duplicated spaces with a single space\r\n\t\t$data = preg_replace (\"/[ \\t]+/\", ' ', $data);\r\n\t\t# Remove space at the start and the end\r\n\t\t$data = trim ($data);\r\n\t\t# Collapse duplicated newlines\r\n\t\t$data = preg_replace (\"/[\\n]+/\", \"\\n\", $data);\r\n\t\t# Remove any space at the start or end of each line\r\n\t\t$data = str_replace (\"\\n \", \"\\n\", $data);\r\n\t\t$data = str_replace (\" \\n\", \"\\n\", $data);\r\n\t\t\r\n\t\t# Re-assign the data\r\n\t\t#!# Remove these\r\n\t\t$this->value = $data;\r\n\t}",
"public function setZeroPointsToNull() {\n\t\tforeach ($this->Data as $series => $data) {\n\t\t\t$this->Data[$series]['data'] = array_map(\"PLOT__setZeroToNullMapper\", $data['data']);\n\t\t}\n\t}",
"private static function _changeEmptyToNull(array $data)\n\t{\n\t\t// If the field is not set in form, the value is empty string.\n\t\t// We want the value of field which is not set to be null.\n\t foreach($data as $key=>$value)\n \t{\n \t\tif(empty($value)) \n \t\t{\n \t\t\t$data[$key] = null;\t\n \t\t}\n \t}\n \treturn $data;\t\t\n\t}",
"function filterRflt($s){\n $r=array(\"VAL\"=>\"\",\"ERR\"=>array(),\"WARN\"=>array());\n if ($s!=\"\"){\n $s_prev=$s;\n $s=filter_var($s,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);\n if (strlen($s_prev)!=strlen($s))\n $r['WARN'][]=Signs::NUMBERCLEARED;\n $tmp=filter_var($s,FILTER_VALIDATE_FLOAT);\n if ($tmp==false && $s!==\"\") $r['ERR'][]=Signs::WRONGFLOAT;\n else $s=$tmp; }\n $r['VAL']=$s;\n return $r;\n }",
"function static_sanitize_number_blank( $val ) {\r\n return is_numeric( $val ) ? $val : '';\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [admintecnico] column value. | public function getAdmintecnico()
{
return $this->admintecnico;
} | [
"public function getClogAdminid()\n {\n return $this->clog_adminid;\n }",
"public function getIdccusto()\n {\n return $this->idccusto;\n }",
"public function getCategEmploiAutre() {\n return $this->categEmploiAutre;\n }",
"public function getClogAdminname()\n {\n return $this->clog_adminname;\n }",
"public function get_column_value()\n {\n return $this->properties['options'][$this->get_value()];\n }",
"public function getCusto()\n {\n return $this->custo;\n }",
"public function getCoEdificio()\n\t{\n\t\treturn $this->co_edificio;\n\t}",
"public function getAccess()\n\t{\n\t\t$column = self::COL_ACCESS;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}",
"public function getIntitCol(): ?string {\n return $this->intitCol;\n }",
"public function getIdcargoadmision()\n {\n\n return $this->idcargoadmision;\n }",
"public function getMedicoAe()\n {\n\n return $this->medico_ae;\n }",
"public function getCdEmpresa()\n {\n return $this->cd_empresa;\n }",
"public function getICO()\n {\n return $this->get(self::ICO);\n }",
"public function getAcao () {\n\t\treturn $this->log_acao;\n\t}",
"public function getAccNo()\n {\n return $this->acc_no;\n }",
"public function getActiCodigo()\n {\n return $this->acti_codigo;\n }",
"public function getCostAccId()\n {\n\n return $this->cost_acc_id;\n }",
"public function getDocenciatecnologicoAccion()\n\t{\n\t\treturn $this->docenciatecnologicoAccion;\n\t}",
"public function getFkAdministracaoAcao()\n {\n return $this->fkAdministracaoAcao;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Requests the Zabbix API and returns the response of the method "application.tablename". The $params Array can be used, to pass parameters to the Zabbix API. For more information about these parameters, check the Zabbix API documentation at The $arrayKeyProperty can be used to get an associative instead of an indexed array as response. A valid value for the $arrayKeyProperty is is any property of the returned JSON objects (e.g. "name", "host", "hostid", "graphid", "screenitemid"). | public function applicationTableName($params = [], $arrayKeyProperty = null, $assoc = true)
{
return $this->request('application.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);
} | [
"public function apiTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('api.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function hostTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('host.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function alertTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('alert.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function alertTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('alert.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function discoveryruleTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('discoveryrule.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function screenitemTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('screenitem.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function screenTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('screen.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function screenTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('screen.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function hostprototypeTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('hostprototype.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function discoveryruleTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('discoveryrule.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function problemTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('problem.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function proxyTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('proxy.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function serviceTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('service.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function itemprototypeTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('itemprototype.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function maintenanceTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('maintenance.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function templatescreenTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('templatescreen.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function eventTableName($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('event.tablename', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }",
"public function taskTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('task.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function configurationTableName($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('configuration.tableName', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get All Photos of Thread | public function get_photos_all($thread_id,$post_id){
return $this->where(array('post_id' => $post_id, 'thread_id' => $thread_id))->get();
} | [
"public function get_photos_all($thread_id,$post_id){\nreturn $this->where(array('post_id' => $post_id, 'thread_id' => $thread_id))->get();\n}",
"public function getPhotos()\n {\n return $this->buildall(\"FacebookPhoto\",$this->api->api(\"/{$this->id}/photos\")); \n }",
"public function getPhotos();",
"public function getMoviePhotos()\n {\n $request = $this->db->prepare(\"SELECT * FROM photo JOIN film_has_photo On photo.id = film_has_photo.id_photo WHERE id_film = :id\");\n $request->execute([\n ':id' => $this->id,\n ]);\n return $request->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getTaggedPhotos()\n {\n // api: https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN\n $tags = $this->_client->getTags();\n\n foreach ($tags as $tag) {\n\n /** Get min ID (get photos after this Min Id) */\n $minTagId = $this->_taggedPhotoFactory->create()\n ->getCollection()\n ->addFieldToFilter('tag_name', $tag)\n ->getLastItem()\n ->getMinTagId();\n\n if (!empty($minTagId)) {\n $param = ['min_tag_id' => $minTagId];\n } else {\n $param = ['count' => 20];\n }\n\n $handle = sprintf('/tags/%s/media/recent', $tag);\n $photos = $this->_client->api($handle, 'GET', $param);\n\n if (isset($photos['pagination']['min_tag_id']) && isset($photos['data']) && count($photos['data'])) {\n $minTagId = $photos['pagination']['min_tag_id'];\n $photos = array_reverse($photos['data']);\n foreach ($photos as $photo) {\n if ($photo['type'] == 'image' || $photo['type'] == 'carousel') {\n $this->savePhoto($photo, $tag, $minTagId);\n }\n }\n }\n }\n }",
"public function get_photostream()\n\t{\n\t\t$this->check_user_id();\n\n\t\t$photos = $this->where('user_id' , '=', $this->_user_id)\n\t\t\t->order_by('upload_date', 'desc')\n\t\t\t->find_all()->as_array();\n\n\t\treturn $photos;\n\t}",
"public function getPhotos()\n {\n return $this->photos;\n }",
"public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}",
"public function fetchPics() {\n\t\treturn $this->fetchObject($this->route_prefix.'drive/special/photos');\n\t}",
"public function getPhotos()\n {\n return $this->provider->getPhotos();\n }",
"public function getPhotos()\n {\n $arg['tconst'] = $this->getTitleId();\n return $this->makeRequest('/title/photos', $arg);\n }",
"public static function getAllPhotosForEvent($eventId)\n {\n $photoConnects = PhotoConnect::select('id')->where('type', PhotoConnect::EVENT)->where('connect_id', $eventId)->get();\n return self::whereIn('id', $photoConnects)->get();\n }",
"public function getAllWithPhoto()\n {\n return Karte::hasPhoto()->get();\n }",
"public function getAllPhotos()\n {\n $settings = craft()->plugins->getPlugin('flickrPhotoPicker')->getSettings();\n $apiKey = $settings['apiKey'];\n $userId = $settings['userId'];\n $allPhotos = array();\n\n $photosets = $this->getFromUrl($this->photoSetsUrl($apiKey, $userId), 'photosets', 'photoset');\n\n foreach ($photosets as $photosetId => $photosetDetails) {\n $photos = $this->getFromUrl($this->photosForPhotoSetUrl($apiKey, $photosetId), 'photoset', 'photo');\n foreach ($photos as $photoId => $photoDetails) {\n $photoDetails['photosetid'] = $photosetId;\n $photoDetails['photosetname'] = $photosetDetails['title']['_content'];\n $allPhotos[$photoId] = $photoDetails;\n }\n }\n\n return $allPhotos;\n }",
"function getFlickrInstagramPhotos(){\n \t$f = new phpFlickr(FLICKR_API_KEY,FLICKR_SECRET);\n\n\t$photos = $f->photos_search (array(\n 'user_id'=>FLICKR_USER,\n 'machine_tags'=>'uploaded:by=instagram',\n 'extras'=>'url_o'\n ));\n\n\treturn $photos;\n}",
"public function getPhotos($group)\n {\n return Photo::where('group_nid', '=', $group->id)\n ->where('used', '=', 1)\n ->orderBy('id', 'DESC')\n ->get();\n }",
"private function GetPhotos(){\n\n if($this->get_request_method() != \"POST\"){\n $this->response('',406);\n }\n $r = json_decode(file_get_contents(\"php://input\"),true);\n //$r = $r['name'];\n $response = array();\n $db = new DbHandler();\n $session = $db->getSession();\n\n if(isset($r['uid']) && $r['uid']=='session_id'){\n $uid = $session['uid'];\n }else{\n $uid = $r['uid'];\n }\n\n $sql = \"SELECT * FROM photos WHERE uid = $uid\";\n $response = $db->getRecords($sql);\n\n if ($response != NULL) {\n $this->response($this->json($response), 200); // send user details\n }\n\n }",
"public static function find_all_user_photos() {\n return static::find_by_query(\"SELECT * FROM \" . static::$db_table . \" WHERE user_id = {$_SESSION[\"id\"]} and deleted is NULL\");\n }",
"public function getPhotos()\n {\n return $this->hasMany(TreePhotos::class, ['tree_id' => 'id'])->orderBy('sort');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test theBlockShouldBeOpened method with element not found. | public function testTheBlockShouldBeOpenedNotFound(): void
{
$trait = $this->getSonataPageAdminTraitMock();
$this->page->expects($this->once())
->method('find')
->with($this->equalTo('css'), $this->equalTo('li:contains(\'Foo\')'))
->willReturn(null)
;
$this->session->expects($this->once())->method('getDriver')->willReturn($this->driver);
$this->session->expects($this->once())->method('getPage')->willReturn($this->page);
$trait->expects($this->exactly(2))->method('getSession')->willReturn($this->session);
$this->expectExceptionMessage("Tag not found.");
$this->expectException(ElementNotFoundException::class);
$trait->theBlockShouldBeOpened("Foo"); // @phpstan-ignore-line
} | [
"public function testIOpenTheBlockNotFound(): void\n {\n $trait = $this->getSonataPageAdminTraitMock();\n\n $this->page->expects($this->once())->method('find')\n ->with($this->equalTo('css'), $this->equalTo('li.page-composer__container__child:contains(\\'Foo\\') > a.page-composer__container__child__edit'))\n ->willReturn(null)\n ;\n\n $this->session->expects($this->once())->method('getDriver')->willReturn($this->driver);\n $this->session->expects($this->once())->method('getPage')->willReturn($this->page);\n $trait->expects($this->exactly(2))->method('getSession')->willReturn($this->session);\n $this->expectExceptionMessage(\"Tag not found.\");\n $this->expectException(ElementNotFoundException::class);\n\n $trait->iOpenTheBlock(\"Foo\"); // @phpstan-ignore-line\n }",
"public function testIOpenTheBlock(): void\n {\n $trait = $this->getSonataPageAdminTraitMock();\n\n $trait->expects($this->once())\n ->method('iWaitForCssElementBeingVisible')\n ->with($this->equalTo('li.page-composer__container__child:contains(\\'Foo\\') > a.page-composer__container__child__edit'), $this->equalTo(2))\n ;\n $this->block->expects($this->once())->method('click');\n $this->page->expects($this->once())->method('find')\n ->with($this->equalTo('css'), $this->equalTo('li.page-composer__container__child:contains(\\'Foo\\') > a.page-composer__container__child__edit'))\n ->willReturn($this->block)\n ;\n\n $this->session->expects($this->once())->method('getPage')->willReturn($this->page);\n $trait->expects($this->once())->method('getSession')->willReturn($this->session);\n\n $trait->iOpenTheBlock(\"Foo\"); // @phpstan-ignore-line\n }",
"public function testIDeleteTheBlockElementNotFound(): void\n {\n $trait = $this->getSonataPageAdminTraitMock();\n\n $this->page->expects($this->at(0))\n ->method('find')\n ->with($this->equalTo('css'), $this->equalTo('li:contains(\\'Foo\\')'))\n ->willReturn(null)\n ;\n\n $this->expectExceptionMessage(\"Tag not found.\");\n $this->expectException(ElementNotFoundException::class);\n $this->session->expects($this->once())->method('getDriver')->willReturn($this->driver);\n $this->session->expects($this->once())->method('getPage')->willReturn($this->page);\n $trait->expects($this->exactly(2))->method('getSession')->willReturn($this->session);\n\n $trait->iDeleteTheBlock(\"Foo\"); // @phpstan-ignore-line\n }",
"public function testBlock() {\n $this->createNode([\n 'type' => 'urban_definition',\n 'title' => 'brb',\n ]);\n $this->createNode([\n 'type' => 'urban_definition',\n 'title' => 'LMK',\n ]);\n\n $this->drupalGet('<front>');\n\n $assertSession = $this->assertSession();\n $assertSession->pageTextContains('brb');\n $assertSession->pageTextContains('LMK');\n $assertSession->pageTextNotContains('Acronym for \"be right back\"');\n $assertSession->pageTextNotContains('Let me know');\n\n $this->click('a[href=\"/urban/definition/1\"]');\n $assertSession->assertWaitOnAjaxRequest();\n $assertSession->pageTextContains('Acronym for \"be right back\"');\n\n $this->click('a[href=\"/urban/definition/2\"]');\n $assertSession->assertWaitOnAjaxRequest();\n $assertSession->pageTextContains('Let me know');\n }",
"public function testEditBlockNotFound() {\n\t\tRolesControllerTest::login($this);\n\n\t\t$BlockMock = $this->getMockForModel('Blocks.Block', ['find']);\n\t\t$BlockMock->expects($this->once())\n\t\t\t->method('find')\n\t\t\t->will($this->returnValue(false));\n\n\t\t$this->controller->NetCommonsBlock->expects($this->once())\n\t\t\t->method('validateBlockId')\n\t\t\t->will($this->returnValue(true));\n\n\t\t$this->controller->expects($this->any())\n\t\t\t->method('throwBadRequest');\n\n\t\t$resultFalse = $this->testAction(\n\t\t\t'/blogs/blog_block_role_permissions/edit/1/5',\n\t\t\tarray(\n\t\t\t\t'method' => 'get',\n\t\t\t)\n\t\t);\n\t\t$this->assertFalse($resultFalse);\n\n\t\tAuthGeneralControllerTest::logout($this);\n\t}",
"public function testContextAwareUnsatisfiedBlocks() {\n $this->drupalGet('admin/structure/block');\n $this->clickLink('Place block');\n // Verify that the context-aware test block does not appear.\n $this->assertSession()->elementNotExists('xpath', '//tr[.//td/div[text()=\"Test context-aware unsatisfied block\"] and .//td[text()=\"Block test\"] and .//td//a[contains(@href, \"admin/structure/block/add/test_context_aware_unsatisfied/stark\")]]');\n\n $definition = \\Drupal::service('plugin.manager.block')->getDefinition('test_context_aware_unsatisfied');\n $this->assertNotEmpty($definition, 'The context-aware test block does not exist.');\n }",
"public function testGettingCellDataFromOutsideOfBlock()\n {\n $block = new DynamicBlock();\n $block->setCellValue('B2', null);\n\n $this->expectException(CellOutOfBlockException::class);\n $cell_value = $block->getCellValue('C3');\n }",
"protected function assertBlockAppears(Block $block) {\n $result = $this->findBlockInstance($block);\n $this->assertTrue(!empty($result), format_string('Ensure the block @id appears on the page', array('@id' => $block->id())));\n }",
"public function testFirstBlockAccess() {\n\n // Log in as admin user\n $this->drupalLogin($this->adminUser);\n \n // Create an array that contains Probe Block configuration\n $configuration = array( \n 'region' => 'sidebar_first',\n 'settings[label]' => $this->title,\n 'settings[number_of_items]' => 10\n );\n\n // Place the Block\n $this->drupalPostForm('admin/structure/block/add/' . $this->block_id \n . '/' . $this->default_theme, $configuration, t('Save block'));\n \t\n // Log out admin user\n $this->drupalLogout();\n\t\n // Login normal user\n $this->drupalLogin($this->normalUser);\n\n // Probe Block should not be visible \n $this->assertNoText('Probe Block');\n }",
"public function testFacilityDoesntExist()\n {\n $this->browse(function (Browser $browser){\n $browser->visit('http://storageseeker/facility/666666666')\n ->click('.phpdebugbar-close-btn')\n ->assertSee('Facility with ID: 666666666 not found')\n ;\n });\n $this->closeAll();\n }",
"protected function assertCustomBlocks($url) {\n $page = $this->getSession()->getPage();\n $assert_session = $this->assertSession();\n\n $this->drupalGet($url);\n $page->clickLink('Layout');\n $page->clickLink('Add Block');\n $page->clickLink('Create custom block');\n $assert_session->linkExists('First type');\n $assert_session->linkExists('Second type');\n }",
"public function testBlockUiListing() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'administer blocks',\n ]));\n\n $this->drupalGet('admin/structure/block');\n $page->clickLink('Place block');\n\n // Ensure that blocks expected to appear are available.\n $assert_session->pageTextContains('Test HTML block');\n $assert_session->pageTextContains('Block test');\n // Ensure that blocks not expected to appear are not available.\n $assert_session->pageTextNotContains('Body');\n $assert_session->pageTextNotContains('Content fields');\n }",
"public function testClickElementThrowsExceptionIfElementNotFound(): void\n {\n $page = $this->createMock(DocumentElement::class);\n $page->expects($this->once())->method('find')->with($this->equalTo('css'), $this->equalTo('.sonata-ba-list a.sonata-link-identifier'));\n\n $session = $this->createMock(Session::class);\n $session->expects($this->once())->method('getPage')->willReturn($page);\n $session->expects($this->once())->method('getDriver')->willReturn($this->createMock(DriverInterface::class));\n\n $trait = $this->getExtraWebAssertMock();\n $trait->expects($this->exactly(2))->method('getSession')->willReturn($session);\n\n $this->expectException(ElementNotFoundException::class);\n\n $trait->clickElement('.sonata-ba-list a.sonata-link-identifier'); // @phpstan-ignore-line\n }",
"public function testEmptyBlock() {\n // Mock the ApodClient object to return NULL.\n $mockApodClient = $this->prophesize(ApodClient::class);\n $mockApodClient->getAstronomyPictureOfTheDay()\n ->willReturn(NULL);\n\n $this->container->set('apod.client', $mockApodClient->reveal());\n\n /** @var \\Drupal\\Core\\Block\\BlockManagerInterface $block_manager */\n $block_manager = $this->container->get('plugin.manager.block');\n\n $block = $block_manager->createInstance('apod_block');\n $render = $block->build();\n $this->assertEmpty($render);\n }",
"public function testBlock() {\n $config = array();\n $plugin = array('module' => 'drupalgotchi', 'id' => 'drupalgotchi_hello');\n $block_plugin = new HelloBlock($config, 'drupalgotchi_hello', $plugin);\n\n $build = $block_plugin->build();\n $this->assertEquals('drupalgotchi_hello_block', $build['#theme']);\n $this->assertEquals('World', $build['#person']);\n }",
"public function iShouldNotSeeAnErrorBox()\n {\n $this->assertElementNotOnPage('.notification-1');\n }",
"public function testReusableBlockContent( AcceptanceTester $I ) {\n\t\t$I->wantToTest( 'Reusable block content is searchable.' );\n\n\t\t$block_id = $I->havePostInDatabase( [\n\t\t\t'post_type' => 'wp_block',\n\t\t\t'post_title' => 'Reusable content!',\n\t\t\t'post_content' => \"<!-- wp:paragraph -->\\n<p>I am reusable!</p>\\n<!-- /wp:paragraph -->\",\n\t\t] );\n\n\t\t$I->havePostInDatabase( [\n\t\t\t'post_type' => 'post',\n\t\t\t'post_title' => 'I am content!',\n\t\t\t'post_content' => sprintf( '<!-- wp:block {\"ref\":%d} /-->', $block_id ),\n\t\t] );\n\n\t\t$I->reindexContent();\n\n\t\t$I->amOnPage( '/?s=reusable' );\n\t\t$I->see( 'I am content!', '.entry-title' );\n\t}",
"public function testAddFrameWithoutBlock() {\n\t\t$this->testAction(\n\t\t\t'/rss_readers/rss_readers/view/183',\n\t\t\tarray(\n\t\t\t\t'method' => 'get',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$this->assertTextEquals('view', $this->controller->view);\n\t}",
"public function testBlockVisibilityNegate() {\n // Update the placed block to be not visible only on \"Timeline\".\n $this->updateBlockSuggestionVisibility($this->blocks[0], [\n $this->suggestions[0]->id(),\n ], TRUE);\n\n // Asserts the blocks is not visible according the single saved config.\n $this->drupalGet($this->articles[0]->toUrl());\n $this->assertSession()->pageTextContains($this->blocks[0]->label());\n $this->drupalGet($this->articles[1]->toUrl());\n $this->assertSession()->pageTextNotContains($this->blocks[0]->label());\n $this->drupalGet($this->articles[2]->toUrl());\n $this->assertSession()->pageTextContains($this->blocks[0]->label());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store a newly created Pengiriman in storage. | public function store(CreatePengirimanRequest $request)
{
$input = $request->all();
$pengiriman = $this->pengirimanRepository->create($input);
Flash::success('Pengiriman saved successfully.');
return redirect(route('pengirimen.index'));
} | [
"public function store(CreatePengirimanAPIRequest $request)\n {\n $input = $request->all();\n\n $pengirimen = $this->pengirimanRepository->create($input);\n\n return $this->sendResponse($pengirimen->toArray(), 'Pengiriman saved successfully');\n }",
"protected function persist()\n\t{\n\t\t$saveData = [];\n\t\t// remove id\n\t\tforeach ($this->neonData as $key=>$value) {\n\t\t\tif (isset($this->neonData[$key][\"id\"])) {\n\t\t\t\t$id = $this->neonData[$key][\"id\"];\n\t\t\t\tunset($value[\"id\"]);\n\t\t\t} else {\n\t\t\t\t$id = Uuid::generate(4);\n\t\t\t}\n\n\t\t\t$saveData[$id] = $value;\n\t\t}\n\t\t$data = $this->neon->encode($saveData, Nette\\Neon\\Encoder::BLOCK);\n\t\tfile_put_contents($this->neonFile, $data);\n\t}",
"public function store(StorePeminjamenRequest $request)\n {\n if (! Gate::allows('peminjaman_create')) {\n return abort(401);\n }\n $peminjaman = Peminjaman::create($request->all());\n\n\n\n return redirect()->route('admin.peminjamen.index');\n }",
"public function store()\n\t{\n $language = new Language;\n\n $language->name = Input::get('name');\n $language->code1 = Input::get('code1');\n $language->code2 = Input::get('code2');\n $language->spoken_in = Input::get('spoken_in');\n\n if ($success = $language->save()) {\n return Redirect::to('/admin/language')->with('message', 'Language created successfully.');\n } else {\n return Redirect::to('/admin/language/create')->withErrors($language->errors());\n }\n\t}",
"public function persist();",
"public function store()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\tAuth::user()->storages_id = $id;\n\t\tAuth::user()->save();\n\t}",
"function store(){\r\n\t\t//store to file\r\n\t}",
"public function store(CreatepermohonanKematianRequest $request)\n {\n $input = $request->all();\n\n $permohonanKematian = $this->permohonanKematianRepository->create($input);\n\n Flash::success('Permohonan Kematian saved successfully.');\n\n return redirect(route('permohonanKematians.index'));\n }",
"public function store(CreatePeminjamanRequest $request)\n {\n $input = $request->all();\n\n $peminjaman = $this->peminjamanRepository->create($input);\n\n Flash::success('Peminjaman saved successfully.');\n\n return redirect(route('peminjaman.index'));\n }",
"public function store(CreatePerikananRequest $request)\n {\n $input = $request->all();\n\n $perikanan = $this->perikananRepository->create($input);\n\n $perikanan->input_perikanan_koordinate($input);\n $perikanan->save();\n Flash::success('Perikanan berhasil ditambahkan.');\n\n return redirect(route('perikanans.index'));\n }",
"private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }",
"public function store()\n\t{\n\t\t$data = Input::all();\n\n\t\t$validator = Validator::make($data, Apuesta::$rules);\n\n\t\t$validacionHora = $this->validarHora($data);\n\t\t$validacionRepetido = $this->validarRepetido($data);\n\n\t\tif ($validator->fails() || !$validacionHora || $validacionRepetido)\n\t\t{\n\t\t\treturn Redirect::back();\n\t\t}\n\n\t\t$a = Apuesta::create($data);\n\t\t\n\t\t$id_fase = Crypt::encrypt(Partido::find($a->idpartido)->idfase);\n\n\t\treturn Redirect::to(\"apuestas/create/\".$id_fase.\"/\");\n\t}",
"public function store(Createbahasa_pemanduRequest $request)\n {\n $input = $request->all();\n\n $bahasaPemandu = $this->bahasaPemanduRepository->create($input);\n\n Flash::success('Bahasa Pemandu saved successfully.');\n\n return redirect(route('bahasaPemandus.index'));\n }",
"public function store(CreatePermohonanRequest $request)\n {\n $input = $request->all();\n\n $permohonan = $this->permohonanRepository->create($input);\n\n Flash::success('Permohonan saved successfully.');\n\n return redirect(route('pemohon.index'));\n }",
"private function store()\n {\n $settings = [];\n foreach ($this->settings as $key => $value) {\n $settings[$key] = serialize($value);\n }\n $this->files->put($this->filepath, json_encode($settings));\n }",
"public function store()\n {\n $this->validate();\n if (auth()->user()->can('create roles')) {\n $this->createRole();\n $this->resetAllData();\n $this->emit('refreshRolesIndex');\n } else {\n Session::flash('accessDenied', 'no permission to create a role.');\n }\n }",
"public function store(CreateMapelRequest $request)\n {\n $input = $request->all();\n\n $mapel = $this->mapelRepository->create($input);\n\n Flash::success('Mapel sukses tersimpan.');\n\n return redirect(route('mapels.index'));\n }",
"public function store(CreateKeteranganPenghasilanRequest $request)\n {\n $input = $request->all();\n\n $keteranganPenghasilan = $this->keteranganPenghasilanRepository->create($input);\n\n Flash::success('Keterangan Penghasilan saved successfully.');\n\n return redirect(route('keteranganPenghasilans.index'));\n }",
"public function store()\n\t{\n\t\t$command_name = Input::get(\"command_name\");\n\t\t$command_line = Input::get(\"command_line\");\n\t\t$uuid = UUID::v4();\n\n\t\tObject::create(array(\n\t\t\t\"uuid\" => $uuid,\n\t\t\t\"object_type\" => \"12\",\n\t\t\t\"first_name\" => $command_name,\n\t\t\t\"second_name\" => \"\",\n\t\t\t\"is_active\" => \"1\"\n\t\t));\n\n\t\tCommand::create(array(\n\t\t\t\"object_uuid\" => $uuid,\n\t\t\t\"command_line\" => $command_line\n\t\t));\n\n\t\t$this->writeConfig();\n\n\t\treturn Response::json(array(\"success\" => true));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the glyph width of a string | function GetStringWidth($string)
{
$string = (string)$string;
$str_width = 0;
$str_len = strlen($string);
for ($i = 0; $i < $str_len; $i++)
{
$str_width += $this->m_glyph_widths[$string[$i]];
}
return $str_width * $this->m_font_size / 1000;
} | [
"function GetStringWidth($string)\n {\n $string = (string)$string;\n $str_width = 0;\n $codes = self::Utf8ToCodepoints($string);\n\n foreach ($codes as $code) \n {\n if (isset($this->m_glyph_widths[$code])) \n { \n // Big-endian uint_16:\n $str_width += (ord($this->m_glyph_widths[2 * $code]) << 8) + \n ord($this->m_glyph_widths[2 * $code + 1]); \n }\n else if ($code > 0 && $code < 128 && \n isset($this->m_glyph_widths[chr($code)])) \n { \n $str_width += $this->m_glyph_widths[chr($code)]; \n }\n else\n {\n $str_width += $this->m_missing_width;\n }\n }\n\n return $str_width * $this->m_font_size / 1000;\n }",
"function stringwidth($s)\n{\n\t$s = (string)$s;\n\t$cw = &$this->CurrentFont['cw'];\n\t$w=0;\n\t$unicode = $this->UTF8StringToArray($s);\n\tforeach($unicode as $char) {\n\t\tif (isset($cw[$char])) { \n\t\t\t$w += $cw[$char]; \n\t\t} else if($char > 0 && $char < 128 && isset($cw[chr($char)])) { \n\t\t\t$w += $cw[chr($char)]; \n\t\t} else if(isset($this->CurrentFont['desc']['MissingWidth'])) { \n\t\t\t$w += $this->CurrentFont['desc']['MissingWidth']; \n\t\t} else if(isset($this->CurrentFont['MissingWidth'])) { \n\t\t\t$w += $this->CurrentFont['MissingWidth']; \n\t\t} else { \n\t\t\t$w += 500; \n\t\t}\n\t}\n\treturn $w*$this->FontSize/1000;\n}",
"function textwidth($string, $font, $size) {\r\n\t$box = imagettfbbox($size,0,$font,$string);\r\n\treturn $box[2] - $box[0];\r\n}",
"function getTextWidth($text){}",
"public function getGlyphWidth($char, $encoding = 'UTF-16BE') {}",
"public function getCharacterWidth() : int;",
"public function GetStringWidth($s)\n {\n $cw=$this->CurrentFont['cw'];\n $w=0;\n $s=(string)$s;\n $l=strlen($s);\n for ($i=0;$i<$l;$i++) {\n $w += $cw[$s[$i]];\n }\n return $w*$this->FontSize/1000;\n }",
"function guessTextWidth($str)\n{\n $box = imageTTFBbox(11, 0, getPath(array(__DIR__, 'fonts', 'DejaVuSans.ttf')), $str);\n return abs($box[4] - $box[0]) * (72 / 96);\n}",
"public function getWidth($char) {}",
"private function getStrPxWidth(String $string): int\r\n {\r\n return parent::getStrPxWitdh($string) + 2;\r\n }",
"public static function strwidth($str) {\n $double = preg_match_all('/[\\xE2-\\xEF][\\x80-\\xBF][\\x80-\\xBF]/', $str, $arr) - // U+2000 - U+FFFF = double width\n preg_match_all('/\\xEF\\xBD[\\xA1-\\xBF]|\\xEF\\xBE[\\x80-\\x9F]/', $str, $arr); // U+FF61 - U+FF9F = single width\n $null = preg_match_all('/[\\x00-\\x19]/', $str, $arr); // U+0000 - U+0019 = no width\n\n return UTF8::strlen($str) - $null + $double;\n }",
"public function getNumGlyphs() {}",
"public function getGlyphWidthByCharCode($charCode) {}",
"private function getInternalFontWidth()\n {\n return $this->getInternalFont() + 4;\n }",
"function GetMBStringWidth($s)\n{\n\t$l=0;\n\t$cw=&$this->CurrentFont['cw'];\n\t$nb=strlen($s);\n\t$i=0;\n\twhile($i<$nb)\n\t{\n\t\t$c=$s[$i];\n\t\tif(ord($c)<128)\n\t\t{\n\t\t\t$l+=$cw[$c];\n\t\t\t$i++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$l+=1000;\n\t\t\t$i+=2;\n\t\t}\n\t}\n\treturn $l*$this->FontSize/1000;\n}",
"function pdf_stringwidth(& $pdf, $text, $font, $fontsize)\n\t{\n\t# check text\n\tif(! strlen($text))\n\t\treturn(0);\n\n\t# check if font is valid\n\tif(sscanf($font, \"/F%d\", $whatever) != 1)\n\t\tdie(__FUNCTION__ . \": invalid font: \" . $font);\n\n\t# check if fontsize is valid\n\tif($fontsize == 0)\n\t\tdie(__FUNCTION__ . \": invalid fontsize: \" . $fontsize);\n\n\t# check if font is loaded\n\tif(! isset($pdf[\"resources\"][\"/Font\"][$font]))\n\t\tdie(__FUNCTION__ . \": font not found: \" . $font);\n\n\t# check if pointer is valid\n\tif(sscanf($pdf[\"resources\"][\"/Font\"][$font], \"%d %d R\", $object_id, $object_version) != 2)\n\t\tdie(__FUNCTION__ . \": invalid pointer.\");\n\n\t# set counter\n\t$width = 0;\n\n\t# convert to iso\n\t$text = utf8_decode($text);\n\n\t# count width of chars\n\tforeach(str_split($text) as $char)\n\t\t$width += $pdf[\"objects\"][$object_id][\"dictionary\"][\"/Widths\"][ord($char)];\n\n\treturn($width / 1000 * $fontsize);\n\t}",
"function getStringWidth( $text = '', $size, $angle = 0, $font = '' ) {\n if( strlen($text) ) {\n list($x,) = $this->textParams($text,$size,$angle,$font);\n return $x;\n }\n return 0;\n }",
"public function stringwidth($text)\n {\n //Source: http://stackoverflow.com/a/8076461\n if ($this->_page instanceof Zend_Pdf_Page ) {\n $font = $this->_page->getFont();\n $fontSize = $this->_page->getFontSize();\n } elseif ($this->_page instanceof Zend_Pdf_Resource_Font ) {\n $font = $this->_page;\n if( $fontSize === null ) return false;\n }\n\n if (!$font instanceof Zend_Pdf_Resource_Font ) {\n \t$this->_errmsg = \"Could not find font\";\n return false;\n }\n $drawingText = $text;//iconv ( '', $encoding, $text );\n $characters = array ();\n for ($i = 0; $i < strlen($drawingText); $i++) {\n $characters[] = ord($drawingText[$i]);\n }\n $glyphs = $font->glyphNumbersForCharacters($characters);\n $widths = $font->widthsForGlyphs($glyphs);\n $textWidth = (array_sum($widths) / $font->getUnitsPerEm()) * $fontSize;\n\n return $textWidth;\n }",
"public static function strwidth($s)\n {\n // init\n self::checkForSupport();\n\n return mb_strwidth($s, 'UTF-8');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get icu locale from sulu locale. | public function getIcuLocale(string $locale): string
{
$parts = explode('-', $locale);
if (isset($parts[1])) {
$parts[1] = mb_strtoupper($parts[1]);
}
return implode('_', $parts);
} | [
"public function getLocale() {\n\t\treturn $this->getClaim(self::CAIM_USER_LOCALE);\n\t}",
"public function getLocale() {}",
"public function getLocale();",
"public function getUiLocaleId()\n {\n return $this->uiLocaleId;\n }",
"function getSystemLocale() ;",
"public function getUserLocale()\n {\n return $this->userLocale;\n }",
"public static function locale() : string\n {\n // Compute the locale just one time\n if (self::$locale) {\n return self::$locale;\n }\n\n // Lang in cookies\n $locale = self::langToLocale($_COOKIE['NameYourGoat_User_Locale'] ?? '');\n\n // Lang in User repository\n if (! $locale && self::isAuth()) {\n $locale = self::langToLocale(self::$fullUser->lang);\n }\n\n // Lang in the request headers\n if (! $locale) {\n $acceptLang = explode(',', getallheaders()['Accept-Language'] ?? '');\n\n foreach ($acceptLang as $lang) {\n if ($locale = self::langToLocale(trim(strtok($lang, '-;')))) {\n break;\n }\n }\n }\n\n return self::$locale = $locale ?: self::$defaultLocale;\n }",
"public function getLocale()\n {\n return $this->_getVar('user_locale');\n }",
"protected function locale()\n {\n if (($member = Member::currentUser()) && $member->Locale) {\n return $member->Locale;\n }\n return i18n::get_locale();\n }",
"public static function getUserLocale()\n {\n global $config;\n if (self::isLoggedIn()) {\n $db = new DBHelper();\n $row = $db->get('user', [\n 'locale'\n ], [\n 'id' => $_SESSION['user'],\n ]);\n return $row['locale'];\n } else {\n if (isset($_COOKIE[$config['cookie']['language']])) {\n return $_COOKIE[$config['cookie']['language']];\n }\n }\n return $config['site']['default_locale'];\n }",
"private static function getLocale(): string\n\t{\n\t\t// Must be here, or $_SESSION is not available\n\t\tsession_start();\n\t\tif (isset($_SESSION['locale'])) {\n\t\t\treturn $_SESSION['locale'];\n\t\t}\n\n\t\t$locale = self::getLocaleNotCached();\n\t\t$_SESSION['locale'] = $locale;\n\t\tsession_write_close();\n\n\t\treturn $locale;\n\t}",
"abstract public function getLocaleCode();",
"public static function getLocale()\n\t\t{\n\t\t\tif (is_null(static::$_locale)) return static::$_defaultLocale;\t\t\t\n\t\t\treturn static::$_locale;\n\t\t}",
"public static function get_user_locale() {\n\t\treturn WPSEO_Language_Utils::get_user_locale();\n\t}",
"public function getLocale(): string\n {\n return $this->localeCode;\n }",
"public function getLocaleID();",
"public function getLocale() {\n }",
"public function getLocale(): string\n {\n return $this->locale;\n }",
"public function getSystemLocale()\n\t{\n\t\treturn $this->_systemLocale;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that we cannot upload a theme without info.xml file | public function testUploadThemeZipWithoutInfoFile(): void
{
// Generate zip with no info.xml
$this->fileName = tempnam(sys_get_temp_dir(), 'Theme');
$filePath = $this->fileName . '.zip';
$archive = new ZipArchive();
$archive->open($filePath, ZipArchive::CREATE);
$archive->addEmptyDir($this->fileName);
$archive->close();
if (file_exists($archive->filename)) {
throw new FileNotFoundException('Could not create zip file with theme');
}
$this->submitThemeUploadForm();
// We should get a 200 and show an error.
self::assertEquals(200, $this->client->getResponse()->getStatusCode());
self::assertContains('We could not find an info.xml', $this->client->getResponse()->getContent());
} | [
"public function testNoDefaultConfig() {\n $name = 'stark';\n $path = $this->availableThemes[$name]->getPath();\n $this->assertFileDoesNotExist(\"$path/\" . InstallStorage::CONFIG_INSTALL_DIRECTORY . \"/$name.settings.yml\");\n $this->container->get('theme_installer')->install([$name]);\n $this->assertNotNull(theme_get_setting('features.favicon', $name));\n }",
"public function test_version1importpreventsinvaliduserthemeoncreate() {\n set_config('allowuserthemes', 0);\n\n $this->run_core_user_import(array('theme' => 'rlmaster'));\n $this->assert_core_user_does_not_exist();\n\n set_config('allowuserthemes', 1);\n\n $this->run_core_user_import(array('theme' => 'bogus'));\n $this->assert_core_user_does_not_exist();\n }",
"public function testValidSimpleThemeImport()\n {\n $creator = $this->getFileImportCreator();\n $creator->setMaxFileUploadSize(1024 * 1024 * 20);\n\n $mvcEvent = $this->getMvcEventMock(__DIR__ . '/../Assets/simple-theme.zip');\n\n $result = $creator->create($mvcEvent);\n $this->assertInstanceOf('Zoop\\ShardModule\\Controller\\Result', $result);\n\n $theme = $result->getModel();\n $assets = $theme->getAssets();\n\n $this->assertInstanceOf('Zoop\\Theme\\DataModel\\PrivateTheme', $theme);\n $this->assertEquals('simple-theme', $theme->getName());\n $this->assertCount(1, $assets);\n $this->assertInstanceOf('Zoop\\Theme\\DataModel\\AssetInterface', $assets[0]);\n\n //check the index content which should be the only non-empty file\n /* @var $asset \\Zoop\\Theme\\DataModel\\AssetInterface */\n foreach ($assets as $asset) {\n if ($asset->getName() === 'index.html') {\n $this->assertInstanceOf('Zoop\\Theme\\DataModel\\Template', $asset);\n $this->assertNotEmpty($asset->getContent());\n }\n }\n }",
"public function testNonexistingConfigurationFile()\n {\n $configuration = new PageConfiguration('/not/existing');\n // Nothing should blow up...\n // Now check if the default options are accessible...\n $this->assertEquals('css', $configuration->stylesheet_direcotry);\n }",
"function test_switch_theme_bogus() {\n\t\t$template = rand_str();\n\t\t$style = rand_str();\n\t\tupdate_option('template', $template);\n\t\tupdate_option('stylesheet', $style);\n\n\t\t$theme = wp_get_theme();\n\t\t$this->assertEquals( $style, (string) $theme );\n\t\t$this->assertNotSame( false, $theme->errors() );\n\t\t$this->assertFalse( $theme->exists() );\n\n\t\t// these return the bogus name - perhaps not ideal behaviour?\n\t\t$this->assertEquals($template, get_template());\n\t\t$this->assertEquals($style, get_stylesheet());\n\t}",
"public function acme_demo_setup_missing_notice() {\r\n\r\n\t\t$search_url = in_array( 'acmethemes', array_keys( wp_get_themes()), true ) ? admin_url( 'theme-install.php?search=acmethemes' ) : admin_url( 'theme-install.php?search=acmethemes' );\r\n\r\n\t\techo '<div class=\"error notice is-dismissible\"><p><strong>' . $this->plugin_full_name . '</strong> – ' . sprintf( esc_html__( 'This plugin requires %s Theme to be activated to work.', 'acme-demo-setup' ), '<a href=\"'.esc_url( $search_url ).'\">' . esc_html__('Acme Themes','acme-demo-setup'). '</a>' ) . '</p></div>';\r\n\t}",
"public function testLoadActualTheme()\n {\n $key = Keys::Generate();\n\n $this->assertNotEquals(FALSE, $key);\n }",
"public function testThemeDoesNotExist(): void {\n $install_command = [\n $this->php,\n 'core/scripts/drupal',\n 'generate-theme',\n 'test_custom_theme',\n '--name=\"Test custom starterkit theme\"',\n '--description=\"Custom theme generated from a starterkit theme\"',\n '--starterkit',\n 'foobarbaz',\n ];\n $process = new Process($install_command, NULL);\n $process->setTimeout(60);\n $result = $process->run();\n $this->assertStringContainsString('Theme source theme foobarbaz cannot be found.', trim($process->getErrorOutput()));\n $this->assertSame(1, $result);\n }",
"public function test_extend_theme_support_non_core_themes(): void {\n\t\tupdate_option( 'stylesheet', '' );\n\n\t\t$this->instance->register();\n\n\t\t$this->assertFalse( get_theme_support( 'web-stories' ) );\n\t}",
"function checkvalidtheme($theme_check){\n global $ADMIN_DIRECTORY;\n if(@fopen(e_THEME.$theme_check.\"/theme.php\", r)){\n define(\"THEME\", e_THEME.$theme_check.\"/\");\n }else{\n @require_once(e_HANDLER.\"debug_handler.php\");\n @require_once(e_HANDLER.\"textparse/basic.php\");\n $etp = new e107_basicparse;\n $e107tmp_theme = search_validtheme();\n define(\"THEME\", e_THEME.$e107tmp_theme.\"/\");\n if(ADMIN && !strstr(e_SELF, $ADMIN_DIRECTORY)){echo '<script>alert(\"'.$etp->unentity(CORE_LAN1).'\")</script>';}\n }\n }",
"public function checkMissingLayoutCurrentThemeViaFrontend()\n {\n $currentPackageName = Mage::getSingleton('core/design_package')->getPackageName();\n $currentTemplateName = Mage::getSingleton('core/design_package')->getTheme('frontend');\n $message = $this->__('Advance Delivery Schedule: Missing layout file or template folder of this module. You can submit a ticket at <a href=\"http://www.mage-world.com/contacts/\" target=\"_blank\">here</a> for us about this.');\n\n // Get directory path to current theme\n $dirPath = Mage::getBaseDir('design') . DS . 'frontend' . DS;\n $dirPath .= $currentPackageName . DS . $currentTemplateName;\n\n // Check layout file is exists\n $layoutPath = $dirPath . DS . 'layout' . DS . self::LAYOUT_FILE;\n if(!file_exists($layoutPath)) {\n $flagLayout = true;\n if($currentTemplateName != 'default') {\n $defaultPath = Mage::getBaseDir('design') . DS . 'frontend' . DS . $currentPackageName . DS . 'default';\n $defaultPath .= DS . 'layout' . DS . self::LAYOUT_FILE;\n if(!file_exists($defaultPath)) {\n $flagLayout = false;\n }\n } else {\n $flagLayout = false;\n }\n\n if($flagLayout == false) {\n $basePath = Mage::getBaseDir('design') . DS . 'frontend' . DS . 'base' . DS . 'default';\n $basePath .= DS . 'layout' . DS . self::LAYOUT_FILE;\n if(!file_exists($basePath)) {\n Mage::getSingleton('core/session')->addError($message);\n return;\n }\n }\n }\n\n // Check template folder is exists\n $templatePath = $dirPath . DS . 'template' . DS . self::TEMPLATE_FOLDER;\n if(!file_exists($templatePath) || !is_dir($templatePath)) {\n $flagTemplate = true;\n if($currentTemplateName != 'default') {\n $defaultPath = Mage::getBaseDir('design') . DS . 'frontend' . DS . $currentPackageName . DS . 'default';\n $defaultPath .= DS . 'template' . DS . self::TEMPLATE_FOLDER;\n if(!file_exists($defaultPath) || !is_dir($defaultPath)) {\n $flagTemplate = false;\n }\n } else {\n $flagTemplate = false;\n }\n\n if($flagTemplate == false) {\n $basePath = Mage::getBaseDir('design') . DS . 'frontend' . DS . 'base' . DS . 'default';\n $basePath .= DS . 'template' . DS . self::TEMPLATE_FOLDER;\n if(!file_exists($basePath) || !is_dir($basePath)) {\n Mage::getSingleton('core/session')->addError($message);\n return;\n }\n }\n }\n\n // Check skin folder is exists\n $skinPath = Mage::getBaseDir('skin') . DS . 'frontend' . DS;\n $skinPath .= $currentPackageName . DS . $currentTemplateName . DS . self::TEMPLATE_FOLDER;\n if(!file_exists($skinPath) || !is_dir($skinPath)) {\n $flagSkin = true;\n if($currentTemplateName != 'default') {\n $defaultPath = Mage::getBaseDir('skin') . DS . 'frontend' . DS . $currentPackageName . DS . 'default';\n $defaultPath .= DS . self::TEMPLATE_FOLDER;\n if(!file_exists($defaultPath) || !is_dir($defaultPath)) {\n $flagSkin = false;\n }\n } else {\n $flagSkin = false;\n }\n\n if($flagSkin == false) {\n $basePath = Mage::getBaseDir('skin') . DS . 'frontend' . DS . 'base' . DS . 'default';\n $basePath .= DS . self::TEMPLATE_FOLDER;\n if(!file_exists($basePath) || !is_dir($basePath)) {\n Mage::getSingleton('core/session')->addError($message);\n return;\n }\n }\n }\n }",
"protected function theme_exists($theme)\n {\n }",
"public function testOnExistingTheme()\r {\r $request = $this->createDesktopRequest();\r $this->selector->select($request);\r\r $this->assertEquals('footheme', $this->holder->getTheme()->getName());\r }",
"public function invalid_setup()\n\t{\n\t\t$this->template->content = $this->add_view('reports/'.$this->report_prefix.'reports_module');\n\t\t$template = $this->template->content;\n\t\t$template->error_msg = _('Some parts in your setup is apparently missing.');\n\t\t$template->info = _(\"make sure you install the latest version of merlin\");\n\t}",
"function check_template() {\n $template_name = 'single-download.php';\n $source_template_file = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $template_name;\n $theme_folder = get_stylesheet_directory();\n if( !file_exists( $theme_folder . DIRECTORY_SEPARATOR . $template_name ) )\n copy( $source_template_file, $theme_folder . DIRECTORY_SEPARATOR . $template_name );\n }",
"protected function should_show_theme()\n {\n }",
"public function testThemeConfigExceptionSCustomTheme()\n {\n $oConfig = oxNew('oxConfig');\n $oConfig->sTheme = null;\n $oConfig->sCustomTheme = 'someTheme';\n\n $oView = oxNew('Theme_Main');\n Registry::set(Config::class, $oConfig);\n $this->assertEquals(true, $oView->themeInConfigFile(), 'Should return true as there is sCustomTheme.');\n }",
"function check_theme_installed($theme_id)\n{\n global $conf;\n\n return file_exists($conf['themes_dir'].'/'.$theme_id.'/'.'themeconf.inc.php');\n}",
"public function test_mod_mcodelti_create_tool_type_nonexistant_file() {\n $this->expectException('moodle_exception');\n $type = mod_mcodelti_external::create_tool_type($this->getExternalTestFileUrl('/doesntexist.xml'), '', '');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns effective source state for the Transition. If this is a Wildcard Transition then $currentState is treated as sourceState as such Transition can start from any State. | private function getSourceState(Workflow $workflow, WorkflowTransition $transition, WorkflowState $currentState)
{
if ($transition->startsFromAnyStateId()) {
return $currentState;
} else {
return $workflow->getStateForStateId($transition->getSourceStateId());
}
} | [
"public function currentState() {\n return $this->state;\n }",
"public function getCurrentSource()\n {\n return $this->currentSource;\n }",
"public function get_previous_source()\n {\n return $this->get_default_property(self::PROPERTY_PREVIOUS_SOURCE);\n }",
"private function getCurrentState() {\n\t\treturn $this->stateStack[0];\n\t}",
"public function get_state() {\n return $this->curr_state;\n }",
"private function getTransition($input) {\n\n $source = $this->currentState->getName();\n if (!isset($this->transitions[$source])) {\n // no more transitions from this state: it is a final state\n return NULL;\n }\n\n $transitionsBySource = $this->transitions[$source];\n if (!isset($transitionsBySource[$input])) {\n return NULL;\n }\n\n return $transitionsBySource[$input];\n }",
"protected function getNextStateFrom($currentTransition, $condition = NULL)\n {\n $possibleTransition = NULL;\n\n /** @var \\Mothership\\StateMachine\\Status $status */\n foreach ($this->states as $statusIndex => $status) {\n if (count($status->getTransitions()) == 0) {\n continue;\n }\n\n /* @var \\Mothership\\StateMachine\\Transition $transition */\n foreach ($status->getTransitions() as $transition) {\n\n // FIX transittion from\n if ($currentTransition == $transition->getFrom()) {\n\n /*\n * If the next expected transition depends on a condition,\n * we need to check, if the condition is also set\n */\n if (true === $transition->hasCondition() && $condition === $transition->getCondition()) {\n //$this->language->evaluate('test == true', ['return' => false]);\n return $transition->getStatus();\n }\n\n if (false === $transition->hasCondition()) {\n return $transition->getStatus();\n }\n }\n }\n }\n $error = \"\\nδ: (X × Z → Z) \" . sprintf('return value [%s] x state_source [%s] → state_target[%s] ', $condition, $currentTransition, 'MISSING');\n throw new TransitionException($error);\n }",
"public function get_Original_Source()\n {\n return $this->orig_src;\n }",
"function getSource() {\n\t\treturn mofilmSource::getInstance($this->getSourceID());\n\t}",
"public function getState()\n\t{\n\t\treturn $this->model->searchState($this->result, $this->data['state'] ?? null);\n\t}",
"public function getTransition()\n {\n return $this->transition;\n }",
"public function getSource() {\n $this->modx->loadClass('sources.modMediaSource');\n $this->source = modMediaSource::getDefaultSource($this->modx,$this->getProperty('source'));\n if (empty($this->source) || !$this->source->getWorkingContext()) {\n return false;\n }\n return $this->source;\n }",
"public function getSyntheticSource()\n {\n if (array_key_exists('ai.operation.syntheticSource', $this->_data)) { return $this->_data['ai.operation.syntheticSource']; }\n return NULL;\n }",
"public function getState();",
"public function getResourceOriginalState()\n {\n return $this->resource_original_state;\n }",
"public function getState() {\n return State::where('abbrev', $this->state)->firstOrFail();\n }",
"public function getCurrentState(): ?object {\n $states = $this->get('states');\n $i = count($states);\n while ($i-- > 0) {\n $state = $states->get($i)->entity;\n if ($state->current->value) {\n return $state;\n }\n }\n return NULL;\n }",
"function GetSource()\n {\n return $this->source;\n }",
"private function getSource() {\n $this->modx->loadClass('sources.modMediaSource');\n $this->source = modMediaSource::getDefaultSource($this->modx,$this->getProperty('source'));\n if (empty($this->source) || !$this->source->getWorkingContext()) {\n return false;\n }\n return $this->source;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
weighted_random_simple() Pick a random item based on weights. | function weighted_random_simple($values, $weights){
$count = count($values);
$i = 0;
$n = 0;
$num = mt_rand(0, array_sum($weights));
while($i < $count){
$n += $weights[$i];
if($n >= $num){
break;
}
$i++;
}
return $values[$i];
} | [
"function weighted_random_simple($values, $weights) {\n $count = count($values);\n $i = 0;\n $n = 0;\n echo array_sum($weights);\n echo \"<br>\";\n $num = mt_rand(0, array_sum($weights));\n echo $num;\n echo \"<br>\";\n while ($i < $count) {\n $n += $weights[$i];\n if ($n >= $num) {\n break;\n }\n $i++;\n }\n return $values[$i];\n }",
"private function weightedRandomTreatment() {\n\t\t$weights = $this->getWeightings();\n\t\t$max = array_sum($weights);\n\t\t$soFar = 0;\n\t\t$random = mt_rand(0, $max - 1);\n\t\tforeach($weights as $k => $v) {\n\t\t\t$soFar += $v;\n\t\t\tif ($random < $soFar) {\n\t\t\t\treturn $k;\n\t\t\t}\n\t\t}\n\t}",
"function random_weighted($kv)\n{\n\t$sum = array_sum(array_values($kv));\n\t$rnd = (mt_rand() / mt_getrandmax()) * $sum;\n\tforeach ($kv as $k => $v)\n\t{\n\t\tif ($v >= $rnd)\n\t\t\treturn $k;\n\t\t$rnd -= $v;\n\t}\n\ttrigger_error('unreachable');\n}",
"function getRandomWeightedElement(array $weightedValues) {\n $rand = mt_rand(1, (int) array_sum($weightedValues));\n\n foreach ($weightedValues as $key => $value) {\n $rand -= $value;\n if ($rand <= 0) {\n return $key;\n }\n }\n }",
"function getRandomWeightedElement(array $weightedValues) {\n $rand = mt_rand(1, (int) array_sum($weightedValues));\n\n foreach ($weightedValues as $key => $value) {\n $rand -= $value;\n if ($rand <= 0) {\n return $key;\n }\n }\n}",
"function array_weighted_rand(array $list)\n{\n $totalWeight = gmp_init(0);\n foreach ($list as $key => $weight) {\n if ($weight < 0) {\n throw new \\InvalidArgumentException(\"Weights cannot be negative. Found $key => $weight.\");\n }\n $totalWeight += $weight;\n }\n\n if ($totalWeight == 0) {\n throw new \\InvalidArgumentException(\"Total weight must exceed zero.\");\n } elseif ($totalWeight == 1) {\n return array_search(1, $list);\n }\n\n $rand = gmp_random_range(1, $totalWeight);\n foreach ($list as $key => $weight) {\n $rand -= $weight;\n if ($rand <= 0) {\n return $key;\n }\n }\n}",
"public static function weighted_chance($options, $weights = array()){\n\n // Count the number of values passed\n $option_amount = count($options);\n\n // If no weights have been defined, auto-generate\n if (empty($weights)){\n $weights = array();\n for ($i = 0; $i < $option_amount; $i++){\n $weights[] = 1;\n }\n }\n\n // Generate a single weighted values array\n $weighted_values = array();\n foreach ($options AS $key => $option){ $weighted_values[$option] = $weights[$key]; }\n\n // Collect a random number and check which key it matches\n $random_int = mt_rand(1, array_sum($weighted_values));\n foreach ($weighted_values as $option => $weight) {\n $random_int -= $weight;\n if ($random_int <= 0) {\n return $option;\n }\n }\n\n }",
"static public function getRandomWeightedElement(array $weightedValues) {\n $rand = mt_rand(1, (int) array_sum($weightedValues));\n\n foreach ($weightedValues as $key => $value) {\n $rand -= $value;\n if ($rand <= 0) {\n return $key;\n }\n }\n }",
"protected function getRandomWeight() \n {\n return ((mt_rand(0, 1000) / 1000) - 0.5) / 2;\n }",
"function rand_weighted($numbers) {\r\n\t$total = 0;\r\n\tforeach ($numbers as $number => $weight) {\r\n\t\t$total += $weight;\r\n\t\t$distribution[$number] = $total;\r\n\t}\r\n\t$rand = mt_rand(0, $total - 1);\r\n\tforeach ($distribution as $number => $weights) {\r\n\t\tif ($rand < $weights) { return $number; }\r\n\t}\r\n}",
"function array_fetch_random_weighted_value( &$array )\n {\n if( !empty($array) )\n {\n $total_weight = 0;\n foreach( $array as $element )\n {\n $weight = is_array($element) ? (isset($element['weight']) ? $element['weight'] : 0) : (isset($element->weight) ? $element->weight : 0);\n $total_weight += max(0, $weight);\n }\n\n if( $total_weight <= 0 )\n {\n return null;\n }\n\n $roll = mt_rand(0, $total_weight-1);\n\n foreach( $array as $key => $element )\n {\n $weight = is_array($element) ? (isset($element['weight']) ? $element['weight'] : 0) : (isset($element->weight) ? $element->weight : 0);\n $roll -= max(0, $weight);\n if( $roll < 0 )\n {\n return $element;\n }\n\n }\n }\n\n return null;\n }",
"function aecom_weighted_random_sort( $weight_a, $weight_b ) {\n $order_a = mt_rand( 0, 1000 ) + ( (int) $weight_a * 10000 );\n $order_b = mt_rand( 0, 1000 ) + ( (int) $weight_b * 10000 );\n return $order_b - $order_a;\n}",
"function randomSimpleUCWeight()\n {\n return mt_rand($this->range_positions['min_xSimple'] * 100, $this->range_positions['max_xSimple'] * 100) / 100;\n }",
"function weighted_randomize($prob_array, $at_key)\r\n{\r\n\t$prob_list = $prob_array[$at_key];\r\n\t\r\n\t// Create an array containing cutpoints for randomization\r\n\t$cumul_prob = array();\r\n\t$cumulative = 0.0;\r\n\tfor ($i=0; $i<count($prob_list); $i++){\r\n\t\t$cumul_prob[$i] = $cumulative;\r\n\t\t$cumulative = $cumulative + floatval($prob_list[$i]);\r\n\t}\r\n\r\n\t// Generate a uniform random floating point value between 0.0 and 1.0\r\n\t$unif_rand = mt_rand() / mt_getrandmax();\r\n\r\n\t// Figure out which integer should be returned\r\n\t$outInt = 0;\r\n\tfor ($k = 0; $k < count($cumul_prob); $k++){\r\n\t\tif ($cumul_prob[$k] <= $unif_rand){\r\n\t\t\t$outInt = $k + 1;\r\n\t\t}\r\n\t}\r\n\r\n\treturn($outInt);\r\n\r\n}",
"function weighted_randomize($prob_array, $at_key)\n{\n\t$prob_list = $prob_array[$at_key];\n\t\n\t// Create an array containing cutpoints for randomization\n\t$cumul_prob = array();\n\t$cumulative = 0.0;\n\tfor ($i=0; $i<count($prob_list); $i++){\n\t\t$cumul_prob[$i] = $cumulative;\n\t\t$cumulative = $cumulative + floatval($prob_list[$i]);\n\t}\n\n\t// Generate a uniform random floating point value between 0.0 and 1.0\n\t$unif_rand = mt_rand() / mt_getrandmax();\n\n\t// Figure out which integer should be returned\n\t$outInt = 0;\n\tfor ($k = 0; $k < count($cumul_prob); $k++){\n\t\tif ($cumul_prob[$k] <= $unif_rand){\n\t\t\t$outInt = $k + 1;\n\t\t}\n\t}\n\n\treturn($outInt);\n\n}",
"function fann_randomize_weights($ann, $min_weight, $max_weight)\n{\n}",
"function randomSimpleUCWeight()\n {\n $MIN = 5;\n $MAX = 7.49;\n return mt_rand($MIN * 100, $MAX * 100) / 100;\n }",
"abstract public function randomWeightedSubsetWithReplacement(int $n, array $weights);",
"public function random()\r\n\t{\r\n\t\treturn $this->_items[array_rand($this->_items)];\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get recurrence data (keys 'recur_') to merge into an event | public function rrule2event()
{
return array(
'recur_type' => $this->type,
'recur_interval' => $this->interval,
'recur_enddate' => $this->enddate ? $this->enddate->format('ts') : null,
'recur_data' => $this->weekdays,
'recur_exception' => $this->exceptions,
);
} | [
"function getRecurEvents($event){\n\n $events = array();\n\n $rulestr = $event['rrule'];//\"FREQ=DAILY\";//;COUNT=5;INTERVAL=3\";\n //$rulestr = \"FREQ=DAILY;DURATION=60\";//;COUNT=5;INTERVAL=3\";\n $startdate = new DateTime($event['sd']);\n $enddate = new DateTime($event['ed']);\n\n // Recurring event, parse RRULE and add appropriate duplicate events\n $rrules = array();\n $rruleStrings = explode(';', $rulestr);\n foreach ($rruleStrings as $s) {\n list($k, $v) = explode('=', $s);\n $rrules[$k] = $v;\n }\n\n // Get frequency\n $frequency = $rrules['FREQ']; \n\n //get duration\n $duration = (isset($rrules['DURATION']) && $rrules['DURATION'] !== '')\n ? $rrules['DURATION']\n : \"120\";\n //if it somehow got a negative duration, fix it.\n if (intval($duration) < 0){\n \t$duration = \"120\";\n }\n //echo $duration;\n //$duration = explode(':',$duration);\n //$durHrs = $duration[0];\n //$durMins = $duration[1];\n\n // Get Interval\n $interval = (isset($rrules['INTERVAL']) && $rrules['INTERVAL'] !== '')\n ? $rrules['INTERVAL']\n : 1;\n\n //get Count\n $count = (isset($rrules['COUNT']) && $rrules['COUNT'] !== '')\n ? $rrules['COUNT']\n : 1;\n\n $until=$enddate;\n\n $currdate = new DateTime(null,(new DateTimeZone(\"America/Los_Angeles\")));\n\n $byday = (isset($rrules['BYDAY']) && $rrules['BYDAY'] !== '')\n ? $rrules['BYDAY']\n : null;\n // if (isset($rrules['UNTIL'])) {\n // Get Until\n // $until = new DateTime($rrules['UNTIL']); \n // } \n\n // Decide how often to add events and do so\n switch ($frequency) {\n case 'DAILY':\n $newsd = $startdate;//->add(new DateInterval('P'.$interval.'D'));\n $tempd = clone $newsd;\n $newed = $tempd->add(new DateInterval('PT'.$duration.'M'));\n\n $ii = 0;\n while ($newed<=$until){\n //for($i=0;$i<$count;$i++){\n if($newed>=$currdate){\n $tempevent = $event;\n $tempevent['id'] = $event[\"id\"];//.\"0\".$ii;\n $tempevent['sd'] = $newsd->format('Y-m-d H:i:s'); \n $tempevent['ed'] = $newed->format('Y-m-d H:i:s');\n $tempevent['repeats'] = $frequency;\n // echo $tempevent['sd'].' '.$tempevent['ed'];\n $events[] = $tempevent;\n $ii++;\n }\n\n //echo json_encode($tempevent);\n //echo $newsd->format('Y-m-d H:i');\n //echo '<br>';\n $newsd = $startdate->add(new DateInterval('P'.$interval.'D'));\n $tempd = clone $newsd;\n $newed = $tempd->add(new DateInterval('PT'.$duration.'M'));\n } \n break;\n case 'WEEKLY':\n $interval = 7; //if weekly, just do same thing as daily but add 7 days\n $newsd = $startdate;//->add(new DateInterval('P'.$interval.'D'));\n $tempd = clone $newsd;\n $newed = $tempd->add(new DateInterval('PT'.$duration.'M'));\n\n $ii = 0;\n while ($newed<=$until){\n //for($i=0;$i<$count;$i++){\n if($newed>=$currdate){\n $tempevent = $event;\n $tempevent['id'] = $event[\"id\"];//.\"0\".$ii;\n $tempevent['sd'] = $newsd->format('Y-m-d H:i:s'); \n $tempevent['ed'] = $newed->format('Y-m-d H:i:s');\n $tempevent['repeats'] = $frequency;\n //echo $tempevent['sd'].' '.$tempevent['ed'];\n //echo '<br>';\n $events[] = $tempevent;\n $ii++;\n }\n\n //echo json_encode($tempevent);\n //echo $newsd->format('Y-m-d H:i');\n //echo '<br>';\n $newsd = $startdate->add(new DateInterval('P'.$interval.'D'));\n $tempd = clone $newsd;\n $newed = $tempd->add(new DateInterval('PT'.$duration.'M'));\n } \n break;\n case 'MONTHLY'://handle by weekday case, also need to handle for weekly.. hmm\n if ($byday != null){\n //$byday = \"1SU\";\n $weekno = intval($byday)-1;\n $dayofweek = substr($byday,-2);\n\n $weekdays = array('SU'=>'sunday','MO'=> 'monday','TU'=>'tuesday','WE'=>'wednesday','TH'=>'thursday','FR'=>'friday','SA'=>'saturday');\n $numwords = ['first','second','third','fourth','fifth'];\n\n\n $interval = 1;\n $newsd = $startdate;//->add(new DateInterval('P'.$interval.'D'));\n $tempd = clone $newsd;\n\n $newed = $tempd->add(new DateInterval('PT'.$duration.'M'));\n\n $ii = 0;\n while ($newed<=$until){\n //for($i=0;$i<$count;$i++){\n if($newed>=$currdate){\n $tempevent = $event;\n $tempevent['id'] = $event[\"id\"];//.\"0\".$ii;\n $tempevent['sd'] = $newsd->format('Y-m-d H:i:s'); \n $tempevent['ed'] = $newed->format('Y-m-d H:i:s');\n $tempevent['repeats'] = $frequency;\n // echo $tempevent['sd'].' '.$tempevent['ed'];\n //echo '<br>';\n $events[] = $tempevent;\n $ii++;\n }\n\n //echo json_encode($tempevent);\n //echo $newsd->format('Y-m-d H:i');\n //echo '<br>';\n $newsd = $startdate->add(DateInterval::createFromDateString($numwords[$weekno].\" \".$weekdays[$dayofweek].\" of next month\"));\n $tempd = clone $newsd;\n $newed = $tempd->add(new DateInterval('PT'.$duration.'M'));\n }\n }\n\n break;\n }\n return $events;\n}",
"public function updateRecurringEvents()\n {\n \n $recurrence = array('daily' => '+1 day',\n 'weekly' => '+1 week',\n 'monthly' => '+1 month',\n 'annually' => '+1 year');\n \n $db =& $this->getDatabaseConnection();\n $sql = \"SELECT DATE_FORMAT(starttime,'%a %Y-%m-%d %T') AS day,\n event_id, recurringtype, recurs_until\n FROM eventdatetime WHERE recurringtype != 'none' GROUP BY starttime;\";\n $days =& $db->queryCol($sql);\n $sql = \"SELECT DATE_FORMAT(endtime, '%a %Y-%m-%d %T'), starttime\n FROM eventdatetime WHERE recurringtype != 'none' GROUP BY starttime;\";\n $end =& $db->queryCol($sql);\n $sql = \"SELECT event_id, starttime FROM eventdatetime\n WHERE recurringtype != 'none' GROUP BY starttime;\";\n $eid =& $db->queryCol($sql);\n $sql = \"SELECT rectypemonth, starttime FROM eventdatetime\n WHERE recurringtype != 'none' GROUP BY starttime;\";\n $rtm =& $db->queryCol($sql);\n $sql = \"SELECT recurringtype, starttime FROM eventdatetime\n WHERE recurringtype != 'none' GROUP BY starttime;\";\n $rct =& $db->queryCol($sql);\n $sql = \"SELECT DATE_FORMAT(recurs_until, '%a %Y-%m-%d %T'), starttime \n FROM eventdatetime WHERE recurringtype != 'none' GROUP BY starttime;\";\n $rcu =& $db->queryCol($sql);\n \n // [0] => recurringdate, [1] => event_id, [2] => recurrence_id, [3] => ongoing, [4] => unlinked\n $res = array(array(), array(), array(), array());\n for ($i = 0, $j = 0, $k = 0, $r = 0; $i < count($days); $i++, $k=0) {\n $cur = $days[$i];\n $sql = \"SELECT recurringdate FROM recurringdate\n WHERE event_id={$eid[$i]} AND unlinked = TRUE;\";\n $ule =& $db->queryCol($sql);\n while (strtotime($cur) <= strtotime($rcu[$i])) {\n $res[0][$j] = date('Y-m-d', strtotime($cur));\n $res[1][$j] = $eid[$i];\n $res[2][$j] = $k;\n $res[3][$j] = 'FALSE';\n $res[4][$j] = 'FALSE';\n $j++;\n $temp = date('D Y-m-d H:i:s', strtotime('next day', strtotime($cur)));\n while (strtotime($temp) <= strtotime($end[$i])) {\n $res[0][$j] = date('Y-m-d', strtotime($temp));\n $res[1][$j] = $eid[$i];\n $res[2][$j] = $k;\n $res[3][$j] = 'TRUE';\n $res[4][$j] = 'FALSE' ;\n $j++;\n $temp = date('D Y-m-d H:i:s', strtotime('next day', strtotime($temp)));\n }\n $k++;\n if ($rct[$i] != 'monthly' || $rtm[$i] == 'date') {\n $cur = date('D Y-m-d H:i:s', strtotime($recurrence[$rct[$i]], strtotime($cur)));\n $end[$i] = date('D Y-m-d H:i:s', strtotime($recurrence[$rct[$i]], strtotime($end[$i])));\n } else if ($rtm[$i] == 'lastday') { \n $nextmon = date('F Y H:i:s', strtotime('+1 day', strtotime($cur)));\n $nextmon = date('F Y H:i:s', strtotime('+1 month', strtotime($nextmon)));\n $cur = date('D Y-m-d H:i:s', strtotime('-1 day', strtotime($nextmon)));\n } else {\n // Update current\n $weekday = date('l', strtotime($cur));\n $fstr = ($rtm[$i] == 'last') ? '+2 months': 'next month';\n $nextmon = date('F Y H:i:s', strtotime($fstr, strtotime($cur)));\n $nextmonweekday = date('l', strtotime($nextmon));\n $cur = date('D Y-m-d H:i:s', strtotime(\"{$rtm[$i]} $weekday, $nextmon\")); \n if ($weekday == $nextmonweekday && $rtm[$i] != 'last') {\n $cur = date('D Y-m-d H:i:s', strtotime('last week', strtotime($cur)));\n }\n // Update end\n $weekday = date('l', strtotime($end[$i]));\n $nextmon = date('F Y H:i:s', strtotime('next month', strtotime($end[$i])));\n $nextmonweekday = date('l', strtotime($nextmon));\n $end[$i] = date('D Y-m-d H:i:s', strtotime(\"{$rtm[$i]} $weekday, $nextmon\"));\n if ($weekday == $nextmonweekday && $rtm[$i] != 'last') {\n $end[$i] = date('D Y-m-d H:i:s', strtotime('last week', strtotime($end[$i])));\n }\n }\n }\n foreach ($ule as $unlinked_date) {\n if ($keys = array_keys($res[0], $unlinked_date)) {\n foreach ($keys as $key) { \n $res[4][$key] = 'TRUE';\n }\n }\n }\n }\n \n // Clean this month\n $sql = \"DROP TABLE IF EXISTS recurringdate;\";\n $dropres = $db->query($sql);\n $sql = \"CREATE TABLE IF NOT EXISTS `recurringdate` (\n `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,\n `recurringdate` DATE NOT NULL, \n `event_id` INTEGER(10) UNSIGNED NOT NULL,\n `recurrence_id` INTEGER(10) UNSIGNED NOT NULL,\n `ongoing` BOOL,\n `unlinked` BOOL DEFAULT FALSE, PRIMARY KEY (`id`), KEY `event_id` (`event_id`), KEY `unlinked` (`unlinked`));\";\n \n $table =& $db->query($sql);\n if (!PEAR::isError($table)) {\n for ($i = 0; $i < count($res[0]); $i++) {\n $sql = \"INSERT INTO recurringdate (recurringdate, event_id, recurrence_id, ongoing, unlinked) \n VALUES('{$res[0][$i]}', {$res[1][$i]}, {$res[2][$i]}, {$res[3][$i]}, {$res[4][$i]});\";\n $ret = $db->query($sql);\n //$res[0][$i] = date('m-d', strtotime($res[0][$i]));\n }\n }\n }",
"public function buildRecurrence(&$entity) {\n /*\n * Validations\n */\n $r = 0;\n // not recurring\n if ($entity->recurrence_type == 0) return $r;\n // is published type\n $type = rec_event_type_load($entity->type);\n if ($type->state > 0) return $r;\n // just in case set NEW\n if (!isset($entity->recurrence_edit_status))\n $entity->recurrence_edit_status = 0;\n // First initialisations\n $wrapper = entity_metadata_wrapper('rec_event', $entity);\n $parent_date = $wrapper->event_date->value(); \n $date_pos = new DateObject($parent_date['value']);\n $date_pos_end = new DateObject($parent_date['value2']);\n $duration = $date_pos->diff($date_pos_end);\n $now = new DateObject('now');\n // is parent? NO\n if (isset($entity->parent_event_id) && !empty($entity->parent_event_id)) {\n // if NEW (comes from auto-creation procedure) OR EXCEPTION? return\n if ($entity->recurrence_edit_status < 2) return $r;\n // if NEXT? then \n // set parent event end date to this event date, no repopulate\n // then proceed to LOOP-THROUGH (update-create/delete)\n //\n if ($entity->recurrence_edit_status == 2) {\n // first set parent id=this id for all events \n // where parentid=old parentid and \n // date >= this date (or ID, is sequential)\n // otherwise saving new max_date to parent entity \n // will delete the remaining events!\n // http://drupal.stackexchange.com/questions/108188/is-it-proper-to-perform-a-db-update-on-an-entity-table\n // @see Drupal.odt\n // db_update is safe: entities will be re-saved through API\n try {\n db_update('rec_event')\n ->fields(array(\n 'parent_event_id' => $entity->event_id\n ))\n ->condition('parent_event_id', $entity->parent_event_id)\n ->condition('event_id', $entity->event_id, '>=') \n // this will change this controller event too but it is ok \n // since it will be properly saved by API when we'll return 2.\n ->execute();\n }\n catch (Exception $e) {\n drupal_set_message(\n t('Update failed. Message = %message, query = %query',\n array(\n '%message' => $e->getMessage(), \n '%query' => $e->query_string,\n )), 'error');\n }\n // Get the number of occurences prior to this edit \n // in order to set max_occ for old parent\n $select = db_select('rec_event', 'e')\n ->fields('e', array('event_id'))\n ->condition('parent_event_id', $entity->parent_event_id)\n ->orderBy('event_id');\n $ids = $select->execute()->fetchCol();\n // move max_date and max_occ to old parent, now is safe to repopulate \n // without affecting old remains\n $entity_parent = rec_event_load($entity->parent_event_id);\n // if for some reason the parent no longer exists \n // (false returned - data discrepancy), then we are ok\n if ($entity_parent) {\n $entity_parent->recurrence_max_date = $date_pos->getTimestamp();\n $entity_parent->recurrence_max_occ = count($ids) + 1;\n $entity_parent->recurrence_edit_status = 3;\n rec_event_save($entity_parent);\n }\n // now set this parent id to null\n $r = 2;\n $entity->parent_event_id = NULL;\n // now is ok to LOOP-THROUGH baby\n }\n // if ALL? then\n // edit parent with the details of this event and disregard this \n else {\n $entity_parent = rec_event_load($entity->parent_event_id);\n if ($entity_parent) {\n RecEventController::copy($entity, $entity_parent);\n // reset from copy\n $entity_parent->parent_event_id = NULL;\n // set explicitly: won't be copied\n $entity_parent->recurrence_edit_status = 3;\n $wrapper_parent = \n entity_metadata_wrapper('rec_event', $entity_parent);\n // Combine parent's date with this event's time\n $new_date = $wrapper_parent->event_date->value();\n $new_date_obj = new DateObject($new_date['value']);\n $new_date['value'] = $new_date_obj->format('Y-m-d') . ' ' . \n $date_pos->format('H:i:s');\n $new_date_obj = new DateObject($new_date['value']);\n $date_pos_end = clone $new_date_obj;\n $new_date['value2'] = \n $date_pos_end->add($duration)->format('Y-m-d H:i:s');\n // No: undesired effects\n //RecEventController::copyFields($wrapper, $wrapper_parent);\n $wrapper_parent->event_date->set($new_date);\n // Remove edit_status from this otherwise we get infinite recursion\n // Set type=0 to avoid buildRecurrence;\n // event will be reused because the select query for existing events\n // during update does not check against this field \n // then it gets reset by parent\n $entity->recurrence_type = 0;\n $entity->recurrence_edit_status = 0;\n rec_event_save($entity);\n // could also have called $wrapper->save();\n // Now proceed to save parent\n $wrapper_parent->save();\n }\n // if for some reason the parent no longer exists \n // (false returned - data discrepancy)\n else {\n drupal_set_message(t(\n 'Update ignored: unable to find the parent event %parent of the series for event %id', \n array(\n '%parent' => $entity->parent_event_id,\n '%id' => $entity->event_id,\n )));\n }\n return $r;\n }\n }\n // is parent? YES\n else {\n // if NEW? then proceed to LOOP-THROUGH (create)\n // if EXCEPTION? return\n if ($entity->recurrence_edit_status == 1) return $r;\n // if NEXT? then set ALL\n elseif ($entity->recurrence_edit_status == 2)\n $entity->recurrence_edit_status = 3;\n // if ALL? then proceed to LOOP-THROUGH (update-create/delete)\n }\n /*\n * LOOP-THROUGH: starting values\n */\n $date_max = new DateObject(($now->format('Y') + 1) . '/12/31 23:59:00');\n //$date_max_recurring = clone $now;\n //$date_max_recurring->setTimestamp($entity->recurrence_max_date);\n if ($entity->recurrence_max_date > 0) {\n $date_max_recurring = new DateObject('@' . $entity->recurrence_max_date);\n if ($date_max_recurring < $date_max)\n $date_max = clone $date_max_recurring;\n }\n // get starting week (for weekly etc)\n $week_pos = $date_pos->format('W'); \n $week_start = $week_pos;\n $weekly_days = isset($entity->recurrence_weekly_days)? \n $entity->recurrence_weekly_days: array(); \n if (!is_array($weekly_days)) $weekly_days = unserialize($weekly_days);\n // get month pos\n $month_pos = $date_pos->format('m');\n $month_start = $month_pos;\n // get occurence number\n $occ_pos = 1;\n // maximum occurences is 2 * 365\n // HC; change this and $date_max to allow more than 2 years of recurrence\n $occ_max = ($entity->recurrence_max_occ > 0)? \n $entity->recurrence_max_occ: 730;\n // logging variables\n $msec = round(microtime(true) * 1000);\n $dates = $date_pos->format('d/m/Y H:i');\n // Get all event IDs that have parentID=this event ID by ID \n // (we assume ID1<ID2 and date1<date2!)\n // Will be used later in updating\n $ids = array();\n // failsafe for endless recursion\n // create new events anyway if status is 0.\n if ($entity->recurrence_edit_status > 0) {\n // we dont check for recurrence_type (we assume it is ok)\n // actually it should be ok, why else a non-recurring item to have parent\n // do not change this because it will break the functionality of\n // case 'not a parent, edit all' above.\n $select = db_select('rec_event', 'e')\n ->fields('e', array('event_id'))\n ->condition('parent_event_id', $entity->event_id)\n ->orderBy('event_id');\n $ids = $select\n ->execute()\n ->fetchCol();\n // remove this ID if happens to be in array\n // shouldn't but may happen if data discrepancy\n // OR if editing subsequent, parent ID is set to this ID (was a bug)\n // If remains, problem because it gets re-saved with unforseeable results.\n $ids = array_diff($ids, array($entity->event_id));\n }\n /*\n * LOOP-THROUGH: the loop\n */\n while (($date_pos < $date_max) && ($occ_pos < $occ_max)) {\n // daily\n if ($entity->recurrence_type == 1) {\n // every x days\n if ($entity->recurrence_subtype == 0)\n $date_pos->add(new DateInterval('P' . \n ($entity->recurrence_daily_every + 1) . 'D'));\n // every working day\n else do {\n $date_pos->add(new DateInterval('P1D'));\n } while (intval($date_pos->format('N')) > 5); // > fri\n }\n // weekly\n elseif ($entity->recurrence_type == 2) {\n do {\n $date_pos->add(new DateInterval('P1D'));\n $week_pos = $date_pos->format('W'); \n } while (!in_array($date_pos->format('N'), $weekly_days) || // date_pos' day is not in list OR\n (($week_pos - $week_start) % ($entity->recurrence_weekly_every + 1))); // if there is modulus (correct week nums should leave mod 0)\n }\n // monthly\n elseif ($entity->recurrence_type == 3) {\n // at a specified date of every x months\n if ($entity->recurrence_subtype == 0) {\n // if month is >12 it is handled by \n // rec_event_get_date_for_month_year()\n $month = $date_pos->format('m') + $entity->recurrence_monthly_every+1;\n $year = $date_pos->format('Y');\n $date_pos = rec_event_get_date_for_month_year(\n $entity->recurrence_at_date, $month, $year, \n $date_pos->format('H:i:s'));\n }\n // at a specified day of a specified week of every x months\n elseif ($entity->recurrence_subtype == 1) {\n do {\n $date_pos->add(new DateInterval('P1D'));\n // get week number in month\n // http://stackoverflow.com/questions/5853380/php-get-number-of-week-for-month\n $month = $date_pos->format('m');\n $year = $date_pos->format('Y');\n $first_of_month = new DateObject($year . '/' . $month . '/1');\n $day_of_first = $first_of_month->format('N');\n $day_of_month = $date_pos->format('j');\n $week_pos = floor(($day_of_first + $day_of_month - 2) / 7) + 1;\n $day_last_of_month = $date_pos->format('t');\n $week_last = floor(($day_of_first + $day_last_of_month - 2) / 7)+1;\n $month_pos = $month;\n } while (!in_array($date_pos->format('N'), $weekly_days) || // date_pos' day is not in list OR\n (($entity->recurrence_at_week < 4) && (($entity->recurrence_at_week + 1) != $week_pos)) ||\n (($entity->recurrence_at_week == 4) && ($week_last != $week_pos)) ||\n (($month_pos - $month_start) % ($entity->recurrence_monthly_every + 1)));\n }\n }\n // yearly\n elseif ($entity->recurrence_type == 4) {\n // at a specified date of a specified month of every year\n if ($entity->recurrence_subtype == 0) {\n $month = $entity->recurrence_at_month; // 1-based\n $year = $date_pos->format('Y') + 1;\n $date_pos = rec_event_get_date_for_month_year(\n $entity->recurrence_at_date, $month, $year, \n $date_pos->format('H:i:s'));\n }\n // at a specified day of a specified week,\n // of a specified month of every year\n elseif ($entity->recurrence_subtype == 1) {\n do {\n $date_pos->add(new DateInterval('P1D'));\n // get week number in month\n // http://stackoverflow.com/questions/5853380/php-get-number-of-week-for-month\n $month = $date_pos->format('m');\n $year = $date_pos->format('Y');\n $first_of_month = new DateObject($year . '/' . $month . '/1');\n $day_of_first = $first_of_month->format('N');\n $day_of_month = $date_pos->format('j');\n $week_pos = floor(($day_of_first + $day_of_month - 2) / 7) + 1;\n $day_last_of_month = $date_pos->format('t');\n $week_last = floor(($day_of_first + $day_last_of_month - 2) / 7)+1;\n } while (!in_array($date_pos->format('N'), $weekly_days) || // date_pos' day is not in list OR\n (($entity->recurrence_at_week < 4) && (($entity->recurrence_at_week + 1) != $week_pos)) ||\n (($entity->recurrence_at_week == 4) && ($week_last != $week_pos)) ||\n ($month != $entity->recurrence_at_month));\n }\n }\n else break; // handle THIS if in future we save anythin in parent event\n if ($date_pos > $date_max) break;\n /*\n * Update-create-delete recurring events\n */\n // get next ID (and remove from array)\n $next_id = array_shift($ids);\n if (!is_null($next_id)) {\n // get the next existing automatic recurring event\n // be careful with caching, for now we assume no reset \n // @see rec_event_load()\n $entity_new = rec_event_load($next_id);\n // if the entity is EXCEPTION\n if ($entity_new->recurrence_edit_status == 1) {\n $wrapper_new = entity_metadata_wrapper('rec_event', $entity_new);\n // if the date is the same with date_pos then skip all together!\n $new_date = $wrapper_new->event_date->value();\n $new_date = new DateObject($new_date['value']);\n if ($date_pos->format('Y/m/d') == $new_date->format('Y/m/d')) \n continue;\n // else get next id\n $next_id = array_shift($ids);\n }\n }\n /*\n * Update / Save new event\n * http://drupalcontrib.org/api/drupal/contributions%21commerce_coupon%21commerce_coupon.module/function/commerce_coupon_line_item_new/7\n * the following takes precedence over ::create()\n * http://www.php.net/manual/en/language.operators.array.php\n */\n if (!is_null($next_id)) $entity_new = rec_event_load($next_id);\n else $entity_new = rec_event_create(array('type' => $entity->type));\n RecEventController::copy($entity, $entity_new);\n $entity_new->recurrence_max_occ =\n ($entity->recurrence_max_occ > 0)?\n ($entity->recurrence_max_occ - $occ_pos + 1): 0;\n $entity_new->parent_event_id = $entity->event_id;\n // set new date field (Field API)\n // https://drupal.org/node/1388922\n $new_date = $parent_date;\n $new_date['value'] = $date_pos->format('Y-m-d H:i:s');\n $date_pos_end = clone $date_pos;\n $new_date['value2'] = \n $date_pos_end->add($duration)->format('Y-m-d H:i:s');\n $wrapper_new = entity_metadata_wrapper('rec_event', $entity_new);\n // Disabled field copy. Is it necessary?\n // If enabled it would copy event registration (user ref) field too\n //RecEventController::copyFields($wrapper, $wrapper_new);\n $wrapper_new->event_date->set($new_date);\n if (isset($wrapper_new->node_reference))\n $wrapper_new->node_reference->set($wrapper->node_reference->value());\n $wrapper_new->save();\n // loop on\n $dates .= ', ' . $date_pos->format('d/m/Y H:i');\n $occ_pos++;\n } // while LOOP-THROUGH\n /*\n * here set final values in parent event (if necessary) \n * and set $r=2 to save parent \n * (otherwise saving has already happened in ::save)\n */\n // clear remaining IDs\n register_shutdown_function('rec_event_delete_multiple', $ids);\n watchdog('rec_event',\n 'Built recurring event (%occ occurences, parent ID %id, dates %dates in %sec sec.', \n array(\n '%occ' => $occ_pos,\n '%id' => $entity->event_id,\n '%dates' => $dates,\n '%sec' => (round(microtime(true) * 1000) - $msec) / 1000, \n ));\n if ($r == 0) $r++;\n return $r;\n }",
"public function getRecurrenceInformation($request = false) {\n\t\t$recurringObject = $this->getRecurringObject();\n\n\t\tif ($request && !$request->get('id') && $request->get('repeat_frequency')) {\n\t\t\t$recurringObject = getrecurringObjValue();\n\t\t}\n\n\t\tif ($recurringObject) {\n\t\t\t$recurringData['recurringcheck'] = 'Yes';\n\t\t\t$recurringData['repeat_frequency'] = $recurringObject->getRecurringFrequency();\n\t\t\t$recurringData['eventrecurringtype'] = $recurringObject->getRecurringType();\n\t\t\t$recurringEndDate = $recurringObject->getRecurringEndDate(); \n\t\t\tif(!empty($recurringEndDate)){ \n\t\t\t\t$recurringData['recurringenddate'] = $recurringEndDate->get_formatted_date(); \n\t\t\t} \n\t\t\t$recurringInfo = $recurringObject->getUserRecurringInfo();\n\n\t\t\tif ($recurringObject->getRecurringType() == 'Weekly') {\n\t\t\t\t$noOfDays = count($recurringInfo['dayofweek_to_repeat']);\n\t\t\t\tfor ($i = 0; $i < $noOfDays; ++$i) {\n\t\t\t\t\t$recurringData['week'.$recurringInfo['dayofweek_to_repeat'][$i]] = 'checked';\n\t\t\t\t}\n\t\t\t} elseif ($recurringObject->getRecurringType() == 'Monthly') {\n\t\t\t\t$recurringData['repeatMonth'] = $recurringInfo['repeatmonth_type'];\n\t\t\t\tif ($recurringInfo['repeatmonth_type'] == 'date') {\n\t\t\t\t\t$recurringData['repeatMonth_date'] = $recurringInfo['repeatmonth_date'];\n\t\t\t\t} else {\n\t\t\t\t\t$recurringData['repeatMonth_daytype'] = $recurringInfo['repeatmonth_daytype'];\n\t\t\t\t\t$recurringData['repeatMonth_day'] = $recurringInfo['dayofweek_to_repeat'][0];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$recurringData['recurringcheck'] = 'No';\n\t\t}\n\t\treturn $recurringData;\n\t}",
"function rec_event_form_ajax_rec($form, $form_state) {\n return $form['recurrence'];\n}",
"public function getRecurrence() {\n\t\t$listEntries = Temboo_Results::getSubItemByKey($this->base, \"recurrence\");\n\t\t$resultArray = array();\n\t\tif(!is_null($listEntries)) {\n\t\t\tforeach ($listEntries as $entry) {\n\t\t \tarray_push($resultArray, $entry);\n\t\t\t}\n\t\t}\n\t\treturn $resultArray;\n\t}",
"public function addRecurringEvents() {\n\t\tif ($this->eventRecord['each_weeks']) {\n\t\t\t// add days for each week(s)\n\t\t\t$this->addRecurringWeeks();\n\t\t} else {\n\t\t\t// add days for xth recurring event\n\t\t\t$startDate = $this->getEventBegin();\n\t\t\t$startDate->modify('-1 month');\n\t\t\t\n\t\t\twhile ($startDate < $this->getMaxDateForGeneratedDays()) {\n\t\t\t\t$startDate->modify('+1 month'); // that's why we subtract 1 month above\n\t\t\t\t$this->addDaysForMonth($startDate->format('F'), $startDate->format('Y'));\n\t\t\t}\n\t\t}\n\t}",
"function mkRecurrent(&$events) {\r\n\t\t$week_days = Array(\"sunday\",\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\",\"sunday\");\r\n\t\t$newEvents = array();\r\n\t\tforeach ($events AS $event) {\r\n\t\t\tswitch ($event->recur_type) {\r\n\t\t\t\tcase \"day\":\r\n\t\t\t\t\tif(is_numeric($event->recur_count)) {\r\n\t\t\t\t\t\t//if date is excepted it will not be counted so we need to add this amount of repeating-times\r\n\t\t\t\t\t\t\t$count = intval($event->recur_count) + intval(count(eventCal_Recursion::getExceptDates($event))-1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$count = ceil(($event->end_date - $event->start_date)/86399);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$start_date = new mosEventCal_DateTimeObject( $event->start_date );\r\n\t\t\t\t\t$end_date = new mosEventCal_DateTimeObject( $event->end_date );\r\n\r\n\t\t\t\t\tfor ($i = 0;$i < $count;$i++) {\r\n\t\t\t\t\t\t$date = clone( $start_date );\r\n\t\t\t\t\t\t$date->clearTime();\r\n\t\t\t\t\t\t//if date is one of the exceptiondates do not continue\r\n\t\t\t\t\t\t\tif( !in_array($date->timestamp, eventCal_Recursion::getExceptDates( $event )) ) {\r\n\t\t\t\t\t\t\t\t//calculate end_date at the same day, just the given hours later\r\n\t\t\t\t\t\t\t\t\t$event->start_date = $start_date->timestamp;\r\n\t\t\t\t\t\t\t\t\t$event->end_date = mktime($end_date->date[\"hours\"],$end_date->date[\"minutes\"],0,$date->date[\"mon\"],$date->date[\"mday\"],$date->date[\"year\"]);\r\n\t\t\t\t\t\t\t\t$newEvents[] = clone( $event );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$start_date->offset( \"+ 1 day\" );\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"week\":\r\n\t\t\t\t\t//clear arrays from old values\r\n\t\t\t\t\t\t$starting_days\t= NULL;\r\n\t\t\t\t\t//every seven days from first correct weekday in time-range until date > end\r\n\t\t\t\t\t\t$start_date\t\t= new mosEventCal_DateTimeObject( $event->start_date );\r\n\t\t\t\t\t\t$end_date\t\t= new mosEventCal_DateTimeObject( $event->end_date );\r\n\r\n\t\t\t\t\t//do for every selected week-day\r\n\t\t\t\t\t\tfor ( $char=0; $char < strlen( $event->recur_week ); $char++ ) {\r\n\t\t\t\t\t\t\t$date = new mosEventCal_DateTimeObject( $start_date->timestamp );\r\n\r\n\t\t\t\t\t\t\t$date->clearDate();\r\n\t\t\t\t\t\t\t$time_offset = $date->timestamp;\r\n\t\t\t\t\t\t\t$date->update( $start_date->timestamp );\r\n\t\t\t\t\t\t\t//look for first correct week day in date range\r\n\t\t\t\t\t\t\t\t$week_day = $event->recur_week[$char];\r\n\t\t\t\t\t\t\t\tif (!($date->date[\"wday\"] == $week_day)) {\r\n\t\t\t\t\t\t\t\t\t$date->offset(\"this $week_days[$week_day]\" );\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$time_offset = 0;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t//calculate repetition from recur_count or set to false \r\n\t\t\t\t\t\t\t\tif (is_numeric($event->recur_count)) {\r\n\t\t\t\t\t\t\t\t\t$count = $event->recur_count;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t$count = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//create dates for following weeks in range \r\n\t\t\t\t\t\t\t\twhile ($date->timestamp <= $end_date->timestamp || $count > 0) {\r\n\t\t\t\t\t\t\t\t\t$thisday = clone( $date );\r\n\t\t\t\t\t\t\t\t\t$thisday->clearTime();\r\n\t\t\t\t\t\t\t\t\t//if $count <> 0 then repeat event just as often as given, otherwise its false repeat until the end of date-range\r\n\t\t\t\t\t\t\t\t\t\tif ($count > 0 || ($count === false)) {\r\n\t\t\t\t\t\t\t\t\t\t\t//check exception dates\r\n\t\t\t\t\t\t\t\t\t\t\t\tif( !in_array( $thisday->timestamp,eventCal_Recursion::getExceptDates($event) ) ) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$starting_days[] = $date;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$event->start_date = $date->timestamp + $time_offset;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$event->end_date = mktime($end_date->date[\"hours\"],$end_date->date[\"minutes\"],0,$date->date[\"mon\"],$date->date[\"mday\"],$date->date[\"year\"]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$newEvents[] = clone( $event );\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$count--; //may result in errors in later php versions when tried with $count = false\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse break;\r\n\t\t\t\t\t\t\t\t$date->offset( \"+ 1 week\" );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"month\":\r\n\t\t\t\t\t//every mday in between starting and ending time\r\n\t\t\t\t\t\t$start_date = new mosEventCal_DateTimeObject($event->start_date);\r\n\t\t\t\t\t\t$end_date = new mosEventCal_DateTimeObject($event->end_date);\r\n\r\n\t\t\t\t\t\tif(is_numeric($event->recur_count)) {\r\n\t\t\t\t\t\t\t//if date is excepted it will not be countet so we need to add this amount of repeating-times\r\n\t\t\t\t\t\t\t\t$count = intval($event->recur_count) + intval(count(eventCal_Recursion::getExceptDates($event))-1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$diff_timestamp = new mosEventCal_DateTimeobject($end_date->timestamp - $start_date->timestamp);\r\n\t\t\t\t\t\t\t$count = ($diff_timestamp->date[\"year\"] - 1970) * 12 + $diff_timestamp->date[\"month\"] + 1;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfor ($i = 0; $i < $count; $i++) {\r\n\r\n\t\t\t\t\t\t\t$date = clone( $start_date );\r\n\t\t\t\t\t\t\t$date->clearTime();\r\n\t\t\t\t\t\t\t//if date is one of the exceptiondates do not continue\r\n\t\t\t\t\t\t\t\tif( !in_array($date->timestamp,eventCal_Recursion::getExceptDates($event)) ) {\r\n\t\t\t\t\t\t\t\t\t$event->start_date = $start_date->timestamp;\r\n\t\t\t\t\t\t\t\t\t$event->end_date = mktime($end_date->date[\"hours\"],$end_date->date[\"minutes\"],0,$start_date->date[\"mon\"],$start_date->date[\"mday\"],$start_date->date[\"year\"]);\r\n\t\t\t\t\t\t\t\t\t$newEvents[] = clone( $event );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$start_date->offset( \"+ 1 month\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"year\":\r\n\t\t\t\t\t//every yday in between starting and ending time\r\n\t\t\t\t\t\t$start_date = new mosEventCal_DateTimeObject($event->start_date);\r\n\t\t\t\t\t\t$end_date = getdate($event->end_date);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(is_numeric($event->recur_count)) {\r\n\t\t\t\t\t//if date is excepted it will not be counted so we need to add this amount of repeating-times\r\n\t\t\t\t\t\t$count = intval($event->recur_count) + intval(count(eventCal_Recursion::getExceptDates($event))-1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$date = new mosEventCal_DateTimeObject($end_date[0] - $start_date->timestamp);\r\n\t\t\t\t\t\t$count = $date->date[\"year\"] - 1969;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor ($i = 0;$i < $count;$i++) {\r\n\t\t\t\t\t\t$date = clone( $start_date );\r\n\t\t\t\t\t\t$date->clearTime();\r\n\t\t\t\t\t\t//if date is one of the exceptiondates do not continue\r\n\t\t\t\t\t\t\tif( !is_numeric($event->recur_except) || !in_array($date->timestamp,eventCal_Recursion::getExceptDates($event)) ) {\r\n\t\t\t\t\t\t\t\t$event->start_date = $start_date->timestamp;\r\n\t\t\t\t\t\t\t\t$event->end_date = mktime($end_date[\"hours\"],$end_date[\"minutes\"],0,$start_date->date[\"mon\"],$start_date->date[\"mday\"],$start_date->date[\"year\"]);\r\n\t\t\t\t\t\t\t\t$newEvents[] = clone( $event );\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t$start_date->offset( \"+ 1 year\" );\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"none\": //do not do anything\r\n\t\t\t\tdefault: //none\r\n\t\t\t\t\t$newEvents[] = clone( $event );\r\n\t\t\t\tbreak; \r\n\t\t\t} //end of switch-block\r\n\t\t} \r\n\t\t$events = $newEvents;\r\n\t}",
"function getEventFromParams(&$params) {\n\n // timestamp of event's start\n $startTime = $params['start_time'];\n if (empty($startTime)) {\n $startTime = '00:00:00';\n }\n if (strlen($startTime) === 5) {\n $startTime .= ':00';\n }\n $startDateTime = $params['start_date'].' '.$startTime;\n $startStamp = checkit::convertISODateTimeToUnix($startDateTime);\n\n // timestamp of event's end\n $endTime = $params['end_time'];\n if (empty($endTime)) {\n $endTime = '23:59:59';\n }\n if (strlen($endTime) === 5) {\n $endTime .= ':00';\n }\n $endDateTime = $params['end_date'].' '.$endTime;\n $endStamp = checkit::convertISODateTimeToUnix($endDateTime);\n\n // timestamp of last occurrence\n $recurEndStamp = NULL;\n if (!empty($params['recur_end_date'])) {\n $recurEndDate = $params['recur_end_date'];\n $recurEndTime = '';\n if (!empty($params['recur_end_time'])) {\n $recurEndTime = $params['recur_end_time'];\n if (strlen($recurEndTime) == 5) {\n $recurEndTime .= ':00';\n }\n }\n $recurEndDateTime = $recurEndDate.' '.$recurEndTime;\n $recurEndStamp = checkit::convertISODateTimeToUnix($recurEndDateTime);\n }\n\n $event = array(\n 'title' => $params['title'],\n 'location' => $params['location'],\n 'description' => $params['description'],\n\n 'start_stamp' => $startStamp,\n 'end_stamp' => $endStamp,\n 'end_year' => (int)date('Y', $endStamp),\n 'end_month' => (int)date('n', $endStamp),\n\n 'recurrence' => $params['recurrence'],\n 'recur_yearly_interval' => $params['recur_yearly_interval'],\n 'recur_yearly_months' => isset($params['recur_yearly_months'])\n ? $params['recur_yearly_months'] : array(),\n 'recur_monthly_interval' => $params['recur_monthly_interval'],\n 'recur_monthly_count' => $params['recur_monthly_count'],\n 'recur_monthly_byweekday' => $params['recur_monthly_byweekday'],\n 'recur_weekly_interval' => $params['recur_weekly_interval'],\n 'recur_weekly_weekdays' => isset($params['recur_weekly_weekdays'])\n ? $params['recur_weekly_weekdays'] : array(),\n 'recur_daily_interval' => $params['recur_daily_interval'],\n );\n\n if (isset($params['event_id'])) {\n $event['event_id'] = $params['event_id'];\n }\n\n if (isset($recurEndStamp)) {\n $event['recur_end'] = $recurEndStamp;\n }\n\n return $event;\n }",
"protected function loadRecEvents() {\n $dayOfWeek = date('w');\n if ($dayOfWeek == 0) {\n $sunday = strtotime(\"today\");\n $saturday = strtotime(\"next Saturday\");\n } else if ($dayOfWeek == 6){ \n $sunday = strtotime(\"last sunday\");\n $saturday = strtotime(\"today\");\n } else {\n $sunday = strtotime(\"last sunday\");\n $saturday = strtotime(\"next saturday\");\n }\n $recEvents = Event::find()\n ->orderBy(['start_dt' => SORT_ASC])\n ->where(['group' => 'rec'])\n ->andWhere(['>=', 'end_dt', strftime('%Y-%m-%d', $saturday)])\n ->andWhere(['<=','start_dt', strftime('%Y-%m-%d', $sunday)])\n //->andWhere(['>=', 'start_dt', strftime('%Y-%m-%d', $sunday)])\n //->andWhere(['<=','start_dt', strftime('%Y-%m-%d', $saturday)])\n ->asArray()->all();\n //return $recEvents;\n $enhancedEvents = $this->injectRepeatingEvents($recEvents,1);\n return $enhancedEvents;\n }",
"public function prepareRecurring()\n { \n \n if (empty($_REQUEST['edit_all_recurrences'])) { \n $repeatFields = array('type', 'interval', 'count', 'until', 'dow', 'parent_id');\n foreach ($repeatFields as $param) {\n unset($_POST['repeat_' . $param]);\n } \n } else if (!empty($_REQUEST['repeat_type']) && !empty($_REQUEST['date_start'])) { \n $params = array(\n 'type' => $_REQUEST['repeat_type'],\n 'interval' => $_REQUEST['repeat_interval'],\n 'count' => $_REQUEST['repeat_count'], \n 'until' => $_REQUEST['repeat_until'], \n 'dow' => $_REQUEST['repeat_dow'], \n ); \n $this->repeatDataArray = CalendarUtils::buildRecurringSequence($_REQUEST['date_start'], $params);\n return true;\n }\n return false;\n }",
"public function getGoogleRecurrence();",
"function update_recurrence_master_record() {\n\n //echo_f('',$_POST);\n\n global $wpdb;\n$wpdb->show_errors();\n $recurrence_weekday = serialize( $_POST['recurrence_weekday'] );\n $recurrence_manual_dates = $_POST['recurrence_type'] == 'm' ? serialize( $_POST['recurrence_manual_dates']) . serialize($_POST['recurrence_manual_end_dates'] ) : NULL;\n\n return $wpdb->update( EVENT_ESPRESSO_RECURRENCE_TABLE,\n array(\n 'recurrence_start_date' => $_POST['recurrence_start_date'],\n 'recurrence_event_end_date' => $_POST['recurrence_event_end_date'],\n 'recurrence_end_date' => $_POST['recurrence_end_date'],\n 'recurrence_frequency' => $_POST['recurrence_frequency'],\n 'recurrence_type' => $_POST['recurrence_type'],\n 'recurrence_interval' => $_POST['recurrence_interval'],\n 'recurrence_weekday' => $recurrence_weekday,\n 'recurrence_repeat_by' => $_POST['recurrence_repeat_by'],\n 'recurrence_regis_date_increment' => $_POST['recurrence_regis_date_increment'],\n 'recurrence_manual_dates' => $recurrence_manual_dates,\n 'recurrence_regis_start_date' => $_POST['recurrence_regis_start_date'],\n 'recurrence_regis_end_date' => $_POST['recurrence_regis_end_date']\n ), array( 'recurrence_id' => $_POST['recurrence_id'] ), array( '%s','%s','%s','%s','%s','%d','%s','%s','%s','%s','%s','%s' ), array( '%d' ) );\n\n //echo $wpdb->last_query;\n\n}",
"private function get_recurrence() {\n\t\t$recurrence = json_decode($this->model->get_recurrence());\n\t\tif(!$recurrence) {\n\t\t\tthrow new NoRecurrenceException('RecurringSchedule.schedule must have a recurrence');\n\t\t}\n\n\t\treturn $recurrence;\n\t}",
"public function getRecurringLog()\n\t{\n\t\t$result = array();\n\n\t\t$query = $this->db->query('SELECT *, ort.`date_added` as `transaction_date` FROM `' . DB_PREFIX . $this->module_name . '_cronlog` '\n\t\t\t. 'JOIN `' . DB_PREFIX . $this->module_name . '_cronlog_transactions` USING(`log_entry_id`) '\n\t\t\t. 'JOIN `' . DB_PREFIX . 'order_recurring_transaction` as ort USING(`order_recurring_transaction_id`) '\n\t\t\t. 'JOIN `' . DB_PREFIX . 'order` USING(`order_id`) '\n\t\t\t. 'ORDER BY `log_entry_id` DESC,`order_recurring_transaction_id` DESC ');\n\n\t\tif ($query->num_rows) {\n\t\t\t$log_entry_line = null;\n\t\t\t$report_line = 0;\n\t\t\t$tmp = array();\n\t\t\tforeach ($query->rows as $row) {\n\t\t\t\tif (!empty($row['order_recurring_id'])) {\n\t\t\t\t\tif (is_null($log_entry_line) || ($row['log_entry_id'] !== $tmp[$log_entry_line]['log_entry_id'])) {\n\t\t\t\t\t\t$log_entry_line = $report_line++;\n\n\t\t\t\t\t\t$tmp[$log_entry_line] = array (\n\t\t\t\t\t\t\t'log_entry_id' => $row['log_entry_id'],\n\t\t\t\t\t\t\t'ref_log_entry_id' => '',\n\t\t\t\t\t\t\t'order_id' => $row['order_id'],\n\t\t\t\t\t\t\t'date' => $row['start_time'],\n\t\t\t\t\t\t\t'amount' => 0,\n\t\t\t\t\t\t\t'currency_code' => $row['currency_code'],\n\t\t\t\t\t\t\t'order_recurring_id' => 0,\n\t\t\t\t\t\t\t'status' => $this->getLogEntryStatus($row['run_time'], $row['pid']),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$tmp[$report_line++] = array (\n\t\t\t\t\t\t'log_entry_id' => $row['reference'],\n\t\t\t\t\t\t'ref_log_entry_id' => $row['log_entry_id'],\n\t\t\t\t\t\t'order_id' => $row['order_id'],\n\t\t\t\t\t\t'date' => $row['transaction_date'],\n\t\t\t\t\t\t'amount' => $row['amount'],\n\t\t\t\t\t\t'currency_code' => $row['currency_code'],\n\t\t\t\t\t\t'order_recurring_id' => $row['order_recurring_id'],\n\t\t\t\t\t\t'status' => $this->getRecurringTransactionType((int)$row['type']),\n\t\t\t\t\t);\n\n\t\t\t\t\t$tmp[$log_entry_line]['amount'] += $row['amount'];\n\t\t\t\t\t$tmp[$log_entry_line]['order_recurring_id']++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($tmp as $row) {\n\t\t\t\t$log_entry = array (\n\t\t\t\t\t'log_entry_id' => $row['log_entry_id'],\n\t\t\t\t\t'ref_log_entry_id' => $row['ref_log_entry_id'],\n\t\t\t\t\t'order_id' => '',\n\t\t\t\t\t'order_link' => '',\n\t\t\t\t\t'order_link_title' => '',\n\t\t\t\t\t'date' => $row['date'],\n\t\t\t\t\t'amount' => $this->currency->format($row['amount'], $row['currency_code']),\n\t\t\t\t\t'order_recurring_id' => '',\n\t\t\t\t\t'order_recurring_btn_link' => '',\n\t\t\t\t\t'order_recurring_btn_title' => '',\n\t\t\t\t\t'status' => $row['status']\n\t\t\t\t);\n\n\t\t\t\tif (empty($row['ref_log_entry_id'])){// Log entry summary\n\t\t\t\t\t$log_entry['order_recurring_id'] = sprintf(\n\t\t\t\t\t\t$this->language->get('order_recurring_total'),\n\t\t\t\t\t\t$row['order_recurring_id']\n\t\t\t\t\t);\n\t\t\t\t} else {// Transaction entry\n\t\t\t\t\t$log_entry['order_id'] = $row['order_id'];\n\t\t\t\t\t$log_entry['order_link'] = $this->url->link(\n\t\t\t\t\t\t'sale/order/info',\n\t\t\t\t\t\t$this->getTokenParam() . '=' . $this->getToken() . '&order_id=' . $row['order_id'],\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\t$log_entry['order_link_title'] = sprintf(\n\t\t\t\t\t\t$this->language->get('order_link_title'),\n\t\t\t\t\t\t$row['order_id']\n\t\t\t\t\t);\n\n\t\t\t\t\t$log_entry['order_recurring_btn_link'] = $this->url->link(\n\t\t\t\t\t\t'sale/recurring/info',\n\t\t\t\t\t\t$this->getTokenParam() . '=' . $this->getToken() . '&order_recurring_id=' . $row['order_recurring_id'],\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\t$log_entry['order_recurring_btn_title'] = sprintf(\n\t\t\t\t\t\t$this->language->get('order_recurring_btn_title'),\n\t\t\t\t\t\t$row['order_recurring_id']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t$result[] = $log_entry;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}",
"function save_events() {\r\n\t\tif( $this->is_recurring() ){\r\n\t\t\tglobal $wpdb;\r\n\t\t\t$event_saves = array();\r\n\t\t\t$matching_days = $this->get_recurrence_days(); //Get days where events recur\r\n\t\t\t$this->delete_events(); //Delete old events beforehand\r\n\t\t\t//Make template event (and we just change dates)\r\n\t\t\t$event = $this->to_array();\r\n\t\t\tunset($event['event_id']); //remove id and we have a event template to feed to wpdb insert\r\n\t\t\t$event['event_attributes'] = serialize($event['event_attributes']);\r\n\t\t\tforeach($event as $key => $value ){ //remove recurrence information\r\n\t\t\t\tif( substr($key, 0, 10) == 'recurrence' ){\r\n\t\t\t\t\tunset($event[$key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$event['recurrence_id'] = $this->id;\r\n\t\t\t//Save event template with different dates\r\n\t\t\tforeach( $matching_days as $day ) {\r\n\t\t\t\t$event['event_start_date'] = date(\"Y-m-d\", $day);\r\n\t\t\t\t$event['event_end_date'] = $event['event_start_date'];\t\t\t\t\r\n\t\t\t\t$event_saves[] = $wpdb->insert($wpdb->prefix.EM_EVENTS_TABLE, $event, $this->get_types($event));\r\n\t\t\t\t//TODO should be EM_DEBUG, and do we really need it?\r\n\t\t\t\tif( DEBUG ){ echo \"Entering recurrence \" . date(\"D d M Y\", $day).\"<br/>\"; }\r\n\t\t \t}\r\n\t\t \treturn !in_array(false, $event_saves);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"private function to_rrule($recurrence)\n {\n if (is_string($recurrence))\n return $recurrence;\n\n $rrule = '';\n foreach ((array)$recurrence as $k => $val) {\n $k = strtoupper($k);\n switch ($k) {\n case 'UNTIL':\n $val = $val->format('Ymd\\THis');\n break;\n case 'EXDATE':\n foreach ((array)$val as $i => $ex)\n $val[$i] = $ex->format('Ymd\\THis');\n $val = join(',', (array)$val);\n break;\n }\n $rrule .= $k . '=' . $val . ';';\n }\n\n return $rrule;\n }",
"public static function importRecurrence($recur, $eventStartTime) {\n\t\t$rrule = '';\n\t\t$freq = \"\";\n\t\tswitch ($recur->type) {\n\t\t\tcase 0:\n\t\t\t\t$freq = \"DAILY\";\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$freq = \"WEEKLY\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$freq = \"MONTHLY\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$freq = \"MONTHLY\";\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\tcase 6:\n\t\t\t\t$freq = \"YEARLY\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ($freq) {\n\n\t\t\t$rrule = new \\GO\\Base\\Util\\Icalendar\\Rrule();\n\t\t\t$rrule->eventStartTime = $eventStartTime;\n\t\t\t$rrule->freq = $freq;\n\t\t\t$rrule->interval = $recur->interval;\n\t\t\tif (!empty($recur->until))\n\t\t\t\t$rrule->until = $recur->until;\n\n\t\t\t$rrule->byday = self::aSync2weekday($recur->dayofweek);\n\t\t\tif (!empty($recur->weekofmonth))\n\t\t\t\t$rrule->bysetpos = $recur->weekofmonth;\n\n//\t\t\t$rrule->shiftDays(true);\n\n\t\t\treturn $rrule->createRrule();\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getRecurrence()\n {\n if (array_key_exists(\"recurrence\", $this->_propDict)) {\n if (is_a($this->_propDict[\"recurrence\"], \"\\Beta\\Microsoft\\Graph\\Model\\Windows10AppsUpdateRecurrence\") || is_null($this->_propDict[\"recurrence\"])) {\n return $this->_propDict[\"recurrence\"];\n } else {\n $this->_propDict[\"recurrence\"] = new Windows10AppsUpdateRecurrence($this->_propDict[\"recurrence\"]);\n return $this->_propDict[\"recurrence\"];\n }\n }\n return null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sets the prpc used in this class | public function setPrpc($prpc)
{
$this->prpc = $prpc;
} | [
"function setC_p($sc_p = '')\n {\n $this->sc_p = $sc_p;\n }",
"function set_pantone_pc($pantone_name)\n {\n $this->pantone_pc = $pantone_name;\n $this->cmyk['c'] = $this->pantone_pallete_pc[$pantone_name]['c'];\n $this->cmyk['m'] = $this->pantone_pallete_pc[$pantone_name]['m'];\n $this->cmyk['y'] = $this->pantone_pallete_pc[$pantone_name]['y'];\n $this->cmyk['b'] = $this->pantone_pallete_pc[$pantone_name]['b'];\n\n $this->convert_cmyk_to_rgb();\n $this->convert_rgb_to_hex();\n }",
"public function setPr($value)\n {\n return $this->set(self::PR, $value);\n }",
"public function pr($value)\n {\n $this->pr = $value;\n return $this;\n }",
"public function getPp()\n {\n return $this->pp;\n }",
"public function _setPrecio($Precio)\n\t {\n\t $this->Precio = $Precio;\n\t }",
"public function setCirculante_P(){\n\t\t$this->Circulante_P = $this->getFornecedores() \n\t\t+ $this->getEmprestimos_Bancarios() \n\t\t+ $this->getObrigacoes_Sociais_e_Impostos_a_Recolher() \n\t\t+ $this->getContas_a_Pagar_C() \n\t\t+ $this->getLucros_a_Distribuir() \n\t\t+ $this->getProvisoes();\n\t}",
"protected abstract function setSPs();",
"public function setRPP($rpp)\n {\n $this->_variables['rpp'] = (int)$rpp;\n }",
"function _ppo ($pParams = array ()){\n\treturn new CopixPPO ($pParams);\n}",
"function set_pr_num( ) {\n global $argv;\n // expected usage : \"script.php 1337\" or \"php script.php 1337\"\n // First element of $argv will be the script file itself, second will be the PR number\n\n if( count( $argv ) != 2 or !ctype_digit( $argv[1] )) {\n $this->error_and_die( \"Usage :\\ngit pr [PR number]\\nSee README\" );\n die();\n }\n \n $this->pr = $argv[1];\n \n }",
"public function initPioche(){\n $this->pioche = $this->getDeck()->getCartes();\n }",
"public function setMpPerc($value)\n {\n return $this->set(self::_MP_PERC, $value);\n }",
"function setProcessId($pid) {\n $this->p_id=$pid;\n }",
"function setPID($pid=\"\"){\n\t\t\t$this->obj->PID = $pid;\t\n\t\t}",
"public function set_caps(){\n\t\t\t\n\t\t\t$caps = new CPT();\n\t\t\t$caps->set_caps();\n\t\t\t\n\t\t}",
"public function setPvp($pvp)\n {\n $this->pvp = $pvp;\n\n return $this;\n }",
"function setPidlist($pid_list)\t{\r\n\t\t$this->pid_list = $pid_list;\r\n\t}",
"private function setPiVars() {\n\t\t// Conference name\n\t\t$this->markerArray['###SPN_CONF_NAME###'] = htmlspecialchars($this->piVars['name']);\n\t\t$this->markerArray['###VAL_CONF_NAME###'] = htmlspecialchars($this->piVars['name']);\n\t\t\n\t\t// Conference description\n\t\t$this->markerArray['###SPN_CONF_DESCRIPTION###'] = htmlspecialchars($this->piVars['description']);\n\t\t$this->markerArray['###VAL_CONF_DESCRIPTION###'] = htmlspecialchars($this->piVars['description']);\n\t\t\n\t\t// Conference duration\n\t\t$this->markerArray['###SPN_CONF_DURATION###'] = htmlspecialchars($this->piVars['duration']);\n\t\t$this->markerArray['###VAL_CONF_DURATION###'] = htmlspecialchars($this->piVars['duration']);\n\t\t\n\t\t// Join confirmation checkbox\n\t\tif ($this->piVars['joinconfirm'] == 'on') {\n\t\t\t$this->markerArray['###CHECKED_JOIN_CONFIRM###'] = ' checked=\"checked\" ';\n\t\t} else {\n\t\t\t$this->markerArray['###CHECKED_JOIN_CONFIRM###'] = '';\n\t\t}\n\t\t\n\t\t// Planned conferece ceckbox\n\t\tif ($this->piVars['schedule'] == 'on') {\n\t\t\t$this->markerArray['###CHECKED_PLANNED###'] = ' checked=\"checked\" ';\n\t\t\t$this->markerArray['###DISPLAY_NONE_CONF_DATE_TIME###'] = '';\n\t\t} else {\n\t\t\t$this->markerArray['###CHECKED_PLANNED###'] = '';\n\t\t\t$this->markerArray['###DISPLAY_NONE_CONF_DATE_TIME###'] = 'display:none;';\n\t\t}\n\t\t\n\t\t// Planned date\n\t\tif ($this->piVars['day']) {\n\t\t\t$this->markerArray['###VAL_CONF_DAY###'] = htmlspecialchars($this->piVars['day']);\n\t\t}\n\t\tif ($this->piVars['month']) {\n\t\t\t$this->markerArray['###VAL_CONF_MONTH###'] = htmlspecialchars($this->piVars['month']);\n\t\t}\n\t\tif ($this->piVars['year']) {\n\t\t\t$this->markerArray['###VAL_CONF_YEAR###'] = htmlspecialchars($this->piVars['year']);\n\t\t}\n\t\t\n\t\t// Planned time\n\t\tif ($this->piVars['hour']) {\n\t\t\t$this->markerArray['###VAL_CONF_HOUR###'] = htmlspecialchars($this->piVars['hour']);\n\t\t}\n\t\tif ($this->piVars['minutes']) {\n\t\t\t$this->markerArray['###VAL_CONF_MINUTE###'] = htmlspecialchars($this->piVars['minutes']);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OneToOne (inverse side) Get fkTcemgTetoRemuneratorioControle | public function getFkTcemgTetoRemuneratorioControle()
{
return $this->fkTcemgTetoRemuneratorioControle;
} | [
"public function getFkTcemgTetoRemuneratorio()\n {\n return $this->fkTcemgTetoRemuneratorio;\n }",
"public function getFkPessoalContrato()\n {\n return $this->fkPessoalContrato;\n }",
"public function getFkTcemgContratoEmpenho()\n {\n return $this->fkTcemgContratoEmpenho;\n }",
"public function getFkTcemgContratoRescisao()\n {\n return $this->fkTcemgContratoRescisao;\n }",
"public function getFkConcursoCandidato()\n {\n return $this->fkConcursoCandidato;\n }",
"public function getFkTcernObraContratos1()\n {\n return $this->fkTcernObraContratos1;\n }",
"public function getFkOrcamentoReceita()\n {\n return $this->fkOrcamentoReceita;\n }",
"public function getComFkusuario()\n {\n return $this->hasOne(Usuario::className(), ['usu_id' => 'com_fkusuario']);\n }",
"public function getIdContrato()\n {\n return $this->id_contrato;\n }",
"public function getFkImobiliarioTrecho()\n {\n return $this->fkImobiliarioTrecho;\n }",
"public function getFkIdResponsavel()\n {\n return $this->hasOne(Pessoa::className(), ['idPessoa' => 'fk_idResponsavel']);\n }",
"public function getFkDividaDividaRemissao()\n {\n return $this->fkDividaDividaRemissao;\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function getContratoId()\n\t{\n\t\treturn $this->contrato_id;\n\t}",
"public function getFkTcemgContratoAditivo()\n {\n return $this->fkTcemgContratoAditivo;\n }",
"public function get_id_contratante()\n {\n return (isset($this->_id_contratante)) ? $this->_id_contratante : null;\n }",
"public function getFkMonetarioContaCorrente()\n {\n return $this->fkMonetarioContaCorrente;\n }",
"public function getFkImobiliarioConfrontacaoTrecho()\n {\n return $this->fkImobiliarioConfrontacaoTrecho;\n }",
"public function getFkMonetarioAcrescimo()\n {\n return $this->fkMonetarioAcrescimo;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endColli() end processing a coli, do everything is needed to conclude the scheduling here we can depending on the configuration parameter remove the pdflabel(s) from the label directory | function endColli() {
error_log( "Carr_DHL_Simple.php::Carr_DHL_Simple::endColli(): begin") ;
if ( self::$carrConfig->DHL_Simple->removeLbl) {
$sysCmd = "rm " . $this->path->Archive . "VeColi/" . $this->veColiNr . "*.pdf" ;
error_log( "Carr_DHL_Simple.php::Carr_DHL_Simple::scheduleColli(): sysCmd = '$sysCmd'") ;
system( $sysCmd) ;
}
error_log( "Carr_DHL_Simple.php::Carr_DHL_Simple::endColli(): end") ;
return true ;
} | [
"public function endCurrentBatch() :void;",
"public function endBatch() {\n\t}",
"public function endBatch() : void\n {\n // IF batch has started we can end it.\n if ($this->batchStarted) {\n\n // Iterate through the couriers\n foreach ($this->couriers as $courierRef => $courier) {\n\n // If there are any consigments on the stack for this courier\n if (array_key_exists($courierRef, $this->consignmentStack)) {\n $dbTransport = new DispatchBatchTransport(\n $this->batchDate,\n $courier, \n $this->consignmentStack[$courierRef]\n );\n $dbTransport->send();\n }\n }\n\n // Mark batch as started as false\n $this->batchStarted = FALSE;\n }\n }",
"public function finalize() {\n $this->log('== Finalizing the exporter job ==');\n $this->set_timestamp_last();\n $this->job_success('Done!');\n }",
"public function dispatchLoopShutdown()\n {\n if ($this->_dynamicHeader->isLearning()) {\n \n $allHeaders = array();\n foreach (new DirectoryIterator($this->_dynamicHeader->getDirectory()) as $file) {\n if (!$file->isDot()) {\n $allHeaders[] = $file->getFilename(); \n }\n }\n\n foreach ($this->_dynamicHeader->getCurrentDynamicHeaders() as $currentHeaderName => $currentHeaderData) {\n if (!in_array($currentHeaderName . '.png', $allHeaders)) {\n $this->_dynamicHeader->generateImage($currentHeaderName);\n $this->_dynamicHeader->generateStylesheet();\n }\n }\n\n }\n \n }",
"function pdf_end_layer(& $pdf)\n\t{\n\t}",
"function pdf_end_template($pdf) {}",
"function PDF_end_glyph($pdfdoc){}",
"public function endOutput();",
"public function finishProcessingPrint()\r\n\t{\r\n \t$this->jsLbl->Text = \"<script type=\\\"text/javascript\\\">finishProcessingPrint();</script>\";\r\n }",
"public function OnEndForking();",
"function EndDoc(){}",
"public function terminate() {\n\t\tforeach($this->getWorkLines()->each() as $wl) {\n\t\t\t$wl->status = Work::STATUS_DONE;\n\t\t\t$wl->save();\n\t\t}\n\t\t$this->status = Work::STATUS_DONE;\n\t\t$this->save();\n\t\t$this->document->setStatus(Order::STATUS_DONE);\n\t}",
"public function endCaption($result)\n {\n $this->captionResult = $result;\n $elapsed = $this->timer->elapsedAsSubripTime();\n $text = $this->captionCount . \"\\n\";\n $text .= $this->captionStarted . ' --> ' . $elapsed . \"\\n\";\n $text .= $this->captionText . \"\\n\\n\";\n file_put_contents($this->fileDir . $this->subtitleFile, $text, FILE_APPEND);\n\n $vStep = new ZoetropeVideoModelStep();\n $vStep->definition = $this->captionText;\n $vStep->result = $this->captionResult;\n $vStep->from = $this->captionStarted;\n $vStep->to = $elapsed;\n $this->zModel->steps[] = $vStep;\n }",
"public function flowEnd();",
"public function postRun(): void {\n if ($this->progress) {\n $this->progress->finish();\n // Progress bar does not print a new-line at the end.\n $this->getOutput()->writeln('');\n }\n }",
"function bcg_loop_end(){\n global $bp;\n \n $bp->bcg->in_the_loop=false;\n}",
"protected function endCollect()\n {\n $this->endComments = $this->accumulated;\n $this->accumulated = [];\n }",
"private static function EndRun()\n\t{\n\t\tself::SaveMessages();\n\t\tif(!self::$_MIMESET)\n\t\t{\n\t\t self::SetMime(\"text/html\");\n\t\t}\n\n\t\tif(self::$_LOGGING)\n\t\t{\n\t\t Krai_Log::Close();\n\t\t}\n\n\t\tsession_commit();\n\t\tob_end_flush();\n\t\texit(0);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new Quest model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate() {
$model = new Quest();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
} | [
"public function actionCreate()\n {\n $model = new Question();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->fr_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Question();\n\n if ($model->load(Yii::$app->request->post()) ) {\n $model->created_at=time();\n if($model->save())\n return $this->redirect(['view', 'id' => $model->qid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Question();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Questions();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\r\n {\r\n $model = new QuestionSave();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new QuestionarioAluno();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->questaluno_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new SurveyKepuasan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'fakultas' => $model->fakultas, 'jurusan' => $model->jurusan]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Survey();\n\n Yii::$app->gon->send('saveSurveyUrl', '/survey/save-new');\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new TrFaq();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Huxuan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Typzamku();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t\t\treturn $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Konsultasi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createQuestAction()\n {\n $quest = new Quest();\n $user = $this->getUser();\n\n\n\n $quest->setTitle(\"Untitled\");\n $quest->setZoomLevelStaticMap(\"5\");\n $quest->setPublished(false);\n $quest->setUser($user);\n\n // todo: change to make key public ....\n $quest->setPublishKey($this->createRandomReadableString(10));\n\n $em = $this->getDoctrine()->getManager();\n $em->persist($quest);\n $em->flush();\n\n return new Response($this->listAction());\n }",
"public function actionCreate()\n {\n $model = new Pengguna();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new QuestionReported();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Track;\n $model->loadDefaultValues();\n\n if ($model->load(request()->post()) && $model->setContents()->save()) {\n session()->setFlash('success', 'New track has been added.');\n return $this->redirect(['admin']);\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n $model = new Answer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new PersetujuanTindak();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->tpt_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Tutor();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->tutorid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Contact Info Uses HTML Microformats: | function contact_info_formatted($html=null,$includeSocial=true){
$org_name=get_theme_option('org_name');
$street_address_1=get_theme_option('street_address_1');
$street_address_2=get_theme_option('street_address_2');
$city=get_theme_option('city');
$state=get_theme_option('state');
$zip=get_theme_option('zip');
$country=get_theme_option('country');
$phone=get_theme_option('phone');
$html.= $org_name ? '<strong><span class="p-name">'.strip_tags($org_name).'</span></strong><br>' : null;
$html.= $street_address_1 ? '<span class="p-street-address">'.strip_tags($street_address_1).'</span><br>' : null;
$html.= $street_address_2 ? '<span class="p-extended-address">'.strip_tags($street_address_2).'</span><br>' : null;
$html.= $city ? '<span class="p-locality">'.trim(strip_tags($city)).'</span>' : null;
$html.= $state ? ', <span class="p-region">'.trim(strip_tags($state)).'</span>' : null;
$html.= $zip ? ' <span class="p-postal-code">'.trim(strip_tags($zip)).'</span>' : null;
$html.= $country ? ' <span class="p-country-name">'.trim(strip_tags($country)).'</span>' : null;
$html.= $phone ? '<br><span class="p-tel">'.trim(strip_tags($phone)).'</span>' : null;
$html.= $includeSocial ? '<br>'.social_links_formatted() : null;
return $html ? '<div class="h-card">'.$html.'</div>' : 'Please enter your contact information in theme settings.';
} | [
"function parse_contact_content($content) {\r\n $content = str_replace('Email:', '<span class=\"email\">Email:</span>', $content);\r\n return $content;\r\n}",
"public function formatContactInfo() {\n $allContactObjectsInfo = $this -> getAllContactEntries();\n $formattedContactInfo = \"\";\n\n foreach ($allContactObjectsInfo as $contactObjectInfo) {\n $formattedContactInfo .= '<div class=\"col-xs-12 col-sm-6 col-md-6 col-lg-6\"><div class=\"contactCardOutter\"><div class=\"contactCard\"><p class=\"name\">'\n . $contactObjectInfo -> getName() . '</p><p class=\"title\">'\n . $contactObjectInfo -> getTitle() . '</p><p class=\"description\">'\n . $contactObjectInfo -> getDescription() . '</p><p class=\"email\">'\n . $contactObjectInfo -> getEmail() . '</p><p class=\"phone\">'\n . $contactObjectInfo -> getPhone() . '</p><hr class=\"style17\"></div></div></div>';\n };\n\n\n return $formattedContactInfo;\n }",
"public function contact_info( $args ) {\n\t\t$args = shortcode_atts(\n\t\t\t[\n\t\t\t\t'show' => 'all',\n\t\t\t\t'class' => '',\n\t\t\t],\n\t\t\t$args,\n\t\t\t'contact-info'\n\t\t);\n\n\t\t$allowed = $this->get_allowed_info( $args );\n\n\t\twp_enqueue_style( 'rank-math-contact-info', rank_math()->assets() . 'css/rank-math-contact-info.css', null, rank_math()->version );\n\n\t\tob_start();\n\t\techo '<div class=\"' . $this->get_contact_classes( $allowed, $args['class'] ) . '\">';\n\n\t\tforeach ( $allowed as $element ) {\n\t\t\t$method = 'display_' . $element;\n\t\t\tif ( method_exists( $this, $method ) ) {\n\t\t\t\techo '<div class=\"rank-math-contact-section rank-math-contact-' . esc_attr( $element ) . '\">';\n\t\t\t\t$this->$method();\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t}\n\n\t\techo '</div>';\n\t\techo '<div class=\"clear\"></div>';\n\n\t\treturn ob_get_clean();\n\t}",
"function exodus_telephone_format_detection() {\n\n?>\n<meta name=\"format-detection\" content=\"telephone=no\">\n<?php\n\n}",
"function theme_acquia_topbar_contact_info($vars) {\n $out = '';\n if (isset($vars['info']) && !empty($vars['info'])) {\n\tacquia_include('options');\n\t$info = $vars['info'];\n\tif (isset($info['skype']) && !empty($info['skype'])) {\n\t $info['skype'] = '<a href=\"skype:'.$info['skype'].'?call\">' .$info['skype'] .'</a>';\n\t}\n\t$items = array();\n\tforeach($info as $key => $title) {\n\t $item = '<li class=\"ac-'.$key.'-detail detail\">';\n\t $item .= '\t<span class=\"font-icon icon-'.$key.'\"></span>';\n\t $item .= '\t'.$title;\n\t $item .= '</li>';\n\t $items[] = $item;\n\t}\n\n\t$out .= '<section class=\"block ac-topbar-contact-info\">';\n\t$out .= '<ul class=\"ac-s-li\">';\n\t$out .= implode('', $items);\n\t$out .= '</ul>';\n\t$out .= '</section>';\n }\n return $out;\n}",
"public function get_contact_section_description() {\n printf( esc_html__( 'Have questions or feature requests? %1$sClick here to contact Laterpay support%2$s', 'laterpay' ), '<a href=\"https://www.laterpay.net/contact-support\">', '</a>' );\n }",
"function maranatha_telephone_format_detection() {\n\n?>\n<meta name=\"format-detection\" content=\"telephone=no\">\n<?php\n\n}",
"function get_person_email_markup( $post ) {\n\tif ( $post->post_type !== 'person' ) { return; }\n\n\tob_start();\n\tif ( $email = get_field( 'person_email', $post->ID ) ):\n?>\n\t<div class=\"row\">\n\t\t<div class=\"col-xl-4 col-md-12 col-sm-4 person-label\">\n\t\t\tE-mail\n\t\t</div>\n\t\t<div class=\"col-xl-8 col-md-12 col-sm-8 person-attr\">\n\t\t\t<a href=\"mailto:<?php echo $email; ?>\" class=\"person-email\">\n\t\t\t\t<?php echo $email; ?>\n\t\t\t</a>\n\t\t</div>\n\t</div>\n\t<hr class=\"my-2\">\n<?php\n\tendif;\n\treturn ob_get_clean();\n}",
"public function getContactInfo();",
"function get_company_info() {\n return '\n <div class=\"company_info\" itemscope itemtype=\"http://schema.org/LocalBusiness\">\n <span style=\"display: none;\" itemprop=\"name\">' .\n get_bloginfo('name') .\n '</span> ' .\n '<span style=\"display: none;\" itemprop=\"description\">' .\n get_bloginfo('description') .\n '</span> ' .\n get_address() .\n get_phone_number(true) .\n get_fax_number(true) .\n '\n </div>';\n}",
"public function getContactInformation();",
"function info_tag($atts, $content = null) {\n\treturn '<span class=\"message info\">'.$content.'</span>'; \n}",
"function contacts_boite_infos($flux){\n\tif ($flux['args']['type']=='auteur'\n\t and $id_auteur = intval($flux['args']['id'])){\n\t\t$html = recuperer_fond('prive/objets/infos/auteur-contact-organisation', array(\n\t\t\t\t\t\t'id_auteur' => $id_auteur\n\t\t\t\t\t));\n\n\t\tif ($p = strpos($flux['data'], '</p>')\n\t\t and $p = strpos($flux['data'], '<p>', $p)){\n\t\t\t$flux['data'] = substr_replace($flux['data'], $html , $p, 0);\n\t\t}\n\t\telse {\n\t\t\t$flux['data'] .= $html;\n\t\t}\n\t}\n\treturn $flux;\n}",
"function dt_sc_address($attrs, $content = null) {\n\t\textract ( shortcode_atts ( array (\n\t\t\t\t'line1' => '',\n\t\t\t\t'line2' => '',\n\t\t\t\t'line3' => '',\n\t\t\t\t'line4' => ''\n\t\t), $attrs ) );\n\t\t\n\t\t\n\t\t$out = '<p class=\"dt-sc-contact-info address\">';\n\t\t$out .= \"<i class='fa fa-pagelines'></i>\";\n\t\t$out .= \"<span>\";\n\t\t$out .= ( !empty($line1) ) ? $line1 : \"\";\n\t\t$out .= ( !empty($line2) ) ? \"<br>$line2\" : \"\";\n\t\t$out .= ( !empty($line3) ) ? \"<br>$line3\" : \"\";\n\t\t$out .= ( !empty($line4) ) ? \"<br>$line4\" : \"\";\n\t\t$out .= \"</span>\";\n\t\t$out .= '</p>';\n\t\t\n\t\treturn $out;\n\t }",
"static public function contact(){\n\t\t$dom_doc = Utils::dom_doc(\"Website - Contact\");\n\n\t\t/*Content*/\n\t\t$content_element = DOMParser::content_element($dom_doc);\n\t\t$p_element = $content_element->appendChild($dom_doc->createElement(\"p\"));\n\t\t//$p_element->nodeValue = \"This is where the contact page text content goes\";\n\t\t$rows = SQLiteParser::table_rows('database.db','contact');//read the database table named: about\n\t\tDOMModifier::append_html($p_element, $rows[0][\"content\"]);\n\t\t\n\t\treturn $dom_doc;\n\t}",
"public function getMailingAddressFullHtml(){\r\n \r\n $state = $this->getState();\r\n $city = $this->getCity();\r\n $zip = $this->getZipCode();\r\n \r\n $address = $this->getMailingAddress();\r\n \r\n if( strlen($city) ){\r\n $address .= '<br />' . $city;\r\n } \r\n \r\n if( !is_null($state) ){\r\n $address .= (strlen($city)?', ':'') . $state->getName();\r\n $address .= '<br />' . $state->getCountry()->getName();\r\n }\r\n \r\n if( strlen($zip) ){\r\n $address .= (strlen($address)?' - ':'') . strtoupper( trim($zip) );\r\n }\r\n\r\n return $address;\r\n \r\n }",
"function contact_information() {\n\t\t\n\t\techo '<p>Online Application URL:<br />';\n\t\techo '<input type=\"text\" name=\"' . $this->get_field_name( 'application_url' ) . '\" id=\"' . $this->get_field_id( 'application_url' ) . '\" value=\"' . esc_attr( $this->get_field_value( 'application_url' ) ) . '\" size=\"50\" />';\n\t\techo '</p>';\n\t\techo '<p>Company NMLS:<br />';\n\t\techo '<input type=\"text\" name=\"' . $this->get_field_name( 'company_nmls' ) . '\" id=\"' . $this->get_field_id( 'company_nmls' ) . '\" value=\"' . esc_attr( $this->get_field_value( 'company_nmls' ) ) . '\" size=\"50\" />';\n\t\techo '</p>';\n\t\techo '<p>Individual NMLS:<br />';\n\t\techo '<input type=\"text\" name=\"' . $this->get_field_name( 'individual_nmls' ) . '\" id=\"' . $this->get_field_id( 'individual_nmls' ) . '\" value=\"' . esc_attr( $this->get_field_value( 'individual_nmls' ) ) . '\" size=\"50\" />';\n\t\techo '</p>';\n\t\techo '<p>Address:<br />';\n\t\techo '<textarea name=\"' . $this->get_field_name( 'address' ) . '\" cols=\"78\" rows=\"8\">' . esc_textarea( $this->get_field_value( 'address' ) ) . '</textarea>';\n\t\techo '</p>';\n\t\techo '<p>Phone Number:<br />';\n\t\techo '<input type=\"text\" name=\"' . $this->get_field_name( 'phone' ) . '\" id=\"' . $this->get_field_id( 'phone' ) . '\" value=\"' . esc_attr( $this->get_field_value( 'phone' ) ) . '\" size=\"50\" /><br />';\n\t\techo '<input type=\"checkbox\" name=\"' . $this->get_field_name( 'phone_checkbox' ) . '\" id=\"' . $this->get_field_id( 'phone_checkbox' ) . '\" value=\"1\"' . checked( 1, $this->get_field_value( 'phone_checkbox' ), false ) . '\" /><label for' . $this->get_field_name( 'phone_checkbox' ) . '>Check to Include in Header</label>';\n\t\techo '</p>';\n\t\techo '<p>Link to Locations Page:<br />';\n\t\techo '<input type=\"text\" name=\"' . $this->get_field_name( 'locations_page' ) . '\" id=\"' . $this->get_field_id( 'locations_page' ) . '\" value=\"' . esc_attr( $this->get_field_value( 'locations_page' ) ) . '\" size=\"50\" /><br />';\n\t\techo '<input type=\"checkbox\" name=\"' . $this->get_field_name( 'locations_checkbox' ) . '\" id=\"' . $this->get_field_id( 'locations_checkbox' ) . '\" value=\"1\"' . checked( 1, $this->get_field_value( 'locations_checkbox' ), false ) . '\" /><label for' . $this->get_field_name( 'location_checkbox' ) . '>Check to Include in Header</label>';\n\t\techo '</p>';\n\t\techo '<p>Disclaimer:<br />';\n\t\techo '<textarea name=\"' . $this->get_field_name( 'disclaimer' ) . '\" cols=\"78\" rows=\"8\">' . esc_textarea( $this->get_field_value( 'disclaimer' ) ) . '</textarea>';\n\t\techo '</p>';\n\t}",
"function dt_sc_email($attrs, $content = null) {\n\t\textract ( shortcode_atts ( array (\n\t\t\t\t'emailid' => ''\n\t\t), $attrs ) );\n\n\t\t$attribute = \" \";\n\n\t\t$out = '<p class=\"dt-sc-contact-info\">';\n\t\t$out .= \"<i class='fa fa-envelope'></i>\";\n\t\t$out .= __('Email : ','dt_themes');\n\t\t$out .= ( !empty($emailid) ) ? \"<a href='mailto:$emailid'>{$emailid}</a>\" : \"\";\n\t\t$out .= '</p>';\n\t\t\n\t\treturn $out;\n\t }",
"function si_address( $address = array() ) {\n\t\t$address = si_format_address( $address, 'string', '<br/>' );\n\t\treturn apply_filters( 'si_address', sprintf( '<address class=\"vcard\"><span>%s</span></address>', $address ), $address );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds an element to the array passed in | function addToArray($array,$element){
$array[count($array)]=$element;
return $array;
} | [
"function intarray_add(&$intarray, $value) {}",
"public function addElement(ArrayElementNode $element) : void\n {\n $this->elements[] = $element;\n }",
"public function addItem(Array $item);",
"public function add($element);",
"function array_add($array, $key, $value)\n\t{\n\t\treturn Arr::add($array, $key, $value);\n\t}",
"public function addEntry(Arrayable $entry);",
"public function append($element){\n $this->elements[] = $element;\n $this->iteratorCount = count($this->elements);\n }",
"function array_add($array, $key, $value)\n\t{\n\t\tif ( ! isset($array[$key])) $array[$key] = $value;\n\n\t\treturn $array;\n\t}",
"public function append($value) {\n\t\t$this->array[] = $value;\n\t}",
"function array_add($array, $key, $value)\n{\n\tif (!isset($array[$key]))\n\t{\n\t\t$array[$key] = $value;\n\t}\n\t\n\treturn $array;\n}",
"public function add($elements)\n {\n if(!is_array($elements)) {\n $this->_elements[] = $elements;\n }\n else\n {\n foreach($elements as $index => $element)\n {\n if(static::getIsIndexed()) {\n $this->_elements[$index] = $element;\n }\n else {\n $this->_elements[] = $element;\n }\n }\n }\n }",
"function append(array $array, $value = null)\n{\n $array[] = $value;\n\n return $array;\n}",
"abstract public function addExample(array $example);",
"function AddIntoArray($value,$array){\n\tif(!in_array($value, $array)){\n\t\t$array[] =$value;\n\t};\n\treturn $array;\n}",
"public function add($elements);",
"abstract public function push(... $elements): AbstractVector;",
"public function append($element)\n {\n $this->array[] = $element;\n return $this;\n }",
"public static function push(array $array, $element)\n {\n array_push($array, $element);\n\n return $array;\n }",
"public function append($element)\n {\n $this->elements[] = $element;\n $this->iteratorCount = count($this->elements);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For specifically checking the user's global level. (For purposes of display only) (Yes that Auth::check() is necessary since is public route) | public function checkGlobal()
{
$result = json_encode(['level' => 0]);
if (Auth::check())
{
$userID = Auth::user()->userID;
$result = $this->user->getGlobal($userID)->first()->toJson();
}
return $result;
} | [
"function page_require_level($required_level) \n{\n global $session;\n $current_user = current_user();\n\n /* caution */\n /* === added by Yoel.- 2019.05.23 === */\n if ( !$current_user ) {\n redirect(SITE_URL.'/home.php', FALSE);\n return FALSE;\n }\n\n $login_group = find_by_groupLevel($current_user['user_level']);\n\n // if user is not logged in\n if (!$session->isUserLoggedIn(TRUE)) {\n $session->msg('d','Por favor Iniciar sesión...');\n redirect(SITE_URL.'/index.php', FALSE);\n }\n // if group status is inactive\n elseif($login_group['group_status'] === '0') {\n $session->msg('d','Este nivel de usaurio esta inactivo!');\n redirect(SITE_URL.'/home.php',FALSE);\n }\n // checking for (user level) <= (required level)\n elseif($current_user['user_level'] <= (int)$required_level) {\n return TRUE;\n }\n else {\n $session->msg(\"d\", \"¡Lo siento! no tienes permiso para ver la página.\");\n redirect(SITE_URL.'/home.php', FALSE);\n }\n}",
"function page_require_level($require_level){\n global $session;\n $current_user = current_user();\n $login_level = find_by_groupLevel($current_user['user_level']);\n //if user not login\n if (!$session->isUserLoggedIn(true)):\n $session->msg('d','Por favor Iniciar sesión...');\n redirect('../index.php', false);\n //if Group status Deactive\n elseif($login_level['group_status'] === '0'):\n $session->msg('d','Este nivel de usaurio esta inactivo!');\n redirect('../home.php',false);\n //cheackin log in User level and Require level is Less than or equal to\n elseif($current_user['user_level'] <= (int)$require_level):\n return true;\n else:\n $session->msg(\"d\", \"¡Lo siento! no tienes permiso para ver la página.\");\n redirect('../home.php', false);\n endif;\n\n }",
"public function check_auth()\n {\n if (isset($_SESSION['go_level'])) {\n if ($_SESSION['go_level'] == 0 || $_SESSION['go_level'] == 3) {\n redirect(base_url().\"admin/\");\n }elseif($_SESSION['go_level'] == 2){\n redirect(base_url().\"spv/\");\n }else{\n redirect(base_url().\"permohonan/\");\n }\n }\n }",
"function page_require_level($require_level){\n global $session;\n $current_user = current_user();\n $login_level = find_by_groupLevel($current_user['user_level']);\n //if user not login\n if (!$session->isUserLoggedIn(true)):\n $session->msg('d','Please login to AdFlow.');\n redirect('index.php', false);\n //if Group status Deactive\n elseif($login_level['group_status'] === '0'):\n $session->msg('d','This level user has been band!');\n redirect('about.php',false);\n //cheackin log in User level and Require level is Less than or equal to\n elseif($current_user['user_level'] <= (int)$require_level):\n return true;\n else:\n $session->msg(\"d\", \"Sorry! you dont have permission to view the page.\");\n redirect('about.php', false);\n endif;\n\n }",
"public function checkAccessLevel()\n {\n if ($_SESSION['RIGHTS'] === 'full') {\n $this->accessLevel = 'full';\n } else {\n $this->accessLevel = 'guest';\n }\n\n $this->arResult['arResult']['ACCESS_LEVEL'] = $this->accessLevel;\n }",
"function minAuthLevel($minLevel, $userLevel){\n\n\t//If ther users level of authentication is lower than required to view this page stop them.\n\tif ($userLevel < $minLevel){\n\t\techo \"You do not have access to view this page\";\n\t\tdie;\n\t}\n\t\n}",
"function getLevel() {\n if($this->Session->check('User.level') === false) {\n return false;\n }\n else {\n return $this->Session->read('User.level');\n }\n\t}",
"function getAuthorised($level)\n{\n global $auth;\n\n $user = getUserName();\n if(isset($user) == FALSE) {\n authGet();\n return 0;\n }\n return authGetUserLevel($user, $auth[\"admin\"]) >= $level;\n}",
"function checkAuthorised($just_check=FALSE)\n{\n global $page_level, $max_level;\n global $day, $month, $year, $area, $room;\n global $PHP_SELF;\n\n $page = this_page();\n \n // Get the minimum authorisation level for this page\n if (isset($page_level[$page]))\n {\n $required_level = $page_level[$page];\n }\n elseif (isset($max_level))\n {\n $required_level = $max_level;\n }\n else\n {\n $required_level = 2;\n }\n \n if ($just_check)\n {\n if ($required_level == 0)\n {\n return TRUE;\n }\n $user = getUserName();\n return (isset($user)) ? (authGetUserLevel($user) >= $required_level): FALSE;\n }\n \n // Check that the user has this level\n if (!getAuthorised($required_level))\n {\n // If we dont know the right date then use today's\n if (!isset($day) or !isset($month) or !isset($year))\n {\n $day = date(\"d\");\n $month = date(\"m\");\n $year = date(\"Y\");\n }\n if (empty($area))\n {\n $area = get_default_area();\n }\n showAccessDenied($day, $month, $year, $area, isset($room) ? $room : null);\n exit();\n }\n \n return TRUE;\n}",
"static public function check_access($level = null)\n\t{\n\n\t\t$user = \\Model_Users::build()->where('user', Session::get('username'))->execute();\n\t\t$user = $user[0];\n\t\tif($level == null)\n\t\t{\n\t\t\treturn $user->access;\n\t\t}\n\t\tif(is_string($level))\n\t\t{\n\t\t\tswitch ($level) \n\t\t\t{\n\t\t\t\tcase 'banned':\n\t\t\t\t\t$level = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'customer':\n\t\t\t\t\t$level = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'privilege':\n\t\t\t\t\t$level = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'admin':\n\t\t\t\t\t$level = 3;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(isset($user->access))\n\t\t{\n\t\t\tif($user->access >= $level)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function Check($level) {\n\t\tif (isset ( $_SESSION ['User'] )) {\n\t\t\treturn ($_SESSION ['User']->accesslevel >= $level ? true : false);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function authGetUserLevel($user)\n{\n global $auth;\n $admins = $auth['admin'];\n // User not logged in, user level '0'\n if(!isset($user))\n {\n return 0;\n }\n\n // Check if the user is can modify\n for ($i = 0; $admins[$i]; $i++)\n {\n if(strcasecmp($user, $admins[$i]) == 0)\n {\n return 2;\n }\n }\n\n // Everybody else is access level '1'\n return 1;\n}",
"function authGetUserLevel($user)\n{\n global $auth;\n $admins = $auth['admin'];\n // User not logged in, user level '0'\n if (!isset($user))\n {\n return 0;\n }\n\n // Check if the user is can modify\n for ($i = 0; $admins[$i]; $i++)\n {\n if(strcasecmp($user, $admins[$i]) == 0)\n {\n return 2;\n }\n }\n\n // Everybody else is access level '1'\n return 1;\n}",
"function check_level() {\r\n\t\t$query = \"select level from users where uid=\".$_SESSION['userid'];\r\n\t\t$res = $this->mdb2->query($query);\r\n\t\tif (PEAR::isError($res)) {\r\n\t\t\tdie($res->getMessage());\r\n\t\t}\r\n\t\t$row = $res->fetchRow();\r\n\t}",
"public static function hasLevel()\n\t{\n\t\t$has_level = false;\n\n\t\tif (self::checkSession())\n\t\t{\n\t\t\t$arguments = func_get_args();\n\t\t\tif (is_array($arguments[0]))\n\t\t\t{\n\t\t\t\t$arguments = $arguments[0];\n\t\t\t}\n\n\t\t\tforeach ($arguments as $access_level)\n\t\t\t{\n\t\t\t\tif (self::checkLevel($access_level))\n\t\t\t\t{\n\t\t\t\t\tif (self::getUserLevel() >= $access_level)\n\t\t\t\t\t{\n\t\t\t\t\t\t$has_level = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $has_level;\n\t}",
"function access_ensure_global_level( $p_access_level ) {\n\t\tif ( ! access_has_global_level( $p_access_level ) ) {\n\t\t\taccess_denied();\n\t\t}\t\t\n\t}",
"private function checkUserAccess()\n {\n global $Core;\n\n if (!$this->usersLevelTableName) {\n return;\n }\n\n if (!isset($this->data['pages']) || empty($this->data['pages'])) {\n $selector = new BaseSelect($this->pagesTableName);\n $selector->addField('level', 'level', $this->usersLevelTableName);\n $selector->addLeftJoin($this->usersLevelTableName, 'id', 'level_id');\n $selector->setWhere(\"`{$Core->dbName}`.`{$this->pagesTableName}`.`controller_path` = '\".$Core->db->escape($Core->rewrite->controllerPath).\"'\");\n $selector->setGlobalTemplate('fetch_assoc');\n $level = $selector->execute();\n if (!empty($level) && isset($level['level']) && $level['level'] == 0) {\n return;\n }\n } else {\n foreach ($this->data['pages'] as $page) {\n if ($Core->Rewrite->controllerPath == $page['controller_path']) {\n return;\n }\n }\n }\n\n $this->userAccessDenied();\n }",
"public function userHasAccess(){\n\t\tif( !$this->user->isAuth() && !$this->user->auth() ){\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->user->hasAccessToLevel( $this->getLevelId() );\n\t}",
"private function CheckPrivilage(){\n \t\t// what level of control required to access function.\n \t\tswitch($_SESSION['TYPE']){\n \t\t\tcase 'ADMIN': \n \t\t\t\treturn 3;\n \t\t\tcase 'Manager':\n \t\t\tcase 'Sizing':\n \t\t\t\treturn 2;\n \t\t\tcase 'Employee':\n \t\t\t\treturn 1;\n \t\t\tdefault:\n \t\t\t\treturn 0;\t\t\n \t\t}\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the last four digits of the card number used for this transaction | public function get_last_four() {
return ! empty( $this->response->getPaddedCardNo()) ? substr($this->response->getPaddedCardNo(),-4): null;
} | [
"public function cardLastFour()\n {\n return (string) ($this->paddleInfo()['payment_information']['last_four_digits'] ?? '');\n }",
"public function getCardNumberLast4() {\n if ($this->getData('card_number_last4') === null) {\n if ($this->getCardNumber()) {\n $this->setCardNumberLast4(substr($this->getCardNumber(), -4));\n }\n }\n return $this->getData('card_number_last4');\n }",
"public function getLastFourCardDigits()\n {\n return $this->last_four;\n }",
"static public function getLast4Digits($cardNr)\n {\n // Apply RegExp to extract last 4 digits\n $matches = array();\n if (preg_match('/\\d{4}$/', $cardNr, $matches))\n {\n return $matches[0];\n }\n return '';\n }",
"public static function getLast4Digits($cardNr)\n {\n // Apply RegExp to extract last 4 digits\n $matches = [];\n if (preg_match('/\\d{4}$/', $cardNr, $matches)) {\n return $matches[0];\n }\n\n return '';\n }",
"public function getAccountNumberLastFour()\n {\n return substr($this->getAccountNumber(), -4, 4) ?: null;\n }",
"public function getCardNumberTail($length=4) {\n $tail = false;\n if(isset($this->_payment['cardNumber']) && strlen($this->_payment['cardNumber']) >= $length) {\n $tail = substr($this->_payment['cardNumber'], -1 * $length);\n }\n return $tail;\n }",
"public function getLastFourDigits()\n {\n return $this->lastFourDigits;\n }",
"public function getLast4(): string\n {\n return $this->getData(self::LAST_4);\n }",
"protected function getLastFourCardDigits($customer)\n\t{\n\t\tif(isset($customer->default_card))\n\t\t{\n\t\t\treturn $customer->cards->retrieve($customer->default_card)->last4;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$acct = $customer->metadata['debit-account'];\n\t\t\tif(isset($acct)){\n\t\t\t\treturn substr($acct, -4);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}",
"private function getLastDigitPlate(){\n\t\treturn substr($this->plate, -1);\n\t}",
"public function credit_card_number( $number ){\n\t\treturn substr_replace($number, str_repeat('X', strlen( $number ) - 4), 0, strlen( $number ) - 4);\n\t}",
"public function getLastDigitFromPlate()\n {\n $plate = str_split($this->getPlate());\n\n return end($plate);\n }",
"public function getCardNumber()\r\n {\r\n return $this->payment->getAdditionalInformation('card_number') ?? '****';\r\n }",
"protected function getLastFourCardDigits($customer)\n {\n return ($customer->default_source) ? $customer->sources->retrieve($customer->default_source)->last4 : null;\n }",
"public function getCardNo();",
"function ucard2number($ucard) {\n return hexdec(substr($ucard, -1));\n}",
"public function getMaskedCardNumber() {\n }",
"public function get_masked_number() {\n\n\t return ! empty( $this->response->getPaddedCardNo() ) ? $this->response->getPaddedCardNo() : null;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether this is the posts page, regardless of whether it's the frontpage or not. | private function is_posts_page(): bool {
return ( is_home() && ! is_front_page() );
} | [
"public static function is_posts_page() {\n\t\treturn ( \\is_home() && 'page' === get_option( 'show_on_front' ) );\n\t}",
"public function isStaticPostsPage() {\n\t\treturn is_home() && ( 0 !== (int) get_option( 'page_for_posts' ) );\n\t}",
"public function is_home_posts_page() {\n\t\treturn ( is_home() && get_option( 'show_on_front' ) === 'posts' );\n\t}",
"private function is_static_posts_page() {\n\t\tif ( is_home() && 0 !== (int) get_option( 'page_for_posts' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function is_frontpage_posts() {\n\t\treturn (is_home() == true && get_option('show_on_front') == 'posts');\n\t}",
"public function isPostspage() {\n $target = $this->target();\n return $target && $target->id == Config::meta('posts_page');\n }",
"public function is_static_posts_page() {\n\t\t$wp_query = $this->wp_query_wrapper->get_main_query();\n\n\t\t$page_for_posts = (int) \\get_option( 'page_for_posts' );\n\n\t\treturn ( $page_for_posts > 0 && $page_for_posts === $wp_query->get_queried_object_id() );\n\t}",
"public function is_home_posts_page()\n {\n }",
"public function is_static_posts_page()\n {\n }",
"function cgit_seo_is_post() {\n return is_single() || is_page();\n}",
"private function is_page()\n {\n if(isset($this->_post) && $this->_post->post_type == 'page') {\n return true;\n }\n return false;\n }",
"public function isPostsArchivePage() {\n if(is_admin() && isset($_GET['post'])) {\n if ((int)$_GET['post'] == get_option('page_for_posts')) {\n return true;\n }\n }\n return false;\n }",
"function isBlogPage(){\n if ( is_page_template('page_blog.php') || is_post_type_archive('post') || is_singular('post') || is_category() || (is_date() && get_post_type() == 'post')) {\n return true; \n } \n \n return false;\n \n }",
"private function is_front_page() {\n\t\tif ( $this->show_on_front === 'page' && is_front_page() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( $this->show_on_front === 'posts' && is_home() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function is_blog_page()\n{\n global $post;\n\n // Post type must be 'post'.\n $post_type = get_post_type($post);\n\n // Check all blog-related conditional tags, as well as the current post type,\n // to determine if we're viewing a blog page.\n return ($post_type === 'post') && (is_home() || is_archive() || is_single());\n}",
"public static function isSinglePage()\n {\n $is_single = false;\n\n /* @var AbstractPostType $instance */\n if ($instance = Theme::getPostTypeInstanceByClassName(get_called_class())) {\n $is_single = (is_page() || is_single()) && get_post_type() === $instance->type;\n }\n\n return $is_single;\n }",
"function auxin_is_blog(){\n // get the slug of page template\n $page_template_slug = is_page_template() ? get_page_template_slug( get_queried_object_id() ) : '';\n // whether the current page is a blog page template or not\n $is_blog_template = ! empty( $page_template_slug ) && false !== strpos( $page_template_slug, 'blog-type' );\n\n if( ( $is_blog_template || ( is_home() && !is_paged() ) || ( is_home() && !is_front_page() ) || ( !is_category() && !is_paged() && !is_tag() && !is_author() && is_archive() && !is_date() ) ) ) {\n return true;\n }\n return false;\n}",
"private function checkFrontPage() {\r\r\n return is_page() && get_option('show_on_front') == 'page' && isset($this->post->ID) && $this->post->ID == get_option('page_on_front');\r\r\n }",
"public function isSlidesFromPosts(){\n\t\treturn $this->is_posts();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The setter for the field streetName | public function setStreetName($streetName)
{
$this->_streetName = $streetName;
} | [
"public function setStreetName($streetName) {\n\t\t$this->streetName = $streetName;\n\t}",
"public function setStreet_name($street_name = null)\n {\n // validation for constraint: string\n if (!is_null($street_name) && !is_string($street_name)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($street_name, true), gettype($street_name)), __LINE__);\n }\n if (is_null($street_name) || (is_array($street_name) && empty($street_name))) {\n unset($this->street_name);\n } else {\n $this->street_name = $street_name;\n }\n return $this;\n }",
"public function setStreet($street);",
"public function setBillingAddressStreetName(?string $billingAddressStreetName);",
"public function setStreet(string $streetaddress = null);",
"public function test_set_address_street_name(){\n $this->address->setStreetName('tikkurilantie');\n $this->assertEquals($this->address->getStreetName(), 'tikkurilantie');\n }",
"public function setStreet($street) {\n\t\t$this->street = $street;\n\t}",
"public function getStreetname()\n {\n return $this->streetname;\n }",
"public function getStreetName()\n {\n return $this->streetName;\n }",
"public function setStreetNo($value){\n\t\t\t$this->street_no = $value;\n\t\t}",
"public function testSetStreetName()\n {\n $this->testAddress= new Address($this->id, $this->testHAN, $this->testStName, $this->testCity, $this->testProv, $this->testPostalC);\n\n $this->assertEquals($this->testStName, $this->testAddress->getStreetName());\n $this->testAddress->setStreetName(\"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\"); //boundary case where set word is 50 chars long\n $this->assertEquals(\"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\", $this->testAddress->getStreetName());\n\n $this->expectException(\\InvalidArgumentException::class);\n $this->testAddress->setStreetName(\"Hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\"); //exception case where set name is over 50 characters (amount allowed)\n\n $this->expectException(\\InvalidArgumentException::class);\n $this->testAddress->setStreetName(48957497); //exception case where set name is only numeric (should be a string)\n\n }",
"function set_street_address($name='*', $suffix='*', $street_num='*', $apt_num='*')\r\n{\r\n\tif ( $this->debug ) $this->print_d(__FUNCTION__ . ' : set street address');\r\n\t\r\n\t// random apartment num\r\n\tif ( $apt_num == '*' ) $apt_num = $this->_get_random_apt_num();\r\n\t\r\n\t// random suffix (St, Ave, Blvd, etc.)\r\n\tif ( $suffix == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_SUFFIX = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$suffix = $_SUFFIX[1];\r\n\t\tif ( $this->debug ) $this->print_d(\"random suffix: $suffix\");\r\n\t}\r\n\t\r\n\t// random street name\r\n\tif ( $name == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_NAME = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$name = $_NAME[0];\r\n\t\tif ( $this->debug ) $this->print_d(\"random name: $name\");\r\n\t}\r\n\t\r\n\t// street number (quick and dirty)\r\n\tif ( $street_num == '*' )\r\n\t{\r\n\t\t$street_num = mt_rand(1,12500);\r\n\t\tif ( $this->debug ) $this->print_d(\"random street number: $street_num\");\r\n\t}\r\n\t\r\n\t// set street prop\r\n\t$this->street_address = trim(ucwords(strtolower(\"$street_num $name $suffix $apt_num\")));\r\n\tif ( $this->debug ) $this->print_d(\"random street_address : {$this->street_address}\");\r\n\treturn;\r\n}",
"public function streetName(): string\n {\n return $this->getData('Streetname');\n }",
"public function setStreetAddress(?string $value): void {\n $this->getBackingStore()->set('streetAddress', $value);\n }",
"public function getStreetName();",
"function setStreetAddress($street_address)\n\t{\n\t\t$this->_modified = true;\n\t\t$this->street_address = $street_address;\n\t}",
"function setStreetNumber($a_sStreetNumber)\n {\n if (DomainWatcher::exists(get_class($this), $this->getId())) {\n $mCompareValue = is_null($a_sStreetNumber) ? NULL : ((string) $a_sStreetNumber);\n if ($mCompareValue !== $this->_sStreetNumber) {\n $this->_markModified();\n }\n }\n $this->_sStreetNumber = is_null($a_sStreetNumber) ? NULL : (string) $a_sStreetNumber;\n }",
"public function getStreetName(): string\n {\n return (string)$this->streetName;\n }",
"public function getStreetName()\n {\n return sprintf(\n '%s %s',\n $this->address->getAddress(),\n $this->address->getAddressMore()\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test fetching user IDs for a given context. | public function test_get_users_in_context() {
$component = 'search_simpledb';
// Ensure both users are found for both contexts.
$expected = [$this->u1->id, $this->u2->id];
sort($expected);
// User 1.
$userlist = new \core_privacy\local\request\userlist($this->c1context, $component);
provider::get_users_in_context($userlist);
$this->assertCount(2, $userlist);
$actual = $userlist->get_userids();
sort($actual);
$this->assertEquals($expected, $actual);
// User 2.
$userlist = new \core_privacy\local\request\userlist($this->c2context, $component);
provider::get_users_in_context($userlist);
$this->assertCount(2, $userlist);
$actual = $userlist->get_userids();
sort($actual);
$this->assertEquals($expected, $actual);
} | [
"public function test_get_users_in_context() {\n $this->resetAfterTest(true);\n $this->setAdminUser();\n $this->scorm_setup_test_scenario_data();\n $component = 'mod_scorm';\n\n $userlist = new \\core_privacy\\local\\request\\userlist($this->context, $component);\n provider::get_users_in_context($userlist);\n\n // Students 1 and 2 have attempts in the SCORM context, student 0 does not.\n $this->assertCount(2, $userlist);\n\n $expected = [$this->student1->id, $this->student2->id];\n $actual = $userlist->get_userids();\n sort($expected);\n sort($actual);\n $this->assertEquals($expected, $actual);\n }",
"public function test_get_users_in_context() {\n $this->resetAfterTest();\n\n $component = 'core_enrol';\n\n $user = $this->getDataGenerator()->create_user();\n $usercontext = context_user::instance($user->id);\n $course = $this->getDataGenerator()->create_course();\n $coursecontext = context_course::instance($course->id);\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecontext, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n\n // Enrol user into course.\n $this->getDataGenerator()->enrol_user($user->id, $course->id, null, 'manual');\n\n // The list of users within the course context should contain user.\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $expected = [$user->id];\n $actual = $userlist1->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the user context should be empty.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($usercontext, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n }",
"public function test_get_users_in_context() {\n $component = 'core_badges';\n\n // Create course1.\n $course1 = $this->getDataGenerator()->create_course();\n $coursecontext1 = context_course::instance($course1->id);\n // Create course2.\n $course2 = $this->getDataGenerator()->create_course();\n $coursecontext2 = context_course::instance($course2->id);\n // Create user1.\n $user1 = $this->getDataGenerator()->create_user();\n $usercontext1 = context_user::instance($user1->id);\n // Create user2.\n $user2 = $this->getDataGenerator()->create_user();\n $usercontext2 = context_user::instance($user2->id);\n // Create user3.\n $user3 = $this->getDataGenerator()->create_user();\n $usercontext3 = context_user::instance($user3->id);\n\n // The list of users in usercontext1 should not return anything yet (related data still haven't been created).\n $userlist1 = new \\core_privacy\\local\\request\\userlist($usercontext1, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n // The list of users in coursecontext1 should not return anything yet (related data still haven't been created).\n $userlist2 = new \\core_privacy\\local\\request\\userlist($coursecontext1, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n // The list of users in systemcontext should not return anything yet (related data still haven't been created).\n $systemcontext = context_system::instance();\n $userlist3 = new \\core_privacy\\local\\request\\userlist($systemcontext, $component);\n provider::get_users_in_context($userlist3);\n $this->assertCount(0, $userlist3);\n\n // Assert that we find contexts where we created/modified a badge.\n $this->create_badge(['usercreated' => $user1->id, 'usermodified' => $user2->id]);\n $badge1 = $this->create_badge(['usercreated' => $user2->id, 'type' => BADGE_TYPE_COURSE, 'courseid' => $course1->id]);\n $badge2 = $this->create_badge(['usercreated' => $user3->id, 'usermodified' => $user1->id]);\n\n $this->create_manual_award(['recipientid' => $user2->id, 'issuerid' => $user1->id, 'badgeid' => $badge1->id]);\n $this->create_manual_award(['recipientid' => $user3->id, 'issuerid' => $user2->id, 'badgeid' => $badge1->id]);\n $this->create_manual_award(['recipientid' => $user1->id, 'issuerid' => $user2->id, 'badgeid' => $badge2->id]);\n\n $this->create_backpack(['userid' => $user2->id]);\n $this->create_issued(['badgeid' => $badge2->id, 'userid' => $user3->id]);\n\n $crit = $this->create_criteria_manual($badge1->id);\n $crit->mark_complete($user3->id);\n\n // The list of users for user context should return user1 and user2.\n provider::get_users_in_context($userlist1);\n $this->assertCount(2, $userlist1);\n $this->assertTrue(in_array($user1->id, $userlist1->get_userids()));\n $this->assertTrue(in_array($user2->id, $userlist1->get_userids()));\n\n // The list of users for course context should return user2.\n provider::get_users_in_context($userlist2);\n $this->assertCount(1, $userlist2);\n $this->assertTrue(in_array($user2->id, $userlist2->get_userids()));\n\n // The list of users for system context should return user1, user2 and user3.\n provider::get_users_in_context($userlist3);\n $this->assertCount(3, $userlist3);\n $this->assertTrue(in_array($user1->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($user2->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($user3->id, $userlist3->get_userids()));\n }",
"public function test_get_users_in_context() {\n $component = 'core_cohort';\n\n // Create system cohort and category cohort.\n $coursecategory = $this->getDataGenerator()->create_category();\n $coursecategoryctx = \\context_coursecat::instance($coursecategory->id);\n $systemctx = \\context_system::instance();\n $categorycohort = $this->getDataGenerator()->create_cohort([\n 'contextid' => $coursecategoryctx->id,\n 'name' => 'Category cohort 1',\n ]);\n // Create user.\n $user = $this->getDataGenerator()->create_user();\n $userctx = \\context_user::instance($user->id);\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecategoryctx, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n\n $userlist2 = new \\core_privacy\\local\\request\\userlist($systemctx, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n\n $systemcohort = $this->getDataGenerator()->create_cohort([\n 'contextid' => $systemctx->id,\n 'name' => 'System cohort 1'\n ]);\n // Create user and add to the system and category cohorts.\n cohort_add_member($categorycohort->id, $user->id);\n cohort_add_member($systemcohort->id, $user->id);\n\n // The list of users within the coursecat context should contain user.\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecategoryctx, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $expected = [$user->id];\n $actual = $userlist1->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the system context should contain user.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($systemctx, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(1, $userlist2);\n $expected = [$user->id];\n $actual = $userlist2->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the user context should be empty.\n $userlist3 = new \\core_privacy\\local\\request\\userlist($userctx, $component);\n provider::get_users_in_context($userlist3);\n $this->assertCount(0, $userlist3);\n }",
"public function test_get_users_in_context() {\n global $DB;\n\n $this->resetAfterTest(true);\n\n $component = 'core_notes';\n // Test setup.\n $this->setAdminUser();\n set_config('enablenotes', true);\n // Create a teacher.\n $teacher1 = $this->getDataGenerator()->create_user();\n $this->setUser($teacher1);\n $teacherrole = $DB->get_record('role', array('shortname' => 'teacher'));\n // Create a student.\n $student = $this->getDataGenerator()->create_user();\n // Create student2.\n $student2 = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n\n // Create courses, then enrol a teacher and a student.\n $nocourses = 3;\n for ($c = 1; $c <= $nocourses; $c++) {\n ${'course' . $c} = $this->getDataGenerator()->create_course();\n ${'coursecontext' . $c} = context_course::instance(${'course' . $c}->id);\n\n role_assign($teacherrole->id, $teacher1->id, ${'coursecontext' . $c}->id);\n role_assign($studentrole->id, $student->id, ${'coursecontext' . $c}->id);\n role_assign($studentrole->id, $student2->id, ${'coursecontext' . $c}->id);\n }\n // The list of users in coursecontext1 should be empty (related data still have not been created).\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecontext1, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n // The list of users in coursecontext2 should be empty (related data still have not been created).\n $userlist2 = new \\core_privacy\\local\\request\\userlist($coursecontext2, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n // The list of users in coursecontext3 should be empty (related data still have not been created).\n $userlist3 = new \\core_privacy\\local\\request\\userlist($coursecontext3, $component);\n provider::get_users_in_context($userlist3);\n $this->assertCount(0, $userlist3);\n\n // Create private user notes (i.e. NOTES_STATE_DRAFT) for student in course1 and course2 written by the teacher.\n $this->help_create_user_note($student->id, NOTES_STATE_DRAFT, $course1->id,\n \"Test private user note about the student in Course 1 by the teacher\");\n $this->help_create_user_note($student->id, NOTES_STATE_DRAFT, $course2->id,\n \"Test private user note about the student in Course 2 by the teacher\");\n\n // The list of users in coursecontext1 should return one user (teacher1).\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $this->assertTrue(in_array($teacher1->id, $userlist1->get_userids()));\n // The list of users in coursecontext2 should return one user (teacher1).\n provider::get_users_in_context($userlist2);\n $this->assertCount(1, $userlist2);\n $this->assertTrue(in_array($teacher1->id, $userlist2->get_userids()));\n // The list of users in coursecontext3 should not return any users.\n provider::get_users_in_context($userlist3);\n $this->assertCount(0, $userlist3);\n\n // Create public user note (i.e. NOTES_STATE_PUBLIC) for student in course3 written by the teacher.\n $this->help_create_user_note($student->id, NOTES_STATE_PUBLIC, $course3->id,\n \"Test public user note about the student in Course 3 by the teacher\");\n\n // The list of users in coursecontext3 should return 2 users (teacher and student).\n provider::get_users_in_context($userlist3);\n $this->assertCount(2, $userlist3);\n $this->assertTrue(in_array($teacher1->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($student->id, $userlist3->get_userids()));\n\n // Create site user note (i.e. NOTES_STATE_SITE) for student2 in course3 written by the teacher.\n $this->help_create_user_note($student2->id, NOTES_STATE_SITE, $course3->id,\n \"Test site-wide user note about student2 in Course 3 by the teacher\"\n );\n\n // The list of users in coursecontext3 should return 3 users (teacher, student and student2).\n provider::get_users_in_context($userlist3);\n $this->assertCount(3, $userlist3);\n $this->assertTrue(in_array($teacher1->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($student->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($student2->id, $userlist3->get_userids()));\n\n // The list of users should not return any users in a different context than course context.\n $contextsystem = context_system::instance();\n $userlist4 = new \\core_privacy\\local\\request\\userlist($contextsystem, $component);\n provider::get_users_in_context($userlist4);\n $this->assertCount(0, $userlist4);\n }",
"public function test_get_users_in_context_invalid_context_type() {\n $systemcontext = context_system::instance();\n\n $userlist = new \\core_privacy\\local\\request\\userlist($systemcontext, 'mod_choice');\n \\mod_choice\\privacy\\provider::get_users_in_context($userlist);\n\n $this->assertCount(0, $userlist->get_userids());\n }",
"public function test_get_users_in_context_forumng_read() {\n list($users, ,$forums ,$dis,$lastposts) = $this->create_basic_test_data();\n $cm = get_coursemodule_from_instance('forumng', $forums[2]->get_id());\n $context = \\context_module::instance($cm->id);\n\n\n $dis[2]->mark_read(1420070400, $users[2]->id);\n\n $userlist = new \\core_privacy\\local\\request\\userlist($context, 'mod_forumng');\n provider::get_users_in_context($userlist);\n $userids = $userlist->get_userids();\n\n $this->assertCount(2, $userids);\n $this->assertContains((int)$users[1]->id, $userids);\n $this->assertContains((int)$users[2]->id, $userids);\n }",
"public function test_get_users_in_context_with_attempt() {\n $this->resetAfterTest(true);\n\n $user = $this->getDataGenerator()->create_user();\n $anotheruser = $this->getDataGenerator()->create_user();\n $this->getDataGenerator()->create_user(); // This user should not be included in the results.\n $question = $this->attemptgenerator->create_embeddable_question('truefalse');\n $this->attemptgenerator->create_attempt_at_embedded_question($question, $user, 'True');\n $this->attemptgenerator->create_attempt_at_embedded_question($question, $anotheruser, 'True');\n\n [$context] = $this->get_context_and_subcontext($question);\n\n $userlist = new userlist($context, 'report_embedquestion');\n provider::get_users_in_context($userlist);\n $this->assertEqualsCanonicalizing([$user->id, $anotheruser->id], $userlist->get_userids());\n }",
"public function test_get_contexts_for_userid() {\n $contextlist = provider::get_contexts_for_userid($this->student1->id);\n\n $this->assertCount(1, $contextlist);\n $contextforuser = $contextlist->current();\n $cmcontext = context_module::instance($this->cm->id);\n $this->assertEquals($cmcontext->id, $contextforuser->id);\n }",
"public function test_get_users_in_context_with_tracking_preferences() {\n global $DB;\n $component = 'mod_forum';\n\n $course = $this->getDataGenerator()->create_course();\n\n $forum = $this->getDataGenerator()->create_module('forum', ['course' => $course->id]);\n $cm = get_coursemodule_from_instance('forum', $forum->id);\n $context = \\context_module::instance($cm->id);\n\n $otherforum = $this->getDataGenerator()->create_module('forum', ['course' => $course->id]);\n $othercm = get_coursemodule_from_instance('forum', $otherforum->id);\n $othercontext = \\context_module::instance($othercm->id);\n\n list($author, $user, $otheruser) = $this->helper_create_users($course, 3);\n\n // Forum tracking is opt-out.\n // Stop tracking the read posts.\n forum_tp_stop_tracking($forum->id, $user->id);\n forum_tp_stop_tracking($otherforum->id, $otheruser->id);\n\n $userlist = new \\core_privacy\\local\\request\\userlist($context, $component);\n \\mod_forum\\privacy\\provider::get_users_in_context($userlist);\n\n // One user - the one who is tracking that forum.\n $this->assertCount(1, $userlist);\n\n $expected = [$user->id];\n sort($expected);\n\n $actual = $userlist->get_userids();\n sort($actual);\n\n $this->assertEquals($expected, $actual);\n }",
"public function test_get_users_in_context() {\n global $DB;\n\n $this->resetAfterTest();\n\n $component = 'core_backup';\n\n $course = $this->getDataGenerator()->create_course();\n $activity = $this->getDataGenerator()->create_module('chat', ['course' => $course->id]);\n\n $user = $this->getDataGenerator()->create_user();\n $user2 = $this->getDataGenerator()->create_user();\n\n $coursecontext = context_course::instance($course->id);\n $activitycontext = \\context_module::instance($activity->cmid);\n\n // The list of users for course context should return the user.\n $userlist = new \\core_privacy\\local\\request\\userlist($coursecontext, $component);\n provider::get_users_in_context($userlist);\n $this->assertCount(0, $userlist);\n\n // Create a course backup.\n // Just insert directly into the 'backup_controllers' table.\n $bcdata = (object) [\n 'backupid' => 1,\n 'operation' => 'restore',\n 'type' => 'course',\n 'itemid' => $course->id,\n 'format' => 'moodle2',\n 'interactive' => 1,\n 'purpose' => 10,\n 'userid' => $user->id,\n 'status' => 1000,\n 'execution' => 1,\n 'executiontime' => 0,\n 'checksum' => 'checksumyolo',\n 'timecreated' => time(),\n 'timemodified' => time(),\n 'controller' => ''\n ];\n\n $DB->insert_record('backup_controllers', $bcdata);\n\n // The list of users for the course context should return user.\n provider::get_users_in_context($userlist);\n $this->assertCount(1, $userlist);\n $expected = [$user->id];\n $actual = $userlist->get_userids();\n $this->assertEquals($expected, $actual);\n\n // Create an activity backup.\n // Just insert directly into the 'backup_controllers' table.\n $bcdata = (object) [\n 'backupid' => 2,\n 'operation' => 'restore',\n 'type' => 'activity',\n 'itemid' => $activity->cmid,\n 'format' => 'moodle2',\n 'interactive' => 1,\n 'purpose' => 10,\n 'userid' => $user2->id,\n 'status' => 1000,\n 'execution' => 1,\n 'executiontime' => 0,\n 'checksum' => 'checksumyolo',\n 'timecreated' => time(),\n 'timemodified' => time(),\n 'controller' => ''\n ];\n\n $DB->insert_record('backup_controllers', $bcdata);\n\n // The list of users for the course context should return user2.\n $userlist = new \\core_privacy\\local\\request\\userlist($activitycontext, $component);\n provider::get_users_in_context($userlist);\n $this->assertCount(1, $userlist);\n $expected = [$user2->id];\n $actual = $userlist->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users for system context should not return any users.\n $systemcontext = context_system::instance();\n $userlist = new \\core_privacy\\local\\request\\userlist($systemcontext, $component);\n provider::get_users_in_context($userlist);\n $this->assertCount(0, $userlist);\n }",
"public function test_get_users_in_context_forumng_subscriptions() {\n global $DB;\n\n list($users, ,$forums) = $this->create_basic_test_data();\n $cm = get_coursemodule_from_instance('forumng', $forums[2]->get_id());\n $context = \\context_module::instance($cm->id);\n\n\n $DB->insert_record('forumng_subscriptions', ['forumngid' => $forums[2]->get_id(), 'userid' => $users[1]->id, 'subscribed' => '1']);\n $DB->insert_record('forumng_subscriptions', ['forumngid' => $forums[2]->get_id(), 'userid' => $users[2]->id, 'subscribed' => '1']);\n $DB->insert_record('forumng_subscriptions', ['forumngid' => $forums[2]->get_id(), 'userid' => $users[3]->id, 'subscribed' => '1']);\n\n $userlist = new \\core_privacy\\local\\request\\userlist($context, 'mod_forumng');\n provider::get_users_in_context($userlist);\n $userids = $userlist->get_userids();\n\n $this->assertCount(3, $userids);\n $this->assertContains((int)$users[1]->id, $userids);\n $this->assertContains((int)$users[2]->id, $userids);\n $this->assertContains((int)$users[3]->id, $userids);\n }",
"public function test_get_contexts_for_userid(): void {\n [$users, , $forums, , ] = $this->create_basic_test_data();\n\n $context1 = $forums[1]->get_context();\n $context2 = $forums[2]->get_context();\n\n // User 1 has content in both forums.\n $contextids = provider::get_contexts_for_userid($users[1]->id)->get_contextids();\n $this->assertTrue(in_array($context1->id, $contextids));\n $this->assertTrue(in_array($context2->id, $contextids));\n\n // User 3 has content in neither forum.\n $contextids = provider::get_contexts_for_userid($users[3]->id)->get_contextids();\n $this->assertFalse(in_array($context1->id, $contextids));\n $this->assertFalse(in_array($context2->id, $contextids));\n }",
"public function testGetUsersByIds()\n {\n $result = self::$accountApi->users(null, [self::$USER_GET_ID, self::$USER_UPDATE_ID]);\n\n self::assertCount(2, $result['users']);\n self::assertValidAccountUser($result['users'][0]);\n self::assertValidAccountUser($result['users'][1]);\n }",
"public function test_get_users_in_context_forumng_ratings() {\n list($users, ,$forums ,$dis,$lastposts) = $this->create_basic_test_data();\n $cm = get_coursemodule_from_instance('forumng', $forums[1]->get_id());\n $context = \\context_module::instance($cm->id);\n\n $lastposts[1]->rate(5, $users[2]->id);\n $lastposts[1]->rate(5, $users[3]->id);\n $dis[1]->create_reply($lastposts[1], 'Welcome/to the Developing as a Researcher seminar', 'reply',\n FORMAT_HTML, false, false, false, $users[1]->id);\n\n $userlist = new \\core_privacy\\local\\request\\userlist($context, 'mod_forumng');\n provider::get_users_in_context($userlist);\n $userids = $userlist->get_userids();\n\n $this->assertCount(3, $userids);\n $this->assertContains((int)$users[1]->id, $userids);\n $this->assertContains((int)$users[2]->id, $userids);\n $this->assertContains((int)$users[3]->id, $userids);\n\n }",
"public function test_get_contexts_for_userid() {\n global $DB;\n\n // User 1 (Courses 1 and 2):\n $contextlist = $this->get_contexts_for_userid($this->users[1]->id, 'local_temporary_enrolments');\n $contexts = $contextlist->get_contextids();\n $this->assertCount(2, $contexts);\n $this->assertContains($this->course_contexts[1]->id, $contexts);\n $this->assertContains($this->course_contexts[2]->id, $contexts);\n\n // User 2 (Courses 1 and 2)::\n $contextlist = $this->get_contexts_for_userid($this->users[2]->id, 'local_temporary_enrolments');\n $contexts = $contextlist->get_contextids();\n $this->assertCount(2, $contexts);\n $this->assertContains($this->course_contexts[1]->id, $contexts);\n $this->assertContains($this->course_contexts[2]->id, $contexts);\n\n // User 3 (Course 1)::\n $contextlist = $this->get_contexts_for_userid($this->users[3]->id, 'local_temporary_enrolments');\n $contexts = $contextlist->get_contextids();\n $this->assertCount(1, $contexts);\n $this->assertContains($this->course_contexts[1]->id, $contexts);\n\n // User 4 (no courses):\n $contextlist = $this->get_contexts_for_userid($this->users[4]->id, 'local_temporary_enrolments');\n $contexts = $contextlist->get_contextids();\n $this->assertCount(0, $contexts);\n }",
"public function getUserIds();",
"public function testGetPendingUsersById()\n {\n $result = self::$accountApi->users(true, [self::$USER_GET_ID]);\n\n self::assertCount(1, $result['users']);\n self::assertValidAccountUser($result['users'][0], ['id' => self::$USER_GET_ID]);\n }",
"function verify_user_ids($user_ids) {\n global $conn;\n\n $int_user_ids = array_map('intval', $user_ids);\n $user_ids_string = implode(\",\", $int_user_ids);\n\n $query = <<<SQL\nSELECT id FROM users WHERE id IN ({$user_ids_string})\nSQL;\n $result = $conn->query($query);\n $verified_user_ids = array();\n while ($row = $result->fetch_assoc()) {\n $verified_user_ids[] = (int)$row['id'];\n }\n return $verified_user_ids;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retorna a data de vencimento | public function getDataVencimento()
{
return $this->dataVencimento;
} | [
"public function getDataVencimento () {\n return $this->oDataVencimento; \n }",
"function getDataVencimentoRecibo()\n {\n return $this->dtVencRecibo;\n }",
"public function GetVolRetardataire()\n {\n $req = $this->select()->setIntegrityCheck(false)\n ->from($this->_name)\n ->where('dateHeureArriveeEffectiveVol > dateHeureArriveePrevueVol')\n ;\n return $this->fetchAll($req)->toArray();\n }",
"public function getDataVacinacao()\n {\n return $this->dataVacinacao;\n }",
"public function getDataOperacao() {\n return $this->oDataVencimento; \n }",
"public function getVencimento()\n {\n return $this->vencimento;\n }",
"public function getVetor(){\n\t\t\n\t\tforeach($this->data as $ch=>$vl){\n\t\t\t$objVetor[$ch] = $vl;\n\t\t}\n\t\t\n\t\treturn \t$objVetor;\n\t}",
"function calcularVencimento(){\n\t\t\t$datas = new Datas();\n\t\t\t$this->setvencimento_original($this->getdata_vencimento());\n\n\t\t\t$consulta = mysql_query(\"SELECT * FROM login WHERE id = '\".$this->getid_user().\"' \");\n\t\t\t$objeto_consulta = mysql_fetch_array($consulta);\n\n\t\t\tif( $objeto_consulta['status'] == 'ativo' ) {\n\t\t\t\t$this->setdata_vencimento($datas->somarDiasUteis($this->getdata_vencimento(), $this->getprazo()));\n\t\t\t} else if( $this->getdata_vencimento() <= date(\"Y-m-d\") ) {\n\t\t\t\t$this->setdata_vencimento($datas->somarDiasUteis(date(\"Y-m-d\"), $this->getprazo()));\n\t\t\t}else {\n\t\t\t\tif( $datas->ifDiaUtil($this->getdata_vencimento()) ) {\n\t\t\t\t\t$this->setdata_vencimento($this->getdata_vencimento());\n\t\t\t\t} else {\n\t\t\t\t\t$this->setdata_vencimento($datas->somarDiasUteis($this->getdata_vencimento(),$this->getprazo()));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function getDataBaseVencimento()\n {\n return $this->data_base_vencimento;\n }",
"public function getDatiBeniServizi();",
"public function getVinculado()\r\n {\r\n return $this->vinculado;\r\n }",
"public function getVaccine(){\n \n\n\n return datatables( VacineProfile::select('vacineprofiles.id','vacineprofiles.nombre_paciente','vaccines.name as vacuna','vaccines.tipo as tipo_inmun','vacineprofiles.dosis','vaccines.dosis as dosis_totales','vacineprofiles.hospital','vacineprofiles.fec_inmun')->join('vaccines','vaccines.id','=','vacineprofiles.id_vaccine')->where('vacineprofiles.id_user',Auth::user()->id)->get())->toJson();\n }",
"public function viviendas(){\n $answer = $this->queryList(\"SELECT tipo_vivienda FROM paciente\",[]);\n return $answer;\n }",
"public function getVenta($id){\n\t\t$this->db->select(\"v.*, c.nombres, c.apellidos, c.direccion, c.telefono, u.nombres as usuNombre, u.apellidos as usuApellido, tc.nombre as tipo_comprobante\");\n\t\t $this->db->from(\"ventas v\");\n\t\t $this->db->join(\"clientes c\", \"v.cliente_id = c.id\");\n\t\t $this->db->join(\"usuarios u\", \"v.usuario_id = u.id\");\n\t\t $this->db->join(\"tipo_comprobante tc\", \"v.tipo_comprobante_id = tc.id\");\n\t\t $this->db->where(\"v.id\", $id);\n\t\t $resultado = $this->db->get();\n\t\t return $resultado->row(); \n\t}",
"public function getAll(){\n\t\t\n\t\t# Recupera as vendas de um vendedor\n\t\t$data = Vendas::getAll();\n\t\t\n\t\t# Retorna a resposta\n\t\treturn $data;\n\t\t\n\t}",
"public function getRetornoInversion(){\r\n $aColumns = array(\"\",\"t.socio\",\"t.codigos\",\"t.ubicacion\",\"t.porcentaje_ganacia\",\"t.inversion\",\"t.ingresos\",\"roi\" ); //para la ordenacion y pintado en html\r\n /*\r\n\t * Ordenando, se verifica por que columna se ordenara\r\n\t */\r\n $sOrder = \"\";\r\n for ( $i=0 ; $i<intval( $this->_iSortingCols ) ; $i++ ){\r\n if ( $this->post( \"bSortable_\".intval($this->post(\"iSortCol_\".$i)) ) == \"true\" ){\r\n $sOrder .= \" \".$aColumns[ intval( $this->post(\"iSortCol_\".$i) ) ].\" \".\r\n ($this->post(\"sSortDir_\".$i)===\"asc\" ? \"asc\" : \"desc\") .\",\";\r\n }\r\n }\r\n $sOrder = substr_replace( $sOrder, \"\", -1 );\r\n $query = \"call sp_prodConsultaROIGrid(:acceso, :idPersona, :iDisplayStart,:iDisplayLength,:sOrder,:sSearch);\";\r\n \r\n $parms = array(\r\n ':acceso' => Session::get('sys_all'),\r\n ':idPersona' => $this->_idPersona,\r\n \":iDisplayStart\" => $this->_iDisplayStart,\r\n \":iDisplayLength\" => $this->_iDisplayLength,\r\n \":sOrder\" => $sOrder,\r\n \":sSearch\" => $this->_sSearch\r\n );\r\n $data = $this->queryAll($query,$parms);\r\n return $data;\r\n }",
"function ListarVentas()\n\t{\n\t\t$sql = \"SELECT V.idventa, DATE(V.fecha_hora) as fecha, V.idcliente, P.nombre as cliente, \t\t\t\t V.idusuario, U.nombre as usuario, V.tipo_comprobante, V.serie_comprobante, \t\t\t\t\t V.num_comprobante, V.total_venta, V.impuesto, V.estado \n\t\t\t\tFROM venta V INNER JOIN persona P ON V.idcliente=P.idpersona \n\t\t\t\t\t\t\t INNER JOIN usuario U ON V.idusuario=U.idusuario\n\t\t\t\tORDER BY V.idventa desc\";\n\t\treturn EjecutarConsulta($sql);\n\t}",
"public function getDataVenda()\n {\n return $this->dataVenda;\n }",
"protected function getViewData()\n {\n $this->result = mysqli_query($this->_database, \"Select * from BestelltePizza where lower(status)= 'bestellt' OR status='im ofen' \");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
__construct Initializes geo image maps | public function __construct()
{
$this->geoImageMaps = new ArrayCollection();
} | [
"public function __construct() {\r\n $this->geoJson = array(\r\n 'type' => 'FeatureCollection',\r\n 'features' => array()\r\n );\r\n }",
"public function _construct()\n {\n $this->_init('signifymap/signifymap', 'signifymap_id');\n }",
"public function __construct($map = array())\n {\n $this->setMap($map);\n }",
"public function __construct()\r\n \t{\r\n\t\t\t$this->tileWidth = 64;\r\n\t\t\t$this->tileHeight = 64;\r\n\t\t\t$this->imageData = imagecreatefrompng('img/tileset.png');\r\n\t\t\t$this->generateTileStats();\r\n\t\t}",
"public function __construct()\n {\n $this->_creator = new OpenLayersZoom_Creator();\n }",
"public function initializeObject() {\r\n\t\t// Set default values.\r\n\t\t$this->mapOptions = $this->objectManager->create('Tx_AdGoogleMaps_MapBuilder_Options_MapOptions');\r\n\t\t$this->mapControl = $this->objectManager->create('Tx_AdGoogleMaps_MapBuilder_Options_MapControl');\r\n\t\t$this->layers = $this->objectManager->create('Tx_Extbase_Persistence_ObjectStorage');\r\n\t}",
"function __construct()\n {\n $this->fields_map = new Fields_map();\n }",
"public function createBaseMap()\n {\n // Create the image with the appropriate dimensions\n $this->image = imagecreatetruecolor( $this->width, $this->height );\n\n // Calculate the positioning information for the tiles that are going to\n // make up this map\n $startX = floor($this->centerPoint->getX( ) - ($this->width / $this->tileSize) / 2);\n $startY = floor($this->centerPoint->getY( ) - ($this->height / $this->tileSize) / 2);\n $endX = ceil($this->centerPoint->getX( ) + ($this->width / $this->tileSize) / 2);\n $endY = ceil($this->centerPoint->getY( ) + ($this->height / $this->tileSize) / 2);\n $this->offsetX = -floor(($this->centerPoint->getX( ) - floor($this->centerPoint->getX( ))) * $this->tileSize);\n $this->offsetY = -floor(($this->centerPoint->getY( ) - floor($this->centerPoint->getY( ))) * $this->tileSize);\n $this->offsetX += floor($this->width / 2);\n $this->offsetY += floor($this->height / 2);\n $this->offsetX += floor($startX - floor($this->centerPoint->getX( ))) * $this->tileSize;\n $this->offsetY += floor($startY - floor($this->centerPoint->getY( ))) * $this->tileSize;\n\n // Now start iterating through the required tiles\n for ($x = $startX; $x <= $endX; $x++) {\n\n for ($y = $startY; $y <= $endY; $y++) {\n\n // Generate the URL to the tile, which comprises the zoom, lat/lng and map type\n $url = str_replace(\n [ '{Z}', '{X}', '{Y}' ],\n [ $this->zoom, $x, $y ],\n $this->tileSrcUrl[ $this->maptype ]\n );\n\n // Fetch the tile, either from the remote source or from the cache\n $tileData = $this->fetchTile($url);\n\n if ( $tileData ) {\n $tileImage = imagecreatefromstring( $tileData );\n } else {\n $tileImage = imagecreate($this->tileSize, $this->tileSize);\n $color = imagecolorallocate($tileImage, 255, 255, 255);\n @imagestring($tileImage, 1, 127, 127, 'err', $color);\n }\n\n // Calculate the point at which to insert this tile into the image\n $destX = ( $x - $startX ) * $this->tileSize + $this->offsetX;\n $destY = ( $y - $startY ) * $this->tileSize + $this->offsetY;\n\n // Inject the tile into the map image\n imagecopy(\n $this->image,\n $tileImage,\n $destX, $destY,\n 0,\n 0,\n $this->tileSize,\n $this->tileSize // Tiles are always square, so width == height == tile size\n );\n }\n }\n }",
"public function __construct()\n {\n $this->map = array(array());\n $this->ash = new Position();\n }",
"function _initObjectMaps()\r\n\t{\r\n\t}",
"public function __construct() {\n\t\t\tparent::__construct(\n\t\t\t\t'zthemename_google_map',\n\t\t\t\tesc_html__( 'Google Map', 'zthemename' ),\n\t\t\t\tarray(\n\t\t\t\t\t'description' => esc_html__( 'Adds a google static map to your website.', 'zthemename' ),\n\t\t\t\t\t'customize_selective_refresh' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}",
"public function __construct($imageMapper){\n\t\t\t$this->imageMapper = $imageMapper;\n\t\t}",
"public function __construct()\n {\n $this->geo = new GeoIP;\n $this->geo->request();\n\n }",
"public function __construct() {\n $this->oMap = new SPLFixedArray(self::I_MAX_SINGLE_BYTE_VALUE + 1);\n $this->populateMap();\n }",
"protected function init(): void\n {\n $this->map = $this->mapService->getMap();\n $this->shooter = $this->map->getShooter();\n $this->target = $this->map->getTarget();\n }",
"public function __construct () {\n $this->coordinata = new Coordinata ( array ( 'x' => 0, 'y' => 0 ) );\n\n }",
"public function __construct()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->types = array(\n self::TYPE_DEFINED => lang('network_map_defined'),\n self::TYPE_UNKNOWN => lang('network_map_unknown')\n );\n\n $this->device_types = array(\n self::DEVICE_LAPTOP => lang('network_map_laptop'),\n self::DEVICE_DESKTOP => lang('network_map_desktop'),\n self::DEVICE_TABLET => lang('network_map_tablet'),\n self::DEVICE_MOBILE => lang('network_map_mobile'),\n self::DEVICE_NETWORK => lang('network_map_network_device'),\n self::DEVICE_PRINTER => lang('network_map_printer'),\n self::DEVICE_SERVER => lang('network_map_server'),\n self::DEVICE_MEDIA => lang('network_map_media'),\n self::DEVICE_OTHER => lang('network_map_other')\n );\n }",
"private function init() {\n add_action( 'wp', array( $this, 'initialize_map_output' ) );\n\n // filters\n add_filter( 'destination_id_for_maps', array( $this, 'filter_destination_id_for_maps') );\n }",
"public function __construct()\n {\n $this->images = new ArrayCollection();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
User can't create a project without providing a `name` field | public function a_project_require_a_name()
{
$project = factory(Project::class)->raw(['name' => '']);
$this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([
'errors' => [
'name',
],
]);
} | [
"public function testProjectSaveForbiddenNames(): void\n {\n $this->expectException(\\Exception::class);\n /** @var User $user */\n $user = User::factory()->create();\n $this->be($user);\n $project = new Project();\n $project->name = 'ESP32';\n $project->save();\n }",
"public function testProjectCreate() \n\t{\n\t\t//testing that admin user can retrieve the form for adding a project\n\t\tRoute::enableFilters();\n\t\tUserTest::adminLogin();\n\t\t$response = $this->call('GET', '/project/1/user/new');\n\t\t\n\t\t$this->assertResponseOk();\n\n\t\tSentry::logout();\n\t\t\n\t\t//tesing that a normal user can't retrieve a form for adding a project\n\t\t//and that a page displays a message as to why they can't\n\t\tUserTest::userLogin();\n\t\t$crawler = $this->client->request('GET', '/project/1/user/new');\n\t\t$message = $crawler->filter('body')->text();\n\n\t\t$this->assertFalse($this->client->getResponse()->isOk());\n\t\t$this->assertEquals(\"Access Forbidden! You do not have permissions to access this page!\", $message);\n\n\t\tSentry::logout();\n\t}",
"public function addProject()\n {\n App::loggedOnly();\n\n $value = [\n 'name' => Request::projectName()\n ];\n\n $valid = [\n 'name' => Manager::canUserAddProject(App::$userId, $value['name'])\n ];\n\n if (! failed($valid)) {\n Database::addProject(App::$userId, $value['name']);\n App::redirectIndex();\n } else {\n (new PagesController())->generalIndex(0, true, false, $value, $valid);\n }\n }",
"public function createProject() {\r\n $token = $_POST['token'];\r\n if(!isset($_POST['name'])) {\r\n throw new Exception(\"Invalid api request: not all required parameters supplied\");\r\n }\r\n\r\n $name = $_POST['name'];\r\n\r\n //create project folder\r\n $this->absolutePath($_POST['name']);\r\n $path = $this->path . $name . \"/\";\r\n mkdir($path);\r\n\r\n //get user email by token\r\n require_once(dirname(__FILE__) . \"/../auth/controller.php\");\r\n $auth = new AuthController();\r\n $email = $auth->getUserByToken($token);\r\n\r\n //check that project name is free\r\n require(__DIR__ . \"/../db.php\");\r\n $query = $connection->prepare(\"SELECT COUNT(*) FROM projects WHERE name = ?\");\r\n $query->execute(array($name));\r\n if($query->fetchColumn() != 0) {\r\n throw new Exception(\"Project name is not free\");\r\n\r\n }\r\n\r\n //create database record about the project\r\n $query = $connection->prepare(\"INSERT INTO projects (owner, name) VALUES(?, ?)\");\r\n $query->execute(array($email, $name));\r\n\r\n //create default file index.html\r\n $this->writeFile($name, 'index.html');\r\n\r\n //return project name when successful\r\n return $name;\r\n }",
"public function testCreateProjectMissingTitle()\n {\n $user = factory(User::class)->create();\n $this->be($user);\n $client = factory(Client::class)->create();\n $workspace = factory(Workspace::class)->create();\n $user['current_workspace_id'] = $workspace->id;\n\n $response = $this->call('POST', '/projects/create',\n array(\n '_token' => csrf_token(),\n 'data' => [\n 'title' => null,\n 'clientID' => $client->id,\n 'description' => 'Description for Project 1',\n 'projectedRevenue' => 10.00,\n 'projectedCost' => 8.00,\n 'projectedTime' => 10,\n 'private' => 0,\n 'startDate' => '2017-06-01 00:00:00',\n 'endDate' => '2017-06-05 00:00:00',\n ]\n ));\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertDatabaseMissing('projects', [\n 'description' => 'Description for Project 1',\n ]);\n\n $data = json_decode($response->getContent(), true);\n $this->assertEquals('Please enter a Project Title', $data['messages']['title']['0']);\n }",
"public function insertProject() {\n //otra manera, pero no olvidar hacer fillable en el modelo\n Project::create([\n 'city_id' => 1,\n 'company_id' => 1,\n 'user_id' => 1,\n 'name' => 'Vack project',\n 'execution_date' => '2021-04-30',\n 'is_active' => 1,\n \n ]);\n return \"Guardado\";\n }",
"public function create()\n {\n // Everybody can create projects\n return true;\n }",
"public function create_project_title()\n {\n $data = array(\n 'title' => $this->input->post('project_title'),\n 'owner_id' => $this->current_user_id,\n );\n return $this->db->insert('projects', $data);\n }",
"function testCreatingProjectWithoutAuthorizedUser()\n {\n $data = [\n 'name' => 'Project name',\n 'description' => 'Project description'\n ];\n\n $response = $this->json('POST', Config::get('apiato.api.url') . '/v1/projects',\n $data);\n\n $response->assertStatus(401);\n }",
"function lingotek_add_project($name) {\n $output = LingotekApi::instance()->request('addProject', array('projectName' => $name));\n if ($output->results == \"success\") {\n variable_set('lingotek_project', $output->id);\n return $output->id;\n }\n}",
"public function actionAddCreateProjectPerm ()\n {\n $auth = Yii::$app->authManager;\n\n $createProject = $auth->createPermission('createProject');\n $createProject->description = 'Create project';\n $auth->add($createProject);\n\n $admin = $auth->getRole('admin');\n\n $auth->addChild($admin, $createProject);\n }",
"private function createProject() {\n\n require_once('../ProjectController.php');\n $maxMembers = $this->provided['maxMembers'];\n $minMembers = $this->provided['minMembers'];\n $difficulty = $this->provided['difficulty'];\n $name = $this->provided['name'];\n $description = $this->provided['description'];\n //TODO REMOVE ONCE FETCHED\n //$tags = $this->provided['tags'];\n setcookie('userId', \"userId\", 0, \"/\");\n // TODO FIX ISSUE HERE: you have to reload the page to get the result with a cookie set\n $tags = array(new Tag(\"cool\"), new Tag(\"java\"), new Tag(\"#notphp\"));\n $project = new Project($maxMembers, $minMembers, $difficulty, $name, $description, $tags);\n foreach (ProjectController::getAllPools() as $pool) {\n if ($pool->hasID($this->provided['sessionID'])) {\n $pool->addProject($project, $tags);\n ProjectController::redirectToHomeAdmin($pool);\n }\n }\n }",
"public function test_only_the_owner_of_a_project_may_add_task() {\n\n $this->signIn();\n\n $project = factory('App\\Project')->create();\n\n\n $this->post($project->path() . '/tasks',['body' => 'test task'])->assertStatus(403);\n\n $this->assertDatabaseMissing('tasks', ['body' => 'test task']);\n\n }",
"private function createProjects(){\n $project_obj =new Project;\n $project_obj ->title =request()->title;\n $project_obj ->amount =request()->amount;\n $project_obj ->organization =request()->organization;\n $project_obj ->location =request()->location;\n $project_obj ->deadline =request()->deadline;\n $project_obj ->head_of_project =request()->head_of_project;\n $project_obj ->created_by =Auth::user()->id;\n $project_obj ->save();\n return redirect()->back()->with('msg', 'You have successfully created project');\n }",
"public function _project_create()\n\t{\n\t\tEmail_Controller::send_mail('Project Created - ID:'.Event::$data['project']->id.', '.Event::$data['project']->name,\n\t\t View::factory('emails/project_create')->set(array('project' => Event::$data['project'])),\n\t\t 'project_create');\n\t}",
"public function testCreateProject()\n {\n }",
"public function createProject(Project $project)\n {\n }",
"function addproj($db, $name) {\n\t$stmt = $db->prepare('INSERT INTO projects (name) VALUES (?)');\n\t$stmt->bind_param('s', $name);\n\tif (!$stmt->execute()) {\n\t\tif ($db->errno === 1062 /* ER_DUP_ENTRY */)\n\t\t\techo(\"<h2>Project name $name already exists</h2>\");\n\t\telse\n\t\t\techo('<h2>Unspecified error adding project</h2>');\n\t}\n\telse {\n\t\techo(\"<h3>Successfully added project $name</h3>\");\n\t}\n\t$stmt->close();\n}",
"public function newProjectAction()\n\t\t{\n\n\t\t\tif(!empty($_POST))\n\t\t\t{\n\t\t\t\t$project=new Projects($_POST);\n\n\t\t\t\t$user=Auth::getUser();\n\n\t\t\t\tif($project->save($user->id))\n\t\t\t\t{\n\t\t\t\t\t$id=$project->returnLastID()[0];\n\n\t\t\t\t\tforeach($project->tasks as $task)\n\t\t\t\t\t{\n\t\t\t\t\t\tTasks::save($task, $id);\n\t\t\t\t\t}\n\n\t\t\t\t\tImages::save($project->imagepath, $id);\n\t\t\t\t}\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for api with bad request params | public function cestBadParams(\FunctionalTester $I)
{
/**
* @todo IMPLEMENT THIS
*/
$I->amOnPage([
'base/api',
'users' => [ ],
'platforms' => [ ]
]);
$I->seeResponseCodeIs(400);
} | [
"public function test_invalid_api_response() {\n\t\t$this->setExpectedException('Exception', \\Paddle\\Api::ERR_202, 202);\n\t\t$this->set_private_field($this->api, 'base_url', '');\n\t\t$this->set_private_field($this->api, 'api_version', '');\n\t\t$this->call_private_method($this->api, 'http_call', array('http://example.com', 'GET'));\n\t}",
"public function testInvalidRequest()\n {\n $response = $this->http->request('POST', 'canary.php', ['http_errors' => false]);\n $this->assertEquals($response->getStatusCode(), 400);\n\n $response = $this->http->request('POST', 'canary.php', ['http_errors' => false, 'form_params' => [ 'id' => '000000' ]]);\n $this->assertEquals($response->getStatusCode(), 400);\n\n $response = $this->http->request('POST', 'canary.php', ['http_errors' => false, 'form_params' => [ 'action' => 'off' ]]);\n $this->assertEquals($response->getStatusCode(), 400);\n\n $response = $this->http->request('POST', 'canary.php', ['http_errors' => false, 'form_params' => [ 'action' => 'nil', 'id' => '000000' ]]);\n $this->assertEquals($response->getStatusCode(), 400);\n }",
"public function testEndpointTravelOrHPYieldsErrorIfInvalidQueryGiven()\n {\n $response = $this->json('GET', '/api/xp/travel?base=j');\n $response->assertStatus(422);\n $response = $this->json('GET', '/api/xp/hp?base=-18');\n $response->assertStatus(422);\n $response = $this->json('GET', '/api/xp/hp?mod=1.5');\n $response->assertStatus(422);\n }",
"public function garbage_in_params_test()\n {\n $url = '/api/v1?method=rates¤cy=eoifaihawifawofw';\n $response = $this->withHeader('Authorization', 'Bearer ' . env('API_TOKEN'))->get($url);\n $response->assertStatus(400);\n }",
"public function test_if_no_input_fails_validation()\n {\n $response = $this->postJson(self::API_PATH, []);\n $response->assertStatus(422); \n\n $response = $this->postJson(self::API_PATH);\n $response->assertStatus(422); \n }",
"public function testGetIncompleteParameter() {\n $data = array('userId'=>null);\n $result = getApi('getUser.php', $data);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n\n $data = array('userId'=>'');\n $result = getApi('getUser.php', $data);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n }",
"public function testEndpointYieldsErrorIfInvalidQueryGiven()\n {\n $response = $this->get('/api/roll?q=Invalid');\n $response->assertStatus(422);\n }",
"public function testGetIncompleteParameter() {\n $data = array('tripId'=>null);\n $result = getApi('getTrip.php', $data);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n\n $data = array('tripId'=>'');\n $result = getApi('getTrip.php', $data);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n }",
"public function testFetchOrderInvalidRequestParameter()\n {\n echo \"\\n <<<<<< Fetch Order Invalid request parameters>>>>>> \\n\";\n \n $requestParams = [\n \"limit\" => 10,\n \"page\" => 0\n ];\n\n $this->json('GET', '/orders', $requestParams)->assertJsonStructure([\n 'errors' => [\n 'page',\n ]]);\n }",
"function testAPIInputFailure()\n {\n $data = array(\"Foo_bad_input\" => array(5,\"abs\",8,7,5));\n\n try\n {\n $output = $this->api->invokeMethod(array($this->mmmr,'MMMRapi'), $data);\n }\n catch(Exception $e)\n {\n $this->assertEquals($e->getMessage(), \"Invalid Input.\");\n return;\n }\n $this->fail('Exception not thrown.');\n\n }",
"public function testNonExistingParameter()\n {\n $client = static::createClient();\n\n $client->request('GET', '/fake/parameter_non_existent');\n }",
"public function testRequestParamsUnexpectedValueException(): void\n {\n $this->_markTestAsRestOnly();\n $expectedMessage = \"Internal Error. Details are available in Magento log file. Report ID: webapi-\";\n $unexpectedMessage = \"\\\"%fieldName\\\" is required. Enter and try again.\";\n\n $serviceInfo = [\n 'rest' => [\n 'resourcePath' => '/V1/testmodule1/withParam',\n 'httpMethod' => Request::HTTP_METHOD_PUT,\n ],\n ];\n\n try {\n $this->_webApiCall($serviceInfo);\n } catch (\\Exception $e) {\n $exceptionResult = $this->processRestExceptionResult($e);\n $actualMessage = $exceptionResult['message'];\n $this->assertStringNotContainsString($unexpectedMessage, $actualMessage);\n $this->assertStringContainsString($expectedMessage, $actualMessage);\n }\n }",
"function die_invalid_param($param_name)\n{\n request_failed(\"Invalid param value\");\n}",
"public function testEndpointManeuverYieldsErrorIfInvalidQueryGiven()\n {\n $response = $this->json('GET', '/api/xp/maneuver?man=j');\n $response->assertStatus(422);\n $response = $this->json('GET', '/api/xp/maneuver?man=mfa');\n $response->assertStatus(422);\n $response = $this->json('GET', '/api/xp/maneuver?man=mf&mod=t');\n $response->assertStatus(422);\n $response = $this->json('GET', '/api/xp/maneuver?man=mf&mod=-20');\n $response->assertStatus(422);\n $response = $this->json('GET', '/api/xp/maneuver?mod=2');\n $response->assertStatus(422);\n }",
"public function testAddBadParams()\n {\n $client = static::createClient();\n\n $params = array(\n 'description' => '',\n 'source' => '',\n 'is_visible' => '',\n 'date' => '',\n 'media_url' => '',\n );\n \n $client->request('POST', '/api/add_content.json', $params);\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertTrue($client->getResponse()->headers->contains('Content-Type', 'application/json'));\n $this->assertRegExp('/error/', $client->getResponse()->getContent());\n }",
"public function testGetIncompleteParameter() {\n $data = array('commentId'=>null);\n $result = getApi('getComment.php', $data);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n\n $data = array('commentId'=>'');\n $result = getApi('getComment.php', $data);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n }",
"public function testGetIncompleteParameter() {\n $data = array('mediaId'=>null);\n $result = getApi('getMedia.php', $data);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n\n $data = array('mediaId'=>'');\n $result = getApi('getMedia.php', $data);\n $this->assertEquals(RESPONSE_BAD_REQUEST, $result['resultCode']);\n }",
"public function testRequestValidationWithInvalidData(): void\n {\n $repository = new GitlabRepository();\n $request = new Request();\n\n $this->expectExceptionCode(419);\n $this->expectExceptionMessage(\"Invalid request.\");\n $repository->parseRequest($request);\n }",
"public function testPostTaskInvalidParameter()\n {\n $todo = factory(\\App\\Todo::class)->make(['done' => 'test']);\n\n $this->post('/api/todo', $todo->toArray())->seeStatusCode('422');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set isExpected attribute of the aswer | public function setIsExpected($isExpected)
{
$this->isExpected = $isExpected;
} | [
"public function setFailed()\n {\n $this->passed = false;\n }",
"public function testSetAssurance() {\n\n $obj = new Clients();\n\n $obj->setAssurance(true);\n $this->assertEquals(true, $obj->getAssurance());\n }",
"public function setFlag() {\n $this->attributes['test_flag'] = TRUE;\n }",
"public function testSetNonRepris() {\n\n $obj = new AttestationAt();\n\n $obj->setNonRepris(true);\n $this->assertEquals(true, $obj->getNonRepris());\n }",
"public function typeCanBeSetTest() {\n\t\t$type = 0;\n\t\t$this->fixture->setType($type);\n\t\t$this->assertEquals($type, $this->fixture->getType());\n\t}",
"public function testSetUrgent() {\n\n $obj = new AppelsEnCours();\n\n $obj->setUrgent(true);\n $this->assertEquals(true, $obj->getUrgent());\n }",
"public function testSetAttrib()\n {\n $this->todo('stub');\n }",
"public function setExpectedValue($value)\n {\n $this->_expectedValue = $value;\n }",
"public function testGetExpectedAttribute()\n {\n // check one value\n $value = 'value';\n $attributes = array(\n 'attribute' => array($value),\n );\n $expected = 'attribute';\n $this->assertEquals($value, Attributes::getExpectedAttribute($attributes, $expected));\n\n // check multiple (allowed) values\n $value = 'value';\n $attributes = array(\n 'attribute' => array($value, 'value2', 'value3'),\n );\n $expected = 'attribute';\n $this->assertEquals($value, Attributes::getExpectedAttribute($attributes, $expected, true));\n }",
"static function shouldFail() {\r\n self::$shouldFail = true;\r\n }",
"public function testSetState()\n {\n $this->expectException('Exception');\n SpecialAddressBlock::__set_state(['invalid_field' => 'invalid value']);\n }",
"public function setWasAttacked() {\n $this->wasAttacked = true;\n }",
"public function testConstructHasCorrectProperty(): void\n {\n $this->assertAttributeSame($this->propertyManipulator, 'propertyManipulator', $this->anonymizer);\n }",
"public function testSetIntervention()\n {\n $expected = 'intervention';\n\n self::assertEquals($this->criticity, $this->criticity->setIntervention($expected));\n self::assertEquals($expected, $this->criticity->getIntervention());\n }",
"public function testReason()\n {\n $expected = $actual = 'reason';\n\n self::assertEquals($this->ip, $this->ip->setReason($actual));\n self::assertEquals($expected, $this->ip->getReason());\n }",
"public function testSetAffectationTaux27() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setAffectationTaux27(true);\n $this->assertEquals(true, $obj->getAffectationTaux27());\n }",
"public function testSetInvalid()\n\t{\n\t\t$data = new OLPBlackbox_Data();\n\n\t\t$rules = $this->getMock('Blackbox_StandardRule', array('isValid', 'runRule'));\n\t\t$rules->expects($this->once())->method('isValid')->will($this->returnValue(TRUE));\n\n\t\t// Test that we actually were TRUE the first run\n\t\t$this->target->setRules($rules);\n\t\t$valid = $this->target->isValid($data, $this->state_data);\n\t\t$this->assertTrue($valid);\n\n\t\t// Set this target to invalid and test that we get FALSE back now\n\t\t$this->target->setInvalid();\n\t\t$valid = $this->target->isValid($data, $this->state_data);\n\t\t$this->assertFalse($valid);\n\t}",
"public function testSetAnnulationTache() {\n\n $obj = new Collaborateurs();\n\n $obj->setAnnulationTache(true);\n $this->assertEquals(true, $obj->getAnnulationTache());\n }",
"public function testManualSettle()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a qualification is attached to this course | public function isQualificationOnCourse($qualID){
$this->getCourseQualifications(false, true);
return (array_key_exists($qualID, $this->quals));
} | [
"public function has_project_for_student($qualID)\n\t{\n\t\t//TODO THIS DOES NOT TAKE INTO CONSIDERATION GROUPS!!!\n\t\tglobal $CFG;\n\t\t$studentID = $this->studentID;\n\t\t//find the quals that the student has access to \n\t\t//is one of them this qual?\n\t\t//if so, does it have a project for this unit?\n\t\t\n\t\t//find all projects on this unit for the qualID\n\t\t//the projects are on courses\n\t\t//does the student have access to this course?\t\n\t\t$sqlSelect = \"SELECT * FROM {block_bcgt_activity_refs} activityrefs\n JOIN on the course module. \n WHERE activityrefs.bcgtunitid = ? AND activityrefs.bcgtqualificationid = ?\";\n \n \n \n \n \n\t\t$sqlFrom = \" FROM {$CFG->prefix}tracking_assignment_selection AS asssel\";\n\t\t$sqlAssignmentTurn = \" JOIN {$CFG->prefix}turnitintool AS turnitin ON turnitin.id = asssel.assignmentid \n\t\tJOIN {$CFG->prefix}course AS course ON course.id = turnitin.course\";\n\t\t$sqlAssignment = \" JOIN {$CFG->prefix}assignment AS assignment ON assignment.id = asssel.assignmentid \n\t\tJOIN {$CFG->prefix}course AS course ON course.id = assignment.course\";\n\t\t$sqlJoin = \" JOIN {$CFG->prefix}context AS context ON context.instanceid = course.id\n\t\tJOIN {$CFG->prefix}role_assignments AS role_ass ON role_ass.contextid = context.id \n\t\tJOIN {$CFG->prefix}role AS role ON role.id = role_ass.roleid\";\n\t\t$sqlWhere = \" WHERE trackingunitid = $this->id AND trackingqualificationid = $qualID \n\t\tAND context.contextlevel = 50 AND role.name = 'Student' AND role_ass.userid = $this->studentID\";\n\t\t$sqlUnion = \" UNION \";\n\t\t$sql = $sqlSelect.$sqlFrom.$sqlAssignmentTurn.$sqlJoin.$sqlWhere.$sqlUnion.$sqlSelect.$sqlFrom.$sqlAssignment.$sqlJoin.$sqlWhere;\n\t\t$records = get_records_sql($sql);\n\t\tif($records)\n\t\t{\n\t\t\treturn true;\t\n\t\t}\n\t\treturn false;\n\t}",
"public function isAssessmentExists() {\n\t\t\tif ($this->as_refid) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function hasGradeInquiry() {\n return $this->grade_inquiries !== null && count($this->grade_inquiries) > 0;\n }",
"public function hasSubjectAttendance()\n {\n return in_array('Por materia', $this->getAttendanceTypeChoices());\n\n }",
"public function hasCorrelatives()\n {\n return count($this->getCorrelativeCareerSubjects()) > 0;\n }",
"function CourseExists(){\n\t}",
"function isComplete()\n\t{\n\t\tif (($this->getTitle()) and (count($this->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function course_exists() {\n return ($this->id !== null);\n }",
"public function anyActiveGradeInquiries() {\n return $this->active_grade_inquiries_count > 0 && $this->core->getUser()->getGroup() < User::GROUP_STUDENT;\n }",
"public function checkExistedTrialCourse()\n\t{\n\t\t$trialCourse = Course::model()->findByAttributes(array('type'=>0, 'deleted_flag'=>0));\n\t\tif(isset($trialCourse->id)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function isInstituteAcquired( $instInquiryId );",
"public function getQualification()\n {\n return $this->qualification;\n }",
"private function is_prereq( $course1, $course2 )\n {\n $prereqs = $this->file_info->prereq_list;\n if( isset( $prereqs[$course1] ) )\n if( in_array( $course2, $prereqs[$course1] ) )\n return true;\n\n if( isset( $prereqs[$course2] ) )\n if( in_array( $course1, $prereqs[$course2] ) )\n return true;\n\n return false;\n\n }",
"function learn_press_is_course_taxonomy() {\r\n\t\treturn is_tax( get_object_taxonomies( LP()->course_post_type ) );\r\n\t}",
"public function has_asset_assignments() {\n\t\t$assignment = AssetAssignment::get_instance();\n\t\treturn in_array( $this->id, array( $assignment->image, $assignment->chapters ) );\n\t}",
"abstract function update_qualification();",
"public function isQualified(): bool\n {\n return $this->form == self::QUALIFIED;\n }",
"private function isCourseAvailable() {\n return $this->getCurrentContext()->isCurrentCourseAvailable();\n }",
"public function is_require_enrollment() {\r\n\t\t$is_require = $this->course_enrolled_require;\r\n\t\t$is_require = empty( $is_require ) || ( $is_require == 'yes' ) ? true : false;\r\n\t\treturn apply_filters( 'learn_press_is_require_enrollment', $is_require, $this );\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
testMerchantEqBrandIsMerchant Starting from an empty db import one fixtured feed item This is an approved brand that with same values from brand and merchant whitelisted as a merchant | public function testMerchantEqBrandIsMerchant()
{
$fid = 'fixionalprovider-levi-502';
$this->step1->testProcessItem($fid);
$this->command->testProcessItem($fid);
$item = $this->repos['item']->findOneBy(array('feedId' => $fid));
$brand = $this->repos['brand']->findOneBy(array());
$this->assertNull($brand);
$merchant = $this->repos['merchant']->findOneBy(array());
$this->assertSame('Levi.com', $merchant->getName());
$board = $this->repos['board']->findOneBy(array(
'createdBy.$id' => new \MongoId($merchant->getId()),
'name' => 'Bottoms'
));
$this->assertNotNull($board);
$this->assertSame('Bottoms', $board->getCategory()->getName());
$post = $this->repos['post']->createQueryBuilder()
->field('board')->references($board)
->field('createdBy')->references($merchant)
->field('target')->references($item)
->getQuery()->execute()->getSingleResult();
$this->assertNotNull($post);
$this->assertSame('Bottoms', $post->getCategory()->getName());
$this->assertSame($fid, $post->getTarget()->getFeedId());
$this->assertSame('merchant', $post->getUserType());
//test rootPost for Item
$this->assertNotNull($item->getRootPost());
$this->assertSame($item->getRootPost()->getId(), $post->getId());
} | [
"public function testMerchantEqBrand()\n {\n $this->command->testProcessItem('fixionalprovider-levi-502');\n\n $this->assertSame(1, $this->repos['item']->findBy(array())->count());\n $this->assertNotNull($this->repos['item']->findOneBy(array('feedId' => 'fixionalprovider-levi-502')));\n\n $this->assertSame(1, $this->repos['user']->findBy(array())->count());\n $this->assertSame(1, $this->repos['merchant']->findBy(array())->count());\n $this->assertNotNull($this->repos['merchant']->findOneBy(array('name' => 'Levi.com')));\n $this->assertSame(0, $this->repos['brand']->findBy(array())->count());\n }",
"public function testMerchantNotOnWhitelist()\n {\n $this->command->testProcessItem('brand-good-merchant-bad');\n\n $this->assertSame(1, $this->repos['item']->findBy(array())->count());\n $this->assertNotNull($this->repos['item']->findOneBy(array('feedId' => 'brand-good-merchant-bad')));\n\n $this->assertSame(1, $this->repos['user']->findBy(array())->count());\n $this->assertSame(0, $this->repos['merchant']->findBy(array())->count());\n $this->assertSame(1, $this->repos['brand']->findBy(array())->count());\n $this->assertNotNull($this->repos['brand']->findOneBy(array('name' => 'Thompson')));\n }",
"public function _importFeedWithOneBrand($file) {\n \n $start = microtime(true);\n $brandResults = array();\n $productResults = array();\n $productsDeleted = 0;\n $filePath = $this->_path . $this->folder . DS . $file;\n $updatedProductIds = array();\n\n if ($this->_fileExist($filePath) === false) {\n $this->_addError('File does not exist: ' . $filePath);\n return false;\n }\n\n $shopId = $this->getShopId($this->_feedName, $this->_countryCode, $this->_networkName, false);\n $oldProductIds = $this->getOldProductIds($shopId);\n \n // Get data from CSV\n $data = $this->_csvArrayToCakeArray($this->_csvToArray($filePath), $this->CSVfieldSeparator);\n \n if (count($data)) {\n // Create/Update brand\n $brandResults = $this->_createUpdateBrand($data[0]['Brand']['name'], $data[0]['Brand']['logo_url'], $this->_countryCode);\n $brandId = $brandResults['brandId'];\n\n // Create/Update prpducts\n $productResults = $this->_createUpdateProducts($data, $brandId, $shopId);\n\n if ($productResults === false) {\n return false;\n }\n \n // Save update products Ids.\n $updatedProductIds = $updatedProductIds + $productResults['updatedProductIds'];\n }\n \n // Remove products which don't belong the feed anymore.\n $removedProductIds = array_diff($oldProductIds, $updatedProductIds);\n\n if (!empty($removedProductIds)) {\n $productsDeleted = $this->removeOldProducts($removedProductIds);\n }\n\n\n $response = array(\n 'shop_name' => $this->_feedName,\n 'network_name' => $this->_networkName,\n 'country_code' => $this->_countryCode,\n 'import_date' => date('Y-m-d H:i:s'),\n 'brands_added' => $brandResults['addedBrands'],\n 'brands_updated' => $brandResults['updatedBrands'],\n 'products_added' => $productResults['addedProducts'],\n 'products_updated' => $productResults['updatedProducts'],\n 'products_deleted' => $productsDeleted,\n 'elapsed_time_in_s' => microtime(true) - $start\n );\n\n $this->_saveImport($response);\n\n return $response;\n }",
"function test_addBrand_duplicate()\n {\n $store_name = \"Nordstorm\";\n $test_store = new Store($store_name);\n $test_store->save();\n\n $brand_name = 'Nike';\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n $test_store->addBrand($test_brand);\n $test_store->addBrand($test_brand);\n $result = $test_store->getBrands();\n\n $this->assertEquals([$test_brand], $result);\n }",
"function test_addBrand()\n {\n $store_name = \"Nordstorm\";\n $test_store = new Store($store_name);\n $test_store->save();\n\n $brand_name = 'Nike';\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n $test_store->addBrand($test_brand);\n\n $result = $test_store->getBrands();\n\n $this->assertEquals([$test_brand], $result);\n }",
"public function testGetTenDLCSmsBrand()\n {\n $config = Configuration::getDefaultConfiguration()\n ->setHost('http://127.0.0.1:4010')\n ->setUsername('YOUR_ACCOUNT_ID')\n ->setPassword('YOUR_API_KEY');\n\n\n $apiInstance = new DefaultApi(\n new Client(),\n $config\n );\n\n //$account_id = $account_id_test_value;\n //$brand_id = $brand_id_test_value;\n \n $response = $apiInstance->getTenDLCSmsBrand($this->brand_id_getTenDLCSmsBrand_test_value());\n \n \n $this->assertInstanceOf('\\FreeClimb\\Api\\Model\\SMSTenDLCBrand',$response);\n }",
"public function test_getDuplicateItemBuyerById() {\n\n }",
"public function testItemCreateWithoutBrandId()\n {\n $this->expectExceptionMessage('A brand id is required to save item');\n\n $data = [\n 'status' => Item::STATUS_DRAFT,\n 'part_number' => str_random(12),\n 'brand_id' => str_random(4)\n ];\n\n $item = new Item();\n $item->status = $data['status'];\n $item->part_number = $data['part_number'];\n $item->save();\n }",
"public function testAddRelationsByBrand() {\n // Create\n $ph_brand = $this->phactory->create( 'brands' );\n $ph_product = $this->phactory->create( 'products' );\n $ph_website_product = $this->phactory->create( 'website_products' );\n $ph_coupon = $this->phactory->create( 'website_coupons' );\n\n // Run\n $this->website_coupon->add_relations_by_brand( $ph_coupon->website_coupon_id, self::WEBSITE_ID, self::BRAND_ID );\n\n // Get\n $coupons = $this->website_coupon->get_by_product( self::WEBSITE_ID, self::PRODUCT_ID );\n\n // Test\n $this->assertEquals( key( $coupons ), $ph_coupon->website_coupon_id );\n }",
"public function testResourceBrand()\r\n {\r\n $brand = $this->resource->getBrands();\r\n $brand = array_pop($brand);\r\n \r\n $this->assertEquals('NO', $brand->getBrandCode());\r\n $this->assertEquals('Norfolk Country Cottages', $brand->getName());\r\n $this->assertEquals('Market Place, Reepham', $brand->getAddress());\r\n $this->assertEquals('http://www.norfolkcottages.co.uk', $brand->getWebsite());\r\n $this->assertEquals('info@norfolkcottages.co.uk', $brand->getEmail());\r\n $this->assertEquals('01603 876200', $brand->getTelephone());\r\n $this->assertEquals('norfolkcottages', $brand->getVendorName());\r\n $this->assertEquals('norfolkcottages', $brand->getSagepayVendorName());\r\n $this->assertEquals(400, $brand->getNumberOfProperties());\r\n }",
"public function testBrandShow()\n {\n $brand = Brand::query()->inRandomOrder()->first();\n\n $this->get(route('api.brands.show', $brand))\n ->assertSuccessful()\n ->assertJson($brand->toArray());\n }",
"private function importBestBuy()\n {\n// $best_buy_tmp = BestBuyImport::where('effectiveDate', 'cast(getDate() as Date')->get();\n $best_buy_tmp = BestBuyImport::get();\n\n if ($best_buy_tmp->count()) {\n $best_buy = BestBuy::truncate();\n foreach ($best_buy_tmp as $row) {\n $best_buy = new BestBuy();\n $best_buy->station_inner_id = $row->stationID;\n $best_buy->name = $this->trim($row->name);\n $best_buy->rank_id = $row->rankID;\n $best_buy->terminal_inner_id = $row->terminalID;\n $best_buy->alternate_terminal_name = $this->trim($row->AlternateTerminalName);\n $best_buy->supplier_id = $row->supplierID;\n $best_buy->alternate_supplier_name = $this->trim($row->AlternateSupplierName);\n $best_buy->carrier_id = $row->carrierID;\n $best_buy->effective_price = $row->effectivePrice;\n $best_buy->supplier_discount = $row->supplierDiscount;\n $best_buy->supplier_ec = $row->supplierEC;\n $best_buy->net_cost = $row->netCost;\n $best_buy->carrier_gas_freight = $row->carrierGasFreight;\n $best_buy->effective_date = $row->effectiveDate;\n $best_buy->effective_time = $row->effectiveTime;\n $best_buy->carrier_alternate_name = $this->trim($row->carrierAlternateName);\n $best_buy->direct_link = $row->directLink;\n $best_buy->fuel_tax = $row->fuelTax;\n $best_buy->product_grade_name = $this->trim($row->productGradeName);\n $best_buy->product_grade_id = $row->productGradeID;\n $best_buy->grade_enforced = $this->trim($row->gradeEnforced);\n $best_buy->epa_schedule_name = $this->trim($row->epaScheduleName);\n $best_buy->epa_date_begin = $row->epaDateBegin;\n $best_buy->epa_date_end = $row->epaDateEnd;\n $best_buy->epa_district_name = $this->trim($row->epaDistrictName);\n $best_buy->product_order = $row->productOrder;\n $best_buy->product_code = $this->trim($row->ProductCode);\n $best_buy->product_alternate_name = $this->trim($row->productAlternateName);\n $best_buy->carrier_surcharge_amt = $row->carrierSurchargeAmt;\n $best_buy->ust_fee = $row->ustFee;\n $best_buy->save();\n }\n }\n }",
"public function hasBrand() : bool;",
"public function runAdminBrandSyncWithSupplier()\r\n {\r\n $success = true;\r\n $suppliersToCreate = [];\r\n $brands = $this->getBrandCollection();\r\n if ($brands->getData() || !empty($brands->getData())) {\r\n foreach ($brands as $brand) {\r\n $brandName = trim($brand->getName());\r\n if (!in_array(strtolower($brandName), $this->skuVaultSuppliers)) {\r\n $suppliersToCreate[] = $brandName;\r\n }\r\n }\r\n $suppliersToCreate = array_filter($suppliersToCreate);\r\n $suppliersToCreate = array_unique($suppliersToCreate);\r\n if (!empty($suppliersToCreate)) {\r\n $response = $this->createSuppliers($suppliersToCreate);\r\n $response = Zend_Http_Response::extractBody($response);\r\n if (!is_null($response)) {\r\n $response = json_decode($response, true);\r\n $responseErrors = $response['Errors'];\r\n if (!empty($responseErrors)) {\r\n $this->handleErrors($responseErrors);\r\n $success = false;\r\n }\r\n }\r\n }\r\n }\r\n return $success;\r\n }",
"public function Activate_inactivate_brand()\n{\n\t\n\t$postdata = array();\n\t$postdata = json_decode(file_get_contents('php://input'),TRUE);\n\t$postdata = $this->striptags($postdata);\n\t$cond= array();\n\t$table=\"brands\";\n\t\n\t$setdata = array();\n\t\n\tif($postdata['Status']==\"Active\")\n\t{\n\t\t$setdata['Status']\t\t= 'Inactive';\n\t}\n\telseif($postdata['Status']==\"Inactive\")\n\t{\n\t\t$setdata['Status']\t\t= 'Active';\n\t}\n\t\n\t$setdata['LastUpdated']\t= time();\n\t$cond['BrandId']\t\t= $postdata['BrandId'];\n\t\n\tif(\t$this->Commonmodel->updatedata($table,$setdata,$cond) )\n\t{\t\n\t\techo \"1\";\n\t}\n\telse\n\t\techo \"0\";\n\t\t\n\t\n}",
"public function hasBrand(): bool;",
"function pcfme_verify_envato_purchase_code() {\n\t\n\t $extra_settings = get_option('pcfme_extra_settings');\n $purchase_code = $extra_settings['purchase_code'];\n $rand_keys = array(\"jp9ejo07ow5bfuz7wf02g208okrs63fc\", \"wq65342y3horxhksyvvxd92d610on095\", \"lp3hvd45yzlfexlsghh9exv0w1m4q8uj\", \"bd4qfswnv2p190773z5z2pv4dgfok4h4\", \"pig58dtwc3e3bpvo49m0gou2ig3xqkwa\");\n $api_key = $rand_keys[array_rand($rand_keys, 1)];\n $user_name = 'phppoet';\n $item_id = 9799777;\n \n\t\t\n \t$ch = curl_init();\n\n // Set cURL options\n curl_setopt($ch, CURLOPT_URL, \"http://marketplace.envato.com/api/edge/$user_name/$api_key/verify-purchase:$purchase_code.json\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, 'ENVATO-PURCHASE-VERIFY'); //api requires any user agent to be set\n\n \n $result = json_decode( curl_exec($ch) , true );\n \n \n if ( !empty($result['verify-purchase']['item_id']) && $result['verify-purchase']['item_id'] ) {\n \n if ( !$item_id ) return true;\n \n if ($result['verify-purchase']['item_id'] == $item_id) {\n\t\t\t\tupdate_option( 'pcfme_activation_status', \"active\" );\n\t\t\t} else {\n\t\t\t\tupdate_option( 'pcfme_activation_status', \"inactive\" );\n\t\t\t}\n } else {\n\t\t\tupdate_option( 'pcfme_activation_status', \"inactive\" );\n\t\t}\n\n}",
"function test_addStore_duplicate()\n {\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n $store_name = 'Nordstorm';\n $test_store = new Store($store_name);\n $test_store->save();\n\n $test_brand->addStore($test_store);\n $test_brand->addStore($test_store);\n\n $result = $test_brand->getStores();\n\n $this->assertEquals([$test_store], $result);\n }",
"public static function brandSearch($brands) {\n\t\t\tassertArray($brands);\n\t\t\t$packages = array();\n\t\t\tif ($brands) {\n\t\t\t\t$search = array();\n\t\t\t\tforeach ($brands as $index => $brand) {\n\t\t\t\t\t$brand = clean($brand, 'name');\n\t\t\t\t\tif ($brand) {\n\t\t\t\t\t\t$brandSearch .= \"'\".prep($brand).\"', \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($brandSearch) {\n\t\t\t\t\t$brandSearch = substr($brandSearch, 0, -2);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($brandSearch) {\n\t\t\t\t$dbh = database::getInstance();\n\t\t\t\t$sql = \"SELECT `a`.* FROM `packages` `a` JOIN `packageSiteMap` `b` USING (`packageID`) WHERE `b`.`siteID` = '\".systemSettings::get('SITEID').\"' AND `a`.`availability` IN ('available', 'alwaysavailable') AND `a`.`brand` IN (\".$brandSearch.\")\";\n\t\t\t\t$result = $dbh->query($sql);\n\t\t\t\tif ($result->rowCount) {\n\t\t\t\t\t// assign a match value according to the number of matches in each package\n\t\t\t\t\twhile ($row = $result->fetchRow()) {\n\t\t\t\t\t\t$packages[$row['packageID']] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t$found = array_keys($packages);\n\t\t\t\t\t// do not display products from members with inactive payment gateways\n\t\t\t\t\t$sql = \"SELECT `a`.`packageID` FROM `packages` `a` JOIN `packageSiteMap` `b` ON (`a`.`packageID` = `b`.`packageID`) JOIN `productToPackage` `c` ON (`a`.`packageID` = `c`.`packageID`) JOIN `products` `d` ON (`c`.`productID` = `d`.`productID`) LEFT JOIN `memberGatewayInfo` `e` ON (`d`.`memberID` = `e`.`memberID` AND `e`.`status` != 'active') WHERE `a`.`packageID` IN ('\".implode(\"', '\", $found).\"') AND `d`.`memberID` != 0 AND `e`.`memberGatewayInfoID` IS NOT NULL GROUP BY `a`.`packageID`\";\n\t\t\t\t\t$filter = $dbh->query($sql);\n\t\t\t\t\tif ($filter->rowCount) {\n\t\t\t\t\t\twhile ($row = $filter->fetchRow()) {\n\t\t\t\t\t\t\tunset($packages[$row['packageID']]);\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\treturn $packages;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test one() with association data. | public function testOneAssociationsMany(): void
{
$data = [
'title' => 'My title',
'body' => 'My content',
'author_id' => 1,
'comments' => [
['comment' => 'First post', 'user_id' => 2],
['comment' => 'Second post', 'user_id' => 2],
],
'user' => [
'username' => 'mark',
'password' => 'secret',
],
];
$marshall = new Marshaller($this->articles);
$result = $marshall->one($data, ['associated' => ['Comments']]);
$this->assertSame($data['title'], $result->title);
$this->assertSame($data['body'], $result->body);
$this->assertSame($data['author_id'], $result->author_id);
$this->assertIsArray($result->comments);
$this->assertCount(2, $result->comments);
$this->assertInstanceOf('Cake\ORM\Entity', $result->comments[0]);
$this->assertInstanceOf('Cake\ORM\Entity', $result->comments[1]);
$this->assertSame($data['comments'][0]['comment'], $result->comments[0]->comment);
$this->assertIsArray($result->user);
$this->assertEquals($data['user'], $result->user);
} | [
"public function testOneAssociationsSingle(): void\n {\n $data = [\n 'title' => 'My title',\n 'body' => 'My content',\n 'author_id' => 1,\n 'comments' => [\n ['comment' => 'First post', 'user_id' => 2],\n ['comment' => 'Second post', 'user_id' => 2],\n ],\n 'user' => [\n 'username' => 'mark',\n 'password' => 'secret',\n ],\n ];\n $marshall = new Marshaller($this->articles);\n $result = $marshall->one($data, ['associated' => ['Users']]);\n\n $this->assertSame($data['title'], $result->title);\n $this->assertSame($data['body'], $result->body);\n $this->assertSame($data['author_id'], $result->author_id);\n\n $this->assertIsArray($result->comments);\n $this->assertEquals($data['comments'], $result->comments);\n $this->assertTrue($result->isDirty('comments'));\n\n $this->assertInstanceOf('Cake\\ORM\\Entity', $result->user);\n $this->assertTrue($result->isDirty('user'));\n $this->assertSame($data['user']['username'], $result->user->username);\n $this->assertSame($data['user']['password'], $result->user->password);\n }",
"public function testOneToOne()\n\t{\n\t\ttestpack( 'Testing one-to-ones' );\n\n\t\t$author = R::dispense( 'author' )->setAttr( 'name', 'a' );;\n\t\t$bio = R::dispense( 'bio' )->setAttr( 'name', 'a' );\n\n\t\tR::storeAll( array( $author, $bio ) );\n\n\t\t$id1 = $author->id;\n\n\t\t$author = R::dispense( 'author' )->setAttr( 'name', 'b' );;\n\t\t$bio = R::dispense( 'bio' )->setAttr( 'name', 'b' );\n\n\t\tR::storeAll( array( $author, $bio ) );\n\n\t\t$id2 = $author->id;\n\n\t\tlist( $a, $b ) = R::loadMulti( 'author,bio', $id1 );\n\n\t\tasrt( $a->name, $b->name );\n\t\tasrt( $a->name, 'a' );\n\n\t\tlist( $a, $b ) = R::loadMulti( 'author,bio', $id2 );\n\n\t\tasrt( $a->name, $b->name );\n\t\tasrt( $a->name, 'b' );\n\n\t\tlist( $a, $b ) = R::loadMulti( array( 'author', 'bio' ), $id1 );\n\n\t\tasrt( $a->name, $b->name );\n\t\tasrt( $a->name, 'a' );\n\n\t\tlist( $a, $b ) = R::loadMulti( array( 'author', 'bio' ), $id2 );\n\n\t\tasrt( $a->name, $b->name );\n\t\tasrt( $a->name, 'b' );\n\n\t\tasrt( is_array( R::loadMulti( NULL, 1 ) ), TRUE );\n\n\t\tasrt( ( count( R::loadMulti( NULL, 1 ) ) === 0 ), TRUE );\n\t}",
"public function testOneSimple(): void\n {\n $data = [\n 'title' => 'My title',\n 'body' => 'My content',\n 'author_id' => 1,\n 'not_in_schema' => true,\n ];\n $marshall = new Marshaller($this->articles);\n $result = $marshall->one($data, []);\n\n $this->assertInstanceOf('Cake\\ORM\\Entity', $result);\n $this->assertEquals($data, $result->toArray());\n $this->assertTrue($result->isDirty(), 'Should be a dirty entity.');\n $this->assertTrue($result->isNew(), 'Should be new');\n $this->assertSame('Articles', $result->getSource());\n }",
"public function testHasOne(): void\n {\n $table = new Table(['table' => 'users']);\n $hasOne = $table->hasOne('profile', ['conditions' => ['b' => 'c']]);\n $this->assertInstanceOf(HasOne::class, $hasOne);\n $this->assertSame($hasOne, $table->getAssociation('profile'));\n $this->assertSame('profile', $hasOne->getName());\n $this->assertSame('user_id', $hasOne->getForeignKey());\n $this->assertEquals(['b' => 'c'], $hasOne->getConditions());\n $this->assertSame($table, $hasOne->getSource());\n }",
"public function testGetHasOneRelations()\n {\n $captain1 = $this->objFromFixture(DataObjectTest\\Player::class, \"captain1\");\n $team1ID = $this->idFromFixture(DataObjectTest\\Team::class, 'team1');\n\n // There will be a field called (relname)ID that contains the ID of the\n // object linked to via the has_one relation\n $this->assertEquals($team1ID, $captain1->FavouriteTeamID);\n\n // There will be a method called $obj->relname() that returns the object itself\n $this->assertEquals($team1ID, $captain1->FavouriteTeam()->ID);\n\n // Test that getNonReciprocalComponent can find has_one from the has_many end\n $this->assertEquals(\n $team1ID,\n $captain1->inferReciprocalComponent(DataObjectTest\\Team::class, 'PlayerFans')->ID\n );\n\n // Check entity with polymorphic has-one\n $fan1 = $this->objFromFixture(DataObjectTest\\Fan::class, \"fan1\");\n $this->assertTrue((bool)$fan1->hasValue('Favourite'));\n\n // There will be fields named (relname)ID and (relname)Class for polymorphic\n // entities\n $this->assertEquals($team1ID, $fan1->FavouriteID);\n $this->assertEquals(DataObjectTest\\Team::class, $fan1->FavouriteClass);\n\n // There will be a method called $obj->relname() that returns the object itself\n $favourite = $fan1->Favourite();\n $this->assertEquals($team1ID, $favourite->ID);\n $this->assertInstanceOf(DataObjectTest\\Team::class, $favourite);\n\n // check behaviour of dbObject with polymorphic relations\n $favouriteDBObject = $fan1->dbObject('Favourite');\n $favouriteValue = $favouriteDBObject->getValue();\n $this->assertInstanceOf(DBPolymorphicForeignKey::class, $favouriteDBObject);\n $this->assertEquals($favourite->ID, $favouriteValue->ID);\n $this->assertEquals($favourite->ClassName, $favouriteValue->ClassName);\n }",
"public function testFetchOne()\n {\n $this->_insertData();\n $cmd = \"SELECT id, name FROM $this->_table_name WHERE id = :id\";\n $data = array('id' => 5);\n $actual = $this->_adapter->fetchOne($cmd, $data);\n $expect = array('id' => '5', 'name' => 'Zim');\n $this->assertEquals($actual, $expect);\n }",
"public function testOneDeepAssociations(): void\n {\n $data = [\n 'comment' => 'First post',\n 'user_id' => 2,\n 'article' => [\n 'title' => 'Article title',\n 'body' => 'Article body',\n 'user' => [\n 'username' => 'mark',\n 'password' => 'secret',\n ],\n ],\n ];\n $marshall = new Marshaller($this->comments);\n $result = $marshall->one($data, ['associated' => ['Articles.Users']]);\n\n $this->assertSame(\n $data['article']['title'],\n $result->article->title\n );\n $this->assertSame(\n $data['article']['user']['username'],\n $result->article->user->username\n );\n }",
"public function testHasOne()\n\t{\n\t\t$q_before = $this->getQueries();\n\t\t$user = Sprig::factory('Test_User');\n\t\t$user->id = 1;\n\t\t$user = $user->load();\n\t\t\n\t\t$this->assertEquals('Mr', $user->title);\n\t\t$this->assertQueryCountIncrease(1, $q_before, $this->getQueries());\n\t\t\n\t\t$user->name->load();\n\t\t$this->assertEquals('one', $user->name->name);\n\t\t$this->assertEquals(1, $user->name->test_user->id);\n\t\t$this->assertQueryCountIncrease(2, $q_before, $this->getQueries());\n\t\n\t}",
"public function testCanAccessHasOneObjectsAsMethods()\n {\n $team = $this->objFromFixture(DataObjectTest\\Team::class, 'team1');\n $captainID = $this->idFromFixture(DataObjectTest\\Player::class, 'captain1');\n\n $team->CaptainID = $captainID;\n $this->assertNotNull($team->Captain());\n $this->assertEquals($captainID, $team->Captain()->ID);\n\n // Test for polymorphic has_one relations\n $fan = $this->objFromFixture(DataObjectTest\\Fan::class, 'fan1');\n $fan->FavouriteID = $team->ID;\n $fan->FavouriteClass = DataObjectTest\\Team::class;\n $this->assertNotNull($fan->Favourite());\n $this->assertEquals($team->ID, $fan->Favourite()->ID);\n $this->assertInstanceOf(DataObjectTest\\Team::class, $fan->Favourite());\n }",
"public function testReadOne() {\r\n $this->entity = $this->repository->findOneById($this->id);\r\n $this->assertNotEmpty($this->entity, sprintf(\r\n 'Empty database or database problem or wrong setted id (default %d).', self::DEFAULT_ID));\r\n }",
"public function testOneAccessibleFieldsOptionForAssociations(): void\n {\n $data = [\n 'title' => 'My title',\n 'body' => 'My content',\n 'user' => [\n 'id' => 1,\n 'username' => 'mark',\n ],\n ];\n $this->articles->setEntityClass(ProtectedArticle::class);\n $this->users->setEntityClass(ProtectedArticle::class);\n\n $marshall = new Marshaller($this->articles);\n\n $result = $marshall->one($data, [\n 'associated' => [\n 'Users' => ['accessibleFields' => ['id' => true]],\n ],\n 'accessibleFields' => ['body' => false, 'user' => true],\n ]);\n $this->assertNull($result->body);\n $this->assertNull($result->user->username);\n $this->assertSame(1, $result->user->id);\n }",
"public function testFindOne()\n\t{\n\t\t// Find by primary key\n\t\t$data = $this->instance->findOne(7);\n\n\t\t$this->assertInstanceOf('Windwalker\\\\Data\\\\Data', $data, 'Return not Data object.');\n\t\t$this->assertEquals('Baby\\'s Breath', $data->title);\n\n\t\t// Find by conditions\n\t\t$data = $this->instance->findOne(array('title' => 'Cosmos'));\n\n\t\t$this->assertEquals('peaceful', $data->meaning);\n\n\t\t$data = $this->instance->findOne(array('title' => 'Freesia', 'state' => 1));\n\n\t\t$this->assertTrue($data->isNull());\n\t}",
"public function testOneAssociationBeforeMarshalMutation(): void\n {\n $users = $this->getTableLocator()->get('Users');\n $articles = $this->getTableLocator()->get('Articles');\n\n $users->hasOne('Articles', [\n 'foreignKey' => 'author_id',\n ]);\n $articles->getEventManager()->on('Model.beforeMarshal', function ($event, $data, $options): void {\n // Blank the association, so it doesn't become dirty.\n unset($data['not_a_real_field']);\n });\n\n $data = [\n 'username' => 'Jen',\n 'article' => [\n 'not_a_real_field' => 'whatever',\n ],\n ];\n $marshall = new Marshaller($users);\n $entity = $marshall->one($data, ['associated' => ['Articles']]);\n $this->assertTrue($entity->isDirty('username'));\n $this->assertFalse($entity->isDirty('article'));\n\n // Ensure consistency with merge()\n $entity = new Entity([\n 'username' => 'Jenny',\n ]);\n // Make the entity think it is new.\n $entity->setAccess('*', true);\n $entity->clean();\n $entity = $marshall->merge($entity, $data, ['associated' => ['Articles']]);\n $this->assertTrue($entity->isDirty('username'));\n $this->assertFalse($entity->isDirty('article'));\n }",
"public function testClientFetchOne(){\n \t$offset = 1; // offset should be at least one because offset 0 is a header\n \t$client = Client::getOne($offset);\n \t$this->assertInstanceOf('App\\Client', $client);\n\n \t// test failed fetch single record\n \t$offset = 100;\n \t$client = Client::getOne($offset);\n \t$this->assertFalse($client);\n }",
"public function testFirstSameResult() {\n\t\t$this->_createTables();\n\t\t$table = Table::build('article', ['table' => 'articles']);\n\t\t$query = new Query($this->connection, $table);\n\t\t$query->select(['id'])->toArray();\n\n\t\t$first = $query->first();\n\t\t$resultSet = $query->execute();\n\t\t$this->assertEquals(['id' => 1], $first);\n\t\t$this->assertSame($resultSet, $query->execute());\n\t}",
"public function testOneToOneLazy()\n {\n\n $jane = User::create([\n \"firstname\" => \"Jane\",\n \"lastname\" => \"Doe\",\n \"email\" => \"jane.doe@example.dd\"\n ]);\n\n $john = User::create([\n \"firstname\" => \"John\",\n \"lastname\" => \"Doe\",\n \"email\" => \"john.doe@example.dd\"\n ]);\n\n $phone = Phone::create([\n \"number\" => \"+49 1234 56789\",\n \"user_id\" => $jane->id\n ]);\n\n $this->assertEquals($phone, $jane->phone()->lazy());\n\n // give the phone to john\n $john->phone()->set($phone);\n $this->assertEquals($phone->id, $john->phone()->lazy()->id);\n\n // detatch object and ensure cache is still active\n $john->phone()->detach();\n $this->assertEquals($phone->id, $jane->phone()->lazy()->id);\n $this->assertEquals($phone->id, $john->phone()->lazy()->id);\n $this->assertNull( $john->phone()->lazy(true));\n $this->assertNull( $john->phone()->lazy(true));\n }",
"public function oneToOne()\n {\n \t$user \t= User::find(1);\n \t$phone \t= $user->phone;\t\t// It contains one entry\n\n \t// Inverse\n \t$phone \t= Phone::find(1);\n \t$user \t= $phone->user;\t\t\t// It contains one entry\n\n \techo '<pre>';\tprint_r( $phone->toArray() );\n }",
"public function testOneAssociationsNoEntities()\n {\n $class = 'TestApp\\Model\\Entity\\ValidatableEntity';\n $article = $this->getMock($class, ['validate']);\n $comment1 = ['comment' => 'test'];\n $comment2 = ['comment' => 'omg'];\n $user = $this->getMock($class, ['validate']);\n $article->set('comments', [$comment1, $comment2]);\n\n $validator1 = $this->getMock('\\Cake\\Validation\\Validator');\n $validator2 = $this->getMock('\\Cake\\Validation\\Validator');\n\n $validator1->expects($this->once())\n ->method('count')\n ->will($this->returnValue(1));\n\n // Should not be called as comments are not entities.\n $validator2->expects($this->never())\n ->method('count');\n\n $this->articles->validator('default', $validator1);\n $this->comments->validator('default', $validator2);\n\n $entityValidator = new EntityValidator($this->articles);\n\n $article->expects($this->once())\n ->method('validate')\n ->with($validator1)\n ->will($this->returnValue([]));\n\n $options = ['associated' => ['Comments']];\n $this->assertFalse($entityValidator->one($article, $options));\n }",
"public function createHasOneRelation()\n {\n $filipe = new HasOnePerson(\n [\n 'name' => 'filipe',\n 'email' => 'filipe@example.com'\n ]\n );\n $this->assertTrue($filipe->save());\n $profile = new HasOneProfile(\n [\n 'timeZone' => 'Atlantic/Azores',\n 'language' => 'pt_PT',\n 'person' => $filipe\n ]\n );\n $relation = Entity\\Manager::getInstance()->get($filipe)\n ->getRelation('_profile');\n\n $this->assertInstanceOf('Slick\\Orm\\Relation\\HasOne', $relation);\n $this->assertTrue($profile->save());\n\n $filipe = HasOnePerson::get(1);\n $this->assertEquals('pt_PT', $filipe->profile->language);\n\n $relation->lazyLoad = true;\n $filipe = HasOnePerson::get(1);\n $this->assertEquals('pt_PT', $filipe->profile->language);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return tripIDs of trip with duration greater than specified duration | public function searchTripsByGreaterDuration($duration) {
$db = new Db();
$query = "SELECT tripID
FROM trip t, trip_duration d
WHERE t.startDate = d.startDate AND
t.endDate = d.endDate AND
duration > " . ModelsUtils::mysqlString($duration);
return $this->returnResult( $this->submitQuery($query));
} | [
"public function filterByDuration($duration = null, $comparison = null);",
"public function getRecipeByDuration($duration)\n {\n $db = getAdapter(); \n $statement = $db->createStatement(\"SELECT * FROM Recipe WHERE duration <=\".$duration);\n $result = $statement->execute();\n $rowset = new ResultSet;\n $rowset->initialize($result);\n \n return $rowset; \n }",
"function project_condition_projactivity_duration_shorter($projactivity, $duration) {\n // Get an array showing the number or days required for each unit of druratype\n $daysarray = project_get_duratypes('days');\n // calculate the duration in days of the project activity\n return ($daysarray[$projactivity->duratype] * $projactivity->duration < $duration);\n}",
"function continueTimer($task_id) {\n\t\tglobal $sql;\n\t\t$duration_details = $sql->getAssoc(\"SELECT D.id, UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(from_time) AS time_taken, T.type\n\t\t\t\t\t\t\t\t\t\t\t\tFROM Duration D INNER JOIN Task T ON T.id=D.task_id \n\t\t\t\t\t\t\t\t\t\t\t\tWHERE task_id=$task_id AND to_time='0000-00-00 00:00:00' \n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY from_time DESC LIMIT 0,1\");\n\t\treturn $duration_details;\n\t}",
"function find_passages($timestamps, $threshold) {\n $passages[0] = array($timestamps[0], 1);\n for ($i = 1; $i < count($timestamps); $i++){\n if ((strtotime($timestamps[$i]) - strtotime($timestamps[$i-1]) > $threshold)) {\n // timestamp is a passage\n $passages[] = array($timestamps[$i], 1);\n } else {\n $passages[] = array($timestamps[$i], 0);\n }\n }\n return $passages;\n}",
"public function findExceededTasks()\n\t{\n\t\t$now = new DateTime();\n\t\treturn $this->mapper->findBy([\"exceedDateTime <=\" => $now]);\n\t}",
"public function runsUnderDuration($end) {\n\t\tif(!$this->checkUserId()) {\n\t\t\techo $this->idErrorMessage;\n\t\t\treturn false;\n\t\t}\n\t\t$this->data = $this->getRuns();\n\t\tforeach($this->data->run as $run) {\n\t\t\tif((float) $run->duration < (float) $end) {\n\t\t\t\t$runArray[] = array(\n\t\t\t\t\t'runId'=>(float) $run->attributes()->id,\n\t\t\t\t\t'startTime'=> (string) $run->startTime,\n\t\t\t\t\t'distance'=> $this->kmToMiles((float) $run->distance),\n\t\t\t\t\t'duration'=> (float) $run->duration,\n\t\t\t\t\t'synctime'=> (float) $run->syncTime,\n\t\t\t\t\t'calories'=> (float) $run->calories,\n\t\t\t\t\t'name'=> (string) $run->name,\n\t\t\t\t\t'description'=> (string) $run->description,\n\t\t\t\t\t'howFelt'=> (string) $run->howFelt,\n\t\t\t\t\t'weather'=> (string) $run->weather,\n\t\t\t\t\t'terrain'=> (string) $run->terrain,\n\t\t\t\t\t'equipmentType'=> (string) $run->equipmentType\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif(!empty($runArray)) {\n\t\t\tif($this->json) {\n\t\t\t\treturn $this->json($runArray);\n\t\t\t} else {\n\t\t\t\treturn $runArray;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function hasDuration(): bool;",
"function filter_duration($req)\r\n\t{\r\n\t\tif(!is_a($req,Request))\r\n\t\t{\r\n\t\t\ttrigger_error(\"Request passed not in valid format, ignoring, expect problems.\",E_USER_WARNING);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t$db=open_db(\"db/system.sqlite\",SQLITE3_OPEN_READONLY);\r\n\t\t$duration=get_setting($db,\"duration\");\r\n\t\tclose_db($db);\r\n\t\tif(($req->getTime()+$duration*60*60) <= time())\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function duration($duration){}",
"public function transactions($timeframe){\r\n\t\t$subset_arr = Array();\r\n\t\tforeach($this->transaction_arr as $key => $value){\r\n\t\t\tif(strtotime($value['date']) >= (time() - strtotime($timeframe))){\r\n\t\t\t\t$subset_arr[] = $transaction;\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $subset_arr;\r\n\t}",
"public function getLockedRiverTrips($river_trip, $year) {\n\n $query = 'SELECT `trip_id`\n FROM `trips`\n WHERE `river_trips_fk` = :river_trip\n AND `locked_on` IS NOT NULL\n AND YEAR(STR_TO_DATE(`takeout_date`,\"%Y-%c-%e\")) = :year';\n\n $trip_ids = $this->db->select($query, array('river_trip' => $river_trip, 'year' => $year));\n\n return $trip_ids;\n }",
"public function isDuration(int $duration): bool\n {\n return $this->duration === $duration;\n }",
"public function filterByDurationEditable($value = null, $comparison = null)\n {\n return $this->useCalendareventQuery()->filterByDurationEditable($value, $comparison)->endUse();\n }",
"function searchMoviesFromDuration($iDurationMax, array $aMovies)\n{\n $aSearchMovies = array();\n foreach ($aMovies as $aMovie) {\n $iDuration = $aMovie['duration'];\n if ($iDuration <= $iDurationMax) {\n $aSearchMovies[] = $aMovie;\n }\n }\n\n return $aSearchMovies;\n}",
"private function _filterByCallDuration( $query, Request $request )\n {\n if ( ! is_null( $request->call_duration ) ) {\n $callDurationRange = explode( ',', $request->call_duration );\n $query = $query->whereBetween( 'dial_call_duration', [\n $callDurationRange[ 0 ],\n $callDurationRange[ 1 ],\n ] );\n\n return $query;\n }\n\n return $query;\n }",
"private function checkEventDuration(){\n // Event date times\n $eventStartTime = Carbon::createFromFormat('m/d/Y h:i a', $this->start_time);\n $eventEndTime = Carbon::createFromFormat('m/d/Y h:i a', $this->end_time);\n // The difference must be at least 10minutes\n return $eventStartTime->diffInMinutes($eventEndTime) >= 10 && $eventStartTime->diffInHours($eventEndTime) <= 12;\n }",
"public function isDurationGreaterOrEqualTo(int $duration): bool\n {\n return $this->duration >= $duration;\n }",
"public function getRequestsForMails($duration)\n {\n if($duration == 'h')\n $condition = \" AND mail_send_at < UNIX_TIMESTAMP() AND mail_send_at <= (UNIX_TIMESTAMP()-(60*60))\";\n if($duration == 'd')\n $condition = \" AND mail_send_at < UNIX_TIMESTAMP() AND mail_send_at <= (UNIX_TIMESTAMP()-(60*60*24))\";\n if($duration == 'nd')\n $condition = \" AND mail_send_at < UNIX_TIMESTAMP() AND mail_send_at >= (UNIX_TIMESTAMP()-(60*60*24))\";\n if($duration == 'w')\n $condition = \" AND mail_send_at < UNIX_TIMESTAMP() AND mail_send_at <= (UNIX_TIMESTAMP()-(60*60*24*7))\";\n if($duration == 'nw')\n $condition = \" AND mail_send_at < UNIX_TIMESTAMP() AND mail_send_at >= (UNIX_TIMESTAMP()-(60*60*24*7))\";\n $query = \"SELECT r.*, up.* FROM \".$this->_name.\" r LEFT JOIN UserPlus up ON r.assigned_to = up.user_id WHERE r.status = 'pending' \".$condition;\n if(($result = $this->getQuery($query,true)) != NULL)\n {\n return $result;\n }\n else\n return \"NO\";\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the currentToken index exists Used by the Iterator interface | public function valid() {
return isset($this->tokens[$this->currentToken]);
} | [
"public function has_current() {\n\t\treturn ( $this->current_position < strlen( $this->input ) );\n\t}",
"public function hasToken();",
"public function valid()\n\t{\n\t\treturn isset($this->tokens[$this->position]);\n\t}",
"protected function hasTokenAtIndex(int $index): bool\n {\n return isset($this->tokenList[$index]);\n }",
"public function hasToken() : bool\n {\n return null !== $this->editToken;\n }",
"public function hasToken()\n {\n return $this->tokenFlag;\n }",
"public function hasTokens(){\n return preg_match($this->token_pattern, $this->html);\n }",
"public function hasMoreTokens()\n {\n return ($this->index < $this->count() - 1);\n }",
"public function tokenIsPresent();",
"public function hasNext()\n\t{\n\t\treturn $this->index+1 < $this->list->size();\n\t}",
"public function hasToken() {\n return (null === ($token = $this->tokenStorage->getToken()));\n\n }",
"public function hasMoreTokens()\r\n\t{\r\n\t\treturn ($this->token !== false);\r\n\t}",
"public function exists(string $token): bool;",
"public function hasMoreTokens(): bool\n {\n return $this->cursor < strlen($this->string);\n }",
"public function valid(){\n return isset($this->keys[$this->currentIndex]);\n }",
"public function is_token($token) {\n\t\treturn $this->token === $token;\n\t}",
"public function isSetNextToken()\n {\n return !is_null($this->fields['NextToken']['FieldValue']);\n }",
"public function isSetNextToken()\n {\n return !is_null($this->_fields['NextToken']['FieldValue']);\n }",
"public abstract function hasMoreTokens();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the remaining number of seconds before the module restarts, or zero when no reboot has been scheduled. | public function get_rebootCountdown()
{ $json_val = $this->_getAttr("rebootCountdown");
return (is_null($json_val) ? Y_REBOOTCOUNTDOWN_INVALID : intval($json_val));
} | [
"public function get_rebootCountdown(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::REBOOTCOUNTDOWN_INVALID;\n }\n }\n $res = $this->_rebootCountdown;\n return $res;\n }",
"public function getSecondsUntilLimitIsReset() : int\n\t{\n\t\treturn $this->getNextResetTimestamp() - time() ?: 0;\n\t}",
"public function get_restart_time() {\r\n\t\t$job_max_execution_time = get_site_option( 'backwpup_cfg_jobmaxexecutiontime' );\r\n\r\n\t\tif ( empty( $job_max_execution_time ) )\r\n\t\t\treturn 300;\r\n\r\n\t\t$execution_time = microtime( TRUE ) - $this->timestamp_script_start;\r\n\t\treturn $job_max_execution_time - $execution_time - 3;\r\n\t}",
"public function getResetTime()\n {\n return (integer)$this->get(self::CONF_SECONDS_TILL_RESET);\n }",
"public function get_seconds_left() {\r\n\t\tif ( $this->is_endless() ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$time_left = $this->get_end_time() - current_time( 'timestamp' );\r\n\t\treturn $time_left < 0 ? 0 : $time_left;\t\r\n\t}",
"public function getRemainingSeconds();",
"public function remaining(): int {\n $alert = $this->alert();\n return is_null($alert) ? 1 : ($alert['created'] + $alert['expiry'] * 60) - time();\n }",
"public function getSecondsBeforeNextAttempts();",
"public function getRemainingWorkTimeInSeconds() \n {\n if ($this->isAfterWorkTime()){\n return 0;\n } elseif ($this->isBeforeWorkTime()) {\n return $this->workdayEnd->diffInSeconds($this->workdayStart);\n } else {\n return $this->workdayEnd->diffInSeconds($this->currentTime);\n }\n }",
"public static function getRemainingSeconds()\n {\n $expirationÇDate = UtilsDate::toTimestamp(self::getRoundExpirationDate());\n $now = UtilsDate::toTimestamp(UtilsDate::create());\n\n return $expirationÇDate - $now;\n }",
"public function getTimeLeft()\n {\n $iTimeout = $this->getConfig()->getConfigParam('iPsBasketReservationTimeout');\n if ($iTimeout > 0) {\n $oRev = $this->getReservations();\n if ($oRev && $oRev->getId()) {\n $iTimeout -= (oxRegistry::get(\"oxUtilsDate\")->getTime() - (int) $oRev->oxuserbaskets__oxupdate->value);\n oxRegistry::getSession()->setVariable(\"iBasketReservationTimeout\", $oRev->oxuserbaskets__oxupdate->value);\n } elseif (($iSessionTimeout = oxRegistry::getSession()->getVariable(\"iBasketReservationTimeout\"))) {\n $iTimeout -= (oxRegistry::get(\"oxUtilsDate\")->getTime() - (int) $iSessionTimeout);\n }\n\n return $iTimeout < 0 ? 0 : $iTimeout;\n }\n\n return 0;\n }",
"public function getRetryTime()\n {\n return $this->secondsToRetry;\n }",
"public function getRequiresRestartValue()\n {\n return $this->readWrapperValue(\"requires_restart\");\n }",
"public function getTotalSleepTimeMilliseconds(): int;",
"public function getRemainingTime()\n {\n return $this->isExpired() ? 0\n : ($this->getExpirationDate()->getTimestamp() - time());\n }",
"private function getScheduledTaskRunDuration(): int\n {\n return round((hrtime(true) - $this->scheduledTaskStartMs) / 1e+6);\n }",
"public function getPeerRestartTime()\n\t{\n\t\treturn $this->peer_restart_time;\n\t}",
"public function getRestartTimes()\n\t{\n\t\treturn $this->restartTimes;\n\t}",
"public function getProcessTimeRemaining(){\n if (!is_null($this->getProcessTimeout())){\n $time_left = $this->getProcessTimeout() - $this->getElapsedProcessTime();\n return $time_left < 0 ? 0 : $time_left;\n }else{\n return NULL;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks for url query parameter. | public function url_get_param( $url ) {
$urldata = parse_url( $url );
if ( isset( $urldata['query'] ) ) {
return false;
} else {
return true;
}
} | [
"public static function checkUrlParam($param=null){\n\n $instance=new self;\n if($param==null){\n return false;\n }\n if(array_key_exists($param,$instance->request->getQueryString())){\n return true;\n }\n return false;\n }",
"private function validateQueryParam(WP_REST_Request $request, string $key) : bool\n {\n return \\array_key_exists($key, $request->get_query_params()) &&\n \\filter_var($request->get_query_params()[$key], FILTER_VALIDATE_INT) === 1;\n }",
"private function hasParams($url) {\n return strpos($url, \":\") > -1;\n }",
"public function checkParams()\n {\n if (!isset($_GET['params'])) {\n die($this->error('404'));\n } else {\n $id = $_GET['params'];\n }\n }",
"public function hasQueryString(): bool\n {\n return $this->parsedUri->queryString()->hasParams();\n }",
"function validateUserUrl($available, $queryParameter)\n{\n foreach ($available as $value) {\n if ($value === $queryParameter) {\n return true;\n }\n }\n return false;\n}",
"protected function urlHasQuery($url)\n {\n return (bool) parse_url($url, PHP_URL_QUERY);\n }",
"public function testQueryPartIsOmittedIfNoQueryParamsWereProvided()\n {\n $this->assertNotContains('?', (string)$this->url);\n }",
"public function ValidateQueryParams()\n {\n if (isset($this->options[\"page\"])) {\n if (!is_numeric($this->options[\"page\"])) {\n self::BadRequest(\"Invalid page\");\n }\n if (intval($this->options[\"page\"]) < 1) {\n self::BadRequest(\"Invalid page: cannot be less than 1\");\n }\n }\n if (isset($this->options[\"limit\"])) {\n if (!is_numeric($this->options[\"limit\"])) {\n self::BadRequest(\"Invalid limit\");\n }\n if (intval($this->options[\"limit\"]) < 1) {\n self::BadRequest(\"Invalid limit: cannot be less than 1\");\n }\n }\n if (intval($this->options[\"limit\"]) > self::$MAX_LIMIT) {\n self::BadRequest(\"Invalid limit: cannot be greater than \" . self::$MAX_LIMIT);\n }\n }",
"function checkMissingParameters() {\n\tif(!isset($_GET['url'])) {\n\t\tthrow new Exception(\"Missing parameter: [url]\");\n\t} else {\n\t\tvalidUrl($_GET['url']); // Vaidate url\n\t}\n\n\tif(!isset($_GET['image_name'])) {\n\t\tthrow new Exception(\"Missing parameter: [image_name]\");\n\t}\n\n\treturn true;\n}",
"function is_query() {\n\tif( isset($_SERVER['QUERY_STRING']) ) \n\t\treturn $_SERVER['QUERY_STRING'];\n}",
"public function isUsingQueryString()\n {\n if (SLIRConfig::$forceQueryString === true) {\n return true;\n } else if (!empty($_SERVER['QUERY_STRING']) && count(array_intersect(array('i', 'w', 'h', 'q', 'c', 'b', 'p'), array_keys($_GET)))) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasParam($name)\r\n {\r\n return isset($this->urlParams[$name]);\r\n }",
"protected function _hasParamException() {\n foreach ($this->exceptIfParam as $p => $v) {\n $value = $this->getRequest()->getParam($p);\n if ($value && ($value === $v)) {\n return TRUE;\n }\n }\n return FALSE;\n }",
"private function isQueryString() : bool\n {\n preg_match('/([a-zA-Z0-9]+)=([a-zA-Z0-9]+)/i', $this->getContent(), $matches);\n return empty($matches) ? false : true;\n }",
"public function hasClearingParam()\n {\n return $this->request->query->has($this->getParamName());\n }",
"function has_query_string() {\n if( $_SERVER['QUERY_STRING'] ) {\n return true;\n } else {\n return false;\n }\n}",
"public static function query($query){\n return isset($_GET[$query]) ? filter_var($_GET[$query], FILTER_SANITIZE_STRING) : false;\n }",
"function __isUrlParamValuesPresent(){\n\t\t\t## there is at least one value set or a GET variable is present. if there\n\t\t\t## is no URL schema, _urlParamPresent is not created. False means there\n\t\t\t## is a URL schema, but no values present\n\n\t\t\tif(!is_array($this->_env['get'])) $this->_env['get'] = array();\n\t\t\tif(!is_array($this->_env['url'])) $this->_env['url'] = array();\n\n\t\t\t$vars = array_merge($this->_env['url'], $this->_env['get']);\n\n\t\t\tif(is_array($vars) && !empty($vars)){\n\n\t\t\t\t$this->_urlParamPresent = false;\n\n\t\t\t\tforeach($vars as $name => $val)\n\t\t\t\t\tif($val != ''){ $this->_urlParamPresent = true; return; }\n\n\t\t\t}\n\n\t\t\treturn;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the next trainer's Auto Increment number | public function getNextTrainersAI()
{
$this->connect();
$query = $this->connection->prepare("SHOW TABLE STATUS LIKE 'trainers'");
$query->execute();
$size = $query->fetch(PDO::FETCH_ASSOC);
$this->disconnect();
return $size['Auto_increment'];
} | [
"public function getAutoIncrement()\r\n {\r\n $connection = Yii::app()->db;\r\n $command = $connection->createCommand(\"SHOW TABLE STATUS LIKE '\" . get_called_class() . \"'\");\r\n $row = $command->queryRow();\r\n $nextId = 'PAM' . $row['Auto_increment'];\r\n\r\n return $nextId;\r\n }",
"public function get_next_id() {\n\t\treturn (int)$this -> db -> select('AUTO_INCREMENT') -> from('information_schema.TABLES') -> where('TABLE_NAME', $this -> table) -> where('TABLE_SCHEMA', $this -> db -> database) -> get() -> row() -> AUTO_INCREMENT;\n\t}",
"public function get_next_id() \n\t{\n\t\treturn (int) $this->db->select('AUTO_INCREMENT')\n\t\t\t\t\t\t\t ->from('information_schema.TABLES')\n\t\t\t\t\t\t\t ->where('TABLE_NAME', $this->_table)\n\t\t\t\t\t\t\t ->where('TABLE_SCHEMA', $this->db->database)\n\t\t\t\t\t\t\t ->get()\n\t\t\t\t\t\t\t ->row()\n\t\t\t\t\t\t\t ->AUTO_INCREMENT;\n\n\t}",
"public function getNextid(): int\n {\n }",
"public static function getNextId()\n {\n\n return 'tb' . self::$_counter++;\n }",
"public static function getNextId() {\n\t\tglobal $db;\n\t\t$next_id_key = constant(get_called_class().'::collectionName');\n\t\t$res = $db->command(\n\t\t\tarray(\"findandmodify\" => \"counter\",\n\t\t\t\t\"query\" => array('_id'=>$next_id_key),\n\t\t\t\t\"update\" => array('$inc'=>array('seq'=>1)),\n\t\t\t\t'new'=> true,\n\t\t\t\t'upsert'=>true\n\t\t\t)); \n\t\t$id = $res['value']['seq'];\n\t\t\n\t\treturn (int)$id;\n\t}",
"public function get_next_id()\n\t{\n\t\treturn (int) $this->_database->select('AUTO_INCREMENT')\n\t\t\t->from('information_schema.TABLES')\n\t\t\t->where('TABLE_NAME', $this->_table)\n\t\t\t->where('TABLE_SCHEMA', $this->_database->database)->get()->row()->AUTO_INCREMENT;\n\t}",
"public function getNextAutoincrementId()\n {\n $database = self::getDefaultAdapter();\n $tableStatus = $database->fetchRow('SHOW TABLE STATUS LIKE ?', array($this->getName()));\n\n return $tableStatus['Auto_increment'];\n }",
"public function getNextId(){\n\t\t$ret = $this->nextId;\n\t\t$this->nextId++;\n\t\treturn $ret;\n\t}",
"public static function nextNo() {\n $util = self::first();\n $no = $util->bil_no;\n $util->bil_no = $no + 1;\n $util->save();\n return $no;\n }",
"public function nextId()\n {\n return $this->query(\"SHOW TABLE STATUS LIKE ?\", [$this->table])->fetch()->Auto_increment;\n }",
"public function next_client_id() {\r\n\t\t$this->db->protect_identifiers(self::TABLE_CLIENTS);\r\n\t\t$result = $this->db->query('SELECT MAX('.self::CID.') AS '.self::CID.'_MAX, '.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'MIN('.self::CID.') AS '.self::CID.'_MIN '.\r\n\t\t\t\t\t\t\t\t\t\t\t\t'FROM '.self::TABLE_CLIENTS.';'\r\n\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t$result = $result->row_array();\r\n\t\t\r\n\t\t// this is not perfect, but it's better than AUTO_INCREMENT\r\n\t\t// any number bigger than one means you can use a lower number\r\n\t\t// if and ID of one is present, just use MAX ID + 1 as the next ID\r\n\t\tif( $result[self::CID.'_MIN'] > 1 ){\r\n\t\t\treturn $result[self::CID.'_MIN'] - 1;\r\n\t\t}else{\r\n\t\t\treturn $result[self::CID.'_MAX'] + 1;\r\n\t\t}\r\n\t}",
"public function next_id();",
"protected function getIdentityIncrement(): int\n {\n return 1;\n }",
"public function getNextUserAI()\n\t{\n\t\t$this->connect();\n\t\t$query = $this->connection->prepare(\"SHOW TABLE STATUS LIKE 'users'\");\n\t\t$query->execute();\n\t\t$size = $query->fetch(PDO::FETCH_ASSOC);\n\t\t$this->disconnect();\n\t\treturn $size['Auto_increment'];\n\t}",
"public static function autoIncrementIncrement()\n {\n $ret = self::queryGetAll(\"SELECT @@auto_increment_increment AS a;\");\n return intval($ret[0][\"a\"]);\n }",
"public function next_id(){\n\t\t$result = $this->db_info();\n\t\t$id = $result['doc_count']+$result['doc_del_count'];\n\t\treturn $id;\n\t}",
"public function getAutoNumber()\n\t{\n\t\treturn $this->autoNumber; \n\n\t}",
"public function getNextUniqueId()\n {\n return $this->nextUniqueId++;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load data page tagihan konfirmasi $order = menentukan order database, desc / asc / random $offset = halaman $limit = Batas pengambilan data $search = Keyword / kata kunci | public function load_data_page_draff($order, $offset, $limit, $search)
{
$this->db->select('*');
$this->db->from('bb_invoice');
$this->db->where('status_inv', '9');
// kondisi jika kata kunci tidak ada
if($search != NULL)
{
$this->db->group_start();
$this->db->like('name_inv', $search);
$this->db->or_like('code_inv', $search);
$this->db->group_end();
}
$this->db->order_by('id_inv', $order);
// kondisi jika pembatasan dan offset tidak ada
if($limit != NULL && $offset!=NULL)
{
$this->db->limit($limit,$offset);
}
elseif($offset == NULL)
{
$this->db->limit($limit);
}
$query = $this->db->get();
return $query->result();
} | [
"public function load_dataPage($order, $offset, $limit, $search)\n\t{\n\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_aksesoris');\n\n\t\t// kondisi jika kata kunci tidak ada\n\t\tif($search != NULL)\n\t\t{\n\t\t\t$this->db->like('name_acc', $search);\n\t\t}\n\n \t$this->db->order_by('id_acc', $order);\n\n \t// kondisi jika pembatasan dan offset tidak ada\n if($limit != NULL && $offset!=NULL)\n {\n \t$this->db->limit($limit,$offset);\n }\n \telseif($offset == NULL)\n \t{\n \t\t$this->db->limit($limit);\n \t}\n \n $query = $this->db->get();\n \n return $query->result();\n\t}",
"public function load_data_page_pending($order, $offset, $limit, $search)\n\t{\n\n\t\t$this->db->select('*');\n\t\t$this->db->from('bb_invoice');\n\t\t$this->db->where('status_inv', '0');\n\n\t\t// kondisi jika kata kunci tidak ada\n\t\tif($search != NULL)\n\t\t{\n\t\t\t$this->db->group_start();\n\t\t\t$this->db->like('name_inv', $search);\n\t\t\t$this->db->or_like('code_inv', $search);\n\t\t\t$this->db->group_end();\n\t\t}\n\n \t$this->db->order_by('id_inv', $order);\n\n \t// kondisi jika pembatasan dan offset tidak ada\n if($limit != NULL && $offset!=NULL)\n {\n \t$this->db->limit($limit,$offset);\n }\n \telseif($offset == NULL)\n \t{\n \t\t$this->db->limit($limit);\n \t}\n \n $query = $this->db->get();\n \n return $query->result();\n\t}",
"public function loadData($searchKeyword=\"\",$sortBy=\"\",$limit=\"\",array $filters=[]);",
"function tampil_data_paging($halaman,$batas)\n\t{\n\t\t\t$query = \"SELECT * FROM tbl_ktp limit $halaman, $batas\";\n\t\t\treturn $this->db->query($query);\n\t}",
"public function paginado(){\n\t\t$start = $this->input->post('start');\n\t\t$length = $this->input->post('length');\n\t\t$search = $this->input->post('search')['value'];\n\n\t\t$r = $this->Tareas->tareaspaginadas($start,$length,$search);\n\t\n\t\t$datos =$r['datos'];\n\t\t$totalDatos = $r['numDataTotal'];\n\t\t$datosPagina = count($datos);\n\n\t\t$json_data = array(\n\t\t\t\"draw\" \t\t\t\t=> intval($this->input->post('draw')),\n\t\t\t\"recordsTotal\" \t=> intval($datosPagina),\n\t\t\t\"recordsFiltered\"\t=> intval($totalDatos),\n\t\t\t\"data\" \t\t\t\t=> $datos\n\t\t);\n\t\t$result = json_encode($json_data);\n\t\techo $result;\n\t}",
"public function pagedSearch($data,$page);",
"function generate_search_view($data)\n {\n //\n $kw_arr = array(); \n if(isset($data['kw']))\n {\n $buffer = explode('+',$data['kw']);\n foreach ($buffer as $item)\n {\n $kw_arr[] = urldecode($item);\n }\n }\n \n // \n $index = empty($data['index']) ? 1 : $data['index'];\n if($data['index']<0)\n {\n return array('total'=>0);\n }\n \n //get the content number that will display in page\n $pre_num = $this->get_display_content_num($data['type']);\n $range = array('start'=>($index-1)*$pre_num,'end'=>($index*$pre_num-1));\n\n //\n $search_data = $this->generate_search_data(array('type'=>$data['type'],'kw'=>$kw_arr,'index'=>$index,'uId'=>$data['uId']),$range); \n \n\n //get the pagination number display in the footer of the page\n $display_num = $this->config->item('pre_pagination_num');\n $total = $this->page_num_calculate($search_data['total'],$pre_num);\n $pagination_data = $this->get_page_data(array('index'=>$index,'total'=>$total,'display_num'=>$display_num));\n list($start,$end) = $pagination_data;\n \n $result = $search_data;\n $result['total'] = $total;\n $result['start'] = $start;\n $result['end'] = $end;\n \n return $result;\n }",
"function get_limit_data($limit, $start = 0, $q = NULL) {\n $this->db->order_by($this->id, $this->order);\n $this->db->like('id_pages', $q);\n\t$this->db->or_like('title', $q);\n\t$this->db->or_like('content', $q);\n\t$this->db->or_like('category', $q);\n\t$this->db->or_like('status', $q);\n\t$this->db->or_like('created_by', $q);\n\t$this->db->or_like('created_at', $q);\n\t$this->db->or_like('img', $q);\n\t$this->db->limit($limit, $start);\n return $this->db->get($this->table)->result();\n }",
"function paginacao($select,$from,$where,$orderby,$conn,$pagina,$tam_pag,$debug=false)\r\n{\r\n\t$sql = \"SELECT \" . $select ;\r\n\t$sql .= \" FROM \" . $from ;\r\n\tif ($where!=\"\") $sql .= \" WHERE \" . $where;\r\n\tif ($orderby!=\"\") $sql .= \" ORDER BY \" . $orderby;\r\n\t\r\n\t$res = mysql_query($sql,$conn);\r\n\t$total_res = mysql_num_rows($res);\r\n\t\t\t\r\n\t$start_reg = ($pagina-1) * $tam_pag;\r\n\t$sql .= \" LIMIT $start_reg,$tam_pag\";\r\n\t\r\n\tif($debug) echo $sql;\r\n\t\r\n\t$res = mysql_query($sql,$conn) or die(\"Paginação: erro na sql: $sql<br>\".mysql_error($conn).\"<br>\");\r\n\t\r\n\t$num_pags = ceil($total_res / $tam_pag);\r\n\tfor($i=0;$i<$num_pags;$i++)\r\n\t{\r\n\t\t$paginas[] = $i+1;\r\n\t}\r\n\t\r\n\treturn array(\r\n\t\t'total' => $total_res,\r\n\t\t'res' => $res,\r\n\t\t'paginas' => $paginas\r\n\t);\r\n}",
"function getVehicles($page,$search){\n $return=array();\n $returnresult=array();\n $offset=0;\n if($search!=null){\n $searchQuery='WHERE (VehicleName LIKE \"%'.$search.'%\" or VehicleModel LIKE \"%'.$search.'%\")';\n $urlQuery='&search='.$search;\n }else{\n $searchQuery='';\n $urlQuery='';\n } \n if (is_numeric($page)){\n $offset=getOffset($page);\n $results=loadQueryArray('SELECT VehicleID FROM Vehicles '.$searchQuery.' ORDER BY VehicleID ASC LIMIT 10 OFFSET '.$offset);\n if($results!=null){\n foreach($results as $result){\n $returnresult[] = searchVehicleByID($result['VehicleID'],false);\n }\n }else{\n $return['detail']=MSG_NOT_FOUND;\n return(json_encode($return));\n }\n }else{\n $return['detail']=MSG_NOT_FOUND;\n return(json_encode($return));\n }\n $return['count']=loadQueryArray('SELECT COUNT(*) as VehiclesCount FROM Vehicles '.$searchQuery)[0]['VehiclesCount'];\n if($offset+10<$return['count']){\n $return['next']=LOCAL_URL.'/vehicles/?page='.($page+1).$urlQuery;\n }else{\n $return['next']=null;\n }\n if($page-1>0){\n $return['previous']=LOCAL_URL.'/vehicles/?page='.($page-1).$urlQuery;\n }else{\n $return['previous']=null;\n }\n $return['results']=$returnresult;\n return(json_encode($return));\n}",
"function paging($count_data=false,$item_per_page=5){\n\t\n if (!$count_data) return false;\n // untuk memberikan nilai pada $page berdasarkan hasil GET pada variable page \n $page = isset($_GET['page']) ? $_GET['page'] : 1 ;\n \n // melakukan kondisi jika nilai $page kosong maka akan diberikan nilai 1 \n if( ( $page < 1) && (empty( $page ) ) ){\n $page=1;\n }\n // menghitung jumlah halaman yang akan dibuat \n $jumlah_hal = ceil($count_data/$item_per_page );\n \n // untuk membatasi agar nilai page tidak lebih besar dari jumlah halaman\n if( $page>$jumlah_hal ){\n $page=$jumlah_hal;\n } \n \n // menghitung nilai batas awal yang digunakan saat query nanti\n $batas = ($page - 1) * $item_per_page;\n \n // menyimpan semua dalam bentuk array kedalam $paging\n $paging['item_per_page']=$item_per_page;\n $paging['batas']=$batas;\n $paging['jumlah_hal']=$jumlah_hal;\n $paging['page']=$page;\n return $paging;\n}",
"function tampilkanGaleriPagination ($start, $perPage) {\n $query = \"SELECT * FROM gambar LIMIT $start, $perPage\";\n return result($query);\n}",
"function populate_data($page) {\n if(isset($this->source)) {\n // reset the data and header arrays\n unset($this->header);\n unset($this->data);\n\n // connect to the database\n $db = new database();\n $db->dblink();\n \n // calculate the starting row\n if($page == 1) {\n $start_row = 0;\n } else {\n $start_row = $this->page_rows * ($page - 1);\n } // end if\n\n // read the raw data\n $result = $db->get_recs($this->source, \"*\", \n $this->filter, \"\",\n $start_row,\n $this->page_rows);\n\n $recs = $db->fetch_objects($result);\n\n if(is_array($recs)) {\n // populate the default column headers\n $i = 0;\n foreach($recs[0] as $key => $value) {\n $this->header[$i] = $key;\n $i++;\n } // end foreach\n\n // populate the data rows\n $n = count($recs);\n for($r = 0; $r < $n; $r++) {\n $c = 0;\n foreach($recs[$r] as $key => $value) {\n $this->data[$r][$c] = $value;\n $c++;\n } // end foreach\n } // end for\n\n // set the current page\n $this->return_page = $page;\n\n // sort the data\n sort($this->data);\n \n // everything OK\n return true;\n } // end if\n } // end if\n\n // no data read\n return false;\n }",
"function get_limit_data($limit, $start = 0, $q = NULL)\n {\n $this->db->order_by($this->id, $this->order);\n $this->db->like('id', $q);\n $this->db->or_like('username', $q);\n $this->db->or_like('password', $q);\n $this->db->or_like('nama_lengkap', $q);\n $this->db->or_like('hak_akses', $q);\n $this->db->limit($limit, $start);\n return $this->db->get($this->table)->result();\n }",
"public function search() {\n $keyword = $this->input->post('keyword'); //menangkap inputan form name keyword\n $data['murid'] = $this->Murid_m->get_keyword($keyword); //memanggil method get_keyword pada model dengan inputannya adalah tangkapan inputan pada form keyword\n if(count($data['murid']) >= 6) {\n $data['footer_class'] = 'footer-class-in-edit-page';\n }\n $data['title'] = \"DATA SISWA PKL DEVELOPER\";\n $this->load->view('header_v');\n $this->load->view('crud/data_siswa_v', $data); //meload & mengirim data detail ke view 'detail'\n $this->load->view('footer_v', $data);\n }",
"function search($m_word, $page, $limit){\n// \t\t $_where .= \" or ( concat(' ', n.short_news) like '% \". implode(\"%' and concat(' ', n.short_news) like '% \", $m_word).\"%' )\";\n \t\t// $_where .= \" or ( concat(' ', n.full_news) LIKE '% \". implode(\"%' and concat(' ', n.full_news) LIKE '% \", $m_word).\"%' )\";\n \t\t// $_where .= \" or ( concat(' ', cn.content) LIKE '% \". implode(\"%' and concat(' ', cn.content) LIKE '% \", $m_word).\"%' )\";\n\t\t\n\n\t\t $_where = \"(c.name LIKE '%\". implode(\"%' and c.name LIKE '%\", $m_word).\"%')\";\n// \t\t $_where .= \" or ( concat(' ', n.short_news) like '% \". implode(\"%' and concat(' ', n.short_news) like '% \", $m_word).\"%' )\";\n \t\t $_where .= \" or (n.full_news LIKE '%\". implode(\"%' and n.full_news LIKE '% \", $m_word).\"%')\";\n \t\t $_where .= \" or (cn.content LIKE '%\". implode(\"%' and cn.content LIKE '%\", $m_word).\"%')\";\n\t\t\t\t\n\n \t\t\t$sql=sql_placeholder('select SQL_CALC_FOUND_ROWS c.id ,c.name, c.action , cn.content, n.full_news from\n \t\t\t\t\t?#FK_CATALOGID as c\n \t\t\t\t\tleft join ?#FK_CONTENT as cn on (c.id=cn.id) left join ?#FK_NEWS as n on (c.id=n.news_id)\n\n \t\t\t\t\twhere '.$_where.' and c.id>1 limit ?,?\n\n \t \t\t\t\t\t', ($page-1)*$limit, $limit);\n //echo $sql.\"<hr>\";\n $r=$this->db->_array_data($sql);\n\t\t \treturn array('data'=>$r, 'cnt'=>$this->db->getFoundRow());\n\n\n\t\t}",
"function get_limit_data($limit, $start = 0, $q = NULL) {\n $this->db->order_by($this->id, $this->order);\n $this->db->like('ID_DATA', $q);\n\t$this->db->or_like('NO_USER', $q);\n\t$this->db->or_like('NAME', $q);\n\t$this->db->or_like('JUDUL_DATA', $q);\n\t$this->db->or_like('ABSTRAK_DATA', $q);\n $this->db->or_like('BIDANG_DATA', $q);\n $this->db->or_like('JENIS_DATA', $q);\n\t$this->db->or_like('TAHUN_DATA', $q);\n\t$this->db->or_like('NAMA_BERKAS', $q);\n\t$this->db->limit($limit, $start);\n return $this->db->get($this->table)->result();\n }",
"public function get_data_blok($limit,$start)\n\t{\n\t\t$this->db->select('k.nama_kawasan, b.nama_blok, b.gambar, b.add_time, b.jumlah_unit, k.alamat, b.id_blok, b.keterangan as ket');\n\t\t$this->db->from('blok as b');\n\t\t$this->db->join('kawasan as k', 'k.id_kawasan = b.id_kawasan', 'inner');\n\t\t$this->db->limit($limit,$start);\n\t\t$this->db->order_by('b.keterangan', 'asc');\n\t\treturn $this->db->get();\n }",
"public function searchData($type='',$status='',$geo='',$io='',$am='',$id='',$content='',$search_value='',$order_column='',$order_dir='',$length='',$start='')\n\t{\n\t\t$sqlstring='';\n\t\t$str='';\n\t\t$sql=array();\n\t\t$sql2=array();\n\t\tif (!empty($type)) {\n\t\t\t$size=sizeof($type);\n\t\t\t$flag=0;\n\t\t\t//$str.=\"(\";\n\t\t\tfor($i=0;$i<$size;$i++)\n\t\t\t{\n\t\t\t\tif(!empty($type[$i])|| $type[$i]!=='All'){\n\t\t\t\t\t$flag=1;\n\t\t\t\t\t$str.=\"FIND_IN_SET(:type\".$i.\",c.type)>0 OR \";\n\t\t\t\t\t$sql[':type'.$i]=$type[$i];\n\t\t\t\t\t$sql2[':type'.$i]=\\Phalcon\\Db\\Column::TYPE_VARCHAR;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($flag==1){\n\t\t\t\t$str=preg_replace('/\\W\\w+\\s*(\\W*)$/', '$1', $str);\n\t\t\t\t//$str.=\")\";\n\t\t\t\t$str=\"(\".$str.\")\";\n\t\t\t\t$sqlstring .= $str.\" AND \";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//for multiselect purpose \n\t\tif (!empty($content)) {\n\t\t\t$str='';\n\t\t\t$size=sizeof($content);\n\t\t\t$flag=0;\n\t\t\t//$str.=\"(\";\n\t\t\tfor($i=0;$i<$size;$i++)\n\t\t\t{\n\t\t\t\tif(!empty($content[$i])|| $content[$i]!=='All'){\n\t\t\t\t\t$flag=1;\n\t\t\t\t\t$str.=\"FIND_IN_SET(:content\".$i.\",c.content)>0 OR \";\n\t\t\t\t\t$sql[':content'.$i]=$content[$i];\n\t\t\t\t\t$sql2[':content'.$i]=\\Phalcon\\Db\\Column::TYPE_VARCHAR;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($flag==1){\n\t\t\t\t$str=preg_replace('/\\W\\w+\\s*(\\W*)$/', '$1', $str);\n\t\t\t//$str.=\")\";\n\t\t\t\t$str=\"(\".$str.\")\";\n\t\t\t\t$sqlstring .= $str.\" AND \";\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($status)) {\n\t\t\t$sqlstring .= \"status=:status AND \";\n\t\t\t$sql[':status']=$status;\n\t\t\t$sql2[':status']=\\Phalcon\\Db\\Column::TYPE_VARCHAR;\n\t\t}\n\n\t\tif (!empty($io)) {\n\t\t\tif($io=='Y'){\n\t\t\t\t$sqlstring .= \"io IS NOT NULL AND \";\n\t\t\t}\n\t\t\telseif($io=='N')\n\t\t\t{\n\t\t\t\t$sqlstring .= \"io IS NULL AND \";\n\t\t\t}\n\t\t\n\t\t}\n\t\tif (!empty($am)) {\n\t\t\t$sqlstring .= \"am=:am AND \";\n\t\t\t$sql[':am']=$am;\n\t\t\t$sql2[':am']=\\Phalcon\\Db\\Column::TYPE_VARCHAR;\n\t\t}\n\t\tif (!empty($id)) {\n\t\t\tif($id!='true')\n\t\t\t{\n\t\t\t\t$sqlstring .= \"c.ag_id=:id AND \";\n\t\t\t\t$sql[':id']=$id;\n\t\t\t\t$sql2[':id']=\\Phalcon\\Db\\Column::TYPE_INTEGER;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//for multiselect\n\t\tif (!empty($geo)) {\n\t\t\t$str='';\n\t\t\t$nextstr='';\n\t\t\t$size=sizeof($geo);\n\t\t\t$flag=0;\n\t\t\tfor($i=0;$i<$size;$i++)\n\t\t\t{\t\n\t\t\t\tif(!empty($geo[$i]) || $geo[$i]!=='All'){\n\t\t\t\t\t$flag=1;\n\t\t\t\t\t$nextstr.=\"ct_id=:ct_id\".$i.\" OR \";\n\t\t\t\t\t$sql[':ct_id'.$i]=$geo[$i];\n\t\t\t\t\t$sql2[':ct_id'.$i]=\\Phalcon\\Db\\Column::TYPE_VARCHAR;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($flag==1){\n\t\t\t\t$str.=\"g.ag_id IN(SELECT g.ag_id FROM CRM__Geo as g\".(!empty($nextstr)? \" WHERE \" . $nextstr:'').\")\";\n\t\t\t\t$str=preg_replace('/\\W\\w+\\s*(\\W*)$/', '$1', $str);\n\t\t\t\t$sqlstring .= $str.\" AND \";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$sqlstring= preg_replace('/\\W\\w+\\s*(\\W*)$/', '$1', $sqlstring);\t\n\t\t$this->sqlstringonly=$sqlstring;\n\t\t\n\t\t$this->sqlg1=$sql;\n\t\t$this->sql2g1=$sql2;\n\t\t\n\t\t\n\t\t//dataTables section starts\n\t\t$search_value=$search_value;\n\t\t$order_column=$order_column;\n\t\t$order_dir=$order_dir;\n\t\t$length=$length;\n\t\t$start=$start;\n\t\t$variable='';\n\t\t$order=array('client','id','type','status','accountName','email','skype','geo','io','am',null);\n\t\tif($search_value!='')\n\t\t{\n\t\t\t\n\t\t\t$sqlstring.=\" AND (\n\t\t\tg.ct_id LIKE :data \n\t\t\tOR a.id LIKE :data \n\t\t\tOR a.agregator LIKE :data \n\t\t\tOR c.email LIKE :data \n\t\t\tOR c.type LIKE :data \n\t\t\tOR c.status LIKE :data \n\t\t\tOR c.accountName LIKE :data \n\t\t\tOR c.skype LIKE :data \n\t\t\tOR c.io LIKE :data \n\t\t\tOR c.am LIKE :data )\";\n\t\t\t$sql[':data']=\"%\".$search_value.\"%\";\n\t\t\t$sql2[':data']=\\Phalcon\\Db\\Column::TYPE_VARCHAR;\n\t\t}\n\t\n\t\t\n\t\t$sqlstring.=\" GROUP BY c.ag_id \";\n\t\tif($order_column!='')\n\t\t{\n\t\t\t$sqlstring.=\" ORDER BY \".$order[$order_column] .\" \". $order_dir;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sqlstring.=\" ORDER BY id ASC\"; \n\t\t}\n\t\t//$this->sql_nolimit=\"SELECT username,company_name from client\".(!empty($this->sql_string)? \" WHERE \" . $this->sql_string:'');\n\t\t$this->sqlprev=$sqlstring;\n\t\t$this->sqlg=$sql;\n\t\t$this->sql2g=$sql2;\n\t\tif($length!='')\n\t\t{\n\t\t\t//$sqlstring.=\" LIMIT \".$start.\",\".$length;\n\t\t\t$sqlstring.=\" LIMIT :start,:length\"; \n\t\t\t$sql[':start']=(int) trim($start);\n\t\t\t$sql2[':start']=\\Phalcon\\Db\\Column::TYPE_INTEGER;\n\t\t\t$sql[':length']=(int) trim($length);\n\t\t\t$sql2[':length']=\\Phalcon\\Db\\Column::TYPE_INTEGER;\n\t\t}\n\t\t\n\t\t//dataTables section ends\n\t\t\n\t\t$checksqlstring='';\n\t\tif($this->sqlstringonly!=''){\n\t\t\t$checksqlstring=\" WHERE hide IS NULL AND \" . $sqlstring;\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\t$checksqlstring=\" WHERE hide IS NULL \".$sqlstring;\n\t\t}\n\t\t\n\t\t$sql1=\"SELECT group_concat(g.ct_id) AS geo, a.id AS id,a.agregator AS client,c.email,c.private_profile as private_profile,c.type, c.status,c.accountName,c.skype,c.io, c.am FROM CRM__Client AS c INNER JOIN Agregators AS a ON c.ag_id=a.id LEFT JOIN CRM__Geo AS g ON g.ag_id=a.id\".(!empty($checksqlstring)? $checksqlstring:'');\n\t\ttry {\n\t\t//$sql1=\"SELECT group_concat(g.ct_id) AS geo, a.id AS id,a.agregator AS client,c.email, c.type, c.status,c.accountName,c.skype,c.io, c.am FROM (SELECT * FROM client \" . (!empty($sqlstring)? \" WHERE \" . $sqlstring:'').\") AS c INNER JOIN Agregators AS a ON c.ag_id=a.id INNER JOIN (SELECT * FROM geo \" . (!empty($string)? \" WHERE \" . $string:'').\" ) AS g ON g.ag_id=c.ag_id GROUP BY c.ag_id LIMIT \".$limit.\",\" .$increase_value .\" \";\n\t\t//echo $sql1;\n\t\t$statement = $this->getDi()->getDb4()->prepare($sql1);\n $exe = $this->getDi()->getDb4()->executePrepared($statement,$sql,$sql2);\n return $exe->fetchAll(PDO::FETCH_ASSOC);\n\t\t} catch (PDOException $e) {\n return $e->getMessage();\n } \n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ / View de Incidencias | public function incidencia() {
return view('Front.incidencia');
} | [
"public static function ver_todas_incidencias(){\n\n\t\tsession_start();\n\n\t\t$user = $_SESSION['logged_user'];\n\n\t\tView::set(\"user\", $user);\n\n\t\t/* */\n\t\t$incidenciasDeManager = Incidencias::getIncidenciasDeUsuario($user->id);\n\n\t\tif ( $incidenciasDeManager != null ){\n\n\t\t\t/* incidencias Del Manager */\n\t\t\tView::set(\"incidenciasDeManager\", $incidenciasDeManager);\n\n\t\t} else {\n\t\t\tView::set(\"no_incidencias_de_Manager\", \"no_incidenciasDeManager\");\n\t\t}\n\n\t\t/* */\n\t\t$incidenciasDeEmpresa = Incidencias::getIncidenciasDeEmpresa($user->empresaId);\n\n\t\tif ( $incidenciasDeEmpresa != null ){\n\n\t\t\t/* Incidencias de toda la Empresa */\n\t\t\tView::set(\"incidencias\", $incidenciasDeEmpresa);\n\n\t\t} else {\n\t\t\tView::set(\"no_incidencias\", \"no_incidencias\");\n\t\t}\n\n\t\t$opcionMenu = \"ver_todas_incidencias\";\n\t\tView::set(\"opcionMenu\", $opcionMenu);\n\t\t\n\t\t$titulo = $_SESSION['logged_user_saludo'];\n\t\tView::set(\"pageTitle\", $titulo . \" | Portal Gerentes | Lanuza Group SAS\");\n\n\t\tView::render( \"portal_manager_home\" );\n\t}",
"protected function viewAction()\n {\n $id = $this->_getParam('id', 0);\n $select = $this->model->select()->where('co_seq_'.$this->crud.' =?', $id);\n $select->where('st_registro=?', 1);\n $select->order('nm_'.$this->crud.' DESC');\n $stmt = $select->query()->fetchAll();\n $this->view->dados = $stmt[0];\n }",
"public static function ver_incidencias(){\n\n\t\tsession_start();\n\n\t\t$user = $_SESSION['logged_user'];\n\n\t\tView::set(\"user\", $user);\n\n\t\t$incidencias = Incidencias::getIncidenciasDeUsuario($user->id);\n\n\t\tif ( $incidencias != null ){\n\n\t\t\t/* Incidencias */\n\t\t\tView::set(\"incidencias\", $incidencias);\n\n\t\t} else {\n\t\t\tView::set(\"no_incidencias\", \"no_incidencias\");\n\t\t}\n\n\t\t$opcionMenu = \"ver_incidencias\";\n\t\tView::set(\"opcionMenu\", $opcionMenu);\n\t\t\n\t\t$titulo = $_SESSION['logged_user_saludo'];\n\t\tView::set(\"pageTitle\", $titulo . \" | Portal Clientes | Lanuza Group SAS\");\n\n\t\tView::render( \"portal_client_home\" );\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $condicionVias = $em->getRepository('EncuestaBundle:CondicionVia')->findAll();\n\n return $this->render('condicionvia/index.html.twig', array(\n 'condicionVias' => $condicionVias,\n ));\n }",
"public function auditoria()\n {\n if (isset($this->view))\n $this->view->render(SYS,'listagem/auditoria');\n }",
"public function incidencia()\n {\n $crud = new grocery_CRUD();\n $crud->set_table('incidencia');\n $output = $crud->render();\n\n $this->output($output);\n }",
"public function visualizarAction()\n\t{\n\t\t$id = array('id_corretor = ?' => (int) $this->_getParam('id'));\n\t\t$list = $this->_model->listar($id);\n\n\t\t$this->view->list = $list;\n\t}",
"public function index()\n {\n $module = Module::get('Citas');\n $clientes= Cliente::all();\n $cliente='';\n $sucursales= Sucursal::all();\n $sucursal = '';\n $servicios= Servicio::all();\n $servicio = '';\n $horarios = Horario::all();\n $horario = '';\n if(Module::hasAccess($module->id)) {\n return View('citas', [\n 'show_actions' => $this->show_action,\n 'listing_cols' => $this->listing_cols,\n 'module' => $module,\n 'clientes' => $clientes,\n 'cliente' => $cliente,\n 'sucursales' => $sucursales,\n 'sucursal' => $sucursal,\n 'servicios' => $servicios,\n 'servicio' => $servicio,\n 'horarios' => $horarios,\n 'horario' => $horario\n ]);\n } else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $seguimientoIndicadors = $em->getRepository('AppBundle:SeguimientoIndicador')->findAll();\n\n return $this->render('AppBundle:seguimientoindicador:index.html.twig', array(\n 'seguimientoIndicadors' => $seguimientoIndicadors,\n )); \n }",
"public function indexAction() { \n \n $curso = new Admin_Model_Curso();\n $dados = $curso->find();\n\n $this->view->assign('curso', $dados);\n $this->view->messages = $this->_flashMessenger->getMessages();\n $this->render();\n }",
"public function mostrarListaIncidencias() {\n\t\t\t$idUsuario = $_SESSION[\"idUsuario\"];\n\t\t\t$data['listaIncidencias'] = $this->incidencia->getAll();\n\t\t\t$this->vista->mostrar(\"incidencia/mostrarListaIncidencias\", $data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $Conservacaos = $em->getRepository('AppBundle:Conservacao')->findAll();\n\n return $this->render('Conservacao/index.html.twig', array(\n 'Conservacaos' => $Conservacaos,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $accueils = $em->getRepository('TestBundle:Accueil')->findAll();\n\n return $this->render('TestBundle:accueil:index.html.twig', array(\n 'accueils' => $accueils,\n ));\n }",
"public function index(){ \n $this->view->setProp($this->model->getDataout());\n //afegir configuració per ruta publica, enllaços, css ,js...\n $this->view->addProp(array('APP_W'=>$this->conf->APP_W));\n $this->view->setTemplate(APP.'/public/tpl/carrito.php');\n $this->view->render(); \n }",
"public function listarinc($id) {\n\t\t$cliente = Cliente::find($id);\n\t\t$incidencias = Incidencia::join('cliente_vehiculo', 'incidencias.alquiler_id', '=', 'cliente_vehiculo.id')\n\t\t\t\t\t\t\t->join('clientes', 'cliente_vehiculo.cliente_id', '=', 'clientes.id')\n\t\t\t\t\t\t\t->select('incidencias.*')\n\t\t\t\t\t\t\t->where('cliente_id',$id)\n\t\t\t\t\t\t\t->paginate(8);\n\t\t$count = count($incidencias);\n\t\t$ordenar = false;\n\t\t$subtitulo = 'Incidencias del cliente: '.$cliente->nom.' '.$cliente->ape;\n\t\treturn \\View::make('Incidencia/rejillaIncidencias',compact('incidencias'),['count'=>$count, 'ordenar'=>$ordenar, 'subtitulo'=>$subtitulo]);\n\t}",
"public function mostrarActividades(){\n\n $this->view->show(\"Horario\");\n }",
"public function buscar() {\n\n\t\t\t$auditoria = new Auditoria;\n\n\t\t\t$auditoria->include_related('usuario', '*');\n\t\t\t$auditoria->include_related('usuario/persona', '*');\n\t\t\t$auditoria->include_related('usuario/perfile', '*');\n\t\t\t$auditoria->order_by('id', 'DESC');\n\t\t\t$auditoria->get();\n\n\t\t\t$this->url_view = $this->url_modulo.'/'.$this->url_menu.'/'.$this->url_crud;\n\n\t\t\t$this->datos_view = array('auditorias' => $auditoria);\t\t\n\t\t\n\t\t//---------------------------------Cargar Vistas-------------------------------------\n\t\t\n\t\t\tlayout_all($this->titulo, $this->url_view, $this->datos_view, $this->view_menu, $this->datos_menu, $this->datos_crud);\t // Carga layouts.\n\n\t\t//-----------------------------------------------------------------------------------\n\t\t\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $condidats = $em->getRepository('RHBundle:Condidat')->findAll();\n\n return $this->render('condidat/index.html.twig', array(\n 'condidats' => $condidats,\n ));\n }",
"public function cargaretiquetasAction()\r\n\t\t{\r\n\t\t\t$controller = $this->_request->getControllerName();\r\n\t\t\t$vista = $this->_request->getPost('vista');\r\n\t\t\tif (!$vista)\r\n\t\t\t\t$vista = $controller;\r\n\t\t\t$perfil = $this->getPerfil();\r\n\t\t\t\r\n\t\t\t$file = \"views/idioma/{$perfil['idioma']}/$controller/$vista.json\";\r\n\t\t\tif (file_exists($file))\r\n\t\t\t{\r\n\t\t\t\tif (is_readable($file))\r\n\t\t\t\t\techo file_get_contents($file);\r\n\t\t\t\telse\r\n\t\t\t\t\tthrow new ZendExt_Exception('E011');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tthrow new ZendExt_Exception('E010');\t\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getAccessString If the accesskey is found in the specified string, underlines it | public function getAccessString($str)
{
$access = $this->getAccessKey();
if (!empty($access) && (false !== ($pos = strpos($str, $access)))) {
return htmlspecialchars(substr($str, 0, $pos), ENT_QUOTES)
. '<span style="text-decoration: underline;">'
. htmlspecialchars(substr($str, $pos, 1), ENT_QUOTES) . '</span>'
. htmlspecialchars(substr($str, $pos + 1), ENT_QUOTES);
}
return htmlspecialchars($str, ENT_QUOTES);
} | [
"function getAccessString( $str )\r\n {\r\n $access = $this->getAccessKey();\r\n if ( !empty($access) && ( false !== ($pos = strpos($str, $access)) ) ) {\r\n return htmlspecialchars(substr($str, 0, $pos), ENT_QUOTES) . '<span style=\"text-decoration: underline;\">' . htmlspecialchars(substr($str, $pos, 1), ENT_QUOTES) . '</span>' . htmlspecialchars(substr($str, $pos+1), ENT_QUOTES);\r\n }\r\n return htmlspecialchars($str, ENT_QUOTES);\r\n }",
"function find_accesskey($string) {\n $found = array();\n $matched = preg_match('/<em>([a-zA-Z])<\\/em>/', $string, $found);\n if ($matched != 1) {\n return null;\n\t}\n return strtolower($found[1]);\n}",
"function highlightAccessKey($label, $accessKey)\n {\n $stripped_label = Horde::stripAccessKey($label);\n\n if (empty($accessKey)) {\n return $stripped_label;\n }\n\n if (isset($GLOBALS['nls']['multibyte'][NLS::getCharset(true)])) {\n /* Prefix parenthesis with the UTF-8 representation of the LRO\n * (Left-to-Right-Override) Unicode codepoint U+202D. */\n $prefix = NLS::getCharset() == 'UTF-8' ? \"\\xe2\\x80\\xad\" : '';\n return $stripped_label . $prefix . '(<span class=\"accessKey\">'\n . strtoupper($accessKey) . '</span>' . ')';\n } else {\n return str_replace('_' . $accessKey, '<span class=\"accessKey\">' . $accessKey . '</span>', $label);\n }\n }",
"public function getAccesskey(): string\n {\n return $this->accesskey;\n }",
"public function accesskey($name)\n {\n wfProfileIn(__METHOD__);\n \n $accesskey = wfMsg(\"accesskey-$name\");\n \n // FIXME: Per standard MW behavior, a value of '-' means to suppress the\n // attribute, but this is broken for accesskey: that might be a useful\n // value.\n if ($accesskey != '' && $accesskey != '-' && ! wfEmptyMsg(\"accesskey-$name\", $accesskey))\n {\n wfProfileOut(__METHOD__);\n return $accesskey;\n }\n \n wfProfileOut(__METHOD__);\n return false;\n }",
"public function getAccesskey()\n {\n return $this->accesskey;\n }",
"public function getAccessKey() {\n\t\treturn $this->getStdAttrib('accesskey');\n\t}",
"public function getAccessName();",
"public function setAccesskey($var)\n {\n GPBUtil::checkString($var, True);\n $this->accesskey = $var;\n\n return $this;\n }",
"public static function getAccessStr($accessType)\n\t{\n\t\t$tr = Zend_Registry::get('Zend_Translate');\n\t\tif($accessType == Category::ACCESS_SHARED)return $tr->translate('Shared');\n\t\tif($accessType == Category::ACCESS_PUBLIC)return $tr->translate('Public');\n\t\tif($accessType == Category::ACCESS_PRIVATE) return $tr->translate('Private');\n\t}",
"function getAttribute($a_func_id)\n\t{\n\t\t$key = ilAccessKey::getKey($a_func_id);\n\t\t\n\t\tif ($key != \"\")\n\t\t{\n\t\t\treturn 'accesskey=\"'.$key.'\"';\n\t\t}\n\t\t\n\t\treturn \"\";\n\t}",
"function access_key_gui()\n\t{\n\t\t\t$access_key = get_option('amazon_polly_access_key');\n\t\t\techo '<input type=\"text\" class=\"regular-text\" name=\"amazon_polly_access_key\" id=\"amazon_polly_access_key\" value=\"' . esc_attr($access_key) . '\" autocomplete=\"off\"> ';\n\t\t\techo '<p class=\"description\" id=\"amazon_polly_access_key\">Required only if you aren\\'t using IAM roles</p>';\n\n\t}",
"function get_access_description ($accessvalue) {\n \n if ($accessvalue != \"PUBLIC\") {\n if ($accessvalue == \"LOGGED_IN\") {\n $title = \"[\" . __gettext(\"Logged in users\") . \"] \";\n } else if (substr_count($accessvalue, \"user\") > 0) {\n $title = \"[\" . __gettext(\"Private\") . \"] \";\n } else {\n $title = \"[\" . __gettext(\"Restricted\") . \"] \";\n if (substr_count($accessvalue, \"community\") > 0) {\n $name = user_name(str_replace(\"community\", '', $accessvalue));\n $title = '<span title=\"' . __gettext('Restricted to Community: ') . $name . '\">' . $title . '</span>';\n } else if (substr_count($accessvalue, \"group\") > 0) {\n $title = '<span title=\"' . __gettext('Restricted to Group') . '\">' . $title . '</span>';\n }\n }\n } else {\n $title = \"\";\n }\n \n return $title;\n}",
"public function set_accesskey($value)\r\n\t{\r\n\t\treturn $this->set_attr('accesskey', $value);\r\n\t}",
"function getAccessKeyAndTitle($label, $nocheck = false)\n {\n $ak = Horde::getAccessKey($label, $nocheck);\n $attributes = 'title=\"' . Horde::stripAccessKey($label);\n if (!empty($ak)) {\n $attributes .= sprintf(_(\" (Accesskey %s)\"), $ak);\n $attributes .= '\" accesskey=\"' . $ak;\n }\n return $attributes . '\"';\n }",
"public function getAccessName()\n {\n return $this->access_name;\n }",
"protected function buildAccessLabel( string $access ): string\n\t{\n\t\t$label\t= $access;\n\t\tif( array_key_exists( $access, $this->words['access'] ) ){\n\t\t\t$label\t= $this->words['access'][$access];\n\t\t\tif( array_key_exists( $access, $this->words['accessAcronym'] ) )\n\t\t\t\t$label\t= HtmlElements::Acronym( $label, $this->words['accessAcronym'][$access] );\n\t\t}\n\t\treturn $label;\n\t}",
"static public function getAccessKey($label, $nocheck = false,\n $shutdown = false)\n {\n /* Shutdown call for translators? */\n if ($shutdown) {\n if (!count(self::$_labels)) {\n return;\n }\n $script = basename($_SERVER['PHP_SELF']);\n $labels = array_keys(self::$_labels);\n sort($labels);\n $used = array_keys(self::$_used);\n sort($used);\n $remaining = str_replace($used, array(), 'abcdefghijklmnopqrstuvwxyz');\n self::logMessage('Access key information for ' . $script);\n self::logMessage('Used labels: ' . implode(',', $labels));\n self::logMessage('Used keys: ' . implode('', $used));\n self::logMessage('Free keys: ' . $remaining);\n return;\n }\n\n /* Use access keys at all? */\n if (!isset(self::$_noAccessKey)) {\n self::$_noAccessKey = !$GLOBALS['browser']->hasFeature('accesskey') || !$GLOBALS['prefs']->getValue('widget_accesskey');\n }\n\n if (self::$_noAccessKey || !preg_match('/_([A-Za-z])/', $label, $match)) {\n return '';\n }\n $key = $match[1];\n\n /* Has this key already been used? */\n if (isset(self::$_used[strtolower($key)]) &&\n !($nocheck && isset(self::$_labels[$label]))) {\n return '';\n }\n\n /* Save key and label. */\n self::$_used[strtolower($key)] = true;\n self::$_labels[$label] = true;\n\n return $key;\n }",
"public function evaluateAccessCode(String $code);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return information about given class import. | public function getImport(string $class): ImportInfo
{
if ($this->hasImport($class)) {
return $this->imports[$class];
}
throw new RuntimeException("$class is not imported into current namespace.");
} | [
"public function get_import_info(): import_info {\n return $this->importinfo;\n }",
"function include_import_class($import_class) {\n\tif (file_exists(ABSPATH . '/includes/import-classes/' . $import_class)) {\n\t\trequire_once(ABSPATH . '/includes/import-classes/' . $import_class);\n\t}\n}",
"public function importClass($importClass = null)\n {\n if(null === $importClass)\n {\n return $this->property('importClass');\n }\n return $this->property('importClass', trim($importClass));\n }",
"function getImportType()\n\t\t{\n\t\t\treturn $this->import_type;\n\t\t}",
"function classkit_import($filename){}",
"public function get_import_instance() {\n\t\treturn $this->import;\n\t}",
"public function getInfoClass(): string\n {\n return $this->info_class;\n }",
"protected function getClassInformation()\n {\n if ($this->classInformation === null) {\n $globalRegistry = DGlobalRegistry::load();\n $this->classInformation = $globalRegistry->getHive(DClassInformation::class);\n }\n\n return $this->classInformation;\n }",
"private function getClassesLine()\n {\n return $this->file[$this->summaryLine+1];\n }",
"public function getTypeImport() {\n return $this->typeImport;\n }",
"public function getImportInformation()\n {\n $lastImport = LengowMain::getLastImport();\n $lastImportDate = $lastImport['timestamp'] === 'none'\n ? $this->locale->t('toolbox.index.last_import_none')\n : LengowMain::getDateInCorrectFormat($lastImport['timestamp'], true);\n if ($lastImport['type'] === 'none') {\n $lastImportType = $this->locale->t('toolbox.index.last_import_none');\n } elseif ($lastImport['type'] === LengowImport::TYPE_CRON) {\n $lastImportType = $this->locale->t('toolbox.index.last_import_cron');\n } else {\n $lastImportType = $this->locale->t('toolbox.index.last_import_manual');\n }\n if (LengowImport::isInProcess()) {\n $importInProgress = LengowMain::decodeLogMessage(\n 'toolbox.index.rest_time_to_import',\n null,\n array('rest_time' => LengowImport::restTimeToImport())\n );\n } else {\n $importInProgress = $this->locale->t('toolbox.index.no_import');\n }\n $checklist = array();\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.global_token'),\n 'message' => LengowConfiguration::get('LENGOW_GLOBAL_TOKEN'),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.url_import'),\n 'message' => LengowMain::getImportUrl(),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.import_in_progress'),\n 'message' => $importInProgress,\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_last_import'),\n 'message' => $lastImportDate,\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_type_import'),\n 'message' => $lastImportType,\n );\n return $this->getAdminContent($checklist);\n }",
"public function testWhenClassDefinitionIsFoundInContentsThenReturnClassNameInResponse()\n {\n $response = Importer::getClassDetails($this->contents[1]);\n static::assertEquals('Region', $response->className);\n }",
"public function getClassAces();",
"public function get_import_type_class( $import_type ) {\n\n\t\tif ( isset( $this->import_class_mapping[ $import_type ] ) ) {\n\t\t\treturn $this->import_class_mapping[ $import_type ];\n\t\t}\n\n\t\treturn 'Kalium_Demo_Content_Import_Type';\n\t}",
"function getImportStatus();",
"public function fetch_class()\n\t{\n\t\treturn $this->route_stack[self::SEG_CLASS];\n\t}",
"protected function scanClass()\n {\n return $this->scanInput('/^\\.([\\w-]+)/', 'class');\n }",
"public function getClasses() {\n return $this->info['classes'];\n }",
"public static function getImporterFormClass(): ?string;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the minimum number of identical tokens (default: 70). | public function setMinTokens($minTokens)
{
$this->minTokens = $minTokens;
} | [
"public function &setMltMaxNumTokens ($value) {}",
"public function setMltMaxNumTokens(int $value): \\SolrQuery {}",
"public function setMaximumNumberOfTokens(int $maximum): self;",
"public function increaseWrongTokenCount()\n {\n ++$this->wrongTokenCount;\n }",
"public function getMinimalTokenCount()\n {\n return $this->minimalTokenCount;\n }",
"public function getMltMaxNumTokens(): int {}",
"public function setMaximumNumberOfTokens($maximum)\n {\n return $this->setOption('maximumnumberoftokens', $maximum);\n }",
"public function setMinOccurances($num);",
"public function getMinimalTokenLength()\n {\n return $this->minimalTokenLength;\n }",
"public function setMinOccurances($num)\n {\n if(is_integer($num) === false){\n throw new GeneratorException('Number must be an integer');\n }\n \n $this[self::REPEAT_MIN_INDEX] = $num;\n }",
"public function setAutoTokens(DeckModel $deck)\n {\n $defEntityCard = $this->defEntity()->card();\n\n $data = $deck->getData();\n $tokens = count($data->Tokens);\n\n // initialize token keyword counter array\n $tokenKeywords = XmlKeyword::tokenKeywords();\n $tokenValues = array_fill(0, count($tokenKeywords), 0);\n $distinctKeywords = array_combine($tokenKeywords, $tokenValues);\n\n // count token keywords\n foreach (['Common', 'Uncommon', 'Rare'] as $rarity) {\n foreach ($data->$rarity as $cardId) {\n if ($cardId > 0) {\n $currentCard = $defEntityCard->getCard($cardId);\n\n $keywords = $currentCard->getData('Keywords');\n $words = explode(\",\", $keywords);\n\n foreach ($words as $word) {\n // remove parameter if present\n $word = preg_split(\"/ \\(/\", $word, 0);\n $word = $word[0];\n\n if (in_array($word, $tokenKeywords)) {\n $distinctKeywords[$word]++;\n }\n }\n }\n }\n }\n\n // get most present token keywords\n arsort($distinctKeywords);\n\n // remove keywords with zero presence\n $distinctKeywords = array_diff($distinctKeywords, [0]);\n $newTokens = array_keys(array_slice($distinctKeywords, 0, $tokens));\n\n // add empty tokens when there are not enough token keywords\n if (count($newTokens) < $tokens) {\n $newTokens = array_pad($newTokens, $tokens, 'none');\n }\n\n // adjust array keys\n $newTokens = array_combine(array_keys(array_fill(1, count($newTokens), 0)), $newTokens);\n $deck->setTokens($newTokens);\n }",
"public function setPasscodeMinimumCharacterSetCount($val)\n {\n $this->_propDict[\"passcodeMinimumCharacterSetCount\"] = intval($val);\n return $this;\n }",
"public function getMltMaxNumTokens () {}",
"private function getTokenLenght(){\n return 8;\n }",
"public function setPasswordMinimumCharacterSetCount($val)\n {\n $this->_propDict[\"passwordMinimumCharacterSetCount\"] = intval($val);\n return $this;\n }",
"public function getMltMaxNumTokens() {}",
"public function resetTokens() {\n\t\t$this->tokens = $this->initialMarking;\n\t}",
"public function settings()\n {\n $this->settings = ['max_token_length' => ['integer', 255] ];\n }",
"public function testSetInvalidTokenLength()\n {\n try {\n $this->_formHelperToken->setTokenLength(1);\n $this->fail('An expected Idun_Form_Helper_Exception has not been raised.');\n } catch (Idun_Form_Helper_Exception $exception) {\n $this->assertEquals('Token length must be greater or equal 6.', $exception->getMessage());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |