query
stringlengths
11
3.13k
ru_query
stringlengths
9
3.91k
document
stringlengths
18
71k
metadata
dict
negatives
listlengths
0
100
negative_scores
listlengths
0
100
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Detect and get quote character Return the correct character used to quote identifiers (table names, column names etc) by looking at the driver being used by \PDO.
Обнаружить и получить символ кавычки Возвращает правильный символ, используемый для ковычек идентификаторов (названия таблиц, названия столбцов и т.д.), анализируя драйвер, используемый \PDO.
private function _detectQuoteCharacter() { switch($this->_db->getAttribute(\PDO::ATTR_DRIVER_NAME)) { case 'pgsql': case 'sqlsrv': case 'dblib': case 'mssql': case 'sybase': return '"'; case 'mysql': case 'sqlite': case 'sqlite2': default: return '`'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function _detect_identifier_quote_character() {\n switch(static::$_db->getAttribute(PDO::ATTR_DRIVER_NAME)) {\n case 'pgsql':\n case 'sqlsrv':\n case 'dblib':\n case 'mssql':\n case 'sybase':\n return '\"';\n case 'mysql':\n case 'sqlite':\n case 'sqlite2':\n default:\n return '`';\n }\n }", "private function get_quote_style() {\n switch($this->stmt->getAttribute(parent::ATTR_DRIVER_NAME)) {\n case 'pgsql':\n case 'sqlsrv':\n case 'dblib':\n case 'mssql':\n case 'sybase':\n return '\"';\n case 'mysql':\n case 'sqlite':\n case 'sqlite2':\n default:\n return '`';\n }\n }", "public static function getQuoteNameChar(): string {\n return '`';\n }", "public static function _setup_identifier_quote_character() {\n \n if (is_null(static::$_config['identifier_quote_character'])) {\n static::$_config['identifier_quote_character'] = static::_detect_identifier_quote_character();\n }\n }", "protected function quote_char()\n {\n }", "function _quote($str) \n {\n global $_DB_DATAOBJECT;\n return (empty($_DB_DATAOBJECT['CONFIG']['db_driver']) || \n ($_DB_DATAOBJECT['CONFIG']['db_driver'] == 'DB'))\n ? $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->quoteSmart($str)\n : $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->quote($str);\n }", "public function quoteIdentifier($identifier)\n {\n if (isset(self::$quotedIdentifiers[$this->driver][$identifier])) {\n return self::$quotedIdentifiers[$this->driver][$identifier];\n }\n $addQuotes = false;\n if (preg_match('/^[^0-9][0-9a-z_]+$/i', $identifier) == false) { // Does the column contain a strange character?\n $addQuotes = true;\n } else {\n // generic keywords (included in both sqlite and mysql)\n $keywords = array('ADD', 'ALL', 'ALTER', 'ANALYZE', 'AND', 'AS', 'ASC', 'BEFORE', 'BETWEEN', 'BY', 'CASCADE', 'CASE', 'CHECK', 'COLLATE', 'COLUMN', 'CONSTRAINT', 'CREATE', 'CROSS', 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'DATABASE', 'DEFAULT', 'DELETE', 'DESC', 'DISTINCT', 'DROP', 'EACH', 'ELSE', 'EXISTS', 'EXPLAIN', 'FOR', 'FOREIGN', 'FROM', 'GROUP', 'HAVING', 'IF', 'IGNORE', 'IN', 'INDEX', 'INNER', 'INSERT', 'INTO', 'IS', 'JOIN', 'KEY', 'LEFT', 'LIKE', 'LIMIT', 'MATCH', 'NATURAL', 'NOT', 'NULL', 'ON', 'OR', 'ORDER', 'OUTER', 'PRIMARY', 'REFERENCES', 'REGEXP', 'RELEASE', 'RENAME', 'REPLACE', 'RESTRICT', 'RIGHT', 'SELECT', 'SET', 'TABLE', 'THEN', 'TO', 'TRIGGER', 'UNION', 'UNIQUE', 'UPDATE', 'USING', 'VALUES', 'WHEN', 'WHERE');\n if ($this->driver === 'mysql') {\n $keywords = array_merge($keywords, array('ACCESSIBLE', 'ASENSITIVE', 'BIGINT', 'BINARY', 'BLOB', 'BOTH', 'CALL', 'CHANGE', 'CHAR', 'CHARACTER', 'CONDITION', 'CONTINUE', 'CONVERT', 'CURRENT_USER', 'CURSOR', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DEC', 'DECIMAL', 'DECLARE', 'DELAYED', 'DESCRIBE', 'DETERMINISTIC', 'DISTINCTROW', 'DIV', 'DOUBLE', 'DUAL', 'ELSEIF', 'ENCLOSED', 'ESCAPED', 'EXIT', 'FALSE', 'FETCH', 'FLOAT', 'FLOAT4', 'FLOAT8', 'FORCE', 'FULLTEXT', 'GENERAL', 'GRANT', 'HIGH_PRIORITY', 'HOUR_MICROSECOND', 'HOUR_MINUTE', 'HOUR_SECOND', 'IGNORE_SERVER_IDS', 'INFILE', 'INOUT', 'INSENSITIVE', 'INT', 'INT1', 'INT2', 'INT3', 'INT4', 'INT8', 'INTEGER', 'INTERVAL', 'ITERATE', 'KEYS', 'KILL', 'LEADING', 'LEAVE', 'LINEAR', 'LINES', 'LOAD', 'LOCALTIME', 'LOCALTIMESTAMP', 'LOCK', 'LONG', 'LONGBLOB', 'LONGTEXT', 'LOOP', 'LOW_PRIORITY', 'MASTER_HEARTBEAT_PERIOD', 'MASTER_SSL_VERIFY_SERVER_CERT', 'MAXVALUE', 'MAXVALUE', 'MEDIUMBLOB', 'MEDIUMINT', 'MEDIUMTEXT', 'MIDDLEINT', 'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'MOD', 'MODIFIES', 'NO_WRITE_TO_BINLOG', 'NUMERIC', 'OPTIMIZE', 'OPTION', 'OPTIONALLY', 'OUT', 'OUTFILE', 'PRECISION', 'PROCEDURE', 'PURGE', 'RANGE', 'READ', 'READS', 'READ_WRITE', 'REAL', 'REPEAT', 'REQUIRE', 'RESIGNAL', 'RESIGNAL', 'RETURN', 'REVOKE', 'RLIKE', 'SCHEMA', 'SCHEMAS', 'SECOND_MICROSECOND', 'SENSITIVE', 'SEPARATOR', 'SHOW', 'SIGNAL', 'SIGNAL', 'SLOW', 'SMALLINT', 'SPATIAL', 'SPECIFIC', 'SQL', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNING', 'SQL_BIG_RESULT', 'SQL_CALC_FOUND_ROWS', 'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN', 'TERMINATED', 'TINYBLOB', 'TINYINT', 'TINYTEXT', 'TRAILING', 'TRUE', 'UNDO', 'UNLOCK', 'UNSIGNED', 'USAGE', 'USE', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'VARBINARY', 'VARCHAR', 'VARCHARACTER', 'VARYING', 'WHILE', 'WITH', 'WRITE', 'XOR', 'YEAR_MONTH', 'ZEROFILL'));\n } elseif ($this->driver === 'sqlite') {\n $keywords = array_merge($keywords, array('ABORT', 'ACTION', 'AFTER', 'ATTACH', 'AUTOINCREMENT', 'BEGIN', 'CAST', 'COMMIT', 'CONFLICT', 'DEFERRABLE', 'DEFERRED', 'DETACH', 'END', 'ESCAPE', 'EXCEPT', 'EXCLUSIVE', 'FAIL', 'FULL', 'GLOB', 'IMMEDIATE', 'INDEXED', 'INITIALLY', 'INSTEAD', 'INTERSECT', 'ISNULL', 'NO', 'NOTNULL', 'OF', 'OFFSET', 'PLAN', 'PRAGMA', 'QUERY', 'RAISE', 'REINDEX', 'ROLLBACK', 'ROW', 'SAVEPOINT', 'TEMP', 'TEMPORARY', 'TRANSACTION', 'VACUUM', 'VIEW', 'VIRTUAL'));\n }\n if (in_array(strtoupper($identifier), $keywords)) {\n $addQuotes = true;\n }\n }\n if ($addQuotes) {\n $identifier = '`' . str_replace('`', '``', $identifier) . '`';\n }\n self::$quotedIdentifiers[$this->driver][$identifier] = $identifier;\n\n return $identifier;\n }", "function db_quote($param='') {\n global $db;\n return $db->qstr($param, get_magic_quotes_gpc());\n}", "public function quoteIdentifier()\n {\n return $this->escape;\n }", "public function getDriverName()\n\t{\n\t\tif($this->_driverName!==null)\n\t\t\treturn $this->_driverName;\n\t\telseif(($pos=strpos($this->connectionString,':'))!==false)\n\t\t\treturn $this->_driverName=strtolower(substr($this->connectionString,0,$pos));\n\t\t//return $this->getAttribute(PDO::ATTR_DRIVER_NAME);\n\t}", "public function testAdapterQuoteIntoDoubleQuote()\n {\n $value = $this->_db->quoteInto('id=?', 'St John\"s Wort');\n $this->assertEquals(\"id='St John\\\"s Wort'\", $value);\n }", "public function testAdapterQuoteIntoDoubleQuote()\n {\n $value = $this->_db->quoteInto('id=?', 'St John\"s Wort');\n $this->assertEquals(\"id='St John\\\"s Wort'\", $value);\n }", "public function testAdapterQuoteDoubleQuote()\n {\n $value = $this->_db->quote('St John\"s Wort');\n $this->assertEquals(\"'St John\\\"s Wort'\", $value);\n }", "public function testAdapterQuoteDoubleQuote()\n {\n $value = $this->_db->quote('St John\"s Wort');\n $this->assertEquals(\"'St John\\\"s Wort'\", $value);\n }", "public function getDriver(): string\n {\n return $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME);\n }", "public function getDriverName()\n {\n return $this->pdo->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n }", "function serendipity_db_escape_string($string) {\n global $serendipity;\n return substr($serendipity['dbConn']->getPlatform()->quoteValue($string), 1, -1); # quoteValue escapes and quotes, but outer quotation is done manually, hence the substr\n}", "public function getQuoteIdentifierSymbol()\n {\n return '';\n }", "private function _setupQuoteCharacter()\n\t{\n\t\tif(is_null($this->_config['quote_character']))\n\t\t{\n\t\t\t$this->_config['quote_character'] = $this->_detectQuoteCharacter();\n\t\t}\n\t}", "public function testAdapterQuoteSingleQuote()\n {\n $string = \"St John's Wort\";\n $value = $this->_db->quote($string);\n $this->assertEquals(\"'St John''s Wort'\", $value);\n }", "public function testAdapterQuoteSingleQuote()\n {\n $string = \"St John's Wort\";\n $value = $this->_db->quote($string);\n $this->assertEquals(\"'St John''s Wort'\", $value);\n }", "abstract protected function getAccidentQuote();", "public function getDriverName() {\n\t\treturn $this->getAttribute(PDO::ATTR_DRIVER_NAME);\n\t}", "public function getDriverName(): string\n {\n $this->connect();\n\n return $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME);\n }", "private function handleQuote($char) {\n\t\tif (!$this->inQuotedString && trim($this->buffer) == \"\") {\n\t\t\t$this->inQuotedString = $char;\n\t\t} elseif ($char == $this->inQuotedString) {\n\t\t\t$this->inQuotedString = false;\n\t\t} else {\n\t\t\t$this->buffer .= $char;\n\t\t}\n\t}", "public function getDriverName()\n\t{\n\t if (($pos=strpos($this->connectionString, ':'))!==false)\n\t {\n\t return strtolower(substr($this->connectionString, 0, $pos));\n\t }\n\t return '';\n\t}", "public function get_driver()\n {\n return $this->getdbh()->getAttribute(PDO::ATTR_DRIVER_NAME);\n }", "function quoteIdentifier($str)\r\n {\r\n return '`' . $str . '`';\r\n }", "public function getQuoteNames($driver = \"\"): array\n {\n $driver = \"\" === $driver ? $this->getDriverName() : $driver;\n switch ($driver) {\n case 'mysql':\n return [\n \"prefix\" => '`',\n \"suffix\" => '`',\n \"find\" => '`',\n \"replace\" => '``',\n ];\n\n case 'sqlsrv':\n return [\n \"prefix\" => '[',\n \"suffix\" => ']',\n \"find\" => ']',\n \"replace\" => '][',\n ];\n\n default:\n return [\n \"prefix\" => '\"',\n \"suffix\" => '\"',\n \"find\" => '\"',\n \"replace\" => '\"\"',\n ];\n }\n }", "public function testAdapterQuoteIntoSingleQuote()\n {\n $value = $this->_db->quoteInto('id = ?', 'St John\\'s Wort');\n $this->assertEquals(\"id = 'St John''s Wort'\", $value);\n }", "public function testAdapterQuoteIntoSingleQuote()\n {\n $value = $this->_db->quoteInto('id = ?', 'St John\\'s Wort');\n $this->assertEquals(\"id = 'St John''s Wort'\", $value);\n }", "function filtrerChainePourBD($str, $idConnexion) {\n if ( ! get_magic_quotes_gpc() ) {\n $idConnexion -> quote($str);\n }\n return $str;\n}", "public function getQuoteIdentifierSymbol()\n {\n return $this->__call(__FUNCTION__, array());\n }", "public function getPlatform(): string\n {\n if (isset($this->dataCache['platform'])) {\n return $this->dataCache['platform'];\n }\n\n if (empty($this->conn)) {\n $this->initialize();\n }\n\n return $this->dataCache['platform'] = ! $this->isPdo() ? 'postgres' : $this->conn->getAttribute(PDO::ATTR_DRIVER_NAME);\n }", "abstract public function quoteColumnName($name);", "public function escape($param) {\n return $this->pdo->quote($param);\n }", "abstract protected function driverName();", "public function getQuotedName(AbstractPlatform $platform): string\n {\n $keywords = $platform->getReservedKeywordsList();\n $parts = explode('.', $this->getName());\n foreach ($parts as $k => $v) {\n $parts[$k] = $this->_quoted || $keywords->isKeyword($v) ? $platform->quoteIdentifier($v) : $v;\n }\n\n return implode('.', $parts);\n }", "public function quote($string) {\n return $this->pdo->quote($string);\n }", "public function quote($string) {\n return $this->pdo->quote($string);\n }", "public function getEscapeChar(): ?string\n {\n return $this->escapeChar;\n }", "function quoteDb($data) { \n return '\"' . $data . '\"';\n}", "public function getDbPlatformName();", "public function quote($value): string\n {\n return $this->pdo->quote($value);\n }", "private static function quoteMe($str, $quote) {\n return $quote ? '\\'' . pg_escape_string($str) . '\\'' : pg_escape_string($str);\n }", "protected function quote_escaped()\n {\n }", "protected function getEscapeSymbol()\n {\n return '\\\\';\n }", "protected function driverName()\n {\n return 'pdo_mysql';\n }", "protected function check($table) {\n\t\tif ($this->quoteCharacter && strpos($table, $this->quoteCharacter)!==false) {\n\t\t throw new Redbean_Exception_Security('Illegal chars in table name');\n\t }\n\t\treturn $this->adapter->escape($table);\n\t}", "protected function quote($name)\r\n {\r\n if($this->db->nameQuote=='['){\r\n return '['.$name.']';// mssql has [ and ] for quoting\r\n }else{\r\n return $this->db->nameQuote.$name.$this->db->nameQuote;\r\n }\r\n }", "public function get_table_name_escaped() {\n\t\treturn $this->table->get_table_name_escaped();\n\t}", "static public function getDbType(PDO $aDbConn) {\n\t\tif (isset($aDbConn)) {\n\t\t\treturn $aDbConn->getAttribute(PDO::ATTR_DRIVER_NAME);\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "public function quote($value)\n\t{\n\t\tif( ! $this->pdo) $this->connect();\n\t\treturn $this->pdo->quote($value);\n\t}", "public function quote ( $string )\n\t{\n\t\treturn $this->pdo->quote( $string );\n\t}", "public function quote($str) {\n return $this->dbh->quote($str);\n }", "protected function quote($token, AbstractPlatform $platform)\r\n {\r\n switch ($platform->getName()) {\r\n case 'mysql':\r\n default:\r\n return '`' . $token . '`';\r\n }\r\n }", "public function getQuotedName() : string {}", "function db_quote($value) {\n $connection = db_connect();\n return \"'\" . mysqli_real_escape_string($connection,$value) . \"'\";\n }", "public function DbEscapeSimple($string) \n { \n if (get_magic_quotes_gpc()) \n return $string; \n else \n return $this->bp->escapeSimple($string); \n }", "public function quote($quote) {\n\t\t\treturn $this->getPdo()->quote($quote);\n\t\t}", "protected function _getHandleCol()\r\n {\r\n $handle_col = $this->_config['handle_col'];\r\n if (strpos($handle_col, '.') === false) {\r\n $handle_col = \"{$this->_config['table']}.{$handle_col}\";\r\n }\r\n return $handle_col;\r\n }", "function autoquote($s) {\n if (get_magic_quotes_gpc()) {\n \treturn \"'$s'\";\n } else {\n \treturn \"'\".addslashes($s).\"'\";\n }\n}", "public static function quote($string)\n {\n return get(PDO::class)->quote($string);\n }", "function SuitableEnclosureQuote($strIn)\n{\n\t//i will probably want to make this smarter at some point\n\tif(contains($strIn, \"\\\"\"))\n\t{\n\t\treturn \"'\";\n\t}\n\treturn '\"';\n}", "public function quote($val) {\n\t\treturn DB::quote($val, $this->get_table_driver());\n \t}", "public function platform()\n\t{\n\t\treturn $this->dbdriver;\n\t}", "protected static function driverSuffix()\n {\n switch (PHP_OS) {\n case 'Darwin':\n return 'mac';\n case 'WINNT':\n return 'win.exe';\n default:\n return 'linux';\n }\n }", "public function getQuotedJoinTableName($platform)\n {\n return isset($this->joinTable['quoted'])\n ? $platform->quoteIdentifier($this->joinTable['name'])\n : $this->joinTable['name'];\n }", "public function get_name()\n {\n return 'ds_quote';\n }", "function getDelimiterCharacter($real_char = false) {\n\t\tif ($this->getDelimiter() == self::DELIMITER_COMMA) {\n\t\t\treturn \",\";\n\t\t} else if ($this->getDelimiter() == self::DELIMITER_TAB) {\n\t\t\tif ($real_char) {\n\t\t\t\treturn \"\\t\";\n\t\t\t} else {\n\t\t\t\treturn '\\t';\n\t\t\t}\n\t\t} else if ($this->getDelimiter() == self::DELIMITER_PIPE) {\n\t\t\treturn \"|\";\n\t\t} else if ($this->getDelimiter() == self::DELIMITER_SEMICOLON) {\n\t\t\treturn \";\";\n\t\t} else if ($this->getDelimiter() == self::DELIMITER_COLON) {\n\t\t\treturn \":\";\n\t\t} else {\n\t\t\treturn \",\";\n\t\t}\n\t}", "function db_real_escape($val,$quote=false){\n global $$dblink;\n\n //We turn off magic_quotes_gpc in main.inc.php BUT leaving the check here just incase some idiot removes it.\n if(get_magic_quotes_gpc()) //Avoid double quotes...\n $val= stripslashes($val);\n\n $val=($$dblink)?mysql_real_escape_string($val):mysql_escape_string($val);\n\n return ($quote)?\"'$val'\":$val;\n }", "public static function magicQuotes($quotes)\n{\nreturn filter_var($quotes, FILTER_SANITIZE_MAGIC_QUOTES);\n}", "abstract function get_driver_sql();", "public function testQuote()\n {\n $strToQuote = \"O'Reilly\";\n $quotedStr = \"'O''Reilly'\";\n\n $this->assertEquals(\n $quotedStr,\n $this->_object->quote($strToQuote)\n );\n }", "public function get_driver_name() {\n\t\treturn $this->driver_name;\n\t}", "function QuoteName( $name )\n\t{\n\t return \"`\" . str_replace(\"`\", \"``\", $name) . \"`\";\n\t}", "public function testAdapterQuoteTableAs()\n {\n $string = \"foo\";\n $alias = \"bar\";\n $value = $this->_db->quoteTableAs($string, $alias);\n $this->assertEquals('\"foo\" \"bar\"', $value);\n }", "public function testAdapterQuoteTableAs()\n {\n $string = \"foo\";\n $alias = \"bar\";\n $value = $this->_db->quoteTableAs($string, $alias);\n $this->assertEquals('\"foo\" \"bar\"', $value);\n }", "public function quoteIdentifier($ident, $auto = false)\n {\n \treturn $this->getDbTable()->quoteIdentifier($ident, $auto);\n }", "function qruqsp_core_dbQuote(&$q, $str) {\n\n// if( is_array($str) ) {\n// error_log(print_r($str, true));\n// }\n\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbConnect');\n\n $rc = qruqsp_core_dbConnect($q, 'qruqsp.core');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n return mysqli_real_escape_string($rc['dh'], $str);\n}", "public function quote_string($str);", "function platform() {\n return $this->dbdriver;\n }", "protected function getPreparedStatementIdPrefix(): string\n {\n return \\str_replace('\\\\', '__', static::class);\n }", "function autounquote($s) {\n if (get_magic_quotes_gpc()) {\n \treturn stripslashes($s);\n } else {\n \treturn $s;\n }\n}", "protected function getSelectColumnString()\n {\n return $this->dialect()->quote($this->getBlobKey(), 'name');\n }", "function db_quote($value) {\n $connection = db_connect();\n return \"'\" . mysqli_real_escape_string($connection,$value) . \"'\";\n}", "public function getEscape(): string\n {\n return $this->escape;\n }", "public function quote(string $string): string\n\t{\n\t\tif (empty($string))\n\t\t\treturn false;\n\n\t\ttry {\n\t\t\t$escaped = $this->db->quote($string);\n\t\t} catch (\\PDOException $e) {\n\t\t\t$this->FSDBError($e);\n\n\t\t\t// better than nothing?\n\t\t\treturn (string) addslashes($string);\n\t\t}\t\n\n\t\treturn (string) $escaped;\n\t}", "public function getAutoEscape() {}", "function quote( $string ){\n\treturn '\\'' . $string . '\\'';\n}", "public static function getDriverName()\n { //Method inherited from \\Illuminate\\Database\\Connection \n /** @var \\Illuminate\\Database\\PostgresConnection $instance */\n return $instance->getDriverName();\n }", "function safeColName($col)\r\n\t{\r\n\t\t$db = FabrikWorker::getDbo();\r\n\t\t$col = str_replace('`', '', $col);\r\n\t\t$splitter = '';\r\n\t\tif (strstr($col, '___')) {\r\n\t\t\t$splitter = '___';\r\n\t\t}\r\n\t\tif (strstr($col, '.')) {\r\n\t\t\t$splitter = '.';\r\n\t\t}\r\n\t\tif ($splitter == '') {\r\n\t\t\treturn $db->nameQuote($col);\r\n\t\t}\r\n\t\tif (strstr($col, $splitter)) {\r\n\t\t\t$col = explode($splitter, $col);\r\n\t\t\tforeach ($col as &$c) {\r\n\t\t\t\t$c = $db->nameQuote($c);\r\n\t\t\t}\r\n\t\t\treturn implode('.', $col);\r\n\t\t}\r\n\t\treturn $col;\r\n\t}", "public final function getSqlTable($table, $escapeChar=null) {}", "abstract protected function quote($value);", "public function getPDOType()\n {\n return $this->PDOType;\n }", "function getCharacterName($charid) {\n global $dbconn;\n \n $strSQL = \"SELECT charname FROM chars WHERE charid=:charid\";\n $statement = $dbconn->prepare($strSQL);\n $statement->bindValue(':charid',$charid);\n \n if (!$statement->execute()) {\n watchdog($statement->errorInfo(),'SQL');\n return '';\n }\n else {\n $arrReturn = $statement->fetchAll();\n \n if (empty($arrReturn)) {\n return '';\n }\n else {\n return $arrReturn[0]['charname'];\n }\n }\n}", "public function quote($string)\n\t{\n\t\treturn $this->conn->quote($string);\n\t}", "public function quote($string, $type = \\PDO::PARAM_STR)\n {\n return $this->connection->quote($string, $type);\n }", "function dbDelimit($name);", "function mysql_fix_string($connection, $string)\n {\n //get_magic_quotes_gpc() verifica el PHP.ini y devuelve 0 si magic_quotes_gpc esta desactivado\n // o activado para evitar problemas de seguridad inyectados\n if (get_magic_quotes_gpc()) \n $string = stripslashes($string);\n return $connection->real_escape_string($string);\n }" ]
[ "0.8613798", "0.7355055", "0.70941", "0.65321136", "0.64954174", "0.6228769", "0.6173214", "0.60395855", "0.60149795", "0.6012718", "0.59809136", "0.59809136", "0.5964048", "0.5964048", "0.5929197", "0.5874482", "0.58609694", "0.58546156", "0.5830898", "0.581962", "0.581962", "0.57737154", "0.5765693", "0.57603866", "0.57094175", "0.5695166", "0.5688507", "0.5672913", "0.5666663", "0.5664948", "0.5664948", "0.5658516", "0.5629752", "0.5604506", "0.5596094", "0.5593108", "0.5577671", "0.5571764", "0.5534978", "0.5534978", "0.551737", "0.54915667", "0.54912096", "0.54749304", "0.5472131", "0.5465965", "0.54610616", "0.5451248", "0.5441774", "0.54275775", "0.54165643", "0.54151726", "0.5414651", "0.5402975", "0.54028386", "0.5398537", "0.5388493", "0.5384386", "0.5383538", "0.53785944", "0.53711164", "0.5350269", "0.5348368", "0.5326875", "0.53176725", "0.53164816", "0.5306645", "0.5303116", "0.52985847", "0.5296641", "0.5292889", "0.5290891", "0.5287207", "0.5286104", "0.5285275", "0.52656466", "0.52635556", "0.52635556", "0.526116", "0.52549887", "0.5252274", "0.525146", "0.5250861", "0.52470577", "0.52393335", "0.52384734", "0.5227223", "0.521059", "0.5204644", "0.5200043", "0.51986915", "0.51954824", "0.5177437", "0.5175382", "0.5173956", "0.5169279", "0.515964", "0.5150387", "0.5142566", "0.51390654" ]
0.8589806
1
Return friends ids for specific user
Вернуть идентификаторы друзей для конкретного пользователя
private function getUserFriendsIds($userId) { return Friendship::where('user_id', $userId)->lists('friend_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_friends_ids($user_id) {\n global $db;\n $friends = array();\n $get_friends = $db->query(sprintf('SELECT users.user_id FROM friends INNER JOIN users ON (friends.user_one_id = users.user_id AND friends.user_one_id != %1$s) OR (friends.user_two_id = users.user_id AND friends.user_two_id != %1$s) WHERE status = 1 AND (user_one_id = %1$s OR user_two_id = %1$s)', secure($user_id, 'int'))) or _error(SQL_ERROR_THROWEN);\n if($get_friends->num_rows > 0) {\n while($friend = $get_friends->fetch_assoc()) {\n $friends[] = $friend['user_id'];\n }\n }\n return $friends;\n }", "public function getFriends($user = false){\n if(!$user){\n $this->JACKED->Flock->requireLogin();\n $user = $this->JACKED->MySQL->sanitize($this->JACKED->Sessions->read('auth.Flock.userid'));\n }\n \n $result = $this->JACKED->MySQL->query(\n 'SELECT friend_id FROM ' .\n $this->config->dbt_friends .\n ' WHERE pending = 0 AND user_id = ' . $user\n );\n $friends = $this->JACKED->MySQL->parseResult($result);\n if(count($friends) > 0 && !is_array($friends[0]))\n $friends = array(0 => $friends);\n $done = array();\n foreach($friends as $val){\n $done[] = $val['friend_id'];\n }\n return $done;\n }", "function _get_user_friends_ids ($target_user_id) {\n\t\t$cur_friends_ids = array();\n\t\t// Get friends from db\n\t\tlist($CUR_FRIENDS_LIST) = db()->query_fetch(\"SELECT friends_list AS `0` FROM \".db('friends').\" WHERE user_id=\".intval($target_user_id));\n\t\t// Convert string into array\n\t\tif (!empty($CUR_FRIENDS_LIST)) {\n\t\t\t$tmp_array = explode(\",\", $CUR_FRIENDS_LIST);\n\t\t}\n\t\tforeach ((array)$tmp_array as $tmp_friend_id) {\n\t\t\tif (empty($tmp_friend_id) || $tmp_friend_id == $target_user_id) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$cur_friends_ids[$tmp_friend_id] = $tmp_friend_id;\n\t\t}\n\t\treturn $cur_friends_ids;\n\t}", "private function friends(int $user_id, $status = UserContact::status['accepted']): array\n {\n $contacts = UserContact::find()->where(['person' => $user_id])->orWhere(['friend' => $user_id])->andWhere(['status' => $status])->asArray()->all();\n $friends = [];\n foreach ($contacts as $contact) {\n if ($contact['person'] === $user_id)\n $friend_id = $contact['friend'];\n else\n $friend_id = $contact['person'];\n if (ZArrayHelper::isIn($friend_id, $friends)) {\n continue;\n }\n $friends[] = $friend_id;\n }\n return $friends;\n }", "private function get_friend_ids(){\n\n $db = $this->db;\n //ovdje spremamo sve vrijednosti id polja prijatelja korisnika\n $users = array();\n\n $users1 = $db->friendQuery('SELECT user_id FROM friend_requests WHERE friend_id=1 AND accepted=1');\n $users1 = $users1->fetchAll(PDO::FETCH_ASSOC);\n\n foreach($users1 as $user)\n {\n $users[] = $user['user_id'];\n }\n\n $users2 = array();\n $users2 = $db->friendQuery('SELECT friend_id FROM friend_requests WHERE user_id=1 AND accepted=1');\n\n if($users2)\n $users2 = $users2->fetchAll(PDO::FETCH_ASSOC);\n\n\n foreach($users2 as $user)\n {\n $users[] = $user['friend_id'];\n }\n \n return $users;\n }", "function get_user_friends(){\r\n\r\n\t\t//$res = getrows($sql, $err);\r\n\r\n\t\t//$ids = $res['0']['memeje_friends'];\r\n\r\n\t\t//return $ids;\r\n\r\n\t}", "public static function getFriendInvites($user_id){\n\t\t$db = &get_instance()->db;\n\t\t\n\t\t$friend_list = array();\n\t\t\n\t\t$db->select('u.id,u.username,up.first_name,up.last_name,up.address1,up.profile_pic')\n\t\t\t->from('user_friends uf,user u, user_profile up')\n\t\t\t->where('(uf.user_id_1='.$user_id.' AND uf.status_1=1 AND uf.status_2=0 AND uf.user_id_2=u.id AND uf.user_id_2=up.user_id)');\n\t\t\t\n\t\t$res = $db->get()->result_array();\n\t\t\n\t\tforeach($res as $r){\n\t\t\tarray_push($friend_list,$r);\n\t\t}\n\t\t\n\t\t$db->select('u.id,u.username,up.first_name,up.last_name,up.address1,up.profile_pic')\n\t\t\t->from('user_friends uf,user u, user_profile up')\n\t\t\t->where('(uf.user_id_2='.$user_id.' AND uf.status_1=0 AND uf.status_2=1 AND uf.user_id_1=u.id AND uf.user_id_1=up.user_id)');\n\t\t\n\t\t$res = $db->get()->result_array();\n\t\t\n\t\tforeach($res as $r){\n\t\t\tarray_push($friend_list,$r);\n\t\t}\n\t\t\n\t\treturn $friend_list;\n\t}", "function getFriends( SocialUser $user );", "public function getUserFriends($userId)\n {\n return User::findOrFail($userId)->friends()->orderBy('users.id')->get();\n }", "public function getUserFriendsOfFriends($userId)\n {\n return $this->getUserFriendsOfFriendsQuery($userId)->get();\n }", "public static function getFriendIds($uid)\n\t{\n\t\treturn DB::table('friendships')\n\t\t\t->where('friendships.user_id', '=', $uid)\n\t\t\t->lists('friendships.friend_id');\n\t}", "public static function getFriendIdList() \n\t{\n\t\t$sql = 'SELECT IF (friend1!=' .Yii::app()->user->id. ', friend1, friend2) as friend\n\t\t\t\tFROM '.Friends::model()->tableName().'\n\t\t\t\tWHERE (friend1 = ' . Yii::app()->user->id . '\n\t\t\t\t\t OR friend2 = ' . Yii::app()->user->id .') \n\t\t\t\t\t AND status = 1';\n\t\t\n\t\t$friendsResult = Yii::app()->db->createCommand($sql)->queryAll();\n\t\t$length = count($friendsResult);\n\t\t\n\t\t$friends = array();\n\t\tfor ($i = 0; $i < $length; $i++) {\n\t\t\tarray_push($friends, $friendsResult[$i]['friend']);\t\t\t\n\t\t}\n\t\t$result = -1;\n\t\tif (count($friends) > 0) {\t\t\n\t\t\t$result = implode(',', $friends);\n\t\t}\n\t\treturn $result;\n\t}", "public static function getFriendRequests($user_id){\n\t\t$db = &get_instance()->db;\n\t\t\n\t\t$friend_list = array();\n\t\t\n\t\t$db->select('u.id,u.username,up.first_name,up.last_name,up.address1,up.profile_pic')\n\t\t\t->from('user_friends uf,user u, user_profile up')\n\t\t\t->where('(uf.user_id_2='.$user_id.' AND uf.status_2=0 AND uf.status_1=1 AND uf.user_id_1=u.id AND uf.user_id_1=up.user_id)');\n\t\t\n\t\t$res = $db->get()->result_array();\n\t\t\n\t\tforeach($res as $r){\n\t\t\tarray_push($friend_list,$r);\n\t\t}\n\t\t\n\t\t$db->select('u.id,u.username,up.first_name,up.last_name,up.address1,up.profile_pic')\n\t\t\t->from('user_friends uf,user u, user_profile up')\n\t\t\t->where('(uf.user_id_1='.$user_id.' AND uf.status_2=1 AND uf.status_1=0 AND uf.user_id_2=u.id AND uf.user_id_2=up.user_id)');\n\t\t\n\t\t$res = $db->get()->result_array();\n\t\t\n\t\tforeach($res as $r){\n\t\t\tarray_push($friend_list,$r);\n\t\t}\n\t\t\n\t\treturn $friend_list;\n\t}", "public function getAllFriends($user_id) {\n $friends = array();\n $tempArray = array();\n\n // need to do 2 queries because they could be friend 1 or friend 2\n $stmt = $this->conn->prepare(\"SELECT User.First_Name, User.User_ID, User.Total_Points, Friends.Accepted, Friends.Responded FROM Friends \n INNER JOIN User \n ON Friends.Friend2 = User.User_ID\n WHERE Friends.Friend1 = ? OR Friends.Friend2 = ?\");\n $stmt->bind_param(\"ii\", $user_id, $user_id);\n if ($stmt->execute()) {\n\n $results = $stmt->get_result();\n while($row = $results->fetch_object()){\n $tempArray = $row;\n array_push($friends, $tempArray);\n }\n $stmt->close();\n \n } else {\n return false;\n }\n\n\n return $friends;\n }", "function getFriends($user_id) \n\t{\n\t\t$uid = mysql_real_escape_string(\"$user_id\");\n\t\n\t\t$arr = getDBResultsArray(\"SELECT user_b FROM friend_map WHERE status=1 AND user_a='$uid' UNION SELECT user_a FROM friend_map WHERE status=1 AND user_b='$uid'\");\n\t\t$ret = array();\n\t\t\n\t\tforeach($arr as $row) \n\t\t{\n\t\t\tforeach($row as $key=>$value) \n\t\t\t{\n\t\t\t\tarray_push($ret, $value);\n\t\t\t}\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function friends(User $user)\n {\n // Get all the friends of the user\n $data = [];\n\n foreach($user->friends as $friend){\n $data[] = $friend;\n }\n\n return $data;\n }", "private function getAllFriendships(){\n $result = $this->JACKED->MySQL->query(\n \"SELECT id FROM \n \" . $this->config->dbt_friends . \" f1 \n INNER JOIN \n \" . $this->config->dbt_friends . \" f2 \n ON \n f1.user_id = f2.friend_id AND\n f1.friend_id = f2.user_id\"\n );\n return $this->JACKED->MySQL->parseResult($result);\n }", "public function getPendingFriends($user = false){\n if(!$user){\n $this->JACKED->Flock->requireLogin();\n $user = $this->JACKED->MySQL->sanitize($this->JACKED->Sessions->read('auth.Flock.userid'));\n }\n \n $result = $this->JACKED->MySQL->query(\n 'SELECT friend_id FROM ' .\n $this->config->dbt_friends .\n ' WHERE pending = 1 AND user_id = ' . $user\n );\n $friends = $this->JACKED->MySQL->parseResult($result);\n if(count($friends) > 0 && !is_array($friends[0]))\n $friends = array(0 => $friends);\n $done = array();\n foreach($friends as $val){\n $done[] = $val['friend_id'];\n }\n return $done;\n }", "public function getListenerIds($user)\n {\n //get partner whom user favourite\n $lOnlFansId = array();\n\n //searching from database\n $lFans = Favourite::where('partner_id', '=', $user->id)->get();\n if(!$lFans->isEmpty()){\n foreach ($lFans as $fan) {\n //check user existed\n if($fan->user){\n //check user online\n if($fan->user->socket_id != null && $fan->user->socket_id != ''){\n //add user to the list\n array_push($lOnlFansId, $fan->user->id);\n }\n }\n }\n }\n\n //get partner who had chat with user\n $lOnlChatedsId = array();\n\n //searching for conversations\n $lConversations = Conversation::where('user1_id','=',$user->id)\n ->orWhere('user2_id','=',$user->id)->get();\n if (!$lConversations->isEmpty()) \n {\n foreach ($lConversations as $conversation) {\n //check to add partner id\n if($conversation->user1_id == $user->id){\n array_push( $lOnlChatedsId, $conversation->user2_id);\n }\n else{\n array_push( $lOnlChatedsId, $conversation->user1_id);\n }\n }\n }\n\n //get matching partners\n $lOnlMatchingsId = array();\n\n //call action matching from UserController\n $lOnlMatchingPartners = UserController::matching($user, true, 1);\n\n if(count($lOnlMatchingPartners) > 0){\n $lOnlMatchingsId = array_pluck($lOnlMatchingPartners, 'id');\n }\n\n //merging those ids\n $listenIds = array_values(array_unique(array_collapse([$lOnlFansId, $lOnlChatedsId, $lOnlMatchingsId])));\n\n //return value\n return $listenIds;\n }", "public function get_friends($user_id, $offset = 0) {\n global $db, $system;\n $friends = array();\n $offset *= $system['min_results_even'];\n /* check the target user's privacy */\n if($this->_data['user_id'] != $user_id) {\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_friends FROM users WHERE user_id = %s\", secure($user_id, 'int') )) or _error(SQL_ERROR_THROWEN);\n $privacy = $get_privacy->fetch_assoc();\n if($privacy['user_privacy_friends'] == \"me\" || ($privacy['user_privacy_friends'] == \"friends\" && ($this->_logged_in && !in_array($user_id, $this->_data['friends_ids'])) ) ) {\n return $friends;\n }\n }\n $get_friends = $db->query(sprintf('SELECT users.user_id, users.user_name, users.user_fullname, users.user_gender, users.user_picture FROM friends INNER JOIN users ON (friends.user_one_id = users.user_id AND friends.user_one_id != %1$s) OR (friends.user_two_id = users.user_id AND friends.user_two_id != %1$s) WHERE status = 1 AND (user_one_id = %1$s OR user_two_id = %1$s) LIMIT %2$s, %3$s', secure($user_id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false) )) or _error(SQL_ERROR_THROWEN);\n if($get_friends->num_rows > 0) {\n while($friend = $get_friends->fetch_assoc()) {\n $friend['user_picture'] = $this->get_picture($friend['user_picture'], $friend['user_gender']);\n /* get the connection between the viewer & the target */\n $friend['connection'] = $this->connection($friend['user_id']);\n $friends[] = $friend;\n }\n }\n return $friends;\n }", "public function getRequestedFriends() {\n // user_id_1 is the user who requested, user_id_2 is the user who confirmed.\n // ordered by time desc.\n $friendReqsQuery = $this->app->dbConn->table('users_friends')->fields('user_id_2', 'time', 'message', 'status')\n ->where(['user_id_1' => $this->id, \"status <= 0\"])->order('time DESC')->query();\n $friendReqs = [];\n while ($req = $friendReqsQuery->fetch()) {\n $friendReqs[intval($req['user_id_2'])] = [\n 'user' => new User($this->app, intval($req['user_id_2'])),\n 'time' => $req['time'],\n 'message' => $req['message'],\n 'status' => $req['status']\n ];\n }\n return $friendReqs;\n }", "public function get_friends( $_id_user ) {\n\t $connection = parent::connect();\n\t\t$query = \"SELECT vdl_user.nick\n\t\t\t\t\tFROM vdl_user\n\t\t\t\t\tWHERE vdl_user.id IN (SELECT vdl_friend_of.user2\n\t\t\t\t\tFROM vdl_friend_of\n\t\t\t\t\tWHERE vdl_friend_of.user1 LIKE '\".$_id_user.\"' UNION SELECT vdl_friend_of.user1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM vdl_friend_of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE vdl_friend_of.user2 LIKE '\".$_id_user.\"')\";\n\t\t$data=$connection->query($query);\n\t\t$arresult=array();\n\t\tif (!$data) {\n\t\t\t$message = 'Invalid query: ' . mysql_error() . \"\\n\";\n\t\t\t$message .= 'Whole query: ' . $query;\n\t\t\tdie($message);\n\t\t\treturn false;\n\t\t}\n\t\twhile ($row = $data->fetch_array()) {\n\t\t\tarray_push($arresult,$row[0]);\n\t\t}\n\t\treturn $arresult;\n }", "private function getUserFriendsOfFriendsQuery($userId)\n {\n // get user friend Ids\n $friendIds = $this->getUserFriendsIds($userId);\n $friendIds[] = $userId;\n\n // get user friend of friends (that are not user friends)\n return User::join('friendships', 'friendships.friend_id', '=', 'users.id')\n ->whereIn('user_id', $friendIds)\n ->whereNotIn('friend_id', $friendIds)\n ->groupBy('users.id')\n ->orderBy('users.id');\n }", "public function get_follower_friends($event_id, $user_id)\n {\n $friend_ids = \"SELECT \"\n . \"CASE \"\n . \" WHEN \"\n . \" user_id = '\" . $user_id . \"' THEN friend_id \"\n . \" WHEN \"\n . \" friend_id = '\" . $user_id . \"' THEN user_id \"\n . \"END AS fid\"\n . \" FROM default_friend_list\"\n . \" WHERE status='accepted' \"\n . \" AND (user_id='\" . $user_id . \"' OR friend_id='\" . $user_id . \"')\";\n\n $following_events = \"SELECT\"\n . \" DISTINCT p.* \"\n . \"FROM default_trends as t\"\n . \" LEFT JOIN default_profiles as p \"\n . \" ON p.user_id = t.user_id\"\n . \" WHERE entry_id='\" . $event_id . \"'\"\n . \" AND p.user_id IN (\" . $friend_ids . \")\"\n . \" AND follow='true'\";\n\n $rs = $this->query($following_events)->result(); \n return $rs; \n }", "public function selectLoginUserFriends() {\r\n\t\t$selectUserFriends = $this->connect->prepare(\"SELECT users.id, users.username FROM users, friends WHERE users.id=friends.friend_id AND friends.user_id='$this->loginUserID'\") or die (databaseConnection::showErrorMessage(\"Cannot open table users and friends from database.\"));\r\n\t\t$selectUserFriends->bind_result($id, $username);\r\n\t\t$selectUserFriends->execute();\r\n\t\t$loginUserFriend = array();\r\n\t\t$friend = array(); \r\n\r\n\t\twhile($selectUserFriends->fetch()){\r\n\t\t\t$loginUserFriend['id'] = $id;\r\n\t\t\t$loginUserFriend['username'] = $username;\r\n\t\t\t$friend[] = $loginUserFriend;\r\n\t\t}\r\n\t\treturn $friend;\r\n\t}", "public function friend_ids()\n {\n return collect($this->friends())->pluck('id')->toArray();\n }", "function getFriends($DB, $userId) {\n return $DB -> query('select * from user where id in (?);',\n $DB -> column('SELECT f1.followingId from follow_relation f1, follow_relation f2\n WHERE f1.userId = :id AND f1.followingId = f2.userId AND f2.followingId = f1.userId',\n array('id'=>$userId))\n );\n}", "public function getUserIds();", "function getFriends($userId)\n\t{\n\t\t$friendsArray\t= array(); //声明变量\n\t\t$query\t= \t\"SELECT friend_id AS FriendId FROM friends_list WHERE user_id='$userId' and approved_status='yes' \n\t\t\t\t\tUNION\n\t\t\t\t\tSELECT user_id as FriendId FROM friends_list WHERE friend_id='$userId' and approved_status='yes' \";\n\t\t$res\t= mysql_query($query);\n\t\tif($res)\n\t\t{\n\t\t\t$totFriends\t= mysql_num_rows($res);\n\t\t\tif($totFriends>0)\n\t\t\twhile($rs=mysql_fetch_object($res))\n\t\t\t\t\t\t\t$friendsArray[]\t= $rs->FriendId;\n\t\t}\n\t\treturn $friendsArray;\n\t}", "public function friends(User $user)\n {\n return $this->result($this->api->friends($user), 200);\n }", "public function getFriendsFromFacebook($epilogue_user_id){\n//\t\t\t$user = $facebook->getUser();\n \t\t$facebook_get_friends = $facebook->api($epilogue_user_id .'?fields=friends');\n\t\t\treturn $facebook_get_friends;\n\t}", "public static function getFriendsSendToday($user_id) {\n\t\t$rRedis = Env::getRedisForUserRead();\n\t\t$key = CacheKey::getFriendsSendPresent ( $user_id );\n\t\t$fids = $rRedis->get ( $key );\n\t\tif (! $fids) {\n\t\t\t$pdo = Env::getDbConnectionForUserRead ( $user_id );\n\t\t\t\n\t\t\t$today_range = self::getTodayRange ();\n\t\t\t\n\t\t\t$sql = 'SELECT * FROM ' . static::TABLE_NAME;\n\t\t\t$sql .= ' WHERE sender_id = ?';\n\t\t\t$sql .= ' AND UNIX_TIMESTAMP(created_at) >= ?';\n\t\t\t$sql .= ' AND UNIX_TIMESTAMP(created_at) < ?';\n\t\t\t$values = array (\n\t\t\t\t\t$user_id,\n\t\t\t\t\t$today_range ['start'],\n\t\t\t\t\t$today_range ['end'] \n\t\t\t);\n\t\t\t$stmt = $pdo->prepare ( $sql );\n\t\t\t$stmt->setFetchMode ( PDO::FETCH_CLASS, get_called_class () );\n\t\t\t$stmt->execute ( $values );\n\t\t\t$objs = $stmt->fetchAll ( PDO::FETCH_CLASS, get_called_class () );\n\t\t\tif (empty ( $objs )) {\n\t\t\t\treturn array ();\n\t\t\t}\n\t\t\t\n\t\t\t$fids = array ();\n\t\t\tforeach ( $objs as $obj ) {\n\t\t\t\t$fids [] = $obj->receiver_id;\n\t\t\t}\n\t\t\t$expire = static::getSecendsToTomorrow ();\n\t\t\tif ($expire > 1) {\n\t\t\t\t$redis = Env::getRedisForUser();\n\t\t\t\t$redis->set ( $key, $fids, $expire );\n\t\t\t}\n\t\t\treturn $fids;\n\t\t} else {\n\t\t\treturn $fids;\n\t\t}\n\t}", "public function getAllMyFriends($userId)\n {\n return $this->daoUser->getAllMyFriends($userId);\n }", "public function getFriendRequests(){\n $this->JACKED->Flock->requireLogin();\n $userid = $this->JACKED->MySQL->sanitize($this->JACKED->Sessions->read('auth.Flock.userid'));\n \n return $this->JACKED->MySQL->getAll(\n array('id', 'user_id'),\n $this->config->dbt_friends,\n 'pending = 1 AND friend_id = ' . $userid\n );\n }", "public function getUserFavouritesIds()\n {\n return array_reduce($this->userFavourite->toArray(), function ($acc, $item) {\n $acc[] = $item->getId();\n return $acc;\n }, []);\n }", "public function getUserFriends() {\n $url = self::FACEBOOK_GRAPH_URL . $this->fbData['user_id'] . '/friends';\n return $this->_getFromGraph($url);\n }", "public function getUserInform(int $friend_id, int $user_id): array\n {\n $user = User::findOne($friend_id);\n $return = [];\n\n $return['id'] = $friend_id;\n if ($user !== null) {\n $return['name'] = $user->title;\n $userCompany = UserCompany::findOne($user->user_company_id);\n if ($userCompany !== null) {\n $return['company'] = $userCompany->name;\n }\n $placeAddres = PlaceAdress::findOne($user->place_region_id);\n if ($placeAddres !== null) {\n $placeCountry = PlaceCountry::findOne($placeAddres->place_country_id);\n if ($placeCountry !== null)\n $return['country'] = $placeCountry->name;\n }\n $return['role'] = $user->role;\n $return['avatar'] = $user->photo;\n $return['blocked'] = $this->getBlocked($friend_id, $user_id);\n }\n return $return;\n }", "public function getUserFriends() {\n if (!$this->getId())\n throw new Exception('Primary Key does not contain a value');\n\n \t$friends = new Petolio_Model_DbTable_PoFriends();\n \t$all = array_merge($friends->findFriends($this->getId(), null, 1), $friends->findFriends(null, $this->getId(), 1));\n \tksort($all); // sort invited / accepted\n\n\t\t$result = array();\n \tforeach ($all as $idx => $row) {\n\t\t\t$user = $this->fill($row);\n\t\t\t$result[$idx] = $user;\n \t}\n\n \treturn $result;\n }", "function members_get_friends($userid){\n\t$members = array();\n\t$sql = \"SELECT user_to FROM member_bonds WHERE user_from = $userid\";\n\t$rst = mysql_query($sql) or die (mysql_error());\n\twhile($row = mysql_fetch_assoc($rst)){\n\t\t$userid = $row['user_to'];\n\t\t$member['user_id']=$userid;\n\t\t$member['name'] = members_get_info('nombre', $userid);\n\t\t$member['lastname'] = members_get_info('apellido', $userid);\n\t\t$member['hash'] = members_get_info('hash', $userid);\n\t\t$members[] = $member;\n\t}\n\treturn $members;\n}", "function tw_friends_ids_all(){\r\n $output = tw_friends_ids();\r\n $resp = array();\r\n if ($output['success']) {\r\n $resp = $output['response']['ids'];\r\n }\r\n return $resp;\r\n}", "function getFriends(){\n\t\t\n\t\t// MOVE THIS TO A MODEL (all Fb calls, api and stuff should be in there, easier to access from anywhere)\n\t\t\n\t\tif(!$this->li){\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t//Cache::set(array('duration' => '1 hour'));\n\t\t//$results = Cache::read('fb_friends_'.GLOBAL_CACHE.FRIENDS_CACHE.'_'.$this->uid);\n\t\t$results = false;\n\t\tif($results === false || !is_array($results)){\n\t\t\t\n\t\t\t\t$data = $this->api('/me/friends');\n\t\t\t\t\n\t\t\t\tif($data !== false){\n\t\t\t\t\t$ids = Set::extract($data['data'],'{n}.id');\n\t\t\t\t\n\t\t\t\t\t//Cache::set(array('duration' => '1 hour'));\n\t\t\t\t\t//Cache::write('fb_friends_'.GLOBAL_CACHE.FRIENDS_CACHE.'_'.$this->uid, $ids);\n\t\t\t\t\n\t\t\t\t\treturn $ids;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t\t\n\t}", "function getFriendRequests($userid){\n $selection = $this->db->prepare('Select username, id from users where id IN (Select user1_id from relationships where user2_id = ? and friends = 0)');\n $selection->bindValue(1, $userid);\n $selection->execute();\n\n $results = $selection->fetchAll(PDO::FETCH_ASSOC);\n $selection->closeCursor();\n echo json_encode($results);\n }", "function getFriendsOfFriends(): array\n {\n $friends = $this->getFriends();\n $friendsOfFriendsArray = array();\n $friendsOfFriends = array();\n foreach ($friends as $friend) {\n array_push($friendsOfFriendsArray, $this->db->query(\"SELECT users.id FROM users, friends WHERE friends.`user` = ? AND friends.friend = users.id\", $friend['id'])->fetchAll());\n }\n $it = new RecursiveIteratorIterator(new RecursiveArrayIterator($friendsOfFriendsArray));\n foreach ($it as $v) {\n array_push($friendsOfFriends, $v);\n }\n return $friendsOfFriends;\n }", "function melodev_load_friends($uid) {\n $flags = flag_get_user_flags('user', NULL, $uid);\n $friends = array();\n if(is_array($flags) && is_array($flags['friend'])) {\n foreach($flags['friend'] as $uid => $flag) {\n $friends[] = $uid;\n }\n }\n return $friends;\n}", "function getMyFriendID(){\n\n\t $myFriendID=mysql_query(\"SELECT * FROM ((SELECT friend AS id FROM Friend WHERE user=$_SESSION[user_id])\n\t UNION ALL (SELECT user AS id FROM Friend WHERE friend=$_SESSION[user_id])) AS MyFriend GROUP BY id HAVING COUNT(*)=2\");\n\n\t return $myFriendID;\n \t}", "function getFriends($userid){\n $selection = $this->db->prepare('Select username, id from users where id IN (Select user2_id from relationships where user1_id = ? and friends = 1) OR id IN (Select user1_id from relationships where user2_id = ? and friends = 1)');\n $selection->bindValue(1, $userid);\n $selection->bindValue(2, $userid);\n $selection->execute();\n\n $results = $selection->fetchAll(PDO::FETCH_ASSOC);\n $selection->closeCursor();\n echo json_encode($results);\n }", "function getFriends(): array\n {\n return $this->db->query('SELECT users.*, friends.`user`, friends.friend FROM users , friends WHERE friends.`user` = ? AND friends.friend = users.id ', $this->userObject['id'])->fetchAll();\n }", "public function getConnectedFriends($user_id) {\n $friends = array();\n $tempArray = array();\n\n // get pending requests, if they are receiving the request they are friend 2\n $stmt1= $this->conn->prepare(\"SELECT User.First_Name, User.User_ID, User.Total_Points, Friends.Accepted, Friends.Responded FROM Friends \n INNER JOIN User \n ON Friends.Friend1 = User.User_ID\n WHERE Friends.Friend2 = ?\n AND Friends.Responded = 0\");\n $stmt1->bind_param(\"i\", $user_id);\n if ($stmt1->execute()) {\n\n $results = $stmt1->get_result();\n while($row = $results->fetch_object()){\n $tempArray = $row;\n array_push($friends, $tempArray);\n }\n $stmt1->close();\n \n } else {\n return false;\n }\n\n // for friends that responded they could be friend 1 or friend 2, need to do these separately because the joins with the user table are different\n $stmt2 = $this->conn->prepare(\"SELECT User.First_Name, User.User_ID, User.Total_Points, Friends.Accepted, Friends.Responded FROM Friends \n INNER JOIN User \n ON Friends.Friend2 = User.User_ID\n WHERE Friends.Friend1 = ?\n AND Friends.Accepted = 1\");\n $stmt2->bind_param(\"i\", $user_id);\n if ($stmt2->execute()) {\n\n $results = $stmt2->get_result();\n while($row = $results->fetch_object()){\n $tempArray = $row;\n array_push($friends, $tempArray);\n }\n $stmt2->close();\n \n } else {\n return false;\n }\n\n\n // for friends that responded they could be friend 1 or friend 2\n $stmt3 = $this->conn->prepare(\"SELECT User.First_Name, User.User_ID, User.Total_Points, Friends.Accepted, Friends.Responded FROM Friends \n INNER JOIN User \n ON Friends.Friend1 = User.User_ID\n WHERE Friends.Friend2 = ?\n AND Friends.Accepted = 1\");\n $stmt3->bind_param(\"i\", $user_id);\n if ($stmt3->execute()) {\n\n $results = $stmt3->get_result();\n while($row = $results->fetch_object()){\n $tempArray = $row;\n array_push($friends, $tempArray);\n }\n $stmt3->close();\n \n } else {\n return false;\n }\n\n\n return $friends;\n }", "public function getReadIds(User $user);", "protected function friendsIds($id = null, $userId = null, $screenName = null, $page = null, $format = 'xml') {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$url = $this->_url . 'friends/ids';\n\t\t\t$params = array();\n\n\t\t\tif(!empty($id)) {\n\t\t\t\t$url .= '/' . $id . '.' . $format;\n\t\t\t}\n\t\t\telseif(!empty($userId)) {\n\t\t\t\t$url .= '.' . $format;\n\t\t\t\t$params['user_id'] = $userId;\n\t\t\t}\n\t\t\telseif(!empty($screenName)) {\n\t\t\t\t$url .= '.' . $format;\n\t\t\t\t$params['screen_name'] = $screenName;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new \\Bedrock\\Common\\Service\\Exception('No user identifier specified, cannot complete query.');\n\t\t\t}\n\n\t\t\tif(!empty($page)) $params['page'] = $page;\n\n\t\t\t$result = self::exec($url, 'GET', $this->_username, $this->_password, $params);\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Common\\Service\\Exception('A problem was encountered while attempting to make the request \"friends/ids\".');\n\t\t}\n\t}", "function getFollowedUsers ($user_id)\n\t{\n\t\t$db = new Database();\n\t\t$select = \"select user_id from USERS where user_id in (select followed_user_id from FOLLOWERS where following_user_id = {$user_id});\";\n\t\t$result = $db->query($select);\n\n\t\t$array = array();\n\t\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t\t$user_id = $row['user_id'];\n\t\t\t$array[] = getUser($user_id);\n\t\t}\n\t\t\n\t\treturn $array;\n\t}", "public function getFriendRequests() {\n // user_id_1 is the user who requested, user_id_2 is the user who confirmed.\n // ordered by time desc.\n $friendReqsQuery = $this->app->dbConn->table('users_friends')->fields('user_id_1', 'time', 'message', 'status')\n ->where(['user_id_2' => $this->id, \"status <= 0\"])->order('time DESC')->query();\n $friendReqs = [];\n while ($req = $friendReqsQuery->fetch()) {\n $friendReqs[intval($req['user_id_1'])] = [\n 'user' => new User($this->app, intval($req['user_id_1'])),\n 'time' => $req['time'],\n 'message' => $req['message'],\n 'status' => $req['status']\n ];\n }\n return $friendReqs;\n }", "public function check_friends( $_id_user1 ) {\n }", "public function areFriends($userId, $friendId)\n {\n $queryBuilder = $this->db->createQueryBuilder();\n\n return $queryBuilder->select(\n 'f.FK_idUserB'\n )\n ->from('friends', 'f')\n ->where('f.FK_idUserA = :userId')\n ->andWhere('f.FK_idUserB = :friendId')\n ->select('COUNT(DISTINCT u.PK_idUsers) AS total_results')\n ->setParameters(array(':userId' => $userId, ':friendId' => $friendId));\n }", "public function getUserFollowingIds($username)\n\t{\n\t\treturn $this->con->get(\"$username/following_ids\");\n\t}", "public function getUserIds()\n {\n return $this->users->lists('id')->toArray();\n }", "public function friends()\n {\n $friendsDemand = null;\n $friendsWait = null;\n $friendsAccepted = null;\n\n $user = User::find(Auth::user()->id);\n\n\n $friendsDemandID = UserUser::where(['user_id' => $user->id, 'status' => 0])->get();\n\n foreach ($friendsDemandID as $value)\n {\n $friendsDemand[] = User::find($value->getUserIdDemand());\n }\n $friendsWaitID = UserUser::where(['user_id1' => $user->id, 'status' => 0])->get();\n\n foreach ($friendsWaitID as $value)\n {\n $friendsWait[] = User::find($value->getUserIdWait());\n }\n\n\n $friendsAcceptedID1 = UserUser::where(['user_id' => $user->id, 'status' => 1])->get();\n $friendsAcceptedID2 = UserUser::where(['user_id1' => $user->id, 'status' => 1])->get();\n\n foreach ($friendsAcceptedID1 as $value)\n {\n $friendsAccepted[] = User::find($value->getUserIdDemand());\n }\n\n foreach ($friendsAcceptedID2 as $value)\n {\n $friendsAccepted[] = User::find($value->getUserIdWait());\n }\n\n return view('user.friends', [\n 'friendsDemand' => $friendsDemand,\n 'friendsWait' => $friendsWait,\n 'friendsAccepted' => $friendsAccepted,\n ]);\n }", "public function getUserSuggestedFriends($userId, $directedFriendsCount = 2)\n {\n return $this->getUserFriendsOfFriendsQuery($userId)\n ->groupBy('friendships.friend_id')\n ->having(DB::raw('COUNT(*)'), '>=', $directedFriendsCount)\n ->get();\n }", "public static function get_friends($user_id, $offset = 0) {\n global $sqlConnect, $wo;\n $friends = array();\n\n\t\t$sql = \"SELECT `user_id`, `username`, `first_name`, `last_name`, `gender`, `avatar` FROM \" . T_USERS . \" WHERE `user_id` IN (SELECT `following_id` FROM \" . T_FOLLOWERS . \" WHERE `follower_id` = {$user_id} AND `following_id` <> {$user_id} AND `active` = '1') AND `active` = '1' \n\t\tAND `user_id` NOT IN (SELECT `owner_id` FROM `pokes` WHERE `user_id` = {$user_id})\n\t\tAND `user_id` NOT IN (SELECT `user_id` FROM `pokes` WHERE `owner_id` = {$user_id})\n\t\tLIMIT 10\n\t\t\";\n\t\t$get_friends = $sqlConnect->query($sql);\n if($get_friends->num_rows > 0) {\n\t\t/*generate array*/\n while($friend = $get_friends->fetch_assoc()) {\n\t\t\tif($friend['avatar']!= ''){ $friend['user_picture'] = $friend['avatar']; } else { $friend['user_picture'] = 'upload/photos/d-avatar.jpg'; }\n\t\t\tif($friend['first_name']!= ''){ $friend['user_fullname'] = $friend['first_name'].' '.$friend['last_name']; } else { $friend['user_fullname'] = $friend['username']; }\t\t\t\n $friends[] = $friend;\n }\n }\n return $friends;\n }", "public function getFriends($id)\n {\n $userInfo = User::find($id);\n return $userInfo;\n }", "public function getFriends($id)\n {\n $userInfo = User::find($id);\n return $userInfo;\n }", "function followsUser(int $user): int\n {\n return $this->db->query(\"SELECT * FROM friends WHERE user = ? AND friend = ?\", $user, $this->userObject['id'])->numRows();\n }", "function getFriends($connection) {\n \n $comma_separated = getListOfFriendIds($connection);\n $friends = array();\n $pageNum = count($comma_separated);\n \n for($i=0; $i<$pageNum; $i++) {\n $friends[$i]= $connection->get('users/lookup', array('user_id' => $comma_separated[$i]));\n }\n \n return $friends;\n\n}", "function getAllUserIDsIFollow($myUserId)\n{\n\t//SELECT follows FROM `entrp_user_follows` where clientid=1\n\t$data= array();\n\t\n\t$qry=\"SELECT follows FROM entrp_user_follows WHERE clientid=\".$myUserId.\"\";\n\t$res=getData($qry);\n\t$count_res=mysqli_num_rows($res);\n\tif($count_res>0)\n\t{\n\t\twhile($row=mysqli_fetch_array($res))\n\t\t{\n\t\t\t$data[]\t\t\t=\t$row['follows'];\n\t\t}\t\t\n\t}\n\treturn $data;\n\n\n}", "function getListOfFriendIds($connection) {\n $friendIds= $connection->get('friends/ids');\n $friendIds= $friendIds->ids;\n \n $friendsNum= count($friendIds);\n $friendsIdArray = array();\n if($friendsNum>23) {\n $pages = $friendsNum/23;\n $start = 0;\n \n for($i=0; $i<ceil($pages); $i++) {\n if($i!=$pages) {\n $friendsIdArray[$i]=array_slice($friendIds, $start, 23);\n $friendsIdArray[$i]= implode(\",\", $friendsIdArray[$i]);\n $start= $start+23;\n } else {\n $friendsIdArray[$i]= array_slice($friendIds, $start, 23);\n $friendsIdArray[$i]= implode(\",\", $friendsIdArray[$i]);\n }\n \n }\n \n } else {\n $friendsIdArray[0] = implode(\",\", $friendIds);\n }\n \n return $friendsIdArray;\n}", "public static function getUserFeedIds($userid, $formData = array(), $limit = 30)\n\t{\n\t\tglobal $db;\n\t\t$userFeedIdList = array();\n\t\t\t\n\t\t$whereString = '';\n\t\tif($formData['fuserid'] > 0)\n\t\t\t$whereString .= ($whereString != '' ? ' AND ' : '') . '(f.u_id = '.(int)$formData['fuserid'].') OR (f.u_id_receive = '.(int)$formData['fuserid'].') ';\n\t\t\t\n\t\t\t\n\t\t$sql = 'SELECT f_id FROM ' . TABLE_PREFIX . 'feed f WHERE ' . $whereString . ' ORDER BY f_dateupdated DESC LIMIT ' . $limit;\n\t\t$stmt = $db->query($sql);\n\t\twhile($row = $stmt->fetch())\n\t\t\t$userFeedIdList[] = $row['f_id']; \n\t\t\n\t\treturn $userFeedIdList;\n\t}", "function getAwaitingFriendRequests($userid){\n $selection = $this->db->prepare('Select username, id from users where id IN (Select user2_id from relationships where user1_id = ? and friends = 0)');\n $selection->bindValue(1, $userid);\n $selection->execute();\n\n $results = $selection->fetchAll(PDO::FETCH_ASSOC);\n $selection->closeCursor();\n echo json_encode($results);\n }", "public function getFriends() {\n\t\tif (is_null($this->friends)) {\n\t\t\t$sql = 'select f.fri_usr_id from user_friends f WHERE (f.own_usr_id=\"' . e($this->usr_id) . '\")';\n\t\t\t$result = Database::singleton()->query_fetch_all($sql);\n\t\t\tforeach ($result as &$friend) {\n\t\t\t\t$this->friends[$friend['fri_usr_id']] = new User_Profile($friend['fri_usr_id']);\n\t\t\t}\n\t\t}\n\t\treturn $this->friends;\n\t}", "public function getIdsByUserId($user_id)\n {\n $get = self::where('user_id', (int) $user_id)->get();\n $data = [];\n\n foreach($get as $row) {\n $data[$row->getFeatureId()] = $row->getFeatureId();\n }\n\n return $data;\n }", "function user_friends($id=false, $params = array()) {\n $url = \"http://twitter.com/statuses/friends\";\n if($id != false) {\n $url .= \"/{$id}.xml\";\n } else {\n $url .= \".xml\";\n }\n \n return $this->__process($this->Http->get($url, $params, $this->__getAuthHeader()));\n }", "public function getfriendsInformation() {\r\n $req = \"select f.id_user_f as publictoken, u.pseudo , u.firstname as firstName, u.lastname as lastName, u.age, u.city, u.imagelink, u.number, g.log as lon, g.lat,g.time\r\n from friends f, user u, usergeo g \r\n where f.id_user='$this->token' \r\n and f.id_user_f=u.publictoken \r\n and g.token_user = (select u1.token from user u1 where publictoken = f.id_user_f)\r\n and g.visible = '1'\";\r\n\r\n $res = Connection::getDbMapper()->execStatement($req);\r\n $ret = array();\r\n while (($row = mysqli_fetch_array($res, MYSQLI_ASSOC)) != NULL) {\r\n $ret[] = $row;\r\n }\r\n mysqli_free_result($res);\r\n return $ret;\r\n }", "function nbr_friends($id){\n\t\tglobal $bdd;\n\n\t\t$q = $bdd->prepare(\"SELECT status FROM friendship_relations WHERE (user_id1 = :connected_user OR user_id2 = :connected_user) AND status = '1' \");\n\t\t$q->execute([\n\t\t\t'connected_user' => $id\n\t\t]);\n\t\t$countr = $q->rowCount();\n\t\t$q->closeCursor();\n\t\treturn $countr;\n\n\t}", "function show_user_friends($connected_user){\n\t\tglobal $bdd;\n\t\t$q = $bdd->prepare(\"SELECT friendship_relations.user_id1 , friendship_relations.status, friendship_relations.user_id2, users.id , users.pseudo, users.avatar FROM friendship_relations \n LEFT JOIN users\n ON users.id = friendship_relations.user_id2\n WHERE friendship_relations.user_id1 =:user_id1 \n AND friendship_relations.status = '1' \"\n\t\t);\n\n\t\t$q->execute([\n\t\t'user_id1' => $connected_user\n\t\t]);\n\t\t\n\t\t$results = $q->fetchAll(PDO::FETCH_OBJ);\n\t\treturn $results;\n\n\t}", "private function getOnlyFriends($usersId)\n {\n $myFriends = $this->doctrine\n ->getRepository('KibokoSocialNetworkBundle:UserFriendship')\n ->findAcceptedFriends($this->currentUser);\n $foundedFriends = [];\n if (!empty($myFriends)) {\n foreach ($myFriends as $myFriend) {\n foreach ($usersId as $id) {\n if ($id === $myFriend['id']) {\n $friend = $this->doctrine\n ->getRepository('KibokoSocialNetworkBundle:User')\n ->findOneById($myFriend['id']);\n $foundedFriends[] = $friend;\n }\n }\n }\n }\n\n return $foundedFriends;\n }", "function isFriendsWithUser(int $friend): int\n {\n return $this->db->query(\"SELECT * FROM friends WHERE user = ? AND friend = ?\", $this->userObject['id'], $friend)->numRows();\n }", "function yz_get_private_users_activity_ids( $users ) {\n\n global $bp, $wpdb;\n\n // If the given users is array convert it to string.\n if ( is_array( $users ) ) {\n $users = implode( ',', array_map( 'absint', $users ) );\n }\n\n // Get SQL.\n $sql = \"SELECT id FROM {$bp->activity->table_name} WHERE user_id IN ( $users )\";\n\n // Get Result\n $activities = $wpdb->get_results( $sql , ARRAY_A );\n\n // Return Array List.\n $activities_ids = wp_list_pluck( $activities, 'id' );\n\n return $activities_ids;\n\n}", "public function getfriendlist($id){\n $this->db->query('SELECT * FROM friendships WHERE id_user1 = :id OR id_user2 = :id AND status = \"Amis\" ORDER BY time DESC');\n \n $this->db->bind(':id', $id);\n $results = $this->db->resultset();\n\n return $results;\n }", "public function areInvited($userId, $friendId)\n {\n $queryBuilder = $this->db->createQueryBuilder();\n\n $queryBuilder->select(\n 'f.FK_idUserB'\n )\n ->from('invitations', 'i')\n ->where('i.FK_idUserA = :userId', 'i.FK_idUserB = :friendId')\n // ->andWhere('i.FK_idUserB = :friendId')\n ->orWhere('i.FK_idUserA = :friendId AND i.FK_idUserB = :userId')\n // ->andWhere('i.FK_idUserB = :userId')\n ->select('COUNT(DISTINCT i.FK_idUserB) AS total_results')\n ->setParameters(array(':userId' => $userId, ':friendId' => $friendId));\n\n return $queryBuilder->execute()->fetchAll();\n }", "public function getFriendsList() {\n $id = (int) $this->loggedInUser->getUserId();\n\n $sql = 'SELECT * FROM `relationship` WHERE ' .\n '(`user_one_id` = ' . $id . ' OR `user_two_id` = ' . $id . ') ' .\n 'AND `status` = 1';\n\n $resultObj = $this->dbCon->query($sql);\n\n $rels = array();\n\n while ($row = $resultObj->fetch_assoc()) {\n $rel = new Relationship();\n $rel->arrToRelationship($row, $this->dbCon);\n $rels[] = $rel;\n }\n\n return $rels;\n }", "public function listIds($userid)\n {\n if ($this->cache->has('blocked_users_'.$userid)) {\n return $this->cache->get('blocked_users_'.$userid);\n } else {\n $q = $this->model->where('user_id', '=', $userid)->orderBy('id', 'desc')->lists('block_id');\n\n $q[] = 0;//prevent query issues\n $this->cache->forever('blocked_users_'.$userid, $q);\n return $q;\n }\n }", "public function getAllFriendRequests($user_id) {\n\t\t$limit = Input::get('limit') ?: 15;\n\n\t\t$friendRequests = FriendRequest::with('requester.profile_image')->where('friend_user_id', $user_id)\n\t\t\t\t\t\t\t\t\t\t->where('status', 0)->paginate($limit);\n\n\t\t$fractal = new Manager();\n\n\t\t$friendRequestsResource = new Collection($friendRequests, new FriendRequestTransformer);\n\n\t\t$friendRequestsResource->setPaginator(new IlluminatePaginatorAdapter($friendRequests));\n\n\t\t$data = $fractal->createData($friendRequestsResource);\n\n\t\treturn $data->toJson();\n\t}", "function getFollowers(): array\n {\n return $this->db->query('SELECT users.* FROM friends , users WHERE friends.friend = ? AND friends.user = users.id', $this->userObject['id'])->fetchAll();\n }", "function friend_of($user_id){\r\n // identify the opposite party.\r\n return ($user_id == $this->user_one->id)?\r\n $this->user_two : $this->user_one;\r\n }", "function getFriendCheckIns($user_id)\n\t{\n\t\t$uid = mysql_real_escape_string(\"$user_id\");\n\t\t$minutes = 60;\n\t\t\n\t\treturn getDBResultsArray(\n\t\t\"\t\n\t\t\tSELECT * \n\t\t\tFROM check_in\n\t\t\tWHERE user_id\n\t\t\tIN (\n\t\t\t\tSELECT user_a\n\t\t\t\tFROM friend_map\n\t\t\t\tWHERE user_b = '$uid'\n\t\t\t\tAND STATUS =1\n\t\t\t\tUNION SELECT user_b\n\t\t\t\tFROM friend_map\n\t\t\t\tWHERE user_a = '$uid'\n\t\t\t\tAND STATUS =1\n\t\t\t)\n\t\t\tAND TIME_TO_SEC(TIMEDIFF(NOW(), time)) < (60 * $minutes);\n\t\t\");\n\t}", "public function getUserIds() {\n return @$this->attributes['user_ids'];\n }", "public function getBlockedFriends() {\n $id = (int) $this->loggedInUser->getUserId();\n\n $sql = 'SELECT * FROM `relationship` ' .\n 'WHERE (`user_one_id` = ' . $id . ' OR `user_two_id` = ' . $id . ')' .\n ' AND `status` = 3 ' .\n 'AND `action_user_id` = ' . $id;\n\n $resultObj = $this->dbCon->query($sql);\n\n $rels = array();\n\n while ($row = $resultObj->fetch_assoc()) {\n $rel = new Relationship();\n $rel->arrToRelationship($row, $this->dbCon);\n $rels[] = $rel;\n }\n\n return $rels;\n }", "public function getRequestList(int $user_id): array\n {\n $requests = UserContact::find()->where(['friend' => $user_id])->andWhere(['status' => UserContact::status['await']])->orderBy(['created_at' => SORT_DESC])->asArray()->all();\n $return = [];\n if (!empty($requests)) {\n foreach ($requests as $key => $list) {\n if ($list['person'] !== $user_id)\n $person = \\zetsoft\\models\\user\\User::findOne($list['person']);\n else\n $person = \\zetsoft\\models\\user\\User::findOne($list['friend']);\n\n if ($person !== null) {\n $return[$key]['id'] = $person->id;\n $return[$key]['name'] = $person->title;\n $return[$key]['status'] = $person->status;\n $return[$key]['avatar'] = $person->photo;\n }\n }\n }\n return $return;\n }", "public static function GetFilterFansList($user_id, $fan_ids, $location, $country )\n {\n\t\t\t$sql = \"SELECT uf.id as Id, uf.user_id_follow as UserIdFollow, u.name as Name, u.first_name as FirstName, u.last_name as LastName, u.email as Email, u.dob as Dob, u.gender \t as Gender, u.country as Country, u.location as Location, u.avatar as Avatar FROM user_follow as uf INNER JOIN user as u ON uf.id = u.id WHERE 1\";\n\t\t\n\t\t$sql .=\" AND uf.user_id_follow = \".$user_id.\" AND uf.id IN (\".$fan_ids.\") AND uf.blocked = 0 AND uf.email_confirmed =1\";\t\t\n\n\t\t$users = Query::GetAll( $sql );\n\t\t\n return $users;\n }", "function friend_get_user_data($user_id_data)\n\t {\n\t $data = array();\n\t for($i=0; $i<count($user_id_data); $i++)\n\t\t{\n\t\t $username = $this->User_data->get_username(array('uId'=>$user_id_data[$i]));\n\t\t $headphoto_path = $this->User_data->get_user_headphotopath($user_id_data[$i]);\n\t\t $tags = array_slice($this->User_data->get_user_private_tag_data($user_id_data[$i]),0,5); \n\t\t $html = \"<div class='q_tags'>\";\n\t\t foreach($tags as $tag)\n\t\t {\n\t\t \t\t$html .= \"<a class='label'>\".$tag['tag_name'].\"</a>\";\n\t\t }\n\t\t $html .= \"</div>\";\n\t\t array_push($data, array($user_id_data[$i],$username,$headphoto_path,$html));\n\t\t}\n\t\treturn $data;\n\t }", "public function getMutualFriends($user_to_check) {\n\t\t\t// $MUTUALFRIENDS VARIABLE\n\t\t\t$mutualFriends = 0;\n\t\t\t// SET $USER_ARRAY VARIABLE\n\t\t\t$user_array = $this->user['friend_array'];\n\t\t\t// SPLIT $USER_ARRAY VARIABLE AT COMMA\n\t\t\t$user_array_explode = explode(',', $user_array);\n\n\t\t\t// DATABASE QUERY (FRIEND ARRAY OF $USER_TO_CHECK)\n\t\t\t$query = mysqli_query($this->connection, \"SELECT friend_array FROM users WHERE username='$user_to_check'\");\n\t\t\t// STORE QUERY RESULTS IN ARRAY\n\t\t\t$row = mysqli_fetch_array($query);\n\t\t\t// SET $USER_TO_CHECK_ARRAY VARIABLE FROM FRIEND ARRAY\n\t\t\t$user_to_check_array = $row['friend_array'];\n\t\t\t// SPLIT $USER_TO_CHECK_ARRAY VARIABLE AT COMMA\n\t\t\t$user_to_check_array_explode = explode(',', $user_to_check_array);\n\n\t\t\t// LOOP THROUGH BOTH FRIEND ARRAYS AND ADD 1 TO $MUTUALFRIENDS WHEN THEY MATCH\n\t\t\tforeach($user_array_explode as $i) {\n\t\t\t\tforeach($user_to_check_array_explode as $j) {\n\t\t\t\t\tif ($i == $j && $i != '') {\n\t\t\t\t\t\t$mutualFriends++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// RETURN VALUE OF MUTAL FRIENDS\n\t\t\treturn $mutualFriends;\n\t\t}", "public function countFriends($id) {\r\n\t\treturn $this->where(function($query) use ($id) {\r\n\t\t\t\t\t$query->where('first_user', $id);\r\n\t\t\t\t\t$query->orWhere('first_user', $id);\r\n\t\t\t\t})\r\n\t\t\t\t->where('status', 1)\r\n\t\t\t\t->count();\r\n\t}", "public function getEventHaventInvitedFriendList($eventID, $userID) {\r\n\t\t//$friendList= $this->getFriendList($userID);\r\n\t\t$result = $this->mysqli->prepare ( '(SELECT c4_friend.friend_id FROM c4_friend\r\n\t\t\tWHERE c4_friend.user_id =?\r\n\t\t\tAND c4_friend.friend_status =1\r\n\t\t\tAND c4_friend.friend_id NOT IN (SELECT user_id FROM c4_eventattend WHERE event_ID=?\r\n\t \t\tAND eventattend_status= 2)\r\n\t\t\t)\t\r\n\t\tUNION (\r\n\t\tSELECT c4_friend.user_id\r\n\t\tFROM c4_friend\r\n\t\tWHERE c4_friend.friend_id =?\r\n\t\tAND c4_friend.friend_status =1\r\n\t\tAND c4_friend.user_id NOT IN (SELECT user_id FROM c4_eventattend WHERE event_ID=?\r\n\t AND eventattend_status= 2))' );\r\n\t\tif ($result) {\r\n\t\t\t$result->bind_param ( 'iiii', $userID, $eventID, $userID, $eventID );\r\n\t\t\t$result->execute ();\r\n\t\t\t$result->bind_result ( $userID );\r\n\t\t\twhile ( $result->fetch () ) {\r\n\t\t\t\t// var_dump($userID);\r\n\t\t\t\t// echo \"<br>\";\r\n\t\t\t\t$userIDList [] = $userID;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t$result->close ();\r\n\t\t\tforeach ( $userIDList as $userID ) {\r\n\t\t\t\t$userList [] = $this->getUserAccountByID ( $userID );\r\n\t\t\t}\r\n\t\t\treturn $userList;\r\n\t\t\r\n\t\t}\r\n\t}", "public function getUserFollowersIds($username)\n\t{\n\t\treturn $this->con->get(\"$username/followers_ids\");\n\t}", "public function getFriendsArray($user_to_check) {\n\n\t\t$user_object = new User($this->conn,$this->user['user_id'] );\n\n\t\tif( $user_object->numOfFriendsFromProfile($user_to_check) == 0)\n\t\treturn \"<p style='border:1px solid #eee; padding:2px 10px; text-align:center;'>No Friends</p>\";\n\n\t\t$user_to_check_object = new User($this->conn,$user_to_check);\n\t\t$user_array = $user_to_check_object->getFriendArray();\n\t\t$user_array_explode = explode(\",\",$user_array);\n\t\t$friend_array = array();\n\t\t$friends = \"\";\n\n\t\tforeach($user_array_explode as $i){\n\t\t\tarray_push($friend_array,$i);\n\t\t}\n\t\t$i = 0;\n\t\tforeach( $friend_array as $friend){\n\t\t\tif($i++==0) continue;\n\t\t\tif($i == sizeof($friend_array)) continue;\n\t\t\t$friend_object = new User($this->conn,$friend);\n\n\t\t\t$friend_profilepic = $friend_object->getProfilePic();\n\t\t\t$friend_name = $friend_object->getFirstAndLastName();\n\t\t\t$friend_dept = $friend_object->getDept();\n\t\t\t$friend_num_of_friends = $friend_object->numOfFriends();\n\n\t\t\t$friends .= \"\n\t\t\t<a href='$friend'> \n\t\t\t\t<div class='friend_profile'> \n\t\t\t\t\t<img src='\".$friend_profilepic.\"'>\"\n\t\t\t\t\t.$friend_name.\n\t\t\t\t\t\"<div class='friend_profile_details'>\n\t\t\t\t\t\tFriends : \".$friend_num_of_friends. \"<br>\".$friend_dept.\"</div></div> \n\t\t\t</a>\";\n\t\t}\n\t\treturn $friends;\n\t}", "private function getBlocked(int $user_id, int $friend_id)\n {\n $contacts = UserContact::find()->where(['person' => $friend_id])->orWhere(['friend' => $friend_id])->andWhere(['status' => UserContact::status['accepted']])->all();\n $blocked = null;\n if (!$this->emptyOrNullable($contacts)) {\n foreach ($contacts as $contact) {\n if (($contact->person === $user_id && $contact->friend === $friend_id) || ($contact->person === $friend_id && $contact->friend === $user_id)) {\n $blocked = $contact->blocked;\n }\n }\n if ($blocked === 0)\n $blocked = null;\n }\n return $blocked;\n }", "public function getUserIds()\n {\n $this->_parse();\n\n return $this->_cache['userid'];\n }", "public function suggestFriendList($userID) {\r\n\t\t//$friendList=$this->getFriendList($userID);\r\n\t\t$result = $this->mysqli->prepare ( 'SELECT user_id FROM `c4_user` WHERE user_id != ? AND user_id NOT IN(\r\n \t\t\tSELECT friend_id FROM c4_friend WHERE user_id=?\r\n \t\t\tUNION(\r\n \t\t\tSELECT user_id FROM c4_friend WHERE friend_id=?\r\n\t\t\t\t)\r\n\t\t\t\t) \r\n\t\t\tORDER BY rand() LIMIT 5' );\r\n\t\tif ($result) {\r\n\t\t\t$result->bind_param('iii',$userID,$userID,$userID);\r\n\t\t\t$result->execute ();\r\n\t\t\t$result->bind_result ( $ID );\r\n\t\t\t$i = 0;\r\n\t\t\twhile ( $result->fetch () ) {\r\n\t\t\t\t$suggestList[]=$ID;\r\n\r\n\t\t\t}\r\n\t\t\t$result->close ();\r\n\t\t\tforeach($suggestList as $userID){\r\n\t\t\t$suggestUserList []= $this->getUserAccountByID($userID);\r\n\t\t}\r\n\t\treturn $suggestUserList;\r\n\t\t}\r\n\t//\treturn $suggestList;\r\n\t}", "function listOfUserIDs(){\n\t\t$ids = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$id = $obj->getUserID();\n\t\t\tarray_push($ids, $id);\n\t\t}\n\t\treturn $ids;\n\t}", "function load_friends_list( $user, $page = -1 )\n\t{\n\t\t$url\t= \"http://twitter.com/statuses/friends/{$user}.{$this->format}?cursor={$page}\";\n\t\t$args\t= array(\n\t\t\t\t\t\t'cache'\t\t=> true\n\t\t\t\t\t\t);\n\t\t$res = $this->_try_get_request( $url, $args );\n\n\t\t$body = wp_remote_retrieve_body($res);\n\t\t$body = json_decode($body);\n\t\t$friends = @$body->users;\n\n\t\tif( empty( $friends ) && !@$body->next_cursor ){\n\t\t\t// Delete cache as this request is useless\n\t\t\t// $_body = (isset($args['body']))?$args['body']:'';\n\t\t\t// $this->clear_cache( $url, $_body, $args );\n\n\t\t\treturn array();\n\t\t}\n\n\t\t// Recursive search for more friends\n\t\tif( $body->next_cursor ) // If there is a next page\n\t\t\t$friends_friends = array_merge(\n\t\t\t\t(array) $friends, $this->load_friends_list( $user, $body->next_cursor )\n\t\t\t);\n\t\telse\n\t\t\t$friends_friends = (array) $friends;\n\n\t\treturn $friends_friends;\n\t}", "function _add_user_friends_ids ($target_user_id, $add_friends_ids = array()) {\n\t\t$cur_friends_ids = $this->_get_user_friends_ids($target_user_id);\n\t\t// Merge current friends list with new ones\n\t\tif (is_numeric($add_friends_ids)) {\n\t\t\t$add_friends_ids = array($add_friends_ids);\n\t\t}\n\t\tforeach ((array)$add_friends_ids as $add_friend_id) {\n\t\t\t$cur_friends_ids[$add_friend_id] = $add_friend_id;\n\t\t}\n\t\t// Save friends ids\n\t\t$this->_save_user_friends_ids ($target_user_id, $cur_friends_ids);\n\t}" ]
[ "0.79189485", "0.7399979", "0.7395095", "0.72284615", "0.717168", "0.7117332", "0.70232797", "0.69738704", "0.68736225", "0.6857751", "0.68448734", "0.68150383", "0.67930335", "0.672505", "0.6721779", "0.67215466", "0.6685532", "0.6672795", "0.6653257", "0.66294813", "0.6608784", "0.65879154", "0.6586759", "0.6559099", "0.65249914", "0.6520679", "0.6510738", "0.6510184", "0.64777815", "0.6469794", "0.6445429", "0.64354175", "0.6423464", "0.6361518", "0.6354885", "0.63515425", "0.63315004", "0.6324315", "0.62857985", "0.6282402", "0.62461984", "0.6225069", "0.62165767", "0.62117213", "0.620737", "0.61972135", "0.6184162", "0.6182726", "0.61791205", "0.61754066", "0.61727035", "0.61625147", "0.61508733", "0.61203754", "0.61186343", "0.6104491", "0.6100033", "0.6092614", "0.60659254", "0.6060372", "0.6060372", "0.6051643", "0.6047904", "0.60256034", "0.5996209", "0.5994739", "0.5984249", "0.5984198", "0.5972655", "0.5965413", "0.5958894", "0.59566855", "0.5944951", "0.59399545", "0.5938355", "0.5931029", "0.5920658", "0.5920421", "0.5908944", "0.59033084", "0.5900083", "0.5894974", "0.58907825", "0.58860356", "0.58821213", "0.5880159", "0.58669996", "0.586174", "0.5855337", "0.5854127", "0.5848207", "0.58457935", "0.58424044", "0.583436", "0.582576", "0.5822645", "0.5822534", "0.58223647", "0.580879", "0.5805061" ]
0.783758
1
function that retrieves a students records from the excel file
функция, которая извлекает записи о студентах из файла Excel
function getStudentsInfo($excelObject,$startingRow,$sheet_index){ $students_info=array(); //get student information from the sheet for($i=$startingRow;$i<=$excelObject->rowcount($sheet_index);$i++) { $temp_array=array(); //import students personal information foreach(range('A', 'M') as $alphabet) $temp_array[$excelObject->val($startingRow-1,$alphabet,$sheet_index)]=$excelObject->val($i,$alphabet,$sheet_index); //import class information foreach(range('O', 'Z') as $alphabet) { if($excelObject->val($i,$alphabet,$sheet_index)!=="") $temp_array['cls_'.$excelObject->val($startingRow-2,$alphabet,$sheet_index)]=$excelObject->val($i,$alphabet,$sheet_index); } //import attendance information foreach(range('M', 'X') as $alphabet) { if($excelObject->val($i,"A".$alphabet,$sheet_index)!=="") $temp_array['attendance_'.$excelObject->val($startingRow-2,"A".$alphabet,$sheet_index)]=$excelObject->val($i,"A".$alphabet,$sheet_index); } //import scholarship //scholarship cannot be mapped with final scholarship list as we donot know tha class/level here foreach(range('A','L') as $alphabet) { if($excelObject->val($i,"A".$alphabet,$sheet_index)!=="") $temp_array['sch_'.$excelObject->val($startingRow-2,"A".$alphabet,$sheet_index)]=$excelObject->val($i,"A".$alphabet,$sheet_index); } //import bank details,stream,ecd number,ecd type and previous school, schooling source if this is the new excel file if(checkIsNewFile($excelObject)) { foreach(array("AY","AZ","BM","BN","BO","BP","BQ") as $alphabet) $temp_array[$excelObject->val($startingRow-1,$alphabet,$sheet_index)]=$excelObject->val($i,$alphabet,$sheet_index); } if($excelObject->val($i,'A',$sheet_index)!=="") array_push($students_info,$temp_array); } return $students_info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readStudentExcel() {\n\t\t$this->readStudentExcelFiles('./data/StudentListTest.xlsx');\n\t\t$this->readStudentExcelFiles('./data/StudentListTest.xls');\n\t\t$this->readStudentExcelFiles('./data/StudentListTest.csv');\n\t\t\n\t\t// $this->markTestIncomplete(\"Test ODS file\");\n\t}", "private function readStudentExcelFiles($filename) {\n\t\t// Read from any of the supported files directly\n\t\t$objPHPExcel = PHPExcel_IOFactory::load($filename);\n\n\t\t$rowIterator = $objPHPExcel->getActiveSheet()->getRowIterator();\n\t\t// Contains the list of ids which will be generated upon inserting into the database\n\t\t$student_insert_ids = array();\n\t\t$file_column_mapping = array('A' => 'name', 'B' => 'registernumber', 'C' => 'year', 'D' => 'semester', 'E' => 'mobile', 'F' => 'email', 'G' => 'address');\n\t\t\n\t\tforeach($rowIterator as $row) {\n\t\t\t$cellIterator = $row->getCellIterator();\n\t\t\t$cellIterator->setIterateOnlyExistingCells(true);\n\n\t\t\t//skip first row -- Since its the heading\n\t\t\tif(1 === $row->getRowIndex()) {\n\t\t\t\tforeach($cellIterator as $cell) {\n\t\t\t\t\tif('name' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'name';\n\t\t\t\t\t} else if('registernumber' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'registernumber';\n\t\t\t\t\t} else if('year' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'year';\n\t\t\t\t\t} else if('semester' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'semester';\n\t\t\t\t\t} else if('mobile' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'mobile';\n\t\t\t\t\t} else if('email' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'email';\n\t\t\t\t\t} else if('address' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'address';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Getting zero-based row index\n\t\t\t$rowIndex = $row->getRowIndex() - 2;\n\t\t\t$array_data[$rowIndex] = array('name' => '', 'registernumber' => '', 'year' => '', 'semester' => '', 'mobile' => '', 'email' => '', 'address' => '');\n\t\t\t\n\t\t\t// Get the data from the sheet\n\t\t\tforeach($cellIterator as $cell) {\n\t\t\t\t$prop = $file_column_mapping[$cell->getColumn()];\n\t\t\t\t$array_data[$rowIndex][$prop] = $cell->getValue();\n\t\t\t}\n\t\t\t\n\t\t\t// Insert the Student Data into DB\n\t\t\t// Map the Excel File fields to Student Model fields\n\t\t\t$student_post_data = array(\n\t\t\t\t\t\t\t\t\t'class_id' => 1, \n\t\t\t\t\t\t\t\t\t'year' => $array_data[$rowIndex]['year'],\n\t\t\t\t\t\t\t\t\t'idstudent' => $array_data[$rowIndex]['registernumber'],\n\t\t\t\t\t\t\t\t\t'name' => $array_data[$rowIndex]['name'],\n\t\t\t\t\t\t\t\t\t'email' => $array_data[$rowIndex]['email'],\n\t\t\t\t\t\t\t\t\t'address' => $array_data[$rowIndex]['address'],\n\t\t\t\t\t\t\t\t\t'mobile' => $array_data[$rowIndex]['mobile'],\n\t\t\t\t\t\t\t\t\t'current_semester' => $array_data[$rowIndex]['semester']\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t$r = Student::LoadAndSave($student_post_data, $this->db);\n\t\t\t\n\t\t\t$this->assertNotInstanceOf('PDOException', $r);\t// Make sure its not an error\n\t\t\t$this->assertEquals(false, is_object($r));\t// Make sure its not an error\n\t\t\t\n\t\t\tif(!is_object($r)) $student_insert_ids[] = $array_data[$rowIndex]['registernumber'];\n\t\t}\n\t\t\n\t\t// Test Data contains 1 records apart from the initial row\n\t\t$this->assertEquals(1, count($array_data));\n\t\t\n\t\t// Lets test if the data is actually read properly\n\t\t$this->assertEquals('Ashwanth', $array_data[0]['name']);\n\t\t$this->assertEquals('21203015', $array_data[0]['registernumber']);\n\t\t$this->assertEquals('4', $array_data[0]['year']);\n\t\t$this->assertEquals('8', $array_data[0]['semester']);\n\t\t$this->assertEquals('9003290112', $array_data[0]['mobile']);\n\t\t$this->assertEquals('ashwanthkumar@googlemail.com', $array_data[0]['email']);\n\t\t\n\t\t// Now delete the inserted fields from the datastore\n\t\tforeach($student_insert_ids as $sid) {\n\t\t\t$r = Student::Delete($sid, $this->db);\n\t\t\t$this->assertEquals(1, $r);\n\t\t}\n\t}", "public function upload_student_file(){\n\n\t\t//check if the excel file were set\n\t\tif(isset($_FILES[\"excelfile\"][\"name\"])){\n\n\t\t\t//get the path of the excel excelfile\n\t\t\t$path = $_FILES[\"excelfile\"][\"tmp_name\"];\n\n\t\t\t//load the object data\n\t\t\t$object = PHPExcel_IOFactory::load($path);\n\n\t\t\t//loop the object data to assign it to another array\n\t\t\tforeach($object->getWorksheetIterator() as $worksheet){\n\n\t\t\t\t//get the highest row and column of the excel file\n\t\t\t\t$highestRow = $worksheet->getHighestRow();\n\t\t\t\t$highestColumn = $worksheet->getHighestColumn();\n\n\t\t\t\t//loop the object with based on the highest row\n\t\t\t\tfor($row = 2; $row <= $highestRow; $row++){\n\n\t\t\t\t\t//get the object value from the excel and assign it to other variable\n\t\t\t\t\t$id_number = $worksheet->getCellByColumnAndRow(0, $row)->getValue();\n\t\t\t\t\t$lastname = $worksheet->getCellByColumnAndRow(1, $row)->getValue();\n\t\t\t\t\t$firstname = $worksheet->getCellByColumnAndRow(2, $row)->getValue();\n\t\t\t\t\t$middleinitial = $worksheet->getCellByColumnAndRow(3, $row)->getValue();\n\t\t\t\t\t$gender = $worksheet->getCellByColumnAndRow(4, $row)->getValue();\n\t\t\t\t\t$gradelevel = $this->input->post(\"gradelevel\");\n\n\t\t\t\t\t//create a data that will holds the data for the first table\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t\"LastName\"\t\t=> $lastname,\n\t\t\t\t\t\t\"FirstName\"\t\t=> $firstname,\n\t\t\t\t\t\t\"MiddleInitial\"\t=> $middleinitial,\n\t\t\t\t\t\t\"Gender\"\t\t=> $gender,\n\t\t\t\t\t);\n\n\t\t\t\t\t//create a data that will holds the data for the second table\n\t\t\t\t\t$data2[] = array(\n\t\t\t\t\t\t\"Username\"\t\t=> $id_number,\n\t\t\t\t\t\t\"Password\"\t\t=> md5(md5($id_number)),\n\t\t\t\t\t\t\"IsActive\"\t\t=> 1,\n\t\t\t\t\t\t\"UserRole\"\t\t=> \"Student\",\n\t\t\t\t\t);\n\n\t\t\t\t\t//create a data that will holds the data for the second table\n\t\t\t\t\t$data3[] = array(\n\t\t\t\t\t\t\"GradeLevel\"\t=> $gradelevel,\n\t\t\t\t\t\t\"Status\"\t\t=> \"UnAssigned\"\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//call the model function for uploading the students\n\t\t\t$result = $this->md->upload_student(\"userdetail\", \"useraccount\",\"studentlist\", $data, $data2, $data3, \"UserDetailId\", \"UserAccountId\");\n\n\t\t\t//return the result\n\t\t\techo $result;\n\n\t\t}\n\n\t}", "function findExaminersInExemption($ExemptionFile_FullPath,$staffName,$staffEmail,&$missingExaminerInExemption) {\n\n $PHPExcelObj = \\PhpOffice\\PhpSpreadsheet\\IOFactory::load($ExemptionFile_FullPath);\n $EXCEL_AllData = $PHPExcelObj->getActiveSheet()->toArray(null, true, true, true);\n\n try {\n $Offset = 2; // Exclude headers\n $Total_DataInSheet = count($EXCEL_AllData) - $Offset;\n $found = false;\n\n\n for ($RowIndex = 3; $RowIndex <= $Total_DataInSheet + $Offset; $RowIndex++) {\n\n // Check if name is empty or null\n if (isset($EXCEL_AllData[$RowIndex][\"B\"]) && !empty($EXCEL_AllData[$RowIndex][\"B\"])) {\n if (strtolower(trim($staffName)) == strtolower(trim($EXCEL_AllData[$RowIndex][\"B\"]))) {\n $found = true;\n }\n\n }\n }\n if ($found == false) {\n $missingExaminerInExemption[] = array(\"name\" => $staffName, \"email\" => $staffEmail);\n }\n return 0;\n }\n catch (Exception $Ex) {\n echo $Ex->getMessage();\n return -1; // General exception\n }\n\n}", "public function get_class_result_excel($class_id,$exam_id)\n {\n \n \n \n \n //Depends on schools settings for subjects done in that school\n //Should contain teachers data to prevent manipulation \n $objPHPExcel = new PHPExcel();\n // Set the active Excel worksheet to sheet 0\n $objPHPExcel->setActiveSheetIndex(0); \n // Initialise the Excel row number\n /* //Print header\n foreach($data as $key => $value)\n {\n $objPHPExcel->getActiveSheet()->SetCellValue(A++.'1',$key); \n }\n */\n \n //Set headers here this should be abstract by use of table meta or get variable names from \n $objPHPExcel->getActiveSheet()->SetCellValue('A1',\"Student Name\"); \n $objPHPExcel->getActiveSheet()->SetCellValue('B1',\"Mathematics\"); \n $objPHPExcel->getActiveSheet()->SetCellValue('C1', \"English\"); \n $objPHPExcel->getActiveSheet()->SetCellValue('D1',\"Kiswahili\"); \n $objPHPExcel->getActiveSheet()->SetCellValue('E1', \"Chemistry\");\n $objPHPExcel->getActiveSheet()->SetCellValue('F1', \"Biology\"); \n $objPHPExcel->getActiveSheet()->SetCellValue('G1',\"Physics\"); \n $objPHPExcel->getActiveSheet()->SetCellValue('H1', \"Geography\");\n $objPHPExcel->getActiveSheet()->SetCellValue('I1',\"History\"); \n $objPHPExcel->getActiveSheet()->SetCellValue('J1',\"CRE\"); \n $objPHPExcel->getActiveSheet()->SetCellValue('K1', \"Business\");\n $objPHPExcel->getActiveSheet()->SetCellValue('L1', \"French\"); \n $objPHPExcel->getActiveSheet()->SetCellValue('M1',\"H/S\"); \n \n $data=$this->teacher_model->get_class_result($class_id,$exam_id); \n $rowCount = 2; \n //Initialise data here \n foreach($data as $rs)\n {\n $objPHPExcel->getActiveSheet()->SetCellValue('A'.$rowCount, $rs->student_name); \n $objPHPExcel->getActiveSheet()->SetCellValue('B'.$rowCount, $rs->Mat); \n $objPHPExcel->getActiveSheet()->SetCellValue('C'.$rowCount, $rs->Eng);\n $objPHPExcel->getActiveSheet()->SetCellValue('D'.$rowCount, $rs->Kis); \n $objPHPExcel->getActiveSheet()->SetCellValue('E'.$rowCount, $rs->Che);\n $objPHPExcel->getActiveSheet()->SetCellValue('F'.$rowCount, $rs->Bio); \n $objPHPExcel->getActiveSheet()->SetCellValue('G'.$rowCount, $rs->Phy);\n// $objPHPExcel->getActiveSheet()->SetCellValue('H'.$rowCount, $rs->Geg); \n $objPHPExcel->getActiveSheet()->SetCellValue('I'.$rowCount, $rs->Hag);\n $objPHPExcel->getActiveSheet()->SetCellValue('J'.$rowCount, $rs->Cre); \n $objPHPExcel->getActiveSheet()->SetCellValue('K'.$rowCount, $rs->Bst);\n// $objPHPExcel->getActiveSheet()->SetCellValue('L'.$rowCount, $rs->fre);\n $objPHPExcel->getActiveSheet()->SetCellValue('M'.$rowCount, $rs->Hsc);\n $rowCount++; \n }\n // Instantiate a Writer to create an OfficeOpenXML Excel .xlsx file\n $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); \n // Write the Excel file to filename some_excel_file.xlsx in the current directory\n //$objWriter->save('some_excel_file.xlsx'); \n // redirect output to client browser\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"myfile.xlsx\"');\n header('Cache-Control: max-age=0'); \n $objWriter = IOFactory::createWriter($objPHPExcel, 'Excel2007');\n $objWriter->save('php://output'); \n exit();\n \n\n }", "public function readStaffExcel() {\n\t\t$this->readStaffExcelFile('./data/StaffListTest.xlsx');\n\t\t$this->readStaffExcelFile('./data/StaffListTest.xls');\n\t\t$this->readStaffExcelFile('./data/StaffListTest.csv');\n\t\t\n\t\t// $this->markTestIncomplete(\"Test ODS Files\");\n\t}", "private function readStaffExcelFile($filename) {\n\t\t// Read from any of the supported files directly\n\t\t$objPHPExcel = PHPExcel_IOFactory::load($filename);\n\n\t\t$rowIterator = $objPHPExcel->getActiveSheet()->getRowIterator();\n\t\t// Contains the list of ids which will be generated upon inserting into the database\n\t\t$staff_insert_ids = array();\n\t\t$file_column_mapping = array('A' => 'staffid', 'B' => 'name', 'C' => 'address', 'D' => 'designation', 'E' => 'mobile', 'F' => 'email');\n\t\t\n\t\tforeach($rowIterator as $row) {\n\t\t\t$cellIterator = $row->getCellIterator();\n\t\t\t$cellIterator->setIterateOnlyExistingCells(true);\n\n\t\t\t//skip first row -- Since its the heading\n\t\t\tif(1 === $row->getRowIndex()) {\n\t\t\t\tforeach($cellIterator as $cell) {\n\t\t\t\t\tif('name' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'name';\n\t\t\t\t\t} else if('staffid' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'staffid';\n\t\t\t\t\t} else if('designation' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'designation';\n\t\t\t\t\t} else if('mobile' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'mobile';\n\t\t\t\t\t} else if('email' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'email';\n\t\t\t\t\t} else if('address' == strtolower($cell->getValue())) {\n\t\t\t\t\t\t$file_column_mapping[$cell->getColumn()] = 'address';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Getting zero-based row index\n\t\t\t$rowIndex = $row->getRowIndex() - 2;\n\t\t\t$array_data[$rowIndex] = array('name' => '', 'staffid' => '', 'designation' => '', 'mobile' => '', 'email' => '', 'address' => '');\n\t\t\t\n\t\t\t// Get the data from the sheet\n\t\t\tforeach($cellIterator as $cell) {\n\t\t\t\t$prop = $file_column_mapping[$cell->getColumn()];\n\t\t\t\t$array_data[$rowIndex][$prop] = $cell->getValue();\n\t\t\t}\n\t\t\t\n\t\t\t// Insert the Staff Data into DB\n\t\t\t// Map the Excel File fields to Staff Model fields\n\t\t\t$staff_post_data = array(\n\t\t\t\t\t\t\t\t\t'name' => $array_data[$rowIndex]['name'],\n\t\t\t\t\t\t\t\t\t'designation' => $array_data[$rowIndex]['designation'], \n\t\t\t\t\t\t\t\t\t'dept_id' => 16, \n\t\t\t\t\t\t\t\t\t'staff_id' => $array_data[$rowIndex]['staffid'],\n\t\t\t\t\t\t\t\t\t'email' => $array_data[$rowIndex]['email'],\n\t\t\t\t\t\t\t\t\t'mobile' => $array_data[$rowIndex]['mobile'],\n\t\t\t\t\t\t\t\t\t'address' => $array_data[$rowIndex]['address']\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t$r = Staff::LoadAndSave($staff_post_data, $this->db);\n\t\t\t\n\t\t\t$this->assertNotInstanceOf('PDOException', $r);\t// Make sure its not an error\n\t\t\t\n\t\t\t// Run this assertion only if there is a PDOException\n\t\t\tif(is_object($r) && get_class($r) == \"PDOException\") \n\t\t\t\t$this->assertNotEquals('PDOException', $r->getMessage());\t// Make sure its not an error\n\t\t\t\t\n\t\t\t$this->assertEquals(false, is_object($r));\t// Make sure its not an error\n\t\t\t\n\t\t\tif(!is_object($r)) $staff_insert_ids[] = $array_data[$rowIndex]['staffid'];\n\t\t}\n\t\t\n\t\t// Test Data contains 3 records apart from the initial row\n\t\t$this->assertEquals(3, count($array_data));\n\t\t\n\t\t// Lets test if the data is actually read properly\n\t\t$this->assertEquals('Staff1', $array_data[0]['name']);\n\t\t$this->assertEquals('A123', $array_data[0]['staffid']);\n\t\t$this->assertEquals('AP-I', $array_data[0]['designation']);\n\t\t$this->assertEquals('1234567890', $array_data[0]['mobile']);\n\t\t$this->assertEquals('staff1@src.sastra.edu', $array_data[0]['email']);\n\t\t\n\t\t// Now delete the inserted fields from the datastore\n\t\tforeach($staff_insert_ids as $sid) {\n\t\t\t$r = Staff::Delete($sid, $this->db);\n\t\t\t$this->assertEquals(1, $r);\n\t\t}\n\t}", "public function getExcel();", "function getAllStudents(){\n $query =\"SELECT * FROM `student`\";\n $params = [];\n return DataBase::getInstance()->getRows($query,$params);\n }", "public function indexAjax(){\n\t\t\t\t\t$fileName = 'region.xls';\n\t\t\t\t\t$dir = str_replace('\\app\\Controller','',dirname(__FILE__));\n\t\t\t\t\t$pathName = $dir.'\\\\app\\\\webroot\\\\files\\\\CampExcel\\\\'.$fileName;\n\t\t\t\t\t$handle = fopen($pathName,\"r\");\n\t\t\t\t\t$data = new Spreadsheet_Excel_Reader();\n\t\t\t\t\t$data->setOutputEncoding('CP1251');\n\t\t\t\t\t$data->read($pathName);\n\t\t\t\t\techo '<pre>'; print_r($data->read); exit;\n }", "public function readCourseExcel() {\n\t\t$this->markTestIncomplete(\"Yet to write this test\");\n\t}", "function readoneforstudent(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE student_id = '\" . $this->student_id . \"'\";\n $result = mysqli_query($this->conn, $query);\n return $result;\n }", "public function get_students()\r\n\t\t{\r\n\t\t\t$user_id = $this->input->post('u_id');\r\n\t\t\t$result = $this->admin_model->get_students($user_id);\r\n\r\n\t\t\tforeach ($result as $row){\r\n\t\t\t\techo $row[\"first_name\"] . \" \" . $row[\"last_name\"] . ',';\r\n\t\t\t}\r\n\t\t}", "public function get_students(){\n \t\t$sql2 =\"SELECT `fname`,`lname`,`stud_id` FROM student WHERE is_active = 1\";\n \t\t\n\t $result = mysqli_query($this->db,$sql2);\t \n\t \t\t$user_data = array();\n\t\t\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t\t $user_data[] = $row;\n\t\t\t}\n\t if(count($user_data))\n\t \treturn $user_data;\n\t else\n\t \treturn false;\n \t}", "public abstract function get_records();", "private function import_student_data_from_excel($file_id, $season) {\n $subject = array(\n 'H' => 'chinese',\n 'I' => 'math',\n 'J' => 'english',\n 'K' => 'chemistry',\n 'L' => 'physics',\n 'M' => 'biology',\n );\n $data = array();\n $column = array (\n 'A' => 'studentno',\n 'B'=>'grade',\n 'C'=>'name',\n 'D'=>'gender',\n 'E'=>'school',\n 'F'=>'phone',\n 'G'=>'phone_bck',\n 'H' => 'chinese',\n 'I' => 'math',\n 'J' => 'english',\n 'K' => 'chemistry',\n 'L' => 'physics',\n 'M' => 'biology',\n 'N' => 'pay_status',\n );\n $l_map['season'] = $season;\n $l_map['token'] = $this->token;\n $data = D('WxyCourseLessonView')->where($l_map)->order('bat asc')->select();\n $lesson = array(); //course bat info stored in this variable.\n foreach ($data as $key => $vo) {\n $lesson[$vo['bat']] = $vo['courseid'];\n }\n\n $data = importFormExcel($file_id, $column, array(), 3); //read excel file from start_row!\n //var_dump($data);\n //exit();\n $student_model = D('WxyStudentCard');\n //var_dump($student_model);\n if ($data['status']) {\n foreach ($data['data'] as $row) {\n $row['token'] = $this->token;\n $row['uid'] = $this->uid;\n $row['phone'] = strval($row['phone']);\n $row['phone_bck'] = strval($row['phone_bck']);\n $row['pay_status'] = strval(array_search($row['pay_status'], $this->config['pay_status']));\n $row['gender'] == '女' && $row['gender'] = 1;\n $row['gender'] == '男' && $row['gender'] = 0;\n\n $map['token'] =$row['token'];\n $map['studentno'] = $row['studentno'];\n $map['grade'] =$row['grade'];\n $student = $student_model->where($map)->find();\n if(empty($student)){\n $student_model->addStudent($row);\n }\n else{\n $sid = $student['id'];\n $student_model->where($map)->save($row);\n }\n $row1['season'] = $season;\n $row1['token'] = $this->token;\n $row1['studentno'] = $row['studentno'];\n $row1['sid'] = $sid;\n $student_course_model = M('WxyStudentCourse');\n foreach ($subject as $key => $vo) {\n $row1['bat_no'] = $row[$vo];\n if (!empty($row1['bat_no'])) {\n if (empty($student_course_model->where($row1)->find())) {\n $row1['courseid'] = $lesson[$row1['bat_no']];\n $row1['timestamp'] = time();\n $student_course_model->add($row1);\n }\n }\n }\n }\n return true;\n }\n else return false;\n }", "public function testing(){\n\t\t/*\n\t\t\t$this->load->model('church_model');\n\n\t\t\t$data['users'] = $this->login_model->get_user('simsoon27','lala123');\n\t\t\t$churchInfo['details'] = $this->church_model->get_church('bic');\n\t\t\techo $data['users']['0']['username'];\n\t\t\techo $data['users']['0']['cid'];\n\t\t\techo $churchInfo['details']['0']['church_nm'];\n\t\t\t*/\n\t\t\t// $this->load->library('excel');\n\t\t\t/*\n\t\t\t$spreadsheet = new Spreadsheet();\n\t\t\t$sheet = $spreadsheet->getActiveSheet();\n\t\t\t$sheet->setCellValue('A1', 'Hello World !');\n\n\t\t\t$writer = new Xlsx($spreadsheet);\n\t\t\t$writer->save('hello world.xlsx');\n\t\t\t\t*/\n\n\n\t\t\t$reader = \\PhpOffice\\PhpSpreadsheet\\IOFactory::load(\"masterList.xlsx\");\n\t\t\t// $reader->setReadDataOnly(true);\n\t\t\t// $reader->load(\"hello world.xlsx\");\n\n\t\t\t$isExit = true;\n\t\t\t$count = 2;\n\n\t\t\twhile($isExit){\n\n\t\t\t\t\t$a = 'A' . $count;\n\t\t\t\t\t$b = 'B' . $count;\n\t\t\t\t\t$c = 'C' . $count;\n\t\t\t\t\t$d = 'D' . $count;\n\t\t\t\t\t$e = 'E' . $count;\n\t\t\t\t\t$f = 'F' . $count;\n\t\t\t\t\t$g = 'G' . $count;\n\n\t\t\t\t\tif(!empty($reader->getActiveSheet()->getCell($a)->getValue())){\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$name = $reader->getActiveSheet()->getCell($b)->getValue();\n\t\t\t\t\t\t$day = $reader->getActiveSheet()->getCell($a)->getValue();\n\t\t\t\t\t\t$max = $reader->getActiveSheet()->getCell($c)->getValue();\n\t\t\t\t\t\t$isdisplay = 0;\n\t\t\t\t\t\t$count2 = 0;\n\t\t\t\t\t\t*/\n\n\t\t\t\t\t\t$unique = $reader->getActiveSheet()->getCell($b)->getValue();\n\t\t\t\t\t\t$name = $reader->getActiveSheet()->getCell($a)->getValue();\n\t\t\t\t\t\t$country = $reader->getActiveSheet()->getCell($c)->getValue();\n\t\t\t\t\t\t$day1 = 'null';\n\t\t\t\t\t\t$day2 = 'null';\n\t\t\t\t\t\t$day3 = 'null';\n\t\t\t\t\t\t$isReg = 'N';\n\t\t\t\t\t\t$isInst = $reader->getActiveSheet()->getCell($d)->getValue();\n\t\t\t\t\t\t$instDay1 = $reader->getActiveSheet()->getCell($e)->getValue();\n\t\t\t\t\t\t$instDay2 = $reader->getActiveSheet()->getCell($f)->getValue();\n\t\t\t\t\t\t$instDay3 = $reader->getActiveSheet()->getCell($g)->getValue();\n\n\t\t\t\t\t\t//echo \"INSERT INTO `honor_tbl`(`honor_nm`, `day`, `isDisplay`, `count`, `maxCount`) VALUES ('$name',$day,$isdisplay,$count2,$max);\";\n\n\t\t\t\t\t\techo \"INSERT INTO `master_list_tbl`(`uniqId`, `name`, `clubNm`, `day1`, `day2`, `day3`, `isReg`, `isInst`, `instDay1`, `instDay2`, `instDay3`) VALUES ('$unique','$name','$country',$day1,$day2,$day3,'$isReg','$isInst','$instDay1','$instDay2','$instDay3');\";\n\n\t\t\t\t\t\t//echo \"INSERT INTO `master_list_tbl`(`uniqId`, `name`, `clubNm`, `day1`, `day2`, `day3`, `isReg`, `isInst`, `instDay1`, `instDay2`, `instDay3`) VALUES ('$unique','$name','$day1',null,null,null,'N','Y','Y','Y','Y');\";\n\n\n\t\t\t\t\t\techo '<br>';\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$isExit = false;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t /*\n\t\t\techo $reader->getActiveSheet()->getCell('A2')->getValue();\n\t\t\techo $reader->getActiveSheet()->getCell('B2')->getValue();\n\t\t\techo $reader->getActiveSheet()->getCell('C2')->getValue();\n\t\t\techo $reader->getActiveSheet()->getCell('D2')->getValue();\n\t\t\techo $reader->getActiveSheet()->getCell('E2')->getValue();\n\t\t\techo $reader->getActiveSheet()->getCell('F2')->getValue();\n\t\t\techo $reader->getActiveSheet()->getCell('G2')->getValue();\n\t\t\t*/\n\n\t}", "public function showFileInfo() {\n $files = 'uploaded_files/isbn.csv'; \n\n $books = []; //Nested array to hold all the arrays\n\n if (@$file_handle = fopen($files, 'r')){ \n\n \n while ($data = fgetcsv($file_handle)) { \n $books[] = $data[0];\n }\n return $books; \n\n //Close the file \n fclose($file_handle);\n } \n }", "public function get_student_record(){\n\n\t\t//get the current id\n\t\t$studentid = $this->input->get(\"id\");\n\n\t\t$data = json_encode($this->md->model_get_data_from_4_table_w_condition(\"examresult\",\"useraccount\", \"userdetail\", \"book\", \"examresult.StudentId = useraccount.UserAccountId\", \"useraccount.UserDetailId = userdetail.UserDetailId\", \"examresult.BookId = book.BookId\", \"examresult.StudentId=\".$studentid, \"INNER\"));\n\n\t\t//echo the result\n\t\techo $data;\n\t}", "public function excel() {\n self::$repNo=$_GET['col'];\n self::$export=true;\n if (self::$repNo) {\n $this->connect();\n $this->setExcelHead($_GET[filename].\".xls\");\n $where=$this->CreateFilterString(\"HAVING\");\n $this->GetPagingGroupArray(self::$repNo,$where);\n $this->GetArrayGroupReport(self::$repNo,$where);\n $this->close();\n }\n }", "protected function readBankReportFile()\n {\n// move_uploaded_file($_FILES['bankReportFile']['tmp_name'], $file);\n// $spreadSheet = \\PhpOffice\\PhpSpreadsheet\\IOFactory::load($file);\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xls;\n $reader->setReadDataOnly(true);\n $data = $reader->load($_FILES['bankReportFile']['tmp_name']);\n\n return $data;\n }", "public function getrowsAction() {\n\t\t$searchObj = new Model_Table_StudentSearch();\n\n\t\t// get the list of all searches for this user\n\t\t$mySearches = $searchObj->mySearches($this->usersession->sessIdUser, 'my_searches');\n\t\t\n\t\t// get the main search options (limit/status/sort)\n\t\t// as well as the the search row data\n\t\t$mySearch = $searchObj->getSearch($mySearches[0]['id_student_search'], 'my_searches');\n if(0 < count($mySearch['subforms']['my_searches'])) {\n\t $data = new Zend_Dojo_Data('id_student_search_rows', $mySearch['subforms']['my_searches']);\n } else {\n \t$data = new Zend_Dojo_Data('id_student_search_rows', array());\n }\n \n $this->view->data = $data->toJson();\n return $this->render('data');\n\t\t\t\t\n\t}", "public function indexAction() {\n $file = PHPExcel_IOFactory::load(APPLICATION_PATH . '/../data/courts.xls');\n //Zend_Debug::dump($file);\n $writer = new Zend_Log_Writer_Firebug();\n $logger = new Zend_Log($writer);\n\n foreach ($file->getWorksheetIterator() as $worksheet) {\n\n $title = $worksheet->getTitle();\n $rows = $worksheet->getHighestRow(); // количество строк\n $column = $worksheet->getHighestColumn(); // колонок\n $index = PHPExcel_Cell::columnIndexFromString($column);\n $columns = ord($column) - 64;\n\n for ($row = 2; $row <= $rows; ++$row) {\n $court = trim($worksheet->getCellByColumnAndRow(1, $row)->getValue());\n $code = trim($worksheet->getCellByColumnAndRow(6, $row)->getValue());\n }\n }\n \n }", "public function get_records(){\n\t\t\t$sql='select * from tbl_institute';\n \t\t\t$query=$this->db->query($sql);\n\t\t\t$result = $query->result();\n \treturn $result;\n\t\t}", "function get_student_by_details($params) { \n $student_bll = new Student_BLL();\n $result = $student_bll->check_student_exists($params);\n $studentID = $result[id];\n if ($studentID == false){ //no student found with given student name, mail & phone\n $studentID = -1;\n }\n $response_array['status'] = 'ok'; \n $response_array['studentID'] = $studentID;\n return $response_array;\n }", "function getExceldata($file,$type)\t\t\t\r\n{\r\n\t\r\n\t$fileInfo = pathinfo($file) ;\r\n\t\t\r\n\tif($type=='final')\r\n\t\t$rindex=6;\r\n \r\n\tif($fileInfo['extension']=='xls')\r\n\t{\r\n\t\trequire_once(INCLUDE_PATH.\"/reader.php\");\r\n\t\t$data1 = new Spreadsheet_Excel_Reader();\r\n\t\t$data1->setOutputEncoding('Windows-1252');\r\n\t\t$data1->read($file);\r\n\t\t\r\n\t\treturn $data1->sheets[0];\r\n\t}\r\n\telseif($fileInfo['extension']=='xlsx')\r\n\t{\r\n\t\trequire_once (INCLUDE_PATH.\"/PHPExcel.php\");\r\n \r\n\t\t$objReader = PHPExcel_IOFactory::createReader('Excel2007');\r\n\t\t$objReader->setReadDataOnly(true);\r\n\t\t$objPHPExcel = $objReader->load($file);\r\n\t\t$sheetname = $objPHPExcel->getSheetNames();\r\n\t\tforeach ($objPHPExcel->getWorksheetIterator() as $objWorksheet) {\r\n\t\t $xlsArr1[] = $objWorksheet->toArray(null,true,true,false);\r\n\t\t}\r\n\t\t\r\n\t\treturn $xlsArr1[0];\r\n\t}\r\n}", "public function excel();", "function show_students()\n\t\t\t{\n\t\t\t\t$query = $this->db->get('students');\n\t\t\t\t$query_result = $query->result();\n\t\t\t\treturn $query_result;\n\t\t\t}", "function HandleExcelData_ExaminerList($error_code, $InputFile_FullPath, $ExemptionFile_FullPath)\n{\n $Contents = \"********************************** LOADING examiner_list **********************************\\n\";\n //$PHPExcelObj = PHPExcel_IOFactory::load($InputFile_FullPath);\n $PHPExcelObj = \\PhpOffice\\PhpSpreadsheet\\IOFactory::load($InputFile_FullPath);\n\n $EXCEL_AllData = $PHPExcelObj->getActiveSheet()->toArray(null, true, true, true);\n\n global $TABLES, $conn_db_ntu;\n try {\n\n\n\n $Stmt = sprintf(\"SELECT * FROM %s\", $TABLES[\"staff\"]);\n $DBOBJ_Result = $conn_db_ntu->prepare($Stmt);\n $DBOBJ_Result->execute();\n $Data = $DBOBJ_Result->fetch(PDO::FETCH_ASSOC);\n\n\n // initialize all staff examinable to be 0\n if (isset($Data['id']) && !empty($Data['id'])) {\n $initialize = sprintf(\"UPDATE %s SET exemption = 0, examine = 0\", $TABLES[\"staff\"]);\n $conn_db_ntu->prepare($initialize)->execute();\n }\n\n $Offset = 1; // Exclude headers\n $Total_DataInSheet = count($EXCEL_AllData) - $Offset;\n $Total_DataEmpty = 0;\n // $staffWithoutEmail = array();\n $newExaminerWithoutName2 = array();\n $missingExaminerInExemption = array();\n\n $RowCount = 0;\n $RowCount_Updated = 0;\n $RowCount_Created = 0;\n\n if (isset($_REQUEST['filter_Year']))\n $year = $_REQUEST['filter_Year'];\n\n\n //$Stmt = sprintf(\"UPDATE %s SET exemption = %d,exemptionS2 = %d, examine = %d\", $TABLES[\"staff\"], 0,0,0);\n //$conn_db_ntu->prepare($Stmt)->execute();\n\n // Data starts at row 2\n for ($RowIndex = 2; $RowIndex <= $Total_DataInSheet + $Offset; $RowIndex++) {\n $RowCount++;\n\n if (isset($EXCEL_AllData[$RowIndex][\"D\"]) && !empty($EXCEL_AllData[$RowIndex][\"D\"])) {\n $EXCEL_StaffEmail = strtolower(trim($EXCEL_AllData[$RowIndex][\"D\"]));\n $EXCEL_StaffName = trim($EXCEL_AllData[$RowIndex][\"B\"]);\n $EXCEL_StaffID = explode(\"@\", $EXCEL_StaffEmail)[0];\n $EXCEL_Loading = intval(explode(\"%\", $EXCEL_AllData[$RowIndex][\"G\"])[0]);\n\n // Check if the staff in excel list is in staff table\n $Stmt = sprintf(\"SELECT * FROM %s WHERE id = '%s'\", $TABLES[\"staff\"], $EXCEL_StaffID);\n $DBOBJ_Result = $conn_db_ntu->prepare($Stmt);\n $DBOBJ_Result->execute();\n $Data = $DBOBJ_Result->fetch(PDO::FETCH_ASSOC);\n\n $temp = (int)substr($year, -2);\n $acadyear = (int)((string)$temp . (string)($temp + 1));\n\n\n // count the number of projects in the selected year and sem\n // only updates if there is project for the selected year and semester.\n $stmt2 = sprintf(\"SELECT COUNT(*) FROM %s WHERE examine_year = '%s' AND examine_sem = '%s'\", $TABLES[\"fea_projects\"], $acadyear, 1);\n $DBOBJ_Result = $conn_db_ntu->prepare($stmt2);\n $DBOBJ_Result->execute();\n $projects = $DBOBJ_Result->fetchColumn();\n\n $facultySize = $Total_DataInSheet;\n //echo '<script> alert(\"$Total_DataInSheet\")</script>';\n $base = $projects * 4 / $facultySize;\n\n\n\n // calculate staff's contribution in sem 1\n $stmt3 = sprintf(\"SELECT COUNT(*) FROM %s LEFT JOIN %s ON fyp_assign.project_id = fea_projects.project_id WHERE fea_projects.examine_year = %d AND fea_projects.examine_sem = %d AND staff_id = '%s'\", $TABLES[\"fyp_assign\"], $TABLES[\"fea_projects\"], $acadyear, 1, $EXCEL_StaffID);\n $DBOBJ_Result = $conn_db_ntu->prepare($stmt3);\n $DBOBJ_Result->execute();\n $contribution = $DBOBJ_Result->fetchColumn();\n\n $exemption = intval(floor(($base * (1 - ($EXCEL_Loading / 100))))) + $contribution * 3;\n\n\n if (isset($Data['id']) && !empty($Data['id'])) {\n // Try to update the examine of the staff\n\n $Stmt = sprintf(\"UPDATE %s SET workload = %d, exemption = %d, examine = %d WHERE id ='%s'\", $TABLES[\"staff\"], $EXCEL_Loading, $exemption, 1, $EXCEL_StaffID);\n $DBOBJ_Result = $conn_db_ntu->prepare($Stmt);\n if ($DBOBJ_Result->execute()) {\n $RowCount_Updated++;\n $Contents = $Contents . sprintf(\"%03d. Staff exemption: %d : %-25s : %-35s . Examine and exemption updated successfully \\n\", $RowCount, $exemption, $Data['id'], $Data['name']);\n } else {\n $Contents = $Contents . sprintf(\"%03d. Staff : %-25s : %-35s . Examine was not updated successfully \\n\", $RowCount, $Data['id'], $Data['name']);\n }\n\n } else {\n\n\n // Try to create the Examine of the staff\n $Stmt = sprintf(\"INSERT INTO %s (id, email, name, workload,exemption, examine) VALUES('%s', '%s', '%s', %d, %d, %d)\", $TABLES[\"staff\"], $EXCEL_StaffID, $EXCEL_StaffEmail,$EXCEL_StaffName, $EXCEL_Loading, $exemption, 1);\n $DBOBJ_Result = $conn_db_ntu->prepare($Stmt);\n if ($DBOBJ_Result->execute()) {\n $RowCount_Created++;\n $Contents = $Contents . sprintf(\"%03d. Staff : %-25s : %-35s : Exemption : %2d . Examine created successfully! \\n\", $RowCount, $EXCEL_StaffID, $EXCEL_StaffName, $exemption);\n } else {\n $Contents = $Contents . sprintf(\"%03d. Staff : %-25s : %-35s . Examine was not created successfully \\n\", $RowCount, $EXCEL_StaffID, $EXCEL_StaffName);\n }\n\n // to do let user input name2\n $newExaminerWithoutName2[] = array(\"name\" => $EXCEL_StaffName, \"email\" => $EXCEL_StaffEmail);\n\n }\n\n\n $sem =0;\n\n if (isset($_REQUEST['filter_Sem']))\n $sem = $_REQUEST['filter_Sem'];\n\n\n if ($sem == 2) {\n findExaminersInExemption($ExemptionFile_FullPath, $EXCEL_StaffName,$EXCEL_StaffEmail,$missingExaminerInExemption);\n }\n\n\n } else {\n $Total_DataEmpty++;\n $Contents = $Contents . sprintf(\"%03d. %-30s : %03d %-35s\\n\", $RowCount, \"Empty email detected at row \", $RowCount, \". FAILED - No Email\");\n }\n }\n\n\n\n\n\n // store new examiner without name2 into session var for modal input\n if (!empty($newExaminerWithoutName2)) {\n if (session_status() !==PHP_SESSION_ACTIVE) { session_start();}\n $_SESSION[\"newExaminerWithoutName2\"] = $newExaminerWithoutName2;\n }\n // store new examiner not in exemption file into session var for modal input\n if (!empty($missingExaminerInExemption)) {\n if (session_status() !==PHP_SESSION_ACTIVE) { session_start();}\n $_SESSION[\"missingExaminerInExemption\"] = $missingExaminerInExemption;\n\n\n }\n $Contents = $Contents . sprintf(\"%-35s : %04d/%04d\\n\", \"Total staff examine updated\", $RowCount_Updated, $Total_DataInSheet - $Total_DataEmpty);\n $Contents = $Contents . sprintf(\"%-35s : %04d\\n\", \"Total staff examine created\", $RowCount_Created);\n // RESULT\n $file = \"submit_import_examiner_settings.txt\";\n file_put_contents($file, $Contents, LOCK_EX);\n\n\n return $error_code;\n } catch (Exception $Ex) {\n echo $Ex->getMessage();\n return $error_code = 5; // General exception\n }\n}", "function getAllPermitUser() {\n \n $service = connectSheet();\n\n $spreadsheetId = \"<YOUR_SPREADSHEET_ID>\"; //It is present in your URL\n\n $get_range = \"<SHEET_NAME:RANGE>\";\n\n //Request to get data from spreadsheet.\n\n $response = $service->spreadsheets_values->get($spreadsheetId, $get_range);\n\n $values = $response->getValues();\n\n return $values;\n}", "function getReviewReimSheetUsers($assessment_id) {\n \n $res=$this->db->get_results(\"SELECT user_id,sheet_status FROM h_user_review_reim_sheet_status \n WHERE assessment_id=?\",array($assessment_id));\n return $res?$res:array();\n }", "function readone(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE activity_id = \" . $this->activity_id . \" AND student_id = '\" . $this->student_id . \"'\";\n $result = mysqli_query($this->conn, $query);\n return $result;\n }", "function lookupStudent($srno){\n\t\t\t\t$res = mysql_query(\"select * from freeEdu.MSTUDENTT s where s.srno like '$srno' \");\n\t\t\t\tif(mysql_num_rows($res)<=0)\n\t\t\t\t\treturn \"false\";\n\t\t\t\treturn mysql_fetch_array($res);\n\t\t\t}", "public function import(Request $request){\n if($request->hasFile('file')){\n\n $file = $request -> file;\n if($file->getClientOriginalExtension() == 'xlsx'){\n $students = (new FastExcel)->import($file)->toArray();\n // check if the first column is STT\n if(strtolower(array_keys($students[0])[0])!=\"stt\"){\n return redirect()->back()->with('error','File không đúng định dạng');\n }\n\n\n $arr = array_filter($students,function($student){\n return $student['STT'] != '';\n });\n\n foreach($arr as $student){\n $value = array_values($student);\n $username = preg_replace('/[^0-9]/', '', $value[1]);\n StudentAccount::updateOrCreate([\"username\"=>$this->trim_str($username)],\n [\"username\"=>$this->trim_str($username),\"full_name\"=>$value[3],\n \"vnu_mail\"=>$value[4],\"school_year\"=>$value[5]]);\n User::updateOrCreate([\"name\"=>$this->trim_str($username)],['name'=>$this->trim_str($username),\"password\"=>bcrypt($value[2]),\"email\"=>$value[4],\"role\"=>3]);\n }\n\n return redirect()->back()->with('success','Done');\n }\n }else{\n return redirect()->back();\n }\n }", "public function download_xls() {\n $tenant_id = $this->user->tenant_id;////added by shubhranshu due to client request\n if($tenant_id =='T02'){\n $file_name = \"uploads/Xprienz_Trainee_Bulk_Registration.xls\";\n ob_clean();\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Disposition: attachment;filename=Xprienz_Trainee_Bulk_Registration.xls\");\n readfile(base_url() . $file_name);\n exit();\n }else{\n $file_name = \"uploads/Trainee_Bulk_Registration.xls\";\n ob_clean();\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Disposition: attachment;filename=Trainee_Bulk_Registration.xls\");\n readfile(base_url() . $file_name);\n exit();\n }\n \n }", "public function importStudents(Request $request) { \n try {\n Excel::import(new StudentImport, $request->file('file'));\n return responseJson(1, __(\"done\"));\n } catch (\\Exception $exc) { \n return responseJson(0, $exc->getMessage());\n } \n }", "public function fetchBatchWiseStudent() {\n\t\treturn $this->success($this->repo->fetchBatchWiseStudent($this->request->all()));\n\t}", "function getStudent($id){\n\t\trequire('db.php');\n\t\t$res = mysqli_query($co, \"SELECT nameUser, firstNameUser, mailUser, pwdUser\n\t\t\t\t\t\t\t\t\tFROM user\n\t\t\t\t\t\t\t\t\tWhere idUser = $id\") or die('err_getStudent');\n\n\t\tif (mysqli_num_rows($res) != 0) {\n\t\t\t$stu = mysqli_fetch_all($res);\n\t\t\treturn $stu;\n\t\t}\n\t}", "public static function getStudents() {\r\n\r\n\t\t$db = new data_base();\r\n $result = array();\r\n\r\n /* Connecting to the database */\r\n $db->connect();\r\n $cnx = $db->getConnection();\r\n\r\n /* Preparing statment then execute it */\r\n $query = \"SELECT * FROM student\";\r\n\r\n $res = mysql_query($query, $cnx);\r\n if( !$res ) {\r\n $db->close();\r\n throw new exception( \"An error occured while executing a request : \". mysql_error() );\r\n }\r\n\r\n\t\t/* For each row found, instantiate the object and then, push it into the array */\r\n while( $row = mysql_fetch_array($res) ) {\r\n\r\n\t\t\t$currentStudent = new student( $row['id_student'], $row['url_photo_student'], $row['name_student'], $row['mail_student'], \r\n $row['cellphone_student'], $row['degree_student'], $row['semester_student'], \r\n $row['skill_student'], $row['areas_student'] );\r\n\r\n\t\t\t$result[] = $currentStudent;\r\n }\r\n\r\n\t\t/* Finally, close the database */\r\n\t\t$db->close();\t\t\r\n\r\n\t\treturn $result;\r\n\t}", "public function bulk_excel($items) {\n\t\n\t\tif(empty($items)){\n\t\t\treturn false;\n\t\t}\n\t\n\t\t$objPHPExcel = new PHPExcel();\n\t\t$company = Isp::getActiveISP();\n\t\t$translator = Shineisp_Registry::getInstance ()->Zend_Translate;\n\t\n\t\t$objPHPExcel->getProperties()->setCreator($company['company']);\n\t\t$objPHPExcel->getProperties()->setLastModifiedBy($company['manager']);\n\t\t$objPHPExcel->getProperties()->setTitle(\"Office 2007 XLSX __CLASS__ Document\");\n\t\t$objPHPExcel->getProperties()->setSubject(\"Office 2007 XLSX __CLASS__ Document\");\n\t\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\n\t\t// Get the records from the customer table\n\t\t$data = self::get_customers($items);\n\t\n\t\t// Create the PDF header\n\t\t$objPHPExcel->getActiveSheet()->setTitle($translator->translate('Customer List'));\n\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 1, strtoupper($translator->translate('Customer List')));\n\t\n\t\tif(!empty($data[0])){\n\t\t\t$row = 4;\n\t\t\t$column = 0;\n\t\t\t\t\n\t\t\t// Fields header title\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column, 3, $translator->translate('Id'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Company'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Firstname'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Lastname'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Gender'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Email'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Password'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Birth Date'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Birth Place'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Birth District'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Birth Country'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Birth Nationality'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Tax Payer Number'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('VAT'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Company Type'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Legal form'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Note'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Status'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Group'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Language'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Newsletter'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Creation Date'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Upload Date'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Tax Free'));\n\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Address'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('City'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Code'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Country'));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, 3, $translator->translate('Area'));\n\t\t\t\n\t\t\t$column=0;\n\t\n\t\t\t// Get the main information of the client\n\t\t\tforeach ($data as $item){\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column, $row, $item['customer_id']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['company']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['firstname']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['lastname']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['gender']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['email']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['password']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['birthdate']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['birthplace']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['birthdistrict']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['birthcountry']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['birthnationality']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['taxpayernumber']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['vat']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['CompanyTypes']['name']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['Legalforms']['name']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['note']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['Statuses']['status']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['CustomersGroups']['name']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['issubscriber']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['created_at']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['updated_at']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $item['taxfree']);\n\t\t\t\t\n\t\t\t\t// get all the addresses\n\t\t\t\tforeach ($item['Addresses'] as $address){\n\t\t\t\t\t\n\t\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $address['address']);\n\t\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $address['city']);\n\t\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $address['code']);\n\t\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $address['Countries']['name']);\n\t\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $address['area']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\n\t\t\t\t// get all the contacts\n\t\t\t\tforeach ($item['Contacts'] as $contact){\n\t\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column, 3, $translator->translate($contact['ContactsTypes']['name']));\n\t\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($column++, $row, $contact['contact']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t\t$column = 0;\n\t\t\t}\n\t\t}\n\t\n\t\t// Create the XLS\n\t\t$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);\n\t\t$objWriter->save(PUBLIC_PATH . \"/tmp/\" . __CLASS__ . '.xlsx');\n\t\n\t\tdie(json_encode(array('url' => \"/tmp/\" . __CLASS__ . \".xlsx\")));\n\t}", "public function getMatrixDataFromSpreadsheet() {\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\t\t$msg = '';\n\n\t\t// get file\n\t\t$file = KRequest::getFile('file');\n\t\tif(!$file){\n\t\t\t$msg .= 'No File has been uploaded.';\n\t\t\techo json_encode(['success'=>false, 'message' => $msg]);\n\t\t\treturn;\n\t\t}\n\n\t\t$inputFileName = $file['tmp_name'];\n\t\t$userFileName = $file['name'];\n\n\t\t// get extension\n\t\t$tmpExtension = substr($inputFileName, strrpos($inputFileName, '.'));\n\t\t$userExtension = substr($userFileName, strrpos($userFileName, '.'));\n\t\t$newFileName = str_replace($tmpExtension, $userExtension, $inputFileName);\n\t\t$copyResult = rename($inputFileName, $newFileName);\n\t\tif($copyResult) $inputFileName = $newFileName;\n\n\t\t// Include PHPExcel_IOFactory\n\t\trequire_once KenedoPlatform::p()->getComponentDir('com_configbox').'/external/phpexcel/PHPExcel/IOFactory.php';\n\n\t\t// Read your Excel workbook\n\t\ttry {\n\t\t\t// extension check\n\t\t\tif(!in_array(strtolower($userExtension),['.xls', '.xlsx'])){\n\t\t\t\t$msg .= $extErrMsg = 'Not an Excel file.';\n\t\t\t\tthrow new Exception($extErrMsg);\n\t\t\t}\n\t\t\t$inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n\t\t\tif(empty($inputFileType)) {\n\t\t\t\t$msg .= $extErrMsg = 'Could not identify an Excel file.';\n\t\t\t\tthrow new Exception($extErrMsg);\n\t\t\t}\n\t\t\t$objReader = PHPExcel_IOFactory::createReader($inputFileType);\n\t\t\tif(empty($objReader)) {\n\t\t\t\t$msg .= $extErrMsg = 'Could not create Excel Reader.';\n\t\t\t\tthrow new Exception($extErrMsg);\n\t\t\t}\n\n\t\t\t// Set read only (may bring a slight performance improvement)\n\t\t\t$objReader->setReadDataOnly(true);\n\n\t\t\t$objPHPExcel = $objReader->load($inputFileName);\n\t\t\tif(empty($objPHPExcel)) {\n\t\t\t\t$msg .= $extErrMsg = 'Could not load Excel File Object.';\n\t\t\t\tthrow new Exception($extErrMsg);\n\t\t\t}\n\t\t\t// Get worksheet dimensions\n\t\t\t$sheet = $objPHPExcel->getSheet(0);\n\t\t\tif(empty($sheet)) {\n\t\t\t\t$msg .= $extErrMsg = 'Could not get Excel Sheet.';\n\t\t\t\tthrow new Exception($extErrMsg);\n\t\t\t}\n\t\t\t$highestRow = $sheet->getHighestRow();\n\t\t\tif(empty($highestRow)) {\n\t\t\t\t$msg .= $extErrMsg = 'Could not get Excel highest Row.';\n\t\t\t\tthrow new Exception($extErrMsg);\n\t\t\t}\n\t\t\t$highestColumn = $sheet->getHighestDataColumn();\n\t\t\tif(empty($highestColumn)) {\n\t\t\t\t$msg .= $extErrMsg = 'Could not get Excel highest Column.';\n\t\t\t\tthrow new Exception($extErrMsg);\n\t\t\t}\n\n\t\t} catch(Exception $e) {\n\t\t\tKLog::log('Error loading file \"'.pathinfo($inputFileName,PATHINFO_BASENAME).'\": ','error');//.$e->getMessage());\n\t\t\t$msg .= ' Error loading file `'.$file['name'].'`';\n\t\t\techo json_encode(array('success' => false, 'message' => $msg));\n\t\t\treturn;\n\t\t}\n\n\t\t// load Excel data\n\t\t$outputData = [];\n\t\t// Loop through each row of the worksheet in turn\n\t\tfor ($row = 1; $row <= $highestRow; $row++) {\n\t\t\t// Read a row of data into an array\n\t\t\t$excelData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row,\n\t\t\t\tNULL,\n\t\t\t\tTRUE,\n\t\t\t\tFALSE);\n\t\t\tif(!empty($excelData[0])) $outputData[] = $excelData[0];\n\t\t}\n\n\t\tif(empty($outputData)) {\n\t\t\t$msg .= 'Could not get Excel output data.';\n\t\t\techo json_encode(['success'=>false, 'message' => $msg]);\n\t\t\treturn;\n\t\t}\n\n\t\techo json_encode(['success'=>true, 'data' => $outputData]);\n\n\t\t// delete input file\n\t\tif(file_exists($inputFileName)) unlink($inputFileName);\n\n\t}", "public function retriveData() {\n $params = array(\n 'fields' => array(\n 'first_name'\n , 'last_name'\n , 'email'\n , 'password'\n , 'gender'\n , 'city'\n , 'country'\n , 'status'\n , 'agreement'),\n );\n $listing = $this->Detail->find('all', $params);\n echo \"<pre>\";\n print_r($listing);\n die;\n// $log = $this->Detail->getDataSource()->getLog(false, false);\n// debug($log);\n// die;\n }", "public function getStudentDetails()\r\n\t{\r\n\t\t$query = $this->db_con->query(\"SELECT * FROM students ORDER BY Student_Id DESC\");\r\n \t\t$result = array();\r\n \t\twhile ($row=$query->fetch_assoc()){\r\n \t\t\t$result[] = $row;\r\n \t\t}\r\n \t\treturn $result;\r\n\t}", "private function get_students()\n {\n return $this->students_model->find_all();\n }", "function get_student_record($studid)\n {\n $this->db->where('userID', $studid);\n $this->db->from('user');\n $query = $this->db->get();\n return $query->row();\n }", "public function getStudentList()\n\t\t {\n\t\t\t //get all values from database\n\t\t \t $students = $this->_DAL_Obj->getValue('students_info','*');\n\t\t\t\n\t\t\tif(!empty($students[0]))\n\t\t\t{\n\t\t\t\tforeach ($students as $student)\n\t\t\t\t{\n\t\t\t\t\t//getting student status\n\t\t\t\t\tif($student['student_status'] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$btn = '<button class=\"btn btn-success\">Active</button>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$btn = '<button class=\"btn btn-danger\">Deactive</button>';\n\t\t\t\t\t}\n\t\t\t\t\techo '<tr>\n\t\t\t\t\t\t\t<td>'.$student['f_name'].' '.$student['m_name'].' '.$student['l_name'].'</td>\n\t\t\t\t\t\t\t<td>'.$this->getInstituteName('institute_info','institute_id',$student['institute_id'],'name').'</td>\n\t\t\t\t\t\t\t<td>'.$student['email'].'</td>\n\t\t\t\t\t\t\t<td>'.$student['dob'].'</td>\n\t\t\t\t\t\t\t<td>'.$this->getInstituteName('student_status', 'id', $student['edu_level'], 'status_name').'</td>\n\t\t\t\t\t\t\t<td>'.$student['department'].'</td>\n\t\t\t\t\t\t\t<td><a href=\"edit-student.php?uid='.$student['user_id'].'\"><button class=\"btn btn-info\">Edit</button></a></td>\n\t\t\t\t\t\t\t<td>'.$btn.'</td>\n\t\t\t\t\t\t</tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t }", "function readExcelFile($inputFileName){ //read the excel file to insert the data\n\t\t$inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n\t\t$objReader = PHPExcel_IOFactory::createReader($inputFileType);\n\t\t$objReader->setReadDataOnly(false);\n\n\t\t$objPHPExcel = $objReader->load($inputFileName);\n\t\t$objWorksheet = $objPHPExcel->setActiveSheetIndex(0);\n\t\t$highestRow = $objWorksheet->getHighestRow();\n\t\t$highestColumn = $objWorksheet->getHighestColumn();\n\t\t$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);\n\n\t\treturn array($highestRow,$highestColumnIndex,$objWorksheet);\n\t}", "function get_student_record_row() {\n $sql = $this->query_exe(\"SELECT * FROM `tbl_student` WHERE id = '{$_SESSION['student_id']}' ORDER BY id DESC LIMIT 1\");\n $row = mysqli_fetch_assoc( $sql );\n \n return $row;\n }", "public function read_single_employee() {\n \n \n $selected_fields = array_map('trim', explode(',','Job_title'));\n $employee_fields = array_map('trim', explode(',', $_GET['fields']));\n print( $employee_fields);\n \n $fields = '';\n \n foreach ($employee_fields as $value) {\n if (!empty($value)) {\n \n if (in_array($value, $selected_fields) ) {\n $fields = $value . \",\";\n \n }\n }\n }\n \n if ($fields != '') {\n \n $fields = rtrim($fields, ',');\n }\n \n \n\n $query = 'SELECT id, Job_title , Salary, Location, YearsExperience\n FROM ' . $this->table .'WHERE Job_title='.$fields ;\n \n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n\n return $stmt;\n \n \n }", "public function partnerexcel() {\r\n $this->load->dbutil();\r\n $row =$this->Audit_started_model->getallPartnerData();\r\n $name = 'Partner List.csv';\r\n force_download($name, $row);\r\n }", "private function test_fetch_students() {\n $this->load->library('unit_test');\n\n $test = $this->fetch_students(\"Josh\")[0]->firstName; // Known-good database values (change as nessisary).\n $result = \"Joshua\"; // Should return a known-good student record.\n $name = \"test_fetch_students\";\n\n $this->unit->run($test, $result, $name);\n\n echo $this->unit->report();\n }", "public function upload_exam_file(){\n\n\t\t//check if the excel file were set\n\t\tif(isset($_FILES[\"excelfileexam\"][\"name\"])){\n\n\t\t\t//get the path of the excel excelfile\n\t\t\t$path = $_FILES[\"excelfileexam\"][\"tmp_name\"];\n\n\t\t\t//get the id of the book\n\t\t\t$book_id = $_POST[\"bookid\"];\n\n\t\t\t//load the object data\n\t\t\t$object = PHPExcel_IOFactory::load($path);\n\n\t\t\t//loop the object data to assign it to another array\n\t\t\tforeach($object->getWorksheetIterator() as $worksheet){\n\n\t\t\t\t//get the highest row and column of the excel file\n\t\t\t\t$highestRow = $worksheet->getHighestRow();\n\t\t\t\t$highestColumn = $worksheet->getHighestColumn();\n\n\t\t\t\t//loop the object with based on the highest row\n\t\t\t\tfor($row = 2; $row <= $highestRow; $row++){\n\n\t\t\t\t\t//get the object value from the excel and assign it to other variable\n\t\t\t\t\t$question = $worksheet->getCellByColumnAndRow(0, $row)->getValue();\n\t\t\t\t\t$option1 = $worksheet->getCellByColumnAndRow(1, $row)->getValue();\n\t\t\t\t\t$option2 = $worksheet->getCellByColumnAndRow(2, $row)->getValue();\n\t\t\t\t\t$option3 = $worksheet->getCellByColumnAndRow(3, $row)->getValue();\n\t\t\t\t\t$option4 = $worksheet->getCellByColumnAndRow(4, $row)->getValue();\n\t\t\t\t\t$correctanswer = $worksheet->getCellByColumnAndRow(5, $row)->getValue();\n\n\t\t\t\t\t//create a data that will holds the data for the first table\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t\"BookId\"\t\t\t=> $book_id,\n\t\t\t\t\t\t\"Question\"\t\t\t=> $question,\n\t\t\t\t\t\t\"Option1\"\t\t\t=> $option1,\n\t\t\t\t\t\t\"Option2\"\t\t\t=> $option2,\n\t\t\t\t\t\t\"Option3\"\t\t\t=> $option3,\n\t\t\t\t\t\t\"Option4\"\t\t\t=> $option4,\n\t\t\t\t\t\t\"CorrectAnswer\"\t\t=> $correctanswer,\n\t\t\t\t\t\t\"IsFileExam\"\t\t=> 0,\n\t\t\t\t\t\t\"ExamFileName\"\t\t=> \"\",\n\t\t\t\t\t\t\"IsDeleted\"\t\t\t=> 0,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// var_dump($data);\n\n\t\t\t//call the model function for uploading the students\n\t\t\t$result = $this->md->upload_exam(\"exam\", $data);\n\n\t\t\t//return the result\n\t\t\techo $result;\n\n\t\t}\n\n\t}", "public function listStudents(){\n $sql = \"SELECT * FROM interessados\";\n $response = $this->conn->query($sql);\n if($response->num_rows > 0){\n $students;\n while($row = $response->fetch_assoc()){\n $students[] = $row;\n }\n return array(\"erro\" => false, \"students\" => $students);\n }\n return array(\"erro\" => false, \"students\" => NULL);\n }", "function getAllStudents(){\n\t$conn = createDBConnection();\n\t$sql = \"SELECT * FROM SC_Students\";\t\t// SQL Call string\n\t$result = $conn->query($sql);\n\tif ($result->num_rows > 0) {\t\t\t// Check if there are rows in the query result.\n\n\t\techo \"<table class='tblContent'><thead><tr>\".\t\t// Notice that the output will be in form of echo calls.\n\t \"<th>Id</th>\".\n\t \"<th>First Name</th>\".\n\t \"<th>Last Name</th>\".\n\t \"<th>Level</th>\".\n\t \"</tr></thead><tbody>\";\n\n \twhile($row = $result->fetch_assoc()) {\t\t\t\t// Iterate over the result variable using fetch_assoc()\n \t\techo \"<tr><td>\".$row[\"Id\"].\"</td><td>\".$row[\"Name\"].\"</td><td>\".$row[\"LastName\"].\"</td><td>\".$row[\"Level\"].\"</td></tr>\";\n \t\t }\n\n \t\t echo \"</tbody></table>\";\n\t} else {\n \techo \"<p> There are no results </p>\";\n\t}\n\tcloseConnection($conn);\n}", "public function getExcel(){\n\t\t$data = User::orderBy('lastname')->where('active', 1)->get();\n \t$data1 = array();\n \tforeach ($data as $key => $item) {\n\t $user = new UserModelExcel();\n\t $user->meno = $item->lastname . \" \". $item->name . \", \" . $item->degree; \n\t $user->klapka = $item->phone; \n\t $user->kancelaria = $item->room;\n\t if(empty($item->department)){\n\t\t\t\t$user->odbor =\" \";\n\t }else{\n\t \t$user->odbor = $item->department->short;\n\t } \n\t \n \t\tarray_push($data1,(array) $user); \n \t} \n\n \t$nameExcel = \"pouzivatelia_\". date(\"d_m_y\");\n\n \treturn Excel::create($nameExcel, function($excel) use ($data1) {\n $excel->sheet('mySheet', function($sheet) use ($data1)\n {\n $sheet->fromArray($data1);\n });})->download('xlsx'); \n\t}", "public static function courseEnrollUserByTeacher($data, $filename = 'course_enroll_user')\n {\n $objPHPExcel = new \\PHPExcel();\n\n // Set document properties\n $objPHPExcel->getProperties()->setCreator(\"E-Learning\")\n ->setLastModifiedBy(\"E-Learning\")\n ->setTitle(Yii::t('frontend', 'face_course_enroll_user_list'))\n ->setKeywords(\"E-Learning\");\n\n // Add header\n $objPHPExcel->setActiveSheetIndex(0)\n ->setCellValue('A1', Yii::t('common', 'real_name'))\n ->setCellValue('B1', Yii::t('frontend', 'department'))\n ->setCellValue('C1', Yii::t('frontend', 'position'))\n ->setCellValue('D1', Yii::t('frontend', 'email'))\n ->setCellValue('E1', Yii::t('common', 'mobile'));\n\n $objSheet = $objPHPExcel->setActiveSheetIndex(0);\n foreach ($data as $index => $item) {\n $row = $index + 2;\n // Miscellaneous glyphs, UTF-8\n $objSheet->getStyle('E' . $row)->getNumberFormat()->setFormatCode(\\PHPExcel_Style_NumberFormat::FORMAT_TEXT);\n\n $objSheet->setCellValue('A' . $row, $item['real_name'])\n ->setCellValue('B' . $row, $item['orgnization_name_path'] . '/' . $item['orgnization_name'])\n ->setCellValue('C' . $row, $item['position_name'])\n ->setCellValue('D' . $row, $item['email'])\n ->setCellValue('E' . $row, $item['mobile_no']);\n }\n\n $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(10);\n $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(22);\n $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(15);\n $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(20);\n $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(15);\n\n// $objPHPExcel->getActiveSheet()->getStyle('A6')->getFont()->setName('宋体')->setSize(30);\n\n// Rename worksheet\n $objSheet->setTitle('User List');\n\n\n// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n $objPHPExcel->setActiveSheetIndex(0);\n\n\n// Redirect output to a client’s web browser (Excel2007)\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"' . $filename . '.xlsx\"');\n header('Cache-Control: max-age=0');\n// If you're serving to IE 9, then the following may be needed\n header('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n header('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header('Pragma: public'); // HTTP/1.0\n\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n $objWriter->save('php://output');\n\n }", "public function importGrades(Request $request){\n\n // //Validation\n $this->validate($request, array(\n 'file' => 'required',\n 'academic_year_id' => 'required',\n 'subject' => 'required'\n ));\n\n if($request->hasFile('file')){\n\n //Get the file extension\n $extension = File::extension($request->file->getClientOriginalName());\n\n //Use only excel file\n if ($extension == \"xlsx\" || $extension == \"xls\") {\n \n //Load excel data into array\n $data = Excel::toArray(new ImportGrades, $request->file('file'));\n\n //Check the file data\n if(!empty($data)){\n\n //Update 'grade_id' instead of 'grade'\n for($i = 0; count($data[0]) > $i ; $i++){\n\n if($i == 0){\n //To skip heading row\n continue;\n }\n\n //$i will be loop throught data\n //1 is the Grade column\n $id = DB::table('gradings')\n ->where('grade', $data[0][$i][1] )\n ->first();\n \n $data[0][$i][1] = $id->id;\n \n }\n\n\n //Student details alone with academic year\n $students = DB::table('students')\n ->join('student_subjects', 'student_subjects.students_stu_reg_no', '=', 'students.student_registration_number')\n ->where([['students.academic_year_id','=',$request->academic_year_id],\n ['student_subjects.subjects_subject_code','=', $request->subject],\n ])\n ->select('student_registration_number',\n 'student_index_number',\n 'academic_year_id',\n 'first_name',\n 'last_name',\n 'course_id',\n 'department_id')\n ->get();\n\n //Loop through the students object\n foreach($students as $student){\n\n for($i = 0; count($data[0]) > $i ; $i++){\n\n if($i == 0){\n //To skip heading row\n continue;\n }\n \n //$i will be loop throught data \n \n if($data[0][$i][0] == $student->student_registration_number){\n $student->grade_id = $data[0][$i][1];\n break;\n }\n \n }\n }\n\n\n $subject_code = $request->subject;\n $subject_title = Subject::find($request->subject)->title; \n $academic_year = AcademicYear::find($request->academic_year_id)->year;\n $gradings = Grading::all();\n $hint = \"import\";\n\n return view('grades.create')->with(['students' => $students,\n 'subject_code' => $subject_code,\n 'subject_title'=> $subject_title,\n 'academic_year' => $academic_year,\n 'academic_year_id' => $request->academic_year_id,\n 'gradings' => $gradings,\n 'hint' => $hint]); \n\n \n }\n \n Session::flash('warning', 'Uploaded file is empty. Please try again with correct file.');\n return back();\n \n }else {\n Session::flash('error', 'File is a '.$extension.' file. Please upload a valid excel file.');\n return back();\n }\n }\n\n // return $request->all();\n }", "public function get_students_name_ids()\r\n\t\t{\r\n\r\n\t\t\t$user_id = $this->input->post('u_id');\r\n\t\t\t$result = $this->admin_model->get_students($user_id);\r\n\r\n\t\t\tforeach ($result as $row){\r\n\t\t\t\techo $row[\"first_name\"] . \" \" . $row[\"last_name\"] . \"-\" . $row[\"student_id\"] . ',';\r\n\t\t\t}\r\n\t\t\r\n\t\t}", "private function read_csv()\n {\n $addressBook=[];\n // Code to read file $this->filename\n $handle = fopen($this->filename, 'r');\n while(!feof($handle)) \n {\n $row=fgetcsv($handle); \n if (is_array($row)) \n {\n $addressBook[] = $row;\n }\n }\n fclose($handle);\n return $addressBook;\n }", "public function view_students_archive()\n {\n\n $status = $this->db->get('tbl_student');\n return $status->result_object();\n \n }", "function showSalaryTable() {\n $this->readFile();\n echo '<table>';\n echo '<thead>\n <tr>\n <td>Nombre</td>\n <td>Apellidos</td>\n <td>Lunes</td>\n <td>Martes</td>\n <td>Miercoles</td>\n <td>Jueves</td>\n <td>Viernes</td>\n <td>Totales</td>\n <td>CCSS</td>\n <td>A.S.</td>\n <td>S. Neto</td>\n </tr>\n </thead>';\n foreach($this->sheet->getRowIterator() as $row) {\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(false);\n echo '<tr>';\n foreach($cellIterator as $cell) {\n if(!is_null($cell) &&\n ($cell->getColumn() == 'A' || \n $cell->getColumn() == 'B' || \n $cell->getColumn() == 'E' || \n $cell->getColumn() == 'F' || \n $cell->getColumn() == 'G' || \n $cell->getColumn() == 'H' || \n $cell->getColumn() == 'I'|| \n $cell->getColumn() == 'J'||\n $cell->getColumn() == 'M'|| \n $cell->getColumn() == 'N'|| \n $cell->getColumn() == 'O')) {\n\n $value = $cell->getValue();\n echo '<td>' . $value . '</td>';\n }\n }\n echo '</tr>';\n }\n echo '</table>';\n }", "public function importExcel(Request $request)\n\n\t{\n\n\n\n\t\tif($request->hasFile('import_file')){\n\t\t\tif($request->hasFile('import_file')){\n\t\t\t\t// Get filename with the extension\n\t\t\t\t$filenameWithExt = $request->file('import_file')->getClientOriginalName();\n\t\t\t\t// Get just filename\n\t\t\t\t$filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n\t\t\t\t// Get just ext\n\t\t\t\t$extension = $request->file('import_file')->getClientOriginalExtension();\n\t\t\t\t// Filename to store\n\t\t\t\t\n\t\t\t\tif($extension!=='xlsx')\n\t\t\t\t{\n\t\t\t\t\treturn back()->with('error','Unsuccessfull');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$path = $request->file('import_file')->getRealPath();\n\n\n\n\t\t\t$data = Excel::load($path, function($reader) {})->get();\n\n\n\n\t\t\tif(!empty($data) && $data->count()){\n\n\n\t\t\t\t$i=0;\n\t\t\t\t$errcount=0;\n\t\t\t\t$rowcount=0;\n\t\t\t\tforeach ($data->toArray() as $key => $value) {\n\n\t\t\t\t\tif(!empty($value)){\n\t\t\t\t\t\t//echo $value;\n\t\t\t\t\t\t//dd($value);\n\t\t\t\t\t\t// foreach ($value as $v) {\n\t\t\t\t\t\t// \tdd($v);\n\t\t\t\t\t\t// \t$insert = ['name' => $v['name'], 'email' => $v['email'], 'rollno' => $v['rollno']];\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t$rowcount++;\n\n\t\t\t\t\t\t$users = Student::where('rollno',$value['rollno']) ->orWhere('email',$value['email'])->get();\n\n\t\t\t\t\t\tif(count($users)>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errcount++;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t$insert[$i++]= ['name' => $value['name'], 'email' => $value['email'], 'rollno' => $value['rollno'], 'cgpa' => $value['cgpa']];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif($errcount==$rowcount)\n\t\t\t\t{\n\t\t\t\t\treturn back()->with('error','Only duplicate entries found');\n\n\t\t\t\t}\n\n\t\t\t\telse if($errcount > 0)\n\t\t\t\t{\n\t\t\t\t\t\\App\\Student::insert($insert);\n\n\t\t\t\t\treturn back()->with('error','Data inserted successfully except Duplicate entries found');\n\n\t\t\t\t}\n\n\n\n\t\t\t\tif(!empty($insert)){\n\n\t\t\t\t\t\\App\\Student::insert($insert);\n\n\t\t\t\t\treturn back()->with('success','Insert Record successfully.');\n\n\t\t\t\t}\n\n\n\n\t\t\t}\n\n\n\n\t\t}\n\n\n\n\t\treturn back()->with('error','Please Check your file, Something is wrong there.');\n\n\t}", "public function importemployees($redirect, $table)\n\t{\n\t\t\n\t\tif(isset($_FILES['file']['name']))\n\t\t{\n\t\t\t$filename = $_FILES[\"file\"][\"tmp_name\"];\n\t \n\t \n\t\t\t if($_FILES[\"file\"][\"size\"] > 0)\n\t\t\t {\n\t \n\t\t\t\t$file = fopen($filename, \"r\");\n\t\t\t\t\n\t\t\t\t$row = 0;\n\t\t\t\t\n\t\t\t\t while (($emapData = fgetcsv($file, 10000, \",\")) !== FALSE)\n\t\t\t\t {\n\t\t\t\t\t $row++;\n\t\t\t\t\t \n\t\t\t\t\t if($row == 1){}\n\t \t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t\t \n\t\t\t\t\t\t $fname = $emapData[2];\n\t\t\t\t\t\t $lname = $emapData[3];\n\t\t\t\t\t\t $dob = $emapData[5];\n\t\t\t\t\t\t $deptitles = $emapData[6];\n\t\t\t\t\t\t $gender = $emapData[7];\n\t\t\t\t\t\t \n\t\t\t\t\t\t $check_datas = $this->getcustomdata(\"select * from employees order by employeeId desc limit 1\");\n\t\t\t\t\t\t $empcode = '';\n\t\t\t\t\t\t foreach($check_datas as $data)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t $empcode = $data->employeeCode;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $empcode_array = preg_split('/(?<=[A-Z])(?=[0-9]+)/i', $empcode);\n\t\t\t\t\t\t \n\t\t\t\t\t\t $empcode_num = $empcode_array[1];\n\t\t\t\t\t\t \n\t\t\t\t\t\t $new_num = $empcode_num+1;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if($new_num > 9)\n\t\t\t\t\t\t \t$codeprefix = \"EMP0\";\n\t\t\t\t\t\t else if($new_num > 99)\n\t\t\t\t\t\t \t$codeprefix = \"BSHCL\";\n\t\t\t\t\t\t else if($new_num < 10)\n\t\t\t\t\t\t \t$codeprefix = \"EMP00\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t $check_departs = $this->getindividual(\"departments\", \"name\", $deptitles);\n\t\t\t\t\t\t \n\t\t\t\t\t\t foreach($check_departs as $depart)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t $depid = $depart->departmentId;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $code = $codeprefix.$new_num;\n\t\t\t\t\t\t \n\t\t\t\t\t\t $columns = \"employeeCode, department, fname, lname, dob, gender\";\n\t\t\n\t\t\t\t\t\t $values = \"'$code', '$depid', '$fname', '$lname', '$dob', '$gender'\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t $data = $this->model->saveexcel($table, $columns, $values, $redirect);\t\n\t\t\t\t\t }\n\t\t\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t fclose($file);\n\t\t\t\t \n\t\t\t\t $this->model->Alert(\"alert-success\", \"Data has been uploaded successfully!\");\n\t\t\t\t \n\t\t\t }\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "function establishment_file(){\n $myFile = \"./upload/establishment.txt\";\n $this->load->library('parser');\n \n //load required data from database\n $userDetails = $this->user_model->establishment();\n $data['user_details'] = $userDetails;\n\t\t\n\t\tforeach($userDetails as $abc){\n\t\t\t$array = get_object_vars($abc);\n\t\t\t//echo $comma_separated = implode(\"+\",$array);\t\n\t\t}\n\t\t\n //pass retrieved data into template and return as a string\n $stringData = $this->parser->parse('establishment_details_csv', $data, true);\n $stringData = trim($stringData);\n //open excel and write string into excel\n $fh = fopen($myFile, 'w') or die(\"can't open file\");\n fwrite($fh, $stringData);\n fclose($fh);\n $this->checkcharacters($myFile);\n }", "public function downloadExcelFile()\n\t{\n $data = User::get()->toArray();\n return Excel::create('newsheet', function($excel) use ($data) {\n $excel->sheet('sheet1', function($sheet) use ($data)\n {\n $sheet->fromArray($data);\n });\n })->export('xlsx');\n\t\t\n }", "public function getTotalStudentAction(){\r\n if($this->request->isPost()){\r\n $students = $this->__getRegisterStudents($this->request->getPost());\r\n $this->__collectiveExcelSheet($this->request->getPost());\r\n }\r\n }", "public function students_archive()\n {\n\n $status = $this->db->get('tbl_student');\n return $status->result_object();\n \n }", "function bim_get_student_details( $ids )\n{\n $ids_string = implode( \",\", $ids );\n\n // get the user details of all the students\n $student_details = get_records_select( \"user\",\n \"id in ( $ids_string ) \" );\n\n return $student_details;\n}", "public function importFromExcel()\n {\n $this->load->library('excel');\n $objReader = PHPExcel_IOFactory::createReader('Excel2007');\n $objReader->setReadDataOnly(true);\n $objPHPExcel = $objReader->load(\"./assets/uploads/numbers.xlsx\");\n $objWorksheet = $objPHPExcel->getActiveSheet();\n static $array = array();\n static $out_array = array();\n $rows = $objPHPExcel->setActiveSheetIndex(0)->getHighestRow();\n foreach ($objWorksheet->getRowIterator() as $row) {\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(false);\n foreach ($cellIterator as $cell) {\n if ($cell->getValue() != \"\")\n array_push($out_array, $cell->getValue());\n }\n }\n return $out_array;\n }", "public function excelReportAction(){\n\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(TRUE);\n\n $chapId = Zend_Auth::getInstance()->getIdentity()->id;\n\n $userSearchKey = trim($this->_getParam('email'));\n $userFilter = $this->_getParam('type');\n $fromDate = $this->_getParam('from');\n $toDate = $this->_getParam('to');\n\n $modelUser = new Pbo_Model_User();\n $regUsers = $modelUser->getSerachedrRegUsersForReport($chapId, $userSearchKey, strtoupper($userFilter), $fromDate, $toDate);\n\n $data = \"\";\n $line = \"ID\".\"\\t\".\"E-Mail\".\"\\t\".\"Mobile\".\"\\t\".\"Type\".\"\\t\".\"Status\".\"\\t\".\"\\n\";\n\n foreach($regUsers as $regUser){\n $line.= $regUser->id.\"\\t\";\n $line.= $regUser->email.\"\\t\";\n $line.= $regUser->mobile_no.\"\\t\";\n $line.= $regUser->type.\"\\t\";\n if($regUser->status){\n $line.= 'Verified'.\"\\t\";\n }else{\n $line.= 'Not-Verified'.\"\\t\";\n }\n $line .= \"\\n\";\n }\n\n $data .= trim($line) . \"\\n\";\n $data = str_replace(\"\\r\", \"\", $data);\n\n header(\"Content-Type: application/vnd.ms-excel\");\n header(\"Content-Disposition: attachment; filename = registered-users.xls\");\n header(\"Pragma: no-cache\");\n header(\"Expires: 0\");\n print $data;\n exit;\n }", "public function index()\n\t{\n\t\treturn $this->students->findAll();\n\t}", "function LoadRow() {\n\t\tglobal $conn, $Security, $students;\n\t\t$sFilter = $students->KeyFilter();\n\n\t\t// Call Row Selecting event\n\t\t$students->Row_Selecting($sFilter);\n\n\t\t// Load SQL based on filter\n\t\t$students->CurrentFilter = $sFilter;\n\t\t$sSql = $students->SQL();\n\t\t$res = FALSE;\n\t\t$rs = ew_LoadRecordset($sSql);\n\t\tif ($rs && !$rs->EOF) {\n\t\t\t$res = TRUE;\n\t\t\t$this->LoadRowValues($rs); // Load row values\n\n\t\t\t// Call Row Selected event\n\t\t\t$students->Row_Selected($rs);\n\t\t\t$rs->Close();\n\t\t}\n\t\treturn $res;\n\t}", "public function downloadstudent()\n\t{\n\t\t$this->load->helper(\"file\");\n\t\t$this->load->helper(\"download\");\n\t\t$this->load->model(\"administrator\");\n\t\t$file_location=$this->administrator->downloadstudent();\n\t\t$data = file_get_contents($file_location); \n\t\t$filename=$this->session->userdata('college_id').\"_Student.csv\";\n\t\tforce_download($filename, $data);\n\t\t\n\t}", "public function read_single_user_data() {\n \n if(!isset($_GET['emp_id'])){\n $_GET['emp_id'] = -1;\n }\n\n $id = $_GET['emp_id'];\n\n $query = \"SELECT * FROM \".$this->table.\" where id = '\".$this->id.\"' \";\n\n return $this->conn->query($query);\n\n }", "function insertTeacherPersonalInfo($excelObject,$startingRow,$sheet_index)\n{\n $teachers_info=array();\n for($i=$startingRow;$i<=$excelObject->rowcount($sheet_index);$i++)\n {\n $temp_array=array();\n //retrieve students marks from excel file\n foreach(createColumnsArray('AE') as $alphabet)\n $temp_array[$excelObject->val($startingRow-1,$alphabet,$sheet_index)]=$excelObject->val($i,$alphabet,$sheet_index);\n\n if($excelObject->val($i,'A',$sheet_index)!==\"\")\n array_push($teachers_info,$temp_array);\n }\n //now insert each teacher into the database\n if(!empty($teachers_info))\n {\n foreach($teachers_info as $record)\n {\n //relevant mappings\n $nationality_map=array(0=>\"\",1=>\"Nepalese\",2=>\"Indian\",3=>\"Others\");\n $language_map=array(\n 1=>\"Bhojpuri\",\n 2=>\"English\",\n 3=>\"Gurung\",\n 4=>\"Maithali\",\n 5=>\"Nepali\",\n 6=>\"Newari\",\n 7=>\"Sanskrit\",\n 8=>\"Sherpa\",\n 9=>\"Tamang\",\n 10=>\"Rai\",\n 11=>\"Awadhi\",\n 12=>\"Hindi\",\n 13=>\"Kirati\",\n 14=>\"Others\"\n );\n //insert into tmis_main\n $temp_data=array();\n\n\n\n\t\t\t$temp_data['tid']=strlen($record['School ID'].$record['Teacher ID'])==13? \"0\".$record['School ID'].$record['Teacher ID']:$record['School ID'].$record['Teacher ID'];\n\t\t\t$temp_data['sch_year']=$record['Year'];\n $temp_data['sch_num']=strlen($record['School ID'])==8? \"0\".$record['School ID']:$record['School ID'];\n\t\t\t$temp_data['t_name']=$record['Teacher Name'];\n idata(\"tmis_main\",$temp_data);\n\n //now import into tmis_sec1 if position is not vacant\n if (strtolower($record['Teacher Name'])!=\"vacant\")\n {\n $temp_data=array();\n $temp_data['tid']=strlen($record['School ID'].$record['Teacher ID'])==13? \"0\".$record['School ID'].$record['Teacher ID']:$record['School ID'].$record['Teacher ID'];\n\t\t\t\t//$temp_data['tid']=$record['School ID'].$record['Teacher ID'];\n $temp_data['sch_year']=$record['Year'];\n $temp_data['sex']=$record['Sex'];\n $temp_data['t_caste']=$record['Caste/Ethnicity'];\n $temp_data['nationality']=$nationality_map[$record['Nationality']];\n //now the dob's\n if(strlen($record['Citizenship'])>7)\n {\n $citizenship_dob=explode(\"/\",convertDate($record['Citizenship']));\n $temp_data['bs_dob_day1']=$citizenship_dob[0];\n $temp_data['bs_dob_month1']=$citizenship_dob[1];\n $temp_data['bs_dob_year1']=$citizenship_dob[2];\n }\n if(strlen($record['Certificate'])>7)\n {\n $certificate_dob=explode(\"/\",convertDate($record['Certificate']));\n $temp_data['bs_dob_day2']=$certificate_dob[0];\n $temp_data['bs_dob_month2']=$certificate_dob[1];\n $temp_data['bs_dob_year2']=$certificate_dob[2];\n }\n $temp_data['citizenship_no']=$record['Citizenship No'];\n $temp_data['citizenship_dist']=$record['Issue District'];\n $temp_data['name_father']=$record['Father\\'s Name'];\n $temp_data['name_mother']=$record['Mother\\'s Name'];\n $temp_data['name_spouse']=$record['Spouse\\'s Name'];\n $temp_data['name_willper']=$record['Will Person'];\n $temp_data['mother_tongue']=$language_map[$record['Mother Tongue']];\n $temp_data['disability_status']=$record['Disability'];\n $temp_data['perm_addr_email']=$record['Email'];\n $temp_data['perm_addr_phone']=$record['Telephone/Mobile No'];\n $temp_data['curr_perm_level']=$record['Current Level'];\n $temp_data['curr_perm_rank']=$record['Rank'];\n $temp_data['curr_perm_type']=$record['Position'];\n $temp_data['head_teacher']=$record['Teacher Type'];\n $temp_data['teaching_lang']=$language_map[$record['Teaching Language']];\n $temp_data['license_no']=$record['License No'];\n $temp_data['insurance_no']=$record['Insurance No'];\n $temp_data['pf_no']=$record['PF Account No'];\n $temp_data['trk_no']=$record['Trk No'];\n $temp_data['account_no']=$record['Bank Account No'];\n $temp_data['bank_name']=$record['Bank Name'];\n\n idata(\"tmis_sec1\",$temp_data);\n }\n }\n }\n}", "public function importDataUser()\n {\n $status = $this->input->post('jenisUser');\n // upload file xls\n $target = basename($_FILES['import-data']['name']);\n move_uploaded_file($_FILES['import-data']['tmp_name'], $target);\n // beri permisi agar file xls dapat di baca\n chmod($_FILES['import-data']['name'], 0777);\n // mengambil isi file xls\n $data = new Spreadsheet_Excel_Reader($_FILES['import-data']['name'], false);\n // menghitung jumlah baris data yang ada\n $jumlah_baris = $data->rowcount($sheet_index = 0);\n for ($i = 2; $i <= $jumlah_baris; $i++) {\n // menangkap data dan memasukkan ke variabel sesuai dengan kolumnya masing-masing\n $kode_user = 0;\n if ($status == \"Mahasiswa\") {\n $result = [\n \"nim\" => $data->val($i, 1),\n \"nama\" => $data->val($i, 2),\n \"noTest\" => base64_encode(random_bytes(3)),\n \"password\" => password_hash(123, PASSWORD_DEFAULT),\n \"prodikode\" => 1\n ];\n $kode_user = 5;\n $user = [\n \"user_profile_kode\" => $kode_user,\n \"username\" => $result['nim'],\n \"password\" => password_hash(123, PASSWORD_DEFAULT),\n \"nama\" => $result['nama'],\n 'is_active' => 1,\n 'date_created' => date('Y-m-d')\n ];\n } else {\n $result = [\n \"nip\" => $data->val($i, 1),\n \"nama_dosen\" => $data->val($i, 2),\n \"jenisKelamin\" => $data->val($i, 3),\n \"statusPNS\" => $data->val($i, 4),\n \"posisi\" => $data->val($i, 5),\n \"statusAktif\" => $data->val($i, 6),\n \"jenjang\" => $data->val($i, 7),\n \"noTlpnDosen\" => $data->val($i, 8),\n \"AlamatDosen\" => $data->val($i, 9),\n \"prodi_dosen\" => $data->val($i, 10),\n \"jabatan_pimpinan\" => $data->val($i, 11)\n ];\n $kode_user = 4;\n $user = [\n \"user_profile_kode\" => $kode_user,\n \"username\" => $result['nip'],\n \"password\" => password_hash(123, PASSWORD_DEFAULT),\n \"nama\" => $result['nama_dosen'],\n 'is_active' => 1,\n 'date_created' => date('Y-m-d')\n ];\n }\n if ($kode_user == 5) {\n if ($result['nim'] != \"\" && $result['nama'] != \"\") {\n // input data ke database (table data_pegawai)\n $this->db->insert('mahasiswa', $result);\n $this->db->insert('user', $user);\n }\n } else {\n if ($result['nip'] != \"\" && $result['nama_dosen'] != \"\") {\n // input data ke database (table data_pegawai)\n $this->db->insert('dosen', $result);\n $this->db->insert('user', $user);\n }\n }\n }\n // hapus kembali file .xls yang di upload tadi\n // unlink($_FILES['import-data']['name']);\n // alihkan halaman ke index.php\n $this->session->set_flashdata('message', '<div class=\"alert alert-success\" role=\"alert\">Impor data berhasil</div>');\n redirect('admin/manajemenUser');\n }", "public function importStudentsFromFile($inputFileName)\n\t{\n\t\t// comprovem que no hi ha qualificacions dels alumnes de P3 al curs actual\n\t\t$ac = $this->dao->getActiveCourse();\n\t\t$at = $this->dao->getActiveTrimestre();\n\t\t$classrooms = [$this->dao->getById(\"Classroom\", 1), $this->dao->getById(\"Classroom\", 2)];\n\t\t$students = array();\n\t\tforeach ($classrooms as $classroom) {\n\t\t\t$enrollments = $this->dao->getByFilter(\"Enrollment\", ['course'=>$ac, 'classroom'=>$classroom]);\n\t\t\tforeach ($enrollments as $enrollment) {\n\t\t\t\t$students[] = $enrollment->getStudent();\n\t\t\t}\n\t\t}\n\t\tforeach ($students as $student) {\n\t\t\tif ($student->getNumEvaluations($ac, $at) > 0) return null;\n\t\t}\n\t\t// carreguem l'arxiu de dades\n\t\trequire_once BASEDIR . 'vendor/PHPExcel/Classes/PHPExcel.php';\n\t\t$phpExcel = new \\PHPExcel();\n\t\t$inputFileType = \\PHPExcel_IOFactory::identify($inputFileName);\n\t\t$objReader = \\PHPExcel_IOFactory::createReader($inputFileType);\n\t\t$objReader->setReadDataOnly(true);\n\t\t$objPHPExcel = $objReader->load($inputFileName);\n\t\t$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);\n\t\t$nameCol = array_search(\"Nom\", $sheetData[1]);\n\t\t$surnamesCol = array_search(\"Cognoms\", $sheetData[1]);\n\t\t$groupCol = array_search(\"Grup\", $sheetData[1]);\n\t\tif (($nameCol & $surnamesCol & $groupCol) == false) return null;\n\t\tunset($sheetData[1]);\n\t\t// eliminem els alumnes actuals de P3\n\t\tforeach ($students as $student) {\n\t\t\t$this->dao->remove($student);\n\t\t}\n\t\t$this->dao->flush();\n\t\tforeach ($sheetData as $row) {\n\t\t\t$student = new Student($row[$nameCol], $row[$surnamesCol], $this->dao->getSchool());\n\t\t\t$classroom = $this->dao->getById(\"Classroom\", ($row[$groupCol] == 'A' ? 1 : 2));\n\t\t\t$enrollment = new Enrollment($student, $classroom, $this->dao->getActiveCourse(), $this->dao->getActiveTrimestre());\n\t\t\t$this->dao->persist($student);\n\t\t\t$this->dao->persist($enrollment);\n\t\t}\n\t\t$this->dao->flush();\n\t\treturn count($sheetData);\n\t}", "function GetSprById($studentId){\r\n\t\t\t$records = null;\r\n\r\n\t\t\tif($this->conn == null){\r\n\t\t\t\t$error = \"No defined connection.\";\r\n\t\t\t\treturn null;\r\n\t\t\t} else {\r\n\r\n\t\t\t\t$conn = $this->conn;\r\n\r\n\t\t\t\t$query = \"SELECT DISTINCT CONCAT(pd.LastName, ', ', pd.FirstName, ' ', pd.MiddleName) AS `studentName`, \";\r\n\t\t\t\t$query .= \"pd.StudentNo \";\r\n\t\t\t\t$query .= \"FROM `spr-personal_data` pd \";\r\n\t\t\t\t$query .= \"WHERE pd.StudentID={$studentId} \";\r\n\r\n\t\t\t\t$result = $conn->query($query);\r\n\r\n\t\t\t\t//check for errors first\r\n\t\t\t\tif($conn->error <> \"\"){\r\n\t\t\t\t\t$this->error = $conn->error;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$records = array();\r\n\t\t\t\t\tif($result->num_rows > 0){\r\n\t\t\t\t\t\twhile($row = $result->fetch_assoc()){\r\n\r\n\t\t\t\t\t\t\t$records[] = array();\r\n\t\t\t\t\t\t\t$records[count($records) - 1]['studentName'] = $row['studentName'];\r\n\t\t\t\t\t\t\t$records[count($records) - 1]['StudentNo'] = $row['StudentNo'];\r\n\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\r\n\t\t\treturn $records;\r\n\t\t}", "public function get_student_info()\r\n\t\t{\r\n\t\t\t$student_id = $this->input->post('s_id');\r\n\t\t\t$result = $this->admin_model->find_student_info($student_id);\r\n\t\t\t\r\n\t\t\techo $result->first_name . \"-\" . $result->last_name . \"-\" . $result->grade . \"-\" . $result->classroom_id;\r\n\t\t}", "function get_student($student_id){\r\n\tglobal $link;\r\n\t$staffs = [];\r\n\t$sql = \"SELECT * FROM students WHERE student_id = '$student_id'\";\r\n\t$query = mysqli_query($link, $sql);\r\n\tif ($query) {\r\n\t\tif (mysqli_num_rows($query) > 0) {\r\n\t\t\twhile($row = mysqli_fetch_assoc($query)){\r\n\t\t\t\t$staffs[] = $row;\r\n\t\t\t}\r\n\t\t\treturn $staffs;\r\n\t\t}\r\n\t} return false;\r\n}", "public function fetchIndex()\n {\n $file = new \\RK_Csv_File($this->getCsvFile(), 0);\n $file->setMappingMode(\\RK_Csv_File::INDEX);\n $row = $file->fetch();\n $this->assertEquals('John', $row[1]);\n }", "function bim_get_markers_students( $bim, $marker )\n{\n $student_details = array();\n // get list of students\n// $students = get_records_select( \"bim_markers_students\",\n // \"course=$course and marker=$marker\" );\n\n // get the groups belonging to the marker\n $groups = get_records_select( \"bim_group_allocation\",\n \"bim=$bim->id and userid=$marker\" );\n\n // if no groups allocated, no students\n if ( empty( $groups ) ) return $student_details;\n \n $group_ids = array();\n foreach ( $groups as $group )\n {\n $group_ids[] = $group->groupid;\n }\n $group_ids_string = implode( \",\", $group_ids );\n \n // now get the list of students from group_members\n $students = get_records_select( \"groups_members\",\n \"groupid in ( $group_ids_string )\" );\n\n if ( empty( $students )) return $student_details;\n\n $student_ids = array();\n foreach ( $students as $student )\n {\n $student_ids[] = $student->userid;\n }\n $student_ids_string = implode( \",\", $student_ids );\n // get the user details of all the students\n $student_details = get_records_select( \"user\", \n \"id in ( $student_ids_string ) \" );\n\n return $student_details;\n}", "function getStudent($email) {\n\n require(\"db_connection.php\");\n\n $sql = \"SELECT * FROM student WHERE email = '{$email}' AND enroll_status = 1\";\n\n $result = $conn->query($sql);\n $conn->close();\n return $result;\n}", "function insertSubjects($excelObject,$startingRow,$sheet_index,$school_info)\n{\n $class_subjects=array();\n\n\tif(checkIsNewFile($excelObject)){\n\t\t$letters = createColumnsArray(\"HL\");\n\t}else{\n\t\t$letters = createColumnsArray(\"AM\");\n\t\t}\n\t//var_dump($letters);die;\n foreach($letters as $key=>$alphabet)\n {\n //start from \"A\" if file is new else start with D\n\n if(checkIsNewFile($excelObject)){\n\t\t\tif($key%22==0)\n\t\t\t{\n\t\t\t\t$subj_sn=1;\n\t\t\t\tfor($i=$startingRow;$i<=$excelObject->rowcount($sheet_index);$i++)\n\t\t\t\t{\n\t\t\t\t\t//retrieve rows as associative array\n\t\t\t\t\tif($excelObject->val($i,$letters[$key],$sheet_index)!==\"\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp_array=array(\n\t\t\t\t\t\t\t\t\t\t'sch_num'=>$school_info['school_number'],\n\t\t\t\t\t\t\t\t\t\t'sch_year'=>$school_info['year'],\n\t\t\t\t\t\t\t\t\t\t'class'=>($key/22)+1,\n\t\t\t\t\t\t\t\t\t\t'subject_no'=>$subj_sn,\n\t\t\t\t\t\t\t\t\t\t'subject'=>$excelObject->val($i,$letters[$key],$sheet_index),\n\t\t\t\t\t\t\t\t\t\t'full_marksT'=>$excelObject->val($i,$letters[$key+1],$sheet_index),\n\t\t\t\t\t\t\t\t\t\t'pass_marksT'=>$excelObject->val($i,$letters[$key+2],$sheet_index),\n\t\t\t\t\t\t\t\t\t\t'full_marksP'=>$excelObject->val($i,$letters[$key+3],$sheet_index),\n\t\t\t\t\t\t\t\t\t\t'pass_marksP'=>$excelObject->val($i,$letters[$key+4],$sheet_index));\n\t\t\t\t\t\tidata(\"id_students_subject\",$temp_array);\n\t\t\t\t\t\t$subj_sn++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tif($key%3==0)\n\t\t\t\t{\n\t\t\t\t\t$subj_sn=1;\n\t\t\t\t\tfor($i=$startingRow;$i<=$excelObject->rowcount($sheet_index);$i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//retrieve rows as associative array\n\t\t\t\t\t\tif($excelObject->val($i,$letters[$key],$sheet_index)!==\"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_array=array(\n\t\t\t\t\t\t\t\t\t\t\t'sch_num'=>$school_info['school_number'],\n\t\t\t\t\t\t\t\t\t\t\t'sch_year'=>$school_info['year'],\n\t\t\t\t\t\t\t\t\t\t\t'class'=>($key/3),\n\t\t\t\t\t\t\t\t\t\t\t'subject_no'=>$subj_sn,\n\t\t\t\t\t\t\t\t\t\t\t'subject'=>$excelObject->val($i,$letters[$key],$sheet_index),\n\t\t\t\t\t\t\t\t\t\t\t'full_marksT'=>$excelObject->val($i,$letters[$key+1],$sheet_index),\n\t\t\t\t\t\t\t\t\t\t\t'pass_marksT'=>$excelObject->val($i,$letters[$key+2],$sheet_index));\n\t\t\t\t\t\t\tidata(\"id_students_subject\",$temp_array);\n\t\t\t\t\t\t\t//var_dump($temp_array);die;\n\t\t\t\t\t\t\t$subj_sn++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }\n}", "public function indexAction()\n {\n $filename = \"a.xls\";\n $sheetname = \"Simple\";\n\n // Create new Spreadsheet object\n $spreadsheet = new Spreadsheet();\n\n // Set document properties\n $spreadsheet->getProperties()->setCreator('Andi Praja')\n ->setLastModifiedBy('Andi Praja')\n ->setTitle('Office 2007 XLSX Test Document')\n ->setSubject('Office 2007 XLSX Test Document')\n ->setDescription('Test document for Office 2007 XLSX, generated using PHP classes.')\n ->setKeywords('office 2007 openxml php')\n ->setCategory('Test result file');\n\n\n\n\n\n\n // Set columns width\n $spreadsheet->getActiveSheet()->getColumnDimension('A')->setWidth(6);\n $spreadsheet->getActiveSheet()->getColumnDimension('B')->setWidth(28);\n $spreadsheet->getActiveSheet()->getColumnDimension('C')->setWidth(12);\n $spreadsheet->getActiveSheet()->getColumnDimension('D')->setWidth(14);\n $spreadsheet->getActiveSheet()->getColumnDimension('E')->setWidth(12);\n $spreadsheet->getActiveSheet()->getColumnDimension('F')->setWidth(12);\n $spreadsheet->getActiveSheet()->getColumnDimension('G')->setWidth(15);\n\n // Header\n $spreadsheet->setActiveSheetIndex(0)\n ->mergeCells('A1:G1')\n ->setCellValue('A1', 'DATA FORMASI PEMENUHAN AO KANWIL BRI MALANG BERDASARKAN SURAT NOKEP. 107 DIR/CDS/02/2017')\n ->mergeCells('A2:A5')\n ->setCellValue('A2', 'NO')\n ->mergeCells('B2:B5')\n ->setCellValue('B2', 'KANCA')\n ->mergeCells('C2:G2')\n ->setCellValue('C2', 'AO RITEL KOMERSIAL')\n ->mergeCells('C3:F3')\n ->setCellValue('C3', 'POSISI 31-5-2018')\n ->mergeCells('C4:C5')\n ->setCellValue('C4', 'FORMASI')\n ->mergeCells('D4:F4')\n ->setCellValue('D4', 'PEMENUHAN')\n ->setCellValue('D5', 'PT')\n ->setCellValue('E5', 'KONTRAK')\n ->setCellValue('F5', 'JUMLAH')\n ->mergeCells('G3:G5')\n ->setCellValue('G3', 'KURANG/LEBIH');\n\n $query = View2::find();\n $i = 1;\n $j = 1;\n foreach ($query as $q) {\n $q_status = $this->modelsManager->executeQuery(\"\n SELECT ps.status status, ps.id status_id, count(*) jumlah\n from \\Vokuro\\Models\\Pegawai p\n left join \\Vokuro\\Models\\PegawaiStatus ps on ps.id=p.status\n left join \\Vokuro\\Models\\UnitKerja uk on uk.kode_uker=p.kode_uker\n where uk.id = :uker_id:\n group by status\",\n [\"uker_id\"=>$q->uker_id]);\n $kontrak = 0;\n $tetap = 0;\n foreach ($q_status as $qs) {\n // kontrak\n if ($qs->status_id == 3 OR $qs->status == 4) {\n $kontrak += $qs->jumlah;\n }\n // tetap\n if ($qs->status_id == 6 OR $qs->status == 7) {\n $tetap += $qs->jumlah;\n }\n }\n $jumlah = $tetap+$kontrak;\n $kurang_lebih = $jumlah - $q->formasi_ao;\n\n // ROW KANCA\n if ($i > 1 && $q->uker == $q->kanca) {\n $spreadsheet->setActiveSheetIndex(0)\n ->mergeCells('A'.($i+5).':B'.($i+5))\n ->setCellValue('A'.($i+5), \"TOTAL\")\n ->setCellValue('C'.($i+5), $r_total_formasi)\n ->setCellValue('D'.($i+5), $r_total_tetap) // PT\n ->setCellValue('E'.($i+5), $r_total_kontrak) // KONTRAK\n ->setCellValue('F'.($i+5), $r_total_jumlah) // JUMLAH\n ->setCellValue('G'.($i+5), $r_total_kurang_lebih) // -/+\n ;\n $i+=2;\n $r_total_formasi = 0;\n $r_total_tetap = 0;\n $r_total_kontrak = 0;\n $r_total_jumlah = 0;\n $r_total_kurang_lebih = 0;\n\n\n // Styling\n $style = array(\n 'alignment' => array(\n 'horizontal' => Alignment::HORIZONTAL_CENTER,\n 'vertical' => Alignment::VERTICAL_CENTER,\n 'wrapText' => TRUE\n )\n );\n $spreadsheet->getDefaultStyle()->applyFromArray($style);\n $spreadsheet->getActiveSheet()->getStyle('A'.($i+5).':G'.($i+5))->getFont()->setSize('10')->setName('Arial');\n $spreadsheet->getActiveSheet()->getStyle('A'.($i+5).':G'.($i+5))->getFill()\n ->setFillType(\\PhpOffice\\PhpSpreadsheet\\Style\\Fill::FILL_SOLID)\n ->getStartColor()->setARGB('FFFFFF00');\n }\n\n $r_total_formasi += $q->formasi_ao;\n $r_total_tetap += $tetap;\n $r_total_kontrak += $kontrak;\n $r_total_jumlah += $jumlah;\n $r_total_kurang_lebih += $kurang_lebih;\n\n if ($q->uker == $q->kanca) {\n // Styling\n $style = array(\n 'alignment' => array(\n 'horizontal' => Alignment::HORIZONTAL_CENTER,\n 'vertical' => Alignment::VERTICAL_CENTER,\n 'wrapText' => TRUE\n )\n );\n $spreadsheet->getDefaultStyle()->applyFromArray($style);\n $spreadsheet->getActiveSheet()->getStyle('A'.($i+5).':G'.($i+5))->getFont()->setSize('10')->setName('Arial');\n $spreadsheet->getActiveSheet()->getStyle('A'.($i+5).':G'.($i+5))->getFill()\n ->setFillType(\\PhpOffice\\PhpSpreadsheet\\Style\\Fill::FILL_SOLID)\n ->getStartColor()->setARGB('FFFFFF00');\n $spreadsheet->setActiveSheetIndex(0)->setCellValue('A'.($i+5), $j);\n $j++;\n }\n\n $spreadsheet->setActiveSheetIndex(0)\n // ->setCellValue('A'.($i+5), $i)\n ->setCellValue('B'.($i+5), $q->uker)\n ->setCellValue('C'.($i+5), $q->formasi_ao)\n ->setCellValue('D'.($i+5), $tetap) // PT\n ->setCellValue('E'.($i+5), $kontrak) // KONTRAK\n ->setCellValue('F'.($i+5), $jumlah) // JUMLAH\n ->setCellValue('G'.($i+5), $jumlah - $q->formasi_ao) // -/+\n\n // ->setCellValue('I'.($i+5), $r_total_formasi) // cobak2\n ;\n\n $i++;\n }\n\n // $spreadsheet->setActiveSheetIndex(0)\n // ->mergeCells('A'.($i+6).':B'.($i+6))\n // ->setCellValue('A'.($i+6), \"TOTAL JUMLAH AO KCP\")\n // ->setCellValue('B'.($i+6), \"TOTAL JUMLAH AO KCP\")\n // ;\n\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('B'.($i+5), \"KETERANGAN :\")\n ->setCellValue('B'.($i+6), \"- PIC NPL TERMASUK DI PEMENUHAN RITEL\")\n ->setCellValue('B'.($i+7), \"- PEMENUHAN AO NPL TIDAK TERMASUK PIC NPL HANYA AO NPL & AO PPS\");\n\n $i+=2;\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A'.($i+5), $i)\n ->setCellValue('B'.($i+5), $q->uker)\n ->setCellValue('C'.($i+5), $q->formasi_ao)\n ->setCellValue('D'.($i+5), $tetap) // PT\n ->setCellValue('E'.($i+5), $kontrak) // KONTRAK\n ->setCellValue('F'.($i+5), $jumlah) // JUMLAH\n ->setCellValue('G'.($i+5), $jumlah - $q->formasi_ao) // -/+\n ;\n\n // Styling\n $style = array(\n 'alignment' => array(\n 'horizontal' => Alignment::HORIZONTAL_CENTER,\n 'vertical' => Alignment::VERTICAL_CENTER,\n 'wrapText' => TRUE\n )\n );\n $spreadsheet->getDefaultStyle()->applyFromArray($style);\n // Font\n $spreadsheet->getDefaultStyle()->getFont()->setSize('10')->setName('Arial');\n $spreadsheet->getActiveSheet()->getStyle('A1:G5')->getFont()->setSize('11')->setName('Calibri');\n $spreadsheet->getActiveSheet()->getRowDimension('1')->setRowHeight(25);\n // cell bakground color\n $spreadsheet->getActiveSheet()->getStyle('A2:G5')->getFill()\n ->setFillType(\\PhpOffice\\PhpSpreadsheet\\Style\\Fill::FILL_SOLID)\n ->getStartColor()->setARGB('FFAAAAAA');\n $spreadsheet->getActiveSheet()->getStyle('C2')->getFill()\n ->setFillType(\\PhpOffice\\PhpSpreadsheet\\Style\\Fill::FILL_SOLID)\n ->getStartColor()->setARGB('FF55CC55');\n\n\n\n\n\n\n // Rename worksheet\n $spreadsheet->getActiveSheet()->setTitle($sheetname);\n\n // Set active sheet index to the first sheet, so Excel opens this as the first sheet\n $spreadsheet->setActiveSheetIndex(0);\n\n // Redirect output to a client’s web browser (Xls)\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"'.$filename.'\"');\n header('Cache-Control: max-age=0');\n // If you're serving to IE 9, then the following may be needed\n header('Cache-Control: max-age=1');\n\n // If you're serving to IE over SSL, then the following may be needed\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n header('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header('Pragma: public'); // HTTP/1.0\n\n $writer = IOFactory::createWriter($spreadsheet, 'Xls');\n $writer->save('php://output');\n exit;\n\n }", "function LoadRow() {\n\t\tglobal $conn, $Security, $view_sponsored_student_school;\n\t\t$sFilter = $view_sponsored_student_school->KeyFilter();\n\n\t\t// Call Row Selecting event\n\t\t$view_sponsored_student_school->Row_Selecting($sFilter);\n\n\t\t// Load SQL based on filter\n\t\t$view_sponsored_student_school->CurrentFilter = $sFilter;\n\t\t$sSql = $view_sponsored_student_school->SQL();\n\t\t$res = FALSE;\n\t\t$rs = ew_LoadRecordset($sSql);\n\t\tif ($rs && !$rs->EOF) {\n\t\t\t$res = TRUE;\n\t\t\t$this->LoadRowValues($rs); // Load row values\n\n\t\t\t// Call Row Selected event\n\t\t\t$view_sponsored_student_school->Row_Selected($rs);\n\t\t\t$rs->Close();\n\t\t}\n\t\treturn $res;\n\t}", "public function studentInformation();", "function get_row()\n\t{\n\t\t$person_id = $this->input->post('row_id');\n\t\t$data_row=get_person_data_row($this->Person->get_info($person_id),$this);\n\t\techo $data_row;\n\t}", "function ExportData() {\n\t\tglobal $view_sponsored_student_school;\n\t\t$utf8 = FALSE;\n\t\t$bSelectLimit = EW_SELECT_LIMIT;\n\n\t\t// Load recordset\n\t\tif ($bSelectLimit) {\n\t\t\t$this->lTotalRecs = $view_sponsored_student_school->SelectRecordCount();\n\t\t} else {\n\t\t\tif ($rs = $this->LoadRecordset())\n\t\t\t\t$this->lTotalRecs = $rs->RecordCount();\n\t\t}\n\t\t$this->lStartRec = 1;\n\n\t\t// Export all\n\t\tif ($view_sponsored_student_school->ExportAll) {\n\t\t\t$this->lDisplayRecs = $this->lTotalRecs;\n\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t} else { // Export one page only\n\t\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t\t// Set the last record to display\n\t\t\tif ($this->lDisplayRecs < 0) {\n\t\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t\t} else {\n\t\t\t\t$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;\n\t\t\t}\n\t\t}\n\t\tif ($bSelectLimit)\n\t\t\t$rs = $this->LoadRecordset($this->lStartRec-1, $this->lDisplayRecs);\n\t\tif (!$rs) {\n\t\t\theader(\"Content-Type:\"); // Remove header\n\t\t\theader(\"Content-Disposition:\");\n\t\t\t$this->ShowMessage();\n\t\t\treturn;\n\t\t}\n\t\tif ($view_sponsored_student_school->Export == \"xml\") {\n\t\t\t$XmlDoc = new cXMLDocument(EW_XML_ENCODING);\n\t\t\t$XmlDoc->AddRoot();\n\t\t} else {\n\t\t\t$ExportDoc = new cExportDocument($view_sponsored_student_school, \"h\");\n\t\t\t$ExportDoc->ExportHeader();\n\t\t\tif ($ExportDoc->Horizontal) { // Horizontal format, write header\n\t\t\t\t$ExportDoc->BeginExportRow();\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->sponsored_student_id);\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->sponsored_student_sponsored_student_id);\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->school_attendance_id);\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->student_firstname);\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->student_middlename);\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->start_date);\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->end_date);\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->schools_school_id);\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->entry_level);\n\t\t\t\t$ExportDoc->ExportCaption($view_sponsored_student_school->entry_class);\n\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t}\n\t\t}\n\n\t\t// Move to first record\n\t\t$this->lRecCnt = $this->lStartRec - 1;\n\t\tif (!$rs->EOF) {\n\t\t\t$rs->MoveFirst();\n\t\t\tif (!$bSelectLimit && $this->lStartRec > 1)\n\t\t\t\t$rs->Move($this->lStartRec - 1);\n\t\t}\n\t\twhile (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {\n\t\t\t$this->lRecCnt++;\n\t\t\tif (intval($this->lRecCnt) >= intval($this->lStartRec)) {\n\t\t\t\t$this->LoadRowValues($rs);\n\n\t\t\t\t// Render row\n\t\t\t\t$view_sponsored_student_school->CssClass = \"\";\n\t\t\t\t$view_sponsored_student_school->CssStyle = \"\";\n\t\t\t\t$view_sponsored_student_school->RowType = EW_ROWTYPE_VIEW; // Render view\n\t\t\t\t$this->RenderRow();\n\t\t\t\tif ($view_sponsored_student_school->Export == \"xml\") {\n\t\t\t\t\t$XmlDoc->AddRow();\n\t\t\t\t\t$XmlDoc->AddField('sponsored_student_id', $view_sponsored_student_school->sponsored_student_id->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('sponsored_student_sponsored_student_id', $view_sponsored_student_school->sponsored_student_sponsored_student_id->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('school_attendance_id', $view_sponsored_student_school->school_attendance_id->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('student_firstname', $view_sponsored_student_school->student_firstname->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('student_middlename', $view_sponsored_student_school->student_middlename->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('start_date', $view_sponsored_student_school->start_date->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('end_date', $view_sponsored_student_school->end_date->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('schools_school_id', $view_sponsored_student_school->schools_school_id->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('entry_level', $view_sponsored_student_school->entry_level->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('entry_class', $view_sponsored_student_school->entry_class->ExportValue($view_sponsored_student_school->Export, $view_sponsored_student_school->ExportOriginalValue));\n\t\t\t\t} else {\n\t\t\t\t\t$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->sponsored_student_id);\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->sponsored_student_sponsored_student_id);\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->school_attendance_id);\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->student_firstname);\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->student_middlename);\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->start_date);\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->end_date);\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->schools_school_id);\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->entry_level);\n\t\t\t\t\t$ExportDoc->ExportField($view_sponsored_student_school->entry_class);\n\t\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\tif ($view_sponsored_student_school->Export <> \"xml\")\n\t\t\t$ExportDoc->ExportFooter();\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\n\t\t// Clean output buffer\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\n\t\t\tob_end_clean();\n\n\t\t// Write BOM if utf-8\n\t\tif ($utf8 && !in_array($view_sponsored_student_school->Export, array(\"email\", \"xml\")))\n\t\t\techo \"\\xEF\\xBB\\xBF\";\n\n\t\t// Write debug message if enabled\n\t\tif (EW_DEBUG_ENABLED)\n\t\t\techo ew_DebugMsg();\n\n\t\t// Output data\n\t\tif ($view_sponsored_student_school->Export == \"xml\") {\n\t\t\theader(\"Content-Type: text/xml\");\n\t\t\techo $XmlDoc->XML();\n\t\t} elseif ($view_sponsored_student_school->Export == \"email\") {\n\t\t\t$this->ExportEmail($ExportDoc->Text);\n\t\t\t$this->Page_Terminate($view_sponsored_student_school->ExportReturnUrl());\n\t\t} else {\n\t\t\techo $ExportDoc->Text;\n\t\t}\n\t}", "public function laporanExcelUser()\n {\n $date = date(now());\n return (new UserReport)->download('user-' . $date . '.xlsx');\n }", "function recommends_wrec_infosheet($s_email,$name){\n global $user;\n \n // Search for the student record\n $search = $s_email;\n \n $entry = array();\n\n$entries = recommends_st_entry_load_email($entry,$search);\n$rows = array();\nforeach ($entries as $entry) {\n// Sanitize the data before handing it off to the theme layer.\n\t$rows[] = array_map('check_plain',(array) $entry);\n}\n \n $msg =\"Student: \";\n $msg .= $rows[0]['prefix'] . \" \";\n $msg .= $rows[0]['lastname'] . \", \";\n $msg .= $rows[0]['firstname'] . \" \";\n $msg .= $rows[0]['initial'] . \" \";\n $msg .= $rows[0]['suffix'] . \"<br/>\";\n $msg .=\"Email: \";\n $msg .= $rows[0]['s_email'] . \"<br/>\";\n $msg .=\"Date Requested: \";\n $msg .= $rows[0]['s_req_date'] . \"<br/>\";\n \n $msg .=\"Master Document: \";\n $msg .= $rows[0]['s_master_doc']; \n \n $msg .= \"<br/>Statement of intent/POV/Prof comments: \";\n \tif ($rows[0]['s_comments'] == \"\") {\n \t\t$msg .= \" None\" . \"\\n\";\n \t} else {\n \t\t$msg .= \"<br/>\" . $rows[0]['s_comments'] . \"\\n\";\n \t}\n \n $msg .= \"<br/>Professor comments: \";\n \tif ($rows[0]['s_prof_comments'] == \"\") {\n \t\t$msg .= \" None\" . \"\\n\";\n \t} else {\n \t\t$msg .= \"<br/>\" . $rows[0]['s_prof_comments'] . \"\\n\\n\";\n \t}\n \n\n $search = $rows[0]['s_email'];\n $msg .=\"Earliest Required by School: \";\n \n // Determine the earliest date\n\n$earliest = \" \";\nif ($entries = recommends_rc_entry_load_jst($entry,$search)) {\n $rows = array();\n foreach ($entries as $entry) {\n // Sanitize the data before handing it off to the theme layer.\n $rows[] = array_map('check_plain', (array) $entry);\n }\n $ldate = \"99999999\";\n $edate = \" \";\n \n////\n for ($i = 0; $i <= sizeof($rows)-1; $i++) {\n \t\t$emonth = $rows[$i]['r_date_due_month'];\n \t\t$m = str_pad($emonth,2,\"0\",STR_PAD_LEFT);\n \t\t$eday = $rows[$i]['r_date_due_day'];\n \t\t$d = str_pad($eday,2,\"0\",STR_PAD_LEFT);\n \t\t$eyear = $rows[$i]['r_date_due_year'];\n \t\t$edate = $eyear . $m . $d;\n \t\tif ($edate < $ldate) {\n \t\t\t$earliest = $edate;\n \t\t\t$ldate = $edate;\n \t\t} else {\n \t\t\t$earliest = $ldate;\n \t\t}\t\t \n \t }\n \t \n \t $msg .= substr($earliest,4,2) . \"/\" . substr($earliest,6,2) . \"/\" . substr($earliest,0,4) . \"<br/>\";\t\n } else {\n \t\t$msg .= \"Date not found<br/>\";\n \t}\n\n/////// for course info\n$msg .=\"<div align=center><h3>Course Info</h3> </div>\";\n\nrecommends_cs_entry_load_jst($entry,$search);\n\n$msg .=\"<br/>\";\n\n\n$output = '';\n\n // Get all entries in the recommends_cs table.\n if ($entries = recommends_cs_entry_load_jst($entry,$search)) {\n $rows = array();\n foreach ($entries as $entry) {\n // Sanitize the data before handing it off to the theme layer.\n $rows[] = array_map('check_plain', (array) $entry);\n }\n \n for ($i = 0; $i <= sizeof($rows)-1; $i++) {\n \t$msg .= $rows[$i]['c_course'] . \" \" . $rows[$i]['c_semester'] . \n \t\" \" . $rows[$i]['c_year'] . \" \" . $rows[$i]['c_grade'] . \"<br/><br/>Comments: \";\n \tif ($rows[$i]['c_comments'] == \"\") {\n \t\t$msg .= \" None\" . \"\\n\";\n \t} else {\n \t\t$msg .= \"<br/>\" . $rows[$i]['c_comments'] . \"\\n\";\n \t}\n \t$msg .= '<br/><br/>';\n }\t\n }\n else {\n // drupal_set_message(t('No entries.'));\n }\n \n ////////// for schoole info \n \n $msg .=\"<div align=center><h3>School Info</h3> </div>\"; \n \n$output = '';\n\n // Get all entries in the recommends_cs table.\n if ($entries = recommends_rc_entry_load_jst($entry,$search)) {\n $rows = array();\n foreach ($entries as $entry) {\n // Sanitize the data before handing it off to the theme layer.\n $rows[] = array_map('check_plain', (array) $entry);\n }\n for ($i = 0; $i <= sizeof($rows)-1; $i++) {\n \t\n \t$msg .=\"School: \";\n \t\t$msg .= $rows[$i]['r_school'] . \"<br/>\";\n \t\t$msg .=\"Program/Position: \";\n \t\t$msg .= $rows[$i]['r_program'] . \"<br/>\";\n \t\t\n \t\t$msg .=\"Contact Email Address: \";\n \t\t$msg .= $rows[$i]['r_school_contact_email'] . \"<br/>\";\n \t\t$msg .=\"Contact Postal Address: <br/>\";\n \t\t$msg .= $rows[$i]['r_school_contact_postal'];\n \t\t$msg .=\"Status: \";\n \t\t$msg .= $rows[$i]['r_status'] . \"<br/>\";\n \t\t$msg .=\"Required by Date: \";\n \t\t$msg .= $rows[$i]['r_date_due_month'] . \"/\";\n \t\t$msg .= $rows[$i]['r_date_due_day'] . \"/\";\n \t\t$msg .= $rows[$i]['r_date_due_year'] . \"<br/>\";\n \t\t\n \t\t$btext = $btext = $rows[$i]['lastname'] . $rows[$i]['firstname'] . $rows[$i]['initial'] . \"\";\n \t\t$student_title = $btext . '-' . $rows[$i]['r_school'] . '-' .$rows[$i]['r_date_due_year'];\n \t\t$nid = find_recommendlate($student_title);\n \t\t//save for add, if needed\n \t\tvariable_set('recommendlate_wrec_student_school',$rows[$i]['r_school']);\n \t\t\n \tif ($nid <> 'none') {\n \t $msg .=\"Recommendlate: <a href=?q=node/\" . \n \t\t $nid . \">node/\" . $nid . \"</a><br/>\";\n \t\t} else {\n \t\t$msg .= '<a href=?q=recommends_wrec/arguments/' . rawurlencode ( $rows[$i]['r_school']) . '/' . $rows[$i]['r_email'] . '/>Create Recommendlate</a><br/><br/>'; \n \t\t}\n \t\t//set session variables for recommendlate, if clicked\n \t\tvariable_set('recommendlate_student_school', $rows[$i]['r_school']);\n \t\tvariable_set('recommendlate_status', $rows[$i]['r_status']);\n \t\t\n \t$msg .= \"Comments: \";\n \tif ($rows[$i]['r_comments'] == \"\") {\n \t\t$msg .= \" None\" . \"\\n\";\n \t} else {\n \t\t$msg .= \"<br/>\" . $rows[$i]['r_comments'] . \"\\n\";\n \t}\n \t$msg .= \"<br/><br/>\";\n }\n \t\n }\n else {\n drupal_set_message(t('No entries.'));\n }\n\n$msg .= '<br/><br/><a href=\"?q=recommendations/list/wrec\">Back to Student List</a><br/>';\nreturn $msg;\n}", "function getRows($filename){\n\tglobal $dbpath;\n\t$filename=$dbpath.$filename;\n\tif (file_exists($filename)) {\n\t\t$datafile=fopen($filename,\"r\");\n\t\t$rowsArray=file($filename);\n\t\tfclose($datafile);\n\t\treturn $rowsArray;\n\t}\n}", "function getStudentInformation($uID, $courseTitle, $courseYear)\n {\n //course title, year and level not defined here. SO i would just select \n //from the course that the staff member is on instead.\n require 'connect.php';\n $courseTitle = $_SESSION['courseTitle'];\n $SQL_stmt = \"SELECT DISTINCT users.userID AS 'Student_ID', users.userFirstName AS 'first', \n users.userLastName AS 'last',\n student.availableBalance AS 'Available_Balance' FROM users INNER JOIN student ON users.userID = student.studentID\n INNER JOIN departmentsStaffCourseStudents ON users.userID = departmentsStaffCourseStudents.bscsStudentID\n AND departmentsStaffCourseStudents.bscsStaffID = '\". $uID .\"' \n AND student.studentID = departmentsStaffCourseStudents.bscsStudentID\n INNER JOIN course ON departmentsStaffCourseStudents.bscsCourseID = course.courseID \n AND course.courseTitle = '\". $courseTitle .\"'\"; \n \n $result = 0;\n \n //$studentName = 0;\n \n $result = $DBconnection->query($SQL_stmt); \n \n if ($result->fetch()==FALSE){\n echo '<tr style align = \"middle\">\n <th scope=\"row\" colspan =\"3\">No Info</th>\n <td><input type=\"checkbox\"></td>\n </tr>';\n }\n else\n {\n $result = $DBconnection->query($SQL_stmt);\n $count = 1;\n while ($row = $result->fetch())\n {\n echo '<tr>\n <th scope=\"row\">'.$row['Student_ID'].'</th>\n <td>'.$row['first'].' '.$row['last'].'</td>\n <td>'.$row['Available_Balance'].'</td>\n <td><input type=\"checkbox\" class=\"checkbox\" name=\"checkbox'.$count.'\" value=\"'.$row['Student_ID'].'\" ></td>\n </tr>';\n $count++;\n }\n }\n }", "function get_student_finances_search()\n {\n access_control($this);\n\n # Get the passed details into the url data array if any\n $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));\n\n # Pick all assigned data\n $data = assign_to_data($urldata);\n\n #FETCH SEARCH DETAILS FROM FRONT END\n $result = explode('@@',$data['i']);\n $search = $result[1];\n $start_date = (strlen($result[2]) > 0)?$result[2]:0;\n $end_date = (strlen($result[3]) > 0)?$result[3]:0;\n $dat_string = '';\n #DATE SEARCH MANIPULATION STRING\n if(($start_date > 0) && ($end_date > 0) )\n {\n\n $dat_string='AND( dateadded >= \"'.$start_date.'\" AND dateadded <= \"'.$end_date.'\" )';\n\n }\n else if(($start_date > 0))\n {\n $dat_string= 'AND(dateadded >= \"'.$start_date.'\")';\n\n }\n else if ($end_date > 0)\n {\n $dat_string= 'AND(dateadded >= \"'.$end_date.'\")';\n\n }\n else{\n $dat_string = '';\n\n }\n\n\n #Get the student's details\n $studentid = decryptValue($result[0]);\n $data['studentdetails'] = $this->Query_reader->get_row_as_array('get_students_list', array('isactive' => 'Y', 'limittext' =>'','searchstring'=> ' AND id = '.$studentid ));\n #Check if the student belongs to the current user's school\n\n if($data['studentdetails']['school'] != $this->schoolinfo['id']){\n $data['studentdetails'] = array ();\n $studentid = '';\n $data['msg'] = 'ERROR : The student data could not be found.';\n }\n #Get the paginated list of the students finances with Search\n $data = paginate_list($this, $data, 'search_student_accounts', array('isactive'=>'Y', 'limittext'=>'', 'searchstring'=>' AND (amount like \"%'.$search.'%\" or type like \"%'.$search.'%\" or payer like \"%'.$search.'%\") '.$dat_string.' AND student = '.$studentid), 50);\n\n $data = add_msg_if_any($this, $data);\n\n #LOAD VIEW\n $this->load->view('students/student_finances_view_search', $data);\n\n }", "function LoadRow() {\n\t\tglobal $conn, $Security, $sponsored_student;\n\t\t$sFilter = $sponsored_student->KeyFilter();\n\n\t\t// Call Row Selecting event\n\t\t$sponsored_student->Row_Selecting($sFilter);\n\n\t\t// Load SQL based on filter\n\t\t$sponsored_student->CurrentFilter = $sFilter;\n\t\t$sSql = $sponsored_student->SQL();\n\t\t$res = FALSE;\n\t\t$rs = ew_LoadRecordset($sSql);\n\t\tif ($rs && !$rs->EOF) {\n\t\t\t$res = TRUE;\n\t\t\t$this->LoadRowValues($rs); // Load row values\n\n\t\t\t// Call Row Selected event\n\t\t\t$sponsored_student->Row_Selected($rs);\n\t\t\t$rs->Close();\n\t\t}\n\t\treturn $res;\n\t}", "function getBookDetails($bookId){\r\n if ($bookId > 2000 && $bookId < 3000) {\r\n $path = \"data/scenery.txt\";\r\n $file = fopen($path, \"r\");\r\n $data = array();\r\n $i = 0;\r\n while(! feof($file))\r\n {\r\n $data[$i]= fgets($file);\r\n $i++;\r\n }\r\n fclose($file);\r\n $data=array_filter($data);\r\n foreach($data as $k=>$v){\r\n $str = explode(\"|\",$v);\r\n if ($str[0] == $bookId){\r\n $row[0] = $str[1];\r\n $row[1] = $str[2];\r\n break;\r\n }\r\n }\r\n } else if($bookId > 1000 && $bookId < 2000) {\r\n $path_h = \"data/hotel.txt\";\r\n $file_h = fopen($path_h, \"r\");\r\n $data_h = array();\r\n $i_h = 0;\r\n while(! feof($file_h))\r\n {\r\n $data_h[$i_h]= fgets($file_h);\r\n $i_h++;\r\n }\r\n fclose($file_h);\r\n $data_h=array_filter($data_h);\r\n foreach($data_h as $k=>$v){\r\n $str_h = explode(\"|\",$v);\r\n if ($str_h[0] == $bookId){\r\n $row[0] = $str_h[1];\r\n $row[1] = $str_h[4];\r\n }\r\n }\r\n }else if($bookId > 3000 && $bookId < 4000) {\r\n $path_s = \"data/share.txt\";\r\n $file_s = fopen($path_s, \"r\");\r\n $data_s = array();\r\n $i_s = 0;\r\n while(! feof($file_s))\r\n {\r\n $data_s[$i_s]= fgets($file_s);\r\n $i_s++;\r\n }\r\n fclose($file_s);\r\n $data_h=array_filter($data_s);\r\n foreach($data_s as $k=>$v){\r\n $str_s = explode(\"|\",$v);\r\n if ($str_s[0] == $bookId){\r\n $row[0] = $str_s[2];\r\n $row[1] = $str_s[1];\r\n }\r\n }\r\n }\r\n return $row;\r\n}", "public function studentsExport($class_id) \n {\n $class = Classes::findOrFail($class_id);\n $infoStudents = InfoStudents::where('class', $class_id)->get();\n return Excel::download(new StudentsExport($infoStudents, $class), 'students_'.$class->class_name.'_'.date('d-m-Y').'.xlsx');\n }", "function get_student_details($stud_id)\n\t\t{\n\t\t\t$sql =\t$GLOBALS['db']->prepare(\"select * from student_basic where stud_id=$stud_id\");\n\t\t\t$sql->execute();\n\t\t\t$result = $sql->fetchAll();\n\t\t\treturn $result;\n\t\t}", "function getDataFromXLSXPath($xlsxPath){\r\n $inputFileType = PHPExcel_IOFactory::identify($xlsxPath); \r\n $objReader = PHPExcel_IOFactory::createReader($inputFileType); \r\n $objReader->setReadDataOnly(true); \r\n $objPHPExcel = $objReader->load($xlsxPath); \r\n\r\n // set config -> activesheet, highestRow, highestColumn and get heading data\r\n $objWorksheet = $objPHPExcel->setActiveSheetIndex(0);\r\n $highestRow = $objWorksheet->getHighestRow();\r\n $highestColumn = $objWorksheet->getHighestColumn();\r\n \r\n $headingsArray = $objWorksheet->rangeToArray('A1:'.$highestColumn.'1', null, true, true, true);\r\n $headingsArray = $headingsArray[1];\r\n\r\n // collect data within $namedDataArray\r\n $r = -1;\r\n $namedDataArray = array();\r\n for ($row = 2; $row <= $highestRow; ++$row) {\r\n ++$r;\r\n $dataRow = $objWorksheet->rangeToArray('A'.$row.':'.$highestColumn.$row, null, true, true, true);\r\n foreach($headingsArray as $columnKey => $columnHeading) {\r\n $namedDataArray[$r][$columnHeading] = $dataRow[$row][$columnKey];\r\n }\r\n }\r\n return $namedDataArray;\r\n }", "function get_student_finances()\n\t{\n\t\taccess_control($this);\n\t\t\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'));\n\t\t\n\t\t# Pick all assigned data\n\t\t$data = assign_to_data($urldata);\n\n\t\t#Get the student's details\n\t\t$studentid = decryptValue($data['i']);\n #find out whether student isactive or not and fetch data accordiginly::\n if(isset($data['m'])){\n $isactiv =$data['m'];\n $isactiv=($isactiv == 'N' ) ? $isactiv : 'Y';\n }\n else\n {\n $isactiv = 'Y';\n }\n\n\t\t$data['studentdetails'] = $this->Query_reader->get_row_as_array('get_students_list', array('isactive' =>'Y', 'limittext' =>'','searchstring'=> ' AND id = '.$studentid ));\n\t\t\t\n\t\t#Check if the student belongs to the current user's school\n\n\t\tif(@$data['studentdetails']['school'] != $this->schoolinfo['id']){\n\t\t\t\t$data['studentdetails'] = array ();\n\t\t\t\t$studentid = '';\n\t\t\t\t$data['msg'] = 'ERROR : The student data could not be found.';\n\t\t}\n\t\t\n\t\t#Get the paginated list of the students finances\n\n\t\t@$data = paginate_list($this, $data, 'search_student_accounts', array('isactive'=>$isactiv, 'limittext'=>'', 'searchstring'=>' AND student = '.$studentid), 50);\n\t\t\t\t\n\t\t$data = add_msg_if_any($this, $data);\n\t\t$this->load->view('students/student_finances_view', $data);\n\t\t\n\t\t\n\t}" ]
[ "0.7065373", "0.664104", "0.63348264", "0.61880016", "0.6182549", "0.61676395", "0.61188114", "0.6096632", "0.6092174", "0.6064927", "0.6057486", "0.6052561", "0.603971", "0.6039612", "0.6024237", "0.60082877", "0.59553766", "0.59422666", "0.5926588", "0.5911406", "0.59002376", "0.5875499", "0.583372", "0.5828064", "0.576271", "0.57577866", "0.57206017", "0.5707664", "0.5706867", "0.5706575", "0.57041705", "0.56795883", "0.567323", "0.5662264", "0.564369", "0.56429017", "0.5641434", "0.56414235", "0.5632948", "0.5632038", "0.56318307", "0.5630109", "0.56270325", "0.56207466", "0.5620516", "0.5611605", "0.5608374", "0.56022805", "0.5602265", "0.5590826", "0.55839366", "0.5574179", "0.556977", "0.5562185", "0.55522585", "0.55452347", "0.5542575", "0.5540782", "0.5539908", "0.5531374", "0.5524964", "0.5520047", "0.55157566", "0.5504546", "0.5503374", "0.55021566", "0.5501358", "0.5496898", "0.54967225", "0.54961526", "0.549569", "0.548495", "0.5483244", "0.5482343", "0.5480889", "0.5475486", "0.5474834", "0.54693806", "0.54649186", "0.5452707", "0.54513425", "0.54442817", "0.54441434", "0.544366", "0.5443354", "0.5443315", "0.5429458", "0.5423494", "0.5420164", "0.54201263", "0.54201186", "0.5415938", "0.5415057", "0.54146975", "0.5412586", "0.5406132", "0.54046273", "0.5400436", "0.53889287", "0.538498" ]
0.70823824
0
_get_info load_playlist This is called once per page load it makes sure that this session has a tmp_playlist, creating it if it doesn't, then sets $this>playlist as a tmp_playlist object that can be fiddled with later on
_get_info загрузить_плейлист Этот метод вызывается один раз при загрузке страницы, он убедится, что в этой сессии есть tmp_playlist, создаст его при необходимости, а затем установит $this>playlist как объект tmp_playlist, который позже можно будет изменять
public function load_playlist() { $session_id = session_id(); $this->playlist = tmpPlaylist::get_from_session($session_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadPlaylist() {\r\n $dbLayer = DBLayer::getInstance();\r\n\r\n $this->playlist = null;\r\n\r\n // load the user playlist\r\n $data = $dbLayer->executeQuery('users.playlist', array(':user_id' => $this->userId));\r\n\r\n if ($data) {\r\n // Clear previous data - if any\r\n $items = array();\r\n\r\n // Get all the playlist records\r\n foreach ($data as $item) {\r\n array_push($items, $item);\r\n }\r\n\r\n $this->playlist = $items;\r\n }\r\n\r\n }", "function loadPlaylist();", "protected function getPlaylistObject()\n\t{\n\t\treturn $this->playlist_obj;\n\t}", "public function playlist_get()\n {\n }", "function __construct()\n\t{\n\t\t$this->arrPlaylist = array();\n\t}", "public function __construct($playlist)\n {\n $this->playlist = $playlist;\n }", "function createPlaylist();", "private function _getPlaylist($req, $plId = \"PLPSfPyOOcp3R9ZPLNjZkWxRy-BWCfNMrn\") {\n $f = new \\App\\library\\DomParser();\n $html = $f->file_get_html(\"https://www.youtube.com/playlist?list=\" . $plId);\n $title = $req->get('title') ? $req->title : $html->find(\"#pl-header h1.pl-header-title\", 0)->plaintext;\n $thumb_url = $req->get('thumb_url');\n if ($req->id) {\n $playlist = Playlist::find($req->id);\n }\n if (!$playlist) {\n $playlist = Playlist::where('yid', $plId)->first();\n }\n if (!$playlist) {\n $playlist = new Playlist();\n $playlist->yid = $plId;\n }\n\n $playlist->cat_id = $req->cat_id;\n $playlist->en_cat_id = $req->en_cat_id;\n\n $playlist->title = trim($title);\n $playlist->thumb_url = $thumb_url ? $thumb_url : \"\";\n\n if ($req->status) {\n $playlist->status = 1;\n } else {\n $playlist->status = 0;\n }\n $this->_getVideos($html, $playlist);\n\n $playlist->item_count = $playlist->videos()->count();\n $playlist->save();\n\n return $playlist;\n }", "public function process()\n\t{\n Phpfox::getLib('setting')->setParam('musicsharing.url_image', Phpfox::getParam('core.url_pic') . 'musicsharing' . PHPFOX_DS);\n phpFox::isUser(true);\n $aParentModule = $this->getParam('aParentModule');\n if($aParentModule)\n {\n phpFox::getLib('session')->set('pages_msf',$aParentModule);\n if(!phpFox::getService('pages')->hasPerm($aParentModule['item_id'], 'musicsharing.can_manage_playlist'))\n {\n $this->url()->send(\"subscribe\");\n }\n }\n else\n {\n phpFox::getLib('session')->remove('pages_msf');\n }\n $this->template()->setBreadCrumb(phpFox::getPhrase('musicsharing.music_sharing'),null);\n\t\t$prefix=phpFox::getParam(array('db', 'prefix'));\n $settings = phpFox::getService('musicsharing.music')->getUserSettings(phpFox::getUserId());\n $this->template()->assign(array('settings'=>$settings));\n if(isset($_POST['task']) && $_POST['task'] == \"dodelete\")\n {\n foreach($_POST['delete_playlist'] as $pid)\n {\n phpFox::getService('musicsharing.music')->deletePlaylist($pid);\n }\n }\n\n if($this->request()->get(\"orderplaylist\"))\n {\n $id_playlist=$this->request()->get(\"orderplaylist\");\n $playlist_current=phpFox::getService('musicsharing.music')->getplaylists_Id($id_playlist,phpFox::getUserId());\n $order_playlist_current=$playlist_current[\"order_id\"];\n $playlist_after=phpFox::getService('musicsharing.music')->getplaylistsBefore_Id($id_playlist,phpFox::getUserId());\n $order_playlist_after=$playlist_after[\"order_id\"];\n if($order_playlist_after)\n {\n $id_playlist_after=$playlist_after[\"playlist_id\"];\n phpFox::getService('musicsharing.music')->updateplaylist($id_playlist,$order_playlist_after);\n phpFox::getService('musicsharing.music')->updateplaylist($id_playlist_after,$order_playlist_current);\n }\n if ( $this->request()->get('page') > 0)\n $this->url()->send('musicsharing.myplaylists.page_'.$this->request()->get('page'),null,null,null);\n else\n $this->url()->send('musicsharing.myplaylists',null,null,null);\n }\n else if($this->request()->get(\"orderplaylistdown\"))\n {\n $id_playlist=$this->request()->get(\"orderplaylistdown\");\n $playlist_current=phpFox::getService('musicsharing.music')->getplaylists_Id($id_playlist,phpFox::getUserId());\n $order_playlist_current=$playlist_current[\"order_id\"];\n $playlist_after=phpFox::getService('musicsharing.music')->getplaylistsAfter_Id($id_playlist,phpFox::getUserId());\n $order_playlist_after=$playlist_after[\"order_id\"];\n if($order_playlist_after)\n {\n $id_playlist_after=$playlist_after[\"playlist_id\"];\n phpFox::getService('musicsharing.music')->updateplaylist($id_playlist,$order_playlist_after);\n phpFox::getService('musicsharing.music')->updateplaylist($id_playlist_after,$order_playlist_current);\n }\n if ( $this->request()->get('page') > 0)\n $this->url()->send('musicsharing.myplaylists.page_'.$this->request()->get('page'),null,null,null);\n else\n $this->url()->send('musicsharing.myplaylists',null,null,null);\n }\n\n $user_id = phpFox::getUserId();\n if($this->request()->get('setdefaultplaylist'))\n {\n $idplaylist = $this->request()->get('setdefaultplaylist');\n phpFox::getService('musicsharing.music')->setplaylistprofile($idplaylist,$user_id);\n }\n $where = \" where \".$prefix.\"m2bmusic_playlist.user_id = $user_id\";\n $list_total = phpFox::getService('musicsharing.music')->get_total_playlist($where);\n $aGlobalSettings = phpFox::getService('musicsharing.music')->getUserSettings(phpFox::getUserId(), false);\n $iPageSize = isset($aGlobalSettings['number_playlist_per_page']) ? $aGlobalSettings['number_playlist_per_page'] : 5;\n $iPage = $this->request()->get(\"page\");\n if(!$iPage)\n $iPage = 1;\n $max_page = floor($list_total/$iPageSize) + 1;\n if($iPage > $max_page)\n $iPage = $max_page;\n //$sort_by=$prefix.'m2bmusic_playlist.order_id';\n $list_info = phpFox::getService('musicsharing.music')->getPlaylists(($iPage-1)*$iPageSize,$iPageSize,null,null,$where);\n\n\n phpFox::getLib('pager')->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $list_total));\n\n $this->template()->assign(array('iPage'=>$iPage,'aRows'=>$list_info,'iCnt'=>$list_total))\n ->setHeader('cache', array(\n 'pager.css' => 'style_css'));\n\n $this->template()->assign(array(\n 'sDeleteBlock' => 'dashboard',\n 'list_info' =>$list_info,\n 'core_path' =>phpFox::getParam('core.path'),\n 'user_id' =>phpFox::getUserId(),\n 'total_playlist'=>$list_total,\n 'cur_page'=>$this->request()->get('page')<=0?1:$this->request()->get('page')\n ));\n $this->template()->setHeader(array(\n 'm2bmusic_tabcontent.js' => 'module_musicsharing' ,\n 'm2bmusic_class.js' => 'module_musicsharing' ,\n 'music.css' => 'module_musicsharing',\n 'musicsharing_style.css' => 'module_musicsharing',\n\t\t'mobile.css' => 'module_musicsharing',\n ));\n\t\t\n\t\t//modified section (v 300b1)\n\t\t//build filter menu\n\t\tphpFox::getService('musicsharing.music')->getSectionMenu($aParentModule);\n\t\t$catitle = $this->template()->getBreadCrumb();\n\t\t\n\t\tif(!$aParentModule){\n\t\t\t$satitle = isset($catitle[1][0])?$catitle[1][0]:$catitle[0][0];\n\t\t\t$this->template()->clearBreadCrumb();\n\t\t\t$this->template()\n\t\t\t\t->setBreadCrumb(phpFox::getPhrase('musicsharing.music_sharing'), $this->url()->makeUrl('musicsharing'))\n\t\t\t\t->setBreadCrumb($satitle, null)\n\t\t\t\t->setBreadCrumb($satitle, null, true);\n\t\t}else{\n\t\t\t$this->template()->clearBreadCrumb();\n\t\t\t$this->template()\n\t\t\t\t->setBreadCrumb(phpFox::getPhrase('musicsharing.music_sharing'), $this->url()->makeUrl('musicsharing'), false);\n\t\t}\n\t\t///modified section (v 300b1)\n\t}", "function page_player($playlist, $html_attr=array()) {\n $songs = \"\";\n foreach ($playlist as $song) {\n if (!isset($song[\"class\"]))\n $song[\"class\"] = \"\";\n\n $song[\"class\"] = \"inline-playable $song[class]\";\n\n $songs .= $this->Html->tag(\"li\", \n $this->Html->link($song[\"title\"], $song[\"link\"], \n array(\"id\"=>$song[\"id\"], \"class\"=>$song[\"class\"]))\n );\n }\n\n if (!isset($html_attr[\"class\"]))\n $html_attr[\"class\"] = \"\";\n\n $html_attr[\"class\"] = \"playlist $html_attr[class]\";\n\n return $this->Html->tag(\"ul\", $songs, $html_attr);\n }", "function loadNewPlaylist($playlist) {\n\t\n\tglobal $DEBUG, $settings;\n\t\n\t$LOAD_RESULT = false;\n\t\n\tlogEntry(\"Loading a new Playlist: \".$playlist);\n\t\n\tlogEntry(\"FPP Bin dir: \".$settings['fppDir']);\n\t\n\t//FPP FPPD location need to fix based on the platform!\n\t$FPPD_LOCATION = $settings['fppDir'].\"/fppd\";\n\t\n\t\n\tif(file_exists($FPPD_LOCATION)) {\n\t\t\n\t}else {\n\t\n\t\t//it is in the SRC location\n\t\t$FPPD_LOCATION = $settings['fppDir'].\"/src/fppd\";\n\t}\n\t\n\t\n\treturn $LOAD_RESULT;\n\t\n}", "public function getPlaylist() {\r\n return $this->playlist;\r\n }", "public function playlist_data() \n {//getting playlist data function starts\n $orderBy = array('id', 'title', 'desc', 'publish','sorder');\n $order = 'id';\n\n if (isset($this->_orderBy) && in_array($this->_orderBy, $orderBy))\n {\n $order = $this->_orderBy;\n }\n\n switch($order)\n {\n case 'id':\n $order ='pid';\n break;\n\n case 'title':\n $order ='playlist_name';\n break;\n case 'publish':\n $order ='is_publish';\n break;\n\n case 'sorder':\n $order ='playlist_order';\n break;\n\n default:\n $order ='pid';\n }\n return $this->get_playlsitdata($this->_playlistsearchQuery,$this->_searchBtn,$order, $this->_orderDirection);\n }", "public function get() { \n\n\t\t/* Get the Current Playlist */\n\t\t$list = $this->_httpq->get_tracks();\n\n\t\tif (!$list) { return array(); } \n\t\n\t\t$songs = explode(\"::\",$list); \n\n\t\tforeach ($songs as $key=>$entry) { \n\t\t\t$data = array();\n\t\t\t\n\t\t\t/* Required Elements */\n\t\t\t$data['id'] \t= $key;\n\t\t\t$data['raw']\t= $entry;\t\t\n\n\t\t\t$url_data = $this->parse_url($entry); \n switch ($url_data['primary_key']) {\n case 'oid':\n $song = new Song($url_data['oid']);\n $song->format();\n $data['name'] = $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist;\n $data['link'] = $song->f_link;\n break;\n case 'demo_id':\n $democratic = new Democratic($url_data['demo_id']);\n $data['name'] = _('Democratic') . ' - ' . $democratic->name;\n $data['link'] = '';\n break;\n\t\t\t\tcase 'random': \n\t\t\t\t\t$data['name'] = _('Random') . ' - ' . scrub_out(ucfirst($url_data['type'])); \n\t\t\t\t\t$data['link'] = ''; \n\t\t\t\tbreak; \n default:\n /* If we don't know it, look up by filename */\n $filename = Dba::escape($entry['file']);\n $sql = \"SELECT `id`,'song' AS `type` FROM `song` WHERE `file` LIKE '%$filename' \" .\n \"UNION ALL \" .\n \"SELECT `id`,'radio' AS `type` FROM `live_stream` WHERE `url`='$filename' \";\n\n $db_results = Dba::read($sql);\n if ($row = Dba::fetch_assoc($db_results)) {\n $media = new $row['type']($row['id']);\n $media->format();\n switch ($row['type']) {\n case 'song':\n $data['name'] = $media->f_title . ' - ' . $media->f_album . ' - ' . $media->f_artist;\n $data['link'] = $media->f_link;\n break;\n case 'radio':\n $frequency = $media->frequency ? '[' . $media->frequency . ']' : '';\n $site_url = $media->site_url ? '(' . $media->site_url . ')' : '';\n $data['name'] = \"$media->name $frequency $site_url\";\n $data['link'] = $media->site_url; \n break; \n } // end switch on type \n } // end if results\n\n break;\n } // end switch on primary key type\n\n\t\t\t$data['track']\t= $key+1;\n\n\t\t\t$results[] = $data;\n\n\t\t} // foreach playlist items\n\t\t\n\t\treturn $results;\n\n\t}", "public function GetPlaylist()\n\t{\n\t\t$this->_addLog(__METHOD__,\"send\");\n\t\t$plStr = $this->SendCommand(self::MPD_CMD_PLLIST);\n \t\t$array = $this->_parseFileListResponse($plStr);\n \t\t$playlist = $array['files'];\n\t \t$this->playlist_count = count($playlist);\n\t \t$this->playlist = array();\n\t \tif (sizeof($playlist)>0){\n\t\t\tforeach ($playlist as $item ){\n\t\t\t\t$this->playlist[$item['Pos']]=$item;\n\t\t\t}\n\t \t}\n\t\t$this->_addLog(__METHOD__,\"return\");\n\t\treturn true;\n\t}", "protected function _getPlaylists() {\n if (!$this->_playlists) {\n $this->_playlists = \\Drupal::entityTypeManager()->getStorage('node')->loadByProperties(['type' => 'wc_playlist', 'status' => 1]);\n }\n\n return $this->_playlists;\n }", "public function populateHiddenPlayer()\n\t\t\t{\n\t\t\t\t//Initializing Playlist Player Configuaration\n\t\t\t\t$this->populatePlayerWithPlaylistConfiguration();\n\t\t\t\t$music_id_arr = array_unique($this->player_music_id);\n\t\t\t\t$this->configXmlcode_url .= 'pg=music';\n\t\t\t\t$this->playlistXmlcode_url .= 'pg=music_0_'.implode(',', $music_id_arr);\n\t\t\t\t/**\n\t\t\t\t * musicHandler::populatePlayerWithPlaylist()\n\t\t\t\t *\n\t\t\t\t * @param string $div_id\n\t\t\t\t * @param string $music_player_id\n\t\t\t\t * @param integer $width\n\t\t\t\t * @param integer $height\n\t\t\t\t * @param string $auto_play\n\t\t\t\t * @param boolean $hidden\n\t\t\t\t * @param boolean $playlist_auto_play\n\t\t\t * @param boolean $javascript_enabled\n\t\t\t * @param boolean $player_ready_enabled\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\t$music_array = array(\n\t\t\t\t\t'div_id' => 'index_flash_player',\n\t\t\t\t\t'music_player_id' => 'index_hidden_player',\n\t\t\t\t\t'width' \t\t => 1,\n\t\t\t\t\t'height' => 1,\n\t\t\t\t\t'auto_play' => 'false',\n\t\t\t\t\t'hidden' => true,\n\t\t\t\t\t'playlist_auto_play' => false,\n\t\t\t\t\t'javascript_enabled' => true,\n\t\t\t\t\t'player_ready_enabled' => true,\n\t\t\t\t\t'informCSSWhenPlayerReady' => false\n\t\t\t\t);\n\t\t\t\t$this->populatePlayerWithPlaylist($music_array);\n\n\t\t\t\techo '<input type=\"hidden\" name=\"hidden_player_status\" id=\"hidden_player_status\" value=\"no\"/>\n\t\t\t\t\t <script language=\"javascript\" type=\"text/javascript\" >\n\t\t\t\t\t\tvar total_musics_to_play = '.count($this->player_music_id).';\n\t\t\t\t\t\tvar play_functionalities_arr = new Array(\\'music_tracker\\', \\'top_chart\\', \\'top_downloads\\');';\n\n\t\t\t\t\t\tif(!empty($this->player_music_id))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach($this->player_music_id as $music_id_to_play)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\techo 'total_musics_ids_play_arr.push('.$music_id_to_play.');';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\techo '</script>';\n\t\t\t}", "public function testCreatePlaylist()\n {\n $this->testLoginUser();\n\n // Get the playlist creation page\n $this->session->visit($this->baseUrl . \"addPlaylist.php\");\n $page = $this->session->getPage();\n\n // Set form data and submit\n $page->find('css', \"#title\")->setValue(\"title\");\n $page->find('css', \"#description\")->setValue(\"description\");\n $page->find('css', \"#subject\")->setValue(\"subject\");\n $page->find('css', \"#topic\")->setValue(\"topic\");\n\n $page->find('css', \"#playlistForm\")->submit();\n\n // Get the new page and verify that we're on the playlist view page\n $page = $this->session->getPage();\n\n // Check that the subscribers button is there. This button is only\n // present on the playlist view page and the video view page\n // (when playing a playlist).\n $sub = $page->find('css', 'a.btn.subscribe');\n $this->assertInstanceOf(NodeElement::Class, $sub,\n 'Unable to find subscribe button.');\n\n $query = parse_url($this->session->getCurrentUrl(), PHP_URL_QUERY);\n $params = [];\n parse_str($query, $params);\n $this->playlistId = $params[\"v\"];\n\n $this->assertNotNull(Playlist::getPlaylistById($this->playlistId),\n \"Unable to verify playlist id \" . $this->playlistId . \" through DB\");\n }", "public function initPlaylistss()\n {\n $collectionClassName = UserPlaylistsTableMap::getTableMap()->getCollectionClassName();\n\n $this->collPlaylistss = new $collectionClassName;\n $this->collPlaylistssPartial = true;\n $this->collPlaylistss->setModel('\\Models\\Playlists\\Playlists');\n }", "public function getPlaylist()\n\t{\n $app = JFactory::getApplication();\n\n $option\t= $app->input->get('option', '', 'word');\n $view = $app->input->get('view', '', 'word');\n $id = $app->input->get('id', '', 'int');\n $playlist_id = $app->input->get('playlist_id', '', 'int');\n \n if ($option == 'com_hwdmediashare' && $view == 'playlist' && $id)\n {\n return $id;\n }\n\n if ($option == 'com_hwdmediashare' && $view == 'mediaitem' && $playlist_id)\n {\n return $playlist_id;\n }\n \n return false;\n\t}", "function get_player()\n\t{\n\t\t\n\t\t//$str=\"new SWFObject(\\\"\";\n\t\t$str= \"<div id=\\\"profile_mp3Player\\\"\";\n\t\t$end = \"</div>\";\n\t\t\n\n\t\t$url= trim($this->striplayer($this->data, $str,$end));\n\t\t\n\t\t\n\t\t$id['plid']= trim($this->strip($url,'plid','&'));\n\t\t$id['artid'] = trim($this->strip($url,'artid','&'));\n\t\t$id['profid'] = trim($this->strip($url,'profid','&'));\n\t\t//print_r($id);\n\t\t//exit;\n\t\treturn $id;\n\t}", "public function getPlaylist( $id_playlist ) {\n\t\t$sql = 'SELECT * FROM playlist WHERE id_playlist = \"'. $id_playlist .'\" LIMIT 1';\n\t\t$result = $this->mysqlQuery( $sql ); \n\t\t$playlist_info = $this->getArray( $result );\n\t\treturn $playlist_info;\n\t}", "public function initialPlayer()\n\t{\n\t\t$videoid = 0;\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true);\n\n\t\tif (JRequest::getvar('id', '', 'get', 'int') || JRequest::getVar('video', '', 'get', 'int'))\n\t\t{\n\t\t\tif (JRequest::getVar('video', '', 'get', 'int'))\n\t\t\t{\n\t\t\t\t$videoid = JRequest::getVar('video', '', 'get', 'int');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$videoid = JRequest::getvar('id', '', 'get', 'int');\n\t\t\t}\n\n\t\t\tif ($videoid != \"\")\n\t\t\t{\n\t\t\t\t$query->select(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'DISTINCT a.*', 'b.category'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t->from('#__hdflv_upload AS a')\n\t\t\t\t\t\t->leftJoin('#__hdflv_category AS b ON a.playlistid=b.id OR a.playlistid=b.parent_id')\n\t\t\t\t\t\t->where($db->quoteName('a.published') . ' = ' . $db->quote('1'))\n\t\t\t\t\t\t->where($db->quoteName('a.id') . ' = ' . $db->quote($videoid));\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$rowsVal = $db->loadAssoc();\n\t\t\t}\n\t\t}\n\t\telseif (JRequest::getVar('video', '', 'get', 'string'))\n\t\t{\n\t\t\t$video_string = JRequest::getVar('video', '', 'get', 'string');\n\t\t\t$video = str_replace(':', '-', $video_string);\n\t\t\t$query->clear()\n\t\t\t\t\t->select(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'DISTINCT a.*', 'b.category'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t->from('#__hdflv_upload AS a')\n\t\t\t\t\t->leftJoin('#__hdflv_category AS b ON a.playlistid=b.id OR a.playlistid=b.parent_id')\n\t\t\t\t\t->where($db->quoteName('a.published') . ' = ' . $db->quote('1'))\n\t\t\t\t\t->where($db->quoteName('a.seotitle') . ' = ' . $db->quote($video));\n\t\t\t$db->setQuery($query);\n\t\t\t$rowsVal = $db->loadAssoc();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query->clear()\n\t\t\t\t\t->select(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'a.*', 'b.category', 'd.username', 'e.*'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t->from('#__hdflv_upload AS a')\n\t\t\t\t\t->leftJoin('#__users AS d ON a.memberid=d.id')\n\t\t\t\t\t->leftJoin('#__hdflv_video_category AS e ON e.vid=a.id')\n\t\t\t\t\t->leftJoin('#__hdflv_category AS b ON e.catid=b.id')\n\t\t\t\t\t->where($db->quoteName('a.published') . ' = ' . $db->quote('1'))\n\t\t\t\t\t->where($db->quoteName('b.published') . ' = ' . $db->quote('1'))\n\t\t\t\t\t->where($db->quoteName('a.featured') . ' = ' . $db->quote('1'))\n\t\t\t\t\t->where($db->quoteName('a.type') . ' = ' . $db->quote('0'))\n\t\t\t\t\t->group($db->escape('e.vid'))\n\t\t\t\t\t->order($db->escape('a.ordering' . ' ' . 'ASC'));\n\n\t\t\t// Query is to display recent videos in home page\n\t\t\t$db->setQuery($query);\n\t\t\t$rowsVal = $db->loadAssoc();\n\n\t\t\tif (count($rowsVal) == 0)\n\t\t\t{\n\t\t\t\t$query->clear('where')\n\t\t\t\t\t\t->where($db->quoteName('a.published') . ' = ' . $db->quote('1'))\n\t\t\t\t\t\t->where($db->quoteName('b.published') . ' = ' . $db->quote('1'))\n\t\t\t\t\t\t->where($db->quoteName('a.type') . ' = ' . $db->quote('0'));\n\n\t\t\t\t// Query is to display recent videos in home page\n\t\t\t\t$db->setQuery($query, 0, 1);\n\t\t\t\t$rowsVal = $db->loadAssoc();\n\t\t\t}\n\t\t}\n\n\t\treturn $rowsVal;\n\t}", "public function show(Playlist $playlist)\n {\n //\n }", "function createplaylist ()\r\n{\r\n\t// requerimos los archivos necesarios de la bibilioteca php que obtiene datos de\r\n\t// los ficheros mp3\r\n\trequire_once('getid3/getid3/getid3.php');\r\n\t\r\n\t//nombre del curso\r\n\t$curso_nombre = $_SESSION['_course']['name'];\r\n\t//datos de rutas\r\n\t$dominio = api_get_path('WEB_COURSE_PATH');\r\n\t$curso = $_GET['cidReq'];\r\n\t$carpeta = \"/podcast/\";\r\n\t$dir = \"../../courses/\" . $_GET['cidReq'] . \"/podcast\";\r\n\r\n\t//*****************************************************\r\n\t$rss_titulo = 'Podcast del curso ' . $curso_nombre;\r\n\t$rss_url = \"$dominio$curso$carpeta\" . 'playlist.xml';\r\n\t$rss_docs = $dominio . $curso . $carpeta;\r\n\t$rss_descripcion = 'Podcast del curso ' . $curso_nombre;\r\n\r\n\t//*****************************************************\r\n\r\n\t//borramos los archivos anteriores si existen\r\n\tif (file_exists($dir .'/playlist.xml'))\r\n\t{\r\n\t\tunlink($dir .'/playlist.xml');\t\r\n\t\tunlink($dir .'/playlist.xspf');\t\r\n\t}\r\n\r\n\t//creamos los archivos\r\n\t$getid3 = new getID3;\r\n\t$getid3->encoding = 'UTF-8';\r\n\t//header('Content-Type: text/html; charset=UTF-8');\r\n\t\r\n\t if ($gd = opendir($dir)) \r\n\t\t{\r\n\t\t\t//------------- PLAYLIST --------------------------------\r\n\t\t\t$archivo = $dir . \"/playlist.xspf\"; \r\n\t\t\t$puntero = fopen($archivo, 'w+'); \r\n\t\t\t$ContenidoFinal = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\r\n\t\t\t$ContenidoFinal .= '<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">';\r\n\t\t\t$ContenidoFinal .= '<title>Podcast</title>';\r\n\t\t\t$ContenidoFinal .= '<trackList>';\r\n\t\t\t// ---------- RSS ------------------------------------\r\n\t\t\t$rss = $dir . \"/playlist.xml\"; \r\n\t\t\t$puntero2 = fopen($rss, 'w+'); \r\n\t\t\t$ContenidoRSS = '<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>';\r\n\t\t\t$ContenidoRSS .=\r\n\t\t\t'<rss version=\"0.92\">\r\n\t\t\t <channel>\r\n\t\t \t\t<docs>'.$rss_docs.'</docs>\r\n\t\t\t\t<title>'.$rss_titulo.'</title>\r\n\t\t\t \t\t<link>'.$rss_url.'</link>\r\n\t\t\t\t<description>'.$rss_descripcion.'</description>\r\n\t\t \t\t<language>es</language>';\r\n\t\t\t//------------------ELEMENTOS----------------------------------\r\n\t\t\twhile (($archivo = readdir($gd)) !== false) \r\n\t\t\t{\r\n\t\t\t\t\tif(strstr($archivo,'.mp3'))\r\n\t\t\t\t\t//buscamos solos archivos mp3\r\n\t\t\t\t\t{\r\n\t\t\t\t\t$ContenidoFinal .= \"<track>\";\t\t\t\t\r\n\t\t\t\t\t$ContenidoFinal .= \"<location>\";\t\t\t\t\r\n\t\t\t\t\t$ContenidoFinal .= \"$dominio$curso$carpeta$archivo\";\r\n\t\t\t\t\t$ContenidoFinal .= \"</location>\";\r\n\r\n\t\t\t\t\ttry { \r\n\t\t\t\t\t$getid3->Analyze($dir.\"/\".$archivo);\r\n\t\t\t\t\t//---------- PLAYLIST item ----------------\r\n\t\t\t\t\t$ContenidoFinal .=\"<title>\";\t\t\t\t\r\n\t\t\t\t\t$ContenidoFinal .= @$getid3->info['id3v1']['title'];\r\n\t\t\t\t\t$ContenidoFinal .= \"</title>\";\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t$ContenidoFinal .= \"<album>\";\t\t\t\t\r\n\t\t\t\t\t$ContenidoFinal .= @$getid3->info['id3v1']['album'];\r\n\t\t\t\t\t$ContenidoFinal .= \"</album>\";\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t$ContenidoFinal .= \"<artist>\";\t\t\t\t\r\n\t\t\t\t\t$ContenidoFinal .= @$getid3->info['id3v1']['artist'];\r\n\t\t\t\t\t$ContenidoFinal .= \"</artist>\";\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t//---------- RSS item ----------------\r\n\t\t\t\t\t$ContenidoRSS .= \"<item><title>\".@$getid3->info['id3v1']['title'].\"</title>\";\r\n\t\t\t\t $ContenidoRSS .= \"<link>$dominio$curso$carpeta$archivo</link>\";\r\n\t\t\t\t $ContenidoRSS .= \"<description>\".@$getid3->info['id3v1']['artist'].\"</description></item>\";\r\n\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\tcatch (Exception $e) \r\n\t\t\t\t\t\t{ \r\n\t \t\t\techo 'Error ocurrido: ' . $e->message; \r\n\t \t\t\techo \"<br>\";\r\n\t\t\t\t\t\t}\r\n\t \t\t\t\t$ContenidoFinal .= \"</track>\";\t\r\n\t\t\t\t\t}\t\t\r\n\t\t\t\t}\r\n\t $ContenidoFinal .= \"</trackList>\";\r\n\t\t$ContenidoFinal .= \"</playlist>\";\r\n\r\n\t\t$ContenidoRSS .= \"</channel>\";\r\n\t \t$ContenidoRSS .= \"</rss>\"; \r\n\t \t\r\n\tfwrite($puntero, $ContenidoFinal); \r\n\tfclose($puntero);\r\n\tfwrite($puntero2, $ContenidoRSS); \r\n\tfclose($puntero2); \r\n\t\t\t}\r\n\tclosedir($gd);\t\r\n\treturn true;\r\n}", "protected function getCurrentPlaylist()\n {\n $container = $this->getContainer();\n return $container['playlist'];\n }", "public function testAddPlaylist() {\n\n\n // login\n $page = $this->loginToSite();\n\n\n // move to createPlaylist\n $this->session->visit('./createPlaylist');\n\n $page = $this->session->getPage();\n\n // Check that we are logged in\n $this->assertInstanceOf(\n NodeElement::Class,\n $page->find('css', 'h1'),\n \"Unable to find header in playlist page\"\n );\n $this->assertEquals(\n \"Lag spilleliste\",\n $page->find('css', 'h1')->getText(),\n \"h1 should indicate is on create playlist page\"\n );\n\n\n // FILL OUT FORM\n\n $form = $page->find('css', '.createPlaylistForm');\n $this->assertInstanceOf(NodeElement::Class, $form, 'Unable to locate createPlaylist form');\n\n $page->find('css', 'input[name=\"title\"]')->setValue($this->testPlaylistTitleString);\n $page->find('css', 'input[name=\"description\"]')->setValue($this->testPlaylistTitleString);\n // ignore thumbnail completely... set to empty string in db\n\n $form->submit();\n\n\n // get page\n $page = $this->session->getPage();\n\n // assert success\n $this->assertInstanceOf(\n NodeElement::Class,\n $page->find('css', '.alert-success'),\n \"creating of playlist didn't go well (message not success)\"\n );\n\n }", "public static function run_playlist_method()\n {\n // If this wasn't ajax included run away\n if (!defined('AJAX_INCLUDE')) { return false; }\n\n switch (AmpConfig::get('playlist_method')) {\n default:\n case 'clear':\n case 'default':\n return true;\n break;\n case 'send':\n $_SESSION['iframe']['target'] = AmpConfig::get('web_path') . '/stream.php?action=basket';\n break;\n case 'send_clear':\n $_SESSION['iframe']['target'] = AmpConfig::get('web_path') . '/stream.php?action=basket&playlist_method=clear';\n break;\n } // end switch on method\n\n // Load our javascript\n echo \"<script type=\\\"text/javascript\\\">\";\n echo \"reloadUtil('\".$_SESSION['iframe']['target'].\"');\";\n echo \"</script>\";\n\n }", "function playlist(){\n\t \n \t\t$media = array();\n\t\t$data = $this->Medias->playlist();\n\t\t\n \t\tif (!empty($data)){\t\t\t\n\t\t\tforeach($data as $file){\n\t\t\t\t$play = false;\n\t\t\t\tif (empty($file['MediaPlaytime'])){\n\t\t\t\t\t$play = true;\n\t\t\t\t} else {\n\t\t\t\t\tforeach($file['MediaPlaytime'] as $pt){\n\t\t\t\t\t\tif ($play == false && $pt['time_from'] == intval(date('G').'00') && $pt['time_to'] == intval((date('G')+1).'00') \n\t\t\t\t\t\t\t&& ($pt['day'] == date('N') || $pt['day'] == 0 || empty($pt['day']))){\n\t\t\t\t\t\t\t\t$play = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($play){\n \t\t\t\t\t$media[] = $file['Medias'];\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\tif (empty($media)) {\n \t\t\t$media[] = array('file_name'=> 'default.mp4');\n\t\t}\n \n\t\t$this->set('content', $media);\n\t}", "public function ajaxCreatePlaylistAction()\r\n {\r\n $this -> _helper -> layout -> disableLayout();\r\n $this -> _helper -> viewRenderer -> setNoRender(true);\r\n\r\n if (!$this -> _helper -> requireAuth() -> setAuthParams('ynvideochannel_playlist', null, 'create') -> isValid())\r\n return;\r\n //get viewer\r\n $viewer = Engine_Api::_() -> user() -> getViewer();\r\n //get params\r\n $params = $this ->_getAllParams();\r\n $params['owner_id'] = $viewer -> getIdentity();\r\n $params['owner_type'] = 'user';\r\n $params['title'] = strip_tags($params['title']);\r\n $video_id = $this ->_getParam('video_id');\r\n $db = Engine_Db_Table::getDefaultAdapter();\r\n $db->beginTransaction();\r\n try\r\n {\r\n //create playlists\r\n $playlistTable = Engine_Api::_() -> getItemTable('ynvideochannel_playlist');\r\n $playlist = $playlistTable -> createRow();\r\n $playlist = $playlist -> setFromArray($params);\r\n $playlist -> video_count = 1;\r\n $playlist -> save();\r\n\r\n //add activity\r\n $activityApi = Engine_Api::_()->getDbtable('actions', 'activity');\r\n $action = $activityApi->addActivity($viewer, $playlist, 'ynvideochannel_playlist_new');\r\n if($action) {\r\n $activityApi->attachActivity($action, $playlist);\r\n }\r\n\r\n //set auth\r\n $roles = array(\r\n 'owner',\r\n 'owner_member',\r\n 'owner_member_member',\r\n 'owner_network',\r\n 'registered',\r\n 'everyone'\r\n );\r\n $auth = Engine_Api::_() -> authorization() -> context;\r\n if (empty($params['auth_view']))\r\n {\r\n $params['auth_view'] = 'everyone';\r\n }\r\n\r\n if (empty($params['auth_comment']))\r\n {\r\n $params['auth_comment'] = 'everyone';\r\n }\r\n $viewMax = array_search($params['auth_view'], $roles);\r\n $commentMax = array_search($params['auth_comment'], $roles);\r\n foreach ($roles as $i => $role)\r\n {\r\n $auth -> setAllowed($playlist, $role, 'view', ($i <= $viewMax));\r\n $auth -> setAllowed($playlist, $role, 'comment', ($i <= $commentMax));\r\n }\r\n\r\n if (Engine_Api::_() -> hasModuleBootstrap(\"yncredit\")) {\r\n Engine_Api::_()->yncredit()-> hookCustomEarnCredits($viewer, $playlist -> getTitle(), 'ynvideochannel_playlist', $playlist);\r\n }\r\n\r\n //add playlist videos\r\n $playlistVideoTable = Engine_Api::_() -> getDbTable('playlistvideos', 'ynvideochannel');\r\n $mapRow = $playlistVideoTable -> createRow();\r\n $mapRow -> playlist_id = $playlist -> getIdentity();\r\n $mapRow -> video_id = $video_id;\r\n $mapRow -> creation_date = date('Y-m-d H:i:s');\r\n $mapRow -> video_order = 999;\r\n $mapRow -> save();\r\n $db -> commit();\r\n\r\n echo Zend_Json::encode(array('json' => 'true'));\r\n return true;\r\n }\r\n catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "function getPlaylistInfo() {\n\t\t$db = JFactory::getDBO(); \n\t\t$query = $db->getQuery(true);\n\t\t$id = JRequest::getInt('id');\n //let us load the informations from the son db\n $query->select('a.*');\n $query->from('#__vombiemusic_playlist AS a');\n $query->where('a.id = \"'.(int) $id.'\"');\n $db->setQuery( $query );\n $rows = $db->loadAssoc();\n\n\t\tif (empty($rows)) {\n\t\t\treturn JError::raiseError(404,JText::_('COM_VOMBIEMUSIC_PLAYLIST_NOT_FOUND'));\n\t\t}\n\n\t\treturn $rows;\n\t}", "function initialPlayer() {\n $videoid = 0;\n $db = JFactory::getDBO();\n if (JRequest::getvar('id', '', 'get', 'int') || JRequest::getVar('video', '', 'get', 'int')) {\n if (JRequest::getVar('video', '', 'get', 'int')) {\n $videoid = JRequest::getVar('video', '', 'get', 'int');\n } else {\n $videoid = JRequest::getvar('id', '', 'get', 'int');\n }\n if ($videoid != \"\") {\n $query = \"SELECT DISTINCT a.*,b.category FROM #__hdflv_upload a \n LEFT JOIN #__hdflv_category b ON a.playlistid=b.id OR a.playlistid=b.parent_id \n WHERE a.published='1' AND a.id=$videoid \";\n $db->setQuery($query);\n $rowsVal = $db->loadAssoc();\n }\n } elseif (JRequest::getVar('video', '', 'get', 'string')) {\n $video_string = JRequest::getVar('video', '', 'get', 'string');\n $video = str_replace(':', '-', $video_string);\n $query = 'SELECT DISTINCT a.*,b.category FROM #__hdflv_upload a \n LEFT JOIN #__hdflv_category b ON a.playlistid=b.id OR a.playlistid=b.parent_id \n WHERE a.published=\"1\" AND seotitle=\"' . $video . '\"';\n $db->setQuery($query);\n $rowsVal = $db->loadAssoc();\n } else {\n $query = \"SELECT a.*,b.category,d.username,e.* FROM #__hdflv_upload a \n LEFT JOIN #__users d ON a.memberid=d.id \n LEFT JOIN #__hdflv_video_category e ON e.vid=a.id \n LEFT JOIN #__hdflv_category b ON e.catid=b.id \n WHERE a.published='1' AND a.featured='1' AND a.type='0' \n GROUP BY e.vid ORDER BY a.ordering ASC\"; ## Query is to display recent videos in home page\n $db->setQuery($query);\n $rowsVal = $db->loadAssoc();\n if (count($rowsVal) == 0) {\n $query = \"SELECT a.*,b.category,d.username,e.* FROM #__hdflv_upload a \n LEFT JOIN #__users d ON a.memberid=d.id \n LEFT JOIN #__hdflv_video_category e ON e.vid=a.id \n LEFT JOIN #__hdflv_category b ON e.catid=b.id \n WHERE a.published='1' AND b.published='1' AND a.type='0' \n GROUP BY e.vid ORDER BY a.ordering ASC LIMIT 0,1\"; ## Query is to display recent videos in home page\n $db->setQuery($query);\n $rowsVal = $db->loadAssoc();\n }\n }\n return $rowsVal;\n }", "function getRunningPlaylist() {\n\n\tglobal $sequenceDirectory;\n\t$playlistName = null;\n\t$i=0;\n\t//can we sleep here????\n\n\t//sleep(10);\n\t//FPPD is running and we shoud expect something back from it with the -s status query\n\t// #,#,#,Playlist name\n\t// #,1,# = running\n\n\t$currentFPP = file_get_contents(\"/tmp/FPP.playlist\");\n\tlogEntry(\"Reading /tmp/FPP.playlist : \".$currentFPP);\n\tif($currentFPP == \"false\") {\n\t\tlogEntry(\"We got a FALSE status from fpp -s status file.. we should not really get this, the daemon is locked??\");\n\t}\n\t$fppParts=\"\";\n\t$fppParts = explode(\",\",$currentFPP);\n//\tlogEntry(\"FPP Parts 1 = \".$fppParts[1]);\n\n\t//check to see the second variable is 1 - meaning playing\n\tif($fppParts[1] == 1 || $fppParts[1] == \"1\") {\n\t\t//we are playing\n\n\t\t$playlistParts = pathinfo($fppParts[3]);\n\t\t$playlistName = $playlistParts['basename'];\n\t\tlogEntry(\"We are playing a playlist...: \".$playlistName);\n\t\t\n\t} else {\n\n\t\tlogEntry(\"FPPD Daemon is starting up or no active playlist.. please try again\");\n\t}\n\t\n\t\n\t//now we should have had something\n\treturn $playlistName;\n}", "function getRunningPlaylist() {\n\n\tglobal $sequenceDirectory;\n\t$playlistName = null;\n\t$i=0;\n\t//can we sleep here????\n\n\t//sleep(10);\n\t//FPPD is running and we shoud expect something back from it with the -s status query\n\t// #,#,#,Playlist name\n\t// #,1,# = running\n\n\t$currentFPP = file_get_contents(\"/tmp/FPP.playlist\");\n\tlogEntry(\"Reading /tmp/FPP.playlist : \".$currentFPP);\n\tif($currentFPP == \"false\") {\n\t\tlogEntry(\"We got a FALSE status from fpp -s status file.. we should not really get this, the daemon is locked??\");\n\t}\n\t$fppParts=\"\";\n\t$fppParts = explode(\",\",$currentFPP);\n//\tlogEntry(\"FPP Parts 1 = \".$fppParts[1]);\n\n\t//check to see the second variable is 1 - meaning playing\n\tif($fppParts[1] == 1 || $fppParts[1] == \"1\") {\n\t\t//we are playing\n\n\t\t$playlistParts = pathinfo($fppParts[3]);\n\t\t$playlistName = $playlistParts['basename'];\n\t\tlogEntry(\"We are playing a playlist...: \".$playlistName);\n\t\t\n\t} else {\n\n\t\tlogEntry(\"FPPD Daemon is starting up or no active playlist.. please try again\");\n\t}\n\t\n\t\n\t//now we should have had something\n\treturn $playlistName;\n}", "function getRunningPlaylist() {\n\n\tglobal $sequenceDirectory;\n\t$playlistName = null;\n\t$i=0;\n\t//can we sleep here????\n\n\t//sleep(10);\n\t//FPPD is running and we shoud expect something back from it with the -s status query\n\t// #,#,#,Playlist name\n\t// #,1,# = running\n\n\t$currentFPP = file_get_contents(\"/tmp/FPP.playlist\");\n\tlogEntry(\"Reading /tmp/FPP.playlist : \".$currentFPP);\n\tif($currentFPP == \"false\") {\n\t\tlogEntry(\"We got a FALSE status from fpp -s status file.. we should not really get this, the daemon is locked??\");\n\t}\n\t$fppParts=\"\";\n\t$fppParts = explode(\",\",$currentFPP);\n//\tlogEntry(\"FPP Parts 1 = \".$fppParts[1]);\n\n\t//check to see the second variable is 1 - meaning playing\n\tif($fppParts[1] == 1 || $fppParts[1] == \"1\") {\n\t\t//we are playing\n\n\t\t$playlistParts = pathinfo($fppParts[3]);\n\t\t$playlistName = $playlistParts['basename'];\n\t\tlogEntry(\"We are playing a playlist...: \".$playlistName);\n\t\t\n\t} else {\n\n\t\tlogEntry(\"FPPD Daemon is starting up or no active playlist.. please try again\");\n\t}\n\t\n\t\n\t//now we should have had something\n\treturn $playlistName;\n}", "public function ajax(){\n ?>\n <ul class=\"options\">\n <?php\n if(empty($_SESSION['username'])){\n echo \"<li><h4><a href = 'http://localhost/PHP-Music-App/profile/signin'>Sign In To add Songs to Playlist</a></h4></li>\"; \n } else{\n $result = $this->playListModel->getPlayList();\n foreach($result as $val){\n echo \"<li class='values' id={$val->playlist_id}><h4>{$val->name}</h4></li>\";\n }\n }\n ?>\n </ul>\n <?php\n }", "function lbg_audio8_html5_shoutcast_player_manage_players_page()\r\n{\r\n\tglobal $wpdb;\r\n\tglobal $lbg_audio8_html5_shoutcast_messages;\r\n\tglobal $lbg_audio8_html5_shoutcast_path;\r\n\r\n\t//delete player\r\n\tif (isset($_GET['id'])) {\r\n\t\t//delete from wp_lbg_audio8_html5_shoutcast_players\r\n\t\t$wpdb->query($wpdb->prepare(\"DELETE FROM \".$wpdb->prefix.\"lbg_audio8_html5_shoutcast_players WHERE id = %d\",$_GET['id']));\r\n\r\n\t\t//delete from wp_lbg_audio8_html5_shoutcast_settings\r\n\t\t$wpdb->query($wpdb->prepare(\"DELETE FROM \".$wpdb->prefix.\"lbg_audio8_html5_shoutcast_settings WHERE id = %d\",$_GET['id']));\r\n\r\n\t\t//delete from wp_lbg_audio8_html5_shoutcast_playlist\r\n\t\t$wpdb->query($wpdb->prepare(\"DELETE FROM \".$wpdb->prefix.\"lbg_audio8_html5_shoutcast_playlist WHERE playerid = %d\",$_GET['id']));\r\n\r\n\t\t//initialize the session\r\n\t\t$safe_sql=\"SELECT * FROM (\".$wpdb->prefix .\"lbg_audio8_html5_shoutcast_players) ORDER BY id\";\r\n\t\t$row = $wpdb->get_row($safe_sql,ARRAY_A);\r\n\t\t$row=lbg_audio8_html5_shoutcast_unstrip_array($row);\r\n\t\tif ($row['id']) {\r\n\t\t\t$_SESSION['xid']=$row['id'];\r\n\t\t\t$_SESSION['xname']=$row['name'];\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t$safe_sql=\"SELECT * FROM (\".$wpdb->prefix .\"lbg_audio8_html5_shoutcast_players) ORDER BY id\";\r\n\t$result = $wpdb->get_results($safe_sql,ARRAY_A);\r\n\t//echo $wpdb->last_query;\r\n\tinclude_once($lbg_audio8_html5_shoutcast_path . 'tpl/players.php');\r\n\r\n}", "public function addHead()\n\t{\n\t\tJHtml::_('bootstrap.framework');\n $doc = JFactory::getDocument();\n\t\t//$doc->addStyleSheet(JURI::root() . 'modules/mod_hwd_soundcloud_jplayer/css/jplayer.css'); \n\t\t$doc->addscript(JURI::root() . 'modules/mod_hwd_soundcloud_jplayer/js/jquery.jplayer.min.js'); \n\t\t$doc->addscript(JURI::root() . 'modules/mod_hwd_soundcloud_jplayer/js/jplayer.playlist.js'); \n\n // Extract the layout.\n list($template, $layout) = explode(':', $this->params->get('layout', '_:default'));\n if (file_exists(__DIR__ . '/css/' . $layout . '.css'))\n {\n $doc->addStyleSheet(JURI::base( true ) . '/modules/mod_hwd_soundcloud_jplayer/css/' . $layout . '.css');\n }\n if (file_exists(__DIR__ . '/js/' . $layout . '.js'))\n {\n $doc->addScript(JURI::base( true ) . '/modules/mod_hwd_soundcloud_jplayer/js/' . $layout . '.js');\n }\n \n // Load caching.\n $cache = JFactory::getCache('mod_hwd_soundcloud_jplayer');\n $cache->setLifeTime($this->params->get('methodcache', 43829));\n $cache->setCaching(1); \n $listUrl = $cache->call(array($this, 'resolveUrl'), $this->params);\n //$listUrl = $this->resolveUrl();\n\n ob_start();\n?>\njQuery(document).ready(function(){\n \n $clientID = \"<?php echo $this->client_id; ?>\",\n $listurl = \"<?php echo $listUrl; ?>\",\n\n $i = 0,\n tracks = new Array(),\n trackdata = new Array(),\n playlist = new Array();\n\n // Get the JSON object (the playlist)\n jQuery.ajax({\n url: $listurl,\n async: false,\n dataType: 'json',\n success: function(listdata) {\n // Iterate through the object and create array of tracks\n if(listdata.hasOwnProperty(tracks)){\n // Playlist\n jQuery.each(listdata.tracks, function(key, val) {\n tracks[$i] = val;\n $i++; \n });\n // Other kinds (users, etc) will return tracks directly.\n } else {\n if(\"kind\" in listdata){\n // Track\n tracks[$i] = listdata;\n $i++; \n } else {\n // User, Group\n jQuery.each(listdata, function(key, val) {\n if(\"kind\" in val){\n if (val.kind == 'track') {\n tracks[$i] = val;\n $i++; \n }\n } \n });\n }\n }\n\n // Now, for each of the tracks, save the necessary track info formatted as options for jPlayerPlaylist, all in another array \n for (var i = 0; i < tracks.length; i++) {\n trackdata[i] = {\n title: tracks[i].title,\n mp3: tracks[i].stream_url + '?client_id=' + $clientID,\n url: tracks[i].permalink_url,\n free: true\n }\n }\n\n // Next, stack all these arrays into one array for use in the jPlayer playlist \n for (i = 0; i < trackdata.length; i++) {\n playlist.push(trackdata[i]);\n }\n }\n });\n\n \n // Instantiate the jPlayer playlist object, using the Soundcloud playlist array \n new jPlayerPlaylist({\n jPlayer: \"#jquery_jplayer_<?php echo $this->pid; ?>\",\n cssSelectorAncestor: \"#jp_container_<?php echo $this->pid; ?>\"\n },\n playlist, {\n playlistOptions: {\n autoPlay: false,\n displayTime: 0,\n freeItemClass: 'soundcloudLink'\n },\n loop: true, // For restarting the playlist after the last track\n swfPath: \"../js\",\n supplied: \"mp3, m4a, oga\",\n smoothPlayBar: true,\n keyEnabled: true,\n errorAlerts: false,\n warningAlerts: false\n });\n});\n<?php\n$script = ob_get_contents();\nob_end_clean();\n\n $doc->addScriptDeclaration($script); \n\t}", "public function playlist_post()\n {\n }", "function resetPlaylist() {\n\n}", "public function createAction() {\n\n //Checking for \"Playlist\" is enabled for this site\n if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('sitevideo.playlist.allow', 1))\n return $this->_forwardCustom('requireauth', 'error', 'core');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer->getIdentity())\n return $this->_forwardCustom('requireauth', 'error', 'core');\n\n $this->_helper->content\n //->setNoRender()\n ->setEnabled();\n $this->view->form = $form = new Sitevideo_Form_Playlist_Create();\n if (!$this->getRequest()->isPost()) {\n return;\n }\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n $sitevideoPlaylist = Zend_Registry::isRegistered('sitevideoPlaylist') ? Zend_Registry::get('sitevideoPlaylist') : null;\n if (empty($sitevideoPlaylist))\n return;\n\n $values = $form->getValues();\n $values['owner_id'] = $viewer->getIdentity();\n $values['owner_type'] = $viewer->getType();\n\n //validation for uniqueness of playlist title , userwise \n //started\n $validate = new Zend_Validate_Db_RecordExists(array('table' => Engine_Db_Table::getTablePrefix() . 'sitevideo_playlists',\n 'field' => 'title'));\n $validate->getSelect()->where('owner_id = ?', $values['owner_id']);\n $validate->getSelect()->where('owner_type = ?', 'user');\n $result = $validate->isValid($values['title']);\n if ($result) {\n $form->getElement('title')->setErrors(array('This title already exists'));\n return;\n }\n //validation for uniqueness of playlist title , userwise \n //ended\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n $playlist = Engine_Api::_()->getDbtable('playlists', 'sitevideo')->createRow();\n $playlist->setFromArray($values);\n $playlist->save();\n\n //Playlist thumbnail insertion\n //Started\n $photo = $form->getValue('photo');\n if (!empty($photo)) {\n $playlist->setPhoto($form->photo);\n }\n //Playlist thumbnail insertion\n //Ended\n $db->commit();\n } catch (Exception $ex) {\n \n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'manage', 'tab' => 'playlist'), 'sitevideo_video_general', true);\n }", "private function featuredPage(){\r\n $topPlaylistsObject = $this->getDeezerChartPlaylists();\r\n $data = $topPlaylistsObject[\"data\"];\r\n\r\n //database\r\n $db = Database::instance(); \r\n $db->setZeroRankings(\"featured_song\"); \r\n\r\n //songsArray\r\n $songsArray = array();\r\n\r\n //for each song\r\n for($i = 0; $i < count($data); $i++){\r\n $topPlaylist = $data[$i];\r\n\r\n $playlistTracksURL = \"https://api.deezer.com/playlist/\" . $topPlaylist[\"id\"];\r\n $tracksObject = $this->getPlaylistTracks($playlistTracksURL);\r\n $trackArray = $tracksObject[\"tracks\"][\"data\"];\r\n $currentTrack = $trackArray[floor(count($trackArray)/5)];\r\n\r\n $track = new stdClass();\r\n $track->id = $currentTrack[\"id\"];\r\n\r\n //check for duplicates\r\n $x = 0;\r\n\r\n while(true){\r\n $duplicate = false;\r\n\r\n for($j = 0; $j < count($songsArray); $j++){\r\n if(strcmp(array_column($songsArray, \"id\")[$j], $track->id) === 0){\r\n $duplicate = true;\r\n break;\r\n }\r\n }\r\n\r\n if($duplicate){\r\n if($x === count($trackArray) - 1){\r\n break;\r\n }\r\n\r\n $currentTrack = $trackArray[$x++];\r\n $track->id = $currentTrack[\"id\"];\r\n }\r\n else{\r\n break;\r\n }\r\n }\r\n\r\n if($db->getSong(\"featured_song\", $track->id) === null){\r\n $track->title = $currentTrack[\"title\"];\r\n $track->artist = $currentTrack[\"artist\"][\"name\"];\r\n \r\n $albumID = $currentTrack[\"album\"][\"id\"];\r\n \r\n //get the album info\r\n $albumObject = $this->getDeezerAlbumObject($albumID);\r\n\r\n if(!isset($albumObject[\"error\"])){\r\n $track->genre = \"\";\r\n\r\n $genreArray = $albumObject[\"genres\"][\"data\"];\r\n\r\n if(count($genreArray) == 1){\r\n $track->genre = $genreArray[0][\"name\"];\r\n }\r\n else{\r\n for($a = 0; $a < count($genreArray) - 1; $a++){\r\n $track->genre .= $genreArray[$a][\"name\"].\", \";\r\n }\r\n\r\n $track->genre .= $genreArray[count($genreArray)-1][\"name\"];\r\n }\r\n\r\n $track->releaseDate = $albumObject[\"release_date\"];\r\n }\r\n \r\n $duration = $currentTrack[\"duration\"];\r\n $minutes = floor($duration/60);\r\n $seconds = $duration % 6;\r\n\r\n $track->duration = $minutes.\":\";\r\n\r\n if($seconds < 10){\r\n $track->duration .= \"0\";\r\n }\r\n\r\n $track->duration .= $seconds;\r\n \r\n //images\r\n $artistID = $currentTrack[\"artist\"][\"id\"];\r\n $artistObject = $this->getDeezerArtistObject($artistID);\r\n\r\n //images\r\n if(!isset($artistObject[\"picture_big\"])){\r\n $track->artistImageURL = \"images/notAvailable.jpg\";\r\n }\r\n else{\r\n $track->artistImageURL = $artistObject[\"picture_big\"];\r\n }\r\n\r\n if(!isset($currentTrack[\"album\"][\"cover_big\"])){\r\n $track->albumImageURL = \"images/notAvailable.jpg\";\r\n }\r\n else{\r\n $track->albumImageURL = $currentTrack[\"album\"][\"cover_big\"];\r\n } \r\n \r\n $track->preview = $currentTrack[\"preview\"];\r\n \r\n //P4 T4\r\n $track->album = $albumObject[\"title\"];//\r\n\r\n //insert into the featured_song table\r\n $db->addFeaturedSong($track);\r\n }//else\r\n\r\n //set the ranking\r\n $db->setRanking(\"featured_song\", $track->id, $i+1);\r\n\r\n $song = $db->getSong(\"featured_song\", $track->id);\r\n array_push($songsArray, $song);\r\n }//for each song\r\n\r\n //delete all of the zero ranks\r\n $db->deleteZeroRanks(\"featured_song\");\r\n\r\n return $songsArray;\r\n }", "private function getPlaylist ( $pid )\r\n {\r\n if ( !isset($id) )\r\n {\r\n throw new IllegalArgumentException('Must provide a valid playlist ID');\r\n }\r\n\r\n // try find the playlist\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$playlists = $this->yt->getPlaylistListFeed('default');\r\n\t\t\tforeach ( $playlists as $id => $playlist )\r\n\t\t\t{\r\n\t\t\t\tif ( $playlist->getPlaylistId() == $pid )\r\n\t\t\t\t{\r\n\t\t\t\t\treturn $playlist;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch ( Exception $e )\r\n\t\t{\r\n\t\t\techo __LINE__, ': ', $e;\r\n }\r\n\r\n return FALSE;\r\n\t}", "function get_PlayListItems($channelID,$Playlistid){\n\n$isCompletedSuccesfully=\"false\";\n\n\n// connection \n$connection=getDbConnection();\n\n$stamt=$connection->prepare(\"insert into youtubeApiData Values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\");\n\n$stamt2=$connection->prepare(\"update PlayListIds set nextToken=? where channelid=? and playlistid=?\");\n\n\n$youtube=returnYoutubeClientProfileObject();\n\n\n\n// getting all playlist items result by playlist id\n$playlistitems=$youtube->playlistItems->listPlaylistItems('snippet',array(\n\n\n'playlistId'=>$Playlistid,\n\n\n\t));\n\n$counter=1;\n$masterArray=array();\n\n// looping through the result to obtain info\nforeach ($playlistitems as $playitem) {\n\t\n$localArray=array();\n\n\techo \"fetch first page result \".PHP_EOL;\n \n $etag =\t$playitem['etag'];\n\n $id =\t$playitem['id'];\n\n\t\t\t\t$Publish \t =\t$playitem['snippet']['publishedAt'];\n\n\n\t\t\t\t$chanid \t =\t$playitem['snippet']['channelId'];\n\n\t\t\t\t$title =\t$playitem['snippet']['title'];\n\n\t\t\t\t$description =\t$playitem['snippet']['description'];\n\n\n\t\t\t\t$defaulturl =\t$playitem['snippet']['thumbnails']['default']['url'];\n\n\t\t\t\t$mediumurl =\t$playitem['snippet']['thumbnails']['medium']['url'];\n\t\t\t\t$highurl =\t$playitem['snippet']['thumbnails']['high']['url'];\n\n\t\t\t\tif(trim($playitem['snippet']['thumbnails']['standard']['url'])==\"\")\n\t\t\t\t $standardurl =\"NA\";\n\t\t\t\t$standardurl =\t$playitem['snippet']['thumbnails']['standard']['url'];\n\n\t\t\t\t$chanTitle =\t$playitem['snippet']['channelTitle'];\n\n $returnedArray=get_Video_details_OR_Meta_data($playitem['snippet']['resourceId']['videoId']);\n\n \n\n\n\t\t\t $tags \t\t =\t$returnedArray['ttag'];\n\t\t\t $CatogryId \t =\t$returnedArray['CcatogryId'];\n\t\t $dlang \t\t =\t$returnedArray['DdefulatLanguage'];\n\t\t\t $duration\t =\t$returnedArray['Vduration'];\n\t\t\t $VviewCount =\t$returnedArray['VviewCount'];\n\t\t\t $likecount \t =\t$returnedArray['VlikeCount'];\n\t\t\t $dislike \t =\t$returnedArray['VdislikeCount'];\n\t\t\t $comment \t =\t$returnedArray['VcommentCount'];\n\n$VID=$playitem['snippet']['resourceId']['videoId'];\n\n$stamt->bind_param(\"ssssssssssssissiiiis\",$etag,$id,$Publish,$chanid,$title,$description,$defaulturl,$mediumurl,$highurl,$standardurl,$chanTitle,$tags,$CatogryId,$dlang,$duration,$VviewCount,$likecount,$dislike,$comment,$VID);\n\n\n\n\n$stamt->execute();\n\n\necho \"executing error is \".$stamt->error.PHP_EOL;\n\nif($stamt->execute()===false){\n\nreturn;\n\n}\n\n\n\n\n\n$counter+=1;\n}\n// check to see if nextpage is given,if yes then continue until nextpage=null\n\n$nexttoken=$playlistitems['nextPageToken'];\n\n\nif($nexttoken===NULL){\n\t$isCompletedSuccesfully=\"true\";\n\t$NULL=null;\n\t$stamt2->bind_param(\"sss\",$NULL,$channelID,$Playlistid);\n\t$stamt2->execute();\n}\n\n\nwhile($nexttoken!=NULL){\n\n$stamt2->bind_param(\"sss\",$nexttoken,$channelID,$Playlistid);\n\t$stamt2->execute();\n\n$isCompletedSuccesfully=\"flase\";\necho \"nextPageToken is: \".$nexttoken.PHP_EOL;\nsleep(0.0000000000000000000002);\n\n\n// getting information of the nextToken page \n$nextPageResults=$youtube->playlistItems->listPlaylistItems('snippet',array(\n\n 'playlistId'=>$Playlistid,\n 'pageToken'=>$nexttoken,\n \n\t));\n\n\n\n$counter=1;\nforeach ($nextPageResults['items'] as $moreplayListitems) {\n\t\n echo \"fetched result \".$counter.PHP_EOL;\n\n \n $etag =$playitem['etag'];\n\n $id =$playitem['id'];\n\n\t\t\t\t$Publish =$playitem['snippet']['publishedAt'];\n\n\n\t\t\t\t$chanid =$playitem['snippet']['channelId'];\n\n\t\t\t\t$title =$playitem['snippet']['title'];\n\n\t\t\t\t$description=$playitem['snippet']['description'];\n\n\n\t\t\t\t$defaulturl =$playitem['snippet']['thumbnails']['default']['url'];\n\n\t\t\t\t$mediumurl =$playitem['snippet']['thumbnails']['medium']['url'];\n\n\t\t\t\t$highurl =$playitem['snippet']['thumbnails']['high']['url'];\n\n\t\t\t\tif(trim($playitem['snippet']['thumbnails']['standard']['url'])==\"\")\n\t\t\t\t $standardurl=\"NA\";\n\t\t\t\t$standardurl =$playitem['snippet']['thumbnails']['standard']['url'];\n\n\t\t\t\t$chanTitle =$playitem['snippet']['channelTitle'];\n\n \t$returnedArray=get_Video_details_OR_Meta_data($playitem['snippet']['resourceId']['videoId']);\n\n\t\t\t\t$tags \t\t=$returnedArray['ttag'];\n\t\t\t\t$CatogryId \t\t=$returnedArray['CcatogryId'];\n\t\t \t$dlang \t\t\t=$returnedArray['DdefulatLanguage'];\n\t\t\t\t$duration\t\t=$returnedArray['Vduration'];\n\t\t\t\t$VviewCount \t=$returnedArray['VviewCount'];\n\t\t\t\t$likecount \t=$returnedArray['VlikeCount'];\n\t\t\t\t$dislike \t\t=$returnedArray['VdislikeCount'];\n\t\t\t\t$comment \t\t=$returnedArray['VcommentCount'];\n\n\n$VID=$playitem['snippet']['resourceId']['videoId'];\n\n $stamt->bind_param(\"ssssssssssssissiiiis\",$etag,$id,$Publish,$chanid,$title,$description,$defaulturl,$mediumurl,$highurl,$standardurl,$chanTitle,$tags,$CatogryId,$dlang,$duration,$VviewCount,$likecount,$dislike,$comment,$VID);\n\n $stamt->execute();\n\necho \"error occured is exe\".$stamt->error.PHP_EOL;\n\nif($stamt->execute()){\n\n $nexttoken=$nextPageResults['nextPageToken'];\n\n if($nexttoken===NULL){\n $NULL=null;\n $stamt2->bind_param(\"sss\",$NULL,$channelID,$Playlistid);\n\t$stamt2->execute();\n\n }\n\n\n $counter+=1;\n\n\n}\n}\n\n$isCompletedSuccesfully=\"true\";\n\n}\n\n\n\n$stamt->close();\n$stamt2->close();\n$connection->close();\n\nreturn $isCompletedSuccesfully;\n\n}", "public function load() {\n\t\t$this->_sid = $_SESSION ['info'] ['sid'];\n\t\t$this->_ip = $_SESSION ['info'] ['ip'];\n\t\t$this->_datetime = $_SESSION ['info'] ['datetime'];\n\t\t$this->_data = $_SESSION ['info'] ['data'];\n\t}", "function createplaylist() {\n\tglobal $db;\n $playlisttitle=\"\";\n if (isset($_REQUEST['playlisttitle'] )) {\n $playlisttitle=$_REQUEST['playlisttitle'] ;\n } else {\n echo \"No playlist name given\";\n return;\n }\n \t# Insert main playlist a new playlist\n\t#--------------------------\n\n $result = mysqli_query($db, \"SELECT id FROM playlists WHERE title LIKE \\\"\".$playlisttitle.\"\\\"\");\n if ($thisrow = mysqli_fetch_array($result) ) {\n\t echo \"The command to create a new playlist <I>\\\"$playlisttitle\\\"</I> was successful.<BR>Click <A onclick=\\\"jumpTo('playlist','showpl','playlistId=\".$thisrow['id'].\"')\\\">here</A> to view the playlist.\";\n } else {\n\t $result = mysqli_query($db, \"select max(id) + 1 as next from playlists\");\n\t $nextid = mysqli_fetch_array($result);\n\t $nextid = $nextid['next'];\n\t mysqli_query($db, \"insert into playlists (id, title, ref) values('$nextid', '$playlisttitle','')\");\n\n\t echo \"The command to create a new playlist <I>\\\"$playlisttitle\\\"</I> was successful.<BR>Click <A onclick=\\\"jumpTo('playlist','showpl','playlistId=$nextid')\\\">here</A> to view the playlist\";\n }\n\n\n\t}", "public function create($aData)\n\t{\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\tif (!$viewer || !Engine_Api::_() -> authorization() -> isAllowed('music_playlist', null, 'create'))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"You are not allowed to upload songs.\")\n\t\t\t);\n\t\t}\n\t\t$playlistTable = Engine_Api::_() -> getDbTable('playlists', 'music');\n\t\t//get data\n\t\t$playlist_id = isset($aData['iAlbumId']) ? (int)$aData['iAlbumId'] : 0;\n\t\t$type = isset($aData['sType']) ? $aData['sType'] : false;\n\t\t$playlist_title = isset($aData['sNewAlbumTitle']) ? $aData['sNewAlbumTitle'] : '';\n\t\t$song_title = isset($aData['sTitle']) ? $aData['sTitle'] : '';\n\t\t$privacy_view = isset($aData['sPrivacyView']) ? $aData['sPrivacyView'] : 'everyone';\n\t\t$privacy_comment = isset($aData['sPrivacyComment']) ? $aData['sPrivacyComment'] : 'everyone';\n\t\t$playlist = null;\n\t\t// Get special playlist\n\t\tif (!$playlist_id && false != $type)\n\t\t{\n\t\t\t$playlist = $playlistTable -> getSpecialPlaylist($viewer, $type);\n\t\t}\n\t\telseif ($playlist_id)\n\t\t{\n\t\t\t$playlist = Engine_Api::_() -> getItem(\"music_playlist\", $playlist_id);\n\t\t}\n\t\telseif (!$playlist_id && !$type)\n\t\t{\n\t\t\t$playlist = $playlistTable -> createRow();\n\t\t}\n\n\t\t// Check subject\n\t\tif (!$playlist)\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Invalid playlist\")\n\t\t\t);\n\t\t}\n\n\t\t// check auth\n\t\tif ($playlist_id && !Engine_Api::_() -> authorization() -> isAllowed($playlist, null, 'edit'))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"You are not allowed to edit this playlist\")\n\t\t\t);\n\t\t}\n\n\t\t// Check file\n\t\tif (empty($_FILES['mp3']))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"No file\")\n\t\t\t);\n\t\t}\n\n\t\t// Process\n\t\t$db = $playlistTable -> getAdapter();\n\t\t$db -> beginTransaction();\n\t\ttry\n\t\t{\n\t\t\t// Create song\n\t\t\t$file = Engine_Api::_() -> getWorkingApi('core', 'music') -> createSong($_FILES['mp3']);\n\t\t\tif (!$file)\n\t\t\t{\n\t\t\t\treturn array(\n\t\t\t\t\t'error_code' => 1,\n\t\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Song was not successfully attached\")\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Add song\n\t\t\t$song = $playlist -> addSong($file);\n\t\t\tif (!$song)\n\t\t\t{\n\t\t\t\treturn array(\n\t\t\t\t\t'error_code' => 1,\n\t\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Song was not successfully attached\")\n\t\t\t\t);\n\t\t\t}\n\t\t\t//update playlist info\n\t\t\tif (isset($aData['iSearch']))\n\t\t\t{\n\t\t\t\t$playlist -> search = (int)$aData['iSearch'];\n\t\t\t}\n\t\t\tif (isset($aData['sNewAlbumTitle']))\n\t\t\t{\n\t\t\t\t$playlist -> title = htmlspecialchars(trim($playlist_title), ENT_QUOTES, 'UTF-8');\n\t\t\t}\n\t\t\tif (isset($aData['sDescription']))\n\t\t\t{\n\t\t\t\t$playlist -> description = trim($values['sDescription']);\n\t\t\t}\n\t\t\t$playlist -> owner_type = 'user';\n\t\t\t$playlist -> owner_id = $viewer -> getIdentity();\n\t\t\t$playlist -> save();\n\t\t\t// Only create activity feed item if \"search\" is checked and add new\n\t\t\tif (!$playlist_id && !$type && $playlist -> search)\n\t\t\t{\n\t\t\t\t// Only create activity feed item if \"search\" is checked\n\t\t\t\t$activity = Engine_Api::_() -> getDbtable('actions', 'activity');\n\t\t\t\t$action = $activity -> addActivity($viewer, $playlist, 'music_playlist_new', null, array('count' => 1));\n\t\t\t\tif (null !== $action)\n\t\t\t\t\t$activity -> attachActivity($action, $playlist);\n\t\t\t}\n\t\t\tif (isset($aData['sPrivacyView']) || isset($aData['sPrivacyComment']))\n\t\t\t{\n\t\t\t\t// Authorizations\n\t\t\t\t$auth = Engine_Api::_() -> authorization() -> context;\n\t\t\t\t$prev_allow_comment = $prev_allow_view = false;\n\t\t\t\t$roles = array(\n\t\t\t\t\t'everyone' => 'Everyone',\n\t\t\t\t\t'registered' => 'All Registered Members',\n\t\t\t\t\t'owner_network' => 'Friends and Networks',\n\t\t\t\t\t'owner_member_member' => 'Friends of Friends',\n\t\t\t\t\t'owner_member' => 'Friends Only',\n\t\t\t\t\t'owner' => 'Just Me'\n\t\t\t\t);\n\n\t\t\t\tforeach ($roles as $role => $role_label)\n\t\t\t\t{\n\t\t\t\t\tif (isset($aData['sPrivacyView']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// allow viewers\n\t\t\t\t\t\tif ($privacy_view == $role || $prev_allow_view)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$auth -> setAllowed($playlist, $role, 'view', true);\n\t\t\t\t\t\t\t$prev_allow_view = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$auth -> setAllowed($playlist, $role, 'view', 0);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($aData['sPrivacyComment']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// allow comments\n\t\t\t\t\t\tif ($privacy_comment == $role || $prev_allow_comment)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$auth -> setAllowed($playlist, $role, 'comment', true);\n\t\t\t\t\t\t\t$prev_allow_comment = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$auth -> setAllowed($playlist, $role, 'comment', 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Rebuild privacy\n\t\t\t$actionTable = Engine_Api::_() -> getDbtable('actions', 'activity');\n\t\t\tforeach ($actionTable->getActionsByObject($playlist) as $action)\n\t\t\t{\n\t\t\t\t$actionTable -> resetActivityBindings($action);\n\t\t\t}\n\t\t\tif ($song_title)\n\t\t\t{\n\t\t\t\t$song -> title = $song_title;\n\t\t\t}\n\t\t\t$song -> save();\n\n\t\t\t$db -> commit();\n\t\t\treturn array(\n\t\t\t\t'result' => 1,\n\t\t\t\t'message' => Zend_Registry::get('Zend_Translate') -> _(\"Song successfully uploaded.\"),\n\t\t\t\t'iSongId' => $song -> getIdentity(),\n\t\t\t\t'sSongTitle' => $song -> getTitle(),\n\t\t\t\t'iAlbumId' => $playlist -> getIdentity()\n\t\t\t);\n\n\t\t}\n\t\tcatch( Music_Model_Exception $e )\n\t\t{\n\t\t\t$db -> rollback();\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _($e -> getMessage())\n\t\t\t);\n\n\t\t}\n\t\tcatch( Exception $e )\n\t\t{\n\t\t\t$db -> rollback();\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _('Upload failed by database query')\n\t\t\t);\n\t\t}\n\t}", "public function getPlaylist2($count = -1) {\n\n $response = $this->client->request(\"getplaylist2\" . ($count != -1 ? (\"&cnt=\" . $count) : \"\"));\n\n if (!XMLValidator::isXMLContentValid($response)) return null;\n\n $response = simplexml_load_string($response);\n $response = json_encode($response);\n $response = json_decode($response,true);\n\n return Playlist::fromJson($response);\n }", "public function parsePlaylist($playlist): mixed\n {\n if (! $this->settings->youtubePlaylistsCategoryGroupId) {\n return false;\n }\n\n $categorySet = false;\n\n // Get all existing categories from our playlist category group\n $query = Category::find()\n ->groupId($this->settings->youtubePlaylistsCategoryGroupId)\n ->all();\n\n // For each existing category\n foreach ($query as $category) {\n // If this playlist is already one of our existing categories flag it\n if ($category->ytPlaylistId == $playlist->id) {\n $categorySet = true;\n break;\n }\n }\n\n if (!$categorySet) {\n // Create the category\n $category = new Category();\n\n $category->groupId = $this->settings->youtubePlaylistsCategoryGroupId;\n }\n\n // Always Set/Update the field values so they remain in sync\n $category->title = $playlist->snippet->title;\n\n $category->setFieldValues([\n 'ytPlaylistId' => $playlist->id,\n 'ytPlaylistDescription' => (!empty($playlist->snippet->description)) ? $playlist->snippet->description : '',\n 'ytPlaylistImageMaxRes' => (isset($playlist->snippet->thumbnails->maxres->url) ? $playlist->snippet->thumbnails->maxres->url : isset($playlist->snippet->thumbnails->standard->url)) ? $playlist->snippet->thumbnails->standard->url : $playlist->snippet->thumbnails->high->url,\n ]);\n\n // Save the category!\n if (!Craft::$app->elements->saveElement($category)) {\n Craft::error('YouTubeSync: Couldn’t save the category \"' . $category->title . '\"', __METHOD__);\n\n return false;\n }\n\n return $category;\n }", "public function getPlaylistList() {\n return $this->getSuccessJsonResponse ( [\n 'info' => [\n 'allPlaylists' => $this->repository->getAllPlaylistList (),\n ]\n ] );\n }", "public function get_music_metadata($playlist)\n {\n foreach ($playlist as $key => $track) {\n //echo $index . \"<br>\";\n // var_dump($post);\n $postId = $track->ID;\n \n $playlist[$key]->artist = get_post_meta($postId, 'artist');\n\n $playlist[$key]->musicTitle = get_post_meta($postId, 'music-title', true);\n \n $playlist[$key]->soundExcerpt = get_post_meta($postId, 'sound-excerpt', true);\n \n $playlist[$key]->albumName = get_post_meta($postId, 'album-name', true);\n \n $playlist[$key]->albumThumbnail = get_post_meta($postId, 'album-thumbnail', true);\n \n }\n\n }", "private function disp_up_seltmpl(){\r\n\r\n\t\tif($this->act === \"seltmpl\"){\r\n\t\t\tif($this->up_seltmpl()){\r\n\t\t\t\t//Store in session\r\n\t\t\t\t$this->session->set('playlist.up_post', $this->post);\r\n\t\t\t\tparent::disp_up_before();\r\n\t\t\t\t$this->disp_up();\r\n\t\t\t\tparent::disp_up_after();\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\t// Input check NG\r\n\t\t\t\t// Since the playlist_id from the previous screen disappears, return to the list screen\r\n\t\t\t\t$this->session->set($this->module_name, array(ACTION_UP => false));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t//If there is session data set as initial value\r\n\t\t\ttry{\r\n\t\t\t\t$playlist_id = $this->post[\"playlist_id\"];\r\n\t\t\t}catch(Exception $e){\r\n\t\t\t\t// Return to the list screen when the parameter is invalid\r\n\t\t\t\t$this->request->redirect($this->module_name);\r\n\t\t\t}\r\n\t\t\t$playlist = $this->model->sel_playlist($playlist_id);\r\n\t\t\tif(empty($playlist[0])){\r\n\t\t\t\t//Target absence\r\n\t\t\t\t$this->session->set($this->module_name, array(ACTION_UP => false, TARGET_NOT_FOUND_ERROR => true));\r\n\t\t\t\t$this->request->redirect($this->module_name);\r\n\t\t\t}\r\n\t\t\t$this->template->playlist_id = $playlist_id;\r\n\t\t\t$playlist = $playlist[0];\r\n\t\t\tforeach ($this->model->getPostDataKeys() as $key) $this->post[$key] = $playlist->$key;\r\n\r\n\t\t\tif($this->session->get('playlist.up_post')){\r\n\t\t\t\t$this->post = $this->session->get('playlist.up_post');\r\n\t\t\t\t$this->session->delete('playlist.up_post');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Set value to template\r\n\t\t$this->template->set_filename(\"playlist.up.seltmpl.template\");\r\n\t\t$this->template->arr_all_draw_tmpl = Controller_Template::get_arr_draw_tmpl();\r\n\t\t$this->template->arr_all_ants_version = Controller_Template::get_arr_ants_version();\r\n\r\n\t\t$this->template->arr_all_client = Controller_Template::get_arr_client();\r\n\t\t$this->template->arr_delivery_month = Controller_Template::get_arr_delivery_month();\r\n\t\t$this->template->arr_delivery_kind = Controller_Template::get_arr_delivery_kind();\r\n\t\t$this->template->arr_time_zone = Controller_Template::get_arr_time_zone();\r\n\t\t$this->template->arr_sex = Controller_Template::get_arr_sex();\r\n\r\n\t\tif (isset($playlist_id) && $playlist_id !== \"\") {\r\n\t\t\t$this->template->playlist_id = $playlist_id;\r\n\t\t\t$this->post[\"playlist_id\"] = $playlist_id;\r\n\t\t}\r\n\t}", "public function indexAction() {\r\n if (isset($_POST['params']))\r\n $params = $_POST['params'];\r\n $this->view->is_ajax = $is_ajax = isset($_POST['is_ajax']) ? true : false;\r\n $page = isset($_POST['page']) ? $_POST['page'] : 1;\r\n $this->view->identityForWidget = isset($_POST['identity']) ? $_POST['identity'] : '';\r\n if (!$is_ajax)\r\n $playlist_id = Zend_Controller_Front::getInstance()->getRequest()->getParam('playlist_id');\r\n else\r\n $playlist_id = $params['playlist_id'];\r\n $this->view->playlist = $playlist = Engine_Api::_()->getItem('sesvideo_playlist', $playlist_id);\r\n $settings = Engine_Api::_()->getApi('settings', 'core');\r\n $authorizationApi = Engine_Api::_()->authorization();\r\n //Get viewer/subject\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $this->view->viewer_id = $viewer->getIdentity();\r\n $this->view->informationPlaylist = $this->_getParam('informationPlaylist', array('editButton', 'deleteButton','viewCountPlaylist', 'postedby', 'sharePlaylist', 'watchLater', 'favouriteButtonPlaylist', 'descriptionPlaylist','favouriteCountPlaylist','featuredLabelPlaylist', 'sponsoredLabelPlaylist','likeButtonPlaylist','socialSharingPlaylist','likeCountPlaylist','reportPlaylist'));\r\n $this->view->loadOptionData = $loadOptionData = isset($params['pagging']) ? $params['pagging'] : $this->_getParam('pagging', 'auto_load');\r\n $this->view->height_list = $defaultHeightList = isset($params['height_list']) ? $params['height_list'] : $this->_getParam('height_list','160');\r\n $this->view->width_list = $defaultWidthList = isset($params['width_list']) ? $params['width_list'] : $this->_getParam('width_list','140');\r\n\t\t$this->view->height_grid = $defaultHeightGrid = isset($params['height_grid']) ? $params['height_grid'] : $this->_getParam('height_grid','160');\r\n $this->view->width_grid = $defaultWidthGrid = isset($params['width_grid']) ? $params['width_grid'] : $this->_getParam('width_grid','140');\r\n\t\t$this->view->width_pinboard = $defaultWidthPinboard = isset($params['width_pinboard']) ? $params['width_pinboard'] : $this->_getParam('width_pinboard','300');\r\n $this->view->limit_data = $limit_data = isset($params['limit_data']) ? $params['limit_data'] : $this->_getParam('limit_data', '10');\r\n $this->view->limit = ($page - 1) * $limit_data;\r\n $this->view->title_truncation_list = $title_truncation_list = isset($params['title_truncation_list']) ? $params['title_truncation_list'] : $this->_getParam('title_truncation_list', '100');\r\n $this->view->title_truncation_grid = $title_truncation_grid = isset($params['title_truncation_grid']) ? $params['title_truncation_grid'] : $this->_getParam('title_truncation_grid', '100');\r\n\t\t$this->view->title_truncation_pinboard = $title_truncation_pinboard = isset($params['title_truncation_pinboard']) ? $params['title_truncation_pinboard'] : $this->_getParam('title_truncation_pinboard', '100');\r\n $this->view->description_truncation_list = $description_truncation_list = isset($params['description_truncation_list']) ? $params['description_truncation_list'] : $this->_getParam('description_truncation_list', '100');\r\n\t\t$this->view->description_truncation_grid = $description_truncation_grid = isset($params['description_truncation_grid']) ? $params['description_truncation_grid'] : $this->_getParam('description_truncation_grid', '100');\r\n\t\t$this->view->description_truncation_pinboard = $description_truncation_pinboard = isset($params['description_truncation_pinboard']) ? $params['description_truncation_pinboard'] : $this->_getParam('description_truncation_pinboard', '100');\r\n $text = (!empty($params['text']) ? $params['text'] : (isset($_GET['text']) && ($_GET['text'] != '') ? $_GET['text'] : ''));\r\n $category = (!empty($params['category']) ? $params['category'] : (isset($_GET['category']) && intval($_GET['category']) ? $_GET['category'] : ''));\r\n $show_criterias = isset($params['show_criterias']) ? $params['show_criterias'] : $this->_getParam('show_criteria', array('like', 'comment', 'rating', 'by', 'title', 'featuredLabel', 'sponsoredLabel', 'watchLater', 'category', 'description', 'duration', 'hotLabel', 'favouriteButton', 'playlistAdd', 'likeButton', 'socialSharing', 'view'));\r\n foreach ($show_criterias as $show_criteria)\r\n $this->view->{$show_criteria . 'Active'} = $show_criteria;\r\n $this->view->view_type = $view_type = (isset($_POST['type']) ? $_POST['type'] : (isset($params['view_type']) ? $params['view_type'] : $this->_getParam('view_type', 'list')));\r\n\t\t$this->view->viewTypeStyle = $viewTypeStyle = (isset($_POST['viewTypeStyle']) ? $_POST['viewTypeStyle'] : (isset($params['viewTypeStyle']) ? $params['viewTypeStyle'] : $this->_getParam('viewTypeStyle','fixed')));\r\n if (!$is_ajax) {\r\n\t\t\t$this->view->bothViewEnable = false;\r\n $this->view->optionsEnable = $optionsEnable = $this->_getParam('enableTabs', array('list', 'grid', 'pinboard'));\r\n $view_type = $this->_getParam('openViewType', 'list');\r\n if (count($optionsEnable) > 1) {\r\n $this->view->bothViewEnable = true;\r\n }\r\n }\r\n\t\t$this->view->playlistId = $playlist_id;\r\n $params = array('height_list' => $defaultHeightList, 'width_list' => $defaultWidthList,'height_grid' => $defaultHeightGrid, 'width_grid' => $defaultWidthGrid,'width_pinboard' => $defaultWidthPinboard, 'limit_data' => $limit_data, 'pagging' => $loadOptionData, 'show_criterias' => $show_criterias, 'view_type' => $view_type, 'description_truncation_list' => $description_truncation_list, 'title_truncation_list' => $title_truncation_list, 'title_truncation_grid' => $title_truncation_grid,'title_truncation_pinboard'=>$title_truncation_pinboard,'description_truncation_grid'=>$description_truncation_grid,'description_truncation_pinboard'=>$description_truncation_pinboard,'playlist_id' => $playlist_id,'viewTypeStyle' => $viewTypeStyle);\r\n $this->view->loadMoreLink = $this->_getParam('openTab') != NULL ? true : false;\r\n $this->view->loadJs = true;\r\n // get video associated to playlist\r\n $this->view->paginator = $paginator = $playlist->getVideos(array('playlist_id' => $playlist_id, 'order' => true), true);\r\n $this->view->widgetName = 'playlist-view-page';\r\n $this->view->getVideoItem = true;\r\n // Set item count per page and current page number\r\n $paginator->setItemCountPerPage($limit_data);\r\n $this->view->page = $page;\r\n $this->view->params = $params;\r\n $paginator->setCurrentPageNumber($page);\r\n if ($is_ajax) {\r\n $this->getElement()->removeDecorator('Container');\r\n } else {\r\n\t\t\t$getmodule = Engine_Api::_()->getDbTable('modules', 'core')->getModule('core');\r\n\t\t\tif (!empty($getmodule->version) && version_compare($getmodule->version, '4.8.8') >= 0){\r\n\t\t\t\t$this->view->doctype('XHTML1_RDFA');\r\n\t\t\t\t$this->view->docActive = true;\r\n\t\t\t}\r\n // Do not render if nothing to show\r\n if ($paginator->getTotalItemCount() <= 0) {\r\n \r\n }\r\n }\r\n }", "public function getAllPlaylist() {\n\t\t$result = $this->mysqlQuery( 'SELECT * FROM playlist' );\t\t\n\t\treturn $this->fetchAll();\n\t}", "public function setPlaylist(Playlist $playlist)\n {\n // Populate data\n $this->setAuthor($playlist->getAuthor());\n $this->setTitle($playlist->getTitle());\n $this->setDescription($playlist->getDescription());\n $this->setTracks($playlist->getTracks());\n }", "private function _getVideos($html, $playlist) {\n $playlist->item_count = 0;\n\n $table = $html->find(\"#pl-video-table\", 0);\n $videos = $table->find(\"tr\");\n foreach ($videos as $video_html) {\n $video = null;\n $id_text = \"data-video-ids\";\n $yid = $video_html->find(\".addto-watch-queue-play-now,.addto-watch-later-button-sign-in\", 0)->$id_text;\n if ($yid) {\n $video = Video::where(\"yid\", $yid)->first();\n } else {\n continue;\n }\n if (!$video)\n $video = new Video();\n $video->yid = $yid;\n $video->title = trim($video_html->find(\"a.pl-video-title-link\", 0)->innertext);\n echo $video->title . '<br>';\n if ($video->title == '[Video đã xóa]') {\n continue;\n }\n try {\n $video_time = $video_html->find(\".timestamp span\", 0);\n if ($video_time) {\n $video->time = $video_time->plaintext;\n } else {\n continue;\n }\n } catch (Exception $error) {\n continue;\n }\n $video->thumb_url = \"http://i1.ytimg.com/vi/\" . $yid . \"/hqdefault.jpg\";\n\n $video->save();\n if ($video->id) {\n if (!$playlist->thumb_url)\n $playlist->thumb_url = $video->thumb_url;\n $Pl = $video->playlists()->find($playlist->id);\n if (!$Pl)\n $video->playlists()->attach($playlist->id);\n $playlist->item_count ++;\n }\n }\n\n $playlist->save();\n }", "function get_show_playlist($mysqli, $showID, $limit)\n{\n\t$keys = array(\n\t\t\"l.lb_track_name\",\n\t\t\"l.lb_artist\",\n\t\t\"l.lb_album\",\n\t\t\"l.lb_label\",\n\t\t\"l.lb_rotation\",\n\t\t\"UNIX_TIMESTAMP(l.time_played) * 1000 AS time_played\"\n\t);\n\n\t$q = \"SELECT \" . implode(\",\", $keys) . \" FROM `logbook` AS l \"\n\t\t. \"WHERE l.showID='$showID' AND l.played=1 \"\n\t\t. \"ORDER BY l.time_played DESC \"\n\t\t. \"LIMIT $limit;\";\n\t$result = exec_query($mysqli, $q);\n\n\treturn fetch_array($result);\n}", "private function kodi_playlist_id($type='audio') {\n\t\tif($this->kodi_request('Playlist.GetPlaylists')) {\n\t\t\tif($this->data->result) {\n\t\t\t\t$playlist_id = -1;\n\t\t\t\tforeach($this->data->result as $playlist) {\n\t\t\t\t\tif($playlist->type == $type) {\n\t\t\t\t\t\t$playlist_id = $playlist->playlistid;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->reset_properties();\n\t\t\t\t$this->success = TRUE;\n\t\t\t\tif($playlist_id >= 0) {\n\t\t\t\t\t$this->message = 'OK';\n\t\t\t\t} else {\n\t\t\t\t\t$this->message = 'No playlists with \"'.$type.'\" type!';\n\t\t\t\t}\n\t\t\t\t$this->data = $playlist_id;\n\t\t\t} else {\n\t\t\t\t$this->success = TRUE;\n\t\t\t\t$this->message = 'No playlists!';\n\t\t\t\t$this->data = -1;\n\t\t\t}\n\t\t}\n\t\treturn $this->success;\n\t}", "public function all(){\n if(!empty($_SESSION['username'])){\n $data = $this->playListModel->all();\n $this->view('playlist',$data, $this->script, $this->title); \n } else{\n header(\"location:\".URLROOT.\"profile/signin\");\n }\n }", "function create_playlist( $data, $output ) {\n\t$file_data = \"#EXTM3U\\n\\n#GENERATOR:NPTP\\n\\n\";\n\n\tif ( ! isset( $data->channel ) ) {\n\t\tvar_dump( $data );\n\t\tprintf( \"Wrong XML format (channel)\\n\" );\n\t\treturn;\n\t}\n\n\tforeach ( $data->channel as $row ) {\n\t\t$file_data .= sprintf( \"#EXTINF:%d,%s\\n%s\\n\\n\", 0, base64_decode( $row->title ), $row->stream_url );\n\t}\n\n\treturn file_put_contents( $output, $file_data );\n}", "function __loadFromSession()\n {\n if ($this->Session->check('ipeerSession') && $this->Session->valid('ipeerSession')) {\n $this->id = $this->Session->read('ipeerSession.id');\n $this->username = $this->Session->read('ipeerSession.username');\n $this->fullname = $this->Session->read('ipeerSession.fullname');\n $this->role = $this->Session->read('ipeerSession.role');\n $this->email = $this->Session->read('ipeerSession.email');\n $this->customIntegrateCWL = $this->Session->read('ipeerSession.customIntegrateCWL');\n $this->courseId = $this->Session->read('ipeerSession.courseId');\n } else {\n return $this->Session->error();\n }\n }", "protected function _loadFromSession()\n {\n }", "public function show(Playlist $playlist)\n {\n return response()->json(['item'=>$playlist]);\n }", "private function getSongs($aData)\n\t{\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\t$sAction = (isset($aData['sAction']) && $aData['sAction'] == 'new') ? 'new' : 'more';\n\t\t$iLastSongId = isset($aData['iLastSongId']) ? (int)$aData['iLastSongId'] : 0;\n\t\t$iLimit = isset($aData['iLimit']) ? (int)$aData['iLimit'] : 10;\n\t\t$sSearch = isset($aData['sSearch']) ? $aData['sSearch'] : '';\n\t\t$sView = isset($aData['sView']) ? $aData['sView'] : '';\n\t\t$bIsProfile = (isset($aData['bIsProfile']) && $aData['bIsProfile'] == 'true') ? true : false;\n\t\t$oUser = NULL;\n\t\tif ($bIsProfile)\n\t\t{\n\t\t\t$iProfileId = isset($aData['iProfileId']) ? (int)$aData['iProfileId'] : 0;\n\t\t\t$oUser = Engine_Api::_() -> user() -> getUser($iProfileId);\n\t\t\tif (!$oUser -> getIdentity())\n\t\t\t{\n\t\t\t\treturn array(\n\t\t\t\t\t'result' => 0,\n\t\t\t\t\t'error_code' => 1,\n\t\t\t\t\t'message'=>Zend_Registry::get('Zend_Translate') -> _(\"Profile is not valid!\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t$table = Engine_Api::_() -> getDbtable('playlistSongs', 'music');\n\t\t$song_name = $table -> info('name');\n\t\t$playlistTable = Engine_Api::_() -> getDbtable('playlists', 'music');\n\t\t$playlist_name = $playlistTable -> info('name');\n\t\t$select = $table -> select() -> from($song_name);\n\t\t$select -> join($playlist_name, \"$playlist_name.playlist_id = $song_name.playlist_id\", \"\");\n\t\t// Check the action.\n\t\tif ($iLastSongId > 0)\n\t\t{\n\t\t\tif ($sAction == 'more')\n\t\t\t{\n\t\t\t\t$select -> where('song_id < ?', $iLastSongId);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$select -> where('song_id > ?', $iLastSongId);\n\t\t\t}\n\t\t}\n\t\t// Search case.\n\t\tif (!empty($sSearch))\n\t\t{\n\t\t\t$select -> where(\"$song_name.title LIKE ?\", \"%{$sSearch}%\");\n\t\t}\n\t\t// Profile case.\n\t\tif ($bIsProfile && $oUser -> getIdentity())\n\t\t{\n\t\t\t$select -> where(\"$playlist_name.owner_id = ?\", $oUser -> getIdentity());\n\t\t}\n\t\tif (!$bIsProfile && $sView == 'my' && $viewer -> getIdentity())\n\t\t{\n\t\t\t$select -> where(\"$playlist_name.owner_id = ?\", $viewer -> getIdentity());\n\t\t}\n\t\telseif (!$bIsProfile && $sView == 'friend' && $viewer -> getIdentity())\n\t\t{\n\t\t\t// Get an array of friend ids\n\t\t\t$afriendIds = $viewer -> membership() -> getMembershipsOfIds();\n\t\t\t$select -> where(\"$playlist_name.owner_id IN(?)\", $afriendIds);\n\t\t\t$select -> where(\"$playlist_name.search = 1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$select -> where(\"$playlist_name.search = 1\");\n\t\t}\n\t\t$select -> order(\"$song_name.song_id DESC\");\n\t\t$select -> limit($iLimit);\n\t\t$rows = $table -> fetchAll($select);\n\t\t$aResult = array();\n\t\tforeach ($rows as $song)\n\t\t{\n\t\t\t$playlist = $song -> getParent();\n\t\t\t$owner = $playlist -> getOwner();\n\t\t\tif (!Engine_Api::_() -> authorization() -> isAllowed($playlist, null, 'view'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$songPath = $song -> getFilePath();\n\t\t\t//songURL\n\t\t\tif ($songPath)\n\t\t\t{\n\t\t\t\t$songPath = Engine_Api::_() -> ynmobile() -> finalizeUrl($songPath);\n\t\t\t}\n\t\t\t$sUserImageUrl = $owner -> getPhotoUrl(TYPE_OF_USER_IMAGE_ICON);\n\t\t\tif ($sUserImageUrl != \"\")\n\t\t\t{\n\t\t\t\t$sUserImageUrl = Engine_Api::_() -> ynmobile() -> finalizeUrl($sUserImageUrl);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sUserImageUrl = NO_USER_ICON;\n\t\t\t}\n\t\t\t$sProfileImage = $playlist -> getPhotoUrl(TYPE_OF_USER_IMAGE_NORMAL);\n\t\t\tif ($sProfileImage)\n\t\t\t{\n\t\t\t\t$sProfileImage = Engine_Api::_() -> ynmobile() -> finalizeUrl($sProfileImage);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sProfileImage = NO_ALBUM_MAIN;\n\t\t\t}\n\n\t\t\t$create = strtotime($playlist -> creation_date);\n\t\t\t// Prepare data in locale timezone\n\t\t\t$timezone = null;\n\t\t\tif (Zend_Registry::isRegistered('timezone'))\n\t\t\t{\n\t\t\t\t$timezone = Zend_Registry::get('timezone');\n\t\t\t}\n\t\t\tif (null !== $timezone)\n\t\t\t{\n\t\t\t\t$prevTimezone = date_default_timezone_get();\n\t\t\t\tdate_default_timezone_set($timezone);\n\t\t\t}\n\n\t\t\t$sTime = date(\"D, j M Y G:i:s O\", $create);\n\n\t\t\tif (null !== $timezone)\n\t\t\t{\n\t\t\t\tdate_default_timezone_set($prevTimezone);\n\t\t\t}\n\t\t\t$aResult[] = array(\n\t\t\t\t'sAlbumName' => $playlist -> getTitle(),\n\t\t\t\t'bIsOnProfile' => ($playlist -> profile) ? true : false,\n\t\t\t\t'iSongId' => $song -> getIdentity(),\n\t\t\t\t'iAlbumId' => $playlist -> getIdentity(),\n\t\t\t\t'iUserId' => $playlist -> owner_id,\n\t\t\t\t'sTitle' => $song -> getTitle(),\n\t\t\t\t'sSongPath' => $songPath,\n\t\t\t\t'iOrdering' => $song -> order,\n\t\t\t\t'iTotalPlay' => $song -> play_count,\n\t\t\t\t'iTimeStamp' => $create,\n\t\t\t\t'sTimeStamp' => $sTime,\n\t\t\t\t'sFullTimeStamp' => Engine_Api::_() -> ynmobile() -> calculateDefaultTimestamp($create),\n\t\t\t\t'sFullname' => $owner -> getTitle(),\n\t\t\t\t'sUserImage' => $sUserImageUrl,\n\t\t\t\t'sAlbumImage' => $sProfileImage,\n\t\t\t\t'bIsInvisible' => !(bool)$playlist -> search,\n\t\t\t\t'iUserLevelId' => $owner -> level_id\n\t\t\t);\n\t\t}\n\t\treturn $aResult;\n\t}", "public function PopulateFromSession(){\n\t\tif(isset($_SESSION[$this->key])){\n\t\t\t$this->data=$_SESSION[$this->key];\n\t\t\tif(isset($this->data['flash'])){\n\t\t\t\t$this->flash=$this->data['flash'];\n\t\t\t\tunset($this->data['flash']);\n\t\t\t}\n\t\t}\n\t}", "public function parser($aData)\n\t{\n\t\textract($aData);\n\t\t// Check auth\n\t\tif (!Engine_Api::_() -> authorization() -> isAllowed('music_playlist', null, 'create'))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"You are not allowed to upload songs\"),\n\t\t\t\t'error_code' => 1\n\t\t\t);\n\t\t}\n\n\t\t// Prepare\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\t$playlistTable = Engine_Api::_() -> getDbTable('playlists', 'music');\n\n\t\t$playlist = $playlistTable -> getSpecialPlaylist($viewer, 'wall');\n\t\t\n\t\t// Check subject\n\t\tif (!$playlist)\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Invalid playlist\"),\n\t\t\t\t'error_code' => 1\n\t\t\t);\n\t\t}\n\n\t\t// Get playlist identity\n\t\t$playlist_id = $playlist -> getIdentity();\n\n\t\t// check auth\n\t\tif (!Engine_Api::_() -> authorization() -> isAllowed($playlist, null, 'edit'))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"You are not allowed to edit this playlist\"),\n\t\t\t\t'error_code' => 1\n\t\t\t);\n\t\t}\n\t\t// Check file\n\t\tif (empty($_FILES['mp3']) && $sFilePath == \"\")\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"No file\")\n\t\t\t);\n\t\t}\n\t\tif (isset($_FILES['mp3']))\n\t\t{\n\t\t\t$file_mp3 = $_FILES['mp3'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$file_mp3 = trim(strip_tags($sFilePath));\n\t\t}\n\n\t\t// Process\n\t\t$db = Engine_Api::_() -> getDbtable('playlists', 'music') -> getAdapter();\n\t\t$db -> beginTransaction();\n\n\t\ttry\n\t\t{\n\n\t\t\t// Create song\n\t\t\t$file = Engine_Api::_() -> getWorkingApi('core', 'music') -> createSong($file_mp3);\n\t\t\tif (!$file)\n\t\t\t{\n\t\t\t\treturn array(\n\t\t\t\t\t'error_code' => 1,\n\t\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Song was not successfully attached\")\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Add song\n\t\t\t$song = $playlist -> addSong($file);\n\t\t\tif (!$song)\n\t\t\t{\n\t\t\t\treturn array(\n\t\t\t\t\t'error_code' => 1,\n\t\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Song was not successfully attached\")\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Response\n\t\t\treturn array(\n\t\t\t\t'result' => 1,\n\t\t\t\t'iSongId' => $song -> getIdentity(),\n\t\t\t\t'sSongTitle' => $song -> getTitle(),\n\t\t\t\t'sSongUrl' => Engine_Api::_() -> ynmobile() -> finalizeUrl($song -> getFilePath())\n\t\t\t);\n\t\t\t$db -> commit();\n\n\t\t}\n\t\tcatch( Music_Model_Exception $e )\n\t\t{\n\t\t\t$db -> rollback();\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _($e -> getMessage())\n\t\t\t);\n\t\t}\n\t\tcatch( Exception $e )\n\t\t{\n\t\t\t$db -> rollback();\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Upload failed by database query\")\n\t\t\t);\n\n\t\t}\n\t}", "function home_player() {\t\n \n\t\t\t$settingsData = $this->_settingsData;\n\t\t\t$videoUrl = $videoId = $thumb_image = $homeplayerData = $file_type = '';\n\t\t\t$mobile = vgallery_detect_mobile();\n\t\t\tif ( ! empty( $this->_featuredvideodata[0] ) ) {\n\t\t\t\t$homeplayerData = $this->_featuredvideodata[0];\n\t\t\t}\n\t\t\t\n \t$image_path = str_replace( 'plugins/' . $this->_plugin_name . '/', 'uploads/videogallery/', APPTHA_VGALLERY_BASEURL );\n\t\t\t$_imagePath = APPTHA_VGALLERY_BASEURL . 'images' . DS;\n\t\t\tif ( ! empty( $homeplayerData ) ) {\n\t\t\t\t$videoUrl = $homeplayerData->file;\t\t\t\t\t\t\t\t\t// Get video URL\n\t\t\t\t$videoId = $homeplayerData->vid;\t\t\t\t\t\t\t\t\t// Get Video ID\n\t\t\t\t$thumb_image = $homeplayerData->image;\t\t\t\t\t\t\t\t\t// Get thumb image\n\t\t\t\t$file_type = $homeplayerData->file_type;\n\t\t\t\t$video_title = $homeplayerData->name;\t\t\t\t\t\t\t\t// Get file type of a video\n\t\t\t\tif ( $thumb_image == '' ) {\t\t\t\t\t\t\t\t\t\t\t\t// If there is no thumb image for video\n\t\t\t\t\t$thumb_image = $_imagePath . 'nothumbimage.jpg';\n\t\t\t\t} else {\n\t\t\t\t\tif ( $file_type == 2 || $file_type == 5 ) {\t\t\t\t\t\t\t// For uploaded image\n\t\t\t\t\t\t$amazon_imageurl = strpos('/',$thumb_image); \n\t\t\t\t\t\tif($homeplayerData->amazon_buckets && $amazon_imageurl ){ // For Amazon S3 Buckets images \n\t\t\t\t\t\t\t$thumb_image = $thumb_image;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$thumb_image = $image_path. $thumb_image;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$moduleName = 'playerModule';\n\t\t\t$div = '<div>';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// video player starts\n\t\t\t// To increase hit count of a video\n\t\t\t$div .= '<script type=\"text/javascript\" src=\"' . APPTHA_VGALLERY_BASEURL . 'js/script.js\"></script>';\n\t\t\t$div .= '<style type=\"text/css\" scoped> .video-block {margin-left:' . $settingsData->gutterspace . 'px !important; float:left;} </style>';\n\t\t\t$div .= ' <script>\n\t\t\t\t\tvar baseurl,folder,videoPage;\n\t\t\t\t\tbaseurl = \"' . $this->_site_url . '\";\n\t\t\t\t\tfolder = \"' . $this->_plugin_name . '\";\n\t\t\t\t\tvideoPage = \"' . $this->_mPageid . '\"; </script>';\n\t\t\t$baseref = '';\n\t\t\tif ( ! empty( $this->_vId ) ) {\n\t\t\t\t$baseref .= '&amp;vid=' . $this->_vId;\n\t\t\t} else {\n\t\t\t\t$baseref .= '&amp;featured=true';\n\t\t\t}\n\t\t\t//Show/hide the video title of the home video players\n $settings = $this->_settingsData;\n\t\t\t$player_colors = unserialize($settings->player_colors);\t\t\n\t\t\t$div .= '<div id=\"mediaspace\" class=\"mediaspace\" style=\"color: #666;\">';\n\t\t\t\n\t\t\t// Show Hide / Show option for title\n\t\t\tif( isset( $player_colors['showTitle'] ) && $player_colors['showTitle'] ){\n\t\t\t $div .='<script type=\"text/javascript\">function current_video(vid,title){ document.getElementById(\"video_title\").innerHTML = title; }</script>';\n $div .='<h3 id=\"video_title\" style=\"width:' . $settingsData->width . ';text-align: left;\" class=\"more_title\"></h3>';\n\t\t\t}\n\t\t\t// end title enable /disable\n\t\t\t$div .= '<div id=\"flashplayer\" class=\"videoplayer\">';\n\t\t\tif ( $settingsData->default_player == 1 ) {\n\t\t\t\t$swf = $this->_bannerswfPath;\n\t\t\t\t$showplaylist = '&amp;showPlaylist=true';\n\t\t\t} else {\n\t\t\t\t$swf = $this->_swfPath;\n\t\t\t\t$showplaylist = '';\n\t\t\t}\n\t\t\t\n\t\t\tif ( $homeplayerData->file_type == 5 && ! empty( $homeplayerData->embedcode ) ) {\n\t\t\t\t$playerembedcode = stripslashes( $homeplayerData->embedcode );\n\t\t\t\t$div .= str_replace( 'width=', 'width=\"' . $settingsData->width . '\"', $playerembedcode );\n\t\t\t\t$div .= '<script> current_video( ' . $homeplayerData->vid . ',\"' . $homeplayerData->name . '\" ); </script>';\n\t\t\t} else {\n\t\t\t\tif ( $mobile == true ) {\n\t\t\t\t\tif ( ( preg_match( '/vimeo/', $videoUrl ) ) && ( $videoUrl != '' ) ) {\t\t\t\t\t// IF VIDEO IS YOUTUBE\n\t\t\t\t\t\t$vresult = explode( '/', $videoUrl );\n\t\t\t\t\t\t$div .= '<iframe width=\"100%\" type=\"text/html\" src=\"http://player.vimeo.com/video/\"' . $vresult[3] . '\" frameborder=\"0\"></iframe>';\n\t\t\t\t\t} elseif ( strpos( $videoUrl, 'youtube' ) > 0 ) {\n\t\t\t\t\t\t$imgstr = explode( 'v=', $videoUrl );\n\t\t\t\t\t\t$imgval = explode( '&', $imgstr[1] );\n\t\t\t\t\t\t$videoId1 = $imgval[0];\n\t\t\t\t\t\t$div .= '<iframe width=\"100%\" type=\"text/html\" src=\"http://www.youtube.com/embed/'. $videoId1 . '\" frameborder=\"0\"></iframe>';\n\t\t\t\t\t} elseif (strpos ( $videourl, 'dailymotion' ) > 0) { // For dailymotion videos\n\t\t\t\t\t\t$video = $videourl;\n\t\t\t\t\t $split = explode ( \"/\", $video );\n\t\t\t\t\t\t$split_id = explode ( \"_\", $split [4] );\n\t\t\t\t\t\t$video = $previewurl = $video_url = 'http://www.dailymotion.com/embed/video/' . $split_id [0]; \t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$output .= '<iframe src=\"' . $video . '\" width=\"100%\" class=\"iframe_frameborder\" ></iframe>';\t\t\t\t\t\t\n\t\t\t\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// IF VIDEO IS UPLOAD OR DIRECT PATH\n\t\t\t\t\t\tif ( $file_type == 2 ) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t// For uploaded image\n\t\t\t\t\t\t\tif( $file_type == 2 && strpos($videoUrl , '/' ) ) {\n\t\t\t\t\t\t\t\t$videoUrl = $videoUrl;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$videoUrl = $image_path . $videoUrl;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ( $file_type == 4 ) {\t\t\t\t\t\t\t\t\t\t\t\t// For RTMP videos\n\t\t\t\t\t\t\t$streamer = str_replace( 'rtmp://', 'http://', $homeplayerData->streamer_path );\n\t\t\t\t\t\t\t$videoUrl = $streamer . '_definst_/mp4:' . $videoUrl . '/playlist.m3u8';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$div .= '<video width=\"100%\" id=\"video\" poster=\"' . $thumb_image . '\" src=\"' . $videoUrl . '\" autobuffer controls onerror=\"failed( event )\">' . __( 'Html5 Not support This video Format.', 'video_gallery' ) . '</video>';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$site_url = get_site_url();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Flash player code\n\t\t\t\t\t$div .= '<embed id=\"player\" src=\"' . $swf . '\" flashvars=\"baserefW=' . $site_url . $baseref . $showplaylist . '&amp;mtype=' . $moduleName . '\" width=\"' . $settingsData->width . '\" height=\"' . $settingsData->height . '\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" />';\n\t\t\t\t}\n\t\t\t} \n\t\t\t$div .= '</div>';\n\t\t\t$windo = '';\n\t\t\t$useragent = $_SERVER['HTTP_USER_AGENT'];\n\t\t\tif ( strpos( $useragent, 'Windows Phone' ) > 0 )\n\t\t\t\t$windo = 'Windows Phone';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// section to notify not support video format\n\t\t\t$div .= '<script>\n\t\t\t\t\tvar txt = navigator.platform ;\n\t\t\t\t\tvar windo = \"' . $windo . '\";\n\t\t\t\t\tfunction failed( e )\n\t\t\t\t\t{\n\t\t\t\t\tif( txt ==\"iPod\"|| txt ==\"iPad\" || txt == \"iPhone\" || windo==\"Windows Phone\" || txt == \"Linux armv7l\" || txt == \"Linux armv6l\" )\n\t\t\t\t\t{\n\t\t\t\t\talert( \"' . __( 'Player doesnot support this video.', 'video_gallery' ) . '\" );\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t</script>';\n\t\t\t$div .= '<div id=\"video_tag\" class=\"views\"></div>';\n\t\t\t$div .= '</div>';\n\t\t\t$div .= '</div>';\n\t\t\treturn $div;\n\t\t}", "public function executeList(sfWebRequest $request)\n {\n\tif ($this->getUser()->isAuthenticated())\n\t{\n\t $user_id=$this->getUser()->getAttribute('user_id', '', 'sfGuardSecurityUser'); \n $this->playlist_list = PlaylistPeer::getMyPlaylist($user_id);\n\t $this->song_title=$request->getParameter('song_title');\n\t $this->song_url=$request->getParameter('song_url');\n\t $this->artist=$request->getParameter('artist');\n\t \n $this->music_id= ($this->getRequestParameter('music_id'));\n\t $this->form = new PlaylistForm();\n\t $this->form->setDefaults(array('user_id'=>$user_id)); \n\t}\n\telse\n\t{\n\t return $this->forward('sfGuardAuth','signin');\n\t}\n }", "function getMusic($src) \n{\n\t$playlistMusic = array();\n\t$explodedSrc = explode('<ul class=\"track-info\">',$src);\n\t$explodedTrackIDs = explode('data-track=',$src);\n\n\tfor($i=1; $i < count($explodedSrc); $i++) {\n\t\t$tmp = array();\n\t\t$tmp['id'] = $i;\n\t\t\n\t\t$explodeTmp = explode('<li class=\"track-title',$explodedSrc[$i]);\n\t\t$tmp['title'] = substr(strstr(getInnerText($explodeTmp[1], '\">', '</li>'),'.'),1);\n\t\t\n\t\t$explodeTmp = explode('<li class=\"artist',$explodedSrc[$i]);\n\t\t$tmp['artist'] = getInnerText($explodeTmp[1], '\">', '</li>');\n\t\t\n\t\t$explodeTmp = explode('<li class=\"duration\" rel=\"',$explodedSrc[$i]);\n\t\t$tmp['duration'] = getInnerText($explodeTmp[1], '\">', '</li>');\n\t\t\n\t\t$tmp['link'] = 'http://open.spotify.com/track/' . getInnerText($explodedTrackIDs[$i+1], '\"', '\"');\n\t\t$playlistMusic[] = $tmp;\n\t}\n\treturn $playlistMusic;\n}", "function get_playlist_id( $play_name ) {\r\n\r\n\tglobal $wpdb;\r\n\r\n\t$playlist_id = $wpdb->get_var( 'SELECT pid FROM ' . $wpdb->prefix . 'hdflvvideoshare_playlist WHERE playlist_slugname=\"' . $play_name . '\" LIMIT 1' );\r\n\treturn $playlist_id;\r\n}", "public function playallAction() {\n\n //Checking for \"Playlist\" is enabled for this site\n if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('sitevideo.playlist.allow', 1))\n return $this->_forwardCustom('requireauth', 'error', 'core');\n\n $playlist = Engine_Api::_()->core()->getSubject();\n //GET LOGGED IN USER INFORMATION\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n\n if ($viewer_id != $playlist->owner_id && $playlist->privacy == 'private') {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n $this->_helper->content->setNoRender()->setEnabled();\n }", "function getPlaylists(){\n $db = db();\n $db->begin();\n $data = $db->exec('SELECT title_playlist FROM playlist');\n\n return $data;\n }", "public function __construct() {\n $this-> apiResponse = \"\";\n $this -> spotifyData = \"\";\n $this -> youtubeData = \"\";\n $this -> song = \"\";\n //instantiate spotify and youtube class\n }", "protected function _playSongFromPlaylist(Entity\\StationPlaylist $playlist, array $recent_song_history)\n {\n $media_to_play = $this->_getQueuedSong($playlist, $recent_song_history);\n\n if ($media_to_play instanceof Entity\\StationMedia) {\n $spm = $media_to_play->getItemForPlaylist($playlist);\n $spm->played();\n\n $this->em->persist($spm);\n\n // Log in history\n $sh = new Entity\\SongHistory($media_to_play->getSong(), $playlist->getStation());\n $sh->setPlaylist($playlist);\n $sh->setMedia($media_to_play);\n $sh->setTimestampCued(time());\n\n $this->em->persist($sh);\n $this->em->flush();\n\n return $sh;\n }\n\n if (is_array($media_to_play)) {\n [$media_uri, $media_duration] = $media_to_play;\n\n $sh = new Entity\\SongHistory($this->songRepo->getOrCreate([\n 'text' => 'Remote Playlist URL',\n ]), $playlist->getStation());\n\n $sh->setPlaylist($playlist);\n $sh->setAutodjCustomUri($media_uri);\n $sh->setDuration($media_duration);\n $sh->setTimestampCued(time());\n\n $this->em->persist($sh);\n $this->em->flush();\n\n return $sh;\n }\n\n return null;\n }", "public function index(Request $request)\n {\n \n $session = new Session(\n env('SPOTIFY_CLIENT_ID'),\n env('SPOTIFY_CLIENT_SECRET'),\n env('SPOTIFY_CALLBACK_URL')\n ); \n \n $options = [\n \"auto_refresh\" => true,\n ];\n \n $api = new SpotifyWebApi\\SpotifyWebApi($options, $session);\n \n if (isset($_GET['code'])) { //this get the code immidately when a user agrees\n \n $session->requestAccessToken($_GET['code']);\n\n $access_token = $session->getAccessToken();\n\n $newclear = $session->getRefreshToken();\n \n $request->session()->put('_top', $newclear);\n \n $session->setAccessToken($access_token);\n \n // You can also call setSession on an existing SpotifyWebAPI instance\n $api->setSession($session);\n \n $user = $api->me();\n //getting user playlist\n $playlist = $api->getUserPlaylists($user->id, [\n 'limit' => 10\n ]);\n\n //getting the frist user playlist ID\n $playlistIdss = $playlist->items[0]->id;\n\n //getting a playlist track\n $playlistTrack = $api->getPlaylistTracks($playlistIdss);\n\n return view('player',[\n 'users' => $user,\n 'playlists' => $playlist,\n 'playlistTracks' => $playlistTrack,\n ]);\n } else {\n \n $get_refresh = @$request->session()->get('_top');\n \n if ($get_refresh) { // this if statement will get the refresh token without reloading the page \n\n $session->refreshAccessToken($get_refresh);\n\n $__accessTokens = $session->getAccessToken();\n \n $session->setAccessToken($__accessTokens);\n\n $scopes = $session->getScope();\n \n // You can also call setSession on an existing SpotifyWebAPI instance\n $api->setSession($session);\n \n //Call the API as usual\n $user = $api->me();\n \n //getting user playlist\n $playlist = $api->getUserPlaylists($user->id, [\n 'limit' => 5\n ]);\n \n\n //getting the frist user playlist ID\n $playlistIdss = $playlist->items[0]->id;\n\n //getting a playlist track\n $playlistTrack = $api->getPlaylistTracks($playlistIdss);\n \n\n return view('player',[\n 'users' => $user,\n 'playlists' => $playlist,\n 'playlistTracks' => $playlistTrack,\n ]);\n\n }else{\n\n return view('welcome');\n }\n } \n \n }", "function getPlaylistById($playlist_id) {\n global $conn;\n $query = \"SELECT * FROM playlists\n WHERE playlist_id = :playlist_id\";\n $stmt = $conn->prepare($query);\n $stmt->execute([\n ':playlist_id' => $playlist_id\n ]);\n $playlist = $stmt->fetch(PDO::FETCH_ASSOC);\n\n return $playlist;\n}", "public function __construct($playlistId)\n {\n $this->playlistId = $playlistId;\n }", "function write_xml() {\n\t\t$ser = new XML_Serializer();\n\t\t$ser->setOption(\"addDecl\", true); // Adds xml declaration\n\t\t$ser->setOption(\"indent\", \" \"); // Sets xml to indent properly\n\t\t$ser->setOption(\"rootName\", \"playlist\"); // Rootname should always be playlist\n\t\t$ser->setOption(\"mode\", \"simplexml\"); // should make everything track\n\t\t$ser->setOption(\"rootAttributes\", array(\"version\" => \"1\", \"xmlns\" => \"http://xspf.org/ns/0/\")); // Tells the playlist format\n\t\t\n\t\t// Set playlist info\n\t\t$p_title = $this->title; // Playlist title\n\t\t$safetitle = filename_safe($p_title);\n\t\t\n\t\t$filename = HTDOCS_PATH . \"playlists/$safetitle.xml\";\n\t//\techo $filename;\n\t//\t$p_description = $this->description; // Should be added at some point\n\t\t\n\t\t$videos = $this->get_videos(); // Fetch array of video objects\n\t\t$index = 0;\n\t\tforeach($videos as $video){\n\t\t\t$track[$index] = array(\n\t\t\t\t\"title\" => $video->title,\n\t\t\t\t\"annotation\" => $video->description,\n\t\t\t//\t\"location\" => \"http://wikistudios.caryme.com/YouTube_Multi-Format.php?v=$video->youtube_ID&fmt=18\",\n\t\t\t\t\"location\" => \"http://www.youtube.com/watch?v=\" . $video->youtube_ID\n\t\t\t\t);\n\t\t\t$index++;\t\t\n\t\t}\n\t\t\n\t\t$xml = array(\n\t\t\t\"title\" => $p_title,\n\t\t\t//\"info\" => $p_description,\n\t\t\t\"trackList\" => array(\"track\" => $track) );\n\t\t\n\t\t// Serialize the data\n\t\t$result = $ser->serialize($xml);\n\t\t\n\t\t// Save the data\n\t\t$data = $ser->getSerializedData();\n\t//\techo $data;\n\t\t// This should have some error checking\n\t\t\n\t\t// Open, write, then close the file\n\t\t$handle = fopen($filename, 'w') or die(\"can't open file\");\n\t//\techo $handle;\n\t\tfwrite($handle, $data) or die(\"Something went wrong in writing the data\");\n\t\tfclose($handle);\n\t\t\n\t}", "public function getPlaylistItems()\n {\n if (null === $this->playlistItems) {\n $this->playlistItems = [];\n foreach ($this->json->playlistitems as $json) {\n $this->playlistItems[] = new PlaylistItem($json);\n }\n }\n return $this->playlistItems;\n }", "function getTrackToPlay() {\n\n global $truePath;\n global $tempPath;\n\n\t// get active bucket from bucket table\n $activeBucketId = getActiveBucket();\n\n // initialize database\n $db = new ClientDB();\n\n\t// check if a track is currently playing\n $currentlyPlayingTrackCount = 0;\n\t$currentlyPlayingTrackQuery = $db->query(\"SELECT t_id FROM bucketcontents WHERE b_id = $activeBucketId AND b_currently_playing = 1\");\n while ($row = $currentlyPlayingTrackQuery->fetchArray(SQLITE3_ASSOC)) {\n $currentlyPlayingTrackCount++;\n }\n\tif ($currentlyPlayingTrackCount == 1) {\n\t\t// replay currently playing track\n\t\t$currentlyPlayingFilename;\n\t\t$currentlyPlayingQuery = $db->query(\"SELECT t.t_filename FROM bucketcontents b INNER JOIN tracks t ON b.t_id = t.t_id WHERE b.b_currently_playing = 1\");\n\t\t$currentlyPlayingCountRow = $currentlyPlayingQuery->fetchArray(SQLITE3_ASSOC);\n\t\t$currentlyPlayingFilename = $currentlyPlayingCountRow['t_filename'];\n\t\t\n\n // return the t_filename of random track\n $fileExt = '';\n $fileExt = str_replace(' ', '', $currentlyPlayingFilename);\n $fileExt = explode('.', $fileExt);\n $fileExt = '.' . $fileExt[sizeof($fileExt) - 1];\n\n if(strlen($fileExt) > 5){\n // dirty hack: on missing file extension, assume .mp3\n $fileExt = '.mp3';\n }\n \n shell_exec('cp -fr ' . $truePath . $currentlyPlayingFilename . ' ' . $tempPath . 'currently_playing' . $fileExt );\n \n return 'currently_playing' . $fileExt;\n\n\t\t//echo ('playing same track again. <br/>');\n\t\t\n\t\t// return $currentlyPlayingFilename;\n\t\t\n\t}\n\n // get all unplayed tracks within the active bucket)\n $bucketTracksCount = 0;\n $bucketTracksQuery = $db->query(\"SELECT t_id FROM bucketcontents WHERE b_id = $activeBucketId AND b_played = 0\");\n while ($row = $bucketTracksQuery->fetchArray(SQLITE3_ASSOC)) {\n $bucketTracksCount++;\n }\n\n // switch to next bucket if every track in active bucket is played and next bucket exists\n if ($bucketTracksCount == 0) {\n //echo('error: there are no more unplayed tracks within the active bucket! Switching to next bucket.<br/>');\n\n // look if next bucket exists\n $nextActiveBucketId = $activeBucketId + 1;\n $nextBucketCount = 0;\n $nextBucket = $db->query(\"SELECT b_id FROM buckets WHERE b_id = $nextActiveBucketId\");\n while ($row = $nextBucket->fetchArray(SQLITE3_ASSOC)) {\n $nextBucketCount++;\n }\n if ($nextBucketCount == 0) {\n //echo('error: there are no more buckets to play from.<br/>');\n\n // close db\n $db->close();\n unset($db);\n\n return 'empty';\n }\n\n // switch buckets \n $db->exec(\"UPDATE buckets SET b_is_active=0 WHERE b_id=$activeBucketId\");\n $db->exec(\"UPDATE buckets SET b_is_active=1 WHERE b_id=$nextActiveBucketId\");\n $activeBucketId = $nextActiveBucketId;\n\n // look if next bucket is empty\n $bucketTracksCount = 0;\n $bucketTracksQuery = $db->query(\"SELECT t_id FROM bucketcontents WHERE b_id = $activeBucketId AND b_played = 0\");\n while ($row = $nextBucket->fetchArray(SQLITE3_ASSOC)) {\n $bucketTracksCount++;\n }\n if ($bucketTracksCount == 0) {\n // echo('error: the next bucket is empty.<br/>');\n\n // close db\n $db->close();\n unset($db);\n\n return 'empty';\n }\n\n }\n\n // get all unplayed tracks within the active bucket\n $unplayedTracksQuery = $db->query(\"SELECT t_id FROM bucketcontents WHERE b_id = $activeBucketId AND b_played = 0\");\n\n // push the t_ids of the unplayed tracks into an array\n $unplayedBucketTracks = [];\n\twhile ($row = $unplayedTracksQuery->fetchArray(SQLITE3_ASSOC)) {\n array_push($unplayedBucketTracks, (int)$row['t_id']);\n }\n /*echo ('BucketPlaylist:');\n print_r($unplayedBucketTracks);\n echo ('<br/>');*/\n\n // count the tracks within the array\n $bucketTracksCount = ((int)count($unplayedBucketTracks) - 1);\n\n // check if there is only one element\n\tif($bucketTracksCount == 0) {\n\t\t// no random because only one element exists\n\t\t$randomTrackNumber = 0;\n\t} else {\n\t\t// get a random track within all unplayed tracks\n\t\t$randomTrackNumber = rand(0, $bucketTracksCount);\n\t}\n\t\n\t// get the id of the random track\n\t$randomTrackId = $unplayedBucketTracks[$randomTrackNumber];\n\n // get the u_ip and t_filename from the random track\n $randomTrackFilename;\n $randomTrackUserIp;\n $randomTrackQuery = $db->query(\"SELECT t_filename, u_ip FROM tracks WHERE t_id = $randomTrackId\");\n\n while ($row = $randomTrackQuery->fetchArray(SQLITE3_ASSOC)) {\n $randomTrackFilename = $row['t_filename'];\n $randomTrackUserIp = $row['u_ip'];\n }\n\n //echo ('next song to be played: --- t_id: '.$randomTrackId.' - t_filename: '.$randomTrackFilename.'<br/>');\n\n // set the status of the random track to currently_playing\n $db->exec(\"UPDATE bucketcontents SET b_currently_playing = 1 WHERE t_id=$randomTrackId\");\n\n // update current dj data\n // $db->exec(\"UPDATE users SET u_dj = 1, u_current_track = $randomTrackId WHERE u_ip = '\" . $randomTrackUserIp . \"'\");\n\n // close db\n $db->close();\n unset($db);\n \n // return the t_filename of random track\n $fileExt = '';\n $fileExt = explode('.', $randomTrackFilename);\n $fileExt = '.' . $fileExt[sizeof($fileExt) - 1];\n \n shell_exec('cp -fr ' . $truePath . $randomTrackFilename . ' ' . $tempPath . 'currently_playing' . $fileExt );\n \n return 'currently_playing' . $fileExt;\n}", "public function populateCarousalPlaylistBlock($case, $page_no=1, $rec_per_page=4)\n\t\t\t{\n\n\t\t\t\tglobal $smartyObj;\n\t\t\t\t$start = ($page_no -1) * $rec_per_page; // start = (pageno -1) * rec per page\n\n\t\t\t\tswitch($case)\n\t\t\t\t{\n\t\t\t\t\tcase 'playlistmostviewed':\n\t\t\t\t\t\t$table_names = $this->CFG['db']['tbl']['music_playlist_viewed'] . ' as vpl LEFT JOIN ' . $this->CFG['db']['tbl']['music_playlist'] . ' as pl ON pl.playlist_id=vpl.playlist_id'.', '.$this->CFG['db']['tbl']['users'] . ' as u ';\n\t\t\t\t\t\t$default_fields = \"pl.playlist_id, pl.playlist_name, TIMEDIFF(NOW(), pl.date_added) AS date_added, pl.thumb_music_id as music_id, pl.thumb_ext as music_ext, pl.total_tracks, pl.total_views, pl.total_comments, (pl.rating_total/pl.rating_count) as rating, pl.rating_count, pl.total_favorites, pl.total_featured, pl.playlist_tags, pl.playlist_description, u.user_name, u.user_id, SUM(vpl.total_views) as sum_total_views, pl.allow_ratings\";\n\t\t\t\t\t\t$condition = 'pl.playlist_status=\\'Yes\\' AND pl.total_views>0 AND pl.user_id = u.user_id AND u.usr_status=\\'Ok\\' GROUP BY vpl.playlist_id ';\n\t\t\t\t\t\t$order_by = 'sum_total_views DESC';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$sql = ' SELECT '.$default_fields.' FROM '.$table_names.\n\t\t\t\t\t\t' WHERE '.$condition.' ORDER BY '.$order_by;\n\n\t\t\t\t$sql .= ' LIMIT '.$start.', '.$rec_per_page;\n\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\n\t\t\t if (!$rs)\n\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t$showPlaylists_arr = array();\n\t\t\t\t$playlist_thumbnail_folder = $this->CFG['media']['folder'] . '/' . $this->CFG['admin']['musics']['folder'] . '/' . $this->CFG['admin']['musics']['thumbnail_folder'] . '/';\n\t\t\t\t$inc=0;\n\t\t\t\t$showPlaylists_arr['row'] = array();\n\t\t\t\t$this->player_music_id = array();\n\t\t\t\twhile($row = $rs->FetchRow())\n\t\t\t\t\t{\n\t\t\t\t\t\t$row['date_added'] = ($row['date_added'] != '') ? getTimeDiffernceFormat($row['date_added']) : '';\n\t\t\t\t\t\t$showPlaylists_arr['row'][$inc]['record'] = $row;\n\t\t\t\t\t\t$showPlaylists_arr['row'][$inc]['view_playlisturl'] = getUrl('viewplaylist', '?playlist_id='.$row['playlist_id'].'&amp;title='.$this->changeTitle($row['playlist_name']), $row['playlist_id'].'/'.$this->changeTitle($row['playlist_name']).'/', '','music');\n\t\t\t\t\t\t$showPlaylists_arr['row'][$inc]['getPlaylistImageDetail'] = $this->getPlaylistImageDetail($row['playlist_id']);// This function return playlist image detail array..//\n\t\t\t\t\t\t$inc++;\n\t\t\t\t\t}\n\t\t\t\t$smartyObj->assign('showPlaylists_arr', $showPlaylists_arr);\n\t\t \t$smartyObj->assign('playlist_block_record_count', $inc);//is record found\n\t\t\t\tsetTemplateFolder('general/', 'music');\n\t\t\t\t$smartyObj->display('indexPopularPlaylistContent.tpl');\n\t\t\t}", "public function createAction()\n {\n if( !$this->_helper->requireUser()->isValid() ) {\n return;\n }\n if( !$this->_helper->requireAuth()->setAuthParams('music_playlist', null, 'create')->isValid() ) {\n return;\n }\n\n // catch uploads from FLASH fancy-uploader and redirect to uploadSongAction()\n if( $this->getRequest()->getQuery('ul', false) ) {\n return $this->_forward('upload', 'song', null, array('format' => 'json'));\n }\n\n // Get navigation\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('music_main');\n\n // Get form\n $this->view->form = $form = new Music_Form_Create();\n $this->view->playlist_id = $this->_getParam('playlist_id', '0');\n\n // Check method/data\n if( !$this->getRequest()->isPost() ) {\n return;\n }\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n return;\n }\n\n // Process\n $db = Engine_Api::_()->getDbTable('playlists', 'music')->getAdapter();\n $db->beginTransaction();\n try {\n $playlist = $this->saveValues($form);\n $db->commit();\n } catch( Exception $e ) {\n $db->rollback();\n throw $e;\n }\n\n return $this->_helper->redirector->gotoUrl($playlist->getHref(), array('prependBase' => false));\n }", "function __construct() {\n parent::__construct();\n $this->data = array();\n $this->data['title'] = 'Stock Ticker'; \t\t// default title\n $this->data['pagetitle'] = 'Stock Ticker'; \t// default page\n $this->load->library('parser');\n\n\n $this->load->model(\"PortfolioModel\");\n $players = $this->PortfolioModel->getPlayers();\n\n $playerList = array();\n\n foreach($players as $player) {\n $playerList[] = $player;\n }\n\n $this->data['playerList'] = $playerList;\n $session_id = $this->session->userdata('playername');\n if ($session_id) {\n $this->data['username'] = $session_id;\n }\n\t}", "public function playlistWatchNext( $playlist_slug, $video_slug, VideoMeta $videoMeta, PlaylistMeta $playlistMeta ) {\n\n $verifyVideoSlug = Video::where( 'slug', $video_slug )->first();\n\n if(isset($verifyVideoSlug) ){\n\n $video_detail = array();\n $meta_tags = array();\n\n /*\n Get Video seo id\n */\n $VideoSeo = VideoSeo::where( 'video_id', $verifyVideoSlug->id )->get();\n\n /*\n Meta of speaker\n */\n $meta_tags['meta_title'] = isset( $VideoSeo[0]['meta_title'] ) ? $VideoSeo[0]['meta_title'] : '';\n $meta_tags['meta_description'] = isset( $VideoSeo[0]['meta_description'] ) ? $VideoSeo[0]['meta_description'] : '';\n $meta_tags['meta_keyword'] = isset( $VideoSeo[0]['meta_tag'] ) ? $VideoSeo[0]['meta_tag'] : '';\n\n $video_detail['account_id'] = $videoMeta->getVideoMeta($verifyVideoSlug->id, 'account_id' );\n $video_detail['video_id'] = $verifyVideoSlug->id;\n $video_detail['name'] = $verifyVideoSlug->name;\n $video_detail['slug'] = $verifyVideoSlug->slug;\n $video_detail['tags'] = unserialize( $videoMeta->getVideoMeta($verifyVideoSlug->id, 'tags' ));\n $video_detail['description'] = $videoMeta->getVideoMeta($verifyVideoSlug->id, 'description' );\n $video_detail['long_description'] = $videoMeta->getVideoMeta($verifyVideoSlug->id, 'long_description' );\n $video_detail['images'] = unserialize( $videoMeta->getVideoMeta($verifyVideoSlug->id, 'images' ) );\n $video_detail['custom_fields'] = unserialize( $videoMeta->getVideoMeta($verifyVideoSlug->id, 'custom_fields' ) );\n /*\n Get Speaker from video custom fields;\n */\n $speakers_using_cf = $this->getCustomSpeakers( $video_detail['custom_fields'] );\n\n $splitArraySpeaker = explode( ',', $speakers_using_cf );\n //die;\n\n $all_speakers = array();\n\n if( $speakers_using_cf ) {\n $speakerQuery = DB::table('speakers')->whereIn( 'bc_speaker_name', $splitArraySpeaker )->get();\n\n foreach( $speakerQuery as $speaker ) {\n\n $speaker_descriptions = SpeakerDescription::where( 'speaker_id', $speaker->id )->first();\n\n $userAvatarIMGName = pathinfo($speaker->avatar, PATHINFO_BASENAME);\n $extractIMGName = explode( '.', $userAvatarIMGName);\n\n $all_speakers[] = array(\n 'speaker_id' => $speaker->id,\n 'name' => $speaker_descriptions->name,\n 'slug' => $speaker->slug,\n 'avatar' => $speaker->avatar,\n 'crop' => 'speaker/'.$extractIMGName[0].'_crop.'.$extractIMGName[1],\n 'designation' => $speaker_descriptions->designation,\n 'short_description' => $speaker_descriptions->short_description,\n );\n }\n } \n\n /*\n Get User ID;\n */\n $user_id = Auth::user()->id ?? '';\n\n /*\n Get wishlist listing by user id;\n */\n\n $wishlistQuery = wishlist::where( 'user_id', $user_id )->get();\n\n $all_videos = array();\n\n if( count( $wishlistQuery ) > 0 ) {\n foreach($wishlistQuery as $wishlist ) {\n\n $account_id = $videoMeta->getVideoMeta( $wishlist['video_id'], 'account_id' );\n $name = $videoMeta->getVideoMeta( $wishlist['video_id'], 'name' );\n $description = $videoMeta->getVideoMeta( $wishlist['video_id'], 'description' );\n $images = unserialize( $videoMeta->getVideoMeta( $wishlist['video_id'], 'images' ) );\n $filename = $videoMeta->getVideoMeta( $wishlist['video_id'], 'original_filename' );\n $slug = $videoMeta->getVideoSlug( $wishlist['video_id'] );\n\n $all_videos[] = array(\n 'video_id' => $wishlist['video_id'],\n 'account_id' => $account_id,\n 'name' => $name,\n 'slug' => $slug,\n 'description' => $description,\n 'images' => $images,\n 'filename' => $filename,\n );\n }\n }\n\n /*\n Watch Next based on Popular Videos\n */\n $playlist = Playlist::where( 'slug', $playlist_slug )->first(); \n $videos_array = array();\n\n /*\n check playlist var if isset and not empty;\n */\n if( isset( $playlist ) && !empty( $playlist ) ) {\n\n /*\n Variable initalize;\n */\n $playlist_name = $playlistMeta->getPlaylistMeta( $playlist['id'], 'name' );\n $playlist_slug = Playlist::where( 'id', $playlist['id'])->select('slug')->first();\n $playlist_videos = unserialize( $playlistMeta->getPlaylistMeta( $playlist['id'], 'video_ids' ) );\n\n if( count($playlist_videos) > 0 ) {\n foreach( $playlist_videos as $video_id ) {\n\n $video = Video::where( 'id', $video_id)->first();\n\n if( isset( $video) && !empty( $video ) && $video_id != $verifyVideoSlug->id ) {\n $vidoe_images = unserialize( $videoMeta->getVideoMeta( $video_id, 'images' ) );\n\n $videos_array[] = array(\n 'video_id' => $video_id,\n 'name' => substr( $video['name'], 0, env('char_limit') ).' ...',\n 'slug' => $video['slug'],\n 'images' => $vidoe_images,\n );\n }\n }\n }\n }\n\n //return $videos_array;\n\n $playlist_videos = array();\n\n $playlist_videos['playlist']['playlist_id'] = $playlist['id'];\n $playlist_videos['playlist']['playlist_name'] = $playlist_name;\n $playlist_videos['playlist']['playlist_slug'] = $playlist_slug['slug'];\n $playlist_videos['playlist']['playlist_videos'] = $videos_array;\n\n return view('frontend.video_detail', ['video_detail' => $video_detail, 'wishlist' => $all_videos, 'speakers' => $all_speakers, 'playlist_watch_next' => $playlist_videos, 'meta' => $meta_tags ]);\n \n } else {\n return redirect()->route('404');\n }\n }", "public function getPlaylist($sk, $api_sig, $discovery = null, $rtp = null, $buylinks = null, $speed_multiplier = null, $bitrate = null)\n {\n return $this->getClient()->call('radio.getplaylist', array(\n 'sk' => $sk,\n 'api_sig' => $api_sig,\n 'discovery' => $discovery,\n 'rtp' => $rtp,\n 'buylinks' => $buylinks,\n 'speed_multiplier' => $speed_multiplier,\n 'bitrate' => $bitrate,\n ));\n }", "private function updateSession(){\r\t\tglobal $player;\r\t\tif ($player->id != $this->id){return false;} // not same player , no session update\r\t\t$tmp->display_name=$this->display_name;\r\t\t$tmp->email=$this->email;\r\t\t$tmp->avatar=$this->avatar;\r\t\t$tmp->pass=$this->pass;\r\t\t$tmp->balance=$this->balance;\r\t\t$tmp->points=$this->points;\r\t\t$tmp->rank=$this->rank;\r\t\t$tmp->id=$this->id;\r\t\tsession_start();\r\t\t\t\t$_SESSION[\"player\"]=$tmp;\r\t\tsession_write_close();\r\t}", "public static function from_html($html) {\r\n\t\t$infoNode = self::string_between($html, 'class=\"info', '<div id=\"lyrics');\r\n\t\t$playNode = self::string_between($html, 'class=\"play_btn', 'class=\"info');\r\n\t\t\r\n\t\tif ($infoNode == false || $playNode === false) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\t$aid = '';\r\n\t\t$id = '0';\r\n\t\t$oid = '';\r\n\t\t$url = '';\r\n\t\t$len = 0;\r\n\t\r\n\t\t$artist = self::decode_entity(strip_tags(self::string_between($infoNode, '<b>', '</b>')));\r\n\t\t$title = self::decode_entity(strip_tags(self::string_between($infoNode, 'class=\"title\">', '<span class=\"user\"')));\r\n\t\t\r\n\t\t$aid = self::string_between($html, 'id=\"audio', '\"');\r\n\t\tif (strpos($aid, '_') !== false) {\r\n\t\t\t$parts = explode('_', $aid);\r\n\t\t\t$id = intval($parts[1]) !== 0 ? $parts[1] : '0';\r\n\t\t\t$oid = $parts[0];\r\n\t\t}\r\n\t\t\r\n\t\t$hiddenField = self::string_between($playNode, sprintf('id=\"audio_info%s\"', $aid), '/>');\r\n\t\t$hiddenValues = explode(',', self::string_between($hiddenField, 'value=\"', '\"'));\r\n\t\t\r\n\t\tif (count($hiddenValues) === 2) {\r\n\t\t\t$len = intval($hiddenValues[1]);\r\n\t\t\t$url = $hiddenValues[0];\r\n\t\t}\r\n\t\t\r\n\t\treturn $id !== '0' && !empty($url)\r\n\t\t\t? new VkSong($id, $oid, $url, $artist, $title, $len)\r\n\t\t\t: null;\r\n\t}", "public function get_now_playing() { \r\n\r\n\t\t// First get the current POS\r\n\t\t$pos = $this->sendCommand('getlistpos',array()); \r\n\t\t\r\n\t\t// Now get the filename\r\n\t\t$file = $this->sendCommand('getplaylistfile',array('index'=>$pos)); \r\n\r\n\t\treturn $file; \r\n\r\n\t}", "public function initPlaylistsTagsPlaylistTags()\n {\n $this->combinationCollPlaylistsTagsPlaylistTags = new ObjectCombinationCollection;\n $this->combinationCollPlaylistsTagsPlaylistTagsPartial = true;\n }", "private function __init()\n {\n is_dir(PRIVATE_STORAGE.\"/session\") or mkdir(PRIVATE_STORAGE.\"/session\");\n if (file_exists($this->sessfile)) {\n $this->sessdata = json_decode(file_get_contents($this->sessfile), true);\n } else {\n file_put_contents($this->sessfile, \"\", LOCK_EX);\n }\n }", "function make_get_the_playlist_feed( $limit, $username, $start ) {\n\t// This is offset so that only one is fetched at a time.\n\t// Using the offset query param, you can go down the list to generate one file for each playlist.\n\n\t$file = 'http://gdata.youtube.com/feeds/api/users/' . $username . '/playlists?max-results=1&alt=json&offset=1&start-index=' . $limit;\n\t$contents = file_get_contents($file);\n\t$playlists = json_decode($contents);\n\t$feedlink = 'gd$feedLink';\n\t$videos = $playlists->feed->entry[0]->$feedlink;\n\t$url = $videos[0]->href . '?alt=json&max-results=50&start-index=' . $start;\n\t$contents = file_get_contents($url);\n\t$videosobj = json_decode($contents);\n\t$videos = $videosobj->feed->entry;\n\t$t = '$t';\n\t$output = array(\n\t\t'playlist' => $videosobj->feed->title->$t,\n\t\t'videos' => $videos\n\t\t);\n\treturn $output;\n}", "private function reset_playlist_rela($or_playlist){\r\n\r\n\r\n\t\t// Create registration array\r\n\t\t$playlist_rela_array = array();\r\n\t\t$or_list_array = array();\r\n\r\n\t\t$client_id = $or_playlist->client_id;\r\n\t\t$playlist_id = $or_playlist->playlist_id;\r\n\t\t$extra_cnt = 0;\r\n\r\n\t\t// Acquire registered playlist information\r\n\t\t$default_chk = 0;\r\n\t\t$morning_chk = (EXTRA_PLAYLIST_MAX_MOVIE * ( TIME_ZONE_MORNING - 1));\r\n\t\t$afternoon_chk = (EXTRA_PLAYLIST_MAX_MOVIE * ( TIME_ZONE_NOON - 1));\r\n\t\t$night_chk = (EXTRA_PLAYLIST_MAX_MOVIE * ( TIME_ZONE_EVENING - 1));\r\n\r\n\t\t// Retrieve video relation information of individual playlist\r\n\t\t$cm_playlist->multi_flg = true;\r\n\t\t$playlist_movie_rela = $this->model->sel_arr_id_name_playlist_movie_rela($or_playlist);\r\n\t\tforeach($playlist_movie_rela as $movie_rela){\r\n\t\t\t$order_num = $movie_rela->display_order;\r\n\t\t\t$i = 0;\r\n\t\t\t$sex_id = SEX_KIND_MAN;\r\n\t\t\t// 時間帯 3種 * 2曲以上の登録があれば 性別のカウントを増やす。\r\n\t\t\t// Because there are 4 types of time zones, we will reduce one count\r\n\r\n\t\t\tif( $night_chk <= $order_num ) {\r\n\t\t\t\t$i = (EXTRA_PLAYLIST_MAX_MOVIE * ( TIME_ZONE_EVENING - 1));\r\n\t\t\t\t$order_num = $order_num - $i;\r\n\t\t\t\t$sex_id = SEX_KIND_WOMAN;\r\n\t\t\t}\r\n\t\t\t$movie_rela->sex_id = $sex_id;\r\n\r\n\t\t\tif( $default_chk <= $order_num && $order_num < $morning_chk ) {\r\n\t\t\t\t// Morning\r\n\t\t\t\t$movie_rela->timezone_id = TIME_ZONE_MORNING;\r\n\t\t\t} else if( $morning_chk <= $order_num && $order_num < $afternoon_chk) {\r\n\t\t\t\t// Noon\r\n\t\t\t\t$movie_rela->timezone_id = TIME_ZONE_NOON;\r\n\t\t\t} else if( $afternoon_chk <= $order_num && $order_num < $night_chk) {\r\n\t\t\t\t// Night\r\n\t\t\t\t$movie_rela->timezone_id = TIME_ZONE_EVENING;\r\n\t\t\t}\r\n\t\t\t$or_list_array[$movie_rela->sex_id][$movie_rela->timezone_id][$extra_cnt] = $movie_rela;\r\n\t\t\t$extra_cnt++;\r\n\t\t}\r\n\r\n\t\t// Get common playlist\r\n\t\t$search = new stdClass;\r\n\t\t$search->offset = $pagination->offset;\r\n\t\t$search->commonplaylist = true;\r\n\t\t$search->sta_dt = $or_playlist->sta_dt;\r\n\t\t$search->end_dt = $or_playlist->end_dt;\r\n\r\n\t\t$allitem = array();\r\n\t\t$playlist_mov = array();\r\n\r\n\t\t$cnt = 0;\r\n\t\t//Data acquisition (Get list of common playlists)\r\n\t\t$cm_arr_playlist = $this->model->sel_arr_common_playlist($search);\r\n\t\tforeach($cm_arr_playlist as $cm_playlist){\r\n\t\t\t$common_playlist_id = $cm_playlist->playlist_id;\r\n\t\t\t$deliverymonth_id = $cm_playlist->deliverymonth_id;\r\n\t\t\t$sex_id = $cm_playlist->sex_id;\r\n\t\t\t$timezone_id = $cm_playlist->timezone_id;\r\n\t\t\t$sta_dt = $cm_playlist->sta_dt;\r\n\t\t\t$end_dt = $cm_playlist->end_dt;\r\n\r\n\t\t\t$playlist_id = $or_playlist->playlist_id;\r\n\t\t\t// Confirm that there is no playlist cooperation table with the common playlist and the ID of the individual playlist cooperated\r\n\t\t\t$search = new stdClass;\r\n\t\t\t$search->offset = 0;\r\n\t\t\t$search->common_playlist_id = $common_playlist_id;\r\n\t\t\t$search->sex_id = $sex_id;\r\n\t\t\t$search->timezone_id = $timezone_id;\r\n\t\t\t$search->sta_dt = $sta_dt;\r\n\t\t\t$search->end_dt = $end_dt;\r\n\t\t\t$search->client_id = $or_playlist->client_id;\r\n\t\t\t$search->playlist_id = $or_playlist->playlist_id;\r\n\r\n\t\t\t// Number assignment\r\n\t\t\t$playlist_rela_id = $this->model->sel_next_playlist_rela_id();\r\n\r\n\t\t\t// Acquire video relation information of common playlist\r\n\t\t\t$cm_playlist->single_flg = true;\r\n\t\t\t$playlist_movie_common_rela = $this->model->sel_arr_id_name_playlist_movie_rela($cm_playlist);\r\n\t\t\t// Combine the relation information of the common playlist and relation information of the individual playlist\r\n\t\t\tforeach($playlist_movie_common_rela as $movie_common_rela ){\r\n\r\n\t\t\t\t$playlist_movie_rela = new Db_Ins();\r\n\t\t\t\t$playlist_movie_rela->playlist_rela_id = $playlist_rela_id;\r\n\t\t\t\t$playlist_movie_rela->playlist_id = $movie_common_rela->playlist_id;\r\n\t\t\t\t$playlist_movie_rela->movie_id = $movie_common_rela->movie_id;\r\n\t\t\t\t$playlist_movie_rela->draw_area_id = DRAW_AREA_LAND_MOVIE;\r\n\r\n\t\t\t\t$playlist_movie_rela->sex_id = $sex_id;\r\n\t\t\t\t$playlist_movie_rela->deliverymonth_id = $deliverymonth_id;\r\n\t\t\t\t$playlist_movie_rela->timezone_id = $timezone_id;\r\n\t\t\t\t$playlist_movie_rela->sta_dt = $sta_dt;\r\n\t\t\t\t$playlist_movie_rela->end_dt = $end_dt;\r\n\r\n\t\t\t\t$playlist_mov[$cnt] = $playlist_movie_rela;\r\n\t\t\t\t$cnt++;\r\n\t\t\t}\r\n\t\t\t// Link to a common playlist for each individual playlist\r\n\t\t\t$playlist_rela = new Db_Ins();\r\n\t\t\t$playlist_rela->playlist_rela_id = $playlist_rela_id;\r\n\t\t\t$playlist_rela->timezone_id = $timezone_id;\r\n\t\t\t$playlist_rela->playlist_id = $playlist_id;\r\n\t\t\t$playlist_rela->client_id = $client_id;\r\n\t\t\t$playlist_rela->common_playlist_id = $common_playlist_id;\r\n\t\t\t$playlist_rela->deliverymonth_id = $deliverymonth_id;\r\n\t\t\t$playlist_rela->sex_id = $sex_id;\r\n\t\t\t$playlist_rela->timezone_id = $timezone_id;\r\n\r\n\t\t\t// Since there are cases where there are two common playlists within the individual playlist period,\r\n\t\t\t// 共通プレイリストの開始~終了時期を元に設定する\r\n\t\t\t$playlist_rela->sta_dt = $sta_dt;\r\n\t\t\t$playlist_rela->end_dt = $end_dt;\r\n\r\n\t\t\t// Add playlist linkage DB to array\r\n\t\t\tarray_push($playlist_rela_array, $playlist_rela );\r\n\t\t}\r\n\r\n\t\tforeach ($or_list_array as $tmp_sex_id => $value1) {\r\n\t\t\tforeach ($value1 as $tmp_timezone_id => $value2) {\r\n\r\n\t\t\t\t// If there is no individual playlist value, continue\r\n\t\t\t\tif( 0 == count($value2)){\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$i = 0;\r\n\t\t\t\t$playlist_rela_id_commit = 0;\r\n\t\t\t\tforeach ($playlist_mov as $cm_mov_rela){\r\n\t\t\t\t\t// Register as much as there are songs in the common playlist\r\n\t\t\t\t\t// There are no specifications for 0 common playlists (because it will be promised for each client and it will be unlimited)\r\n\r\n\t\t\t\t\tif( $cm_mov_rela->sex_id != $tmp_sex_id) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( $cm_mov_rela->timezone_id != $tmp_timezone_id) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$playlist_rela_id_commit = $cm_mov_rela->playlist_rela_id;\r\n\t\t\t\t\t$playlist_movie_rela = new Db_Ins();\r\n\t\t\t\t\t$playlist_movie_rela->playlist_rela_id= $playlist_rela_id_commit; // Register as linkage ID\r\n\t\t\t\t\t$playlist_movie_rela->playlist_id = $cm_mov_rela->playlist_id;\r\n\t\t\t\t\t$playlist_movie_rela->movie_id = $cm_mov_rela->movie_id;\r\n\t\t\t\t\t$playlist_movie_rela->client_id = $client_id;\r\n\t\t\t\t\t$playlist_movie_rela->draw_area_id = DRAW_AREA_LAND_MOVIE;\r\n\t\t\t\t\t$playlist_movie_rela->display_order = $i;\r\n\t\t\t\t\t$ret = $this->model->ins_playlist_movie_rela($playlist_movie_rela);\r\n\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Add for each individual playlist\r\n\t\t\t\tforeach ($value2 as $mov_rela){\r\n\t\t\t\t\t$playlist_movie_rela = new Db_Ins();\r\n\t\t\t\t\t$playlist_movie_rela->playlist_rela_id= $playlist_rela_id_commit; // Register as linkage ID\r\n\t\t\t\t\t$playlist_movie_rela->playlist_id = $mov_rela->playlist_id;\r\n\t\t\t\t\t$playlist_movie_rela->movie_id = $mov_rela->movie_id;\r\n\t\t\t\t\t$playlist_movie_rela->client_id = $client_id;\r\n\t\t\t\t\t$playlist_movie_rela->draw_area_id = DRAW_AREA_LAND_MOVIE;\r\n\t\t\t\t\t$playlist_movie_rela->display_order = $i;\r\n\t\t\t\t\t$ret = $this->model->ins_playlist_movie_rela($playlist_movie_rela);\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $playlist_rela_array;\r\n\t}", "private function LoadSession() {\n $this->session = unserialize($_SESSION[''.$this->name]);\n $this->flash = $this->session->_flash;\n unset($this->session->_flash);\n }", "public function createPlaylist(Playlist $playlist)\n {\n MyLogger::info(\"Entering createPlaylist() in the Playlist data service\");\n try {\n // get required data to be inserted\n $name = $playlist->getName();\n $userid = $playlist->getUsers_ID();\n // insert data\n $stmt = $this->db->prepare(\"INSERT INTO `playlists` (`ID`, `NAME`, `users_ID`)\n VALUES (NULL, '$name', '$userid');\");\n $stmt->execute();\n $result = $stmt->rowCount();\n // check rows affected\n if ($result == 1) {\n MyLogger::info(\"Playlist successfully created, exiting, createPlaylist()\");\n return true;\n } else {\n return false;\n }\n } catch (Exception $e2) {\n MyLogger::error(\"Global Exception error in PlaylistDataService.createPlaylist\");\n throw $e2;\n }\n }", "private function loadSession() {\n if(isset($_SESSION['uid'])) {\n $this->uid = $_SESSION['uid'];\n $this->sid = $_SESSION['sid'];\n $this->user = $_SESSION['user'];\n $this->pass = $_SESSION['pass'];\n $this->email = $_SESSION['email'];\n $this->tz = $_SESSION['tz'];\n $this->admin = $_SESSION['admin'];\n $this->active = $_SESSION['active'];\n\n $this->live = true;\n }\n elseif(isset($_COOKIE['auth'])) {\n $this->readCookie();\n }\n }", "function __construct()\r\n\t{\r\n\t\tparent::__construct();\r\n\t\t$this->isPlayList = false;\r\n\t}", "public function detail($aData)\n\t{\n\t\tif (!isset($aData['iSongId']))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Parameter is not valid!\")\n\t\t\t);\n\t\t}\n\t\t// Get song/playlist\n\t\t$song = Engine_Api::_() -> getItem('music_playlist_song', $aData['iSongId']);\n\t\t// Check song/playlist\n\t\tif (!$song)\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _('Invalid song')\n\t\t\t);\n\t\t}\n\t\t$playlist = $song -> getParent();\n\n\t\t// Check song/playlist\n\t\tif (!$playlist)\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _('Invalid playlist')\n\t\t\t);\n\t\t}\n\n\t\t// Check auth\n\t\tif (!Engine_Api::_() -> authorization() -> isAllowed($playlist, null, 'view'))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _('Not allowed to view this song')\n\t\t\t);\n\t\t}\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\t$this -> updateCounterMusic($aData);\n\t\t$owner = $playlist -> getOwner();\n\t\t$songPath = $song -> getFilePath();\n\t\t//songURL\n\t\tif ($songPath)\n\t\t{\n\t\t\t$songPath = Engine_Api::_() -> ynmobile() -> finalizeUrl($songPath);\n\t\t}\n\t\t$sUserImageUrl = $owner -> getPhotoUrl(TYPE_OF_USER_IMAGE_ICON);\n\t\tif ($sUserImageUrl != \"\")\n\t\t{\n\t\t\t$sUserImageUrl = Engine_Api::_() -> ynmobile() -> finalizeUrl($sUserImageUrl);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sUserImageUrl = NO_USER_ICON;\n\t\t}\n\t\t$sProfileImage = $playlist -> getPhotoUrl(TYPE_OF_USER_IMAGE_NORMAL);\n\t\tif ($sProfileImage)\n\t\t{\n\t\t\t$sProfileImage = Engine_Api::_() -> ynmobile() -> finalizeUrl($sProfileImage);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sProfileImage = NO_ALBUM_MAIN;\n\t\t}\n\n\t\t$create = strtotime($playlist -> creation_date);\n\t\t// Prepare data in locale timezone\n\t\t$timezone = null;\n\t\tif (Zend_Registry::isRegistered('timezone'))\n\t\t{\n\t\t\t$timezone = Zend_Registry::get('timezone');\n\t\t}\n\t\tif (null !== $timezone)\n\t\t{\n\t\t\t$prevTimezone = date_default_timezone_get();\n\t\t\tdate_default_timezone_set($timezone);\n\t\t}\n\n\t\t$sTime = date(\"D, j M Y G:i:s O\", $create);\n\n\t\tif (null !== $timezone)\n\t\t{\n\t\t\tdate_default_timezone_set($prevTimezone);\n\t\t}\n\t\treturn array(\n\t\t\t'sAlbumName' => $playlist -> getTitle(),\n\t\t\t'bIsOnProfile' => ($playlist -> profile) ? true : false,\n\t\t\t'iSongId' => $song -> getIdentity(),\n\t\t\t'iAlbumId' => $playlist -> getIdentity(),\n\t\t\t'iUserId' => $playlist -> owner_id,\n\t\t\t'sTitle' => $song -> getTitle(),\n\t\t\t'sSongPath' => $songPath,\n\t\t\t'iOrdering' => $song -> order,\n\t\t\t'iTotalPlay' => $song -> play_count,\n\t\t\t'iTimeStamp' => $create,\n\t\t\t'sTimeStamp' => $sTime,\n\t\t\t'sFullTimeStamp' => Engine_Api::_() -> ynmobile() -> calculateDefaultTimestamp($create),\n\t\t\t'sFullname' => $owner -> getTitle(),\n\t\t\t'sUserImage' => $sUserImageUrl,\n\t\t\t'sAlbumImage' => $sProfileImage,\n\t\t\t'bIsInvisible' => !(bool)$playlist -> search,\n\t\t\t'iUserLevelId' => $owner -> level_id,\n\t\t\t'bIsFriend' => $owner -> membership() -> isMember($viewer),\n\t\t);\n\t}", "protected function setPlaylistObject($object)\n\t{\n\t\t# Check if the passed value is an object.\n\t\tif(is_object($object))\n\t\t{\n\t\t\t# Set the data member.\n\t\t\t$this->playlist_obj=$object;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Explicitly set the data member to NULL.\n\t\t\t$this->playlist_obj=NULL;\n\t\t}\n\t}", "public function setPlaylists($value)\n\t{\n\t\t# Create an empty array to hold the playlists.\n\t\t$playlists=array();\n\t\t# Check if the passed value if empty.\n\t\tif(!empty($value))\n\t\t{\n\t\t\t# Set the Database instance to a variable.\n\t\t\t$db=DB::get_instance();\n\t\t\t# Set the Validator instance to a variable.\n\t\t\t$validator=Validator::getInstance();\n\t\t\t# Check if the passed value is NOT an array.\n\t\t\tif(!is_array($value))\n\t\t\t{\n\t\t\t\t# Trim both ends of the string.\n\t\t\t\t$value=trim($value);\n\t\t\t\t# Trim any dashes (-) off both ends of the string .\n\t\t\t\t$value=trim($value, '-');\n\t\t\t\t# Explode the array to an array separated with dashes (-).\n\t\t\t\t$value=explode('-', $value);\n\t\t\t}\n\t\t\t# Get the Playlist class.\n\t\t\trequire_once Utility::locateFile(MODULES.'Content'.DS.'Playlist.php');\n\t\t\t# Instantiate a new Playlist object.\n\t\t\t$playlist_obj=new Playlist();\n\t\t\t# Create a variable to hold the \"WHERE\" clause.\n\t\t\t$where_clause=array();\n\t\t\t# Loop through the $value array to build the \"WHERE\" clause.\n\t\t\tforeach($value as $playlist_value)\n\t\t\t{\n\t\t\t\t# Set the default field name to search the playlists tablee as \"playlist\".\n\t\t\t\t$field_name='name';\n\t\t\t\t# Check if the value is an integer. If so, set the field name to \"id\".\n\t\t\t\tif($validator->isInt($playlist_value))\n\t\t\t\t{\n\t\t\t\t\t$field_name='id';\n\t\t\t\t}\n\t\t\t\t$where_clause[]='`'.$field_name.'` = '.$db->quote($playlist_value);\n\t\t\t}\n\t\t\t# Create the \"WHERE\" clause.\n\t\t\t$where_clause=' WHERE ('.implode(' OR ', $where_clause).')';\n\t\t\t# Retreive the playlists in as single call.\n\t\t\t$playlist_obj->getPlaylists(NULL, '*', 'id', 'ASC', $where_clause);\n\t\t\t# Set the returned records to a variable.\n\t\t\t$all_playlists=$playlist_obj->getAllPlaylists();\n\t\t\t# Check if there WERE any returned records.\n\t\t\tif(!empty($all_playlists))\n\t\t\t{\n\t\t\t\t# Loop through the returned playlists.\n\t\t\t\tforeach($all_playlists as $single_playlist)\n\t\t\t\t{\n\t\t\t\t\t# Set the playlist name and id to the $playlists array.\n\t\t\t\t\t$playlists[$single_playlist->id]=$single_playlist->name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t# Set the data member.\n\t\t$this->playlists=$playlists;\n\t}", "function addsongplaylist () {\n\t\techo \"<FONT SIZE=4><B>Adding a song:</B><BR>To add a song to a playlist follow these steps:<BR> <UL><LI>Click <A onclick=\\\"jumpTo('playlist','showavail','width='+window.innerWidth)\\\">here</A> to visit the available songs listing.</LI><BR><LI>Click the 'X' next to the song to add the song to a playlist.</LI></UL>\";\n\t}" ]
[ "0.74938524", "0.6814772", "0.66977537", "0.6677457", "0.62884104", "0.6256722", "0.6244432", "0.62334675", "0.619038", "0.613819", "0.61301005", "0.6116085", "0.5896575", "0.5877378", "0.58477634", "0.58366", "0.5826982", "0.5797926", "0.57957363", "0.5771277", "0.57466936", "0.5695284", "0.5688405", "0.5659511", "0.56581324", "0.5645088", "0.5641406", "0.56320035", "0.56194055", "0.5606585", "0.55713177", "0.5505567", "0.547126", "0.547126", "0.547126", "0.5446908", "0.5433895", "0.5401122", "0.53968287", "0.5368723", "0.5345592", "0.53213936", "0.53101104", "0.53078616", "0.5292171", "0.5291033", "0.52820426", "0.52624595", "0.52590734", "0.52275586", "0.52211803", "0.521937", "0.520306", "0.5197069", "0.5179867", "0.5176214", "0.5172746", "0.51572937", "0.51543576", "0.5150118", "0.51437247", "0.51372087", "0.5130574", "0.5101094", "0.5098084", "0.5094932", "0.50899404", "0.5087574", "0.50809544", "0.50785726", "0.50717604", "0.50633264", "0.5060784", "0.5052942", "0.50526273", "0.50412416", "0.5038553", "0.50225174", "0.50214684", "0.50195044", "0.5018417", "0.5015103", "0.500985", "0.4993887", "0.496288", "0.49519578", "0.4946556", "0.49374852", "0.49351412", "0.49320033", "0.49266902", "0.49263066", "0.49256784", "0.49247107", "0.49243945", "0.49229255", "0.4918522", "0.4917493", "0.49043632", "0.48936403" ]
0.8494195
0
get_from_username get_catalogs This returns the catalogs as an array of ids that this user is allowed to access
get_from_username get_catalogs Это возвращает каталоги в виде массива идентификаторов, которые этот пользователь имеет право просматривать
public function get_catalogs() { if (parent::is_cached('user_catalog',$this->id)) { return parent::get_from_cache('user_catalog',$this->id); } $sql = "SELECT * FROM `user_catalog` WHERE `user`='$user_id'"; $db_results = Dba::read($sql); while ($row = Dba::fetch_assoc($db_results)) { $catalogs[] = $row['catalog']; } parent::add_to_cache('user_catalog',$this->id,$catalogs); return $catalogs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_catalogs()\n\t{\n\t\t$path = 'users/' . $_SESSION['ms_username'] . '/';\n\n\t\t// If user do not have own folder, try to create it.\n\t\tif(! file_exists( $path ) )\n\t\t{\n\t\t\tif(! mkdir( $path, 0777 ) )\n\t\t\t\techo 'Can\\'t create user folder!';\n\n\t\t\treturn array();\n\t\t}\n\n\t\t$handle = opendir( $path );\n\t\t$ret = array();\n\n\t\t// Find all catalogue file, eg. all .txt files\n\t\twhile( $file = readdir( $handle ) )\n\t\t{\n\t\t\t// Do not add . and .. to files listing.\n\t\t\tif( $file != '.' && $file != '..' )\n\t\t\t\t$ret[] = $file;\n\t\t}\n\n\t\t// Return catalogues sorted.\n\t\tasort( $ret );\n\t\treturn $ret;\n\t}", "public function getcatalogs() {\n\t\treturn $this->_client->call(self::getServiceName(), __FUNCTION__, array(), array(), true);\n\t}", "public function getCatalognewmycatalog($user_id=0,$CatalogArray=array()){\n\t $user_id = (int) $user_id;\n\t \n\t if(!$user_id||!$CatalogArray) return array();\n\t \n\t $select = $this->db->select()\t \n\t ->from(array('s'=>'catalognewmycatalog'))\n\t ->where('user=?',$user_id)\n\t ->where(\"catalog in (\".implode(\",\", $CatalogArray).\")\");\n\t //echo $select->__toString().\"<br>\";\n\t return $this->db->fetchAll($select);\t \n\t}", "public function getUserIds();", "public function list_catalogue()\n {\n $catalogue = array();\n foreach ($this->db->select('id, name_catalogue')->order_by('name_catalogue', 'ASC')->get('catalogue')->result_array() as $key => $value) {\n $catalogue[$value['id']] = $value['name_catalogue'];\n }\n return $catalogue;\n }", "public function getShopcoinssubbscribe($user_id=0,$CatalogArray=array()){\n\t $user_id = (int) $user_id;\n\n\t if(!$user_id||!$CatalogArray) return array();\n\t \n\t $select = $this->db->select()\t \n\t ->from(array('s'=>'catalogshopcoinssubscribe'))\n\t ->where('user=?',$user_id)\n\t ->where(\"catalog in (\".implode(\",\", $CatalogArray).\")\");\n\t //echo $select->__toString().\"<br>\";\n\t return $this->db->fetchAll($select);\t \n\t}", "static function getConteneursPrincipals($_userid)\n\t\t{\n\t\t\treturn Db::query(\"SELECT * FROM Objects WHERE ObjectContainer =?\", $id);\n\t\t}", "function getList()\n {\n // Return an array : [0..n][idCatalog, name, description, dateCreate, dateModify, lock, nbGeneration]\n return ($this->babase->DbSelect(\"SELECT * FROM catalog WHERE idGroup='\" . $_SESSION[\"idGroup\"] . \"' ORDER BY idCatalog DESC;\", $null));\n }", "public static function get_catalogs($xmlrpc_object) { \n\n\t\t// Pull out the key\n\t\t$variable = $xmlrpc_object->getParam(0); \n\t\t$key = $variable->scalarval(); \n\n\t\t// Check it and make sure we're super green\n\t\tif (!vauth::session_exists('xml-rpc',$key)) { \n\t\t\tdebug_event('XMLSERVER','Error ' . $_SERVER['REMOTE_ADDR'] . ' with key ' . $key . ' does not match any ACLs','1'); \n\t\t\treturn new XML_RPC_Response(0,'503','Key/IP Mis-match Access Denied'); \n\t\t} \n\n\t\t// Go ahead and gather up the information they are legit\n\t\t$results = array(); \n\n\t\t$sql = \"SELECT `catalog`.`name`,COUNT(`song`.`id`) AS `count`,`catalog`.`id` AS `catalog_id` FROM `catalog` \". \n\t\t\t\"LEFT JOIN `song` ON `catalog`.`id`=`song`.`catalog` WHERE `catalog`.`catalog_type`='local' \" . \n\t\t\t\"GROUP BY `catalog`.`id`\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\twhile ($row = Dba::fetch_assoc($db_results)) { \n\t\t\t$results[] = $row; \n\t\t} \n\n\t\t// We need to set time limit at this point as who know how long this data is going to take\n\t\t// to return to the client\n\t\tset_time_limit(0); \n\n\t\t$encoded_array = XML_RPC_encode($results); \n\t\tdebug_event('XMLSERVER','Returning data about ' . count($results) . ' catalogs to ' . $_SERVER['REMOTE_ADDR'],'5'); \n\n\t\treturn new XML_RPC_Response($encoded_array);\n\t}", "public function getListOfLoggedInUsers($username);", "public function index()\n {\n return Auth::user()->catalogs()->with('movies')->get();\n }", "public function getCatalog($catalogId);", "function __getUsers() {\n\t\t$query = \"SELECT u.customer_id AS id\n\t\t\t\t\t\t\tFROM users u\n\t\t\t\t\t\t\tINNER JOIN users_roles_modules urm ON urm.user_id = u.id\n\t\t\t\t\t\t\tINNER JOIN u_roles_modules rm ON urm.role_modu_id = rm.id\n\t\t\t\t\t\t\tINNER JOIN (SELECT u.id\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM users u\n\t\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN users_roles_modules urm ON urm.user_id = u.id\n\t\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN u_roles_modules rm ON urm.role_modu_id = rm.id\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE rm.module_id = 3\n\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY u.id) t1 ON t1.id = u.id\n\t\t\t\t\t\t\tINNER JOIN (SELECT u.id\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM users u\n\t\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN users_roles_modules urm ON urm.user_id = u.id\n\t\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN u_roles_modules rm ON urm.role_modu_id = rm.id\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE rm.module_id = 13\n\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY u.id) t2 ON t2.id = u.id\n\t\t\t\t\t\t\tWHERE rm.module_id = 2\n\t\t\t\t\t\t\tGROUP BY u.customer_id\";\n\t\t$resQuery = $this->db->query($query);\n\t\treturn $resQuery->result_array();\n\t}", "private function getAuthIdentities(){\n\t\t $auth = new AuthenticationService();\n\t\t return $auth->getIdentity();;\n\t }", "public function catalog()\n {\n $selections = Selection::get();\n\n return view('selections.userlists')->with([\n 'selections' => $selections\n ]);\n }", "function user_xtreamaccounts ($user_id) {\n\t\tglobal $sql;\n\t\t$result = $sql->sql_select_array_query(\"SELECT DISTINCT source_host, source_port, source_username, source_password FROM `playlist` WHERE user_id = '{$user_id}'\");\n\t\t$output = [];\n\t\tforeach ($result as $account) {\n\t\t\tif (!empty($account['source_host']) && !empty($account['source_username']) && !empty($account['source_password'])) {\n\t\t\t\t$output[] = $this->playlist_auth($account['source_host'], $account['source_port'], $account['source_username'], $account['source_password'], true);\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "public static function getArrayCatalog()\n {\n return ArrayHelper::map(BlogCatalog::find()->all(), 'id', 'title');\n }", "function getAuthorizedUserObjByUsername($username){\n $user = R::getRow(\"SELECT id FROM user WHERE username=:username LIMIT 1;\"\n , array(':username' => $username));\n return array('id' => $user['id']);\n }", "private function getInsideSalesReps() {\n\n $sales = DB::table('user_roles')->select('user_id','role')->where('role','inside-sales')->distinct()->get();\n $sales = $sales->pluck('user_id');\n\n $users = DB::table('users')\n ->whereIn('id', $sales)\n ->orderBy('name')\n ->select('id', 'name')\n ->get();\n\n return $users;\n }", "public function getAccounts();", "function loadCatalogs() {\n unset($this->catalogs);\n unset($this->catalogTree);\n $ids = array(0);\n if (isset($this->catalogsOpen) && is_array($this->catalogsOpen)) {\n foreach ($this->catalogsOpen as $catalogId => $opened) {\n if ($opened) {\n $ids[] = (int)$catalogId;\n }\n }\n }\n if (count($ids) > 1) {\n $filter = \" IN ('\".implode(\"', '\", $ids).\"') \";\n } else {\n $filter = \" = '0' \";\n }\n $sql = \"SELECT c.catalog_id, c.catalog_parent, ct.lng_id, ct.catalog_title\n FROM %s AS c\n LEFT OUTER JOIN %s AS ct ON (ct.catalog_id=c.catalog_id AND ct.lng_id = '%d')\n WHERE c.catalog_parent $filter\n ORDER BY ct.catalog_title, c.catalog_id DESC\";\n $params = array($this->tableCatalog,\n $this->tableCatalogTrans,\n $this->lngSelect->currentLanguageId);\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $this->catalogs[(int)$row['catalog_id']] = $row;\n $this->catalogTree[(int)$row['catalog_parent']][] = $row['catalog_id'];\n }\n $this->loadCatalogCounts();\n return TRUE;\n }\n return FALSE;\n }", "function loadUserIds ()\n\t{\n\t\t$ids\t\t\t\t\t= array();\n\n\t\t$query\t\t\t\t\t= '\n\t\t\tSELECT *\n\t\t\tFROM zen_customers_fe_users\n\t\t';\n\n\t\t$result\t\t\t\t\t= $this->db->Execute( $query );\n\n\t\twhile( ! $result->EOF )\n\t\t{\n\t\t\t$this->zcUsers[]\t= $result->fields[ 'customers_id' ];\n\t\t\t$this->t3Users[]\t= $result->fields[ 'uid' ];\n\t\t\t$result->MoveNext();\n\t\t}\n\t}", "public function getApplicationIds($username)\n\t{\n\t\t$application_ids = array();\n\t\tif ($customer = $this->getCustomer($username))\n\t\t{\n\t\t\t$factory = $this->driver->getFactory();\n\t\t\t\n\t\t\tif (method_exists($factory, \"getMasterDb\"))\n\t\t\t{\n\t\t\t\t$db = $factory->getMasterDb();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$db = $factory->getDB();\n\t\t\t}\n\t\t\t\n\t\t\t$application = $factory->getModel('Application', $db);\n\t\t\t\n\t\t\t$applications = $application->loadAllBy(array(\"applicant_account_id\" => $customer->applicant_account_id));\n\t\t\t\n\t\t\tforeach($applications as $app)\n\t\t\t{\n\t\t\t\t$application_ids[] = $app->application_id;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $application_ids;\n\t}", "public function getByUsers();", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function getAllRandomizersForOneUser($username) {\n\n $pdo = DATABASE::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"select * from randomizer where username=? order by id desc\";\n $q = $pdo->prepare($sql);\n $q->execute([$username]);\n $q->setFetchMode(PDO::FETCH_ASSOC);\n $positions = $q->fetchAll();\n\n Database::disconnect();\n \n return $positions; \n\n }", "public function getCatalog($catalog_id){\n\t\t$catalog = self::$model->getDetailById($catalog_id);\n\n\t//\tprint_r($catalog);\n\t\treturn $catalog;\n\n\t}", "private function getCurrentUserGroupIDs() {\n global $CurrentUser;\n $tmp = $CurrentUser->getCurrentUserGroupIDs();\n if(!$tmp) {\n return [];\n }\n $user_categories = array_map(function($a){\n return $a['cid'];\n }, $tmp);\n return $user_categories;\n }", "private function getGroupCatalogIDs($group_id)\n\t{\n\t\t$db = Zend_Registry::get('db');\n\t\t$sql_catalogs = \"Select catalog_id from group_has_catalog where group_id = ?\";\n\t\t$data = $db->fetchAll($db->quoteInto($sql_catalogs, $group_id));\n\n\t\t$ret = array();\n\n\t\tforeach ($data as $row) {\n\t\t\t$ret[] = $row->catalog_id;\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function getProviders($exclude) {\n\t\t// query master\n\t\t$db = $this->getMapper()->getDbTable()->getAdapter();\n\t\t$select = $db->query(\"\n\t\t\tSELECT a.*, c.name as category_name\n\t\t\tFROM po_users AS a\n\t\t\tLEFT JOIN po_users_categories AS c ON a.category_id = c.id\n\t\t\tWHERE a.id != {$exclude}\n\t\t\");\n\n\t\t// return what was found\n\t\treturn $select->fetchAll();\n\t}", "public function getRoles()\n {\n\n $db = $this->getDb();\n\n $sql = <<<SQL\nSELECT\n oid,\n *,\n pg_catalog.shobj_description(oid, 'pg_authid') AS description\nFROM\n pg_authid\nWHERE NOT rolcanlogin\nORDER BY rolname\n\nSQL;\n\n $sql .= \";\";\n\n return $db->select($sql)->getAll();\n\n }", "function getCSCList($username, &$db) {\n\t$rslt = mysql_query('SELECT pqr_csc.*,pqr_roles.name FROM pqr_csc \n\t\tLEFT JOIN pqr_roles ON pqr_roles.role_id = pqr_csc.role_id \n\t\tWHERE pqr_csc.player_id = \"'.$username.'\"');\n\n\tif (!$rslt) die(\"csc sql error: \".mysql_error($db));\n\n\tif (mysql_num_rows($rslt) > 3) {\n\t\tdie(\"More than 3 CSCs detected. Problem.\");\n\t} else {\n\t\t$csclist = null;\n\t\twhile ($row = mysql_fetch_array($rslt,MYSQL_ASSOC)){\n\t\t\t$csclist[] = $row;\n\t\t}\n\t}\n\n\treturn $csclist;\t\n}", "public function get($catalog_id = false)\n\t{\n\t\tif ( !$catalog_id || !is_numeric($catalog_id) ) { return false; }\n\t\t\n\t\t$api = new Rest_Helper(\"https://sandbox.rumblefish.com/v2/catalog_admin\", \"GET\", array(\"id\"=>$catalog_id), $this->data->token);\n\t\t$api->execute();\n\t\t\n\t\treturn json_decode($api->getResponseBody());\n\t}", "function getCatalogues() {\n $query = \"SELECT id, nome FROM catalogo;\";\n $result = queryMysql($query);\n $catalogue = array();\n\n for ($j = 0; $j < $result->num_rows; ++$j) {\n $result->data_seek($j);\n $catalogue[] = $result->fetch_row();\n }\n\n return $catalogue;\n}", "public function get_canbook_userids() {\n //TODO check if course has guest access if not get all enrolled users and check with has_capability if user has right to book\n //$this->canbookusers = get_users_by_capability($this->context, 'mod/booking:choose', 'u.id', 'u.lastname ASC, u.firstname ASC', '', '', '', '', true, true);\n $this->canbookusers = get_enrolled_users($this->context, 'mod/booking:choose', null, 'u.id');\n }", "public function getAccounts(){\n $accountsId = $this->getSession('sessionAccountsKey',array());\n $accounts = array();\n foreach($accountsId as $id){\n $accounts[] = $this->callFunctionInConfigs(\n 'getAccountFunction',\n array($id)\n );\n }\n return $accounts;\n }", "public function getAuthorities();", "public function getUserList();", "public function getMyEntries($username)\n\t{\n\t\t$this->db->select('id');\n\t\t$this->db->where('author', $username );\n\t\t$res = $this->db->get('entries')->result();\n\n\t\t$results = array();\n\t\tif (!empty($res)) {\n\t\t\tforeach ($res as $k => $v) {\n\t\t\t\tarray_push($results, $v->id);\n\t\t\t} \n\t\t}\n\n\t\treturn $results;\n\t}", "public function getUsers()\n {\n $productUsers = array();\n foreach ($this->getCustomer()->getVipUsers() as $user) {\n if ($user->hasPermission('use_product', $this->getId())) {\n $productUsers[] = $user;\n }\n }\n return $productUsers;\n }", "public function getLoginRoles()\n {\n\n $db = $this->getDb();\n\n $sql = <<<SQL\nSELECT\n oid,\n *,\n pg_catalog.shobj_description(oid, 'pg_authid') AS description\nFROM\n pg_authid\nWHERE rolcanlogin\nORDER BY rolname\n\nSQL;\n\n $sql .= \";\";\n\n return $db->select($sql)->getAll();\n\n }", "function getCoursesForUser($sid, $parameters) {\n\t\t\n\t\t$this->initAuth($sid);\n\t\t$this->initIlias();\n\n\t\tif(!$this->__checkSession($sid))\n\t\t{\n\t\t\treturn $this->__raiseError($this->__getMessage(),$this->__getMessageCode());\n\t\t}\t\t\t\n\n\t\tglobal $rbacreview, $ilObjDataCache, $tree;\n\t\t\n\t\tinclude_once 'webservice/soap/classes/class.ilXMLResultSetParser.php';\n\t\t$parser = new ilXMLResultSetParser($parameters);\n\t\ttry {\n\t\t\t$parser->startParsing();\n\t\t} catch (ilSaxParserException $exception) {\n\t\t\treturn $this->__raiseError($exception->getMessage(), \"Client\");\n\t\t}\n\t\t$xmlResultSet = $parser->getXMLResultSet();\n\n\t\tif (!$xmlResultSet->hasColumn (\"user_id\"))\n\t\t\treturn $this->__raiseError(\"parameter user_id is missing\", \"Client\");\n\t\t\t\n\t\tif (!$xmlResultSet->hasColumn (\"status\"))\n\t\t\treturn $this->__raiseError(\"parameter status is missing\", \"Client\");\n\t\t\n\t\t$user_id = (int) $xmlResultSet->getValue (0, \"user_id\");\n\t\t$status = (int) $xmlResultSet->getValue (0, \"status\");\n\t\t\n\t\t$ref_ids = array();\n\n\t\t// get roles\n#var_dump($xmlResultSet);\n#echo \"uid:\".$user_id;\n#echo \"status:\".$status;\n\tif (ilSoapCourseAdministration::MEMBER == ($status & ilSoapCourseAdministration::MEMBER) ||\n\t\t\tilSoapCourseAdministration::TUTOR == ($status & ilSoapCourseAdministration::TUTOR) ||\n\t\t\tilSoapCourseAdministration::ADMIN == ($status & ilSoapCourseAdministration::ADMIN))\n\t\tforeach($rbacreview->assignedRoles($user_id) as $role_id)\n\t\t{\t\t\t\n\t\t\tif($role = ilObjectFactory::getInstanceByObjId($role_id,false))\n\t\t\t{\n\t\t\t\t#echo $role->getType();\n\t\t\t\tif ($role->getType() != \"role\")\n\t\t\t\t\tcontinue;\n\t\t\t\tif ($role->getParent() == ROLE_FOLDER_ID)\n\t\t\t\t{\n\t\t\t\t\t continue;\n\t\t\t\t}\n\t\t\t\t$role_title = $role->getTitle();\n\n\t\t\t\tif ($ref_id = ilUtil::__extractRefId($role_title))\n\t\t\t\t{\n\t\t\t\t\tif (!ilObject::_exists($ref_id, true) || ilObject::_isInTrash($ref_id))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t#echo $role_title;\n\t\t\t\t\tif (ilSoapCourseAdministration::MEMBER == ($status & ilSoapCourseAdministration::MEMBER) && strpos($role_title, \"member\") !== false) \n\t\t\t\t\t{\n\t\t\t\t\t\t$ref_ids [] = $ref_id;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t} elseif (ilSoapCourseAdministration::TUTOR == ($status & ilSoapCourseAdministration::TUTOR) && strpos($role_title, \"tutor\") !== false) \n\t\t\t\t\t{\n\t\t\t\t\t\t$ref_ids [] = $ref_id;\n\t\t\t\t\t} elseif (ilSoapCourseAdministration::ADMIN == ($status & ilSoapCourseAdministration::ADMIN) && strpos($role_title, \"admin\") !== false) \n\t\t\t\t\t{\n\t\t\t\t\t\t$ref_ids [] = $ref_id;\n\t\t\t\t\t} elseif (($status & ilSoapCourseAdministration::OWNER) == ilSoapCourseAdministration::OWNER && $ilObjDataCache->lookupOwner($ilObjDataCache->lookupObjId($ref_id)) == $user_id) \n\t\t\t\t\t{\n\t\t\t\t\t\t$ref_ids [] = $ref_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (($status & ilSoapCourseAdministration::OWNER) == ilSoapCourseAdministration::OWNER) \n\t\t{\n\t\t\t$owned_objects = ilObjectFactory::getObjectsForOwner(\"crs\", $user_id);\n\t\t\tforeach ($owned_objects as $obj_id) {\n\t\t\t\t$allrefs = ilObject::_getAllReferences($obj_id);\n\t\t\t\tforeach($allrefs as $r)\n\t\t\t\t{\n\t\t\t\t\tif($tree->isDeleted($r))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($tree->isInTree($r))\n\t\t\t\t\t{\n\t\t\t\t\t\t$refs[] = $r;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count($refs) > 0)\n\t\t\t\t\t$ref_ids[] = array_pop($refs);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$ref_ids = array_unique($ref_ids);\n\t\t\n\t\t\n\t\t\n\t\t$ref_ids = array_unique($ref_ids);\n#print_r($ref_ids);\t\t\n\t\tinclude_once 'webservice/soap/classes/class.ilXMLResultSetWriter.php';\n\t\tinclude_once 'Modules/Course/classes/class.ilObjCourse.php';\n\t\tinclude_once 'Modules/Course/classes/class.ilCourseXMLWriter.php';\n\n\t\t$xmlResultSet = new ilXMLResultSet();\n\t\t$xmlResultSet->addColumn(\"ref_id\");\n\t\t$xmlResultSet->addColumn(\"xml\");\n\t\t$xmlResultSet->addColumn(\"parent_ref_id\");\n\n\t\tglobal $ilUser;\n\t\t//#18004\n\t\t// Enable to see own participations by reducing the needed permissions\n\t\t$permission = $user_id == $ilUser->getId() ? 'read' : 'write';\n\t\t\n\t\tforeach ($ref_ids as $course_id) {\n\t\t\t$course_obj = $this->checkObjectAccess($course_id,\"crs\",$permission, true);\n\t\t\tif ($course_obj instanceof ilObjCourse) {\n\t\t\t\t$row = new ilXMLResultSetRow();\t\t\t\t\n\t\t\t\t$row->setValue(\"ref_id\", $course_id);\n\t\t\t\t$xmlWriter = new ilCourseXMLWriter($course_obj);\n\t\t\t\t$xmlWriter->setAttachUsers(false);\t\t\t\t\n\t\t\t\t$xmlWriter->start();\n\t\t\t\t$row->setValue(\"xml\", $xmlWriter->getXML());\n\t\t\t\t$row->setValue(\"parent_ref_id\", $tree->getParentId($course_id));\n\t\t\t\t$xmlResultSet->addRow($row);\n\t\t\t}\n\t\t}\n\t\t$xmlResultSetWriter = new ilXMLResultSetWriter($xmlResultSet);\n\t\t$xmlResultSetWriter->start();\n\t\treturn $xmlResultSetWriter->getXML();\n\t}", "public function getUsersCalendars() {\n $userId = SPC_USERID;\n\t\t$role = SPC_USER_ROLE;\n\t\t$adminId = SPC_ADMINID;\n\n $db = new SpcDb();\n $activeUserCalendars = SpcCalendar::getActiveUserCals($adminId);\n\n\t\t//get this admin's users' spc_calendar_calendars\n\t\tif ($role == 'admin') {\n\t\t\t$sql = \"SELECT\n\t\t\t\t\t\tspc_users.id AS user_id,\n\t\t\t\t\t\tspc_users.username,\n\t\t\t\t\t\tspc_calendar_calendars.id AS cal_id,\n\t\t\t\t\t\tspc_calendar_calendars.name AS cal_name,\n\t\t\t\t\t\tspc_calendar_calendars.color,\n\t\t\t\t\t\tspc_calendar_calendars.status\n\t\t\t\t\tFROM\n\t\t\t\t\t\tspc_users\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tspc_calendar_calendars ON spc_users.id = spc_calendar_calendars.user_id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tspc_users.admin_id = $userId\n AND\n spc_users.role = 'user'\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tspc_users.username, spc_calendar_calendars.name\";\n\n\t\t\t$rs = $db->query($sql);\n\n\t\t\t$users = array();\n\t\t\twhile ($row = mysql_fetch_assoc($rs)) {\n\t\t\t\t$row['status'] = 'off';\n\t\t\t\tif (in_array($row['cal_id'], $activeUserCalendars)) {\n\t\t\t\t\t$row['status'] = 'on';\n\t\t\t\t}\n\n\t\t\t\t$users[$row['username']][] = $row;\n\t\t\t}\n\n\t\t\techo Spc::jsonEncode(array('users' => $users));\n\n\t\t} else if ($role == 'super') {\n\t\t\t//get admins\n\t\t\t$sql = \"SELECT\n\t\t\t\t\t\tspc_users.id,\n\t\t\t\t\t\tspc_users.username,\n\t\t\t\t\t\tspc_calendar_calendars.id AS cal_id,\n\t\t\t\t\t\tspc_calendar_calendars.name AS cal_name,\n\t\t\t\t\t\tspc_calendar_calendars.color,\n\t\t\t\t\t\tspc_calendar_calendars.status\n\t\t\t\t\tFROM\n\t\t\t\t\t\tspc_users\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tspc_calendar_calendars ON spc_users.id = spc_calendar_calendars.user_id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tspc_users.role = 'admin'\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tspc_users.username, spc_calendar_calendars.name\";\n\n\t\t\t$rs = $db->query($sql);\n\n\t\t\t$admins = array();\n\t\t\twhile ($row = mysql_fetch_assoc($rs)) {\n\t\t\t\t$row['status'] = 'off';\n\t\t\t\tif (in_array($row['cal_id'], $activeUserCalendars)) {\n\t\t\t\t\t$row['status'] = 'on';\n\t\t\t\t}\n\n\t\t\t\t$admins[$row['id']]['calendars'][] = $row;\n\t\t\t\t$admins[$row['id']]['username'] = $row['username'];\n\t\t\t}\n\n\t\t\t//add users\n\t\t\t$sql = \"SELECT\n\t\t\t\t\t\tspc_users.id AS user_id,\n\t\t\t\t\t\tspc_users.admin_id,\n\t\t\t\t\t\tspc_users.username,\n\t\t\t\t\t\tspc_calendar_calendars.id AS cal_id,\n\t\t\t\t\t\tspc_calendar_calendars.name AS cal_name,\n\t\t\t\t\t\tspc_calendar_calendars.color,\n\t\t\t\t\t\tspc_calendar_calendars.status\n\t\t\t\t\tFROM\n\t\t\t\t\t\tspc_users\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tspc_calendar_calendars ON spc_users.id = spc_calendar_calendars.user_id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tspc_users.role = 'user'\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tspc_users.username, spc_calendar_calendars.name\";\n\n\t\t\t$rs = $db->query($sql);\n\n\t\t\twhile ($row = mysql_fetch_assoc($rs)) {\n\t\t\t\t$row['status'] = 'off';\n\t\t\t\tif (in_array($row['cal_id'], $activeUserCalendars)) {\n\t\t\t\t\t$row['status'] = 'on';\n\t\t\t\t}\n\n\t\t\t\t$admins[$row['admin_id']]['users'][$row['username']][] = $row;\n\t\t\t}\n\n\t\t\techo Spc::jsonEncode(array('admins' => $admins));\n\n\t\t} else {\n\t\t\techo Spc::jsonEncode(array('users' => '{}'));\n\t\t}\n }", "private function _getUserList(){\n\t\t/* variable initialization */\n\t\t$strReturnArr = array();\n\t\t\n\t\t/* Get user list objects */\n\t\t$strReturnArr\t= $this->_objDataOperation->getDirectQueryResult(\"select user_name, id from \".$this->_strPrimaryTableName.\" where deleted = 0 order by user_name\");\n\t\t\n\t\t/* return the user list array */\n\t\treturn $strReturnArr;\n\t}", "function getSelCourse($username){\n\trequire('../../mysqli_connect.php');\n\t$SelCoArr = array();\n\t$query = \"select code from SelCourseDetail join StuCourse where StuCourse.cocode = SelCourseDetail.code and stuid = '$username'\";\n\t$r = @mysqli_query($dbc, $query);\n\twhile ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)){\n\t\tarray_push($SelCoArr, $row['code']);\n\t\techo $row['code'].'<br>';\n\t}\n\tmysqli_free_result($r);\n\treturn $SelCoArr;\n}", "function getUserListbyCourse($course_id) {\n $users = $this->find('first', array(\n 'conditions' => array('Course.id' => $course_id),\n 'contain' => array('Enrol')\n ));\n return Set::extract($users, '/Enrol/id');\n }", "public function index()\n\t{\n\t\t$catalogs = $this->catalog->all();\n if(Request::ajax()){\n $catalogs = Role::where('catalog', 'like', '%'.Input::get('term', '').'%')->get(array('id','catalog'));\n }\n return View::make('catalogs.index', compact('catalogs'));\n\t}", "public function getCatalogObjectIds(): ?array\n {\n return $this->catalogObjectIds;\n }", "function getCategories() {\n\t\t$user_handler = new userHandler();\n\t\t$conn = $user_handler->getConnection();\n\t\tif ($conn != null) {\n\t\t\t$query = mysqli_query($conn, 'SELECT * FROM Category');\n\t\t\tif ($query) {\n\t\t\t\t$rows = mysqli_fetch_all($query,MYSQLI_ASSOC);\n\t\t\t\tif (count($rows) > 0) {\t\t\t\t\n\t\t\t\t\treturn $rows;\n\t\t\t\t}\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}", "public function get_user_courses () {\n\t\t//\n\t}", "public function getUser(string $username): array;", "function current_user_has_products()\n{\n\n $current_user_has_products_array = array();\n\n if (function_exists('digimember_listAccessableContent')) :\n $current_user_has_products = digimember_listAccessableContent('page', 'content');\n\n foreach ($current_user_has_products as $current_user_has_product) :\n $current_user_has_products_array[] = $current_user_has_product['product_id'];\n endforeach;\n endif;\n\n //gibt das Array mit allen Prdoukt-Ids zurück, auf die der User Zugriff hat\n return $current_user_has_products_array;\n}", "public function get_course_users() {\r\n global $COURSE, $DB;\r\n $userids = array();\r\n\r\n $context = context_course::instance($COURSE->id);\r\n $query = '\r\n SELECT u.id AS id\r\n FROM {role_assignments} AS a, {user} AS u\r\n WHERE contextid=' . $context->id . ' AND roleid<>0 AND a.userid=u.id;';\r\n\r\n $rs = $DB->get_recordset_sql($query);\r\n\r\n foreach( $rs as $r ) {\r\n $userids[] = $r->id;\r\n }\r\n return $userids;\r\n }", "public function show_all_cart()\n\t{\n\t\t$id_user = $this->session->userdata('id_user');\n\t\t$this->db->where('id_cs IN (SELECT id_cs FROM cart WHERE id_user = '.$id_user.')', NULL, FALSE);\n\t\t$query = $this->db->get('course');\n\t\treturn $query->result_array();\n\t\t#SELECT * FROM course WHERE id_cs IN (SELECT id_cs FROM cart WHERE id_user = 1)\n\t}", "function get_accounts() {\n $conn = db_connect();\n $userid = $_SESSION[\"userid\"];\n $sql = \"select * from dulaney_stewart_accounts where userid = $userid\";\n $query_result = mysqli_query($conn, $sql);\n return db_result_to_array($query_result);\n}", "public function getversions($catalog, $id, $catalogname = null) {\n\t\treturn $this->_client->call(self::getServiceName(), __FUNCTION__, array( $catalog, $id ), array(\n\t\t\t'catalogname' => $catalogname\n\t\t), true);\n\t}", "public function SelectCredencials() {\n\n $query = $this->conection->query(\"SELECT username,password,idroles FROM users\");\n $result = array();\n while ($rst = $this->conection->result($query)) {\n\n $temp = null;\n $user = $rst[\"username\"];\n $pass = $rst[\"password\"];\n $rol = $rst[\"idroles\"];\n $temp = new Login($user, $pass, $rol);\n array_push($result, $temp);\n }\n\n $this->conection->free($query);\n return $result;\n }", "function get_nonauthor_user_ids()\n{\n}", "public function fetchActiveIds();", "abstract public function getIds();", "function get_author_user_ids()\n{\n}", "public function index()\n {\n return $this->user->categories;\n }", "public function getUserDetails($username)\n {\n /* @var $user \\common\\models\\User */\n $user = static::find()->where(['username' => $username])->one();\n return [\n 'user_id' => $user->getId()\n ];\n }", "public function getUserIds()\n {\n return $this->users->lists('id')->toArray();\n }", "public function getCategoriesByCatalog() \n\t{\n\t\t$table = Category::$table;\n\t\t$sqlMale = \"select * from {$table} where gender='male'\";\n\t\t$catesByMale = Category::query($sqlMale);\n\n\t\t$sqlFemale = \"select * from {$table} where gender='female'\";\n\t\t$catesByFemale = Category::query($sqlFemale);\n\n\t\t$data = [\n\t\t\t\"male\" => $catesByMale,\n\t\t\t\"female\" => $catesByFemale\n\t\t];\n\t\t$success = \"Success\";\n\t\t$failure = \"Failure\";\n\t\tFunctions::returnAPI($data, $success, $failure);\n\t}", "public function getUsersArray() {\n $criteria = new CDbCriteria();\n $criteria->select = \"id,username\";\n $data = CHtml::listData($this->findAll($criteria), \"id\", \"username\");\n return $data;\n }", "public function getIds();", "public function getSpecificUser($username){\n\t\t\treturn parent::getResultSetAsArray(\"SELECT * FROM users WHERE username = '$username'\");\n\t\t}", "public function getMyCourses()\n {\n return auth()->user()->getCourses();\n }", "public function getAllCat_User(){\r\n return $this->query('SELECT * from ' . self::$table_name. ' where status = 1');\r\n }", "public function getComics ($userid) {\n $query = \"SELECT * FROM collection WHERE \".\n \"userid=:userid\";\n $sth = $this->prepare($query);\n if ($sth->execute(array(':userid' => $userid))) {\n $data = $sth->fetchAll();\n return $data;\n } else {\n print_r($this->errorInfo());\n }\n }", "function getDivisions()\n{\n return \\Auth::user()->divisions->pluck('id')->toArray();\n}", "public function forUser(Request $request)\n {\n $userId = $request->user()->getKey();\n $userRoles = UserRoles::where('user_id', $userId)->get();\n\n $nonOwnedClients = [];\n\n foreach($userRoles as $role) {\n array_push($nonOwnedClients, (Client::find($role->client_id)));\n }\n $nonOwnedClients = collect(array_filter($nonOwnedClients));\n $userClients = resolve(ClientController::class)->forUser($request);\n\n foreach ($nonOwnedClients as $client) {\n if (!$userClients->contains('id', $client->id)) {\n $userClients->push($client);\n }\n }\n return $userClients;\n }", "function &getUserIds($objectId) {\n\t\t$result =& $this->retrieve(\n\t\t\t\t'SELECT user_id FROM object_for_review_assignments WHERE object_id = ?',\n\t\t\t\t(int) $objectId\n\t\t);\n\n\t\t$userIds = array();\n\t\twhile (!$result->EOF) {\n\t\t\t$userIds[] = $result->fields[0];\n\t\t\t$result->MoveNext();\n\t\t}\n\t\t$result->Close();\n\t\treturn $userIds;\n\t}", "function enrollments_getAll($username)\r\n{\r\n\tlist($dbc, $error) = connect_to_database();\r\n\r\n\t$username_safe = mysqli_real_escape_string($dbc,$username); //protect ourselves\r\n\t\r\n\t$results = mysqli_query($dbc,\"select * from Enrollment join Tbl_Courses on Enrollment.course_id = Tbl_Courses.course_id where username='$username_safe'\");\r\n\t\r\n\t$allEnrollments = array();\r\n\t\r\n\tif ($results)\r\n\t{\r\n\t\twhile ($enrollment = mysqli_fetch_array($results,MYSQLI_ASSOC))\r\n\t\t{\r\n\t\t\t$allEnrollments[] = $enrollment;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $allEnrollments;\r\n}", "function ca_get_logged_client_accounts()\n{\n global $g_table_prefix;\n\n $query = mysql_query(\"\n SELECT account_id, a.first_name, a.last_name\n FROM {$g_table_prefix}accounts a\n WHERE account_id IN (\n SELECT account_id\n FROM {$g_table_prefix}module_client_audit_changes mcac\n GROUP BY account_id\n )\n ORDER BY a.last_name\n \");\n\n $accounts = array();\n while ($row = mysql_fetch_assoc($query))\n $accounts[] = $row;\n\n return $accounts;\n}", "public function read_all() {\n try {\n $result = array();\n $sql = \"SELECT * FROM customers;\";\n $p_sql = Connection::getInstance(ABSPATH . 'configdb.ini')->prepare($sql);\n if ($p_sql->execute()) {\n foreach ($p_sql->fetchAll(PDO::FETCH_ASSOC) as $data) {\n $result[] = $this->setUser($data);\n }\n return $result;\n } else {\n return 'No match found!';\n }\n } catch (Exception $e) {\n print($e);\n }\n }", "public function getUserClients(){\n // get user's clients\n $clientCollection = Auth::user()->clients;\n $clients = [];\n foreach($clientCollection as $client){\n $clients[$client->id] = \"($client->firstname) &nbsp; $client->email\";\n }\n return $clients;\n }", "function getUserList()\n\t{\n\t\t$db = &atkGetDb(atkconfig(\"auth_database\"));\n\t\t$query = \"SELECT * FROM \".atkconfig(\"auth_usertable\");\n\n\t\t$accountdisablefield = atkconfig(\"auth_accountdisablefield\");\n\t\t$accountenableexpression = atkconfig(\"auth_accountenableexpression\");\n\t\tif ($accountenableexpression!=\"\")\n\t\t{\n\t\t\t$query.= \" WHERE $accountenableexpression\";\n\t\t\tif ($accountdisablefield!=\"\") $query.= \" AND $accountdisablefield = 0\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($accountdisablefield!=\"\") $query.= \" WHERE $accountdisablefield = 0\";\n\t\t}\n\n\t\t$recs = $db->getrows($query);\n\n\t\t$userlist = array();\n\t\tatkimport(\"atk.utils.atkstringparser\");\n\t\t$stringparser = new atkStringParser(atkconfig(\"auth_userdescriptor\"));\n\t\tfor ($i=0, $_i=count($recs); $i<$_i; $i++)\n\t\t{\n\t\t\t$userlist[] = array(\"userid\"=>$recs[$i][atkconfig(\"auth_userfield\")], \"username\"=>$stringparser->parse($recs[$i]));\n\t\t}\n\t\tusort($userlist, array(\"auth_db\", \"userListCompare\"));\n\t\treturn $userlist;\n\t}", "function purchases_getAll($username)\n{\n\tlist($dbc, $error) = connect_to_database();\n\n\t$username_safe = mysqli_real_escape_string($dbc,$username); //protect ourselves\n\t\n\t$results = mysqli_query($dbc,\"select * from purchases join books on purchases.book = books.id where username='$username_safe'\");\n\t\n\t$allPurchases = array();\n\t\n\tif ($results)\n\t{\n\t\twhile ($purchase = mysqli_fetch_array($results,MYSQLI_ASSOC))\n\t\t{\n\t\t\t$allPurchases[] = $purchase;\n\t\t}\n\t}\n\t\n\treturn $allPurchases;\n}", "public function get_catalog() {\n return $this->thecatalog;\n }", "function relevant_users()\n{\n\treturn get_users('orderby=nicename&role=' . role_name);\n}", "public function pullClientUsers();", "public function getposusernames()\n\n\t{\n\t\t$resource = Mage::getSingleton('core/resource');\n\t\t$pos_sales_report = $resource->getTableName('pos_sales_report');\n\t\t$connection = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n\t\t$select = $connection->select()->distinct()->from($pos_sales_report, array('pos_user_id','pos_user_name'));//->where('pos_user_name=?',$temp_id);\n\n\t\t$rowArray =$connection->fetchAll($select); //return row\n\n\t\treturn $rowArray;\n\n\t\t//echo'<pre>','test';print_r($rowArray);die;\n\n\t}", "function getRoles ();", "public function getRoles();", "public function getRoles();", "public function getRoles();", "public function getRoles();", "public function getRoles();", "public function getRoles();", "public function getRoles();", "public function getRoles();", "public function getRoles();", "public function getRoles();", "public function getRoles(): array;", "public function getRoles(): array;", "public function getRoles(): array;" ]
[ "0.7094233", "0.6450845", "0.6252153", "0.6244553", "0.583282", "0.5808359", "0.57713056", "0.5704983", "0.56388474", "0.55459875", "0.55207855", "0.55207276", "0.55106306", "0.55095416", "0.55074275", "0.54700476", "0.5455806", "0.5423002", "0.541856", "0.5398614", "0.5396017", "0.5382902", "0.53818595", "0.53745115", "0.5367425", "0.5367425", "0.5367425", "0.5354225", "0.53327656", "0.53196234", "0.5313128", "0.5309904", "0.5306927", "0.5293398", "0.52762717", "0.5274681", "0.5274177", "0.52714664", "0.52624726", "0.5259148", "0.5258904", "0.5258087", "0.5250828", "0.52338904", "0.5211966", "0.5208683", "0.520798", "0.520473", "0.51990926", "0.5195399", "0.51953566", "0.5192609", "0.5190593", "0.5188185", "0.51838666", "0.5180885", "0.51772374", "0.5171908", "0.5168144", "0.5164381", "0.5158354", "0.514902", "0.51480705", "0.5147414", "0.5144298", "0.5136204", "0.5134872", "0.51268315", "0.5123225", "0.5119865", "0.5119248", "0.5117164", "0.51147527", "0.51143426", "0.51098245", "0.5107842", "0.5102761", "0.50998753", "0.5099648", "0.5091375", "0.5090264", "0.50899166", "0.5086165", "0.5081555", "0.50815445", "0.5081209", "0.5078868", "0.50758946", "0.50758946", "0.50758946", "0.50758946", "0.50758946", "0.50758946", "0.50758946", "0.50758946", "0.50758946", "0.50758946", "0.5075874", "0.5075874", "0.5075874" ]
0.757351
0
get_preferences set_preferences sets the prefs for this specific user
get_preferences set_preferences устанавливает prefs для этого конкретного пользователя
public function set_preferences() { $user_id = Dba::escape($this->id); $sql = "SELECT preference.name,user_preference.value FROM preference,user_preference WHERE user_preference.user='$user_id' " . "AND user_preference.preference=preference.id AND preference.type != 'system'"; $db_results = Dba::query($sql); while ($r = Dba::fetch_assoc($db_results)) { $key = $r['name']; $this->prefs[$key] = $r['value']; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user_pref_set( $p_user_id, $p_prefs, $p_project_id = ALL_PROJECTS ) {\n\tif( user_pref_exists( $p_user_id, $p_project_id ) ) {\n\t\treturn user_pref_update( $p_user_id, $p_project_id, $p_prefs );\n\t} else {\n\t\treturn user_pref_insert( $p_user_id, $p_project_id, $p_prefs );\n\t}\n}", "function user_pref_set_pref( $p_user_id, $p_pref_name, $p_pref_value, $p_project_id = ALL_PROJECTS ) {\n\t$t_prefs = user_pref_get( $p_user_id, $p_project_id );\n\n\t$t_prefs->$p_pref_name = $p_pref_value;\n\n\tuser_pref_set( $p_user_id, $t_prefs, $p_project_id );\n\n\treturn true;\n}", "public function set_user($user)\n {\n if (is_object($user)) {\n $this->user = $user;\n\n // overwrite config with user preferences\n $this->config->set_user_prefs((array)$this->user->get_prefs());\n }\n }", "function user_pref_update( $p_user_id, $p_project_id, $p_prefs ) {\n\tstatic $t_vars;\n\t$c_user_id = db_prepare_int( $p_user_id );\n\t$c_project_id = db_prepare_int( $p_project_id );\n\n\tuser_ensure_unprotected( $p_user_id );\n\n\t$t_user_pref_table = db_get_table( 'mantis_user_pref_table' );\n\n\tif ($t_vars == null ) {\n\t\t$t_vars = getClassProperties( 'UserPreferences', 'protected');\n\t}\n\n\t$t_pairs = array();\n\t$t_values = array();\n\n\tforeach( $t_vars as $var => $val ) {\n\t\tarray_push( $t_pairs, \"$var = \" . db_param() ) ;\n\t\tarray_push( $t_values, $p_prefs->$var );\n\t}\n\n\t$t_pairs_string = implode( ', ', $t_pairs );\n\t$t_values[] = $c_user_id;\n\t$t_values[] = $c_project_id;\n\n\t$query = \"UPDATE $t_user_pref_table\n\t\t\t\t SET $t_pairs_string\n\t\t\t\t WHERE user_id=\" . db_param() . \" AND project_id=\" . db_param();\n\tdb_query_bound( $query, $t_values );\n\n\tuser_pref_clear_cache( $p_user_id, $p_project_id );\n\n\t# db_query errors on failure so:\n\treturn true;\n}", "public function storePrefs() {\r\n\r\n\t\t// Database shizms! :)\r\n\t\tglobal $DB;\r\n\r\n\t\t// Serialize the object, so MySQL wont choke.\r\n\t\t$serializedPrefs = serialize($this->preferences);\r\n\r\n\t\t// And store the string.\r\n\t\t$DB->query(\"UPDATE users SET preferences = '\" . $serializedPrefs . \"' where ID='\" . $this->UserID . \"'\");\r\n\r\n\t\t// Update the session, too.\r\n\t\t$_SESSION[PREFS] = serialize($this->preferences);\r\n\t}", "public static function setPreferences(array $preferences)\n {\n static::$preferences = $preferences;\n }", "function fillPrefsCache($user) {\n global $prefs_cache, $use_pdo, $pdo_show_sql_errors;\n\n if (!$this->open()) {\n return;\n }\n\n $prefs_cache = array();\n if ($use_pdo) {\n if (!($sth = $this->dbh->prepare('SELECT ' . $this->identifier_quote_char . $this->key_field . $this->identifier_quote_char . ' AS prefkey, ' . $this->identifier_quote_char . $this->val_field . $this->identifier_quote_char . ' AS prefval FROM ' . $this->identifier_quote_char . $this->table . $this->identifier_quote_char . ' WHERE ' . $this->identifier_quote_char . $this->user_field . $this->identifier_quote_char . ' = ?'))) {\n if ($pdo_show_sql_errors)\n $this->error = implode(' - ', $this->dbh->errorInfo());\n else\n $this->error = _(\"Could not prepare query\");\n $this->failQuery();\n }\n if (!($res = $sth->execute(array($user)))) {\n if ($pdo_show_sql_errors)\n $this->error = implode(' - ', $sth->errorInfo());\n else\n $this->error = _(\"Could not execute query\");\n $this->failQuery();\n }\n\n while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {\n $prefs_cache[$row['prefkey']] = $row['prefval'];\n }\n } else {\n $query = sprintf(\"SELECT %s as prefkey, %s as prefval FROM %s \".\n \"WHERE %s = '%s'\",\n $this->key_field,\n $this->val_field,\n $this->table,\n $this->user_field,\n $this->dbh->quoteString($user));\n $res = $this->dbh->query($query);\n if (DB::isError($res)) {\n $this->failQuery($res);\n }\n\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $prefs_cache[$row['prefkey']] = $row['prefval'];\n }\n }\n }", "function setPref($data_dir, $username, $pref_name, $value) {\n global $prefs_cache;\n\n if (isset($prefs_cache[$pref_name]) && ($prefs_cache[$pref_name] == $value)) {\n return;\n }\n\n if ($value === '') {\n removePref($data_dir, $username, $pref_name);\n return;\n }\n\n $db = new dbPrefs;\n if(isset($db->error)) {\n $db->failQuery();\n }\n\n $db->setKey($username, $pref_name, $value);\n $prefs_cache[$pref_name] = $value;\n assert_options(ASSERT_ACTIVE, 1);\n assert_options(ASSERT_BAIL, 1);\n assert ('$value == $prefs_cache[$pref_name]');\n sqsession_register($prefs_cache , 'prefs_cache');\n return;\n}", "public static function onGetPreferences( $user, &$defaultPreferences ) {\n global $wgOAuth2Client;\n\n if(OAuth2Helper::isExternalUser($user) && $defaultPreferences['password']) {\n $url = $wgOAuth2Client['config']['change_endpoint'];\n // https://github.com/wikimedia/mediawiki-extensions-GlobalPreferences/blob/master/GlobalPreferences.hooks.php\n $link = '<a href=\"' . $url . '\" target=\"_blank\">' . wfMessage( 'prefs-resetpass' )->escaped() . '</a>';\n $defaultPreferences['password'] = [\n 'type' => 'info',\n 'raw' => true,\n 'default' => $link,\n 'label-message' => 'yourpassword',\n 'section' => 'personal/info',\n ];\n }\n }", "public static function onGetPreferences( $user, &$defaultPreferences ) {\n\t\tglobal $wgLang;\n\t\t// Overwrite core edit count\n\t\t$defaultPreferences['editcount']['default'] =\n\t\t\t$wgLang->formatNum( self::getRealEditcount( $user ) );\n\t}", "public function setUsersPreferences($uPrefs, $userId){\n\t\t$this->setTable('users_preferences');\n\t\tforeach ($uPrefs as $value) {\n\t\t\t$this->insert(['user_id' => $userId, 'categorie_id' => $value]);\n\t\t}\n\t}", "public function setValueForUser($_preferenceName, $_value, $_accountId, $_ignoreAcl = FALSE)\n {\n // check acl first\n $userId = $this->_getAccountId();\n if(!$_ignoreAcl){\n if (\n $_accountId !== $userId\n && !Tinebase_Acl_Roles::getInstance()->hasRight($this->_application, $userId, Rights_Abstract::ADMIN)\n ) {\n throw new Tinebase_Exception_AccessDenied('You are not allowed to change the preferences.');\n }\n }\n \n $this->resetAppPrefsCache();\n \n // check if already there -> update\n $queryResult = $this->_getPrefs($_preferenceName, $_accountId, Rights::ACCOUNT_TYPE_USER);\n $prefArray = NULL;\n // need to fetch preference for user account as _getPrefs() returns prefs for ANYONE, too\n foreach ($queryResult as $row) {\n if ($row['account_type'] === Rights::ACCOUNT_TYPE_USER) {\n $prefArray = $row;\n break;\n }\n }\n \n if ($prefArray === NULL) {\n if ($_value !== Tinebase_Model_Preference::DEFAULT_VALUE) {\n // no preference yet -> create\n $preference = new Tinebase_Model_Preference(array(\n 'application_id' => Application::getInstance()->getApplicationByName($this->_application)->getId(),\n 'name' => $_preferenceName,\n 'value' => $_value,\n 'account_id' => $_accountId,\n 'account_type' => Rights::ACCOUNT_TYPE_USER,\n 'type' => Tinebase_Model_Preference::TYPE_USER,\n 'recordConfig' => $this->_getPrefRecordConfig($_preferenceName),\n ));\n $this->create($preference);\n $action = 'Created';\n } else {\n $action = 'No action required';\n }\n\n } else {\n $preference = $this->_rawDataToRecord($prefArray);\n\n if ($preference->locked && ! $_ignoreAcl\n // TODO allow this for admins?\n /* && !Tinebase_Acl_Roles::getInstance()->hasRight(\n $this->_application,\n $userId,\n Rights_Abstract::ADMIN\n ) */) {\n throw new Tinebase_Exception_AccessDenied('You are not allowed to change the locked preference.');\n }\n\n if ($_value === Tinebase_Model_Preference::DEFAULT_VALUE) {\n // delete if new value = use default\n $this->delete($preference->getId());\n $action = 'Reset';\n } else {\n $preference->value = $_value;\n $preference->recordConfig = $this->_getPrefRecordConfig($_preferenceName);\n $this->update($preference);\n $action = 'Updated';\n }\n }\n \n $this->resetAppPrefsCache();\n \n if (Core::isLogLevel(LogLevel::DEBUG)) Core::getLogger()->debug(__METHOD__ . '::' . __LINE__\n . ' ' . $action . ': ' . $_preferenceName . ' for user ' . $_accountId . ' -> '\n . (is_array($_value) ? print_r($_value, true) : $_value));\n }", "private function load_user_preferences($userid) {\n global $DB;\n\n $preferences = new stdClass;\n $preferences->receivecopies = false;\n\n if ($prefs = $DB->get_records('block_jmail_preferences', array('userid' => $userid, 'courseid' => $this->course->id))) {\n foreach ($prefs as $pref) {\n $prefname = $pref->name;\n $preferences->$prefname = $pref->value;\n }\n }\n\n return $preferences;\n }", "function set_pref($pref, $pref_value='default', $itemid=null) {\n $fullprefname = 'grade_report_' . $pref;\n if ($pref_value == 'default') {\n return unset_user_preference($fullprefname.$itemid);\n } else {\n return set_user_preference($fullprefname.$itemid, $pref_value);\n }\n }", "static function setUserPreferenceParameter($name, $value)\n\t{\n\t\ttry {\n\t\t\t$dir = self::$us->users_dir;\n\t\t\tif( ! file_exists( $dir ) ) mkdir($dir, 0700);\n\n\t\t\t$dir = $dir . self::getSessionParameter('name');\n\t\t\tif( ! file_exists( $dir ) ) mkdir($dir, 0700);\n\n\t\t\t$dir = $dir . \"/prefs\";\n\t\t\tif( ! file_exists( $dir ) ) mkdir($dir, 0700);\n\n\t\t\tfile_put_contents(\"$dir/$name\", $value);\n\t\t}\n\t\tcatch(ErrorException $e){\n\t\t\tthrow new RuntimeException($e->getMessage());\n\t\t}\n\t}", "public function onGetPreferences( $user, &$preference ) {\n\t\t$preference['watchlisthidesubpages'] = [\n\t\t\t'type' => 'toggle',\n\t\t\t'section' => 'watchlist/changeswatchlist',\n\t\t\t'label-message' => 'tog-watchlisthidesubpages',\n\t\t];\n\t\tif ( $this->config->get( MainConfigNames::EnotifWatchlist ) ) {\n\t\t\t$preference['enotifwatchlistsubpages'] = [\n\t\t\t\t'type' => 'toggle',\n\t\t\t\t'section' => 'personal/email',\n\t\t\t\t'label-message' => 'tog-enotifwatchlistsubpages'\n\t\t\t];\n\t\t}\n\t}", "function user_pref_get( $p_user_id, $p_project_id = ALL_PROJECTS ) {\n\tstatic $t_vars;\n\tglobal $g_cache_current_user_pref;\n\n\tif ( isset( $g_cache_current_user_pref[(int)$p_project_id] ) &&\n\t\tauth_is_user_authenticated() &&\n\t\tauth_get_current_user_id() == $p_user_id ) {\n\t\treturn $g_cache_current_user_pref[(int)$p_project_id];\n\t}\n\n\t$t_prefs = new UserPreferences( $p_user_id, $p_project_id );\n\n\t$row = user_pref_cache_row( $p_user_id, $p_project_id, false );\n\n\t# If the user has no preferences for the given project\n\tif( false === $row ) {\n\t\tif( ALL_PROJECTS != $p_project_id ) {\n\t\t\t# Try to get the prefs for ALL_PROJECTS (the defaults)\n\t\t\t$row = user_pref_cache_row( $p_user_id, ALL_PROJECTS, false );\n\t\t}\n\n\t\t# If $row is still false (the user doesn't have default preferences)\n\t\tif( false === $row ) {\n\t\t\t# We use an empty array\n\t\t\t$row = array();\n\t\t}\n\t}\n\n\tif ($t_vars == null ) {\n\t\t$t_vars = getClassProperties( 'UserPreferences', 'protected');\n\t}\n\n\t$t_row_keys = array_keys( $row );\n\n\t# Check each variable in the class\n\tforeach( $t_vars as $var => $val ) {\n\t\t# If we got a field from the DB with the same name\n\t\tif( in_array( $var, $t_row_keys, true ) ) {\n\t\t\t# Store that value in the object\n\t\t\t$t_prefs->$var = $row[$var];\n\t\t}\n\t}\n\tif ( auth_is_user_authenticated() && auth_get_current_user_id() == $p_user_id ) {\n\t\t$g_cache_current_user_pref[ (int)$p_project_id ] = $t_prefs;\n\t}\n\treturn $t_prefs;\n}", "public static function export_user_preferences(int $userid) {\n $preferences = get_user_preferences();\n foreach ($preferences as $name => $value) {\n $prefname = null;\n $prefdescription = null;\n $transformedvalue = null;\n switch ($name) {\n case 'grade_report_showcalculations':\n case 'grade_report_showeyecons':\n case 'grade_report_showaverages':\n case 'grade_report_showlocks':\n case 'grade_report_showuserimage':\n case 'grade_report_showactivityicons':\n case 'grade_report_showranges':\n case 'grade_report_showanalysisicon':\n case 'grade_report_shownumberofgrades':\n case 'grade_report_quickgrading':\n case 'grade_report_showonlyactiveenrol':\n case 'grade_report_showquickfeedback':\n case 'grade_report_enableajax':\n $prefname = $name;\n $transformedvalue = transform::yesno($value);\n break;\n case 'grade_report_meanselection':\n $prefname = $name;\n switch ($value) {\n case GRADE_REPORT_MEAN_ALL:\n $transformedvalue = get_string('meanall', 'grades');\n break;\n case GRADE_REPORT_MEAN_GRADED:\n $transformedvalue = get_string('meangraded', 'grades');\n break;\n }\n break;\n case 'grade_report_rangesdecimalpoints':\n case 'grade_report_averagesdecimalpoints':\n case 'grade_report_studentsperpage':\n $prefname = $name;\n $transformedvalue = $value;\n break;\n case 'grade_report_rangesdisplaytype':\n case 'grade_report_averagesdisplaytype':\n $prefname = $name;\n switch ($value) {\n case GRADE_REPORT_PREFERENCE_INHERIT:\n $transformedvalue = get_string('inherit', 'grades');\n break;\n case GRADE_DISPLAY_TYPE_REAL:\n $transformedvalue = get_string('real', 'grades');\n break;\n case GRADE_DISPLAY_TYPE_PERCENTAGE:\n $transformedvalue = get_string('percentage', 'grades');\n break;\n case GRADE_DISPLAY_TYPE_LETTER:\n $transformedvalue = get_string('letter', 'grades');\n break;\n }\n break;\n case 'grade_report_aggregationposition':\n $prefname = $name;\n switch ($value) {\n case GRADE_REPORT_AGGREGATION_POSITION_FIRST:\n $transformedvalue = get_string('positionfirst', 'grades');\n break;\n case GRADE_REPORT_AGGREGATION_POSITION_LAST:\n $transformedvalue = get_string('positionlast', 'grades');\n break;\n }\n break;\n default:\n if (strpos($name, 'grade_report_grader_collapsed_categories') === 0) {\n $prefname = 'grade_report_grader_collapsed_categories';\n $courseid = substr($name, strlen('grade_report_grader_collapsed_categories'));\n $transformedvalue = $value;\n $course = get_course($courseid);\n $prefdescription = get_string(\n 'privacy:request:preference:'.$prefname,\n 'gradereport_grader',\n (object) [\n 'name' => $course->fullname,\n ]\n );\n }\n }\n\n if ($prefname !== null) {\n if ($prefdescription == null) {\n $prefdescription = get_string('privacy:metadata:preference:'.$prefname, 'gradereport_grader');\n }\n writer::export_user_preference(\n 'gradereport_grader',\n $prefname,\n $transformedvalue,\n $prefdescription\n );\n }\n }\n }", "public static function onGetPreferences( User $user, array &$preferences ) {\n\t\t$preferences['twl-notified'] = [\n\t\t\t'type' => 'api'\n\t\t];\n\t}", "public static function onGetPreferences( User $user, array &$preferences ) {\n\t\t$preferences['twl-notified'] = [\n\t\t\t'type' => 'api'\n\t\t];\n\t}", "public static function export_user_preferences(int $userid)\n {\n $preferences = array();\n $preferences['course_view_state'] = get_user_preference('course_view_state', null, $userid);\n $preferences['viewCourseCategory'] = get_user_preference('viewCourseCategory', null, $userid);\n $preferences['aside_right_state'] = get_user_preference('aside_right_state', null, $userid);\n $preferences['menubar_state'] = get_user_preference('menubar_state', null, $userid);\n\n foreach ($preferences as $preference => $value) {\n switch ($value) {\n // for 'course_view_state' and 'viewCourseCategory'\n case \"grid\":\n $preference_description = get_string($preference . '_grid', 'theme_tilemmetry');\n break;\n case \"list\":\n $preference_description = get_string($preference . '_list', 'theme_tilemmetry');\n break;\n \n // for 'aside_right_state'\n case \"\":\n // check via which preference\n if ($preference == 'aside_right_state') {\n $preference_description = get_string('aside_right_state_', 'theme_tilemmetry');\n }\n break;\n case \"overrideaside\":\n $preference_description = get_string('aside_right_state_overrideaside', 'theme_tilemmetry');\n break;\n \n // for 'menubar_state'\n case \"fold\":\n $preference_description = get_string('menubar_state_fold', 'theme_tilemmetry');\n break;\n case \"unfold\":\n $preference_description = get_string('menubar_state_unfold', 'theme_tilemmetry');\n break;\n case \"open\":\n $preference_description = get_string('menubar_state_open', 'theme_tilemmetry');\n break;\n case \"hide\":\n $preference_description = get_string('menubar_state_hide', 'theme_tilemmetry');\n break;\n }\n if (isset($preference_description)) {\n writer::export_user_preference('theme_tilemmetry', $preference, $value, $preference_description);\n }\n }\n }", "public function updatePreference($key, $value) {\n\t\t\n\t\t$tablename = $this -> getTableName();\n\t\t\n\t\t$query = 'UPDATE ' . $tablename . ' SET preferences = preferences || hstore($1, $2) WHERE user_id=$3 ;';\n\t\t\n\t\t$dbconn = \\Database::getDatabaseLink();\n\t\t\n\t\t$params = array($key, $value, $this -> user_id);\n\t\t\n\t\t$result = pg_query_params($dbconn, 'SELECT name FROM pg_prepared_statements WHERE name = $1', array('set_user_preference'));\n\n\t\tif (pg_num_rows($result) == 0) {\n \t\t$result = pg_prepare($dbconn, 'set_user_preference' , $query );\n\t\t}\n\t\t\t\n\t\t$results = pg_execute($dbconn, 'set_user_preference', $params);\n\t\t\n\t}", "public static function init() { \n\t\t\n\t\t$user_id = $GLOBALS['user']->id ? Dba::escape($GLOBALS['user']->id) : '-1'; \n\n\t\t// First go ahead and try to load it from the preferences\n\t\tif (self::load_from_session($user_id)) { \n\t\t\treturn true; \t\n\t\t} \n\n\t /* Get Global Preferences */\n\t\t$sql = \"SELECT `preference`.`name`,`user_preference`.`value`,`syspref`.`value` AS `system_value` FROM `preference` \" . \n\t\t\t\"LEFT JOIN `user_preference` `syspref` ON `syspref`.`preference`=`preference`.`id` AND `syspref`.`user`='-1' AND `preference`.`catagory`='system' \" . \n\t\t\t\"LEFT JOIN `user_preference` ON `user_preference`.`preference`=`preference`.`id` AND `user_preference`.`user`='$user_id' AND `preference`.`catagory`!='system'\"; \n\t $db_results = Dba::read($sql);\n\n\t while ($row = Dba::fetch_assoc($db_results)) {\n\t\t\t$value = $row['system_value'] ? $row['system_value'] : $row['value']; \n\t $name = $row['name'];\n\t $results[$name] = $value; \n\t } // end while sys prefs\n\n\t /* Set the Theme mojo */\n\t if (strlen($results['theme_name']) > 0) {\n\t $results['theme_path'] = '/themes/' . $results['theme_name'];\n\t }\n\t // Default to the classic theme if we don't get anything from their\n\t // preferenecs because we're going to want at least something otherwise\n\t // the page is going to be really ugly\n\t else {\n\t $results['theme_path'] = '/themes/classic';\n\t }\n\n\t Config::set_by_array($results,1);\n\t\t$_SESSION['userdata']['preferences'] = $results; \n\t\t$_SESSION['userdata']['uid'] = $user_id; \n\n\t}", "public function save_preferences($preferences) {\n global $USER, $DB;\n\n if (!$this->canmanagepreferences) {\n return false;\n }\n\n if ($preferences) {\n $preferences = json_decode($preferences);\n if (is_object($preferences)) {\n foreach ($preferences as $key=>$val) {\n if ($pref = $DB->get_record('block_jmail_preferences', array('userid' => $USER->id, 'courseid' => $this->course->id, 'name' => $key))) {\n $pref->value = $val;\n $DB->update_record('block_jmail_preferences', $pref);\n }\n else {\n $pref = new stdClass;\n $pref->userid = $USER->id;\n $pref->courseid = $this->course->id;\n $pref->name = $key;\n $pref->value = $val;\n $DB->insert_record('block_jmail_preferences', $pref);\n }\n }\n }\n }\n\n return true;\n }", "public static function onGetPreferences( $user, array &$preferences ) {\n\t\t// Box or bar UI\n\t\t$preferences['flaggedrevssimpleui'] =\n\t\t\tarray(\n\t\t\t\t'type' => 'radio',\n\t\t\t\t'section' => 'flaggedrevs/flaggedrevs-ui',\n\t\t\t\t'label-message' => 'flaggedrevs-pref-UI',\n\t\t\t\t'options' => array(\n\t\t\t\t\twfMsg( 'flaggedrevs-pref-UI-0' ) => 0,\n\t\t\t\t\twfMsg( 'flaggedrevs-pref-UI-1' ) => 1,\n\t\t\t\t),\n\t\t\t);\n\t\t// Default versions...\n\t\t$preferences['flaggedrevsstable'] =\n\t\t\tarray(\n\t\t\t\t'type' => 'radio',\n\t\t\t\t'section' => 'flaggedrevs/flaggedrevs-ui',\n\t\t\t\t'label-message' => 'flaggedrevs-prefs-stable',\n\t\t\t\t'options' => array(\n\t\t\t\t\twfMsg( 'flaggedrevs-pref-stable-0' ) => FR_SHOW_STABLE_DEFAULT,\n\t\t\t\t\twfMsg( 'flaggedrevs-pref-stable-1' ) => FR_SHOW_STABLE_ALWAYS,\n\t\t\t\t\twfMsg( 'flaggedrevs-pref-stable-2' ) => FR_SHOW_STABLE_NEVER,\n\t\t\t\t),\n\t\t\t);\n\t\t// Review-related rights...\n\t\tif ( $user->isAllowed( 'review' ) ) {\n\t\t\t// Watching reviewed pages\n\t\t\t$preferences['flaggedrevswatch'] =\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'toggle',\n\t\t\t\t\t'section' => 'watchlist/advancedwatchlist',\n\t\t\t\t\t'label-message' => 'flaggedrevs-prefs-watch',\n\t\t\t\t);\n\t\t\t// Diff-to-stable on edit\n\t\t\t$preferences['flaggedrevseditdiffs'] =\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'toggle',\n\t\t\t\t\t'section' => 'editing/advancedediting',\n\t\t\t\t\t'label-message' => 'flaggedrevs-prefs-editdiffs',\n\t\t\t\t);\n\t\t\t// Diff-to-stable on draft view\n\t\t\t$preferences['flaggedrevsviewdiffs'] =\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'toggle',\n\t\t\t\t\t'section' => 'flaggedrevs/flaggedrevs-ui',\n\t\t\t\t\t'label-message' => 'flaggedrevs-prefs-viewdiffs',\n\t\t\t\t);\n\t\t}\n\t\treturn true;\n\t}", "public static function fix_preferences($user_id) { \n\n\t\t$user_id = Dba::escape($user_id); \n\n\t\t/* Get All Preferences for the current user */\n\t\t$sql = \"SELECT * FROM `user_preference` WHERE `user`='$user_id'\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t$results = array(); \n\n\t\twhile ($r = Dba::fetch_assoc($db_results)) { \n\t\t\t$pref_id = $r['preference'];\n\t\t\t/* Check for duplicates */\n\t\t\tif (isset($results[$pref_id])) { \n\t\t\t\t$r['value'] = Dba::escape($r['value']); \n\t\t\t\t$sql = \"DELETE FROM `user_preference` WHERE `user`='$user_id' AND `preference`='\" . $r['preference'] . \"' AND\" . \n\t\t\t\t\t\" `value`='\" . Dba::escape($r['value']) . \"'\"; \n\t\t\t\t$delete_results = Dba::query($sql); \n\t\t\t} // if its set\n\t\t\telse { \n\t\t\t\t$results[$pref_id] = 1; \n\t\t\t} \n\t\t} // end while\n\t\n\t\t/* If we aren't the -1 user before we continue grab the -1 users values */\n\t\tif ($user_id != '-1') { \n $sql = \"SELECT `user_preference`.`preference`,`user_preference`.`value` FROM `user_preference`,`preference` \" .\n \"WHERE `user_preference`.`preference` = `preference`.`id` AND `user_preference`.`user`='-1' AND `preference`.`catagory` !='system'\";\n $db_results = Dba::query($sql);\n\t\t\t/* While through our base stuff */\n while ($r = Dba::fetch_assoc($db_results)) {\n\t\t\t\t$key = $r['preference']; \n $zero_results[$key] = $r['value'];\n }\n } // if not user -1\n\n\t\t// get me _EVERYTHING_ \n $sql = \"SELECT * FROM `preference`\";\n\n\t\t// If not system, exclude system... *gasp*\n if ($user_id != '-1') {\n $sql .= \" WHERE catagory !='system'\";\n }\n $db_results = Dba::query($sql);\n\n while ($r = Dba::fetch_assoc($db_results)) {\n\n\t\t\t$key = $r['id'];\n\n /* Check if this preference is set */\n if (!isset($results[$key])) {\n if (isset($zero_results[$key])) {\n $r['value'] = $zero_results[$key];\n }\n\t\t\t\t$value = Dba::escape($r['value']); \n $sql = \"INSERT INTO user_preference (`user`,`preference`,`value`) VALUES ('$user_id','$key','$value')\";\n $insert_db = Dba::query($sql);\n }\n } // while preferences\n\n /* Let's also clean out any preferences garbage left over */\n $sql = \"SELECT DISTINCT(user_preference.user) FROM user_preference \" .\n \"LEFT JOIN user ON user_preference.user = user.id \" .\n \"WHERE user_preference.user!='-1' AND user.id IS NULL\";\n $db_results = Dba::query($sql);\n\n $results = array();\n\n while ($r = Dba::fetch_assoc($db_results)) {\n $results[] = $r['user'];\n }\n\n foreach ($results as $data) {\n $sql = \"DELETE FROM user_preference WHERE user='$data'\";\n $db_results = Dba::query($sql);\n }\n\n\t}", "function updatePreferences($problem, $user, $resources) {\n\n $problem = getProblemById($problem);\n\n if (!isUserInProblem($user, $problem['id']) && $problem['type'] == \"public\") {\n addUserToProblem($problem['id'], $user);\n }\n\n $preferences = ''; // initialize preferences string\n //$resources = $_POST['resources']; // get the list of boxes that the user checked\n foreach ($resources as $resource) {\n $preferences .= $resource . \"\\n\"; // add the ids to the preference list for that user\n }\n $preferences = substr($preferences, 0, -1); // take off the last new line\n addData($problem['id'], $user, 'preference', $preferences, 1); // 1 means update or add\n\n}", "protected function _prefs($user = null)\n {\n global $injector;\n\n return $injector->getInstance('Horde_Core_Factory_Prefs')->create('ingo', array(\n 'cache' => false,\n 'user' => is_null($user) ? Ingo::getUser() : $user\n ));\n }", "function setPref($name, $value) {\n\t\t// Convert to boolean if value is \"true\" or \"false\"\n\t\tif ($value == 'true') {\n\t\t\t$value = TRUE;\n\t\t}\n\t\telseif ($value == 'false') {\n\t\t\t$value = FALSE;\n\t\t}\n\t\t\n\t\t$this->log->debug(\"Setting pref [$name] = [$value]\");\n\t\t$_SESSION['pref_' . $name] = $value;\n\t}", "public static function export_user_preferences(int $userid) {\n $user = \\core_user::get_user($userid);\n\n switch ($user->maildigest) {\n case 1:\n $digestdescription = get_string('emaildigestcomplete');\n break;\n case 2:\n $digestdescription = get_string('emaildigestsubjects');\n break;\n case 0:\n default:\n $digestdescription = get_string('emaildigestoff');\n break;\n }\n writer::export_user_preference('mod_reactforum', 'maildigest', $user->maildigest, $digestdescription);\n\n switch ($user->autosubscribe) {\n case 0:\n $subscribedescription = get_string('autosubscribeno');\n break;\n case 1:\n default:\n $subscribedescription = get_string('autosubscribeyes');\n break;\n }\n writer::export_user_preference('mod_reactforum', 'autosubscribe', $user->autosubscribe, $subscribedescription);\n\n switch ($user->trackreactforums) {\n case 0:\n $trackreactforumdescription = get_string('trackreactforumsno');\n break;\n case 1:\n default:\n $trackreactforumdescription = get_string('trackreactforumsyes');\n break;\n }\n writer::export_user_preference('mod_reactforum', 'trackreactforums', $user->trackreactforums, $trackreactforumdescription);\n\n $markasreadonnotification = get_user_preferences('markasreadonnotification', null, $user->id);\n if (null !== $markasreadonnotification) {\n switch ($markasreadonnotification) {\n case 0:\n $markasreadonnotificationdescription = get_string('markasreadonnotificationno', 'mod_reactforum');\n break;\n case 1:\n default:\n $markasreadonnotificationdescription = get_string('markasreadonnotificationyes', 'mod_reactforum');\n break;\n }\n writer::export_user_preference('mod_reactforum', 'markasreadonnotification', $markasreadonnotification,\n $markasreadonnotificationdescription);\n }\n }", "public static function rebuild_all_preferences() { \n\n\t\t$sql = \"SELECT * FROM `user`\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\tUser::fix_preferences('-1'); \n\n\t\twhile ($row = Dba::fetch_assoc($db_results)) { \n\t\t\tUser::fix_preferences($row['id']); \n\t\t} \n\n\t\treturn true; \n\n\t}", "function SetPreference($preference_name, $value)\n\t{\n\t\treturn set_site_preference($this->GetName() . \"_mapi_pref_\" . $preference_name, $value);\n\t}", "function savePrefs($userid, $userPrefsBlob){\n\t\tif (!mysql_query(\"UPDATE Preferences SET PrefsBlob = '\" . addslashes($userPrefsBlob) . \"' WHERE ICSUserId = '\" . addslashes($userid) . \"'\"))\n\t\t\treturn \"Unknown user: $userid\";\n\t\t\t\n\t\treturn null;\n\t}", "public function setUserPreference($userLogin, $preferenceName, $preferenceValue)\n {\n Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);\n Option::set($this->getPreferenceId($userLogin, $preferenceName), $preferenceValue);\n }", "public static function export_user_preferences(int $userid) {\n $autologinrequestlast = get_user_preferences('tool_mobile_autologin_request_last', null, $userid);\n if ($autologinrequestlast !== null) {\n $time = transform::datetime($autologinrequestlast);\n writer::export_user_preference('tool_mobile',\n 'tool_mobile_autologin_request_last',\n $time,\n get_string('privacy:metadata:preference:tool_mobile_autologin_request_last', 'tool_mobile')\n );\n }\n }", "public function auto_map_user_preferences($headers)\n {\n }", "function my_preferences() {\n $view_data[\"user_info\"] = $this->Users_model->get_one($this->login_user->id);\n\n //language dropdown\n $view_data['language_dropdown'] = array();\n if (!get_setting(\"disable_language_selector_for_patients\")) {\n $view_data['language_dropdown'] = get_language_list();\n }\n\n $view_data[\"hidden_topbar_menus_dropdown\"] = $this->get_hidden_topbar_menus_dropdown();\n\n $this->load->view(\"patients/contacts/my_preferences\", $view_data);\n }", "public static function export_user_preferences(int $userid) {\n $showadvanced = get_user_preferences('definerole_showadvanced', null, $userid);\n if ($showadvanced !== null) {\n writer::export_user_preference('core_role',\n 'definerole_showadvanced',\n transform::yesno($showadvanced),\n get_string('privacy:metadata:preference:showadvanced', 'core_role')\n );\n }\n }", "public function save_user_settings() {\n \n // Saves user settings\n (new MidrubBaseAdminCollectionUserHelpers\\Settings)->save_user_settings();\n \n }", "public function getPreferences();", "function user_pref_insert( $p_user_id, $p_project_id, $p_prefs ) {\n\tstatic $t_vars;\n\t$c_user_id = db_prepare_int( $p_user_id );\n\t$c_project_id = db_prepare_int( $p_project_id );\n\n\tuser_ensure_unprotected( $p_user_id );\n\n\t$t_user_pref_table = db_get_table( 'mantis_user_pref_table' );\n\n\tif ($t_vars == null ) {\n\t\t$t_vars = getClassProperties( 'UserPreferences', 'protected');\n\t}\n\n\t$t_values = array();\n\n\t$t_params[] = db_param(); // user_id\n\t$t_values[] = $c_user_id;\n\t$t_params[] = db_param(); // project_id\n\t$t_values[] = $c_project_id;\n\tforeach( $t_vars as $var => $val ) {\n\t\tarray_push( $t_params, db_param());\n\t\tarray_push( $t_values, $p_prefs->Get( $var ) );\n\t}\n\n\t$t_vars_string = implode( ', ', array_keys( $t_vars ) );\n\t$t_params_string = implode( ',', $t_params );\n\n\t$query = 'INSERT INTO ' . $t_user_pref_table .\n\t\t\t ' (user_id, project_id, ' . $t_vars_string . ') ' .\n\t\t\t ' VALUES ( ' . $t_params_string . ')';\n\tdb_query_bound( $query, $t_values );\n\n\t# db_query errors on failure so:\n\treturn true;\n}", "function PREF_saveAllPreferenceValues()\n{\n\t$prefName = $_SESSION['preferenceName'];\n\n\tforeach ($_SESSION['preferenceSpace'] as $var => $value)\n\t\tPREF_putValue($prefName, $var, $value);\n}", "public function getPreferencesByUserId(int $userId = null, array $options=[]): array;", "function load_data(&$preferences, $userid) {\n global $USER;\n return true;\n }", "public function setUserPreference($key, $value) {\n\n\t\tif ($this->_authProvider == null)\n\t\t{\n\t\t\tthrow new OSM_Exception('Must be authenticated');\n\t\t}\n\n\t\t$result = $this->_httpApi(\n\t\t\t'/user/preferences/' . rawurlencode(utf8_encode($key)), rawurlencode(utf8_encode($value)), 'PUT');\n\n\t\t$this->getLogger()->debug(__METHOD__.' result:{result}', ['result'=>$result]);\n\t}", "public function preferences() {\n\t\treturn view('users.preferences', [ 'user' => Auth::user() ]);\n\t}", "public static function export_user_preferences(int $userid) {\n $prefvalue = get_user_preferences('gradingform_guide-showmarkerdesc', null, $userid);\n if ($prefvalue !== null) {\n $transformedvalue = transform::yesno($prefvalue);\n writer::export_user_preference(\n 'gradingform_guide',\n 'gradingform_guide-showmarkerdesc',\n $transformedvalue,\n get_string('privacy:metadata:preference:showmarkerdesc', 'gradingform_guide')\n );\n }\n\n $prefvalue = get_user_preferences('gradingform_guide-showstudentdesc', null, $userid);\n if ($prefvalue !== null) {\n $transformedvalue = transform::yesno($prefvalue);\n writer::export_user_preference(\n 'gradingform_guide',\n 'gradingform_guide-showstudentdesc',\n $transformedvalue,\n get_string('privacy:metadata:preference:showstudentdesc', 'gradingform_guide')\n );\n }\n }", "public function SavePreference($UserID, $Preference, $Value = '') {\n // Make sure that changes to the current user become effective immediately.\n $Session = Gdn::Session();\n if ($UserID == $Session->UserID)\n $Session->SetPreference($Preference, $Value, FALSE);\n\n return $this->SaveToSerializedColumn('Preferences', $UserID, $Preference, $Value);\n }", "public function test_export_user_preferences() {\n global $CFG, $DB;\n\n require_once($CFG->dirroot . '/user/editlib.php');\n\n $ids[] = $DB->insert_record('local_mediaserver_channel', (object) ['name' => 'Foo', 'sortorder' => 1, 'hourbegin' => 0, 'hourend' => 24]);\n $ids[] = $DB->insert_record('local_mediaserver_channel', (object) ['name' => 'Bar', 'sortorder' => 3, 'hourbegin' => 0, 'hourend' => 24]);\n $ids[] = $DB->insert_record('local_mediaserver_channel', (object) ['name' => 'Baz', 'sortorder' => 2, 'hourbegin' => 0, 'hourend' => 24]);\n\n $preference = implode(',', $ids);\n useredit_update_user_preference([\n 'id' => $this->user->id,\n 'preference_' . provider::PREFERRED_CHANNELS => $preference,\n ]);\n\n provider::export_user_preferences($this->user->id);\n\n $writer = writer::with_context(context_system::instance());\n $this->assertTrue($writer->has_any_data());\n\n $preferences = $writer->get_user_preferences('local_mediaserver');\n\n $expected = 'Foo, Baz, Bar';\n $this->assertEquals($expected, $preferences->{provider::PREFERRED_CHANNELS}->value);\n }", "function update_company_prefs( $params, $pref = TB_PREF ){\n global $ci;\n $model = $ci->model('common',true);\n foreach($params as $name => $value) {\n $model->update( array('value'=>$value),'sys_prefs',array('name'=>$name));\n // update cached value\n $_SESSION['SysPrefs']->prefs[$name] = $value;\n }\n return true;\n}", "public function UpdatePreferences($preferences) {\r\n\r\n $response = $this->metadata->UpdatePreferencesRequest($this->accesskeyId, $this->associationId, $this->secretaccessId, $preferences\r\n );\r\n return $response;\r\n }", "function getPreferences($userId){\r\n \t\treturn $this->select()\r\n \t\t->find_by(\"email_preference.userId\", $userId);\r\n \t}", "protected function preferencesAction()\n {\n $this->updateOnEvent\n ->setAccess($this, Access::CAN_EDIT_PREFERENCES)\n ->execute($this, UserEntity::class, UserActionEvent::class, NULL, __METHOD__, [], [], $this->userPreferenceRepo)\n ->render()\n ->with(\n [\n 'user_preference' => $this->userPreferenceRepo->getRepo()->findObjectBy(['user_id' => $this->thisRouteID()])\n ]\n )\n ->form(\n $this->userPreferencesForm,\n null,\n $this->userPreferenceRepo->getRepo()->findObjectBy(['user_id' => $this->thisRouteID()])\n )\n ->end();\n }", "public function setNotificationPreference(?EndUserNotificationPreference $value): void {\n $this->getBackingStore()->set('notificationPreference', $value);\n }", "public function setOrganisationPreferences($value)\r\n {\r\n $this->organisationPreferences = $value;\r\n }", "function setUserSettings($user) {\r\n\r\n\t\t$user['settings'] = $this->getUserSettings($user['user_id']);\r\n\r\n\t\treturn $user;\r\n\r\n\t}", "public function user_settings()\n {\n $this->data['page_title'] = 'User settings';\n $user = $this->ion_auth->user()->row();\n $this->data['user'] = $user; // user data (the id) is still needed to perform update\n\n $this->render('admin/user/user_settings_view','admin_master'); // reload the page\n }", "public static function export_user_preferences(int $userid) {\n\n $filteroptions = array(3 => get_string('showall', 'local_intellicart'), 2 => get_string('active', 'local_intellicart'),\n 1 => get_string('inactive', 'local_intellicart'));\n\n $intellicart_categories_filter = get_user_preferences('intellicart_categories_filter', 3, $userid);\n $intellicart_couponsstatus_filter = get_user_preferences('intellicart_couponsstatus_filter', 3, $userid);\n $intellicart_discountsstatus_filter = get_user_preferences('intellicart_discountsstatus_filter', 3, $userid);\n $intellicart_productsstatus_filter = get_user_preferences('intellicart_productsstatus_filter', 3, $userid);\n $intellicart_paymentsstatus_filter = get_user_preferences('intellicart_paymentsstatus_filter', 3, $userid);\n $intellicart_vendorsstatus_filter = get_user_preferences('intellicart_vendorsstatus_filter', 3, $userid);\n $intellicart_usersstatus_filter = get_user_preferences('intellicart_usersstatus_filter', 3, $userid);\n $intellicart_customfields_view_filter = get_user_preferences('intellicart_customfields_view_filter', 3, $userid);\n $intellicart_vendor_filter = get_user_preferences('intellicart_vendor_filter', 3, $userid);\n $intellicart_catsubscriptions_filter = get_user_preferences('intellicart_catsubscriptions_filter', 3, $userid);\n $intellicart_giftcardsstatus_filter = get_user_preferences('intellicart_giftcardsstatus_filter', 3, $userid);\n $intellicart_table_limit = get_user_preferences('intellicart_table_limit', 25, $userid);\n $intellicart_salesstatus_filter = get_user_preferences('intellicart_salesstatus_filter', '', $userid);\n $intellicart_salesbt_filter = get_user_preferences('intellicart_salesbt_filter', '', $userid);\n $intellicart_certificationsstatus_filter = get_user_preferences('intellicart_certificationsstatus_filter', '', $userid);\n $intellicart_certificatestatus_filter = get_user_preferences('intellicart_certificatestatus_filter', '', $userid);\n $intellicart_awardcertificatesstatus_filter = get_user_preferences('intellicart_awardcertificatesstatus_filter', '', $userid);\n $intellicart_billingtype = get_user_preferences('intellicart_billingtype', '', $userid);\n\n if (null !== $intellicart_categories_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_categories_filter',\n $filteroptions[$intellicart_categories_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_categories_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_couponsstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_couponsstatus_filter',\n $filteroptions[$intellicart_couponsstatus_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_couponsstatus_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_discountsstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_discountsstatus_filter',\n $filteroptions[$intellicart_discountsstatus_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_discountsstatus_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_productsstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_productsstatus_filter',\n $filteroptions[$intellicart_productsstatus_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_productsstatus_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_paymentsstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_paymentsstatus_filter',\n $filteroptions[$intellicart_paymentsstatus_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_paymentsstatus_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_vendorsstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_vendorsstatus_filter',\n $filteroptions[$intellicart_vendorsstatus_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_vendorsstatus_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_usersstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_usersstatus_filter',\n $filteroptions[$intellicart_usersstatus_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_usersstatus_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_customfields_view_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_customfields_view_filter',\n $filteroptions[$intellicart_customfields_view_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_customfields_view_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_vendor_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_vendor_filter',\n $filteroptions[$intellicart_vendor_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_vendor_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_catsubscriptions_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_catsubscriptions_filter',\n $filteroptions[$intellicart_catsubscriptions_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_catsubscriptions_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_giftcardsstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_giftcardsstatus_filter',\n $filteroptions[$intellicart_giftcardsstatus_filter],\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_giftcardsstatus_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_table_limit) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_table_limit',\n $intellicart_table_limit,\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_table_limit', 'local_intellicart')\n );\n }\n if (null !== $intellicart_salesstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_salesstatus_filter',\n $intellicart_salesstatus_filter,\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_salesstatus_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_salesbt_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_salesbt_filter',\n $intellicart_salesbt_filter,\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_salesbt_filter', 'local_intellicart')\n );\n }\n if (null !== $intellicart_certificationsstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_certificationsstatus_filter',\n $intellicart_certificationsstatus_filter,\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_certificationsstatus_filter', 'local_intellicart')\n );\n }\n\n if (null !== $intellicart_certificatestatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_certificatestatus_filter',\n $intellicart_certificatestatus_filter,\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_certificatestatus_filter', 'local_intellicart')\n );\n }\n\n if (null !== $intellicart_awardcertificatesstatus_filter) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_awardcertificatesstatus_filter',\n $intellicart_awardcertificatesstatus_filter,\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_awardcertificatesstatus_filter', 'local_intellicart')\n );\n }\n\n if (null !== $intellicart_billingtype) {\n writer::export_user_preference(\n 'local_intellicart',\n 'intellicart_billingtype',\n $intellicart_billingtype,\n get_string('privacy:metadata:local_intellicart:preferences:intellicart_billingtype', 'local_intellicart')\n );\n }\n }", "public function setPreferences(CurrentPreferences $preferences){\n \t$this->preferences = $preferences;\n \treturn $this;\n }", "function wp_set_all_user_settings($user_settings)\n{\n}", "public function saveAdminPreferences($_data)\n {\n // only admins are allowed to update app pref defaults/forced prefs\n if (! Tinebase_Acl_Roles::getInstance()->hasRight($this->_application, Core::getUser()->getId(), Rights_Abstract::ADMIN)) {\n throw new Tinebase_Exception_AccessDenied('You are not allowed to change the preference defaults.');\n }\n \n $this->resetAppPrefsCache();\n \n // create prefs that don't exist in the db\n foreach ($_data as $id => $prefData) {\n if (preg_match('/^default/', $id)\n && (isset($prefData['name']) || array_key_exists('name', $prefData))\n && ($prefData['type'] == Tinebase_Model_Preference::TYPE_FORCED || (string)$prefData['value'] != Tinebase_Model_Preference::DEFAULT_VALUE)\n ) {\n if (Core::isLogLevel(LogLevel::DEBUG)) Core::getLogger()->debug(__METHOD__ . '::' . __LINE__\n . ' Create admin pref: ' . $prefData['name'] . ' = ' . $prefData['value']);\n $newPref = $this->getApplicationPreferenceDefaults($prefData['name']);\n $newPref->value = $prefData['value'];\n $newPref->type = ($prefData['type'] == Tinebase_Model_Preference::TYPE_FORCED) ? $prefData['type'] : Tinebase_Model_Preference::TYPE_ADMIN;\n unset($newPref->id);\n $this->create($newPref);\n \n unset($_data[$id]);\n }\n }\n \n // update default/forced preferences\n $records = $this->getMultiple(array_keys($_data));\n if (Core::isLogLevel(LogLevel::DEBUG)) Core::getLogger()->debug(__METHOD__ . '::' . __LINE__\n . ' Saving admin prefs: ' . print_r($records->name, TRUE));\n foreach ($records as $preference) {\n if ($_data[$preference->getId()]['value'] == Tinebase_Model_Preference::DEFAULT_VALUE) {\n $this->delete($preference->getId());\n } else {\n $preference->value = $_data[$preference->getId()]['value'];\n $preference->type = ($_data[$preference->getId()]['type'] == Tinebase_Model_Preference::TYPE_FORCED) ? $_data[$preference->getId()]['type'] : Tinebase_Model_Preference::TYPE_ADMIN;\n $this->update($preference);\n }\n }\n }", "function set_user_setting( $name, $value ) {\n\t\t$all_user_settings = get_all_user_settings();\n\t\t$all_user_settings[ $name ] = $value;\n\n\t\treturn wp_set_all_user_settings( $all_user_settings );\n\t}", "function saveuserAction(){\n\t\n\t\t$this->disableLayout();\n\t\t\n\t\t$id = $_POST['userid'];\n\t\t\n\t\t//update prefs table\n\t\t$maillist = $_POST['maillist'] == \"on\" ? 1 : 0;\n\t\t$showmap = $_POST['showmap'] == \"on\" ? 1 : 0;\n\t\t\n\t\t$sql = \"REPLACE INTO user_prefs \n\t\t\t\t(`userid`, `maillist`, `showmap`) \n\t\t\t\tVALUES \n\t\t\t\t('$id', '$maillist', '$showmap')\";\n\t\t$this->db->execute($sql);\n\t\t\n\t\t//update main user list\n\t\t$email = $_POST['email'];\n\t\t$invites = $_POST['invites'];\n\t\t\n\t\t$sql = \"UPDATE user_list \n\t\t\t\tSET \n\t\t\t\t`email` = '$email',\n\t\t\t\t`invites` = '$invites'\n\t\t\t\tWHERE `id`='$id' \n\t\t\t\tLIMIT 1\";\n\t\t\n\t\t$this->db->execute($sql);\n\t\t//dbug($sql);\n\t\t$this->Redirect('admin/users' );\n\t}", "function squirrelmail_plugin_init_retrieveuserdata() {\n global $squirrelmail_plugin_hooks;\n\n $squirrelmail_plugin_hooks[\"loading_prefs\"][\"retrieveuserdata\"] = \"check_userdata\";\n $squirrelmail_plugin_hooks[\"options_personal_save\"][\"retrieveuserdata\"] = \"force_userdata\";\n }", "function saveData()\n\t{\n\t\t$userId = self::$USER->getId();\n\t\tforeach($this->_userSettings as $settingName => $value) {\n\t\t\t$setting = $this->getConstSetting($settingName);\n\t\t\t$fields = array('user_id'=>$userId, 'setting_id'=>$setting['setting_id'], 'value' => $value);\n\t\t\tself::$DB->replace(TABLE_USER_SETTINGS, $fields);\n\t\t}\n\t}", "function meta_prefs_set()\r\n\t{\r\n\t\t//global $woocommerce;\r\n\t\tglobal $current_user ;\r\n\r\n\t\t$show = intval($_POST['show']);\r\n\r\n\t\t$user_id = $current_user->ID;\r\n\r\n\t\tif($show==0)\r\n\t\t{\r\n\t\t\tupdate_user_meta($user_id, $this->plugin_slug.'-show-welcome-notice', '0');\r\n\t\t}\r\n\t\telse if($show==1)\r\n\t\t{\r\n\t\t\tupdate_user_meta($user_id, $this->plugin_slug.'-show-welcome-notice', '1');\r\n\t\t}\r\n\t\texit;\r\n\t}", "function force_userdata() {\n global $data_dir, $username;\n\n include(\"../plugins/retrieveuserdata/config.php\");\n\n if ($force != 0 && isset($username)) {\n $got_external_userdata = getPref($data_dir, $username, \"got_external_userdata\");\n if ($got_external_userdata == 0) {\n // if we have never got the user data before, ask someone\n retrieve_external_userdata();\n } else {\n // use backed up user data to avoid external data source access\n $common_name = getPref($data_dir, $username, \"full_name_backup\");\n $mail_address = getPref($data_dir, $username, \"email_address_backup\");\n set_userdata($common_name, $mail_address);\n }\n }\n }", "public function load_data(&$preferences, $userid) {\n return true;\n }", "protected function set_docked_pref($block, $value, $userid) {\n set_user_preference(\"docked_block_instance_{$block->instance->id}\", $value, $userid);\n }", "function get_preferences($user_id=0,$type=0) { \n\t\n\t\t// Fill out the user id\n\t\t$user_id = $user_id ? Dba::escape($user_id) : Dba::escape($this->id); \n\n\t\tif ($user_id != '-1') { \n\t\t\t$user_limit = \"AND preference.catagory != 'system'\";\n\t\t}\n\n\t\tif (!Config::get('use_auth')) { $user_id = '-1'; }\n\t\t\t\n\t\tif ($type != '0') { \n\t\t\t$user_limit = \"AND preference.catagory = '\" . Dba::escape($type) . \"'\";\n\t\t}\n\n\t\n\t\t$sql = \"SELECT preference.name, preference.description, preference.catagory, preference.level, user_preference.value \" . \n\t\t\t\"FROM preference INNER JOIN user_preference ON user_preference.preference=preference.id \" .\n\t\t\t\"WHERE user_preference.user='$user_id' \" . $user_limit;\n\t\t$db_results = Dba::query($sql);\n\n\t\t/* Ok this is crapy, need to clean this up or improve the code FIXME */\n\t\twhile ($r = Dba::fetch_assoc($db_results)) { \n\t\t\t$type = $r['catagory'];\n\t\t\t$admin = false;\n\t\t\tif ($type == 'system') { $admin = true; }\n\t\t\t$type_array[$type][$r['name']] = array('name'=>$r['name'],'level'=>$r['level'],'description'=>$r['description'],'value'=>$r['value']);\n\t\t\tksort($type_array[$type]); \n\t\t\t$results[$type] = array ('title'=>ucwords($type),'admin'=>$admin,'prefs'=>$type_array[$type]);\n\t\t} // end while\n\t\t\n\t\treturn $results;\n\t\n\t}", "function eZPreferences( )\r\n {\r\n }", "public function persist(){\n\n\t\treturn $this->user->update(['settings' => $this->settings]);\n\t}", "function update_company_prefs( $params, $pref = TB_PREF )\n{\n\t$sql = \"UPDATE {$pref}sys_prefs SET value = \";\n\tforeach($params as $name => $value) {\n\t\tif (!db_query($sql. db_escape($value). \" WHERE name=\".db_escape($name),\n\t\t\t \"The company prefferences could not be updated \"))\n\t\t\treturn false;\n\t\t// update cached value\n\t\t$_SESSION['SysPrefs']->prefs[$name] = $value;\n\t}\n\treturn true;\n}", "public function get_preferences() {\n global $USER;\n\n if (!$this->canmanagepreferences) {\n return false;\n }\n\n return $this->load_user_preferences($USER->id);\n }", "public static function set_preference($name, $value) {\n self::$preferences[$name] = $value;\n }", "public function setSettings($userId, array $settings, $key = null): void;", "public function __set($_preferenceName, $_value) {\n if (in_array($_preferenceName, $this->getAllApplicationPreferences())) {\n $this->setValue($_preferenceName, $_value);\n }\n }", "public function setPref($pref, $value) {\r\n\r\n\t\tif (empty ($pref)) {\r\n\t\t\tmakeNotice(\"No preference name given for setting, error in preference_class\", \"error\", \"Nyah! Nyah!\");\r\n\t\t}\r\n\r\n\t\t// Set the preference.\r\n\t\t$this->preferences[$pref] = \"$value\";\r\n\t\t$this->storePrefs();\r\n\t}", "function set_user_setting($name, $value)\n{\n}", "public static function update($preference,$user_id,$value,$applytoall='') { \n\n\t\t// First prepare\n\t\tif (!is_numeric($preference)) { \n\t\t\t$id = self::id_from_name($preference); \n\t\t\t$name = $preference; \n\t\t} \n\t\telse { \n\t\t\t$name = self::name_from_id($preference); \n\t\t\t$id = $preference; \n\t\t} \n\t\tif ($applytoall AND Access::check('interface','100')) { \n\t\t\t$user_check = \"\";\n\t\t}\n\t\telse { \n\t\t\t$user_check = \" AND `user`='$user_id'\";\n\t\t} \n\n\t\t// Now do\n\t\tif (self::has_access($name)) { \n\t\t\t$value \t\t= Dba::escape($value); \n\t\t\t$user_id\t= Dba::escape($user_id); \n\t\t\t$sql = \"UPDATE `user_preference` SET `value`='$value' \" . \n\t\t\t\t\"WHERE `preference`='$id'$user_check\"; \n\t\t\t$db_results = Dba::query($sql); \n\t\t\tPreference::clear_from_session();\n\t\t\treturn true; \n\t\t} \n\t\telse { \n\t\t\tdebug_event('denied',$GLOBALS['user']->username . ' attempted to update ' . $name . ' but does not have sufficient permissions','3'); \n\t\t}\n\n\t\treturn false; \n\t}", "public function setPreference($app, $pref, $value)\n {\n $pushed = $GLOBALS['registry']->pushApp($app);\n $GLOBALS['registry']->loadPrefs($app);\n $value = $GLOBALS['prefs']->setValue($pref, $value);\n if ($pushed) {\n $GLOBALS['registry']->popApp();\n }\n }", "function set_al_user_settings($user_id)\n{\n\tglobal $db;\n\t$sql = 'UPDATE ' . AL_USER_DATA .\n\t\t\t\" SET al_user_settings = '$settings'\n\t\t\t WHERE user_id = '$user_id'\";\n\t\t\t\n\t$result = $db->sql_query($sql);\n\t\n\tif(!$result)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "function savePreferences(string $filename = USER_PREFERENCES_FILE): int\n{\n global $preferences;\n $jsondata = json_encode($preferences, JSON_PRETTY_PRINT);\n $result = file_put_contents($filename, $jsondata);\n return $result;\n}", "public function createData()\n {\n (new UserPreferences())->store($this->attributes['id']);\n }", "public function loadPrefs() {\n\t\t$mysql_api = get_mysql_api();\n\n\t\t// load worker preferences per shift / date\n\t\t$prefs_table = SCHEDULE_PREFS_TABLE;\n\t\t$shifts_table = SCHEDULE_SHIFTS_TABLE;\n\t\t$auth_user_table = AUTH_USER_TABLE;\n\t\t$sql = <<<EOSQL\n\t\t\tSELECT s.date_shift_string as date, s.job_id, a.username, p.pref\n\t\t\t\tFROM {$auth_user_table} as a, {$prefs_table} as p,\n\t\t\t\t\t{$shifts_table} as s\n\t\t\t\tWHERE p.pref>0\n\t\t\t\t\tAND a.id=p.worker_id\n\t\t\t\t\tAND s.id = p.date_id\n\t\t\t\tORDER BY date ASC,\n\t\t\t\t\tp.pref DESC,\n\t\t\t\t\ta.username ASC;\nEOSQL;\n\n\t\t$count = 0;\n\t\tforeach($mysql_api->get($sql) as $row) {\n\t\t\t$u = $row['username'];\n\t\t\t$d = $row['date'];\n\t\t\t$ji = $row['job_id'];\n\t\t\t$p = $row['pref'];\n\n\t\t\t// only add jobs which appear in the schedule\n\t\t\tif ($this->schedule->addPrefs($u, $ji, $d, $p)) {\n\t\t\t\t$this->roster->addPrefs($u, $ji, $d, $p);\n\t\t\t}\n\n\t\t\t$count++;\n\t\t}\n\n\t\t$slackers = $this->roster->getNonResponderNames();\n\t\t$this->initNonResponderPrefs($slackers);\n\t}", "private function setUpPreferences(FirefoxProfile $profile, array $preferences = []): FirefoxProfile\n {\n $accept_languages = 'ru-RU,ru,en,en-US,uk';\n if ($preferences['accept_languages'] ?? false) {\n $accept_languages = $preferences['accept_languages'];\n } elseif (($preferences['lang'] ?? false) === 'en') {\n $accept_languages = 'en,en-us,ru-RU,ru,uk';\n }\n\n $profile->setPreference('intl.accept_languages', $accept_languages);\n\n if ($preferences['no-flash'] ?? false) {\n $profile->setPreference('plugin.state.flash', 0);\n $profile->setPreference('dom.ipc.plugins.enabled.libflashplayer.so', false);\n $profile->setPreference('dom.ipc.plugins.flash.subprocess.crashreporter.enabled', false);\n }\n\n return $profile;\n }", "public function preferences()\n {\n // This is a user only module - redirect everyone else\n // Check this before Security check - maybe after login user has enough rights\n if (!UserUtil::isLoggedIn()) {\n return System::redirect(ModUtil::url('ContactList', 'user', 'loginscreen', array('page' => 'preferences')));\n }\n\n // Security check\n if (!SecurityUtil::checkPermission('ContactList::', '::', ACCESS_COMMENT)) {\n return LogUtil::registerPermissionError(System::getVar('entrypoint', 'index.php'));\n }\n\n // Create new Form reference\n $view = FormUtil::newForm($this->name, $this);\n\n // Execute form using supplied template and page event handler\n return $view->execute('user/preferences.htm', new ContactList_Form_Handler_User_Preferences());\n }", "function init_userprefs($userdata)\r{\r\tglobal $CBT_config, $theme, $images;\r\tglobal $template, $lang, $phpEx, $somCBT_root_path;\r\tglobal $nav_links;\r\r\t$CBT_config['default_lang'] = 'english';\r\t\t \r\t$theme = setup_style( $CBT_config['default_style']);\r\r\treturn;\r}", "function getDefaultUserPreferences(){\n\t\t\t\t$userPreferences = array();\n\t\t\t\t$userPreferences[\"supportedVersions\".$this->pluginVersion] = array( );\n\t\t\t\treturn $userPreferences;\n\t\t\t}", "public function preferencesAction()\r\n {\r\n $this->loadLayout();\r\n $this->_initLayoutMessages('customer/session');\r\n $this->_initLayoutMessages('catalog/session');\r\n\r\n $block = $this->getLayout()->getBlock('customer_preferences');\r\n if ($block) {\r\n $block->setRefererUrl($this->_getRefererUrl());\r\n }\r\n $data = $this->_getSession()->getCustomerFormData(true);\r\n $customer = $this->_getSession()->getCustomer();\r\n if (!empty($data)) {\r\n $customer->addData($data);\r\n }\r\n if ($this->getRequest()->getParam('changepass') == 1) {\r\n $customer->setChangePassword(1);\r\n }\r\n\r\n $this->getLayout()->getBlock('head')->setTitle($this->__('Account Email Preferences'));\r\n $this->getLayout()->getBlock('messages')->setEscapeMessageFlag(true);\r\n $this->renderLayout();\r\n }", "public function getPreferences(){\n \treturn $this->preferences;\n }", "function process_config_options($user_id = null)\n {\n global $user_preferences;\n\n // If the user doesn't have the ability to set his/her own preferences, then don't load it either\n if(!is_null($user_id) && !$user_preferences)\n {\n return;\n }\n\n $config_options = array();\n\n if(get_config_options($user_id, $config_options))\n {\n foreach($config_options as $config_option)\n {\n $param_value = $config_option['value'];\n\n // Prepare the value since everything is stored as a string\n if((is_numeric($param_value) && '' !== $param_value))\n {\n $param_value = (int) $param_value;\n }\n\n $GLOBALS[$config_option['parameter']] = $param_value;\n }\n }\n\n return;\n }", "public function getUserPreferences() {\n\n\t\tif ($this->_authProvider == null)\n\t\t{\n\t\t\tthrow new OSM_Exception('Must be authenticated');\n\t\t}\n\n\t\t$result = $this->_httpApi('/user/preferences');\n\n\t\t$this->getLogger()->debug(__METHOD__.' result:{result}', ['result'=>$result]);\n\n\t\t$prefs = array();\n\n\t\t$x = new \\SimpleXMLElement($result);\n\t\tforeach ($x->preferences->children() as $p)\n\t\t{\n\t\t\t$prefs[(string) $p['k']] = (string) $p['v'];\n\t\t}\n\n\t\treturn $prefs;\n\t}", "function prefs_save($args)\n {\n if ($args['section'] != 'mailbox') {\n return $args;\n }\n\n // Load configuration\n $this->load_config();\n\n // Check that configuration is not disabled\n $dont_override = (array) $this->rc->config->get('dont_override', array());\n $basic_override = in_array('newmail_notifier_basic', $dont_override);\n $sound_override = in_array('newmail_notifier_sound', $dont_override);\n\n if (!$basic_override) {\n $key = 'newmail_notifier_basic';\n $args['prefs'][$key] = get_input_value('_'.$key, RCUBE_INPUT_POST) ? true : false;\n }\n if (!$sound_override) {\n $key = 'newmail_notifier_sound';\n $args['prefs'][$key] = get_input_value('_'.$key, RCUBE_INPUT_POST) ? true : false;\n }\n\n return $args;\n }", "protected static function saveCurrentUser()\n {\n $storage = ParseClient::getStorage();\n $storage->set('user', static::getCurrentUser());\n }", "protected function getAppPrefs() {\n\n $appPrefs = null;\n $coPersonId = $this->Session->read('Auth.User.co_person_id');\n\n // Get preferences if we have an Auth.User.co_person_id\n if(!empty($coPersonId)) {\n $this->loadModel('ApplicationPreference');\n $appPrefs = $this->ApplicationPreference->retrieveAll($coPersonId);\n }\n\n $this->set('vv_app_prefs', $appPrefs);\n }", "function setPluginSetting ($userId, $name, $value)\n\t{\n\t\t$setting = $this->getPluginSettingValue ($userId, $name);\n\t\tif ($setting == null)\n\t\t{\n\t\t\t$setting = $this->itemFactory->getPluginSetting\n\t\t\t\t($userId, $name, $value);\n\t\t\t$this->addItem ($userId, $setting);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$settingId = $this->getPluginSettingId ($userId, $name);\n\t\t\t$setting = $this->getItem ($userId, $settingId);\n\t\t\t$setting->value = $value;\n\t\t\t$this->modifyItem ($userId, $setting);\n\t\t}\n\t}", "public function session_set_user(user $user) {\n //var_dump($user);\n $_SESSION[\"client_site_login\"][\"theme_user\"][\"user\"] = serialize($user);\n }", "function set_config_option($user_id, $param_name, $param_value)\n {\n // We do allow for param values to be empty strings or 0 (zero)\n if(empty($param_name) || is_null($param_value))\n {\n return false;\n }\n\n // Prepare the value before inserting it\n $param_value = config_clean($param_value);\n $param_value = escape_check($param_value);\n\n $query = sprintf('\n INSERT INTO user_preferences (\n user,\n parameter,\n `value`\n )\n VALUES (\n %s, # user\n \\'%s\\', # parameter\n \\'%s\\' # value\n );\n ',\n is_null($user_id) ? 'NULL' : '\\'' . escape_check($user_id) . '\\'',\n escape_check($param_name),\n $param_value\n );\n $current_param_value = null;\n if(get_config_option($user_id, $param_name, $current_param_value))\n {\n if($current_param_value == $param_value)\n {\n return true;\n }\n\n $query = sprintf('\n UPDATE user_preferences\n SET `value` = \\'%s\\'\n WHERE user %s\n AND parameter = \\'%s\\';\n ',\n $param_value,\n is_null($user_id) ? 'IS NULL' : '= \\'' . escape_check($user_id) . '\\'',\n escape_check($param_name)\n );\n\n\t\tif (is_null($user_id))\t\t// only log activity for system changes, i.e. when user not specified\n\t\t\t{\n\t\t\tlog_activity(null, LOG_CODE_EDITED, $param_value, 'user_preferences', 'value', \"parameter='\" . escape_check($param_name) . \"'\", null, $current_param_value);\n\t\t\t}\n\n\t\t}\n\n sql_query($query);\n\n // Clear disk cache\n clear_query_cache(\"preferences\");\n\n return true;\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->preferences = new UserPreferences();\n\t}" ]
[ "0.7501882", "0.7159196", "0.6649655", "0.6481408", "0.6397531", "0.6392905", "0.61905754", "0.6182411", "0.61612254", "0.613839", "0.6123597", "0.611994", "0.61077535", "0.6101471", "0.6002317", "0.59619045", "0.596043", "0.59570134", "0.5931298", "0.5931298", "0.5897275", "0.5892254", "0.58911985", "0.5847533", "0.58412653", "0.58388674", "0.5808545", "0.5791395", "0.57913256", "0.57713604", "0.577034", "0.57437235", "0.57305276", "0.5729151", "0.57163095", "0.5715004", "0.5697746", "0.5664294", "0.56634974", "0.5646309", "0.563965", "0.5636405", "0.56235534", "0.5621977", "0.5617507", "0.5611588", "0.5610038", "0.5605899", "0.5602771", "0.5587254", "0.55814534", "0.5552291", "0.5520814", "0.5519797", "0.55126035", "0.5502997", "0.5499216", "0.5491661", "0.5489877", "0.5479162", "0.5478907", "0.54777664", "0.5468884", "0.5429312", "0.5424241", "0.5407774", "0.5407094", "0.5395618", "0.53924525", "0.5391786", "0.53910154", "0.53902", "0.5373331", "0.53695184", "0.53644675", "0.5363086", "0.5362437", "0.53624153", "0.5362133", "0.5352568", "0.53269523", "0.53248966", "0.53236735", "0.5313315", "0.5311049", "0.5305869", "0.5303365", "0.52817094", "0.5281282", "0.52654165", "0.5255012", "0.5254704", "0.52545774", "0.5251906", "0.52404547", "0.5227732", "0.52271926", "0.52270913", "0.52245563", "0.522304" ]
0.80616295
0
get_favorites get_recommendations This returns recommended objects of $type. The recommendations are based on voodoo economics,the phase of the moon and my current BAL.
get_favorites get_recommendations Это возвращает рекомендованные объекты $type. Рекомендации основаны на вуду-экономике, фазе луны и моем текущем BAL.
function get_recommendations($type) { /* First pull all of your ratings of this type */ $sql = "SELECT object_id,user_rating FROM ratings " . "WHERE object_type='" . Dba::escape($type) . "' AND user='" . Dba::escape($this->id) . "'"; $db_results = Dba::query($sql); // Incase they only have one user $users = array(); while ($r = Dba::fetch_assoc($db_results)) { /* Store the fact that you rated this */ $key = $r['object_id']; $ratings[$key] = true; /* Build a key'd array of users with this same rating */ $sql = "SELECT user FROM ratings WHERE object_type='" . Dba::escape($type) . "' " . "AND user !='" . Dba::escape($this->id) . "' AND object_id='" . Dba::escape($r['object_id']) . "' " . "AND user_rating ='" . Dba::escape($r['user_rating']) . "'"; $user_results = Dba::query($sql); while ($user_info = Dba::fetch_assoc($user_results)) { $key = $user_info['user']; $users[$key]++; } } // end while /* now we've got your ratings, and all users and the # of ratings that match your ratings * sort the users[$key] array by value and then find things they've rated high (4+) that you * haven't rated */ $recommendations = array(); asort($users); foreach ($users as $user_id=>$score) { /* Find everything they've rated at 4+ */ $sql = "SELECT object_id,user_rating FROM ratings " . "WHERE user='" . Dba::escape($user_id) . "' AND user_rating >='4' AND " . "object_type = '" . Dba::escape($type) . "' ORDER BY user_rating DESC"; $db_results = Dba::query($sql); while ($r = Dba::fetch_assoc($db_results)) { $key = $r['object_id']; if (isset($ratings[$key])) { continue; } /* Let's only get 5 total for now */ if (count($recommendations) > 5) { return $recommendations; } $recommendations[$key] = $r['user_rating']; } // end while } // end foreach users return $recommendations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_favorite($type) {\n\n\t\t$fav = RevLoader::get_option('rs_favorite', []);\n\t\t$list = [];\n\n\t\tif (in_array($type, $this->allowed)) {\n\t\t\t$list = $this->get_val($fav, $type, []);\n\t\t}\n\n\t\treturn $list;\n\t}", "function get_favorites($type) { \n\n\t $web_path = Config::get('web_path');\n\n\t\t$results = Stats::get_user(Config::get('popular_threshold'),$type,$this->id,1);\n\n\t\t$items = array();\n\n\t\tforeach ($results as $r) { \n\t\t\t/* If its a song */\n\t\t\tif ($type == 'song') { \n\t\t\t\t$data = new Song($r['object_id']);\n\t\t\t\t$data->count = $r['count'];\n\t\t\t\t$data->format();\n\t\t\t\t$data->f_name = $data->f_link;\n\t\t\t\t$items[] = $data;\n\t\t\t}\n\t\t\t/* If its an album */\n\t\t\telseif ($type == 'album') { \n\t\t\t\t$data = new Album($r['object_id']);\n\t\t\t\t$data->count = $r['count'];\n\t\t\t\t$data->format();\n\t\t\t\t$items[] = $data;\n\t\t\t} \n\t\t\t/* If its an artist */\n\t\t\telseif ($type == 'artist') { \n\t\t\t\t$data = new Artist($r['object_id']);\n\t\t\t\t$data->count = $r['count'];\n\t\t\t\t$data->format();\n\t\t\t\t$data->f_name = $data->f_link;\n\t\t\t\t$items[] = $data;\n\t\t\t} \t\t \n\t\t\t/* If it's a genre */\n\t\t\telseif ($type == 'genre') { \n\t\t\t\t$data = new Genre($r['object_id']);\n\t\t\t\t$data->count = $r['count'];\n\t\t\t\t$data->format();\n\t\t\t\t$data->f_name = $data->f_link;\n\t\t\t\t$items[] = $data;\n\t\t\t}\n\n\t\t} // end foreach\n\t\t\n\t\treturn $items;\n\n\t}", "function format_recommendations($items,$type) { \n\n\t\tforeach ($items as $object_id=>$rating) { \n\n\t\t\tswitch ($type) { \n\t\t\t\tcase 'artist':\n\t\t\t\t\t$object = new Artist($object_id);\n\t\t\t\t\t$object->format_artist(); \n\t\t\t\t\t$name = $object->link;\n\t\t\t\tbreak;\n\t\t\t\tcase 'album':\n\t\t\t\t\t$object = new Album($object_id);\n\t\t\t\t\t$object->format_album(); \n\t\t\t\t\t$name = $object->f_link;\n\t\t\t\tbreak;\n\t\t\t\tcase 'song':\n\t\t\t\t\t$object = new Song($object_id);\n\t\t\t\t\t$object->format_song(); \n\t\t\t\t\t$name = $object->f_link; \n\t\t\t\tbreak;\n\t\t\t} // end switch on type\n\t\t\t$results[] = \"<li>$name -- \" . get_rating_name($rating) . \"<br />\\n</li>\";\n\n\t\t} // end foreach items\n\n\n\t\treturn $results; \n\n\t }", "public function get_favorites(){\n\t\treturn get_option('rs_obj_favorites', array());\n\t}", "public function getRecommendations()\n {\n if ($this->_recommendations === null) {\n $this->_recommendations = $this->_getFacade()->getRecommendations();\n if ($this->_recommendations === null) {\n Mage::helper('factfinder')->performFallbackRedirect();\n }\n }\n\n return $this->_recommendations;\n }", "public function setRecommendationType($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V14\\Enums\\RecommendationTypeEnum\\RecommendationType::class);\n $this->recommendation_type = $var;\n\n return $this;\n }", "public function getRecommendationType()\n {\n return $this->recommendation_type;\n }", "public function get_favorites() {\n return $this->db->order_by('recipeID', 'asc')->get('recipes')->result();\n }", "public function getRecommendations(FactFinderSdkRecommendationRequestTransfer $factFinderRecommendationRequestTransfer);", "public static function addFavorite($id, $type){\n\t\tif(isset($_SESSION['user'])){\n\t\t\tUser::addFavorite($id, $type);\n\t\t\t$_SESSION['favorites'] = User::getFavorites();\n\t\t}\n\t}", "public function get_favorites() {\n \n //Check permissions\n $permission = $this->checkPermissions(Const_Action::LEARN);\n\n if($permission !== Const_Permission::ALLOWED) {\n return View::make('general.permission');\n }\n\n\n //Get user\n $user = User::find($this->user['id']);\n\n //Get favorite catalogs\n $catalogs = array();\n\n foreach ($user->favorites()->get() as $favorite) {\n $fav = Helper_Course::getSubCatalogIDsOfCatalog($favorite);\n $catalogs = array_merge($catalogs, $fav);\n $catalogs = array_unique($catalogs);\n }\n\n //Create view\n $this->layout->content = $this->getLearningView('favorites', $catalogs);\n }", "public function getMyFavorites(){\n if( isset ( $_SESSION['kactoos_access_token'] ) ) {\n $token = unserialize( $_SESSION['kactoos_access_token'] );\n\n $client = $token->getHttpClient( $this->oauth_config );\n $client->setUri(self::$baseurl.'/api/users/get-my-favorites/format/'.$this->format);\n $client->setMethod( Zend_Http_Client::POST );\n $response = $client->request();\n $products = array();\n if($this->format == 'xml'){\n $data = new SimpleXMLElement($response->getBody());\n $size = sizeof($data);\n for($i=0;$i<$size;$i++){\n $products[] = $this->parseProduct($data->product[$i]);\n }\n return $products;\n }else{\n return $response->getBody();\n }\n }\n }", "public function getSocialRecommendations()\n {\n return $this->social_recommendations;\n }", "public function getproduct_feathered($type){\n\t\t\t$pro_in_page = 8;\n\t\t\tif(!isset($_GET['page1'])){\n\t\t\t\t$page = 1;\n\t\t\t}else{\n\t\t\t\t$page = $_GET['page1'];\n\t\t\t}\n\t\t\t$in_page = ($page-1)*$pro_in_page;\n\t\t\t$query = \"SELECT * FROM tbl_product WHERE type = '$type' LIMIT $in_page,$pro_in_page \";\n\t\t\t$result = $this->db->SELECT($query);\n\t\t\treturn $result;\n\t\t}", "public function favorite(Request $request)\n {\n $type = $request->type;\n $id = $request->id;\n $is_favorite = $request->is_favorite;\n switch($type){\n\t\t\t\t case 'project':\n\t\t\t\t\t\t\tif((int)$is_favorite === 1) {\n\t\t\t\t\t\t\t\t\t $favorite = favorite::where('created_by', Auth::user()->id)->where('favorite_type', 'favorite_projects')->where('favorite_id', $id)->delete();\n\t\t\t\t\t\t\t\t\t return response()->json(['favorite' => 'deleted', 'id' => $id]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t $favorite = favorite::updateOrCreate(['created_by' => Auth::user()->id, 'favorite_id' => $id],\n\t\t\t\t\t\t\t\t\t [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'created_by'\t=> Auth::user()->id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'favorite_type'\t=> 'favorite_projects',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'favorite_id'\t=> $id\n\t\t\t\t\t\t\t\t\t\t\t\t\t ]);\n\t\t\t\t\t\t\t\t\treturn response()->json(['favorite' => 'added', 'id' => $id]);\t\t\t\t \n\t\t\t\t\t\t\t}\n\t\t\t\t \t\tbreak;\n\t\t\t\t case 'proposal':\n\t\t\t\t \t\t$fav_proposal = favorite::where('created_by', Auth::user()->id)->where('favorite_type', 'favorite_proposals')->where('favorite_id',$id)->first();\n\t\t\t\t \t\tif($fav_proposal)\n\t\t\t\t\t\t\tfavorite::where('created_by', Auth::user()->id)->where('favorite_type', 'favorite_proposals')->where('favorite_id',$id)->delete();\n\t\t\t\t \t\telse {\n\t\t\t\t \t\t\tfavorite::create([\n\t\t\t\t \t\t\t\t'created_by'\t=> Auth::user()->id,\n\t\t\t\t \t\t\t\t'favorite_type'\t=> 'favorite_proposals',\n\t\t\t\t \t\t\t\t'favorite_id'\t=> $id\n\t\t\t\t\t\t\t\t\t\t\t ]);\n\t\t\t\t \t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t case 'user':\n\t\t\t\t\t\t\t$fav_user = favorite::where('created_by', Auth::user()->id)->where('favorite_type', 'favorite_users')->where('favorite_id',$id)->first();\n\t\t\t\t\t\t\tif($fav_user)\n\t\t\t\t\t\t\t\t\t favorite::where('created_by', Auth::user()->id)->where('favorite_type', 'favorite_users')->where('favorite_id',$id)->delete();\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t favorite::create([\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'created_by'\t=> Auth::user()->id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'favorite_type'\t=> 'favorite_users',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'favorite_id'\t=> $id\n\t\t\t\t\t\t\t\t\t\t\t\t\t ]);\n\t\t\t\t\t\t\t}\n\t\t\t\t \t\tbreak;\n }\n return $favorite;\n }", "public function index(Request $request)\n {\n \n // if($request->all())\n // dd($request->all());\n \n $sort = $request->get('sort');\n $categoryParam = $request->get('category');\n $type = $request->get('type');\n \n $favorites = $favoriteDocuments = $favoritesTreeview = $favoritesPaginated = array();\n $favoriteDocuments = FavoriteDocument::where('user_id', Auth::user()->id)->get();\n $documentTypes = DocumentType::all();\n \n $favoriteCategories = FavoriteCategory::where('user_id', Auth::user()->id)->get();\n \n $hasFavorites = $hasFavoriteCategories = false;\n $favoritesAll = $favoritesCategorised = array();\n // dd(array_pluck($documentTypes, array('id', 'name')));\n \n foreach ($documentTypes as $docType) {\n \n $favsArray = array();\n $favsTmp = array();\n \n $favsArray['document_type_id'] = $docType->id;\n $favsArray['document_type_name'] = $docType->name;\n \n foreach($favoriteDocuments as $fav){\n if(empty($fav->favorite_categories_id)){ // Prevent loading favorites with user-defined categories as duplicates in document-type treeview\n $published = PublishedDocument::where('document_group_id', $fav->document_group_id)->orderBy('id', 'desc')->first();\n if(isset($published->document)){\n if($published->document->document_type_id == $docType->id && $published->document->active == 1 && $published->document->document_status_id == 3){\n array_push($favsTmp, $published->document);\n $hasFavorites = true;\n }\n }\n }\n }\n \n // $favoritesPaginated = Document::whereIn('id', array_pluck($favsTmp, 'id'))->orderBy('name', 'asc')->paginate(10, ['*'], 'seite');\n if($sort && ($type == $docType->id)){\n if($sort == 'asc') $favoritesPaginated = Document::whereIn('id', array_pluck($favsTmp, 'id'))->orderBy('date_published', 'asc')->paginate(10, ['*'], 'page-type-'.str_slug($docType->id));\n else $favoritesPaginated = Document::whereIn('id', array_pluck($favsTmp, 'id'))->orderBy('date_published', 'desc')->paginate(10, ['*'], 'page-type-'.str_slug($docType->id));\n } else $favoritesPaginated = Document::whereIn('id', array_pluck($favsTmp, 'id'))->orderBy('date_published', 'desc')->paginate(10, ['*'], 'page-type-'.str_slug($docType->id));\n \n $favoritesTreeview = $this->favorites->generateTreeview($favoritesPaginated, array('pageFavorites' => true,'showDelete' => true,'showAttachments' => true ));\n \n $favsArray['favoritesPaginated'] = $favoritesPaginated;\n $favsArray['favoritesTreeview'] = $favoritesTreeview;\n \n array_push($favoritesAll, $favsArray);\n }\n \n foreach ($favoriteCategories as $category) {\n \n $favsArray = array();\n $favsTmp = array();\n \n $favsArray['category'] = $category;\n \n foreach($favoriteDocuments as $fav){\n if($fav->favorite_categories_id){ // Check for favorite category ID\n $published = PublishedDocument::where('document_group_id', $fav->document_group_id)->orderBy('id', 'desc')->first();\n if(isset($published->document) && isset($fav->favorite_categories_id)){\n if(($fav->favorite_categories_id == $category->id) && ($published->document->active == 1) && ($published->document->document_status_id == 3)){\n array_push($favsTmp, $published->document);\n $hasFavoriteCategories = true;\n }\n }\n }\n }\n \n // $favoritesPaginated = Document::whereIn('id', array_pluck($favsTmp, 'id'))->orderBy('name', 'asc')->paginate(10, ['*'], 'seite');\n if($sort && ($categoryParam == $category->id)){\n if($sort == 'asc') $favoritesPaginated = Document::whereIn('id', array_pluck($favsTmp, 'id'))->orderBy('date_published', 'asc')->paginate(10, ['*'], 'page-category-'. str_slug($category->id));\n else $favoritesPaginated = Document::whereIn('id', array_pluck($favsTmp, 'id'))->orderBy('date_published', 'desc')->paginate(10, ['*'], 'page-category-'. str_slug($category->id));\n } else $favoritesPaginated = Document::whereIn('id', array_pluck($favsTmp, 'id'))->orderBy('date_published', 'desc')->paginate(10, ['*'], 'page-category-'. str_slug($category->id));\n $favoritesTreeview = $this->favorites->generateTreeview($favoritesPaginated, array('pageFavorites' => true,'showDelete' => true,'showAttachments' => true ));\n \n $favsArray['favoritesPaginated'] = $favoritesPaginated;\n $favsArray['favoritesTreeview'] = $favoritesTreeview;\n \n array_push($favoritesCategorised, $favsArray);\n }\n \n // dd($favoritesCategorised);\n \n return view('favoriten.index', compact('favoritesAll', 'hasFavorites', 'favoritesCategorised', 'hasFavoriteCategories'));\n }", "public function is_favorite($type, $id) {\n\n\t\t$favs = $this->get_favorite($type);\n\n\t\treturn (array_search($id, $favs) !== false) ? true : false;\n\t}", "function get_user_recommenders($start=0, $limit=10, $where=\"\", $sort=\"total_votes DESC\")\r\n {\r\n $rc_users = $this->get_voters($start, $limit, $where, $sort); \r\n return $rc_users;\r\n }", "public function set_favorite($do, $type, $id) {\n\n\t\t$fav = RevLoader::get_option('rs_favorite', []);\n\t\t$id = RevLoader::esc_attr($id);\n\n\t\tif (in_array($type, $this->allowed)) {\n\n\t\t\tif (!isset($fav[$type])) {\n\t\t\t\t$fav[$type] = [];\n\t\t\t}\n\n\t\t\t$key = array_search($id, $fav[$type]);\n\n\t\t\tif ($key === false) {\n\n\t\t\t\tif ($do == 'add') {\n\t\t\t\t\t$fav[$type][] = $id;\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ($do == 'remove') {\n\t\t\t\t\tunset($fav[$type][$key]);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tRevLoader::update_option('rs_favorite', $fav);\n\n\t\treturn $fav;\n\t}", "public static function getRecipesByType($type) {\n $db = Database::getDB();\n $query = \"SELECT * FROM recipes WHERE type = '$type'\";\n $result = $db->query($query);\n $recipes = array();\n foreach ($result as $row) {\n $recipe = new Recipe($row['recipe_name'],\n $row['type'],\n $row['ingredients'],\n $row['servings'],\n $row['calories'],\n $row['prep_time'],\n $row['instructions'],\n $row['image']);\n $recipe->setId($row['id']);\n $recipes[] = $recipe;\n }\n return $recipes;\n }", "function getMyFavorite_get(){\n\t\t//check for auth\n\t\tif(!$this->check_service_auth()){\n $this->response($this->token_error_msg(), SERVER_ERROR); //authetication failed\n }\n \n $offset = $this->get('offset'); \n $limit = $this->get('limit');\n if(!isset($offset) || empty($limit)){\n $offset = 0; $limit= 10;\n }\n \n //get favorite list\n $result = $this->user_model->getMyFaoriteList($offset,$limit);\n //check data exist\n if($result){\n \t$response = array('status' => SUCCESS,'message'=>\"OK\",'favoriteList'=>$result);\n \t$this->response($response);\n }else{\n \t$response = array('status' => FAIL, 'message' => ResponseMessages::getStatusCodeMessage(114));\n \t$this->response($response);\n }\n\t}", "function ting_recommendation_panes_recommendation_list_content_type_content_types() {\n $types = array(\n 'recommendation_list' => array(\n 'title' => t('Ting recommendation list'),\n 'description' => t('Displays a list of recommended Ting objects.'),\n ),\n );\n\n // Append our default settings to every type.\n foreach ($types as $name => $type) {\n $types[$name] += array(\n 'category' => t('Ting'),\n 'required context' => array(\n new ctools_context_optional(t('Ting object'), 'ting_object'), \n new ctools_context_optional(t('Ting collection'), 'ting_collection'),\n ),\n );\n }\n return $types;\n}", "function get_favorites( $out_objects = false ) {\n\t\t\n\t\tif ( $this->user_id != 0 ) {\n\t\t\t\n\t\t\t$favorites = array();\n\t\t\t$i = 0;\n\t\t\t\n\t\t\t// load package_id\n\t\t\t$favorites_data = $this->db->get_results( 'SELECT package_id FROM ' . $this->db->prefix . 'pvmkit_ratings WHERE type = ' . \"'mething'\" . ' AND user_id = ' . $this->user_id );\n\t\t\tforeach ( $favorites_data as $favorit_data ) {\n\t\t\t\t\n\t\t\t\tif ( $out_objects ) {\n\t\t\t\t\t\n\t\t\t\t\t$favorites[ $i ] = new pvmkit_package();\n\t\t\t\t\t$favorites[ $i ]->load_by_id( $favorit_data->package_id );\n\t\t\t\t\t$this->favorites[] = $favorit_data->package_id;\n\t\t\t\t\t$i++;\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$this->favorites[] = $favorit_data->package_id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\tif ( $out_objects ) {\n\t\t\t\treturn $favorites;\n\t\t\t} else {\n\t\t\t\treturn $this->favorites;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn false; \n\t}", "public function favorites()\n {\n return $this->morphMany(Favorite::class, 'favorable');\n }", "public function favorites()\n {\n return $this->morphMany(Favorite::class, 'favorited');\n }", "public function favorites()\n {\n return $this->morphMany(Favorite::class, 'favorited');\n }", "public function recommendations( $num = 10 )\n {\n if( $this->get_cluster() )\n return $this->get_cluster()->recommendations( $num );\n else\n return Article::find_all( $num );\n\n }", "public function getRecommendations(PersonInterface $person, $geoip_data = array(), $limit = 0)\n {\n /**\n *This is our method for ranking categories. It is based on user preferences in the members section.\n *There is a preference intact for every one of our major categories.\n *In the /members/my interests page, the default setting is to have all categories selected.\n *Users must manually uncheck categories.\n *In the remaining checked categories, each member is assigned a score for each category.\n *This score is based on the number of prints and views the user has in each category. (Behavioral recommendation)\n *The categories are then ranked according to the $aGroupings array.\n *A ranking of 40 for the most-liked category, 25 for the second, and so on.\n *Then, suggestions are made, grabbing entities from the DB according to the array rankings.\n *They are also selected according to popularity (other users' clips, prints, likes, dislikes, reviews)\n *These orders are shuffled, then displayed in a random order.\n *For nonmembers, there is a similar process, but user activity and preference is not a factor.\n *Grabs 40, 25, 15, 10, 5, 3, and 2 popular offers for random categories based on locations.\n */\n\n $aGroupings = array(40, 25, 15, 10, 5, 3, 2);\n $aCategories = array(\n 'food_dining' => 4,\n 'home_services' => 231,\n 'health_beauty' => 11,\n 'auto_transportation' => 10,\n 'travel_entertainment' => 5,\n 'retail_fashion' => 8,\n 'special_services' => 9\n );\n if(Config::get('cache.driver') != 'file' && $person->getType() == 'User')\n {\n //Lots of errors\n //if(Cache::tags('recommendations', $person->getType())->has($person->id))\n // return Cache::tags('recommendations', $person->getType())->get($person->id);\n }\n $geoip = empty($geoip_data) ? json_decode(GeoIp::getGeoIp('json')) : $geoip_data;\n\n $cartesian = SoeHelper::getCartesian($geoip->latitude, $geoip->longitude);\n $zip_distance = DB::raw('(sqrt(pow(zipcodes.latm - '.$cartesian['latm'].', 2) + pow(zipcodes.lngm - '.$cartesian['lngm'].', 2)))');\n //$zip_distance = DB::raw('(sqrt(pow(zipcodes.latm - '.$cartesian['latm'].', 2) + pow(zipcodes.lngm - '.$cartesian['lngm'].', 2)))');\n $zipcode = SOE\\DB\\Zipcode::where('state', '=', $geoip->region_name)\n ->where('city', '=', $geoip->city_name)\n ->where('zipcodetype', '=', 'STANDARD')\n ->where(function($query)\n {\n $query->where('locationtype', '=', 'PRIMARY');\n $query->orWhere('locationtype', '=', 'ACCEPTABLE');\n })\n ->where($zip_distance, '<', 68000)// Remove times when accuracy is not great\n ->orderBy('estimatedpopulation', 'desc')\n ->first(array('zipcodes.*'));\n $geoip->latitude = $zipcode->latitude;\n $geoip->longitude = $zipcode->longitude;\n $geoip->region_name = $zipcode->state;\n $geoip->city_name = $zipcode->city;\n\n $cartesian = array('latm' => $zipcode->latm, 'lngm' => $zipcode->lngm);\n $distance = DB::raw('(sqrt(pow(entities.latm - '.$cartesian['latm'].', 2) + pow(entities.lngm - '.$cartesian['lngm'].', 2)))');\n $ranks = $person->getRankings();\n $preferences = $person->getPreferences();\n arsort($ranks);\n $i=0;\n $entities = array();\n $aIDs = array(0);\n\n //Get featured entities to stuff\n $stuff_config = SOE\\DB\\Feature::where('type', '=', 'config')->where('entity', '=', 'save')->where('name', '=', 'recommendation_stuffing')->remember(Config::get('soe.cache', 60*60*24))->first();\n $stuff_config = empty($stuff_config) ? 0 : $stuff_config->value;\n $featured = SOE\\DB\\Entity::where('state', '=', $geoip->region_name)\n ->where(function($query)\n {\n $query->where('starts_year', '=', date('Y'));\n $query->where('starts_day', '<=', (date('z')+1));\n $query->orWhere('starts_year', '<', (date('Y')));\n })\n ->where(function($query)\n {\n $query->where('expires_year', '=', date('Y'));\n $query->where('expires_day', '>=', (date('z')+1));\n $query->orWhere('expires_year', '>=', (date('Y')+1));\n })\n ->where('is_active', '=', '1')\n ->where('location_active', '=', '1')\n ->where('franchise_active', '=', '1')\n ->where('is_featured', '=', '1')\n ->groupBy('location_id')\n ->orderBy(DB::raw('RAND()'))\n ->take($stuff_config)\n ->remember(Config::get('soe.cache', 60*60*24))\n ->get();\n foreach($featured as $feature)\n {\n array_push($aIDs, $feature->id);\n }\n $aString = \"((0,'Offer'),\";\n foreach($featured as $feat)\n {\n $aString .= \"(\".$feat->entitiable_id.\",'\".$feat->entitiable_type.\"'),\";\n }\n $aString = rtrim($aString, ',');\n $aString .= ')';\n\n $aStates = Zipcode::getSurroundingStates($geoip->latitude, $geoip->longitude);\n\n $radius = Feature::findByName('recommendation_dist');\n $radius = empty($radius) ? 34000 : $radius->value;\n foreach($ranks as $slug => $rank)\n {\n if($preferences[$slug] == 0)\n {\n continue;\n }\n $query = DB::table('entities')->where($distance, '<', $radius) //About 20 miles\n ->whereIn('state', $aStates)// '=', $geoip->region_name)\n ->where('category_id', '=', $aCategories[$slug])\n ->where(function($query)\n {\n $query->where('starts_year', '=', date('Y'));\n $query->where('starts_day', '<=', (date('z')+1));\n $query->orWhere('starts_year', '<', (date('Y')));\n })\n ->where(function($query)\n {\n $query->where('expires_year', '=', date('Y'));\n $query->where('expires_day', '>=', (date('z')+1));\n $query->orWhere('expires_year', '>=', (date('Y')+1));\n })\n ->whereRaw('(entitiable_id, entitiable_type) NOT IN '.$aString)\n ->where('is_featured', '=', '0')\n ->where('location_active', '=', '1')\n ->where('franchise_active', '=', '1')\n ->where('is_active', '=', '1');\n if($person->showDemo() == false)\n {\n $query = $query->where('is_demo', '=', '0')\n ->where('franchise_demo', '=', '0');\n }\n $entities[] = $query->orderBy('popularity', 'desc')\n ->groupBy('merchant_id')\n ->take($aGroupings[$i])\n ->remember(Config::get('soe.cache', 60*60*24))\n ->get(array('id', 'entitiable_id', 'entitiable_type', 'location_id'));\n $i++;\n }\n\n $aRecIDs = array(0);\n $aLocIDs = array(0);\n $aEntIDs = array(0);\n $aComposite = array(array(0,'Offer'));\n foreach($entities as $entity)\n {\n foreach($entity as $e)\n {\n $aLocIDs[] = $e->location_id;\n $aRecIDs[] = $e->id;\n $aComposite[] = array($e->entitiable_id, $e->entitiable_type);\n if($e->entitiable_type == 'Offer')\n {\n $aEntIDs[] = $e->entitiable_id;\n }\n }\n }\n\n $counts_query = SOE\\DB\\Entity::whereIn('state', $aStates)->whereIn('location_id', $aLocIDs);\n\n if($person->showDemo() == false)\n {\n $counts_query = $counts_query->where('is_demo', '=', '0')\n ->where('franchise_demo', '=', '0');\n }\n $counts = $counts_query->where(function($query)\n {\n $query->where('starts_year', '=', date('Y'));\n $query->where('starts_day', '<=', (date('z')+1));\n $query->orWhere('starts_year', '<', (date('Y')));\n })\n ->where(function($query)\n {\n $query->where('expires_year', '=', date('Y'));\n $query->where('expires_day', '>=', (date('z')+1));\n $query->orWhere('expires_year', '>=', (date('Y')+1));\n })\n ->where('is_active', '=', '1')\n ->where('location_active', '=', '1')\n ->where('franchise_active', '=', '1')\n ->groupBy('location_id')\n ->remember(Config::get('soe.cache', 60*60*24))\n ->get(array('location_id', DB::raw('COUNT(*) as total_entities')));\n $aCounts = array();\n foreach($counts as $count)\n {\n $aCounts[$count->location_id] = $count->total_entities;\n }\n\n $aClipIDs = array(0);\n if($person->getType() == 'User')\n {\n $clips = SOE\\DB\\UserClipped::whereIn('offer_id', $aEntIDs)\n ->where('user_id', '=', $person->id)\n ->where('is_deleted', '=', '0')\n ->get(array('offer_id'));\n foreach($clips as $clip)\n {\n $aClipIDs[] = $clip->offer_id;\n }\n }\n\n shuffle($aRecIDs);\n\n $entity_filters = array();\n $entity_filters[] = array('type' => 'whereIn', 'key' => 'id', 'value' => $aIDs);\n $featured_results = Entity::get($entity_filters);\n\n $entity_filters = array();\n $entity_filters[] = array('type' => 'whereIn', 'key' => 'id', 'value' => $aRecIDs);\n $rec_results = Entity::get($entity_filters);\n\n $results = array('objects' => array());\n $results['objects'] = array_merge($featured_results['objects'], $rec_results['objects']);\n $results['stats'] = array('total' => count($results['objects']), 'page' => 0, 'take' => 0, 'returned' => count($results['objects']));\n\n if($limit != 0)\n {\n $copy_results = $rec_results;\n shuffle($copy_results['objects']);\n $rec_results['objects'] = array();\n for($i = 0; $i < $limit && $i < $copy_results['stats']['returned']; $i++)\n {\n $rec_results['objects'][] = $copy_results['objects'][$i];\n }\n $rec_results['stats']['returned'] = $limit > $rec_results['stats']['returned'] ? $rec_results['stats']['returned'] : $limit;\n $rec_results['stats']['limit'] = $limit;\n foreach($rec_results['objects'] as $ent)\n {\n $ent->is_clipped = ($ent->entitiable_type == 'Offer' && in_array($ent->entitiable_id, $aClipIDs)) ? 1 : 0;\n $ent->total_entities = isset($aCounts[$ent->location_id]) ? $aCounts[$ent->location_id] : 0;\n }\n return $rec_results;\n }\n\n foreach($results['objects'] as $ent)\n {\n $ent->is_clipped = ($ent->entitiable_type == 'Offer' && in_array($ent->entitiable_id, $aClipIDs)) ? 1 : 0;\n $ent->total_entities = isset($aCounts[$ent->location_id]) ? $aCounts[$ent->location_id] : 0;\n }\n if(Config::get('cache.driver') != 'file' && $person->getType() == 'User')\n {\n //Lots of errors\n //Cache::tags('recommendations', $person->getType())->put($person->id, $results, 30);\n }\n return $results;\n }", "public function get_restaurants_ratings_list($restaurant_id)\r\n {\r\n \t$total_people = $this->db->query(\"SELECT COUNT(rating) AS count_people\r\n \t\t\t\t\t\t\t FROM reviews\r\n\t\t\t\t\t\t\t\t WHERE restaurant_id = '{$restaurant_id}' \r\n\t\t\t\t\t\t\t\t AND category_id = '1'\")->row();\r\n \t\r\n \t$total_stars = $this->db->query(\"SELECT SUM(rating) AS sum_stars\r\n \t\t\t\t\t\t\t FROM reviews\r\n\t\t\t\t\t\t\t\t WHERE restaurant_id = '{$restaurant_id}' \r\n\t\t\t\t\t\t\t\t AND category_id = '1'\")->row();\r\n \t\r\n \tif(floatval($total_people->count_people) != 0)\r\n \t{\t\r\n \t\t$ratings['1'] = round((floatval($total_stars->sum_stars) / floatval($total_people->count_people))*2)/2;\r\n \t}\r\n \telse\r\n \t{\r\n \t\t$ratings['1'] = 0;\r\n \t}\r\n \t\r\n \t//getting second (ambiance) category ratings \r\n \t$total_people = $this->db->query(\"SELECT COUNT(rating) AS count_people\r\n \t\t\t\t\t\t\t FROM reviews\r\n\t\t\t\t\t\t\t\t WHERE restaurant_id = '{$restaurant_id}' \r\n\t\t\t\t\t\t\t\t AND category_id = '2'\")->row();\r\n \t\r\n \t$total_stars = $this->db->query(\"SELECT SUM(rating) AS sum_stars\r\n \t\t\t\t\t\t\t FROM reviews\r\n\t\t\t\t\t\t\t\t WHERE restaurant_id = '{$restaurant_id}' \r\n\t\t\t\t\t\t\t\t AND category_id = '2'\")->row();\r\n \t\r\n \tif(floatval($total_people->count_people) != 0)\r\n \t{\t\r\n \t\t$ratings['2'] = round((floatval($total_stars->sum_stars) / floatval($total_people->count_people))*2)/2;\r\n \t}\r\n \telse\r\n \t{\r\n \t\t$ratings['2'] = 0;\r\n \t}\r\n \t\r\n\r\n \t//getting third (food_quality) category ratings \r\n \t$total_people = $this->db->query(\"SELECT COUNT(rating) AS count_people\r\n \t\t\t\t\t\t\t FROM reviews\r\n\t\t\t\t\t\t\t\t WHERE restaurant_id = '{$restaurant_id}' \r\n\t\t\t\t\t\t\t\t AND category_id = '3'\")->row();\r\n \t\r\n \t$total_stars = $this->db->query(\"SELECT SUM(rating) AS sum_stars\r\n \t\t\t\t\t\t\t FROM reviews\r\n\t\t\t\t\t\t\t\t WHERE restaurant_id = '{$restaurant_id}' \r\n\t\t\t\t\t\t\t\t AND category_id = '3'\")->row();\r\n \t\r\n \tif(floatval($total_people->count_people) != 0)\r\n \t{\t\r\n \t\t$ratings['3'] = round((floatval($total_stars->sum_stars) / floatval($total_people->count_people))*2)/2;\r\n \t}\r\n \telse\r\n \t{\r\n \t\t$ratings['3'] = 0;\r\n \t}\r\n\r\n \t//getting fourth (service) category ratings \r\n \t$total_people = $this->db->query(\"SELECT COUNT(rating) AS count_people\r\n \t\t\t\t\t\t\t FROM reviews\r\n\t\t\t\t\t\t\t\t WHERE restaurant_id = '{$restaurant_id}' \r\n\t\t\t\t\t\t\t\t AND category_id = '4'\")->row();\r\n \t\r\n \t$total_stars = $this->db->query(\"SELECT SUM(rating) AS sum_stars\r\n \t\t\t\t\t\t\t FROM reviews\r\n\t\t\t\t\t\t\t\t WHERE restaurant_id = '{$restaurant_id}' \r\n\t\t\t\t\t\t\t\t AND category_id = '4'\")->row();\r\n \t\r\n\t\tif(floatval($total_people->count_people) != 0)\r\n \t{\t\r\n \t\t$ratings['4'] = round((floatval($total_stars->sum_stars) / floatval($total_people->count_people))*2)/2;\r\n \t}\r\n \telse\r\n \t{\r\n \t\t$ratings['4'] = 0;\r\n \t}\r\n \treturn $ratings;\r\n }", "public function getFeatured($type, $num)\n {\n $catId = $this->getCategoriesByType($type);\n\n $this->dao->select(\n \"f.pk_i_id as pk_i_id\"\n .\", m.s_slug as s_update_url\"\n .\", m.s_banner as s_banner\"\n .\", m.s_banner_path as s_banner_path\"\n .\", m.s_preview as s_preview\"\n .\", f.s_file as s_source_file\"\n .\", f.s_compatible as s_compatible\"\n .\", f.s_version as s_version\"\n .\", f.s_download as s_download\"\n .\", i.fk_i_category_id as fk_i_category_id\"\n .\", i.dt_pub_date as dt_pub_date\"\n .\", i.dt_mod_date as dt_mod_date\"\n .\", i.s_contact_name as s_contact_name\"\n .\", m.fk_i_item_id as fk_i_item_id\"\n .\", d.s_title as s_title\"\n .\", d.s_description as s_description\"\n .\", m.i_total_downloads as i_total_downloads\"\n .\", m.b_featured as b_featured\"\n );\n $this->dao->from($this->getTable().\" m\");\n $this->dao->join($this->getTable_Files().\" f \", \"f.fk_i_market_id = m.pk_i_id\", \"LEFT\");\n $this->dao->join(DB_TABLE_PREFIX.\"t_item i \", \"i.pk_i_id = m.fk_i_item_id\", \"LEFT\");\n $this->dao->join(DB_TABLE_PREFIX.\"t_item_description d\", \"d.fk_i_item_id = m.fk_i_item_id\", \"LEFT\");\n $this->dao->where('f.b_enabled', 1);\n $this->dao->where('m.b_featured', 1);\n if($catId!=null) {\n $this->dao->where('i.fk_i_category_id IN ('. $catId .')' );\n }\n // ?? order by pub data, mod date\n// $this->dao->orderBy('i.dt_pub_date, i.dt_mod_date', 'DESC');\n $this->dao->orderBy('f.pk_i_id', 'DESC');\n $subquery = $this->dao->_getSelect() ;\n $this->dao->_resetSelect() ;\n\n // group by item_id, and sort\n $this->dao->select();\n $this->dao->from($this->getTable_Files());\n $this->dao->join(sprintf( '(%s) as aux', $subquery ), \"aux.pk_i_id = \".DB_TABLE_PREFIX.\"t_market_files.pk_i_id \", \"RIGHT\");\n $this->dao->groupBy($this->getTable_Files().\".fk_i_market_id\");\n $this->dao->orderBy(DB_TABLE_PREFIX.'t_market_files.pk_i_id', 'DESC');\n $this->dao->limit(0, $num);\n\n $result = $this->dao->get() ;\n\n if($result!==false) {\n $data = $result->result();\n\n foreach($data as $k => $v) {\n $data[$k]['e_type'] = $type;\n // clean description\n $aux_description = $data[$k]['s_description'];\n $data[$k]['s_description'] = nl2br($aux_description);\n\n $this->extendWithImages($v['fk_i_item_id'], $data[$k]);\n\n unset($data[$k]['fk_i_item_id']);\n unset($data[$k]['fk_i_category_id']);\n unset($data[$k]['pk_i_id']);\n }\n return $data;\n } else {\n return array();\n }\n }", "function getFavs() {\n\t\tglobal $w, $wuser;\n\t\t//\n\t\t$query = 'SELECT j.juego_id, j.j_title, j.j_hits, j.j_votos_pos, j.j_date, j.j_imagen, j.j_url, u.* FROM j_juegos AS j LEFT JOIN j_favoritos AS f ON f.fav_juego = j.juego_id LEFT JOIN usuarios AS u ON u.usuario_id = j.j_user WHERE f.fav_user = \\''.$_SESSION['uid'].'\\' AND j.j_status = \\'0\\' ORDER BY j.juego_id DESC';\n // PAGINAR\n $total = mysql_num_rows(mysql_query($query));\n $pages = $w->getPagination($total, 12);\n $data['pages'] = $pages;\n $data['total'] = $total;\n //\n $data['data'] = result_array(mysql_query($query.' LIMIT '.$pages['limit'])); \n //\n return $data;\n\t}", "public function getlists($type) {\n if($type == 1) {\n return ProductList::with(['user', 'items', 'event'])->orderBy('updated_at', 'DESC')->paginate(20);\n } else if($type == 2) {\n return ProductList::with(['user', 'items'])->where('event_id', null)->orderBy('updated_at', 'DESC')->paginate(20);\n } else {\n return ProductList::with(['user', 'items', 'event'])->where('event_id', '!=', null)->orderBy('updated_at', 'DESC')->paginate(20);\n }\n }", "function quotes_user_favorites_get() {\r\n\t\t$resp = $this->prepare_response();\r\n\t\t\r\n\t\t// check access_token if existed\r\n\t\t$id = $this->check_authentication();\t\r\n\t\t\r\n\t\t$userid = $this->get('userid');\r\n\t\t\r\n\t\tif ($userid == false || is_int($userid)) {\r\n\t\t\t$resp['status'] = 400;\r\n\t\t\t$resp['message'] = 'User id missing.';\r\n\t\t\t$this->response($resp, 400);\r\n\t\t}\r\n\t\t\r\n\t\t$quotes = $this->quote_model->get_fav_quotes($userid);\r\n\t\t\r\n\t\tif ($quotes == false)\r\n\t\t\t$resp['data'] = null;\r\n\t\telse {\r\n\t\t\tforeach ($quotes as $key => $quote) {\r\n\t\t\t\t$quotes[$key] = $this->_build_quote_resp($quote, $id);\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$resp['data'] = $quotes;\r\n\t\t}\r\n\t\t\r\n\t\t$this->response($resp, 200);\t\r\n\t}", "function jig_get_fli_types(){\r\n\t\t\tcheck_ajax_referer('jig_get_fli_types', 'security');\r\n\t\t\t$user_id = $_REQUEST['user_id'];\r\n\t\t\t$output = array();\r\n\t\t\t$output['elements'] = '';\r\n\t\t\t$fli_api_key = trim($this->settings['fli_api_key']);\r\n\r\n\t\t\t// check for the photostream (public photos)\r\n\t\t\t$flickr_url = \"https://api.flickr.com/services/rest?api_key=\".$fli_api_key.\"&format=php_serial&method=flickr.people.getPublicPhotos&per_page=1&user_id=\".$user_id;\r\n\t\t\t$rsp = maybe_unserialize($this->file_get_contents_curl($flickr_url));\r\n\t\t\tif(!empty($rsp) && $rsp['photos']['total'] > 0){\r\n\t\t\t\t// got photos\r\n\t\t\t\t$output['elements'] .= '<div class=\"JIGupdateButton fliTypeBtn fliPhotostreamBtn\">Photostream</div>';\r\n\t\t\t}elseif(!empty($rsp) && $rsp['stat'] == 'fail'){\r\n\t\t\t\techo json_encode(array('error' => sprintf(__(\"Error from Flickr: %s (code %d)\", 'jig_td'),$rsp['message'],$rsp['code'])));\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\r\n\t\t\t// check for favorites\r\n\t\t\t$flickr_url = \"https://api.flickr.com/services/rest?api_key=\".$fli_api_key.\"&format=php_serial&method=flickr.favorites.getPublicList&per_page=1&user_id=\".$user_id;\r\n\t\t\t$rsp = maybe_unserialize($this->file_get_contents_curl($flickr_url));\r\n\t\t\tif($rsp['photos']['total'] > 0){\r\n\t\t\t\t// got favs\r\n\t\t\t\t$output['elements'] .= '<div class=\"JIGupdateButton fliTypeBtn fliFavoritesBtn\">Favorites</div>';\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// check for groups\r\n\t\t\t$flickr_url = \"https://api.flickr.com/services/rest?api_key=\".$fli_api_key.\"&format=php_serial&method=flickr.people.getPublicGroups&invitation_only=1&user_id=\".$user_id;\r\n\t\t\t$rsp = maybe_unserialize($this->file_get_contents_curl($flickr_url));\r\n\t\t\tif(count($rsp['groups']['group']) > 0){\r\n\t\t\t\t// got groups\r\n\t\t\t\t$output['elements'] .= '<div class=\"JIGupdateButton fliTypeBtn\" id=\"fliGroupSelector\">Group pool (+)</div>';\r\n\t\t\t}\r\n\r\n\t\t\t// check for photosets\r\n\t\t\t$flickr_url = \"https://api.flickr.com/services/rest?api_key=\".$fli_api_key.\"&format=php_serial&method=flickr.photosets.getList&per_page=1&user_id=\".$user_id;\r\n\t\t\t$rsp = maybe_unserialize($this->file_get_contents_curl($flickr_url));\r\n\t\t\tif($rsp['photosets']['total'] > 0){\r\n\t\t\t\t// got photosets\r\n\t\t\t\t$output['elements'] .= '<div class=\"JIGupdateButton fliTypeBtn\" id=\"fliPhotosetSelector\">Album (+)</div>';\r\n\t\t\t}\r\n\r\n\t\t\t// check for collections\r\n\t\t\t$flickr_url = \"https://api.flickr.com/services/rest?api_key=\".$fli_api_key.\"&format=php_serial&method=flickr.collections.getTree&per_page=1&user_id=\".$user_id;\r\n\t\t\t$rsp = maybe_unserialize($this->file_get_contents_curl($flickr_url));\r\n\t\t\tif(count($rsp['collections']) > 0){\r\n\t\t\t\t// got photosets\r\n\t\t\t\t$output['elements'] .= '<div class=\"JIGupdateButton fliTypeBtn\" id=\"fliCollectionSelector\">Collection (+)</div>';\r\n\t\t\t}\r\n\r\n\t\t\t// check for galleries\r\n\t\t\t$flickr_url = \"https://api.flickr.com/services/rest?api_key=\".$fli_api_key.\"&format=php_serial&method=flickr.galleries.getList&per_page=1&user_id=\".$user_id;\r\n\t\t\t$rsp = maybe_unserialize($this->file_get_contents_curl($flickr_url));\r\n\t\t\tif($rsp['galleries']['total'] > 0){\r\n\t\t\t\t// got groups\r\n\t\t\t\t$output['elements'] .= '<div class=\"JIGupdateButton fliTypeBtn\" id=\"fliGallerySelector\">Gallery (+)</div>';\r\n\t\t\t}\r\n\r\n\t\t\tif($output['elements'] == ''){\r\n\t\t\t\t$output['error'] .= '<div id=\"fliError\">'.__(\"You don't have any resource on Flickr that this plugin could load! If you believe this is not true, there might be a Flickr user with the same user name as you. Remove this user and add yourself by providing your full Flickr profile URL in the settings.\",\"jig_td\").'</div>';\r\n\t\t\t}else{\r\n\t\t\t\t$output['elements'] .= '<div class=\"JIGupdateButton fliTypeBtn\" id=\"fliPassToSeach\">Search...</div>';\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\techo json_encode($output);\r\n\t\t\tdie();\r\n\t\t}", "public function findUserFavorites(User $user);", "public function listRecommendations($request): ListRecommendationsResponse;", "public function getRecommendations() {\n if (empty($this->productIds)) {\n $dataProviderParams = $this->getDataProvider()->getParams();\n $requestParams = $this->getParamsParser()->getRequestParams();\n if (isset($dataProviderParams['id'])) {\n $this->productIds = $dataProviderParams['id'];\n } elseif (isset($requestParams['id'])) {\n $this->productIds = array($requestParams['id']);\n }\n if (empty($this->productIds)) {\n trigger_error('Recommendations cannot be loaded without id. Could not load id from request.', E_USER_WARNING);\n return array();\n }\n }\n if (!$this->recommendationUpToDate || !isset($this->recommendation) || $this->recommendation == null) {\n $this->recommendation = $this->createRecommendations();\n $this->recommendationUpToDate = true;\n }\n return $this->recommendation;\n }", "public function showByType($type,$value)\n {\n\t\t$recipes = DB::select('CALL recipeGetRecipesByTypeSP(?,?)',Array($type,$value));\n\n\t\tif (!$recipes)\n\t\t{\n\t\t\t$recipes = config('result.empty');\n\t\t}\n\t\t\n return $recipes;\n }", "public function actionFavourites()\n\t{\n\t $id =Yii::app()->user->id;\n\t\t\t$model = $this->loadModel($id);\n\t\t\tif($model->role == '2'){\n\t\t\t\t$productids = explode(',',$model->favourite_products);\n\t\t\t\t$productids = array_filter($productids);\n\t\t\t\tif(count($productids))\n\t\t\t\t $products = Storeproducts::model()->getinfo_byids($productids);\n\t\t\t\t else{\n\t\t\t\t\t$products = array();\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t\t$this->render('favourite',array(\n\t\t\t\t\t 'model'=> $model,\n\t\t\t\t\t 'products'=>$products,\n\t\t\t\t\t));\n\t\t\t}\n\t}", "public function getAllFavorites($user_id)\n\t{\t\n\t\t// get all favorites id\n\t\t$favoris = $this->findAll(array('conditions'=> array('users_id' => $user_id)));\n\t\t$data = array();\n\n\t\t// get all the spot from their id\n\t\tforeach ($favoris as $favoris) {\n\t\t\t$favoris = $this->load($favoris->spots_id, 'spots');\n\t\t\n\t\t\tif(isset($favoris[0])) {\n\t\t\t\t$data[] = $favoris[0];\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn (object) $data;\n\t}", "public function getRecommended(){\n $hotels = HotelProfile::limit(4)->get();\n return new HotelProfileCollection($hotels);\n }", "public function getFavoriteList($user) {\n $condition = $this->getUserCondition($user) . \" AND `\" . self::FIELD_FAVORITE . \"`='1'\";\n return $this->getDatabase()->select(self::TABLE_NAME,\n null,\n $condition,\n $this->getTablePrimaryRow(),\n null);\n }", "function list_reviews()\n{\n\t$query = mysql_query('SELECT review_type FROM `wp_pgrvw` WHERE featured=1 AND review_type!=\"\" GROUP BY review_type;');\n\techo mysql_error();\n\t $i = 0;\n\t while ($cont = mysql_fetch_array($query, MYSQL_ASSOC)) {\n\t\t$cat[$i] = $cont[review_type];\n\t\t$i++;\n\t }\n\t // going through an array of categories to retrieve data for featured reviews in each of them\n\t foreach ($cat as $r_type) {\n\t\t$query = mysql_query(\"SELECT urllogo, title, descr, padeid AS page_id, urlreview FROM `wp_pgrvw` WHERE featured=1 AND review_type='\".$r_type.\"' ORDER BY id DESC LIMIT 0,3;\");?>\n\t\t<div class=\"featured_title\"><h2> <? echo $r_type;?> reviews </h2></div>\n\t\t<div class=\"featured_content\">\n<?\n\t\twhile ($cont = mysql_fetch_array($query, MYSQL_ASSOC)) {\n?>\n\t\t\t<div class=\"featured_review\">\n\t\t\t<?if (isset($cont[urllogo]) && $cont[urllogo]!=\"\") {?><img alt=\"<? echo $cont[title];?>\" src=\"<?echo $cont[urllogo];?>\" /> <?}?>\n\t\t\t<div class=\"featured_review_title\">\n\t\t\t<? echo \"<a href='\".get_permalink($cont[page_id]).\"'>\".$cont[title].\"</a>\";?>\n\t\t\t</div>\n\t\t\t<div class=\"featured_review_text\">\n\t\t\t<?\n\t\t\techo chopsentences($cont[descr],3);\n\t\t\t?>\n\t\t\t</div>\n\t\t\t<div class=\"featured_review_bottom\">\n\t\t\t<? echo \"<a class=\\\"readon\\\" href='\".get_permalink($cont[page_id]).\"'>Read more</a>\";?>\n\t\t\t<?\n\t\t\tif ($cont[urlreview] != \"\") echo \"<a class=\\\"readon\\\" href='\".$cont[urlreview].\"' target=\\\"_blank\\\">Play now</a>\";\n\t\t\t?>\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?\n\t\t}\n\t\t?>\n\t\t</div>\n\t\t<?\n\t }\n}", "function get_user_recommendees($start=0, $limit=10, $where=\"\", $sort=\"total_votes DESC\")\r\n { \r\n return $this->get_objecters($start, $limit, $where, $sort);\r\n }", "public function recommendation()\n {\n $data = Reviews::with('buysell')->select(\"buysell_id\", DB::raw(\"count(*) as num\"))\n ->groupBy('buysell_id')\n ->orderBy('num','desc')\n ->get();\n\n\n return $data;\n }", "public function testRecommendations()\n {\n $recommendations = $this->client->recommendations(Client::RECOMMENDATIONS_TRENDING);\n\n $this->assertEquals(\n \"https://api.bestbuy.com/beta/products/trendingViewed?apiKey={$this->apiKey}&format=json\",\n $recommendations->metadata->context->canonicalUrl\n );\n\n $this->throttle();\n }", "public function favorites()\n {\n $favoritesArray = unserialize(Auth::user()->favorites);\n $seriesData = [];\n $productGroup = [];\n\n // Get the product data\n $productData = Product::whereIn('number', $favoritesArray)->get();\n\n // Store each series from the products in a separate array for categorisation\n foreach ($productData as $product) {\n array_push($seriesData, $product->series);\n }\n\n // Only keep the unique values\n $seriesData = array_unique($seriesData);\n\n // Put the product and series data in a new array\n foreach ($seriesData as $key => $series) {\n foreach ($productData as $product) {\n if ($product->series == $series) {\n $productGroup[$series][] = $product;\n }\n }\n }\n\n return view('account.favorites', [\n 'favorites' => $productData,\n 'discounts' => Helper::getProductDiscount(Auth::user()->login),\n 'groupData' => $productGroup,\n ]);\n }", "function get_preferences($user_id=0,$type=0) { \n\t\n\t\t// Fill out the user id\n\t\t$user_id = $user_id ? Dba::escape($user_id) : Dba::escape($this->id); \n\n\t\tif ($user_id != '-1') { \n\t\t\t$user_limit = \"AND preference.catagory != 'system'\";\n\t\t}\n\n\t\tif (!Config::get('use_auth')) { $user_id = '-1'; }\n\t\t\t\n\t\tif ($type != '0') { \n\t\t\t$user_limit = \"AND preference.catagory = '\" . Dba::escape($type) . \"'\";\n\t\t}\n\n\t\n\t\t$sql = \"SELECT preference.name, preference.description, preference.catagory, preference.level, user_preference.value \" . \n\t\t\t\"FROM preference INNER JOIN user_preference ON user_preference.preference=preference.id \" .\n\t\t\t\"WHERE user_preference.user='$user_id' \" . $user_limit;\n\t\t$db_results = Dba::query($sql);\n\n\t\t/* Ok this is crapy, need to clean this up or improve the code FIXME */\n\t\twhile ($r = Dba::fetch_assoc($db_results)) { \n\t\t\t$type = $r['catagory'];\n\t\t\t$admin = false;\n\t\t\tif ($type == 'system') { $admin = true; }\n\t\t\t$type_array[$type][$r['name']] = array('name'=>$r['name'],'level'=>$r['level'],'description'=>$r['description'],'value'=>$r['value']);\n\t\t\tksort($type_array[$type]); \n\t\t\t$results[$type] = array ('title'=>ucwords($type),'admin'=>$admin,'prefs'=>$type_array[$type]);\n\t\t} // end while\n\t\t\n\t\treturn $results;\n\t\n\t}", "public static function getAllFavorites(){\n $currentUser = self::getActiveUserWithoutCookie();\n $idAcc = $currentUser->getIdAccount();\n return $tempFavorites = Favorite::getAllFavorites($idAcc);\n }", "function display_favorite_properties() {\n\n\t\t$design = sanitize_text_field( $_POST['design_variation'] );\n\t\t$property_ids = $_POST['prop_ids'];\n\n\t\tif ( ! empty( $design ) && is_array( $_POST['prop_ids'] ) ) {\n\n\t\t\t$count = count( $property_ids );\n\n\t\t\t// My properties arguments.\n\t\t\t$favorites_properties_args = array(\n\t\t\t\t'post_type' => 'property',\n\t\t\t\t'posts_per_page' => $count,\n\t\t\t\t'post__in' => $property_ids,\n\t\t\t\t'orderby' => 'post__in',\n\t\t\t);\n\n\t\t\t$favorites_query = new WP_Query( $favorites_properties_args );\n\n\t\t\tif ( $favorites_query->have_posts() ) {\n\n\t\t\t\tif ( 'dashboard' === $design ) :\n\t\t\t\t\tglobal $dashboard_globals;\n\t\t\t\t\t$dashboard_globals['current_module'] = 'favorites';\n\t\t\t\t\t?>\n <div class=\"dashboard-posts-list\">\n\t\t\t\t\t<?php get_template_part( 'common/dashboard/property-columns' ); ?>\n <div class=\"dashboard-posts-list-body\">\n\t\t\t\t<?php\n\t\t\t\tendif;\n\n\t\t\t\twhile ( $favorites_query->have_posts() ) :\n\t\t\t\t\t$favorites_query->the_post();\n\t\t\t\t\tif ( 'dashboard' === $design ) {\n\t\t\t\t\t\tget_template_part( 'common/dashboard/property-card' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tget_template_part( 'assets/' . $design . '/partials/properties/favorite-card' );\n\t\t\t\t\t}\n\t\t\t\tendwhile;\n\t\t\t\twp_reset_postdata();\n\n\t\t\t\tif ( 'dashboard' === $design ) :\n\t\t\t\t\t?>\n </div>\n </div>\n\t\t\t\t<?php\n\t\t\t\tendif;\n\n\t\t\t} else {\n\t\t\t\tif ( 'modern' === $_POST['design_variation'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"rh_alert-wrapper\">\n\t\t\t\t\t\t<h4 class=\"no-results\"><?php esc_html_e( 'No property found!', 'framework' ); ?></h4>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t} elseif ( 'classic' === $_POST['design_variation'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"alert-wrapper\">\n\t\t\t\t\t\t<h4><?php esc_html_e( 'No property found!', 'framework' ); ?></h4>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdie;\n\t}", "public function recommendations( $num = 10 )\n {\n if( $num == 0 ) return array();\n\n // Append special chars to query string for variable\n // length inputs=\n $var_list = \":0\";\n for( $i = 1; $i < $this->size(); $i++ )\n $var_list .= \", :\" . $i;\n try\n {\n // Prepare the necessary queries\n $clicks = Database::prepare( str_replace( \"%list\", $var_list, self::$SQL_REC ) );\n\n // Execute the query\n for( $i = 0; $i < $this->size(); $i++ )\n $clicks->bindValue( \":\" . $i, $this->data[\"users\"][$i], PDO::PARAM_STR );\n $today = date( \"Y-m-d 00:00:00\" );\n $clicks->bindValue( \":today\", $today, PDO::PARAM_STR );\n $clicks->execute();\n\n // Find all the articles associated with the recommended\n // urls\n $clicks = $clicks->fetchAll( PDO::FETCH_ASSOC );\n foreach( $clicks as $info )\n $recommendations[] = Article::find( $info[\"url\"] );\n if( empty( $clicks ) )\n $recommendations = array();\n\n // If there are less than $num recommended urls, fill the\n // remainder of the request with the newest articles\n $num_normal = $num - count( $clicks );\n $articles = Article::find_all( $num );\n for( $i = 0; $i < $num; $i++ )\n if( !in_array( $articles[$i], $recommendations ) )\n $recommendations[] = $articles[$i];\n return $recommendations;\n }\n catch( PDOException $e )\n {\n echo \"Error: \" . $e;\n return false;\n }\n }", "function showRecommendations() {\n // Define the return string variable\n $return_string = \"\";\n \n // Check if the session variable form submitted is set. If yes display the \n // results, otherwise display the form\n if ( isset( $_SESSION['recommendations_form_submitted'] )\n&& $_SESSION['recommendations_form_submitted'] === TRUE ) {\n \n // Initialize some variables;\n $compare = FALSE;\n $compare_results = array();\n $compare_app = \"\";\n $results = array();\n $header = array();\n $rows = array();\n \n // Get the recommender app session var\n $recommender_app = $_SESSION['recommender_app'];\n \n // Get the recommender_type_value session var\n $value = $_SESSION['recommender_type_value'];\n \n // Get the recommender app name\n $recommender_app_name = getRecommenderAppName($recommender_app);\n \n // Check if the user wants to compare two algorithms\n if ( isset($_SESSION['recsys_wb_compare_form_submitted']) \n&& $_SESSION['recsys_wb_compare_form_submitted'] === TRUE) {\n $compare = TRUE;\n }\n \n // Check which recommender type if is\n $type = 'score';\n if ( $_SESSION['recommender_type'] === 'top n' )\n $type = 'top_n';\n \n if ( preg_match(\"/^book/\", $recommender_app_name) ) {\n $results = getBookRecommendations(\n $type, \n user_id, \n $recommender_app, \n $value \n );\n $entity = 'Book';\n \n // Check if compare is set\n if ( $compare ) {\n $compare_app = $_SESSION['recsys_wb_compare_app_id'];\n $compare_results = getBookRecommendations(\n $type, \n user_id, \n $compare_app, \n $value \n );\n }\n } \n else {\n // Get movie recommendations\n $results = getMovieRecommendations(\n $type, \n user_id, \n $recommender_app, \n $value \n );\n $entity = 'Movie';\n \n // Check if compare is set\n if ( $compare ) {\n $compare_app = $_SESSION['recsys_wb_compare_app_id'];\n $compare_results = getMovieRecommendations(\n $type, \n user_id, \n $compare_app, \n $value \n );\n }\n } \n \n if ( sizeof($results) == 0 )\n {\n unset( $_SESSION['recommendations_form_submitted'] );\n return \"You have no recommendations yet. Make sure you rate some movies \"\n . \" and/or books and come back later!\" . drupal_render( \n drupal_get_form('recsys_wb_reset_form') );\n }\n\n if ( $compare ) {\n // Prepare the table headers and rows\n $header = array(\n getRecommenderAppTitle($recommender_app),\n t('Score'),\n getRecommenderAppTitle($compare_app),\n t('Score'),\n );\n $rows = array();\n \n if ( sizeof($compare_results) > sizeof($results) )\n {\n $max = sizeof($compare_results);\n }\n else {\n $max = sizeof($results);\n }\n \n // Loop through all results and fill up the list\n for ($i=0; $i < $max; $i++) { \n $orig = array(\"-\",\"-\");\n $comp = array(\"-\",\"-\");\n \n if ( array_key_exists($i, $results) ) {\n $orig = $results[$i];\n $orig[0] = createEntityLinkByName($orig[0]);\n }\n \n if ( array_key_exists($i, $compare_results) ) {\n $comp = $compare_results[$i];\n $comp[0] = createEntityLinkByName($comp[0]);\n }\n \n $rows[] = array($orig[0],$orig[1],$comp[0],$comp[1]);\n }\n }\n else {\n // Prepare the table headers and rows\n $header = array( $entity, t('Score') );\n $rows = array();\n \n // Loop through the db query results and add each of them to the rows \n // array\n foreach ($results as $result ) {\n $result[0] = createEntityLinkByName($result[0]);\n $rows[] = $result;\n }\n }\n \n // Add some description\n if ( $type === 'score' ) {\n if ( ! $compare )\n {\n $return_string .= \"<h4>Recommendations based on prediction score >= \";\n $return_string .= $value . \" and algorithm \";\n $return_string .= getRecommenderAppTitle($recommender_app) . \"</h4>\";\n }\n else {\n $return_string .= \"<h4>Recommendations based on prediction score >= \";\n $return_string .= $value . \"<br/>\";\n $return_string .= getRecommenderAppTitle($recommender_app) . \" vs. \";\n $return_string .= getRecommenderAppTitle($compare_app) . \"</h4>\";\n }\n }\n else {\n if ( ! $compare )\n {\n $return_string .= \"<h4>Top \" . $value . \" recommendations based on \";\n $return_string .= getRecommenderAppTitle($recommender_app) . \"</h4>\";\n }\n else {\n $return_string .= \"<h4>Top \" . $value . \" recommendations<br/>\";\n $return_string .= getRecommenderAppTitle($recommender_app) . \" vs. \";\n $return_string .= getRecommenderAppTitle($compare_app) . \"</h4>\";\n }\n } \n \n // Assign the renderable array to the return string \n $return_string .= theme(\n 'table', \n array( 'header' => $header, 'rows' => $rows ) \n );\n \n // Add the compare_to form\n if ( ! $compare ) {\n $return_string .= drupal_render( \n drupal_get_form('recsys_wb_compare_form') \n );\n $return_string .= \"<br/><strong>OR</strong><br/>\";\n }\n \n // Add the reset form\n $return_string .= \"<br/>\" . drupal_render( \n drupal_get_form('recsys_wb_reset_form') \n );\n } \n else{\n $return_string .= drupal_render( \n drupal_get_form('recsys_wb_get_recommendations_form')\n );\n }\n\n return $return_string;\n}", "public function test_get_favourites_info_for_user() {\n list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();\n\n // Favourite 2 courses for user1 and 1 course for user2.\n $ufservice1 = \\core_favourites\\service_factory::get_service_for_user_context($user1context);\n $ufservice2 = \\core_favourites\\service_factory::get_service_for_user_context($user2context);\n $coursefavourite1 = $ufservice1->create_favourite('core_course', 'courses',\n $course1context->instanceid, $course1context);\n $this->waitForSecond();\n $coursefavourite2 = $ufservice1->create_favourite('core_course', 'courses',\n $course2context->instanceid, $course2context);\n $this->waitForSecond();\n $coursefavourite3 = $ufservice2->create_favourite('core_course', 'courses',\n $course2context->instanceid, $course2context);\n $this->assertCount(2, $ufservice1->find_favourites_by_type('core_course', 'courses'));\n $this->assertCount(1, $ufservice2->find_favourites_by_type('core_course', 'courses'));\n\n // Get the favourites info for user1 in the course1 context.\n $favouriteinfo1 = (object) provider::get_favourites_info_for_user($user1->id, $course1context,\n 'core_course', 'courses', $course1context->instanceid);\n // Ensure the correct data has been returned.\n $this->assertEquals(transform::yesno(true), $favouriteinfo1->starred);\n $this->assertEquals('', $favouriteinfo1->ordering);\n $this->assertEquals(transform::datetime($coursefavourite1->timecreated), $favouriteinfo1->timecreated);\n $this->assertEquals(transform::datetime($coursefavourite1->timemodified), $favouriteinfo1->timemodified);\n\n // Get the favourites info for user1 in the course2 context.\n $favouriteinfo2 = (object) provider::get_favourites_info_for_user($user1->id, $course2context,\n 'core_course', 'courses', $course2context->instanceid);\n // Ensure the correct data has been returned.\n $this->assertEquals(transform::yesno(true), $favouriteinfo2->starred);\n $this->assertEquals('', $favouriteinfo2->ordering);\n $this->assertEquals(transform::datetime($coursefavourite2->timecreated), $favouriteinfo2->timecreated);\n $this->assertEquals(transform::datetime($coursefavourite2->timemodified), $favouriteinfo2->timemodified);\n\n // Get the favourites info for user2 in the course2 context.\n $favouriteinfo3 = (object) provider::get_favourites_info_for_user($user2->id, $course2context,\n 'core_course', 'courses', $course2context->instanceid);\n // Ensure the correct data has been returned.\n $this->assertEquals(transform::yesno(true), $favouriteinfo3->starred);\n $this->assertEquals('', $favouriteinfo3->ordering);\n $this->assertEquals(transform::datetime($coursefavourite3->timecreated), $favouriteinfo3->timecreated);\n $this->assertEquals(transform::datetime($coursefavourite3->timemodified), $favouriteinfo3->timemodified);\n\n // Get the favourites info for user2 in the course1 context (user2 has not favourited course1).\n $favouriteinfo4 = provider::get_favourites_info_for_user($user2->id, $course1context,\n 'core_course', 'courses', $course1context->instanceid);\n // Ensure that data has not been returned.\n $this->assertEmpty($favouriteinfo4);\n }", "public function getProviders( $type = null, $ref = ['media', 'price', 'text'] );", "public function returnUserFavorites() {\n\n $results = array();\n $user = My_Plugin_User::ReturnUser();\n $db = Zend_Registry::get('db');\n\n // Return a list of applications that the user has fav shortcuts for\n\n $select = new Zend_Db_Select($db);\n $select->from(array('scf' => 'shortcuts_favorites'),array());\n $select->join(array('sc' => 'shortcuts'),'scf.shortcut_id = sc.id',array());\n $select->join(array('ap' => 'applications'),'sc.application_id = ap.id',array('name','id'));\n $select->where('user_id = ?', $user->getId());\n $select->group('ap.name');\n $select->order('name');\n\n $applications = $db->fetchAssoc($select);\n\n $select = null;\n\n // Loop through the applications\n foreach ($applications as $application) {\n\n // Handle the name\n $per_application['name'] = $application['name'];\n $per_application['id'] = $application['id'];\n\n // Generate a list of shortcuts for this app that the user has faved.\n $select = new Zend_Db_Select($db);\n $select->from(array('scf' => 'shortcuts_favorites'),array());\n $select->join(array('sc' => 'shortcuts'),'scf.shortcut_id = sc.id');\n $select->join(array('ap' => 'applications'),'sc.application_id = ap.id',array('name'));\n $select->where('user_id = ?', $user->getId());\n $select->where('ap.id = ?', $application['id']);\n $per_application['shortcuts'] = $favorites = $db->fetchAssoc($select);\n \n array_push($results,$per_application);\n }\n\n return $results;\n }", "public function getAll($mgr, $type){\n switch ($type){\n case \"boeken\":\n $lijst = BoekService::getBoekenOverzicht($mgr);\n break;\n case \"films\":\n $lijst = FilmService::getFilmOverzicht($mgr);\n break;\n default :\n $lijst = ProductDao::getAll($mgr); \n break;\n }\n return $lijst;\n }", "public function getRecommendations($id)\n {\n $artist = $this->artist->findOrFail($id);\n\n $this->authorize('show', $artist);\n\n return Cache::remember(\"radio.artist.{$artist->id}\", Carbon::now()->addDays(2), function() use($artist) {\n return [\n 'type' => 'artist',\n 'seed' => $artist,\n 'recommendations' => $this->resolver->get('radio')->getRecommendations($artist, 'artist'),\n ];\n });\n }", "function listFeatures( $data, $type = 'service', $params = null ) {\r\n\t\t$features = array();\r\n\r\n\t\tforeach( $data as $row) {\r\n\t\t\t$link = $this->Html->link( trim($row['name']), '/searches/' . $type .':'. $row['slug'] );\r\n\t\t\t$features[] = $link;\r\n\t\t}\r\n\t\t\r\n\t\treturn ( $this->Text->toList($features, ',') ); \r\n\t\t\r\n\t}", "public function listFavorites()\n {\n $cacheKey = 'winter-twitter-favorites';\n $cached = Cache::get($cacheKey, false);\n if ($cached && ($unserialized = @unserialize($cached)) !== false)\n {\n return $unserialized;\n }\n\n $obj = static::instance();\n\n $userData = $obj->getUserData();\n\n $code = $obj->client->user_request(array(\n 'url' => $obj->client->url('1.1/favorites/list'),\n 'params' => array(\n 'include_entities' => true,\n 'count' => 200,\n 'screen_name' => $userData['screen_name']\n )\n ));\n\n if ($code <> 200)\n {\n throw new ApplicationException('Error requesting Twitter API: '.$obj->client->response['error']);\n }\n\n $result = json_decode($obj->client->response['response'], true);\n foreach ($result as &$message) {\n $text = $message['text'];\n $text = preg_replace('/\\@\\w+/', '<span class=\"name\">$0</span>', $text);\n $text = preg_replace('/\\#\\w+/', '<span class=\"tag\">$0</span>', $text);\n $message['text_processed'] = $obj->urlsToLinks($text);\n }\n\n Cache::put($cacheKey, serialize($result), 2);\n return $result;\n }", "function favorites($id = false, $params = array()) {\n $url = \"http://twitter.com/favorites\";\n if($id != false) {\n $url .= \"/{$id}.xml\";\n } else {\n $url .= \".xml\";\n }\n \n return $this->__process($this->Http->get($url, $params, $this->__getAuthHeader()));\n }", "public function index($type = null)\n {\n if(permissions('categories_type_view') == 0){\n //set session message\n Session::flash('message', __('strings.do_not_have_permission'));\n return view('permissions');\n }\n if(request()->is('admin/categories_type')){\n $types = CategoriesType::where(['type' => 2 ,'org_id' => Auth::user()->org_id])->paginate(20);\n }\n if(request()->is('admin/categories_type/offers')){\n $ids = [];\n $list = CategoriesType::join('categories', function ($join) {\n $join->on('categories_type.id', '=', 'categories.category_type_id')\n ->where([ 'categories_type.type' => 2, 'categories_type.org_id' => Auth::user()->org_id]);\n })->get();\n\n foreach ($list as $value){\n $ids[] = $value->id;\n }\n $types = Offers::whereIn('cat_id', $ids)->paginate(20);\n\n }\n if(request()->is('admin/categories_type/items')){\n $types = CategoriesType::where(['type' => 1 ,'org_id' => Auth::user()->org_id])->paginate(20);\n }\n if(request()->is('admin/categories_type/items/offers')){\n $ids = [];\n $list = CategoriesType::join('categories', function ($join) {\n $join->on('categories_type.id', '=', 'categories.category_type_id')\n ->where([ 'categories_type.type' => 1, 'categories_type.org_id' => Auth::user()->org_id]);\n })->get();\n\n foreach ($list as $value){\n $ids[] = $value->id;\n }\n $types = Offers::whereIn('cat_id', $ids)->paginate(20);\n }\n \n if(request()->is('admin/categories_type/suggestion')){\n $types = Category::where(['grouped' => 2, 'org_id' => Auth::user()->org_id])->paginate(20);\n }\n\n if(request()->is('admin/categories_type/suggest_product')){\n $list = CategoriesType::join('categories', function ($join) {\n $join->on('categories_type.id', '=', 'categories.category_type_id')\n ->where([ 'categories_type.type' => 1, 'categories_type.org_id' => Auth::user()->org_id, 'categories.grouped' => null]);\n })->get();\n return view('categories_type.index', compact( 'types', 'type', 'list'));\n }\n return view('categories_type.index', compact( 'types', 'type'));\n }", "public function whoVoted($id, $type = 'both', $limit = 10) {\n $who_voted = array('like' => array(), 'dislike' => array());\n \n $limit = !empty($limit) ? \" LIMIT \" . $limit : '';\n $query = array();\n if($type == 'like' || $type == 'both') {\n $query[] = \"SELECT * FROM (SELECT v.type, u.username FROM \".$this->table.\" v JOIN user_profile u USING (user_id) WHERE v.type = 'like' AND \" . $this->fk_field. \" = {$id} ORDER BY v.created DESC {$limit}) AS t1\";\n }\n if($type == 'dislike' || $type == 'both') {\n $query[] = \"SELECT * FROM (SELECT v.type, u.username FROM \".$this->table.\" v JOIN user_profile u USING (user_id) WHERE v.type = 'dislike' AND \" . $this->fk_field. \" = {$id} ORDER BY v.created DESC {$limit}) AS t2\";\n }\n $voted = $this->db->query(implode(\" UNION \", $query));\n \n if($voted !== FALSE) {\n foreach($voted->result_array() as $row) {\n $who_voted[$row['type']][] = $row['username'];\n }\n }\n \n return $who_voted;\n }", "function get_global_popular($type) {\n\n\t$stats = new Stats();\n\t$count = Config::get('popular_threshold');\n $web_path = Config::get('web_path');\n\n\t/* Pull the top */\n\t$results = $stats->get_top($count,$type);\n\n\tforeach ($results as $r) { \n\t\t/* If Songs */\n if ( $type == 'song' ) {\n $song = new Song($r['object_id']);\n\t\t\t$song->format();\n $text = \"$song->f_artist_full - $song->title\";\n /* Add to array */\n $song->link = \"<a href=\\\"$web_path/stream.php?action=single_song&amp;song_id=$song->id\\\" title=\\\"\". scrub_out($text) .\"\\\">\" .\n\t \tscrub_out(truncate_with_ellipsis($text, Config::get('ellipse_threshold_title')+3)) . \"&nbsp;(\" . $r['count'] . \")</a>\";\n\t\t\t$items[] = $song;\n } // if it's a song\n \n\t\t/* If Artist */\n elseif ( $type == 'artist' ) {\n $artist = new Artist($r['object_id']);\n\t\t\t$artist->format();\n $artist->link = \"<a href=\\\"$web_path/artists.php?action=show&amp;artist=\" . $r['object_id'] . \"\\\" title=\\\"\". scrub_out($artist->full_name) .\"\\\">\" .\n \t truncate_with_ellipsis($artist->full_name, Config::get('ellipse_threshold_artist')+3) . \"&nbsp;(\" . $r['count'] . \")</a>\";\n\t\t\t$items[] = $artist;\n } // if type isn't artist\n\n\t\t/* If Album */\n elseif ( $type == 'album' ) {\n $album = new Album($r['object_id']);\n\t\t\t$album->format(); \n $album->link = \"<a href=\\\"$web_path/albums.php?action=show&amp;album=\" . $r['object_id'] . \"\\\" title=\\\"\". scrub_out($album->name) .\"\\\">\" . \n \t scrub_out(truncate_with_ellipsis($album->name,Config::get('ellipse_threshold_album')+3)) . \"&nbsp;(\" . $r['count'] . \")</a>\";\n\t\t\t$items[] = $album;\n } // else not album\n\n\t\telseif ($type == 'genre') { \n\t\t\t$genre \t = new Genre($r['object_id']);\n\t\t\t$genre->format(); \n\t\t\t$genre->link = \"<a href=\\\"$web_path/browse.php?action=genre&amp;genre=\" . $r['object_id'] . \"\\\" title=\\\"\" . scrub_out($genre->name) . \"\\\">\" .\n\t\t\t\t\tscrub_out(truncate_with_ellipsis($genre->name,Config::get('ellipse_threshold_title')+3)) . \"&nbsp;(\" . $r['count'] . \")</a>\";\n\t\t\t$items[] = $genre;\n\t\t} // end if genre\n } // end foreach\n \n return $items;\n\n}", "function displayRecommendation($recommendation) {\n\t\t$markers = array();\n\t\t$markers['recommendation'] = $this->util->getOutputFromCObj($recommendation->toArray(), $this->conf['recommendations.'], 'recommendation');\n\t\t\n\t\t$content = $this->util->getTemplateSubpart('recommendations');\n\t\t$this->util->substituteMarkers($content, $markers);\n\t\t\n\t\treturn $content;\n\t}", "public function getFavoritos()\n {\n return $this->hasMany(Favoritos::className(), ['pt_idPontoTuristico' => 'id_pontoTuristico']);\n }", "public function test_delete_favourites_for_userlist() {\n list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();\n\n // Favourite 2 courses for user1 and 1 course for user2.\n $systemcontext = context_system::instance();\n $ufservice1 = \\core_favourites\\service_factory::get_service_for_user_context($user1context);\n $ufservice2 = \\core_favourites\\service_factory::get_service_for_user_context($user2context);\n $ufservice1->create_favourite('core_course', 'courses', $course1context->instanceid, $systemcontext);\n $ufservice1->create_favourite('core_course', 'courses', $course2context->instanceid, $user1context);\n $ufservice2->create_favourite('core_course', 'courses', $course2context->instanceid, $systemcontext);\n $this->assertCount(2, $ufservice1->find_favourites_by_type('core_course', 'courses'));\n $this->assertCount(1, $ufservice2->find_favourites_by_type('core_course', 'courses'));\n\n // Ask the favourites privacy api to export userids for favourites of the type we just created, in the system context.\n $userlist1 = new \\core_privacy\\local\\request\\userlist($systemcontext, 'core_course');\n provider::add_userids_for_context($userlist1, 'courses');\n // Verify we have two userids in the list for system context.\n $this->assertCount(2, $userlist1->get_userids());\n\n // Ask the favourites privacy api to export userids for favourites of the type we just created, in the user1 context.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($user1context, 'core_course');\n provider::add_userids_for_context($userlist2, 'courses');\n // Verify we have one userid in the list for user1 context.\n $this->assertCount(1, $userlist2->get_userids());\n\n // Now, delete the favourites for user1 only in the system context.\n $approveduserlist = new \\core_privacy\\local\\request\\approved_userlist($systemcontext, 'core_course',\n [$user1->id]);\n provider::delete_favourites_for_userlist($approveduserlist, 'courses');\n // Ensure user1's data was deleted and user2 is still returned for system context.\n $userlist1 = new \\core_privacy\\local\\request\\userlist($systemcontext, 'core_course');\n provider::add_userids_for_context($userlist1, 'courses');\n $this->assertCount(1, $userlist1->get_userids());\n // Verify that user2 is still in the list for system context.\n $expected = [$user2->id];\n $this->assertEquals($expected, $userlist1->get_userids());\n // Verify that the data of user1 was not deleted in the user1context.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($user1context, 'core_course');\n provider::add_userids_for_context($userlist2, 'courses');\n $expected = [$user1->id];\n $this->assertEquals($expected, $userlist2->get_userids());\n\n // Now, delete the favourites for user2 only in the user1 context.\n // Make sure favourites are only being deleted in the right context.\n $approveduserlist = new \\core_privacy\\local\\request\\approved_userlist($user1context, 'core_course',\n [$user2->id]);\n provider::delete_favourites_for_userlist($approveduserlist, 'courses');\n // Verify we have one userid in the list for system context.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($systemcontext, 'core_course');\n provider::add_userids_for_context($userlist2, 'courses');\n $this->assertCount(1, $userlist2->get_userids());\n // Verify that user2 is still in the list for system context.\n $expected = [$user2->id];\n $this->assertEquals($expected, $userlist2->get_userids());\n\n // Verify that user1 is still present in the list for user1 context.\n $userlist3 = new \\core_privacy\\local\\request\\userlist($user1context, 'core_course');\n provider::add_userids_for_context($userlist3, 'courses');\n $this->assertCount(1, $userlist3->get_userids());\n // Verify that user1 is still in the list for user1 context.\n $expected = [$user1->id];\n $this->assertEquals($expected, $userlist3->get_userids());\n }", "public function show(Recommendation $recommendation)\n {\n return Response::Json(['status' => true, 'result' => $recommendation]);\n }", "public static function MyFavoriteList($user_id){\n\t\t\n\t\tself::init_database();\n\t\t$connection = self::$database->GetConnection();\n\t\t$query = \"SELECT r.* FROM recipe r, fav_user_recipe fur WHERE r.recipe_id = fur.recipe_id AND fur.user_id = $user_id \"; \n\t\ttry{\n\t\t\t$stmt = $connection->prepare($query);\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $result;\n\t\t\t\n\t\t}catch(PDOException $e)\n\t\t{\n\t\t\techo \"Query Failed: \".$e->getMessage();\n\t\t}\n\t\t\n\t}", "public function getLikeDislikeIdeaByUser($user_id,$idea_id,$user_type)\r\n\t{\r\n\t\t$query = $this->db_con->query(\"SELECT Status FROM likes_dislike WHERE User_Id = '\".$user_id.\"' AND Idea_Id = '\".$idea_id.\"' AND User_Type = '\".$user_type.\"'\");\r\n \t\t$result = $query->fetch_array();\r\n \t\treturn $result;\r\n\t}", "public function get_restaurant_reviews($restId, $start, $n, &$reviews)\n\t{\n\t\tinclude($_SERVER['DOCUMENT_ROOT'].'/hp/DB.php');\n\t\t//open database connection\n\t\t$connection = mysql_connect($host, $user, $pass) or die('could not connect');\n\t\t//select database\n\t\tmysql_select_db($dbName) or die('could not select database');\n\t\t//create query\n\t\t$query=\"SELECT reviews.id, reviews.created, reviews.restaurant_id, reviews.title, reviews.rating, reviews.comment,\n\t\t\t\tusers.id, users.username, users.email, users.firstname, users.lastname, users.privilege\n\t\t\t\tFROM reviews, users\n\t\t\t\tWHERE reviews.user_id = users.id\n\t\t\t\tAND restaurant_id=$restId\n\t\t\t\tAND reviews.title != 'NONE'\n\t\t\t\tORDER BY reviews.created desc\n\t\t\t\tLIMIT $start, $n\"; \n\t\t//execute query\n\t\t$result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error());\n\t\t//create response object\n\t\t$response = new ResponseObject();\n\t\tif(mysql_num_rows($result)>0)\n\t\t{\n\t\t\t$response->code = mysql_num_rows($result); \n\t\t\t$response->explanation = 'restaurants found!';\n\t\t\t$count=0;\n\t\t\twhile($row = mysql_fetch_assoc($result))\n\t\t\t{\n\t\t\t\t$reviews[$count]=$row; \n\t\t\t\t$count++; \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response->code = 0; \n\t\t\t$response->explanation = 'No Reviews';\n\t\t}\n\t\t\n\t\tmysql_free_result($result);\n\t\tmysql_close($connection);\n\t\treturn $response;\n\t}", "public function index()\n {\n $reviews = Review::select(\"reviews.*\")->get();\n $users = [];\n foreach($reviews as $review) {\n if($review->likes > $review->dislikes){\n $users[] = $review->user_id;\n }\n }\n $reviews = Review::select(\"reviews.*\")->get();\n $products = Product::all();\n $follows = Follow::where('follows.follower_id', Auth::id())->get();\n $map = [];\n if(count($users) > 0) {\n foreach (range(0, count($users) - 1) as $user) {\n $map[$user] = User::select(\"users.*\")->where(\"id\", \"=\", $users[$user])->get()[0]; \n }\n }\n $follows = Follow::where('follows.follower_id', Auth::id())->get();\n \n return view('recommendations.recommendations')->with('users', $map)->with('follows', $follows);\n }", "public function getRecommendedClasses($qualification_id) {\r\n $tableObj = new TrainingRecommend();\r\n\r\n $select = $tableObj->select()\r\n ->from(array('tr' => 'training_recommend'), array())\r\n ->from( '', \"GROUP_CONCAT(tto.training_topic_phrase ORDER BY training_topic_phrase SEPARATOR ', ') AS topics\")\r\n ->setIntegrityCheck(false)\r\n ->join(array('ttt' => 'training_to_training_topic_option'), \"ttt.training_topic_option_id = tr.training_topic_option_id\",array())\r\n ->join(array('t' => 'training'), \" t.id = ttt.training_id\",array('training_id' => 'id', 'training_start_date','training_title_option_id'))\r\n // ->join(array('c' => 'course'), \"t.training_title_option_id = c.id\",'training_title_option_id')\r\n ->join(array('tt' => 'training_title_option'), \"tt.id = t.training_title_option_id\",array('training_title' => 'training_title_phrase'))\r\n\r\n ->join(array('tto' => 'training_topic_option'), \"tto.id = ttt.training_topic_option_id\",array())\r\n \t ->join(array('tc' => 'training_location'), 't.training_location_id = tc.id', 'training_location_name')\r\n\r\n ->where(\"tr.person_qualification_option_id = $qualification_id AND t.is_deleted = 0 AND training_start_date > NOW()\")\r\n ->group(\"t.id\")\r\n ->group(\"tr.person_qualification_option_id\")\r\n ->order(\"training_start_date\")\r\n ;\r\n\r\n return $tableObj->fetchAll($select)->ToArray();\r\n }", "function getReviews(){\r\n\t\t$reviewsTable = $this->getTable(\"Review\");\r\n\t\t$reviews = $reviewsTable->getReviews($this->offerId, $this->appSettings->show_pending_review,REVIEW_TYPE_OFFER);\r\n\r\n\t\tif(!empty($reviews)){\r\n\t\t\tforeach($reviews as $review){\r\n\t\t\t\t$review->responses = $reviewsTable->getCompanyReviewResponse($review->id);\r\n\t\t\t\tif(isset($review->scores)){\r\n\t\t\t\t\t$review->scores = explode(\",\",$review->scores);\r\n\t\t\t\t}\r\n\t\t\t\tif(isset($review->answer_ids)){\r\n\t\t\t\t\t$review->answerIds = explode(\",\", $review->answer_ids);\r\n\t\t\t\t}\r\n\t\t\t\t$review->pictures = $reviewsTable->getReviewPictures($review->id);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $reviews;\r\n\t}", "public function getAllWithType($type);", "public static function getKlassen($type = null)\n {\n $query = Rooster::filterOnzin('klas')->orderBy('klas')->get(array('klas'))->toArray();\n\n // Alleen 'enkelvoudige' klassen mogen in de lijst voorkomen, niet meerdere klassen.\n // TODO: Gadverdamme. Dit kan beter.\n\n $klassen = [];\n\n foreach ($query as $klasColumn) {\n foreach (Bereken::klassenNaarArray($klasColumn['klas']) as $klas)\n $klassen[] = $klas;\n }\n\n $klassen = array_unique($klassen);\n\n if ($type === 'random')\n shuffle($klassen);\n\n return $klassen;\n }", "public function query(Favorite $model)\n {\n\n if (auth()->user()->hasRole('admin')) {\n return $model->newQuery()->with(\"product\")->with(\"user\")->select(\"favorites.*\");\n } else {\n return $model->newQuery()->with(\"product\")->with(\"user\")\n ->join(\"products\",\"products.id\",\"=\",\"favorites.product_id\")\n ->join(\"user_markets\", \"user_markets.market_id\", \"=\", \"products.market_id\")\n ->where('user_markets.user_id', auth()->id())\n ->select(\"favorites.*\");\n }\n }", "public function getPreference($type);", "public static function get_item_reviewed( $items = array(), $type = '' ) {\n\t\t$schema = array();\n\t\tif ( false !== $items && ! empty( $items ) && '' !== $type ) {\n\t\t\tarray_unique( $items );\n\t\t\tforeach ( $items as $item ) {\n\t\t\t\t$title = get_the_title( $item );\n\t\t\t\tif ( '' !== $title ) {\n\t\t\t\t\t$item_schema = array(\n\t\t\t\t\t\t'@type' => $type,\n\t\t\t\t\t\t'name' => $title,\n\t\t\t\t\t);\n\t\t\t\t\t$schema[] = $item_schema;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $schema;\n\t}", "public function getterms($type='movie'){\n\t\t$get_data_sql=\"SELECT * FROM movie_terms ORDER BY RAND() LIMIT 30\";\n\t\t\t //s echo $get_data_sql.'<br />';\n\t\t\t$data=$this->CI->db->query($get_data_sql)->result_array();\n\t\t\treturn $data;\n\t}", "public function getTypeFlower($type)\n {\n $flowers = Flower::where('type','like',$type)->get();\n return $flowers->toJson(JSON_PRETTY_PRINT);\n }", "static public function getAllowedExtras($type) {\r\n\r\n $type = intval($type);\r\n\r\n $extras = array();\r\n foreach(self::getRegisteredExtras() as $extra) {\r\n\r\n // read user tsconfig configuration for current extra\r\n $perm = $GLOBALS['BE_USER']->getTSConfigVal('newspaper.be.hideExtra.' . $extra->getTable());\r\n\r\n if ($perm == self::HIDE_NOWHERE || (($type != self::HIDE_EVERYWHERE) && !($type & $perm))) {\r\n // add to array (either HIDE_NOWHERE is configured or the given $type matches the $perm bitmask)\r\n $extras[] = $extra;\r\n }\r\n//if($perm) t3lib_div::debug(array('table' => $extra->getTable(), 'type' => $type, 'perm' => $perm, 'bitmask check' => ($type & $perm)));\r\n }\r\n return $extras;\r\n }", "public function recommendedAction() {\n $productId = $this->_request->id;\n $this->view->pageTitle = 'Recommended Apps';\n $deviceSession = new Zend_Session_Namespace('Device');\n $deviceId = $deviceSession->deviceId;\n $recommendationsObj = new Nexva_Recommendation_Recommendation($this->themeMeta->WHITELABLE_APP_FILTER);\n //first param is the id, second is the build and the third is the # of recommendations to return.\n $products = $recommendationsObj->getRecommendationsForProduct($productId, $deviceId, 10);\n $this->view->products = $this->enablePagenator($products);\n $controllerName = $this->getRequest()->getControllerName();\n $actionName = $this->getRequest()->getActionName();\n $this->view->baseUrlfo = $_SERVER ['SERVER_NAME'] . '/' . $controllerName . '/' . $actionName . '/id/' . $productId;\n }", "public function getRecommendations()\n {\n return array_filter($this->requirements, function ($req) {\n return $req->isOptional();\n });\n }", "function getComparedProducts($id,$type)\r\n\t{\r\n\t\tglobal $wpdb;\r\n\t\t\r\n\t\tif($type == HOTELS) {\r\n\t\t\t\r\n\t\t\treturn $wpdb->get_results( \r\n\t\t\t\t\t\"\r\n\t\t\t\t\tSELECT * \r\n\t\t\t\t\tFROM \".$wpdb->prefix.\"alfieliate_products\r\n\t\t\t\t\tWHERE visible='1'\r\n\t\t\t\t\tAND product_name LIKE '%\".$id.\"%'\r\n\t\t\t\t\tGROUP BY feed_id\r\n\t\t\t\t\tORDER BY price ASC\r\n\t\t\t\t\t\");\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn $wpdb->get_results( \r\n\t\t\t\t\t\"SELECT * \r\n\t\t\t\t\tFROM \".$wpdb->prefix.\"alfieliate_products\r\n\t\t\t\t\tWHERE visible='1'\r\n\t\t\t\t\tAND ean = '\".$id.\"'\r\n\t\t\t\t\tGROUP BY `feed_id`\r\n\t\t\t\t\tORDER BY price ASC\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function actionRecommendSecond()\n {\n $code = 1000;\n\n $supplierId = (int)Yii::$app->request->get('supplier_id', 0);\n// $districtCode = (int)Yii::$app->request->get('district_code', Yii::$app->params['district_default']);\n if (!$supplierId) {\n return Json::encode([\n 'code' => $code,\n 'msg' => Yii::$app->params['errorCodes'][$code],\n ]);\n }\n\n $page = (int)Yii::$app->request->get('page', 1);\n $size = (int)Yii::$app->request->get('size', ModelService::PAGE_SIZE_DEFAULT);\n $where = [\n 'type' => GoodsRecommendSupplier::RECOMMEND_GOODS_TYPE_SECOND,\n// 'status' => GoodsRecommendSupplier::STATUS_ONLINE,\n 'delete_time' => 0,\n 'supplier_id' => $supplierId,\n// 'district_code' => $districtCode,\n ];\n\n return Json::encode([\n 'code' => 200,\n 'msg' => 'OK',\n 'data' => [\n 'total' => GoodsRecommendSupplier::find()->where($where)->asArray()->count(),\n 'recommend_second' => GoodsRecommendSupplier::pagination($where, GoodsRecommendSupplier::$appFields, $page, $size, ['sorting_number' => SORT_ASC]),\n ],\n ]);\n }", "public function favorites()\n {\n return $this->hasMany(Favorite::class);\n }", "public function getSuggesters();", "private function getSuggestion($type)\n {\n switch ($type) {\n case 'file':\n return 'assets';\n case 'markitup':\n return 'markdown';\n }\n }", "public function actionIndex()\n {\n $params = Yii::$app->request->queryParams;\n\n $params['res'] = isset($params['res']) ? $params['res'] : 'goods';\n\n $params['FavorSearch']['res_name'] = $params['res'];\n $params['FavorSearch']['user_id'] = Yii::$app->user->id;\n\n $searchModel = new FavorSearch();\n $dataProvider = $searchModel->search($params);\n\n return $this->render('index', [\n 'res' => Favor::res(),\n 'params' => $params,\n 'dataProvider' => $dataProvider\n ]);\n }", "public function getOfficeFromAgencyName($recommendations)\n {\n $offices = $this->getOffices();\n\n $out = array();\n foreach($recommendations as $recommendation) {\n $aliases = $this->getAgencyAliases($recommendation->agencyName);\n foreach($offices as $office) {\n if(array_search($office->name, $aliases) !== FALSE) {\n $recommendation->office_id = $office->id;\n $recommendation->url = preg_replace(\"/\\/$/\", \"\", $office->url);\n $recommendation->path_to_json = $this->getPathToJSON($office->id);\n if(!isset($recommendation->status)) {\n $recommendation->status = 'Open'; // default\n }\n $out[] = $recommendation;\n break;\n }\n }\n if(!$recommendation->office_id) {\n $this->log(\"ERROR: No office_id found for '{$recommendation->agencyName}' in office table\");\n }\n }\n\n return $out;\n }", "public function getItems($type = null, $excludeItems = []);", "function get_user_favorites () {\n\t\t\n\t\t$query = \"\n\t\t\tSELECT \n\t\t\t\t UF.id\n\t\t\t\t, UF.search_text\n\t\t\tFROM public.user_favorites UF\n\t\t\tLEFT OUTER JOIN public.users U ON UF.user_id = U.id\n\t\t\tWHERE (1 = 1)\n\t\t\tAND (U.email ILIKE '\" . $_SESSION['Username'] . \"')\n\t\t\";\n\t\t\t\n\t\t$conn = get_postgresql_db_connection('v2v_auth');\n\t\t\n\t\t$result = pg_query($conn, $query) \n\t\t\tor die ('Error: ' + pg_last_error($conn) + '\\n');\n\n\t\t$user_favorites = array();\n\t\t\n\t\twhile ($row = pg_fetch_row($result)) {\n\t\t\t$user_favorites[] = array(\n\t\t\t\t 'Id' => $row[0]\n\t\t\t\t, 'SearchText' => $row[1]\n\t\t\t);\n\t\t}\n\t\t\n\t\tpg_close($conn);\n\t\t\n\t\techo json_encode($user_favorites);\n\t}", "public function myFavorites($key)\n {\n // $alphas = DB::table('recipes')\n // ->select(DB::raw('DISTINCT LEFT(title, 1) as letter'))\n // //->where('user_id','=',Auth::user()->id)\n // ->where('user_id','=',-1)\n // ->orderBy('letter')\n // ->get();\n // //dd($alphas);\n\n $letters = [];\n // foreach($alphas as $alpha) {\n // $letters[] = $alpha->letter;\n // }\n // //dd($letters);\n\n // find the favorites\n $favs = DB::table('recipe_user')\n ->where('user_id','=',Auth::user()->id)\n ->get();\n //$favs = Recipe::with('user','category')->where('recipe_user.user_id','=',Auth::user()->id)->get();\n //$recipes = Recipe::with('user','category')->where('user_id','=', Auth::user()->id)->orderBy('title', 'asc')->get();\n\n // // Create an empty array to store the recipes \n $recipes = [];\n\n // // Store the recipe values into the $recipes array\n foreach ($favs as $fav)\n {\n $recipes[$fav->id] = Recipe::find($fav->recipe_id);\n }\n \n // // Sort the recipes array by title\n $recipes = array_values(array_sort($recipes, function ($value) {\n return $value['title'];\n }));\n\n // return view('recipes.viewfavorites')->withRecipes($recipes);\n //return view('recipes.myFavorites', compact('recipes','letters'));\n //return view('recipes.index', compact('recipes','letters'));\n return view('recipes.index', compact('recipes','letters'));\n }", "function _getRecommendationsList($eventId) {\n\n // get Recommendations for this event\n $recommendations = $this->calendarObj->loadRecommendations($eventId);\n if (!$recommendations) {\n return '';\n }\n\n $list = sprintf(\n '<listview title=\"%s\">'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Recommendations'))\n );\n $list .= sprintf(\n '<cols><col>%s</col><col>%s</col></cols>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('By User')),\n papaya_strings::escapeHTMLChars($this->_gt('For Calendar'))\n );\n $list .= '<items>'.LF;\n\n foreach ($recommendations as $rec) {\n $list .= sprintf(\n '<listitem title=\"%s\">\n <subitem>%s</subitem>\n </listitem>',\n papaya_strings::escapeHTMLChars($rec['recommendator']),\n papaya_strings::escapeHTMLChars($rec['calendar_title'])\n );\n }\n\n $list .= '</items>'.LF;\n $list .= '</listview>'.LF;\n\n return $list;\n }", "public function get_merchants($type) {\n\t\t// car dealers - $type = 120\n\t\t$merchants = DB::table('merchants')\n\t\t\t->where('subcategory_id', '=', $type)\n\t\t\t->where('page_title', '!=', \"\")\n\t\t\t->get();\n\t\n\t\treturn $merchants;\t\n\t}", "public function getMyPublicationsType($type)\n\t{\n\t\t$id = Input::get('id');\n\t\tif (strtolower($type) == \"lider\") {\n\t\t\t$publications = Publicaciones::where('user_id','=',$id)\n\t\t\t->leftJoin('categoria','categoria.id','=','publicaciones.categoria')\n\t\t\t->leftJoin('departamento','departamento.id','=','publicaciones.departamento')\n\t\t\t->where('publicaciones.tipo','=',ucfirst(strtolower($type)))\n\t\t\t->where('publicaciones.deleted','=',0)\n\t\t\t->orderBy('publicaciones.id','DESC')\n\t\t\t->get(array('publicaciones.*','categoria.nombre as categoria','departamento.nombre as dep_desc'));\t\n\t\t}elseif (strtolower($type) == \"habitual\") {\n\t\t\t$publications = Publicaciones::join('categoria','categoria.id','=','publicaciones.categoria')\n\t\t\t->leftJoin('departamento','departamento.id','=','publicaciones.departamento')\n\t\t\t->where('user_id','=',$id)\n\t\t\t->where('publicaciones.tipo','=','Habitual')\n\t\t\t->where('publicaciones.deleted','=',0)\n\t\t\t->orderBy('publicaciones.id','DESC')\n\t\t\t->get(array('publicaciones.*','categoria.nombre as categoria','departamento.nombre as dep_desc'));\t\n\t\t}elseif(strtolower($type) == \"casual\")\n\t\t{\n\t\t\t$publications = Publicaciones::join('categoria','categoria.id','=','publicaciones.categoria')\n\t\t\t->leftJoin('departamento','departamento.id','=','publicaciones.departamento')\n\t\t\t->where('publicaciones.user_id','=',$id)\n\t\t\t->where('publicaciones.tipo','=','Casual')\n\t\t\t->where('publicaciones.deleted','=',0)\n\t\t\t->orderBy('publicaciones.id','DESC')\n\t\t\t->get(array(\n\t\t\t\t'publicaciones.*',\n\t\t\t\t'categoria.nombre as categoria'\n\t\t\t));\n\t\t\t$rePub = Publicaciones::where('publicaciones.user_id','=',$id)\n\t\t\t->where('publicaciones.tipo','=','Casual')\n\t\t\t->where('publicaciones.deleted','=',0)\n\t\t\t->orderBy('fechRepub','desc')\n\t\t\t->first(array('fechRepub'));\n\n\t\t}\n\t\tif (strtolower($type) == \"casual\") {\n\t\t\treturn Response::json(array(\n\t\t\t\t'publications' \t=> $publications,\n\t\t\t\t'type' \t\t\t=> strtolower($type),\n\t\t\t\t'rePub'\t \t\t=> $rePub,\n\t\t\t));\n\t\t}\n\t\treturn Response::json(array(\n\t\t\t'publications' => $publications,\n\t\t\t'type' \t\t\t=> strtolower($type),\n\t\t));\n\t}", "public static function getRecommendationsForUser($buyer_id, $seller_id = 0) {\n\n $results = Database::query('SELECT Auction.* FROM Auction WHERE Auction.id IN\n (SELECT Bid.auction_id FROM Bid WHERE Bid.userrole_id IN\n (SELECT Bid.userrole_id FROM Bid WHERE Bid.auction_id IN\n (SELECT Bid.auction_id FROM Bid WHERE Bid.userrole_id = ?)))\n AND Auction.end_date > now() AND NOT Auction.userrole_id = ?\n AND NOT EXISTS (SELECT * FROM Bid WHERE Bid.auction_id = Auction.id AND userrole_id = ?)',\n [$buyer_id, $seller_id, $buyer_id]);\n\n\n if(count($results) == 0) {\n /*\n if on the auctions the user bid he was the only bidder\n give suggestions from top categories he bought from\n\n */\n $results = Database::query('SELECT DISTINCT Auction.* FROM Auction JOIN Item ON Auction.id = Item.auction_id\n WHERE Item.id IN (SELECT DISTINCT(ItemCategory.item_id) FROM ItemCategory JOIN\n (SELECT ItemCategory.category_id, COUNT(ItemCategory.item_id) as no_items FROM ItemCategory JOIN\n (SELECT Item.id FROM Bid JOIN Item ON Bid.auction_id = Item.auction_id\n WHERE Bid.userrole_id = ?) AS BidItems\n ON ItemCategory.item_id = BidItems.id\n GROUP BY ItemCategory.category_id\n ORDER BY no_items\n LIMIT 1) as TopCategories\n ON ItemCategory.category_id = TopCategories.category_id)\n AND Auction.end_date > now()\n AND NOT Auction.userrole_id = ?\n AND NOT EXISTS (SELECT * FROM Bid WHERE Bid.auction_id = Auction.id AND userrole_id = ?)', [$buyer_id, $seller_id, $buyer_id]);\n\n }\n\n if(count($results) == 0) {\n\n /*\n if the user did not bid on any auction, recommend from popular categories\n\n */\n\n $results = Database::query('SELECT DISTINCT Auction.* FROM Auction JOIN Item ON Auction.id = Item.auction_id\n WHERE Item.id IN (SELECT DISTINCT(ItemCategory.item_id) FROM ItemCategory JOIN\n (SELECT ItemCategory.category_id, COUNT(ItemCategory.item_id) as no_items FROM ItemCategory\n GROUP BY ItemCategory.category_id\n ORDER BY no_items\n LIMIT 1) as TopCategories\n ON ItemCategory.category_id = TopCategories.category_id)\n AND Auction.end_date > NOW()\n AND NOT Auction.userrole_id = ?\n AND NOT EXISTS (SELECT * FROM Bid WHERE Bid.auction_id = Auction.id AND userrole_id = ?)', [$seller_id, $buyer_id]);\n\n\n }\n\n return self::processAuctionsResultSetSql($results);\n\n }", "public function getRecommendations()\n {\n $array = array();\n foreach ($this->requirements as $req) {\n if ($req->isOptional()) {\n $array[] = $req;\n }\n }\n\n return $array;\n }", "public function favorites()\n {\n return $this->hasMany('\\App\\FavoriteModel', 'user_id');\n }", "public function fetchServices($type)\n {\n $limit = 100;\n $page = 0;\n\n $data = [];\n\n $fetchFunction = 'get' . ucfirst($type) . 'ServicesQuery';\n\n $semanticResults = $this->makeSparqlService()->performSparqlQuery(static::$fetchFunction(), 'GET', 'json');\n\n // Transform the data in a compatible format\n $transformedData = $this->transform($semanticResults);\n\n $data = array_merge($data, array_values($transformedData));\n\n while (!empty($transformedData)) {\n $page++;\n $semanticResults = $this->makeSparqlService()->performSparqlQuery(static::$fetchFunction($limit, ($limit * $page)), 'GET', 'json');\n\n // Transform the data in a compatible format\n $transformedData = $this->transform($semanticResults);\n\n if (!empty($transformedData)) {\n $data = array_merge($data, array_values($transformedData));\n }\n }\n\n return $data;\n }" ]
[ "0.72618943", "0.70656407", "0.63679177", "0.5820408", "0.5779264", "0.5739333", "0.5680276", "0.5649803", "0.5619644", "0.55803907", "0.5576431", "0.5490075", "0.53668714", "0.5341236", "0.53348005", "0.5320851", "0.5311116", "0.52960694", "0.5283591", "0.52539134", "0.52528995", "0.5239162", "0.5226934", "0.5210405", "0.52059484", "0.52059484", "0.5165762", "0.5163636", "0.51534516", "0.51446795", "0.5142012", "0.5123193", "0.5100618", "0.5083132", "0.50812066", "0.50708705", "0.5062678", "0.505841", "0.50547695", "0.504456", "0.5025467", "0.5010453", "0.5005384", "0.4978473", "0.49732882", "0.49700138", "0.49479106", "0.4937819", "0.49349576", "0.4931696", "0.493026", "0.4910611", "0.4906234", "0.4889963", "0.4888289", "0.48869678", "0.48813224", "0.48663408", "0.48637098", "0.4834421", "0.4829572", "0.48247594", "0.48241225", "0.4809465", "0.48005292", "0.4792249", "0.47912583", "0.47890347", "0.47886527", "0.47827658", "0.4773215", "0.47610632", "0.47474012", "0.47464535", "0.47395983", "0.47341636", "0.4729736", "0.4719621", "0.4718221", "0.47170255", "0.47140494", "0.47129288", "0.47107753", "0.47057015", "0.4695046", "0.46903762", "0.468565", "0.4682006", "0.46797293", "0.46775404", "0.4675523", "0.46736655", "0.46682522", "0.46676427", "0.46594852", "0.465637", "0.46536416", "0.46503597", "0.4648392", "0.4643506" ]
0.7204107
1
update_validation update_fullname updates their fullname
update_validation update_fullname обновляет их fullname
public function update_fullname($new_fullname) { $new_fullname = Dba::escape($new_fullname); $sql = "UPDATE `user` SET `fullname`='$new_fullname' WHERE `id`='$this->id'"; $db_results = Dba::query($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatefullname()\r\n\t{\r\n\t global $CFG,$objSmarty;\r\n if(isset($_SESSION['user_id']) && !empty($_SESSION['user_id']))\r\n {\r\n \t\t\t/*$user_already =$this->getValue(\"username\",$CFG['table']['register'],\"username='\".$this->filterInput($_POST['fullname']).\"' AND user_id != '\".$this->filterInput($_SESSION['user_id']).\"'\");\r\n \t\t \tif($user_already)\r\n \t\t\t\t{\r\n \t\t\t\t\techo \"This Fullname already Exist try with another\";\r\n \t\t\t\t\texit();\t\r\n \t\t\t\t}\r\n \t\t\telse\r\n \t\t\t\t{*/\r\n \t\t\t\t \t$sql_regupdate\t= \" UPDATE \".$CFG['table']['register'].\" SET `username` = '\".$this->filterInput($_POST['fullname']).\"' \r\n WHERE `user_id` = '\".$this->filterInput($_SESSION['user_id']).\"'\";\r\n $res\t = $this->ExecuteQuery($sql_regupdate,'update');\r\n \t\t\t\t\tif($res){\r\n \t\t\t\t\techo 'Adınız başarıyla güncellendi';\r\n \t\t\t\t\t}\r\n \t\t\t\t/*}*/\r\n } \r\n\t}", "public function do_user_full_name_edit()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_tutor_auth();\n\t\t$CI->load->model('tutor/Profiles');\n\n\t\t$password = md5(\"gef_quize\".$CI->input->post('password'));\n\t\t\n\t\t$is_exist = $CI->Profiles->check_old_password( $password );\n\t\t\n\n\t\tif($is_exist)\n\t\t{\n\t\t\t$data =array(\n\t\t\t\t\"user_name\"\t=> $this->input->post('full_name')\n\t\t\t\t);\n\t\t\t$CI->Profiles->user_info_update( $data );\n\t\t\t\n\t\t\t$CI->session->set_userdata(array('message'=>display(\"successfully_changed\")));\n\t\t\tredirect(base_url('tutor/User_profile'));exit();\n\t\t\t\n\t\t}else{\n\t\t\n\t\t\t$CI->session->set_userdata(array('warning_message'=>display(\"sorry_password_dosent_match\")));\n\n\t\t\tredirect(base_url('tutor/User_profile/edit_user_info'));exit();\n\t\t}\n\t\t\n\t}", "function um_update_profile_full_name( $user_id, $changes ) {\r\n\t// Sync display name changes\r\n\t$option = UM()->options()->get( 'display_name' );\r\n\r\n\tif ( ! isset( $user_id ) || empty( $user_id ) ) {\r\n\t\t$user = get_user_by( 'email', $changes['user_email'] );\r\n\t\tum_fetch_user( $user->ID );\r\n\t\t$user_id = $user->ID;\r\n\t}\r\n\r\n\tswitch ( $option ) {\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\tcase 'full_name':\r\n\t\t\t$update_name = get_user_meta( $user_id, 'first_name', true ) . ' ' . get_user_meta( $user_id, 'last_name', true );\r\n\t\t\tbreak;\r\n\t\tcase 'sur_name':\r\n\t\t\t$fname = get_user_meta( $user_id, 'first_name', true );\r\n\t\t\t$lname = get_user_meta( $user_id, 'last_name', true );\r\n\t\t\t$update_name = $lname . ' ' . $fname;\r\n\t\t\tbreak;\r\n\t\tcase 'initial_name':\r\n\t\t\t$fname = get_user_meta( $user_id, 'first_name', true );\r\n\t\t\t$lname = get_user_meta( $user_id, 'last_name', true );\r\n\t\t\t$update_name = $fname . ' ' . ( !empty( $lname ) ? $lname[0] : '' );\r\n\t\t\tbreak;\r\n\t\tcase 'initial_name_f':\r\n\t\t\t$fname = get_user_meta( $user_id, 'first_name', true );\r\n\t\t\t$lname = get_user_meta( $user_id, 'last_name', true );\r\n\t\t\t$update_name = ( !empty($fname) ? $fname[0] : '' ) . ' ' . $lname;\r\n\t\t\tbreak;\r\n\t\tcase 'nickname':\r\n\t\t\t$update_name = get_user_meta( $user_id, 'nickname', true );\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tif ( isset( $update_name ) ) {\r\n\r\n\t\t$arr_user = array( 'ID' => $user_id, 'display_name' => $update_name );\r\n\t\t$return = wp_update_user( $arr_user );\r\n\r\n\t\tif( is_wp_error( $return ) ) {\r\n\t\t\twp_die( '<pre>' . var_export( array( 'message' => $return->get_error_message(), 'dump' => $arr_user, 'changes' => $changes ), true ) . '</pre>' );\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tif ( isset( $changes['first_name'] ) && isset( $changes['last_name'] ) ) {\r\n\r\n\t\t$full_name = UM()->user()->profile['display_name'];\r\n\t\t$full_name = UM()->validation()->safe_name_in_url( $full_name );\r\n\r\n\t\tupdate_user_meta( UM()->user()->id, 'full_name', $full_name );\r\n\r\n\t}\r\n\r\n\t// regenerate slug\r\n\tUM()->user()->generate_profile_slug( $user_id );\r\n}", "public function handleProfileUpdateValidation() {\n $firstNameValidity = Validation::isValidName($this->firstName);\n $lastNameValidity = Validation::isValidName($this->lastName);\n $isValidCity = Validation::isValidResident($this->city);\n // var_dump($this->city); exit;\n if (!$firstNameValidity['isValid']) {\n $this->error['firstName'] = $firstNameValidity['message'];\n }\n\n if (!$lastNameValidity['isValid']) {\n $this->error['lastName'] = $lastNameValidity['message'];\n }\n\n if (!$isValidCity ['isValid']) {\n $this->error['city'] = $isValidCity['message'];\n }\n\n if (empty(trim($this->email))) {\n $this->error['email'] = 'Email address can not be empty';\n } else if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->error['email'] = 'Invalid email address';\n }\n\n if ($this->sex != 'Male' && $this->sex != 'Female') {\n $this->error['sex'] = 'Invalid sex';\n }\n\n if ($this->phoneNumber && is_numeric(!$this->phoneNumber)) {\n $this->error['phoneNumber'] = 'Invalid phone number';\n }\n\n if (sizeof($this->error) == 0 && $this->isEmailUpdated() && $this->isPhoneNumberUpdated()) {\n $user = UserModel::getUserByEmailPhone($this->pdoConnection, $this->email, $this->phoneNumber);\n if ($user == 'Server error') // return server error response if there is an exception thrown when retrieving user data\n $this->jsonResponse(array('success' => false, 'code' => Controller::HTTP_SERVER_ERROR_CODE, 'message' => 'Server error'));\n \n if ($user) {\n if ($user['email'] == $this->email) \n $this->error['email'] = 'Email address already exist';\n if ($user['phone_number'] == $this->phoneNumber) \n $this->error['phoneNumber'] = 'Phone number already exist';\n }\n } else if (sizeof($this->error) == 0 && $this->isEmailUpdated()) {\n $user = UserModel::getUserByEmail($this->pdoConnection, $this->email);\n if ($user == 'Server error') // return server error response if there is an exception thrown when retrieving user data\n $this->jsonResponse(array('success' => false, 'code' => Controller::HTTP_SERVER_ERROR_CODE, 'message' => 'Server error'));\n \n if ($user)\n $this->error['email'] = 'Email address already exist';\n\n } else if (sizeof($this->error) == 0 && $this->isPhoneNumberUpdated()) {\n $user = UserModel::getUserByPhoneNumber($this->pdoConnection, $this->phoneNumber);\n if ($user == 'Server error') // return server error response if there is an exception thrown when retrieving user data\n $this->jsonResponse(array('success' => false, 'code' => Controller::HTTP_SERVER_ERROR_CODE, 'message' => 'Server error'));\n \n if ($user) \n $this->error['phoneNumber'] = 'Phone number already exist';\n }\n\n\n\n if (sizeof($this->error) == 0) return true;\n\n $this->jsonResponse(array('success' => false, 'code' => Controller::HTTP_BAD_REQUEST_CODE, 'messages' => $this->error));\n }", "public function full_name_callback() {\n printf(\n '<input type=\"text\" id=\"full_name\" name=\"orb_form[full_name]\" value=\"%s\" />',\n isset( $this->options['full_name'] ) ? esc_attr( $this->options['full_name']) : ''\n );\n }", "public function validForUpdate($id, $first_name, $last_name, $email, $password);", "function set_full_name($full_name) {\n $this->full_name = $full_name;\n }", "public function update($thisStudent)\n {\n $this->db->query(\"UPDATE `user` SET `fullname`=? WHERE `id`=?\", array($thisStudent['fullName'], $thisStudent['id']));\n }", "public function updateUserName($data)\n {\n if($data['first_name'] && $data['last_name']) {\n\n $name = setUsername($data['first_name'], $data['last_name']);\n\n $this->name = $name;\n\n $this->save();\n }\n }", "public function updateEmailAndName(array $input)\n {\n\n $input = array_map('trim', $input);\n $input['name'] = html2text($input['name']);\n\n $validator = new Validator($input);\n\n $validator->rule('required', 'name');\n $validator->rule('lengthMax', 'name', 200);\n\n $validator->rule('required', 'email');\n\n $validator->rule('unique', 'email', 'users', 'email', $input['email'], 'id', $this->id)\n ->message(_('{field} is taken.'));\n\n $validator->rule('email', 'email');\n\n // does the user wants to change their email address?\n\n if (post('verify_email') || post('email') != $this->email) {\n $validator->rule('required', 'verify_email');\n $validator->rule('email', 'verify_email');\n $validator->rule('equals', 'verify_email', 'email');\n }\n\n // if validation passes, we save and redirect\n if ($validator->validate()) {\n try {\n static::$db->pdo->beginTransaction();\n\n\n $updated = false;\n // Save the email if changed\n if ($input['verify_email'] && $this->email !== $input['email']) {\n $this->attributes['original_email'] = $this->email;\n $this->email = $input['email'];\n $updated = true;\n }\n\n // save the email address if changed\n $this->save();\n\n // save the name in the profile\n $default = new Profile();\n $default->name = 'name';\n $default->user_id = $this->id;\n $name = $this->profiles->findBy('name', 'name', $default);\n\n if ($input['name'] !== $name->value) {\n $updated = true;\n $name->value = $input['name'];\n $name->save();\n }\n\n // Commit Transaction\n static::$db->pdo->commit();\n\n if ($updated) {\n event('account.updated', array($this, _('Name and Email address')));\n }\n\n return $updated;\n\n } catch (\\Exception $e) {\n static::$db->pdo->rollBack();\n Error::exception($e);\n }\n }\n\n return $validator->errorsToNotification();\n }", "public function update_account()\n\t{\n\t\t//form validation rules\n\t\t$this->form_validation->set_rules('last_name', 'Last Names', 'required|xss_clean');\n\t\t$this->form_validation->set_rules('first_name', 'First Name', 'required|xss_clean');\n\t\t$this->form_validation->set_rules('phone', 'Phone', 'required|xss_clean');\n\t\t\n\t\t//if form has been submitted\n\t\tif ($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t$this->session->set_userdata('front_error_message', validation_errors());\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t//check if user has valid login credentials\n\t\t\tif($this->users_model->edit_frontend_user($this->session->userdata('user_id')))\n\t\t\t{\n\t\t\t\t$this->session->set_userdata('front_success_message', 'Your details have been successfully updated');\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->session->set_userdata('front_error_message', 'Oops something went wrong and we were unable to update your details. Please try again');\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->my_details();\n\t}", "public function changeNamee(){\n\n $id=$this->session->id;\n\t $email=$this->session->email;\n\t $res=$this->User_model->selectInfo($email);\n\t $data['res']=$res;\n foreach ($res as $reso => $list) {\n foreach ($res as $reso => $listt) {\n $name= $listt['name'] ;\n }\n }\n\n $this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t $this->form_validation->set_rules('name', 'name', 'required|is_unique[reg.name]');\n\n if ($this->form_validation->run() == FALSE) {\n echo $name;\n echo \"||\";\n echo validation_errors();\n\n }else {\n\n $newname=$this->input->post('name');\n $this->User_model->change($id,$newname);\n echo $newname;\n echo \" || \";\n echo\"<span style='color:green'>updated successfuly</span>\";\n }\n\n\t}", "public function updateFirstName() {\n\n// $data['Detail']['id'] = 7;\n// $data['Detail']['first_name'] = \"abcd\";\n// $this->Detail->create();\n// $this->Detail->save($data);\n\n $this->Detail->updateAll(\n array('first_name' => \"'abcd'\"), array('id =' => '7')\n );\n\n\n $log = $this->Detail->getDataSource()->getLog(false, false);\n debug($log);\n die();\n }", "public function testShouldUpdateUserFailCaseFullnameEmpty()\n {\n $userId = 1;\n $parameters = [\n 'fullname' => '',\n 'phone' => '0977444333',\n ];\n $this->put(\"/api/users/\" . $userId, $parameters)\n ->seeStatusCode(422)\n ->seeJsonContains(['fullname' => ['The fullname field is required.']]);\n }", "private function _update_searchname() {\n $this->searchname = sprintf('%s%s', text::searchable($this->first_name), text::searchable($this->last_name));\n }", "public function updated($propatyName){\n $this->validateOnly($propatyName);\n}", "public function setFullName($fullname)\n\t{\n\t\t$this->fullname = $fullname;\n\t}", "private function name_validation()\n {\n foreach(self::$field as $value)\n {\n if(empty($this->data[$value]))\n {\n $this->$output_val[$value] = \"Required\";\n }\n else\n {\n $n = $this->validate_str($this->data[$value]);\n\n if (!preg_match(\"/^[a-zA-Z- ]*$/\", $n))\n {\n $this->$output_val[$value] = \"Characters Only\";\n }\n\n\n }\n }\n\n if (!($this->$output_val['first'] == 'Required') && !($this->$output_val['last'] == 'Required'))\n {\n $this->$output_val['full'] = $this->data['first'] . \" \" . $this->data['last'];\n }\n\n if (($this->$output_val['first'] == '') && ($this->$output_val['last'] == ''))\n {\n $this->$output_val['out'] = \"Hello \" . $this->data['first'] . \" \" . $this->data['last'];\n }\n }", "public function testShouldUpdateUserFailCaseFullnameOverMaxlength()\n {\n $userId = 1;\n $parameters = [\n 'fullname' => 'Nguyen Thi Hanh Nguyen Thi Hanh Nguyen Nguyen Thi Hanh',\n 'phone' => '0977444333',\n ];\n $this->put(\"/api/users/\" . $userId, $parameters)\n ->seeStatusCode(422)\n ->seeJsonContains(['fullname' => ['The fullname may not be greater than 50 characters.']]);\n }", "function hook_cern_profiles_displayname_update($realname, $account) {\n\n}", "public function setFullname($Fullname){\n $this->Fullname = $Fullname;\n }", "function update_user_names() {\n if(isset($_POST['update_name'])) {\n global $db_connect;\n $first_name = $_POST['first_name'];\n $last_name = $_POST['last_name'];\n\n $first_name = mysqli_real_escape_string($db_connect, $first_name);\n $last_name = mysqli_real_escape_string($db_connect, $last_name);\n\n if(empty($first_name) || empty($last_name)) {\n echo \"First name or Last name is empty\";\n } else {\n $query = \"UPDATE users SET first_name = '$first_name', last_name = '$last_name' WHERE email_address = '{$_SESSION['email_address']}'\";\n $query_result = mysqli_query($db_connect, $query);\n\n if(!$query_result){\n die('Query Failed');\n }\n }\n }\n}", "public function setFullNameAttribute($value)\n {\n $this->attributes['full_name'] = ucwords(strtolower($value));\n }", "public function changeLnameAction()\r\n {\r\n if (preg_match(\"/^[a-z]+[\\w.-]*$/i\", $_POST['profileLname'])) {\r\n $this->user->changeLname();\r\n echo \"<script> alert('Data changed !')</script>\";\r\n } else {\r\n echo '<script> alert(\"Wrong format !\")</script>';\r\n }\r\n }", "public function full_name(){\n \n return $firstname. \" \" . $lastname;\n }", "public function setFullName($fullName)\n {\n $this->fullName = $fullName;\n }", "public function setFullName($fullName)\n {\n $this->fullName = $fullName;\n }", "public function update(Request $request, Author $author)\n {\n\n $validator = Validator::make($request->all(),\n [\n 'name' => ['required', 'min:2', 'max:32', 'alpha'],\n 'surname' => ['required', 'min:2', 'max:32','alpha'],\n ],\n[\n'name.required' => 'Must enter the name',\n'name.min' => 'Name too short',\n'name.max' => 'Name too long',\n'name.alpha' => 'Do not enter numbers or random simbols',\n\n'surname.required' => 'Must enter the surname',\n'surname.min' => 'Surname too short',\n'surname.max' => 'Surname too long',\n'surname.alpha' => 'Do not enter numbers or random simbols',\n\n]\n );\n if ($validator->fails()) {\n $request->flash();\n return redirect()->back()->withErrors($validator);\n }\n\n$author->name = strtolower($request->name);\n$author->name = ucfirst($request->name);\n\n$author->surname = strtolower($request->surname);\n$author->surname = ucfirst($request->surname);\n $author->save();\n return redirect()->route('author.index')->with('success_message', 'Updated.');\n\n}", "public function updateProfile(Request $request){\n \n if ($request->has(\"nameUpdate\")) { \n // POUR LE NOM ET L\"EMAIL //\n if ($request->name == null && $request->email == null) {\n return back();\n } elseif ($request->name == null) {\n $request->validate([\n \"email\" => [\"string\",\"email\",\"max:255\",\"unique:users\"]\n ]);\n Auth::user()->email = $request->email;\n Auth::user()->save();\n\n } elseif ($request->email == null) {\n $request->validate([\n \"name\" => \"string|max:255\",\n ]);\n Auth::user()->name = $request->name;\n Auth::user()->save();\n } else {\n $request->validate([\n \"email\" => [\"string\",\"email\",\"max:255\",\"unique:users\"],\n \"name\" => \"string|max:255\",\n ]);\n Auth::user()->name = $request->name;\n Auth::user()->email = $request->email;\n Auth::user()->save();\n }\n return redirect()->back()->with(\"success\" , \"save done\");\n } \n }", "public function changeLastName(string $lastName): void;", "function update_user()\n\t{\n\t\t$query = $GLOBALS['connection']->query(\"UPDATE users SET first_name='\". $GLOBALS['first_name'] .\"', last_name='\". $GLOBALS['last_name'] .\"' WHERE email='\". $GLOBALS['email'] .\"'\");\n\t}", "public function UpdateAccount(){\n\n $firstName = htmlentities(htmlspecialchars($_POST['firstName']));\n $insertion = htmlentities(htmlspecialchars($_POST['insertion']));\n $lastName = htmlentities(htmlspecialchars($_POST['lastName']));\n $birthDate = htmlentities(htmlspecialchars($_POST['birthdate']));\n $ID = '25';\n\n\n $model = $this->model('User');\n\n if($model->validateUserInputUpdate($firstName, $insertion, $lastName, $birthDate, $ID)){\n echo \"<script>alert('Uw account is succesvol geupdate!');</script>\";\n $this->view('main/index');\n }else{\n $this->view('profiel/index');\n }\n }", "function update_name() {\r\n\t\tif($this->session->userdata('stud_id') == FALSE ) {\r\n\t\t\tredirect('students','refresh');\r\n\t\t}\r\n\t\t\r\n\r\n\t\t$updated = false; //Set updated boolean\r\n\r\n\t\t// input\r\n\t\t$name = $this->input->post('name', true);\r\n\r\n\t\t// Check if the input is not emty\r\n\t\tif( !empty($name) ) {\r\n\t\t\t$data = [\r\n\t\t\t\t'name' => trim($name)\r\n\t\t\t];\r\n\r\n\t\t\t// Update the input\r\n\t\t\t$update_user = $this->crud->update('students',['stud_id' => $this->session->userdata('stud_id')], $data);\r\n\r\n\t\t\tif( $update_user ) { //if successfully updated\r\n\t\t\t\t$updated = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\techo json_encode(['updated' => $updated]);\r\n\t}", "function FullName()\n\t{\treturn trim($this->details['firstname'] . ' '. $this->details['surname']);\n\t}", "function setLastname($lastname)\n\t{\n\t\t$this->_modified = true;\n\t\t$this->lastname = $lastname;\n\t}", "public function update(){\r\n\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->nam,email=\\\"$this->email\\\",last_name=\\\"$this->last_name\\\",username=\\\"$this->username\\\",rol=$this->rol,plant_id=$this->plant_id where id=$this->id\";\r\n\t\tExecutor::doit($sql);\r\n\t}", "function validate_on_update ($data) {\n\n\t\t$val = $this->form_validation;\n\t\t\n\t\tif (isset($data['username'])) {\n\t\t\t$val->set_rules('username', 'Login', 'trim|required|alpha_dash|min_length[4]');\n\t\t}\n\t\tif (isset($data['password'])) {\n\t\t\t$val->set_rules('password', 'Password', 'trim|required');\n\t\t}\n\t\tif (isset($data['open_password'])) {\n\t\t\t$val->set_rules('open_password', 'Open Password', '');\n\t\t}\n\t\tif (isset($data['email'])) {\n\t\t\t$val->set_rules('email', 'EMail', 'trim|required|valid_email');\n\t\t}\n\t\tif (isset($data['status'])) {\n\t\t\t$val->set_rules('status', 'Status', '');\n\t\t}\n\n\t\treturn $this->run_validation($data);\n\t}", "function suggestUsername() {\n\t\tparent::validate();\n\t\t$suggestion = Validation::suggestUsername(\n\t\t\tRequest::getUserVar('firstName'),\n\t\t\tRequest::getUserVar('lastName')\n\t\t);\n\t\techo $suggestion;\n\t}", "function opfbs_username_alter(&$name, $account) { \n $user = user_load($account->uid);\n if (!empty($user->profile_forename) && !empty($user->profile_surname)) {\n $name = $user->profile_forename . \" \" . $user->profile_surname;\n }\n}", "function updateUser()\n {\n $result = parent::update($this->tableP, $this->satz->assmUpdate(\n array(\n $this->name,\n $this->lastName,\n $this->phone\n ), \n array(\n $this->data->data->name,\n $this->data->data->lastName,\n $this->data->data->phone\n )), $this->email . ' like ' . $this->satz->apst($this->data->data->email));\n \n parent::closeConection();\n return array('status' => $result);\n }", "public function saveLastName() {\n\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE user \n\t\t\t\t\t\t\t\t\t\tSET last_name=:lname \n\t\t\t\t\t\t\t\t\t\tWHERE id=:id\");\n\n\t\t\t$stmt->bindValue(':id', $this->id);\n\t\t\t$stmt->bindValue(':lname', $this->last_name);\n\t\t\t\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t\tcatch (Exception $e) {\n\t\t\t$this->log->logError($e);\n\t\t\treturn false;\n\t\t}\n\t}", "function get_full_real_name()\r\n {\r\n return $this->real_first_name .' '. $this->real_last_name;\r\n }", "public function update($name_slug)\n {\n $member = $this->getMemberUsingSlug($name_slug);\n\n $member_update_data = Input::only(['first_name', 'last_name', 'email']);\n $rules = ['first_name' => 'required', 'last_name' => 'required'];\n $rules['email'] = ($member_update_data['email'] != $member->email) ? 'required|email|unique:users' : '';\n $validator = Validator::make($member_update_data, $rules);\n if (!$validator->passes()) {\n return Redirect::back()\n ->withInput()\n ->withErrors($validator->errors());\n }\n\n $member->update($member_update_data);\n return Redirect::route('members.edit', $member->makeSlug());\n }", "function do_change_name() {\n\t// Check XSRF token\n\tif ($_SESSION['xsrf_token'] != $_POST['xsrf_token'])\n\t\ttrigger_error('Do_Change_Name: Invalid XSRF token', E_USER_ERROR);\n\t\n\t// Check if ID is valid\n\t$query = 'SELECT name, yog FROM users WHERE id=\"' . mysqli_real_escape_string(DB::get(),$_GET['ID']) . '\" LIMIT 1';\n\t$result = DB::queryRaw($query);\n\t\n\t// If User ID isn't valid, show an error page\n\tif (mysqli_num_rows($result) != 1)\n\t\ttrigger_error('Invalid user ID', E_USER_ERROR);\n\t\n\t$row = mysqli_fetch_assoc($result);\n\t$yog = $row['yog'];\n\t$old_name = $row['name'];\n\t\n\t// Validate the entered name:\n\t//\n\t\n\tglobal $name;\n\t$name = htmlentities(ucwords(trim($_POST['name'])));\n\t\t// capitalizes first letters if they didn't do it; removes whitespace before and after.\n\t\t// and makes sure to escape the name\n\t$name = preg_replace('/\\s\\s+/', ' ', $name);\t// removes multiple consecutive spaces, thanks to juglesh at https://bytes.com/topic/php/answers/160400-delete-multiple-spaces-special-characters\n\t\n\t\n\tif (strlen($name) > 25)\n\t\t$name = substr($name, 0, 25); \t// you should not be able to enter a name > 25 chars.\n\t\t\t\t\t\t\t\t\t\t// If so, you're probably hacking around. Names are trimmed.\n\t\n\tif (strlen($name) < 6) {\t\t// minimum length: 6 chars\n\t\tshow_change_name_page('Names must be at least 6 characters long');\n\t\treturn;\n\t}\n\t\n\t// Check for extraneous characters\n\tif (!preg_match('/^[A-Za-z-\\s]+$/', $name)) {\n\t\tshow_change_name_page('You may only use letters, hyphens and spaces in a name');\n\t\treturn;\n\t}\n\t\n\t// Check that a current member (or pending member) does not share that name\n\t$sql_name = mysqli_real_escape_string(DB::get(),strtolower($name));\n\t$query = 'SELECT COUNT(*) FROM users WHERE LOWER(name)=\"' . $sql_name . '\" AND yog=\"'\n\t\t. mysqli_real_escape_string(DB::get(),$yog) . '\" AND permissions!=\"L\" AND approved!=\"-1\"';\n\t$result = DB::queryRaw($query);\n\t$row = mysqli_fetch_assoc($result);\n\t\n\t$count = 0;\n\tif (strtolower($name) == strtolower($old_name))\t// you can change the case of a name\n\t\t$count = 1;\n\t\n\tif ($row['COUNT(*)'] > $count) {\n\t\tshow_change_name_page('An account with that name in the same grade already exists');\n\t\treturn;\n\t}\n\t\n\t\n\t// ** INFORMATION VALIDATED AT THIS POINT **\n\t\n\t// Change name\n\t$query = 'UPDATE users SET name=\"' . $name . '\" WHERE id=\"' . mysqli_real_escape_string(DB::get(),$_GET['ID']) .'\" LIMIT 1';\n\tDB::queryRaw($query);\n\t\n\tredirect();\n}", "public function update() {\n\t\t//check if the user is authenticated\n\t\tif(Auth::check()) {\n\t\t\t//the user is authenticated. Profile update can continue\n\n\t\t\t//retrieve the existing email adres from the db and store it in a variable\n\t\t\t$useremail = User::find(Auth::user()->PK_userId)->email;\n\t\t\t\n\t\t\t//array with the fields and their content\n\t\t\t$fields = array(\n\t\t\t\t'name'\t\t\t\t=>\tInput::get('name'),\n\t\t\t\t'password'\t\t\t=>\tInput::get('password'),\n\t\t\t\t'newpassword'\t\t=>\tInput::get('newpassword'),\n\t\t\t\t'twitter'\t\t\t=>\tInput::get('twitter'),\n\t\t\t\t'github'\t\t\t=>\tInput::get('github'),\n\t\t\t\t'linkedin'\t\t\t=>\tInput::get('linkedin'),\n\t\t\t\t'pintrest'\t\t\t=>\tInput::get('pintrest'),\n\t\t\t\t'googleplus'\t\t=>\tInput::get('googleplus'),\n\t\t\t\t'instagram'\t\t\t=>\tInput::get('instagram'),\n\t\t\t\t'myspace'\t\t\t=>\tInput::get('myspace'),\n\t\t\t\t'website'\t\t\t=>\tInput::get('website'),\n\t\t\t\t'bio'\t\t\t\t=>\tInput::get('bio'),\n\t\t\t\t'profilepicture'\t=>\tInput::get('profilepicture'),\n\t\t\t\t'grouped'\t\t\t=> Input::get('grouped')\n\t\t\t);\n\n\t\t\t//array with the validation rules for the determined fields\n\t\t\t$rules = array(\n\t\t\t\t'name'\t\t\t\t=>\t'required|min:3|max:60',\n\t\t\t\t'password'\t\t\t=>\t'required_with:newpassword|passwordCheck|min:3',\n\t\t\t\t'newpassword'\t\t=>\t'required_with:password|min:3',\n\t\t\t\t'twitter'\t\t\t=>\t'min:3',\n\t\t\t\t'github'\t\t\t=>\t'min:3',\n\t\t\t\t'linkedin'\t\t\t=>\t'min:3',\n\t\t\t\t'pintrest'\t\t\t=>\t'min:3',\n\t\t\t\t'googleplus'\t\t=>\t'min:3',\n\t\t\t\t'instagram'\t\t\t=>\t'min:3',\n\t\t\t\t'myspace'\t\t\t=>\t'min:3',\n\t\t\t\t'website'\t\t\t=>\t'min:7',\n\t\t\t\t'bio'\t\t\t\t=>\t'min:3|max:2000',\n\t\t\t\t'profilepicture'\t=>\t'image|max:5000',\n\t\t\t\t'grouped'\t\t\t=>\t'required|min:1'\n\t\t\t);\n\n\t\t\t//messages array to override the default message for the passwordCheck rule\n\t\t\t//this needs to get in another file but does not work yet\n\t\t\t$messages = array(\n\t\t\t\t'password_check' => 'The given password does not match the excisting password.',\n\t\t\t);\n\n\t\t\t//check if the email adres in the db is diffrent from the email adres in the input field\n\t\t\tif($useremail != Input::get('email')) {\n\t\t\t\t//email adres in the form is diffrent from the email adress in the db so include the field in the validator and give it validation rules\n\t\t\t\t$fields['email'] = Input::get('email');\n\t\t\t\t$rules['email'] = 'required|email|unique:users';\n\t\t\t}\n\n\t\t\t//create validator\n\t\t\t$validator = Validator::make(\n\t\t\t\t$fields,\n\t\t\t\t$rules,\n\t\t\t\t$messages //messages override for the passwordCheck field\n\t\t\t);\n\t\t\t\n\t\t\t//store the validator messages in the messages variable\n\t\t\t$messages = $validator->messages();\n\t\t\t\n\t\t\t//check if the validator fails\n\t\t\tif($validator->fails()) {\n\t\t\t\t//validator failed, send the user back with errors and his input\n\t\t\t\treturn Redirect::back()->withErrors($messages)->withInput();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//update the user his profile\n\t\t\t\t$user = User::find(Auth::user()->PK_userId);\n\t\t\t\t$user->updateProfile();\n\t\t\t\t//validator passed, continue with updating profile data\n\t\t\t\treturn Redirect::to('/profile/' . Auth::user()->PK_userId);\n\t\t\t}\n\n\t\t}\n\t\telse {\n\t\t\t//the user is not authenticated and will be redirected to the homepage\n\t\t\treturn Redirect::to('/');\n\t\t}\n\t}", "public function updateName( $sName );", "function fnln_updateFields($user_id){\n\t\t\n\t\tupdate_usermeta( $user_id, 'first_name', $_POST['first_name']);\n\t\tupdate_usermeta( $user_id, 'last_name', $_POST['last_name']);\n}", "public function updateAddress($id, $f_name, $l_name, $address) { \r\n\t\t$error = false;\r\n\t\t$fnameError = '';\r\n\t\t\r\n\t\t// name validation\r\n\t\tif (empty($f_name) || empty($l_name)) {\r\n\t\t\t$error = true;\r\n\t\t\t$fnameError = \"Please enter full name and surname\"; \r\n\t\t\t\r\n\t\t} else if (strlen($f_name) < 3 || strlen($l_name) < 3) {\r\n\t\t\t$error = true;\r\n\t\t\t$fnameError = \"Name and surname must have at least 3 characters.\"; \r\n\t\t\t\r\n\t\t} else if (!preg_match(\"/^[a-zA-Z]+$/\", $f_name) || !preg_match(\"/^[a-zA-Z]+$/\", $l_name)) {\r\n\t\t\t$error = true;\r\n\t\t\t$fnameError = \"Name and surname must contain only letters and no spaces.\"; \r\n\t\t\t\r\n\t\t}\r\n\t \r\n\t\t// if any error -> return error msgs\r\n\t\tif ($error == true) { \r\n\t\t\t$errors['fnameError'] = $fnameError;\r\n\t\t\treturn $errors; \r\n\t\t} // no error -> register account\r\n\t\telse if ($error == false) { \r\n\t\t\t$query = \"UPDATE user SET f_name = '$f_name', l_name = '$l_name', address = '$address' WHERE id = {$id}\";\r\n\t\t\t\t\t$result = $this->db->update($query);\r\n\r\n\t\t\tif ($result) {\r\n\t\t\t\t$msg = \"<div class='alert alert-success'>Address edited successfully!</div>\";\r\n\t\t return $msg;\r\n\t }else{\r\n $msg = \"<div class='alert alert-danger'>Edit address failed! Please try again</div>\";\r\n\t\t return $msg;\t\t\t\r\n\t }\r\n\t\t} \r\n\t\t }", "function profileUpdate($active = \"details\")\n {\n $this->load->library('form_validation');\n \n $this->form_validation->set_rules('fname','Full Name','trim|required|max_length[128]');\n $this->form_validation->set_rules('mobile','Mobile Number','required|min_length[10]');\n $this->form_validation->set_rules('email','Email','trim|required|valid_email|max_length[128]|callback_emailExists'); \n \n if($this->form_validation->run() == FALSE)\n {\n $this->profile($active);\n }\n else\n {\n $name = ucwords(strtolower($this->security->xss_clean($this->input->post('fname'))));\n $mobile = $this->security->xss_clean($this->input->post('mobile'));\n $email = strtolower($this->security->xss_clean($this->input->post('email')));\n \n $userInfo = array('name'=>$name, 'email'=>$email, 'mobile'=>$mobile, 'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->user_model->editUser($userInfo, $this->vendorId);\n \n if($result == true)\n {\n $this->session->set_userdata('name', $name);\n $this->session->set_flashdata('success', 'Profile updated successfully');\n }\n else\n {\n $this->session->set_flashdata('error', 'Profile updation failed');\n }\n\n redirect('profile/'.$active);\n }\n }", "public function updateuserdata(){\n\t\t$this->form_validation->set_rules('txtFirstName', 'First Name', 'trim|required|regex_match[/^[a-zA-z]+$/]');\n\t\t$this->form_validation->set_rules('txtPhoneNumber', 'Phone Number', 'trim|required|regex_match[/^[0-9]+$/]');\n\t\t$this->form_validation->set_rules('txtLastName', 'Last Name', 'trim|required|regex_match[/^[a-zA-z]+$/]');\n\t\t$this->form_validation->set_rules('txtAddressLine1', 'Address Line 1', 'trim|required|regex_match[/^(\\w*\\s*[\\#\\-\\,\\/\\.\\(\\)\\&]*)+/]');\n\t\t$this->form_validation->set_rules('txtAddressLine2', 'Address Line 2', 'trim|regex_match[/^(\\w*\\s*[\\#\\-\\,\\/\\.\\(\\)\\&]*)+/]');\n\t\t$this->form_validation->set_rules('txtAddressLine3', 'Address Line 3', 'trim|regex_match[/^(\\w*\\s*[\\#\\-\\,\\/\\.\\(\\)\\&]*)+/]');\n\t\t$this->form_validation->set_rules('txtAddressLine4', 'Address Line 4', 'trim|regex_match[/^(\\w*\\s*[\\#\\-\\,\\/\\.\\(\\)\\&]*)+/]');\n\t\t$this->form_validation->set_rules('txtCity', 'City', 'trim|required|regex_match[/^[a-zA-z ]+$/]');\n\t\t$this->form_validation->set_rules('txtPin', 'Pin Code', 'trim|required|min_length[6]|max_length[6]|regex_match[/^[0-9]+$/]');\n\t\t$this->form_validation->set_rules('ddlState', 'State', 'trim|required');\n\n\t\tif($this->form_validation->run() == FALSE) {\n\t\t\t$this->session->set_flashdata('error_log', validation_errors());\n\t\t\tredirect('home/manageaccount');\n\t\t} else {\n\n\t\t\t// //Remove XSS\n\t\t\t$email=$this->security->xss_clean($this->input->post('txtEmail'));\n\t\t\t$txtFirstName=$this->security->xss_clean($this->input->post('txtFirstName'));\n\t\t\t$txtLastName=$this->security->xss_clean($this->input->post('txtLastName'));\n\t\t\t$txtAddress1=$this->security->xss_clean($this->input->post('txtAddressLine1'));\n\t\t\t$txtAddress2=$this->security->xss_clean($this->input->post('txtAddressLine2'));\n\t\t\t$txtAddress3=$this->security->xss_clean($this->input->post('txtAddressLine3'));\n\t\t\t$txtAddress4=$this->security->xss_clean($this->input->post('txtAddressLine4'));\n\t\t\t$txtCity=$this->security->xss_clean($this->input->post('txtCity'));\n\t\t\t$txtPin=$this->security->xss_clean($this->input->post('txtPin'));\n\t\t\t$txtState=$this->security->xss_clean($this->input->post('ddlState'));\n\t\t\t$txtPhone=$this->security->xss_clean($this->input->post('txtPhoneNumber'));\n\n\t\t\tif($this->home_model->updateuserdetails($email,$txtFirstName,$txtLastName,$txtAddress1,$txtAddress2,$txtAddress3,$txtAddress4,$txtCity,$txtPin,$txtState,$txtPhone)){\n\n\t\t\t\t$this->session->set_flashdata('success_log', \"Your Account Created Success Fully\");\n\t\t\t\tredirect('home/manageaccount');\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$this->session->set_flashdata('error_log', \"Opps its some error!\");\n\t\t\t\tredirect('home/manageaccount');\n\t\t\t}\n\t\t}\n\t}", "public function setLastName($input){\n\t\t$this->last_name = $input;\n\t}", "function validateupdate(){\n\t\tglobal $_REQUEST;\n\t\t\n\t\tif (isset($_REQUEST['employee_id']) && $_REQUEST['employee_id'] !== ''){\n\t\t\t\t$this->updatewhere[\"employee_id\"] = utf8_decode($_REQUEST['employee_id']);\n\t\t}else{ $this->errors[] = 'No se recibio el id del usuario'; }\t\t\n\t\t\n\t\tif (isset($_REQUEST['name']) && $_REQUEST['name'] !== ''){\n\t\t\t\t$this->userdata[\"name\"] = utf8_decode($_REQUEST['name']);\n\t\t}\n\t\t\n\t\tif (isset($_REQUEST['last_name']) && $_REQUEST['last_name'] !== ''){\n\t\t\t\t$this->userdata[\"last_name\"] = utf8_decode($_REQUEST['last_name']);\n\t\t}\n\t\t\n\t\tif (isset($_REQUEST['nickname']) && $_REQUEST['nickname'] !== ''){\n\t\t\t\t$this->userdata[\"nickname\"] = utf8_decode($_REQUEST['nickname']);\n\t\t}\n\t\t\n\t\tif (isset($_REQUEST['rol']) && $_REQUEST['rol'] !== ''){\n\t\t\t\t$this->userdata[\"rol\"] = utf8_decode($_REQUEST['rol']);\n\t\t}\n\t\t\n\t\t$this->userdata[\"access_requisition\"] = $_REQUEST['access_requisition'];\n\t\t$this->userdata[\"requisition_pwd\"] = $_REQUEST['requisition_pwd'];\n\t\t\n\t\t$this->userdata[\"modification_time\"] = time();\n\t\t$this->userdata[\"status\"] = (isset($_REQUEST['status']) && $_REQUEST['status'] !== '') ? $_REQUEST['status'] : '0';\t\t\n\t\t\n\t\tif(!empty($this->errors)){\n\t\t\t$result = false;\n\t\t}else{\n\t\t\t$result = true;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function updateProfile($data)\n\t{\n\t\treturn $this->validator->make($data, [\n\t\t\t'first_name' => 'required|max:64',\n\t\t\t'last_name' => 'required|max:64'\n\t\t]);\n\t}", "public function setFullName($name)\n {\n list($firstName, $lastName) = explode(\" \", $name);\n $this->first_name = $firstName;\n $this->last_name = $lastName;\n\n return true;\n }", "function update_action()\n {\n $this->form_validation->set_rules('user_name', 'User Name', 'required|trim');\n $this->form_validation->set_rules('contact_no', 'Contact No', 'trim|required');\n $this->form_validation->set_rules('email', 'Email', 'trim|valid_email|required');\n //$this->form_validation->set_rules('email', 'Email', 'trim|valid_email',array('required' => 'Invalid %s Fomate.'));\n if ($this->form_validation->run() == FALSE) {\n echo json_encode(array('success' => 'no', 'msg' => validation_errors()));\n } else {\n $post = $this->input->post();\n $check = $this->User_model->user_update('user', $post);\n\n if ($check == TRUE) {\n echo json_encode(array('success' => 'yes', 'msg' => '<strong>Successfully Update..</strong>..Refresh'));\n } else {\n echo json_encode(array('success' => 'no', 'msg' => 'Some Bad Happening..Contact to developer'));\n }\n }\n }", "function updateUsername($userinfo, &$existinguser, &$status)\r\n {\r\n }", "public function testEditLastName()\n {\n $id = Contact::first()->uuid;\n\n $response = $this->json('PUT', \"api/contacts/$id\", [\n 'first_name' => 'John',\n 'last_name' => 'Doe',\n 'email' => 'john@gmail.com'\n ])\n ->assertStatus(200)\n ->assertJson([\n 'data' => [\n 'attributes' => [\n 'last_name' => 'Doe'\n ]\n ]\n ]);\n }", "public function doUpdateProfile()\n {\n $inputs = $this->input->post(NULL, TRUE);\n $inputs = array_map(function ($v) {\n return strip_tags($v);\n }, $inputs);\n $inputs = array_map(function ($v) {\n return remove_invisible_characters($v);\n }, $inputs);\n $inputs = array_map(function ($v) {\n return makeSafeInput($v);\n }, $inputs);\n\n $this->form_validation->set_data($inputs);\n $this->form_validation->set_rules('inputUserFullName', 'نام و نام خانوادگی', 'trim|required|max_length[254]');\n $this->form_validation->set_rules('inputUserPhone', 'تلفن همراه', 'trim|required|max_length[15]|numeric');\n $this->form_validation->set_rules('inputUserJobTitle', 'عنوان شغلی', 'trim|required|max_length[50]');\n $this->form_validation->set_rules('inputUserEmployStatus', 'وضعیت اشتغال', 'trim|required|max_length[25]|alpha');\n $this->form_validation->set_rules('inputUserEmail', 'ایمیل', 'trim|required|max_length[254]|valid_email');\n $this->form_validation->set_rules('inputUserStateId', 'استان', 'trim|required|max_length[3]|numeric');\n $this->form_validation->set_rules('inputUserCityId', 'شهر', 'trim|required|max_length[3]|numeric');\n $this->form_validation->set_rules('inputUserBirthDate', 'تاریخ تولد', 'trim|required|max_length[10]');\n $this->form_validation->set_rules('inputUserGender', 'جنسیت', 'trim|required|max_length[5]|alpha');\n $this->form_validation->set_rules('inputUserMilitaryStatus', 'وضعیت خدمت سربازی', 'trim|required|max_length[12]|alpha');\n $this->form_validation->set_rules('inputUserMainMajorId', 'رشته تحصیلی', 'trim|required|numeric');\n $this->form_validation->set_rules('inputUserMainJobCategoryId', 'دسته بندی شغلی', 'trim|required|numeric');\n $this->form_validation->set_rules('inputUserAgentId', 'نمایندگی', 'trim|required|numeric');\n $this->form_validation->set_rules('inputUserAbout', 'درباره من', 'trim|required|min_length[10]|max_length[1024]');\n\n if ($this->form_validation->run() == FALSE) {\n $arr = array(\n 'type' => \"red\",\n 'content' => validation_errors()\n );\n echo json_encode($arr);\n die();\n }\n $userInfo = $this->session->userdata('UserLoginInfo')[0];\n $inputs['inputUserId'] = $userInfo['UserId'];\n $result = $this->ModelUser->doUpdateProfile($inputs);\n echo json_encode($result);\n }", "public function update()\n\t{\n\t\tglobal $gdbObj;\n\t\t$user_id = $this->user_id;\n\t\t$username = $gdbObj->escape_value($this->username);\n\t\t$first_name = $gdbObj->escape_value($this->first_name);\n\t\t$last_name = $gdbObj->escape_value($this->last_name);\n\t\t$country = $gdbObj->escape_value($this->country);\n\t\t$city = $gdbObj->escape_value($this->city);\n\t\t$street = $gdbObj->escape_value($this->street);\n\t\t$phone = $gdbObj->escape_value($this->phone);\n\t\t$zip = $gdbObj->escape_value($this->zip);\n\t\t$description = $gdbObj->escape_value($this->description);\n\t\t\n\t\t$sql = \"UPDATE \".self::$usersTable.\" SET username = '$username',first_name = '$first_name', last_name = '$last_name', street = '$street', city = '$city', country = '$country', zip_code = '$zip' , phone = '$phone', description = '$description' where user_id = '$user_id'\";\n\t\tif($gdbObj->query($sql))\n\t\t{\n\t\t\t$this->user_id = $gdbObj->insert_id();\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function profileUpdate($active = \"details\")\n {\n $this->load->library('form_validation');\n \n $this->form_validation->set_rules('fname','Full Name','trim|required|max_length[128]');\n $this->form_validation->set_rules('mobile','Mobile Number','required|min_length[10]');\n $this->form_validation->set_rules('email','Email','trim|required|valid_email|max_length[128]|callback_emailExists'); \n \n if($this->form_validation->run() == FALSE)\n {\n $this->profile($active);\n }\n else\n {\n $name = ucwords(strtolower($this->security->xss_clean($this->input->post('fname'))));\n $mobile = $this->security->xss_clean($this->input->post('mobile'));\n $email = strtolower($this->security->xss_clean($this->input->post('email')));\n \n $userInfo = array('name'=>$name, 'email'=>$email, 'mobile'=>$mobile, 'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->user_model->editUser($userInfo, $this->vendorId);\n \n if($result == true)\n {\n $this->session->set_userdata('name', $name);\n $this->session->set_flashdata('success', 'Profile updated successfully');\n }\n else\n {\n $this->session->set_flashdata('error', 'Profile updation failed');\n }\n\n redirect(ADMIN_PANEL.'profile/'.$active);\n }\n }", "public function getFullNameAttribute(){\n return strtoupper($this->name). ' '.strtoupper($this->last_name) ;\n }", "public function updated($propertyName)\n {\n $this->validateOnly($propertyName, [\n 'temporary' => 'nullable|mimes:jpeg,png|max:4096',\n 'name' => 'required|string|max:200|unique:users,name, ' . $this->user->id,\n 'description' => 'required|string|max:500',\n\n 'nameUser' => 'required|string|max:200',\n 'firstLastname' => 'required|string|max:200',\n 'secondLastname' => 'required|string|max:200',\n 'phone' => 'required|numeric|unique:users,phone, ' . $this->user->id,\n 'email' => 'required|email|unique:users,email, ' . $this->user->id,\n 'corporative' => 'required|email|unique:users,corporative, ' . $this->user->id,\n\n 'birthday' => 'date|nullable',\n 'facebook' => 'string|max:200|nullable|unique:profiles,facebook, ' . $this->profile->id,\n 'instagram' => 'string|max:200|nullable|unique:profiles,instagram, ' . $this->profile->id,\n 'github' => 'string|max:200|nullable|unique:profiles,github, ' . $this->profile->id,\n 'website' => 'string|max:200|nullable|unique:profiles,website, ' . $this->profile->id,\n 'other' => 'string|max:200|nullable|unique:profiles,other, ' . $this->profile->id,\n\n 'status' => 'required',\n ]);\n }", "public function changeFirstName(string $firstName): void;", "public function update() {\n # Validate to make sure we have the required data.\n if (!isset($this->email)) {throw new Exception(\"Unable to update user details. An email address is required.\",PEAR_LOG_ERR);}\n if (!isset($this->first_name)) {throw new Exception(\"Unable to update user details. A first name is required.\",PEAR_LOG_ERR);}\n if (!isset($this->surname)) {throw new Exception(\"Unable to update user details. An surname is required.\",PEAR_LOG_ERR);}\n # Build the query that handles the users table\n $sql = \"UPDATE users SET \";\n $sql .= \"email='\".$this->email.\"'\";\n $sql .= \", first_name='\".$this->first_name.\"'\";\n $sql .= \", surname='\".$this->surname.\"'\";\n if (isset($this->description)) {$sql .= \", description='\".$this->description.\"'\";}\n if (isset($this->homepage)) {$sql .= \", homepage='\".remove_http($this->homepage).\"'\";}\n if (isset($this->default_scope)) {$sql .= \", default_scope='\".$this->default_scope.\"'\";}\n if (isset($this->web_hook_url_nugget_add)) {$sql .= \", web_hook_url_nugget_add='\".remove_http($this->web_hook_url_nugget_add).\"'\";}\n if (isset($this->web_hook_url_nugget_update)) {$sql .= \", web_hook_url_nugget_update='\".remove_http($this->web_hook_url_nugget_update).\"'\";}\n if (isset($this->web_hook_url_nugget_delete)) {$sql .= \", web_hook_url_nugget_delete='\".remove_http($this->web_hook_url_nugget_delete).\"'\";}\n $sql .= \", dt_last_mod=\".time().\" \";\n $sql .= \"WHERE id=\".$this->id;\n # Execute the query\n if (!$result = $this->db->query($sql)) {throw new Exception(\"Unable to update user: \".$this->db->error,PEAR_LOG_ERR);}\n return (true);\n }", "public function update()\n {\n $validatedValue = Request::validate([\n 'nickname' => ['required', 'string'],\n 'first_name' => ['nullable', 'string'],\n 'last_name' => ['nullable', 'string'],\n 'email' => ['required', 'email:rfc', function ($attribute, $value, $fail) {\n\n $hasBeenUsed = User::where([\n [$attribute, '=', $value],\n ['id', '!=', Auth::guard('web')->user()->id]\n ])\n ->exists();\n\n //驗證信箱是否已被使用\n if ($hasBeenUsed) {\n\n $fail(sprintf('%s已被使用', $attribute));\n\n }\n\n\n }],\n 'phone_number' => ['nullable', 'regex:/^09[0-9]{8}$/'],\n 'city' => ['nullable', 'string', Rule::in(array_keys(Config::get('custom.city_list')))],\n 'district' => ['nullable', 'string', Rule::requiredIf(function () {\n\n $input = Request::get('city');\n\n $districts = Config::get('custom.city_list');\n\n return isset($districts[$input]);\n\n })],\n 'address' => ['nullable', 'string', Rule::requiredIf(function () {\n\n $input = Request::get('city');\n\n return boolval($input);\n })],\n ]);\n\n $user = Auth::guard('web')->user();\n\n if ($user->update($validatedValue)) {\n\n return redirect(route('user.show'))->with('status', '更新成功');\n\n }\n\n }", "public function update_profile()\n\t{\n\t\t$us_fullname = $this->input->post('my_fullname');\n\t\t$us_email = $this->input->post('my_email');\n\t\t$us_password = \"123456\";\n\t\t//Load Model\n\t\t$this->load->model('Caidat/st_profile');\n\t\t//$this->model_name->method();\n\t\t//Call method model\n\t\t// if($this->st_profile->capnhat($us_fullname,$us_email, $us_password)){\n\t // \theader('Location: http://'.$_SERVER['HTTP_HOST'].'/profile');\n\t\t//\texit;\t \n\t // }else{\n\t // \t$noti = 'error';\n\t // }\n\t // echo $noti;\n\n\t}", "public function getfullNameAttribute(){\n return $this->firstName . ' '. $this->lastName;\n }", "public function saveFirstName() {\n\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE user \n\t\t\t\t\t\t\t\t\t\tSET first_name=:fname \n\t\t\t\t\t\t\t\t\t\tWHERE id=:id\");\n\n\t\t\t$stmt->bindValue(':id', $this->id);\n\t\t\t$stmt->bindValue(':fname', $this->first_name);\n\t\t\t\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t\tcatch (Exception $e) {\n\t\t\t$this->log->logError($e);\n\t\t\treturn false;\n\t }\n\t}", "function locationupdate() {\n if ($this->session->userdata('role') == 2) {\n redirect('/');\n }\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->load->library('form_validation');\n\n $compid = $this->input->post('compid');\n $this->form_validation->set_rules('location', 'Location Name', 'trim|required|xss_clean');\n\n\n if ($this->form_validation->run() == FALSE) {\n $this->editlocation($compid);\n } else {\n $location = ucwords(strtolower($this->input->post('location')));\n \n // $userInfo = array();\n $compInfo = array('lname' => $location, 'updatedDtm' => date('Y-m-d H:i:s'));\n\n $result = $this->Locations_model->editLocation($compInfo, $compid);\n\n if ($result == true) {\n $this->session->set_flashdata('success', 'Company updated successfully');\n } else {\n $this->session->set_flashdata('error', 'Company updation failed');\n }\n\n redirect('locationListing');\n }\n }\n }", "public function setLastName($lastName);", "function process_update_user($handle, $name_user, $last_name_user1, $last_name_user2, $address_user, $phone_user, $id_user, $email_user, $level_user, $branch, $us)\n{ \n\t// verificamos si cambio el nombre de usuario\n\t$result = $handle->query(\"SELECT * FROM users WHERE user_name='$us' AND dni='$id_user'\");\n\tif($result->num_rows > 0){\n\t// significa que no cambio el nombre de usuario\n\t\t\t\t\t\t\t// verifiacmo si cambio el email\n\t\t\t\t\t\t\t$result=$handle->query(\"SELECT * FROM users WHERE dni='$id_user' AND email='$email_user'\");\t\n\t\t\t\t\t\t\tif($result->num_rows > 0){\n\t\t\t\t\t\t\t// significa que no cambio el email\n\t\t\t\t\t\t\t//** Actualizamos los datos menos user_name ni email\n\t\t\t\t\t\t\t$handle->query(\"UPDATE users SET name_user='$name_user',name_user1='$last_name_user1',name_user2='$last_name_user2',address_user='$address_user',phone_user='$phone_user',id_location='$branch',level='$level_user' \".\n\t\t\t\t\t\t\t\"WHERE dni='$id_user'\");\n\t\t\t\t\t\t\t$result->free();\n\t\t\t\t\t\t\tok_update_user_selected();\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t// significa que cambio el email\n\t\t\t\t\t\t\t// verificamos su disponibilidad\n\t\t\t\t\t\t\tcheck_free_mail_user($handle, $email_user);\t\n\t\t\t\t\t\t\t//** Actualizamos email menos el user_name\n\t\t\t\t\t\t\t$handle->query(\"UPDATE users SET name_user='$name_user',name_user1='$last_name_user1',name_user2='$last_name_user2',address_user='$address_user',\".\n\t\t\t\t\t\t\t\"phone_user='$phone_user',email='$email_user',id_location='$branch',level='$level_user' \".\n\t\t\t\t\t\t\t\"WHERE dni='$id_user'\");\n\t\t\t\t\t\t\tok_update_user_selected();\n\t\t\t\t\t\t\t}\n\t}\n\telse{\n\t// significa que cambio el nombre de usuario\t\n\t\t\t\t\t\t\t// verificamos si cambio el email\n\t\t\t\t\t\t\t$result=$handle->query(\"SELECT * FROM users WHERE dni='$id_user' AND email='$email_user'\");\n\t\t\t\t\t\t\tif($result->num_rows > 0){\n\t\t\t\t\t\t\t// significa que no cambio el mail\n\t\t\t\t\t\t\t// verificamos la disponibilidad del usuario\n\t\t\t\t\t\t\tcheck_free_user($handle, $us);\n\t\t\t\t\t\t\t//** Actualizamos los datos menos el email\t\n\t\t\t\t\t\t\t$handle->query(\"UPDATE users SET name_user='$name_user',name_user1='$last_name_user1',name_user2='$last_name_user2',address_user='$address_user',\".\n\t\t\t\t\t\t\t\"phone_user='$phone_user',id_location='$branch',level='$level_user' \".\n\t\t\t\t\t\t\t\"WHERE dni='$id_user'\");\n\t\t\t\t\t\t\t$result->free();\n\t\t\t\t\t\t\tok_update_user_selected();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t// significa que cambio el mail y el usuario\t\n\t\t\t\t\t\t\t// verificamos la disponibilidad de ambos\n\t\t\t\t\t\t\t// verificamos la disponibilidad del usuario\n\t\t\t\t\t\t\tcheck_free_user($handle, $us);\n\t\t\t\t\t\t\t// verificamos su disponibilidad\n\t\t\t\t\t\t\tcheck_free_mail_user($handle, $email_user);\n\t\t\t\t\t\t\t//** Actualizamos todos los datos\n\t\t\t\t\t\t\t$handle->query(\"UPDATE users SET user_name='$us',name_user='$name_user',name_user1='$last_name_user1',name_user2='$last_name_user2',address_user='$address_user',\".\n\t\t\t\t\t\t\t\"phone_user='$phone_user',email='$email_user',id_location='$branch',level='$level_user'\".\n\t\t\t\t\t\t\t\"WHERE dni='$id_user'\");\t\n\t\t\t\t\t\t\tok_update_user_selected();\t\n\t\t\t\t\t\t\t}\n\t}\n}", "public function updateProfile(Request $request){\n $request_data = $request->All();\n $current_password = $request_data['current_password'];\n $password = $request_data['password'];\n $password_confirmation = $request_data['password_confirmation'];\n $fullname = $request_data['fullname'];\n\n if($fullname){\n $this->updateName($fullname);\n $fullnameMessage = 'Profile updated!';\n }\n else{\n $message = 'Nothing to update!';\n $this->Notifier($message);\n }\n\n if($current_password || $password || $password_confirmation){\n $this->updatePassword($current_password, $password, $password_confirmation);\n }\n else{\n $message = 'Nothing to update!';\n $message = $fullnameMessage;\n $this->Notifier($message);\n }\n return $this->Notifier($message);\n }", "public function validation_update() {\n\n$this->load->library('form_validation');\n$this->form_validation->set_rules(\"fname\", \"First Name\", \"required|trim\");\n$this->form_validation->set_rules(\"lname\", \"Last Name\", \"required|trim\");\n$this->form_validation->set_rules(\"emp_no\", \"Employee Number\", \"required|numeric|trim|is_unique|exact_length[6]\");\n\nif ($this->form_validation->run() == FALSE) {\n\n$this->load->view(\"site_header\");\n$this->load->view(\"site_nav\");\n$this->load->view(\"updateemployee\");\n$this->load->view(\"site_footer\");\n\n} else {\n\n$this->load->model(\"get_db\");\n\n$newRow = array(array(\n\"first_name\"=> $this->input->post('fname'), \n'last_name'=> $this->input->post('lname'),\n'emp_no'=> $this->input->post('emp_no'), \n));\n\n$this->get_db->update2($newRow);\n\n$this->load->view(\"site_header\");\n$this->load->view(\"site_nav\");\n$this->load->view(\"updateemployee\");\n$this->load->view(\"site_footer\");\necho \"Updated!\"; \n\n} \n\n}", "public function updateProfile(){\n $this->validate([\n 'first_name'=>'required',\n 'surname'=>'required',\n 'mobile'=>'required',\n 'position'=>'required',\n 'hire_date'=>'required',\n 'confirm_date'=>'required',\n 'birth_date'=>'required',\n 'department'=>'required',\n 'address'=>'required',\n 'email'=>'required|email'\n ]);\n $user = User::find(Auth::user()->id);\n $user->first_name = $this->first_name;\n $user->surname = $this->surname;\n $user->mobile = $this->mobile;\n $user->position = $this->position;\n $user->hire_date = $this->hire_date;\n $user->confirm_date = $this->confirm_date;\n $user->department_id = $this->department;\n $user->address = $this->address;\n $user->email = $this->email;\n $user->gender = $this->gender;\n $user->save();\n session()->flash(\"profile_update\", \"<strong>Success!</strong> Changes saved.\");\n $this->setProperties();\n }", "function learn_press_update_user_profile_basic_information() {\n\t$user_id = learn_press_get_current_user_id();\n\t$update_data = array(\n\t\t'ID' => $user_id,\n\t\t'first_name' => filter_input( INPUT_POST, 'first_name', FILTER_SANITIZE_STRING ),\n\t\t'last_name' => filter_input( INPUT_POST, 'last_name', FILTER_SANITIZE_STRING ),\n\t\t'display_name' => filter_input( INPUT_POST, 'display_name', FILTER_SANITIZE_STRING ),\n\t\t'nickname' => filter_input( INPUT_POST, 'nickname', FILTER_SANITIZE_STRING ),\n\t\t'description' => filter_input( INPUT_POST, 'description', FILTER_SANITIZE_STRING ),\n\t);\n\t$res = wp_update_user( $update_data );\n\tif ( $res ) {\n\t\t$message = __( 'Your change is saved', 'learnpress' );\n\t} else {\n\t\t$message = __( 'Error on update your profile info', 'learnpress' );\n\t}\n\t$current_url = learn_press_get_current_url();\n\tlearn_press_add_message( $message );\n\twp_redirect( $current_url );\n\texit();\n}", "public function post_update_user() {\n\t\t$all\t\t= Input::all();\n\t\t$password\t= Input::get('password');\n\t\t$firstname\t= Input::get('firstname');\n\t\t$lastname\t= Input::get('lastname');\n\t\t$username\t= Input::get('username');\n\n\t\t// all fields required\n\t\t$rules = array(\n\t\t\t'password' => 'required',\n\t\t\t'firstname' => 'required',\n\t\t\t'lastname' => 'required',\n\t\t\t'username' => 'required',\n\t\t);\n\n\t\t$validation = Validator::make($all, $rules);\n\n\t\tif ($validation->fails()) {\n\t\t\treturn Response::json(Notification::get('form_required'));\n\t\t}\n\n\t\t// only alpha characters on names\n\t\t$rules = array(\n\t\t\t'firstname' => 'alpha',\n\t\t\t'lastname'\t=> 'alpha'\n\t\t);\n\n\t\t$validation = Validator::make($all, $rules);\n\n\t\tif ($validation->fails()) {\n\t\t\treturn Response::json(Notification::get('profile_names_alpha_only'));\n\t\t}\n\n\t\t// username must be alphanumeric with dashes\n\t\t$rules = array(\n\t\t\t'username' => 'alpha_dash',\n\t\t);\n\n\t\t$validation = Validator::make($all, $rules);\n\n\t\tif ($validation->fails()) {\n\t\t\treturn Response::json(Notification::get('profile_user_invalid'));\n\t\t}\n\n\t\t// password mismatch\n\t\t$user = User::find(Session::get('id'));\n\t\tif (!Hash::check($password, $user->password)) {\n\t\t\treturn Response::json(Notification::get('form_password_invalid'));\n\t\t}\n\n\t\t// user exists\n\t\t// @TODO: this can be methodized\n\t\t$user = User::where_username($username)->first();\n\n\t\tif (!empty($user)) {\n\t\t\treturn Response::json(Notification::get('form_user_exists'));\n\t\t}\n\n\t\t// all good, update\n\t\t$user = User::find(Session::get('id'));\n\t\t$user->username\t= $username;\n\t\t$user->firstname\t= $firstname;\n\t\t$user->lastname\t= $lastname;\n\t\t$user->save();\n\n\t\treturn Response::json(Notification::get('profile_updated'));\n\t}", "function _update()\n\t{\n\t\t$query = '';\n\t\t$valueArray = array();\n\t\tif($this->_record_exists)\n\t\t{\n\t\t\t//update\n\t\t\t$query = \"update Webmaster set firstname=?,lastname=?,ssn_taxid=?,street_address=?,postal_code=?,city=?,state=?,country=?,email=?,referred_webmaster_id=?,aim=?,icq=?,company=?,pay_to=?,payment_method=?,minimum_payout=?,notes=?,referral_percent=?,total_signups=?,udf1=?,skype=?,phone=?,referral_amount=? where id=?\";\n\t\t\t$valueArray = array($this->getFirstname(),$this->getLastname(),$this->getSsnTaxid(),$this->getStreetAddress(),$this->getPostalCode(),$this->getCity(),$this->getState(),$this->getCountry(),$this->getEmail(),$this->getReferredWebmasterId(),$this->getAim(), $this->getIcq(), $this->getCompany(), $this->getPayTo(),$this->getPaymentMethod(),$this->getMinimumPayout(),$this->getNotes(),$this->getReferralPercent(), $this->getTotalSignups(), $this->getUdf1(), $this->getSkype(), $this->getPhone(), $this->getReferralAmount(), $this->getId());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//insert\n\t\t\tif($this->getId() == '')\n\t\t\t\t$this->setId($this->_generateNextId());\n\n\t\t\t$query = \"insert into Webmaster (id,firstname,lastname,ssn_taxid,street_address,postal_code,city,state,country,email,referred_webmaster_id,aim,icq,company,pay_to,payment_method,minimum_payout,notes,referral_percent,total_signups,udf1,skype,phone,referral_amount) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\t\t\t$valueArray = array($this->getId(),$this->getFirstname(),$this->getLastname(),$this->getSsnTaxid(),$this->getStreetAddress(),$this->getPostalCode(),$this->getCity(),$this->getState(),$this->getCountry(),$this->getEmail(),$this->getReferredWebmasterId(),$this->getAim(), $this->getIcq(), $this->getCompany(), $this->getPayTo(), $this->getPaymentMethod(), $this->getMinimumPayout(), $this->getNotes(), $this->getReferralPercent(),$this->getTotalSignups(),$this->getUdf1(),$this->getSkype(),$this->getPhone(),$this->getReferralAmount());\n\t\t}\n\t\t$sth = $this->db->prepare($query);\n\t\t$res = $this->db->execute($sth, $valueArray);\n\t\tif(DB::isError($res))\n\t\t{\n\t\t\tprint_r($res);\n\t\t\ttrigger_error($res->getmessage(), E_USER_ERROR);\n\t\t}\n\t\t$this->_modified = false;\n\t\t$this->_record_exists = true;\n\t}", "function updateProfile($name, $phone, $email, $username, $adminid) {\n $query = \"UPDATE `admin_account` SET fullname = ?,mobileno = ?,email = ?,username = ? WHERE adminid = ?\";\n $paramType = \"ssssi\";\n $paramValue = array(\n ucwords($name),\n $phone,\n $email,\n $username,\n $adminid\n );\n \n $this->db_handle->update($query, $paramType, $paramValue);\n }", "function set_last_name($last_name) {\n $this->last_name = $last_name;\n }", "public function save() \n\t{\n\t\t// Not a valid user\n\t\tif ($this->id == null)\n\t\t\treturn false;\t\t\n\n\t\t$slug = User::slugify($this->first_name . \" \" . $this->last_name);\n\n\t\tif ($this->slug != $slug) {\n\n\t\t\tif(User::verify_slug($slug)) {\n\t\t\t\t$counter = 1;\n\t\t\t\t$original_slug = $slug;\n\t\t\t\t$slug = $original_slug . '-' . $counter;\n\t\t\t\twhile(User::verify_slug($slug)) {\n\t\t\t\t\t$counter++;\n\t\t\t\t\t$slug = $original_slug . '-' . $counter;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t$stmt = $GLOBALS['db']->prepare(\"UPDATE user \n\t\t\t\t\t\t\t\t\t\t\tSET first_name=:first_name,\n\t\t\t\t\t\t\t\t\t\t\t\tlast_name=:last_name,\n\t\t\t\t\t\t\t\t\t\t\t\tslug=:slug,\n\t\t\t\t\t\t\t\t\t\t\t\temail=:email \n\t\t\t\t\t\t\t\t\t\t\tWHERE id=:id\");\n\t\t \n\t\t\t$stmt->bindValue(':first_name', $this->first_name);\n\t\t\t$stmt->bindValue(':last_name', $this->last_name); \n\t\t\t$stmt->bindValue(':slug', $slug);\n\t\t\t$stmt->bindValue(':email', $this->email); \n\t\t\t$stmt->bindValue(':id', $this->id);\n\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t} catch (Exception $e) {\n\t\t\t$this->log->logError($e);\n\t\t\treturn false;\n\t\t}\t\t\t\n\t}", "public function getFullNameAttribute()\n {\n return \"{$this->first_name} {$this->last_name}\";\n }", "public function setFullName($full_name)\n\t{\n\t\t$this->full_name = ky_assure_string($full_name);\n\t\treturn $this;\n\t}", "private function validate_update_form($data_array) {\n \n // Validate Name\n if(empty($data_array['name'])) {\n $data_array['name_err'] = 'Please enter your name';\n }\n\n // Validate Email\n if(empty($data_array['email'])) {\n $data_array['email_err'] = 'Please enter your email';\n } else {\n // checking if email does exist\n if ($this->userModel->check_not_self_user_existance_from_email($data_array['email'], $_SESSION['user_id'])) {\n $data_array['email_err'] = 'Email is already taken';\n }\n }\n\n // Validate mobile\n if(empty($data_array['mobile'])) {\n $data_array['mobile_err'] = 'Please enter your mobile no.';\n }\n\n // Validate emergency contact\n if(empty($data_array['emergency_contact'])) {\n $data_array['emergency_contact_err'] = 'Please enter your emergency contact';\n }\n\n // Validate blood group\n if(empty($data_array['blood_group'])) {\n $data_array['blood_group_err'] = 'Please enter your blood group';\n }\n\n // Making sure errors are empty\n if(empty($data_array['email_err']) && empty($data_array['name_err']) && empty($data_array['mobile_err']) && empty($data_array['emergency_contact_err']) && empty($data_array['blood_group_err'])) {\n // Validated\n // save\n if ($this->userModel->update_personal_data($data_array)) {\n flash('personal_data_update', 'Updated successfully.. 😍');\n redirect('users/details/' . $_SESSION['user_id']);\n } else {\n die('Could not be registered!');\n }\n \n } else {\n // Not validated\n // Load with error\n $this->view_path('update_form', $data_array);\n }\n\n }", "private function _validate_update_account_form() {\n\n\t\t$this->form_validation->set_rules('userFirstName', 'UserFirstName', 'required|max_length[64]|xss_clean');\n\t\t$this->form_validation->set_rules('userSecondName', 'UserSecondName', 'max_length[64]|xss_clean');\n\t\t$this->form_validation->set_rules('userAddressLine1', 'UserAddressLine1', 'max_length[64]|xss_clean');\n\t\t$this->form_validation->set_rules('userNeighborhood', 'UserNeighborhood', 'max_length[64]|xss_clean');\n\t\t$this->form_validation->set_rules('userLastName', 'UserLastName', 'max_length[64]|xss_clean');\n\t\t$this->form_validation->set_rules('userSurname', 'UserSurname', 'max_length[64]|xss_clean');\n\t\t$this->form_validation->set_rules('userEmail', 'UserEmail', 'required|max_length[64]|xss_clean');\n\t\t$this->form_validation->set_rules('userId', 'UserEmail', 'max_length[64]|xss_clean');\n\t\t$this->form_validation->set_rules('userGender', 'UserGender', 'trim|xss_clean');\n\n\t\tif ($this->form_validation->run() == FALSE)\n\t\t\treturn false;\n\n\t\treturn true;\n\n\t}", "public function update_teacher_info($up_fullname,$up_address,$up_email,$up_father,$up_mother,$up_dob,$up_qualification,$up_contact,$up_staff,$up_gender,$teacher_id)\n\t{\n\t\t$update_teacher_info_select = \"update teacher_info set t_fullname='$up_fullname',t_address='$up_address',t_email='$up_email',t_father='$up_father',t_mother='$up_mother',t_dob='$up_dob',t_qualification='$up_qualification',t_contact='$up_contact',t_staff_type='$up_staff',t_gender='$up_gender' where t_id='$teacher_id'\";\n\t\t$update_teacher_info_run = $this->connectdb->query($update_teacher_info_select);\n\t\treturn $update_teacher_info_run;\n\t}", "function initial_check($initial, $firstname, $lastname, $display_name, $firstnameERR, $lastnameERR, $error_variable_name){\n\n //check if the variable has not been already confirmed empty\n if ($GLOBALS[\"$error_variable_name\"] == \"\" && $GLOBALS[\"$firstnameERR\"] == \"\" && $GLOBALS[\"$lastnameERR\"] == \"\"){\n \n //length of the initial\n $initial_length = strlen($initial);\n \n //strip any dots in the initial\n for ($i = 0; $i < $initial_length; $i++){\n if ($initial[$i] == \".\"){\n $initial = substr_replace($initial, \"\", $i, 1);\n $i--;\n\n }\n\n }\n \n \n //convert the initials and the name to all capitals\n $initial = strtoupper($initial);\n \n $firstname = strtoupper($firstname);\n \n $lastname = strtoupper($lastname);\n \n //get the first letters from the firstname and lastname and the initial\n $firstname = substr($firstname,0,1);\n $lastname = substr($lastname,0,1);\n \n $initial_firstname = substr($initial,0,1);\n $initial_lastname = substr($initial,1,1);\n \n //compare if the initial matches the first letters of the firstname and lastname\n if ($firstname != $initial_firstname || $lastname != $initial_lastname){\n $GLOBALS[\"$error_variable_name\"] = $display_name . \" does not match the firstname and lastname\";\n }\n \n \n \n }\n}", "function fullName(){\n return $this->firstName .' '. $this->lastName;\n }", "public static function edit_student_profile($email, $firstname, $lasttname, $religion, $gender, $schoolid, $birthplace, $fatherbirthplace, $motherbirthplace, $fatherfatherbirthplace, $fathermotherbirthplace, $motherfatherbirthplace, $mothermotherbirthplace)\n {\n $result_teacher = data::update(\"`student`\", \"`schoolid`='$schoolid',`firstname`='$firstname',`lastname`='$lasttname', `religion`='$religion', `gender`='$gender'\", \"`studentemailid`='$email'\");\n //this line just added to check the transaction result and in case of error return false\n if (strpos($result_teacher, 'rror') !== false) {\n return false;\n }\n //the parameter $result_birth added to check whether the transaction is successful or failure\n $result_birth = data::update(\"`studentbirthdetails`\", \"`birthplace`='$birthplace', `fatherbirthplace`='$fatherbirthplace', `motherbirthplace`='$motherbirthplace', `fatherfatherbirthplace`='$fatherfatherbirthplace', `fathermotherbirthplace`='$fathermotherbirthplace', `motherfatherbirthplace`='$motherfatherbirthplace', `mothermotherbirthplace`='$mothermotherbirthplace'\", \"`studentemailid`='$email'\");\n //this line just added to check the transaction result and in case of error return false\n if (strpos($result_birth, 'rror') !== false) {\n return false;\n }\n }", "function update()\n\t{\n\t\tif (!$this->tank_auth->is_logged_in()) \n\t\t{\t\t\t\t\t\t\t\t\t// logged in\n\t\t\tredirect('/auth/login/');\n\t\t} \n\t\telseif ($this->tank_auth->is_logged_in(FALSE)) \n\t\t{\t\t\t\t\t\t// logged in, not activated\n\t\t\tredirect('/auth/send_again/');\n\t\t}\n\t\t\n\t\t$stored_profile = $this->Profiles_model->get_by_user($this->tank_auth->get_user_id());\n\t\t$stored_profile = $stored_profile->result_array();\n\t\t$data = $stored_profile['0'];\n\t\t\n\t\t//establish form validation rules\n\t\t$this->form_validation->set_rules('first_name','First Name','required|trim|xss_clean|max_length[50]');\t\t\t\n\t\t$this->form_validation->set_rules('last_name','Last Name','required|trim|xss_clean|max_length[50]');\n\t\t$this->form_validation->set_rules('date_of_birth','Date of Birth','required|trim|xss_clean|max_length[255]');\t\t\t\t\t\n\t\t$this->form_validation->set_rules('secondary_email','Secondary Email','trim|xss_clean|valid_email|max_length[255]');\t\t\t\n\t\t$this->form_validation->set_rules('is_student','Is Student?','required|xss_clean|max_length[11]');\t\t\t\n\t\t//$this->form_validation->set_rules('carpool','Carpool?','required|max_length[11]');\t\t\t\n\t\t$this->form_validation->set_rules('primary_phone','Primary Phone','required|trim|xss_clean|is_numeric|max_length[20]');\t\t\t\n\t\t$this->form_validation->set_rules('secondary_phone','Secondary Phone','xss_clean|is_numeric|max_length[20]');\t\n\t\t\n\t\t$this->form_validation->set_rules('submit_button', 'Submit', '');\n\t\t\t\n\t\t$this->form_validation->set_error_delimiters('<br /><span style=\"color: red;\">', '</span>');\n\t\n\t\tif ($this->form_validation->run() == FALSE) // validation hasn'\\t been passed\n\t\t{\n\t\t\t$data['view']['do'] = '';\n\t\t\t$this->template->load('template', 'profiles/update_form', $data);\n\t\t}\n\t\telse // passed validation proceed to post success logic\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t$profile_data = array(\n\t\t\t\t\t \t'first_name' => set_value('first_name'),\n\t\t\t\t\t \t'last_name' => set_value('last_name'),\n\t\t\t\t\t\t\t'date_of_birth' => set_value('date_of_birth'),\n\t\t\t\t\t \t'is_student' => set_value('is_student'),\n\t\t\t\t\t \t'carpool' => set_value('carpool'),\n\t\t\t\t\t \t'primary_phone' => set_value('primary_phone')\n\t\t\t\t\t\t);\n\t\t\t$sec_mail = set_value('secondary_email');\n\t\t\tif(!empty($sec_mail))\n\t\t\t\t$profile_data['secondary_email'] = set_value('secondary_email');\n\t\t\t$sec_phone = set_value('secondary_phone');\t\n\t\t\tif(!empty($sec_phone))\n\t\t\t\t$profile_data['secondary_phone'] = set_value('secondary_phone');\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t// run insert model to write data to db, but first send emails for account info/activation\n\t\t\n\t\t\t$write_status = $this->Profiles_model->update($this->tank_auth->get_user_id(), $profile_data);\n\t\t\t\n\t\t\tif ($write_status == TRUE) // the information has therefore been successfully saved in the db\n\t\t\t{\n\t\t\t\t$this->session->set_flashdata('notice', '<div class=\"success\">The profile was updated successfully</div>');\n\t\t\t\tredirect('account'); \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->session->set_flashdata('notice', '<div class=\"error\">Something went horribly wrong, and the profile could not be saved.</div>');\n\t\t\t\tredirect('account');\n\t\t\t}\n\t\t}\n\t}", "public function update()\n\t{\n\t\t$data = array('first_name' => $_POST['first_name'], 'last_name'=> $_POST['last_name'],'email'=>$_POST['email'],'password'=>md5(sha1($_POST['password'])), 'uID'=>$_POST['uID']);\n\n\t\t$this->userObject = new User();\n\t\t$response = $this->userObject->update($data);\n\t\t$this->set('first_name',$data['first_name']);\n\t\t$this->set('last_name',$data['last_name']);\n\t\t$this->set('email',$data['email']);\n\t\t$this->set('uID',$data['uID']);\n\t\t$this->set('password', $data['password']);\n\t\t$this->set('message', $response);\n\t\t$this->set('task','update');\n\t}", "public function fullname(\n $value,\n $vardef,\n &$focus\n )\n {\n if ( property_exists($focus,'first_name') && property_exists($focus,'last_name') ) {\n $name_arr = preg_split('/\\s+/',$value);\n \n if ( count($name_arr) == 1) {\n $focus->last_name = $value;\n }\n else {\n // figure out what comes first, the last name or first name\n if ( strpos($this->default_locale_name_format,'l') > strpos($this->default_locale_name_format,'f') ) {\n $focus->first_name = array_shift($name_arr);\n $focus->last_name = join(' ',$name_arr);\n }\n else {\n $focus->last_name = array_shift($name_arr);\n $focus->first_name = join(' ',$name_arr);\n }\n }\n }\n }", "public function testUpdateUserName()\n {\n $user = User::find(1);\n $user -> name = 'Steve Smith';\n $this->assertTrue($user -> save());\n $this->assertTrue($user -> name == 'Steve Smith');\n }", "function html_updateprofile(){\n global $lang;\n global $conf;\n global $ID;\n global $INFO;\n global $auth;\n\n print p_locale_xhtml('updateprofile');\n\n if (empty($_POST['fullname'])) $_POST['fullname'] = $INFO['userinfo']['name'];\n if (empty($_POST['email'])) $_POST['email'] = $INFO['userinfo']['mail'];\n?>\n <div class=\"centeralign\">\n <form id=\"dw__register\" method=\"post\" action=\"<?php echo wl($ID)?>\" accept-charset=\"<?php echo $lang['encoding']?>\">\n <fieldset style=\"width: 80%;\">\n <input type=\"hidden\" name=\"do\" value=\"profile\" />\n <input type=\"hidden\" name=\"save\" value=\"1\" />\n\n <legend><?php echo $lang['profile']?></legend>\n <label class=\"block\">\n <?php echo $lang['user']?>\n <input type=\"text\" name=\"fullname\" disabled=\"disabled\" class=\"edit\" size=\"50\" value=\"<?php echo formText($_SERVER['REMOTE_USER'])?>\" />\n </label><br />\n <label class=\"block\">\n <?php echo $lang['fullname']?>\n <input type=\"text\" name=\"fullname\" <?php if(!$auth->canDo('modName')) echo 'disabled=\"disabled\"'?> class=\"edit\" size=\"50\" value=\"<?php echo formText($_POST['fullname'])?>\" />\n </label><br />\n <label class=\"block\">\n <?php echo $lang['email']?>\n <input type=\"text\" name=\"email\" <?php if(!$auth->canDo('modName')) echo 'disabled=\"disabled\"'?> class=\"edit\" size=\"50\" value=\"<?php echo formText($_POST['email'])?>\" />\n </label><br /><br />\n\n <?php if($auth->canDo('modPass')) { ?>\n <label class=\"block\">\n <?php echo $lang['newpass']?>\n <input type=\"password\" name=\"newpass\" class=\"edit\" size=\"50\" />\n </label><br />\n <label class=\"block\">\n <?php echo $lang['passchk']?>\n <input type=\"password\" name=\"passchk\" class=\"edit\" size=\"50\" />\n </label><br />\n <?php } ?>\n\n <?php if ($conf['profileconfirm']) { ?>\n <br />\n <label class=\"block\">\n <?php echo $lang['oldpass']?>\n <input type=\"password\" name=\"oldpass\" class=\"edit\" size=\"50\" />\n </label><br />\n <?php } ?>\n\n <input type=\"submit\" class=\"button\" value=\"<?php echo $lang['btn_save']?>\" />\n <input type=\"reset\" class=\"button\" value=\"<?php echo $lang['btn_reset']?>\" />\n </fieldset>\n </form>\n </div>\n<?php\n}", "public function editLetterName()\n\t{\n\t\t$rules = array(\n\t\t\t'rname' => 'required',\n\t\t\n\t\t);\n\n\t\t// Create a new validator instance from our validation rules\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// If validation fails, we'll exit the operation now.\n\t\tif ($validator->fails())\n\t\t{\n\t\t\t$data['status'] = 'error';\n\t\t\t$data['errors'] = $validator->messages()->toArray();\n\t\t}\n\t\telse{\n\t\t\t$form_id = Input::get('form_id');\n\t\t\t$form = Forms::where('id',$form_id)->first();\n\t\t\t$form->name = Input::get('rname');\n\t\t\t\n\t\t\tif($form->save())\n\t\t\t{\n \t$data['status'] = 'success';\n\t\t \t}\n\t\t \telse\n\t\t \t{ \n\t\t \t $data['status'] = 'error';\t\n\t\t \t}\n\n\t\t}\n\n\t\treturn Response::json($data);\n\n\t}", "public function updateUser($id, $f_name, $l_name, $address, $email, $password,$user_level,$user_state) { \r\n\t\t$error = false;\r\n\t\t$fnameError = $emailError = $passError = '';\r\n\t\t\r\n\t\t// name validation\r\n\t\tif (empty($f_name) || empty($l_name)) {\r\n\t\t\t$error = true;\r\n\t\t\t$fnameError = \"Please enter full name and surname\"; \r\n\t\t\t\r\n\t\t} else if (strlen($f_name) < 3 || strlen($l_name) < 3) {\r\n\t\t\t$error = true;\r\n\t\t\t$fnameError = \"Name and surname must have at least 3 characters.\"; \r\n\t\t\t\r\n\t\t} else if (!preg_match(\"/^[a-zA-Z]+$/\", $f_name) || !preg_match(\"/^[a-zA-Z]+$/\", $l_name)) {\r\n\t\t\t$error = true;\r\n\t\t\t$fnameError = \"Name and surname must contain only letters and no spaces.\"; \r\n\t\t\t\r\n\t\t}\r\n\t \r\n\t\t// email validation if updated\r\n\t\tif (strlen($email) > 0) {\r\n\t\t\tif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n\t\t\t\t$error = true;\r\n\t\t\t\t$emailError = \"Please enter a valid email address.\"; \r\n\t\t\t } else {\r\n\t\t\t\t$query = \"SELECT * FROM user WHERE email = '\".$email.\"'\";\r\n\t\t\t\t$result = $this->db->select($query);\r\n\t\t\t\tif($result){ \r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\t$emailError = \"Email is already in use.\";\r\n\t\t\t\t} \r\n\t\t\t\t\t}\r\n\t}\r\n\r\n\t// password validation if updated\r\n\t\tif (strlen($password) > 0) {\r\n\t\t\t\tif (strlen($password) < 6) {\r\n\t\t\t$error = true;\r\n\t\t\t$passError = \"Password must have at least 6 characters.\"; \r\n\t\t}\r\n\t}\r\n\t\r\n\t\t// if any error -> return error msgs\r\n\t\tif ($error == true) { \r\n\t\t\t$errors['fnameError'] = $fnameError;\r\n\t\t\t$errors['emailError'] = $emailError;\r\n\t\t\t$errors['passError'] = $passError;\r\n\t\t\treturn $errors; \r\n\t\t} // no error -> register account\r\n\t\telse if ($error == false) { \r\n\t\t\t$query = \"UPDATE user SET f_name = '$f_name', l_name = '$l_name', address = '$address',user_level = $user_level, user_state = $user_state WHERE id = {$id}\";\r\n\t\t\t\t\t$result = $this->db->update($query);\r\n\r\n\t\t\tif (strlen($email) > 0) { // if email updated\r\n\t\t\t\t\t$query = \"UPDATE user SET email = '$email' WHERE id = {$id}\";\r\n\t\t\t\t\t$result = $this->db->update($query);\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tif (strlen($password) > 0) { // if password updated\r\n\t\t\t\t$pass = hash('sha256', $password);\r\n\t\t\t\t$query = \"UPDATE user SET password = '$pass' WHERE id = {$id}\";\r\n\t\t\t\t$result = $this->db->update($query);\r\n\t\t} \r\n\t\t\r\n\t\t\tif ($result) {\r\n\t\t\t\t$msg = \"<div class='alert alert-success'>User edited successfully!</div>\";\r\n\t\t return $msg;\r\n\t }else{\r\n $msg = \"<div class='alert alert-danger'>Edit user failed! Please try again</div>\";\r\n\t\t return $msg;\t\t\t\r\n\t }\r\n\t\t} \r\n\t\t }", "function validate_edit_profile_form() {\n //$this->form_validation->set_rules('user_lastname', 'last name', 'required');\n //$this->form_validation->set_rules('user_gender', 'gender selection', 'required'); \n $this->form_validation->set_rules('user_phone1', 'personal mobile', 'required|trim|min_length[10]|max_length[10]|numeric');\n $this->form_validation->set_rules('user_phone2', 'office mobile', 'trim|min_length[10]|max_length[10]|numeric|differs[user_phone1]');\n $this->form_validation->set_rules('user_bio', 'about you', 'max_length[100]');\n $this->form_validation->set_rules('user_email', 'registered email (work)', 'required|valid_email');\n $this->form_validation->set_rules('user_email_secondary', 'personal email', 'required|valid_email|differs[user_email]');\n $this->form_validation->set_rules('user_blood_group', 'blood group', 'required');\n /* $this->form_validation->set_rules('dob_day', 'birth day selection', 'required');\n $this->form_validation->set_rules('dob_month', 'birth month selection', 'required');\n $this->form_validation->set_rules('dob_year', 'birth year selection', 'required'); */\n $this->form_validation->set_error_delimiters('<div class=\"validation-error\">', '</div>');\n if ($this->form_validation->run() == TRUE) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function getFullNameAttribute()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullNameAttribute()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function full_name()\n\t{\n\t\t//echo \"hiiii\".$this->first_name;\n\t\treturn $this->first_name.\" \".$this->last_name;\n\t}", "public function update_my_profile_via_edit($member_id,$data_arr,&$validation_passed,&$err_arr){\n\t\tglobal $g_mc;\n\t\trequire_once(\"classes/class.image_util.php\");\n\t\t$g_img = new image_util();\n\t\t\n\t\t$validation_passed = true;\n\t\t\n\t\tif($data_arr['f_name']==\"\"){\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['f_name'] = \"Please specify your first name\";\n\t\t}\n\t\tif($data_arr['l_name']==\"\"){\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['l_name'] = \"Please specify your last name\";\n\t\t}\n\t\t\n\t\tif(!$validation_passed){\n\t\t\treturn true;\n\t\t}\n\t\t///////////////////////////////\n\t\t\n\t\t/*************************\n\t\tnow update the record\n\t\t/************************************/\n\t\t$q = \"update \".TP.\"member set f_name='\".$g_mc->view_to_db($data_arr['f_name']).\"', l_name='\".$g_mc->view_to_db($data_arr['l_name']).\"' where mem_id='\".$member_id.\"'\";\n\t\t$result = mysql_query($q);\n\t\tif(!$result){\n\t\t\treturn false;\n\t\t}\n\t\t$validation_passed = true;\n\t\treturn true;\n\t}" ]
[ "0.7321212", "0.69352764", "0.647475", "0.6333956", "0.62197775", "0.61916363", "0.61793613", "0.61697733", "0.61685526", "0.6146746", "0.6127102", "0.60789156", "0.6043517", "0.60334504", "0.60313195", "0.60177815", "0.6011778", "0.5972092", "0.5949597", "0.5938902", "0.5916592", "0.5906301", "0.58876204", "0.5883125", "0.5876183", "0.5872108", "0.5872108", "0.5868857", "0.58559644", "0.5848065", "0.5836995", "0.5833572", "0.5831814", "0.5809829", "0.5807884", "0.58044124", "0.5802722", "0.5793962", "0.57936275", "0.5776668", "0.57760227", "0.5772909", "0.5765857", "0.5750362", "0.57397133", "0.5736399", "0.5736151", "0.57225376", "0.5722231", "0.57144725", "0.57004344", "0.5699201", "0.5679312", "0.56765324", "0.56691194", "0.5661318", "0.5660416", "0.5659843", "0.56547654", "0.56523454", "0.5652244", "0.564895", "0.5647064", "0.56422144", "0.56242704", "0.56203973", "0.5613934", "0.56137323", "0.56093955", "0.5608378", "0.5602094", "0.55915993", "0.55836684", "0.55834585", "0.5580824", "0.557573", "0.55639845", "0.55625015", "0.55620176", "0.55600315", "0.55523616", "0.5550334", "0.554588", "0.5544227", "0.55422324", "0.55379015", "0.5532444", "0.5527103", "0.5525865", "0.55216277", "0.5511022", "0.55097216", "0.5504218", "0.5503271", "0.5502205", "0.5501225", "0.5498387", "0.5498387", "0.54917794", "0.54915905" ]
0.70882136
1
update_stats insert_ip_history This inserts a row into the IP History recording this user at this address at this time in this place, doing this thing.. you get the point
update_stats insert_ip_history Это вставляет строку в историю IP, записывая этого пользователя по этому адресу в это время в этом месте, делая это действие. вы поняли, о чём я
public function insert_ip_history() { if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ $sip = $_SERVER['HTTP_X_FORWARDED_FOR']; debug_event('User Ip', 'Login from ip adress: ' . $sip,'3'); } else { $sip = $_SERVER['REMOTE_ADDR']; debug_event('User Ip', 'Login from ip adress: ' . $sip,'3'); } $ip = Dba::escape(inet_pton($sip)); $date = time(); $user = $this->id; $agent = Dba::escape($_SERVER['HTTP_USER_AGENT']); $sql = "INSERT INTO `ip_history` (`ip`,`user`,`date`,`agent`) VALUES ('$ip','$user','$date','$agent')"; $db_results = Dba::query($sql); /* Clean up old records... sometimes */ if (rand(1,100) > 60) { $date = time() - (86400*Config::get('user_ip_cardinality')); $sql = "DELETE FROM `ip_history` WHERE `date` < $date"; $db_results = Dba::query($sql); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function access_LogUser($user, $ip) {\n\treturn db_QueryInsert(\n\t\t\"INSERT INTO \".CMW_TABLE_USER_ACCESS.\" (\n\t\t\tuser, ip, first_timestamp, last_timestamp, total\n\t\t)\n\t\tVALUES ( \n\t\t\t?, \".(defined('CMW_USING_MARIADB')?\"INET6_ATON(?)\":\"INET_ATON(?)\").\", NOW(), NOW(), 1\n\t\t)\n\t\tON DUPLICATE KEY UPDATE\n\t\t\tlast_timestamp=NOW(),\n\t\t\ttotal=total+1\n\t\t;\",\n\t\t$user, $ip\n\t);\n}", "function updateActiveVisitors($ip)\n{\n $ip = (string) $ip;\n $past = time() - 25;\n $arr = array($past);\n // TESTED SQL VERSION [DELETE FROM active WHERE stamp < UNIX_TIMESTAMP() - 30;] \n\n\n Query(\"DELETE FROM active WHERE stamp < ?\", $arr);\n\n if (isset($_SESSION['id'])) {\n $innerArr = array($_SESSION['id']);\n if (countResults(\"SELECT * FROM active WHERE user_id = ?\", $innerArr) == 0) {\n $arr = array($_SESSION['id'], time(), $ip);\n Query(\"INSERT INTO active (user_id, stamp, ip) VALUES(?, ?, ?)\", $arr);\n }\n } else {\n $innerArr = array($ip);\n if (countResults(\"SELECT * FROM active WHERE ip = ?\", $innerArr) == 0) {\n $arr = array(-1, $ip, time());\n Query(\"INSERT INTO active (user_id, ip, stamp) VALUES(?, ?, ?)\", $arr);\n } //ip from share internet\n }\n}", "public static function update_350004() { \n\n\t\t$sql = \"ALTER TABLE `session` CHANGE `ip` `ip` VARBINARY( 255 ) NULL\"; \n\t\t$db_results = Dba::write($sql); \n\n\t\t$sql = \"ALTER TABLE `session_stream` CHANGE `ip` `ip` VARBINARY( 255 ) NULL\"; \n\t\t$db_results = Dba::write($sql); \n\n\t\t// Pull all of the IP history, this could take a while\n\t\t$sql = \"SELECT * FROM `ip_history`\"; \n\t\t$db_results = Dba::read($sql); \n\n\t\t$ip_history = array(); \n\n\t\twhile ($row = Dba::fetch_assoc($db_results)) { \n\t\t\t$row['ip'] = long2ip($row['ip']);\n\t\t\t$ip_history[] = $row; \n\t\t} \n\n\t\t// Clear the table before we make the changes\n\t\t$sql = \"TRUNCATE `ip_history`\"; \n\t\t$db_results = Dba::write($sql); \n\n\t\t$sql = \"ALTER TABLE `ip_history` CHANGE `ip` `ip` VARBINARY( 255 ) NULL\"; \n\t\t$db_results = Dba::write($sql); \n\t\t\n\t\t$sql = \"ALTER TABLE `ip_history` ADD `agent` VARCHAR ( 255 ) NULL AFTER `date`\"; \n\t\t$db_results = Dba::write($sql); \n\n\t\t// Reinsert the old rows\n\t\tforeach ($ip_history as $row) { \n\t\t\t$ip = Dba::escape(inet_pton($row['ip'])); \n\t\t\t$sql = \"INSERT INTO `ip_history` (`user`,`ip`,`date`,`agent`) \" . \n\t\t\t\t\"VALUES ('\" . $row['user'] . \"','\" . $ip . \"','\" . $row['date'] . \"',NULL)\"; \n\t\t\t$db_results = Dba::write($sql); \n\t\t} \n\t\n\t\t// First pull all of their current ACL's\n\t\t$sql = \"SELECT * FROM `access_list`\"; \n\t\t$db_results = Dba::read($sql); \n\n\t\t$acl_information = array(); \n\n\t\twhile ($row = Dba::fetch_assoc($db_results)) { \n\t\t\t$row['start'] = long2ip($row['start']);\n\t\t\t$row['end'] = long2ip($row['end']);\n\t\t\t$acl_information[] = $row; \n\t\t} \n\n\t\t$sql = \"TRUNCATE `access_list`\"; \n\t\t$db_results = Dba::write($sql); \n\n\t\t// Make the changes to the database\n\t\t$sql = \"ALTER TABLE `access_list` CHANGE `start` `start` VARBINARY( 255 ) NOT NULL\"; \n\t\t$db_results = Dba::write($sql); \n\n\t\t$sql = \"ALTER TABLE `access_list` CHANGE `end` `end` VARBINARY( 255 ) NOT NULL\"; \n\t\t$db_results = Dba::write($sql); \n\n\t\t$sql = \"ALTER TABLE `access_list` DROP `dns`\"; \t\n\t\t$db_results = Dba::write($sql); \n\n\t\t$sql = \"ALTER TABLE `access_list` ADD `enabled` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1' AFTER `key`\"; \n\t\t$db_results = Dba::write($sql); \n\n\t\t// If we had nothing in there before add some base ALLOW ALL stuff as we're going\n\t\t// to start defaulting Access Control to On. \n\t\tif (!count($acl_information)) { \n\t\t\t$v6_start = Dba::escape(inet_pton('::')); \n\t\t\t$v6_end = Dba::escape(inet_pton('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff')); \n\t\t\t$v4_start = Dba::escape(inet_pton('0.0.0.0')); \n\t\t\t$v4_end = Dba::escape(inet_pton('255.255.255.255')); \n\t\t\t$sql = \"INSERT INTO `access_list` (`name`,`level`,`start`,`end`,`key`,`user`,`type`,`enabled`) \" . \n\t\t\t\t\"VALUES ('DEFAULTv4','75','$v4_start','$v4_end',NULL,'-1','interface','1')\"; \n\t\t\t$db_results = Dba::write($sql); \n\t\t\t$sql = \"INSERT INTO `access_list` (`name`,`level`,`start`,`end`,`key`,`user`,`type`,`enabled`) \" . \n\t\t\t\t\"VALUES ('DEFAULTv4','75','$v4_start','$v4_end',NULL,'-1','stream','1')\"; \n\t\t\t$db_results = Dba::write($sql); \n\t\t\t$sql = \"INSERT INTO `access_list` (`name`,`level`,`start`,`end`,`key`,`user`,`type`,`enabled`) \" . \n\t\t\t\t\"VALUES ('DEFAULTv6','75','$v6_start','$v6_end',NULL,'-1','interface','1')\"; \n\t\t\t$db_results = Dba::write($sql); \n\t\t\t$sql = \"INSERT INTO `access_list` (`name`,`level`,`start`,`end`,`key`,`user`,`type`,`enabled`) \" . \n\t\t\t\t\"VALUES ('DEFAULTv6','75','$v6_start','$v6_end',NULL,'-1','stream','1')\"; \n\t\t\t$db_results = Dba::write($sql); \n\t\t} // Adding default information\n\n\t\tforeach ($acl_information as $row) { \n\t\t\tdebug_event('Crap',print_r($row,1),1); \n\t\t\t$row['start'] = Dba::escape(inet_pton($row['start'])); \n\t\t\t$row['end'] = Dba::escape(inet_pton($row['end'])); \n\t\t\t$row['key'] = Dba::escape($row['key']); \n\t\t\t$sql = \"INSERT INTO `access_list` (`name`,`level`,`start`,`end`,`key`,`user`,`type`,`enabled`) \" . \n\t\t\t\t\"VALUES ('\" . Dba::escape($row['name']) . \"','\" . intval($row['level']) . \n\t\t\t\t\"','\" . $row['start'] . \"','\" . $row['end'] . \"','\" . $row['key'] . \"','\" . intval($row['user']) . \"','\" . \n\t\t\t\t$row['type'] . \"','1')\"; \n\t\t\t$db_results = Dba::write($sql); \n\t\t} // end foreach of existing rows\n\t\t\n\t\tself::set_version('db_version','350004');\n\n\t\treturn true; \n\n\t}", "function insert_ip() {\n global $con;\n $ip = acquire_ip_details($_SERVER['REMOTE_ADDR']);\n\n //if address exists, just update hits.\n if (ip_exists($ip->ip, $ip->domain, $ip->agent)) {\n update_hits($ip->ip, $ip->domain, $ip->agent);\n } else {\n $query = \"\n INSERT INTO ip (ip, agent, domain, Hostname, City, Region, Country, \n CountryCode, Longitude, Latitude, DateCreated) VALUES \n (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP) \";\n\n try {\n $stmt = $con->prepare_statement($query);\n\n //checking if query well written\n if (!$stmt)\n throw new Exception();\n\n $stmt->bind_param(\"ssssssssdd\", $ip->ip, $ip->agent, $ip->domain, $ip->hostname, $ip->city, $ip->region, $ip->country, $ip->country_code, $ip->longitude, $ip->latitude);\n $stmt->execute();\n\n $stmt->close();\n } catch (Exception $x) {\n \n }\n }\n return $ip;\n}", "public function logIp() {\n\t\tif ($this->ip !== $this->getBrowserIp()) {\n\n\t\t\t/* See if this new IP has been used before on this account */\n\t\t\t$sth = $this->db->prepare('SELECT COUNT(*) FROM iplog WHERE ip = ? AND userid = ?');\n\t\t\t$sth->execute(array($this->getBrowserIp(), $this->getId()));\n\t\t\t$res = $sth->fetch();\n\t\t\t$count = $res[0];\n\n\t\t\tif ($count == 0) {\n\t\t\t\t$warningSignals = 0;\n\n\t\t\t\t/* Log the new IP */\n\t\t\t\t$host = gethostbyaddr($this->getBrowserIp());\n\t\t\t\t$sth = $this->db->prepare(\"INSERT INTO iplog(userid, ip, lastseen, host) VALUES (?, ?, NOW(), ?)\");\n\t\t\t\t$sth->execute(array($this->getId(), $this->getBrowserIp(), $host));\n\n\t\t\t\t/* Check if domain has changed to a \"strange\" country-code eg. hacked or sold account */\n\t\t\t\t$currentHost = gethostbyaddr($this->getIp());\n\t\t\t\tif (substr($host, -2) != substr($currentHost, -2)) {\n\t\t\t\t\t$bannedCountryCodes = \"za au ch fr ie ar mx hu tr it pl il jp ro nz sk fo sg cn ru uk rs de gr es vn pt hr\";\n\t\t\t\t\t$bannedCountryCodesArray = explode(\" \", $bannedCountryCodes);\n\t\t\t\t\tif (array_search(substr($currentHost, -2), $bannedCountryCodesArray) !== false) {\n\t\t\t\t\t\t$warningSignals++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Check if IP has been used to try to access a banned user account */\n\t\t\t\t$sth = $this->db->prepare(\"SELECT COUNT(*) FROM inlogg JOIN users ON inlogg.uid = users.id WHERE inlogg.ip = ? AND enabled = 'no'\");\n\t\t\t\t$sth->execute(array($this->getBrowserIp()));\n\t\t\t\t$res = $sth->fetch();\n\t\t\t\tif ($res[0]) {\n\t\t\t\t\t$warningSignals++;\n\t\t\t\t}\n\n\t\t\t\t/* Check if IP has been used on a banned user account */\n\t\t\t\t$sth = $this->db->prepare(\"SELECT COUNT(*) FROM iplog JOIN users ON iplog.userid = users.id WHERE iplog.ip = ? AND enabled = 'no'\");\n\t\t\t\t$sth->execute(array($this->getBrowserIp()));\n\t\t\t\t$res = $sth->fetch();\n\t\t\t\tif ($res[0]) {\n\t\t\t\t\t$warningSignals++;\n\t\t\t\t}\n\n\t\t\t\t/* Log to Staff if enough warning signals */\n\t\t\t\tif ($warningSignals > 0) {\n\t\t\t\t\t$sth = $this->db->prepare(\"INSERT INTO ipchanges(userid, datum, ip, hostname, level) VALUES(?, NOW(), ?, ?, ?)\");\n\t\t\t\t\t$sth->bindValue(1, $this->getId(), PDO::PARAM_INT);\n\t\t\t\t\t$sth->bindValue(2, $this->getBrowserIp(), PDO::PARAM_INT);\n\t\t\t\t\t$sth->bindParam(3, $host, PDO::PARAM_INT);\n\t\t\t\t\t$sth->bindParam(4, $warningSignals, PDO::PARAM_INT);\n\t\t\t\t\t$sth->execute();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function Add_Audit_Trail($strLogin,$strMessage) {\n $strIP = get_client_ip_env();\n $sql = \"INSERT INTO tb_auditlog_tr (audit_type, audit_detail, audit_ip, create_datetime, create_by) \n VALUES ('$strLogin', '$strMessage', '$strIP', NOW(), 'admin')\";\n $result = mysqli_query($_SESSION['conn'] ,$sql);\n}", "private function insertTrackingdata() {\n\n $trackingData = $this->trackingData;\n\n $connection = new DB();\n $db = $connection->getDB();\n\n $stmt = $db->prepare(\"INSERT INTO user_data (http_user_agent, http_referer, ip, itime, remote_host, time_on_site, utime, pages_visited) \n VALUES (:http_user_agent, :http_referer, :ip, :itime, :remote_host, :time_on_site, :utime, :pages_visited)\");\n $stmt->bindParam(':http_user_agent', $trackingData['http_user_agent']);\n $stmt->bindParam(':http_referer', $trackingData['http_referer']);\n $stmt->bindParam(':ip', $trackingData['ip']);\n $stmt->bindParam(':itime', $trackingData['itime']);\n $stmt->bindParam(':remote_host', $trackingData['remote_host']);\n $stmt->bindParam(':time_on_site', $trackingData['time_on_site']);\n $stmt->bindParam(':utime', $trackingData['itime']);\n $stmt->bindParam(':pages_visited', $trackingData['pages_visited']);\n\n $stmt->execute();\n\n }", "function addToHistory($id){\n // Set query.\n $this->db->query('INSERT INTO logins (userId, ip, country, city) VALUES (:userId, :ip, :country, :city)');\n // Get the data\n // Set ip\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n $loginData = json_decode(file_get_contents(\"http://api.ipstack.com/\".$ip.'&access_key=2436a92b33638c51f3d14bc2b36ad5d0?fields=ip,country_name,city'));\n //die(print_r($loginData));\n // Bind the values.\n $bindArray = array(\n ':userId' => $id,\n ':ip' => $loginData->ip,\n ':country' => $loginData->country_name,\n ':city' => $loginData->city,\n );\n foreach ($bindArray as $bind => $value){\n $this->db->bind($bind, $value);\n }\n // Execute the query.\n if($this->db->execute()){\n return TRUE;\n }\n return FALSE;\n }", "public function updateUserLog($table_name, $ip, $session_id)\n\t\t\t{\n\t\t\t\t$sql = 'UPDATE '.$table_name .\n\t\t\t\t\t\t' SET last_logged=NOW()'.\n\t\t\t\t\t\t', num_visits=num_visits+1, logged_in=\\'1\\''.\n\t\t\t\t\t\t', last_active=NOW(), ip='.$this->dbObj->Param('ip').\n\t\t\t\t\t\t', session='.$this->dbObj->Param('session').\n\t\t\t\t \t \t' WHERE user_id='.$this->dbObj->Param('user_id');\n\n $stmt = $this->dbObj->Prepare($sql);\n $rs = $this->dbObj->Execute($stmt, array($ip, $session_id, $this->user_details_arr['user_id']));\n if (!$rs)\n \t trigger_db_error($this->dbObj);\n\t\t\t}", "function insert_request($ip_addr) {\n\n $ip = acquire_ip_details($ip_addr);\n $ip->request = 1;\n $ip->request_source = $_SERVER['REMOTE_ADDR'];\n\n //if address exists, just update hits.\n if (ip_exists($ip->ip, $ip->domain, $ip->agent) == true) {\n update_hits($ip->ip, $ip->domain, $ip->agent);\n } else {\n global $con;\n $query = \"\n INSERT INTO ip (ip, agent, domain, Request, RequestSource, Hostname, \n City, Region, Country, CountryCode, Latitude, Longitude, DateCreated) VALUES \n (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP) \";\n\n try {\n $stmt = $con->prepare_statement($query);\n\n //checking if query well written\n if (!$stmt)\n throw new Exception();\n\n $stmt->bind_param(\"sssissssssdd\", $ip->ip, $ip->agent, $ip->domain, $ip->request, $ip->request_source, $ip->hostname, $ip->city, $ip->region, $ip->country, $ip->country_code, $ip->latitude, $ip->longitude);\n $stmt->execute();\n\n $stmt->close();\n } catch (Exception $x) {\n \n }\n }\n return $ip;\n}", "public function InsertHistory()\n {\n\n\t\t\t$nicks = $this->GetNick($this->to_user,$_SESSION['userid']);\n\n $sth = DB::prep(\"INSERT INTO cms_messaging_history (user,from_ip, email, sess, msg, admin, type) VALUES(:user,INET_ATON(:from_ip),:email,:sess,:msg,:this_admin, 'admin')\");\n $sth->bindParam(\":msg\", $this->msg, PDO::PARAM_STR);\n\t\t\t$sth->bindParam(\":from_ip\", $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);\n\t\t\t$sth->bindParam(\":sess\", $nicks->sess, PDO::PARAM_STR);\n\t\t\t$sth->bindParam(\":email\", $nicks->email, PDO::PARAM_STR);\n\t\t\t$sth->bindParam(\":this_admin\", $nicks->admin, PDO::PARAM_STR);\n $sth->bindParam(\":user\", $nicks->nick, PDO::PARAM_STR);\n \n DB::Exec($sth);\n }", "public function add_ipaddress()\n\t{\n\t\t$ip_user = $this->getRealIP();\n\t\t$conection = $this->ConnectDB();\n\t\t$statement = $conection->prepare(\"INSERT INTO visitas (ip_address) values (:ip_address)\");\n\t\t$statement->execute(array(':ip_address' => $ip_user));\n\t}", "function logVote() {\n\t\tglobal $con;\n\t\t$myip = \t$_SERVER['REMOTE_ADDR'];\n\t\t$sql = \"INSERT INTO `iptable` (`ip`) VALUES ('\".$myip.\"')\";\n\t\t$con->query($sql);\n\t}", "public function insertIps($visitorIp){\n \n \n $query = new IpsTable;\n $query->ip_address = $visitorIp;\n $query->insert();\n\t\t\n }", "public static function RegisterAttempt()\r\n {\r\n $ip = $_SERVER[\"REMOTE_ADDR\"];\r\n $sql = static::$conn->prepare(\r\n \"INSERT INTO logintable (ip) VALUES (:ip)\"\r\n );\r\n $sql->execute(array(\r\n ':ip' => $ip\r\n ));\r\n }", "protected function trackingIps()\n\t{\n\t\t$f = date('Y.W', time());\n\t\tFile::append(config('veer.history.path') . '/ips.' . $f . '.txt', \n\t\t\\Illuminate\\Support\\Facades\\Request::getClientIp(). '|' . url() . '|' .\n\t\t\t\\Illuminate\\Support\\Facades\\Route::currentRouteName() . \"\\r\\n\" );\n\t}", "function record_visit() \r\n{\r\n\t$db = new db_functions();\r\n $db->db_connect();\r\n\r\n\t$ip_new = VisitorIP();\r\n\t$page_name = find_full_page_name();\r\n\r\n\t$query = \"SELECT * \r\n\tFROM `Visits` \r\n\tWHERE `IP` LIKE '$ip_new'\r\n\tAND `Page Name` LIKE '$page_name'\r\n\tLIMIT 0 , 30\";\r\n\r\n\t$result = $db->db_query($query);\r\n\r\n\t$visited = false;\r\n\tif($row = $db->db_fetch_row($result))\r\n\t{\r\n\t\t$visited = true;\r\n\r\n\t\t$ip = $row[0];\r\n\t\t$times = $row[2];\r\n\t\t$user = $row[3];\r\n\t\t$page_name = $row[4]; \r\n\r\n\t\t$new_times = $times + 1;\r\n\t\tif(strlen($user) == 0)\r\n\t\t{\r\n\t\t\t$new_user = $_SESSION['email'];\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t$new_user = $user; \r\n\t\t}\r\n\t}\r\n\r\n\r\n\tif($visited)\r\n\t{\r\n\t\t$date = date('Y-m-d g-i-s', time()+(60*60*3)); \r\n\t\t$query = \"UPDATE `ididit`.`Visits` SET `Most Recent` = '$date',\r\n\t\t`Times` = '$new_times',\r\n\t\t`User` = '$new_user' WHERE \r\n\t\t`Visits`.`IP` = '$ip' AND \r\n\t\t`Visits`.`Times` =$times AND \r\n\t\t`Visits`.`User` = '$user' AND\r\n\t\t`Visits`.`Page Name` = '$page_name' LIMIT 1 ;\";\r\n\t}\r\n\telse \r\n\t{\r\n\t \tif(isset($_COOKIE['user']))\r\n\t\t\t$user = $_COOKIE['user']; \r\n\t\telse\r\n\t\t\t$user = '';\r\n\r\n\t\tif(strlen($user) == 0)\r\n\t\t{\r\n\t\t\t$user = \"Guest\"; \r\n\t\t}\r\n\r\n\t\t$date = date('Y-m-d g-i-s', time()+(60*60*3)); \r\n\r\n\t\t$location_info = json_decode(file_get_contents(\"http://api.ipinfodb.com/v3/ip-city/?format=json&key=b49cd6eb6da4c0e429300fd010f02061db560d5b38c2526481abe89bc73f8b3b&ip=\".$ip_new));\r\n\r\n\t\t@$country = @$location_info->{'countryName'};\r\n\t\t@$city = @$location_info->{'cityName'};\r\n\t\t@$zip = @$location_info->{'zipCode'};\r\n\t\t@$state = @$location_info->{'regionName'};\r\n\r\n\t\t$query = \"INSERT INTO `ididit`.`Visits` (\r\n\t\t`IP` ,\r\n\t\t`Most Recent` ,\r\n\t\t`Times` ,\r\n\t\t`User`,\r\n\t\t`Page Name`,\r\n\t\t`Country`,\r\n\t\t`City`,\r\n\t\t`Zip`,\r\n\t\t`State`\r\n\t\t)\r\n\t\tVALUES (\r\n\t\t'$ip_new', \r\n\t\t'$date', '1', '$user', '$page_name', '$country', '$city','$zip', '$state'\r\n\t\t);\";\r\n\t}\r\n\r\n\t$db->db_query($query);\r\n\r\n}", "function logNewIP($ip,$facilityID,$hubID) {\n\tglobal $datetime,$user;\n\t//avoid duplicates\n\tif(!getDetailedTableInfo2(\"vl_ips\",\"lower(ip)='\".strtolower($ip).\"' limit 1\",\"id\")) {\n\t\t//insert into vl_ips\n\t\tmysqlquery(\"insert into vl_ips \n\t\t\t\t(ip,created,createdby) \n\t\t\t\tvalues \n\t\t\t\t('$ip','$datetime','$user')\");\n\t\t//return ipID\n\t\t$ipID=0;\n\t\t$ipID=getDetailedTableInfo2(\"vl_ips\",\"createdby='$user' order by id desc limit 1\",\"id\");\n\t\t//ensure this facilityID belongs to this ip\n\t\tif($facilityID && !getDetailedTableInfo2(\"vl_facilities\",\"id='$facilityID' and ipID='$ipID' limit 1\",\"id\")) {\n\t\t\t//log table change\n\t\t\tlogTableChange(\"vl_facilities\",\"ipID\",$facilityID,getDetailedTableInfo2(\"vl_facilities\",\"id='$facilityID'\",\"ipID\"),$ipID);\n\t\t\t//update vl_ips\n\t\t\tmysqlquery(\"update vl_facilities set ipID='$ipID' where id='$facilityID'\");\n\t\t}\n\t\t//ensure this hubID belongs to this ip\n\t\tif($hubID && !getDetailedTableInfo2(\"vl_hubs\",\"id='$hubID' and ipID='$ipID' limit 1\",\"id\")) {\n\t\t\t//log table change\n\t\t\tlogTableChange(\"vl_hubs\",\"ipID\",$hubID,getDetailedTableInfo2(\"vl_hubs\",\"id='$hubID'\",\"ipID\"),$ipID);\n\t\t\t//update vl_ips\n\t\t\tmysqlquery(\"update vl_hubs set ipID='$ipID' where id='$hubID'\");\n\t\t}\n\t\treturn $ipID;\n\t} else {\n\t\t//return ipID\n\t\t$ipID=0;\n\t\t$ipID=getDetailedTableInfo2(\"vl_ips\",\"lower(ip)='\".strtolower($ip).\"' limit 1\",\"id\");\n\t\t//ensure this facilityID belongs to this ip\n\t\tif($facilityID && !getDetailedTableInfo2(\"vl_facilities\",\"id='$facilityID' and ipID='$ipID' limit 1\",\"id\")) {\n\t\t\t//log table change\n\t\t\tlogTableChange(\"vl_facilities\",\"ipID\",$facilityID,getDetailedTableInfo2(\"vl_facilities\",\"id='$facilityID'\",\"ipID\"),$ipID);\n\t\t\t//update vl_ips\n\t\t\tmysqlquery(\"update vl_facilities set ipID='$ipID' where id='$facilityID'\");\n\t\t}\n\t\t//ensure this hubID belongs to this ip\n\t\tif($hubID && !getDetailedTableInfo2(\"vl_hubs\",\"id='$hubID' and ipID='$ipID' limit 1\",\"id\")) {\n\t\t\t//log table change\n\t\t\tlogTableChange(\"vl_hubs\",\"ipID\",$hubID,getDetailedTableInfo2(\"vl_hubs\",\"id='$hubID'\",\"ipID\"),$ipID);\n\t\t\t//update vl_ips\n\t\t\tmysqlquery(\"update vl_hubs set ipID='$ipID' where id='$hubID'\");\n\t\t}\n\t\treturn $ipID;\n\t}\n}", "function user_access_log_insert () {\n /*$ip = $this->CI->input->ip_address(); \n if($_SERVER['SERVER_NAME'] == 'www.tpaccbms.com' && $_SESSION['bms']['staff_id'] != 1273) {\n $json = file_get_contents('http://getcitydetails.geobytes.com/GetCityDetails?fqcn='. $ip); \n $json_arr = json_decode($json);\n //echo '<b>'. $ip .'</b> resolves to:' ;\n \n $data['staff_id'] = $_SESSION['bms']['staff_id'];\n $data['ip_address'] = $json_arr->geobytesipaddress;\n $data['remoteip'] = $json_arr->geobytesremoteip;\n $data['latitude'] = $json_arr->geobyteslatitude; \n $data['longitude'] = $json_arr->geobyteslongitude;\n $data['accessed_module'] = $this->CI->uri->segment(1);\n $data['accessed_method'] = $this->CI->uri->segment(2);\n $data['accessed_date'] = date('Y-m-d H:i:s');\n $data['regionlocationcode'] = $json_arr->geobytesregionlocationcode;\n $data['region'] = $json_arr->geobytesregion;\n $data['city'] = $json_arr->geobytescity;\n $data['code'] = $json_arr->geobytescode;\n $data['fqcn'] = $json_arr->geobytesfqcn;\n $this->CI->db->insert('bms_user_access_log', $data); \n } */\n //echo \"<pre>\";print_r($data); echo \"</pre>\"; exit;\n }", "function access_logs($ip,$userName,$type,$time){\r\n\t$query = \"INSERT INTO accesslogs\r\n\t\t\t\t (id,userName,ipAddress,type,time)\r\n\t\t\t\t VALUES ('','$userName','$ip','$type','$time')\";\r\n\t$result = mysql_query($query);\r\n\tconfirm_query($result);\r\n}", "function logIP($method=\"login\")\n {\n global $dbconn;\n\n // Delete exisitng log entry for this IP \n $sql = \"delete from tbliptracking where ipaddr='\".$_SERVER['REMOTE_ADDR'].\"'; \";\n \n if($method==\"login\")\n {\n // Add entry to IP tracking table\n $sql.= \"insert into tbliptracking (ipaddr, securityuserid) values ('\".$_SERVER['REMOTE_ADDR'].\"', \".$this->getID().\")\";\n }\n\n pg_send_query($dbconn, $sql);\n\n // Get 'delete' result then 'insert' result, ignoring delete result as we don't need to know\n $result = pg_get_result($dbconn);\n $result = pg_get_result($dbconn);\n if(pg_result_error_field($result, PGSQL_DIAG_SQLSTATE))\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "function logUserVisit($ip_address, $path) {\n\t$time = gmdate(\"Y-m-d H:i:s\");\n\t$sql = \"INSERT INTO visitors (ip, timestamp, location) VALUES ('$ip_address', '$time', '$path')\";\n\t$result = mysql_query($sql, $_SESSION['bumdb']);\n\treturn $result;\n}", "public function iphistoryAction(){\n $this->view->ips = $this->_logins->myIps($this->getUsername(), $this->_getParam('page'));\n }", "function writeLog() {global $myIPs;\n if( isset( $myIPs[ $_SERVER['REMOTE_ADDR'] ] ) ) {\n return;\n }\n\n//--- No, go on\n\n $user = User::getCurrentUser();\n\n $fields = array();\n $fields['hitDay'] = date( \"Y-m-d\", time() );\n $fields['hitTime'] = date( \"Y-m-d H:i:s\", time() );\n $fields['script'] = $_SERVER['PHP_SELF'];\n $fields['idparam'] = Motl::getParameter('id');\n $fields['ip'] = $_SERVER['REMOTE_ADDR'];\n $fields['idUser'] = $user ? $user->getId() : null;\n\n $id = MotlDB::saveRow( \"logTable\", \"id\",null, $fields, false, true );\n //die( \"==$id==\" );\n if( ! $id ) {\n \n MotlDB::query( \"CREATE TABLE logtable (\"\n .\" id int(11) NOT NULL auto_increment,\"\n .\" hitDay date default NULL,\"\n .\" hitTime datetime NOT NULL,\"\n .\" script varchar(50) default NULL,\"\n .\" idparam varchar(50) default NULL,\"\n .\" ip varchar(50) default NULL,\"\n .\" idUser int(11) default NULL,\"\n .\" PRIMARY KEY (id),\"\n .\" KEY indexDay (hitDay),\"\n .\" KEY indexDayUser (hitDay,ip,idUser),\"\n .\" KEY indexDayPage (hitDay,script,idparam)\"\n .\") ENGINE=MyISAM DEFAULT CHARSET=utf8\" );\n $id = MotlDB::saveRow( \"logTable\", \"id\",null, $fields, false, true );\n }\n}", "function qa_db_limits_ip_add($ip, $action, $period, $count)\n{\n\tqa_db_query_sub(\n\t\t'INSERT INTO ^iplimits (ip, action, period, count) VALUES (UNHEX($), $, #, #) ' .\n\t\t'ON DUPLICATE KEY UPDATE count=IF(period=#, count+#, #), period=#',\n\t\tbin2hex(@inet_pton($ip)), $action, $period, $count, $period, $count, $count, $period\n\t);\n}", "public function storeEverything($referer) {\ninclude('ip2locationlite.class.php');\n\nif($referer ==''){\n$referer = 'DirectVisitors';\n}\n\n$ipLite = new ip2location_lite;\n$ipLite->setKey('efc5a5ac583e225f8113d341491345d2a0271d97af7e9e0fb247fa8950324614');\n$ip = $_SERVER['REMOTE_ADDR'];\n$locations = $ipLite->getCity($ip);\n$page = $_SERVER['PHP_SELF'];\n$details = $_SERVER['HTTP_USER_AGENT'];\n\n\n $days = array(0,31,59,90,120,151,181,212,243,273,304,334);\n $time = date('d/m/Y h:i:s A');\n \n $timestamp = time();\n $cmonth = date(\"m\");\n $day = date(\"d\")+$days[$cmonth-1];\n $month = date(\"Y.m\");\n $hour = date(\"h A\");\n\t\n \t\nmysql_query(\"INSERT INTO log (IP, Time, Details, Page,timestamp,day,cmonth,Hour,refferer)\n VALUES ('\" . $ip . \"','\" . $time . \"','\" . $details . \"','\" . $page . \"','\" . $timestamp . \"','\" . $day . \"','\" . $cmonth . \"','\" . $hour. \"','\" . $referer . \"')\") or die(mysql_error());\n\n\n \n\n\tmysql_query(\"INSERT INTO location (ipAddress,countryCode,countryName,regionName,cityName,latitude,longitude,timeZone)\n VALUES ('\" . $ip . \"','\" . $locations['countryCode'] . \"','\" . $locations['countryName'] . \"','\" . $locations['regionName'] . \"','\" . $locations['cityName'] . \"','\" . $locations['latitude'] . \"','\" . $locations['longitude'] . \"','\" . $locations['timeZone'] . \"')\") or die(mysql_error());\n\n\n\n\n\n}", "function update_inst_ip() {\n\tglobal $wpdb;\n\tglobal $inst_ip_table_name;\n\n\t$id = $_POST['id'];\n\t$location_id = $_POST['location_id'];\n\t$ip_start = $_POST['ip_start'];\n\t$ip_end = $_POST['ip_end'];\n\n\t//convert to storable long data type\n\t$ip_start = sprintf(\"%u\", ip2long($ip_start));\n\t$ip_end = sprintf(\"%u\",ip2long($ip_end));\n\n\t$push_data = array(\n\t\t'location_id' => $location_id,\n\t\t'start' => $ip_start,\n\t\t'end' => $ip_end\n\t);\n\n\t$wpdb->update(\n\t\t$inst_ip_table_name,\n\t\t$push_data,\n\t\tarray('ID' => $id),\n\t\tarray('%d', '%f', '%f'),\n\t\tarray('%d')\n\t);\n\n\tcheck_db_errors();\n}", "function SaveUser()\n {\n $tmp_db = new DB();\n $q = \"SELECT * FROM \".TblModUser.\" WHERE `sys_user_id`='\".$this->user_id.\"'\";\n $res = $this->db->db_Query( $q );\n if( !$res ) return false;\n $rows = $this->db->db_GetNumRows();\n //echo '<br>$q='.$q.'$rows='.$rows;\n\n $ip = $_SERVER['REMOTE_ADDR'];\n\n $long_ip = ip2long($ip);\n $q = \"SELECT * from `mod_stat_ip` WHERE `ip_from`<\".$long_ip.\" AND `ip_to`>\".$long_ip.\"\";\n $restmp = $tmp_db->db_Query( $q );\n //if( !$restmp ) return false;\n $rows_tmp = $tmp_db->db_GetNumRows();\n if($rows_tmp>0){\n $row_tmp = $tmp_db->db_FetchAssoc();\n //echo '<br>$q='.$q.' $rows_tmp='.$rows_tmp;\n $ip_ctry = $row_tmp['ctry'];\n }\n else $ip_ctry=NULL;\n\n\n if( $rows>0 ) //--- update\n {\n // echo $this->subscr;\n $Logon = new UserAuthorize();\n $q = \"UPDATE `\".TblModUser.\"` SET\n `name`='\".$this->name.\"',\n `country`='\".$this->country.\"',\n `adr`='\".$this->adr.\"',\n `city` = '\".$this->city.\"',\n `phone` = '\".$this->phone.\"',\n `phone_mob`='\".$this->phone_mob.\"',\n `fax`='\".$this->fax.\"',\n `www`='\".$this->www.\"',\n `subscr`='\".$this->subscr.\"',\n `user_status`='\".$this->user_status.\"',\n `state`='\".$this->state.\"',\n `aboutMe`='\".$this->aboutMe.\"',\n `discount`='\".$this->discount.\"'\n \";\n //if update make User (not adminitsrator), then save IP address of this user.\n if( $Logon->user_id==$this->user_id){\n $q = $q.\", `ip`='\".$ip.\"'\";\n if( !empty($ip_ctry) ) $q = $q.\", `ip_ctry`='\".$ip_ctry.\"'\";\n }\n if(isset($this->expertTitle)){\n $q.=\", `expertTitle`='\".$this->expertTitle.\"'\";\n }\n if(isset($this->ShowInTop) && $this->ShowInTop==1){\n $q.=\", `ShowInTop`='1'\";\n }else{\n $q.=\", `ShowInTop`='0'\";\n }\n if( isset($this->bonuses) ){\n $q = $q.\", `bonuses`='\".$this->bonuses.\"'\";\n }\n $q = $q.\" WHERE `sys_user_id`='\".$this->user_id.\"'\";\n //echo $q;die();\n }\n else //--- insert\n {\n $q = \"INSERT INTO `\".TblModUser.\"` SET\n `sys_user_id`='\".$this->user_id.\"',\n `name`='\".$this->name.\"',\n `country`='\".$this->country.\"',\n `adr`='\".$this->adr.\"',\n `city` = '\".$this->city.\"',\n `phone` = '\".$this->phone.\"',\n `phone_mob`='\".$this->phone_mob.\"',\n `fax`='\".$this->fax.\"',\n `www`='\".$this->www.\"',\n `subscr`='\".$this->subscr.\"',\n `user_status`='\".$this->user_status.\"',\n `ip`='\".$ip.\"',\n `state`='\".$this->state.\"',\n `aboutMe`='\".$this->aboutMe.\"',\n `discount`='\".$this->discount.\"'\n \";\n if( !empty($ip_ctry) ) $q = $q.\", `ip_ctry`='\".$ip_ctry.\"'\";\n if( isset($this->bonuses) ){\n $q = $q.\", `bonuses`='\".$this->bonuses.\"'\";\n }\n if(isset($this->ShowInTop) && $this->ShowInTop==1){\n $q.=\", `ShowInTop`='1'\";\n }else{\n $q.=\", `ShowInTop`='0'\";\n }\n if(isset($this->expertTitle)){\n $q.=\", `expertTitle`='\".$this->expertTitle.\"'\";\n }\n }\n $res = $this->db->db_Query( $q );\n //echo '<br>$q='.$q.' $res='.$res.' $this->db->result='.$this->db->result;echo \"rows=\".$rows;\n if( !$res OR !$this->db->result ) return false;\n return true;\n }", "private function storeVisitor(){\n\t\t$query = \"INSERT INTO visitor (ip, user_agent, resource, redirect, time, trackCode) VALUES (:ip, :user_agent, :resource, :redirect, :time, :trackCode)\";\n\t\ttry {\n\t\t\t$sth = $this->connection->prepare($query);\n\t\t\t$sth->bindValue(':ip', $this->ip, PDO::PARAM_STR);\n\t\t\t$sth->bindValue(':user_agent', $this->userAgent, PDO::PARAM_STR);\n\t\t\t$sth->bindValue(':resource', $this->resource, PDO::PARAM_STR);\n\t\t\t$sth->bindValue(':redirect', $this->redirectTo, PDO::PARAM_STR);\n\t\t\t$sth->bindValue(':time', $this->time, PDO::PARAM_STR);\n\t\t\t$sth->bindValue(':trackCode', $this->trackCode, PDO::PARAM_STR);\n\t\t\tif (!$sth->execute()){\n\t\t\t\t$this->_logger->logInfo( __METHOD__ , implode(\" \", $sth->errorInfo()));\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$this->_logger->logException( __METHOD__ , $e->getMessage());\n\t\t}\n\t}", "function insert_inst_ip() {\n\tglobal $wpdb;\n\tglobal $inst_ip_table_name;\n\n\t$location_id = $_POST['location_id'];\n\t$ip_start = $_POST['ip_start'];\n\t$ip_end = $_POST['ip_end'];\n\n\t//convert to storable long data type\n\t$ip_start = sprintf(\"%u\", ip2long($ip_start));\n\t$ip_end = sprintf(\"%u\", ip2long($ip_end));\n\n\t$push_data = array(\n\t\t'location_id' => $location_id,\n\t\t'start' => $ip_start,\n\t\t'end' => $ip_end\n\t);\n\n\t$wpdb->insert(\n\t\t$inst_ip_table_name,\n\t\t$push_data\n\t);\n\tcheck_db_errors();\n}", "function set_client_ip($visiter_ip)\n{\n\tglobal $db;\n\t\n\t$stmt = $db->prepare(\"INSERT INTO sessions (s_ip, s_date, s_agent) VALUES (:ip, :time, :agent)\");\n $stmt->bindParam(':ip', $visiter_ip);\n $stmt->bindParam(':time', time());\n $stmt->bindParam(':agent', $_SERVER['HTTP_USER_AGENT']);\n $stmt->execute();\n\n // var_dump($_SERVER['HTTP_USER_AGENT']);\n}", "function sumo_add_banned($ip=NULL)\n{\n\tGLOBAL $SUMO;\n\n\t$ip_banned = empty($ip) ? $SUMO['client']['ip'] : $ip;\n\n\t$query = \"INSERT INTO \".SUMO_TABLE_BANNED.\"\n\t\t\t\t(ip, time)\n\t\t\t VALUES (\n\t\t\t \t'\".$ip_banned.\"',\n\t\t\t \t \".$SUMO['server']['time'].\"\n\t\t\t )\";\n\n\t$SUMO['DB']->Execute($query);\n}", "function qa_db_user_written($userid, $ip)\n{\n\tqa_db_query_sub(\n\t\t'UPDATE ^users SET written=NOW(), writeip=UNHEX($) WHERE userid=$',\n\t\tbin2hex(@inet_pton($ip)), $userid\n\t);\n}", "public function logIP ()\n {\n $line = date('Y-m-d H:i:s') . \",\" . session_id() . \",\" . $_SERVER['REMOTE_ADDR'] . \",\" . $_SESSION[\"emailID\"];\n file_put_contents(SITE_PATH.'/visitors.log', $line . PHP_EOL, FILE_APPEND);\n }", "function initCounter() {\r\n\r\n $ip = $_SERVER['REMOTE_ADDR']; //get visitor ip\r\n $location = $_SERVER['PHP_SELF']; //get server file path\r\n $sid = session_id();\r\n $qry_1 = \"INSERT INTO counter(session_id, ip, location)VALUES('$sid', '$ip', '$location') ON DUPLICATE KEY UPDATE location='$location' \";\r\n //create log in database table 'counter'\r\n $create_log = mysql_query($qry_1);\r\n}", "function makeLog($actionKey) {\n\n if(!$actionKey) {\n \techo \"There is no action key!\";\n \treturn;\n }\n \n $ip = get_client_ip();\n //$username = isset($_SESSION['name']) ? $_SESSION['name'] : '';\n $username = isset($_SESSION['person']) ? unserialize($_SESSION['person'])->userID : 'unknown username';\n \n $mysqli = openDB();\n\n //$query = \"INSERT INTO LogEntry (UserID) SELECT UserID FROM Person WHERE UserID = ?\";\n $query = \"INSERT INTO LogEntry (UserID, Ip, LogDate, LogTime, ActionKey) VALUES (?, ?, CURDATE(), CURTIME(), ?)\";\n\n // prepare statement\n if (!$stmt = $mysqli->prepare($query))\n {\n echo \"Error preparing statement: <br>\";\n echo nl2br(print_r($stmt->error_list, true), false);\n return;\n }\n\n if (!$stmt->bind_param('sss', $username, $ip, $actionKey))\n {\n echo \"Error binding parameters: <br>\";\n echo nl2br(print_r($stmt->error_list, true), false);\n return;\n }\n\n if (!$stmt->execute())\n {\n echo \"Error executing query: <br>\";\n echo nl2br(print_r($stmt->error_list, true), false);\n return;\n }\n\n\n}", "private function refreshIps()\n {\n $ipAddressDetails = new IpAddressDetails;\n\n $this->newIps()->each(function ($ip) use ($ipAddressDetails) {\n $ipDetails = $ipAddressDetails->getDetails($ip->address);\n\n DB::table('ip_details')->insert([\n 'id' => $ip->id,\n 'address' => $ip->address,\n 'city' => $ipDetails->city,\n 'state_prov' => $ipDetails->state_prov,\n 'zipcode' => $ipDetails->zipcode,\n 'country_name' => $ipDetails->country_name,\n 'country_flag' => $ipDetails->country_flag,\n 'continent_name' => $ipDetails->continent_name,\n ]);\n });\n }", "function insights_history( $entry_id, $action, $note = '', $skip_copy = false ) {\n global $db;\n $tbl = TABLE_PREFIX;\n\n # phase one: make copies of all data associated with this $action_id\n if( $action === 'update' && $skip_copy === false ) {\n $copy_id = insights_backup($entry_id);\n\n # override $note to point to the old entry\n $note = \"~\" . $copy_id;\n }\n\n # phase two: get action id, record info about user and action\n $db->Query(\n \"insert into `{$tbl}_history`\n (`ip`, `action`, `entry_id`, `note`)\n values\n (:addr, :action, :entry_id, :note)\",\n array(\n \":addr\" => $_SERVER[\"REMOTE_ADDR\"],\n \":action\" => $action,\n \":entry_id\" => intval( $entry_id ),\n \":note\" => $note\n )\n );\n\n $action_id = $db->getInsertID();\n\n return( $action_id );\n}", "public function updateTrackingData() {\n\n $trackingData = $this->trackingData;\n $ctime = date('Y-m-d H-i-s', time());\n\n\n // Calculate new time on site\n $trackingData['time_on_site'] = $this->user['time_on_site'] + (time() - strtotime($this->user['utime']));\n\n // Calculate pages visited\n if($this->calldeByJs == false) {\n // Only increment visits on page refresh (not on JavaScript tracker call)\n $trackingData['pages_visited'] = $this->user['pages_visited'] + 1;\n } else {\n $trackingData['pages_visited'] = $this->user['pages_visited'];\n }\n\n $connection = new DB();\n $db = $connection->getDB();\n\n $stmt = $db->prepare(\"UPDATE user_data SET time_on_site = :time_on_site, utime = :utime, pages_visited = :pages_visited\n WHERE id = :id\");\n\n $stmt->bindParam(':id', $this->user['id']);\n $stmt->bindParam(':time_on_site', $trackingData['time_on_site']);\n $stmt->bindParam(':utime', $ctime);\n $stmt->bindParam(':pages_visited', $trackingData['pages_visited']);\n\n $stmt->execute();\n\n }", "public static function historizeUserLogin()\n {\n try {\n $userId = self::getUserInformation()->getId();\n $ipAddress = self::getUserInformation()->getIpAddress();\n\n\n $userHistory = array();\n $userHistory[Db_UserHistory::USER_ID] = $userId;\n $userHistory[Db_UserHistory::IP_ADDRESS] = $ipAddress;\n\n $userHistoryDao = new Dao_UserHistory();\n $historyId = $userHistoryDao->createUserHistory($userHistory);\n\n $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');\n $options = $bootstrap->getOptions();\n\n $sess = new Zend_Session_Namespace($options['auth']['user']['namespace']);\n $sess->userHistory = $historyId;\n\n // update session (user_id)\n $sessionId = Zend_Session::getId();\n $userHistoryDao->updateUserSession($sessionId, $userId, $ipAddress);\n } catch (Exception $e) {\n // don't handle those exceptions\n }\n }", "function update_history($city,$trans,$route,$inp,$username,$action,$count){\n \n\t$quer = \"select max(revision) as ver from routes_edit_history where route = :var1 and city = :var2 and trans = :var3\"; //Get the maximum revision number on the given route\n \t$rev = DB::select( DB::raw($quer), array('var1' => $route,'var2' => $city,'var3' => $trans,));\n \t$ver = $rev[0]->ver;\n \tif($ver==null){\n \t\t$ver=0;\n \t}\n \tif($action!=\"edit\"){\n \t\t$action=\"add\";\n \t}\n \t$ver = $ver+1;//Increment the revision number\n \t$quer = \"INSERT INTO routes_edit_history(route, city, trans, revision, action, edited_by) values(:var1 ,:var2, :var3 ,:var4, :var5 ,:var6)\"; \n \tDB::insert( DB::raw($quer), array('var1' => $route,'var2' => $city,'var3' => $trans,'var4' => $ver,'var5' => $action,'var6' => $username,));// Insert into the 'routes_edit_history' table\n \t$quer = \"select id from routes_edit_history where route = :var1 and city = :var2 and trans = :var3 and revision = :var4\"; \n \t$ids = DB::select( DB::raw($quer), array('var1' => $route,'var2' => $city,'var3' => $trans,'var4' => $ver));\n \t$id = $ids[0]->id;//Getting the id of the insert\n \tfor($i=0;$i<$count;$i++){\n\t\t$t1 = $inp['stop_pos'.$i];\n\t\t$t2 = $inp['stop_name'.$i];\n\t\t$t3 = $inp['stop_lat'.$i];\n\t\t$t4 = $inp['stop_lon'.$i];\n\t\t$quer = \"INSERT INTO routes_edit_history_help(ID,route,stop_pos, stop_name, stop_lat, stop_lon) values(:var1 ,:var2, :var3 ,:var4, :var5 ,:var6)\"; \n \t\tDB::insert( DB::raw($quer), array('var1' => $id,'var2' => $route,'var3' => $t1,'var4' => $t2,'var5' => $t3,'var6' => $t4,)); //Insert the stops of the edited/created route in 'routes_edit_history_help'\n\t}\n\t//echo '<script>window.alert(\"Your edit has been recorded for verification!\");</script>'; \t\n}", "public function increaseLoginAttempts() {\n $date = date(\"Y-m-d\");\n $user_ip = $_SERVER['REMOTE_ADDR'];\n $table = 'wi_login_attempts';\n \n //get current number of attempts from this ip address\n $loginAttempts = $this->_getLoginAttempts();\n \n //if they are greater than 0, update the value\n //if not, insert new row\n if($loginAttempts > 0)\n $this->WIdb->update (\n $table, \n array( \"attempt_number\" => $loginAttempts + 1 ), \n \"`ip_addr` = :ip_addr AND `date` = :d\", \n array( \"ip_addr\" => $user_ip, \"d\" => $date)\n );\n else\n $this->WIdb->insert($table, array(\n \"ip_addr\" => $user_ip,\n \"date\" => $date\n ));\n }", "private function updateAttempted($userIP)\n {\n $query = new Query;\n $query->select(['attempted','reset_at'])\n ->from('tbl_failed_logins')\n ->where('ip=:ip', [':ip' => $userIP])\n ->one();\n\n\n // build and execute the query\n $getAttemptFromDb = $query->one();\n\n if ($getAttemptFromDb['attempted'] < $this->maxAttempts || $getAttemptFromDb['attempted'] == NULL) {\n\n $newCount =$getAttemptFromDb['attempted'] + 1;\n\n if ($getAttemptFromDb['attempted'] == null) //ip has no failed login entry\n {\n\n Yii::$app->db->createCommand()\n ->insert('tbl_failed_logins', [\n 'ip' => $userIP,\n 'attempted' => $newCount,\n ])->execute();\n\n }\n\n else //ip has an existing failed login entry already\n {\n Yii::$app->db->createCommand()\n ->update('tbl_failed_logins', ['attempted' => $newCount], ['ip' => $userIP] )\n ->execute();\n }\n\n\n\n } else { //three attempts reached ---> ban ip for a period = delay\n\n $this->banIP($userIP);\n $this->bannedMessage($getAttemptFromDb['reset_at']);\n\n\n }\n\n\n }", "public function insertStat($market_id, $file_id, $remote_host, $remote_addr, $osclass_version) {\n\n $aSet = array(\n 'fk_i_market_id' => $market_id,\n 'fk_i_file_id' => $file_id,\n 's_hostname' => $remote_host,\n 's_ip' => $remote_addr,\n 'dt_date' => date('Y-m-d H:i:s'),\n 's_osclass_version' => $osclass_version\n );\n\n // get s_country_code from ip\n $result = $this->dao->query(\"select code from \".DB_TABLE_PREFIX.\"t_ip_ranges where ip_from <= INET_ATON('$remote_addr') AND ip_to >= INET_ATON('$remote_addr') LIMIT 1 \");\n $aux = $result->row();\n $s_country_code = '';\n if($aux!==false && isset($aux['code']) ){\n $aSet['s_country_code'] = $aux['code'];\n }\n\n // insert market stat\n $this->dao->insert($this->getTable_Stats(), $aSet);\n\n // insert market stat ++\n $this->increaseMarketDownload($market_id, $osclass_version);\n // insert market file stat ++\n $this->increaseMarketFileDownload($file_id, $osclass_version);\n }", "function log_to_db($db,$result,$postUser) {\n\t$query=\"insert into login set ip=?,date=now(),user=?,action=?\";\n\tif($stmt = mysqli_prepare($db,$query)){\n\t\tmysqli_stmt_bind_param($stmt,\"sss\",$_SERVER['REMOTE_ADDR'],$postUser,$result);\n\t\tmysqli_stmt_execute($stmt);\n\t\tmysqli_stmt_close($stmt);\n\t}\n\t\n\n\n}", "public function saveLoginTransaction()\n {\n $ipAdress = $this->_ipAddress->getClientIp();\n $userAgent = $this->getDeviceType();\n $currentUser = $this->session->getCustomer()->getId();\n $this->_loginHistory->setData('ip_address',$ipAdress);\n $this->_loginHistory->setData('user_agent',$userAgent);\n $this->_loginHistory->setData('customer_id',$currentUser); \n $this->_loginHistory->save();\n }", "public function onAddOrUpdateAddress()\n {\n $post = post();\n unset($post['_handler']);\n unset($post['_token']);\n unset($post['_session_key']);\n $user = Auth::getUser();\n $post['user_id'] = $user->id;\n if ($post['id'] != 0) {//update\n \\Ideas\\Shop\\Models\\UserExtend::where('id', $post['id'])->update($post);\n } else {//insert\n \\Ideas\\Shop\\Models\\UserExtend::insert($post);\n }\n }", "public function logHit($ip_address) \n {\n\t\tif (!array_key_exists($ip_address, $this->data)) {\n\t\t\t$this->data[$ip_address] = array($ip_address, 1, time());\n\t\t} else {\n\t\t\t$this->data[$ip_address][1]++; \n\t\t\t$this->data[$ip_address][2] = time(); \n\t\t}\n }", "protected function updateIPBucket($ip): void\n {\n if($ip != \"\"){\n $time = time();\n $update = $this->db->prepare(\"INSERT INTO `sec_ip_bucket` (`ip`, `bucket`, `last_failure`) VALUES ('$ip', 1, $time) \n ON DUPLICATE KEY UPDATE `bucket` = `bucket` + 1;\");\n $update->execute();\n } \n }", "public function touchLogIp($id)\n {\n return $this->touchLog($id);\n //$sql = \"UPDATE USER_LOG_IP SET TOUCH_DATE = NOW() WHERE ID_USER_IP = ? AND DATE_FIN > NOW()\";\n }", "public function insertIntoLogs($user_id,$url,$ip,$browser,$ref)\n\t\t{\n\t\t\t$STM = $this->dbo->prepare(\"INSERT into log (user_id, url, ip, browser, ref) VALUES (:user_id, :url, :ip, :browser, :ref)\");\n\t\t\t$STM->bindParam(':user_id', $user_id); \n\t\t\t$STM->bindParam(':url', $url); \n\t\t\t$STM->bindParam(':ip', $ip); \n\t\t\t$STM->bindParam(':browser', $browser); \n\t\t\t$STM->bindParam(':ref', $ref); \n\t\t\tif (!$STM->execute())\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t$row = $STM -> fetch();\n\t\t}", "public function addPageView($ip, $useragent) {\n\t\t$databaseConnection = databaseConnection::getInstance();\n\t\t// Get the databse connection info\n\t\t$databaseInfo = $databaseConnection->getDatabaseInfo();\n\t\t// Connect to the database with mysqli\n\t\t$db = new mysqli($databaseInfo['host'], $databaseInfo['username'], $databaseInfo['password'], $databaseInfo['db']);\n\t\t\n\t\t$locationData = $this->ipToLocation($ip);\n\t\t\n\t\t$ip = $db->real_escape_string($ip);\n\t\t$useragent = $db->real_escape_string($useragent);\n\t\t$country = $db->real_escape_string($locationData['countryCode']);\n\t\t$state = $db->real_escape_string($locationData['region']);\n\t\t$city = $db->real_escape_string($locationData['city']);\n\t\t$lat = $db->real_escape_string($locationData['latitude']);\n\t\t$lon = $db->real_escape_string($locationData['longitude']);\n\t\t\n\t\t// Insert the new user into the Users table\n\t\t$query = \"\n\t\t\tINSERT INTO\n\t\t\t\teve_site_hits\n\t\t\t(\n\t\t\t\tip,\n\t\t\t\tuseragent,\n\t\t\t\tcountry,\n\t\t\t\tstate,\n\t\t\t\tcity,\n\t\t\t\tlatitude,\n\t\t\t\tlongitude\n\t\t\t)\n\t\t\tVALUES (\n\t\t\t\t'$ip',\n\t\t\t\t'$useragent',\n\t\t\t\t'$country',\n\t\t\t\t'$state',\n\t\t\t\t'$city',\n\t\t\t\t'$lat',\n\t\t\t\t'$lon'\n\t\t\t)\n\t\t\";\n\t\t// Run the query\n\t\t$db->query($query);\n\t}", "function track($action = \"\" , $id = '0') {\n global $db,$inactive_minutes;\n \n $now = time(); // yyyymmddhhmm, ex. 200009021431 \n /*\n \tUsers who have been inactive for more than $inactive_minutes are removed\n */\n $timeago = time() - ($inactive_minutes*60);\n $db->query(\"DELETE FROM \".DBPREFIX.\"onlineusers WHERE timestamp < \" . $timeago);\n if ($action == \"\") $action = \"surfer rundt\";\n $res = $db->query(\"SELECT * FROM \".DBPREFIX.\"onlineusers WHERE sessionid='\".session_id().\"'\");\n $ip = ip2long($_SERVER['REMOTE_ADDR']);\n $browser = (isset($_SERVER['HTTP_USER_AGENT']) ? addslashes($_SERVER['HTTP_USER_AGENT']) : \"Ukjent\");\n\tif($res->num_rows == 1){\n \t$db->query(\"UPDATE \".DBPREFIX.\"onlineusers \n \t\tSET \n \t\t\tmemberid='$id', \n \t\t\tdoingwhat='\".addslashes($action).\"', \n \t\t\ttimestamp='\".time().\"',\n \t\t\tbrowser='$browser',\n \t\t\tip='$ip'\n \t\tWHERE \n \t\t\tsessionid='\".session_id().\"'\"\n \t);\n } else {\n \t$db->query(\"INSERT INTO \".DBPREFIX.\"onlineusers\n \t(\n \t\tsessionid,\n \t\tmemberid,\n \t\tdoingwhat,\n \t\ttimestamp,\n \t\tbrowser,\n \t\tip\n \t)\n \tVALUES\n \t(\n '\".session_id().\"', \n '$id',\n '\".addslashes($action).\"',\n '\".time().\"',\n '$browser',\n '$ip'\n )\"\n );\n }\n}", "function updateIP($ip){\n\t\t\tinclude(\"account.php\");\n\t\t\t$curDate = date('Y-m-d H:i:s', time());\n\t\t\t$time=time();\n\t\t\t$stmt = $link->prepare(\"UPDATE ips SET last_comment = '$curDate',time='$time' WHERE ip= '$ip'\");\n\t\t\t$stmt->execute(); \n\t\t\t$stmt->close();\n\t\t}", "public function addProfileInVddPool()\n\t{\n \t $sql =\"SELECT PROFILEID,ANALYTIC_SCORE FROM incentive.MAIN_ADMIN_POOL WHERE CUTOFF_DT>='$this->cutOffDate' AND ENTRY_DT<'$this->lastWeekDate'\";\n \t $res = mysql_query_decide($sql,$this->slaveDb) or LoggingWrapper::getInstance()->sendLogAndDie(LoggingEnums::LOG_ERROR, new Exception($sql.mysql_error($this->slaveDb)));\n \t while($row = mysql_fetch_array($res)){\n \t \t $pid \t\t=$row['PROFILEID'];\n\t\t\t$analyticScore \t=$row['ANALYTIC_SCORE'];\n \t \t $sql1 \t\t=\"insert ignore into billing.VARIABLE_DISCOUNT_POOL_TECH(`PROFILEID`,`SCORE`) VALUES('$pid','$analyticScore')\";\n \t \t mysql_query_decide($sql1,$this->myDb) or LoggingWrapper::getInstance()->sendLogAndDie(LoggingEnums::LOG_ERROR, new Exception($sql1.mysql_error($this->myDb)));\n\n $sql1 =\"insert ignore into billing.VARIABLE_DISCOUNT_POOL_TECH_LOG1(`PROFILEID`,`SCORE`) VALUES('$pid','$analyticScore')\";\n mysql_query_decide($sql1,$this->myDb) or LoggingWrapper::getInstance()->sendLogAndDie(LoggingEnums::LOG_ERROR, new Exception($sql1.mysql_error($this->myDb)));\n\n \t}\n\t}", "protected function updateIps()\n {\n $ip = smart_get_client_ip();\n\n if (!$this->isDirty('updated_ip')) {\n $this->updated_ip = $ip;\n }\n\n if (!$this->exists && !$this->isDirty('created_ip')) {\n $this->created_ip = $ip;\n }\n }", "function writeStatisticLog($type, $username, $data)\n{\n\tglobal $ip;\n\t// Spam from IP\n\t$row = Database::queryFirst('SELECT Count(*) AS cnt FROM statistic WHERE clientip = :client AND dateline + 300 > UNIX_TIMESTAMP()', array(':client' => $ip));\n\tif ($row !== false && $row['cnt'] > 8) {\n\t\treturn;\n\t}\n\n\tDatabase::exec('INSERT INTO statistic (dateline, typeid, clientip, username, data) VALUES (UNIX_TIMESTAMP(), :type, :client, :username, :data)', array(\n\t\t'type' => $type,\n\t\t'client' => $ip,\n\t\t'username' => $username,\n\t\t'data' => $data,\n\t));\n}", "public static function insertMemberLog($log_ip,$member_id){\n $log_in = date('Y-m-d H:i:s', time());\n $status = self::LOGIN;\n\n $con=$GLOBALS['con'];\n $stmt = $con->prepare(\"INSERT INTO member_log (log_in, log_ip, status, member_id) VALUES (?, ?, ?, ?)\");\n $stmt->bind_param(\"sssi\", $log_in, $log_ip, $status, $member_id);\n $stmt->execute();\n $log_id = $con->insert_id;\n return $log_id;\n }", "FUNCTION IPs_put_IP( &$dbh,\n\t\t\t\t\t$ip,\n\t\t\t\t\t$deptid,\n\t\t\t\t\t$t_footprints,\n\t\t\t\t\t$t_requests,\n\t\t\t\t\t$t_initiate,\n\t\t\t\t\t$request,\n\t\t\t\t\t$initiate,\n\t\t\t\t\t$i_footprints,\n\t\t\t\t\t$i_timestamp,\n\t\t\t\t\t$onpage = \"\" )\n\t{\n\t\tif ( $ip == \"\" )\n\t\t\treturn false ;\n\n\t\tglobal $CONF ;\n\t\tglobal $VALS ;\n\n\t\tif ( !defined( 'API_IPs_get' ) )\n\t\t\tinclude_once( \"$CONF[DOCUMENT_ROOT]/API/IPs/get.php\" ) ;\n\n\t\t$now = time() ;\n\t\t$ipinfo = IPs_get_IPInfo( $dbh, $ip ) ;\n\t\t$ip_md5 = md5( $ip ) ;\n\n\t\tLIST( $t_footprints, $t_requests, $t_initiate, $i_footprints, $i_timestamp ) = database_mysql_quote( $t_footprints, $t_requests, $t_initiate, $i_footprints, $i_timestamp ) ;\n\n\t\tif ( isset( $ipinfo[\"ip\"] ) )\n\t\t{\n\t\t\t$t_footprints = $ipinfo[\"t_footprints\"] + $t_footprints ;\n\t\t\t$t_requests = $ipinfo[\"t_requests\"] + $t_requests ;\n\t\t\t$t_initiate = $ipinfo[\"t_initiate\"] + $t_initiate ;\n\t\t\t$t_footprints_query = ( $t_footprints ) ? \"t_footprints = $t_footprints\" : \" \" ;\n\t\t\t$t_requests_query = ( $t_requests ) ? \"t_requests = $t_requests\" : \" \" ;\n\t\t\t$t_initiate_query = ( $t_initiate ) ? \"t_initiate = $t_initiate\" : \" \" ;\n\t\t\t$t_query = \"$t_footprints_query,$t_requests_query,$t_initiate_query,\" ;\n\t\t\t$t_query = preg_replace( \"/ ,/\", \"\", $t_query ) ;\n\n\t\t\t/*****************************************/\n\t\t\t/* auto initiate area */\n\t\t\t$initiate_array = ( isset( $CONF[\"auto_initiate\"] ) && $CONF[\"auto_initiate\"] ) ? unserialize( html_entity_decode( $CONF[\"auto_initiate\"] ) ) : Array() ;\n\n\t\t\t$exclude_string = \"\" ;\n\t\t\t$auto_initiate_reset = $auto_initiate_duration = $auto_initiate_footprints = $auto_initiate_andor = 0 ;\n\t\t\tif ( isset( $initiate_array[\"duration\"] )&& $initiate_array[\"duration\"] )\n\t\t\t\t$auto_initiate_duration = $initiate_array[\"duration\"] ;\n\t\t\tif ( isset( $initiate_array[\"footprints\"] ) && $initiate_array[\"footprints\"] )\n\t\t\t\t$auto_initiate_footprints = $initiate_array[\"footprints\"] ;\n\t\t\tif ( isset( $initiate_array[\"andor\"] ) )\n\t\t\t\t$auto_initiate_andor = $initiate_array[\"andor\"] ;\n\t\t\tif ( isset( $initiate_array[\"reset\"] ) )\n\t\t\t\t$auto_initiate_reset = $initiate_array[\"reset\"] ;\n\t\t\tif ( isset( $initiate_array[\"exclude\"] ) && $initiate_array[\"exclude\"] )\n\t\t\t{\n\t\t\t\t$exclude_array = explode( \",\", $initiate_array[\"exclude\"] ) ;\n\t\t\t\tfor ( $c = 0; $c < count( $exclude_array ); ++$c )\n\t\t\t\t\t$exclude_string .= \"($exclude_array[$c])|\" ;\n\n\t\t\t\tif ( $exclude_string ) { $exclude_string = substr_replace( $exclude_string, \"\", -1 ) ; }\n\t\t\t}\n\n\t\t\t$reset = 60*60*24*$auto_initiate_reset ;\n\t\t\t$auto_initiate = $auto_initiate_duration_flag = $auto_initiate_footprints_flag = $auto_initiate_exclude_flag = 0 ;\n\n\t\t\tif ( $auto_initiate_duration && ( ( $now - $ipinfo[\"i_timestamp\"] ) >= $auto_initiate_duration ) )\n\t\t\t\t$auto_initiate_duration_flag = 1 ;\n\t\t\tif ( $auto_initiate_footprints && ( $ipinfo[\"i_footprints\"] >= $auto_initiate_footprints ) )\n\t\t\t\t$auto_initiate_footprints_flag = 1 ;\n\t\t\tif ( $exclude_string && preg_match( \"/$exclude_string/\", $onpage ) )\n\t\t\t\t$auto_initiate_exclude_flag = 1 ;\n\n\t\t\tif ( ( $auto_initiate_andor == 2 ) && ( $auto_initiate_duration_flag && $auto_initiate_footprints_flag ) && !$auto_initiate_exclude_flag )\n\t\t\t\t$auto_initiate = 1 ;\n\t\t\telse if ( ( $auto_initiate_andor == 1 ) && ( $auto_initiate_duration_flag || $auto_initiate_footprints_flag ) && !$auto_initiate_exclude_flag )\n\t\t\t\t$auto_initiate = 1 ;\n\n\t\t\tif ( $initiate && $auto_initiate && ( $ipinfo[\"i_initiate\"] <= $now ) )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"/$ip/\", $VALS[\"CHAT_SPAM_IPS\"] ) )\n\t\t\t\t\t$isonline = 0 ;\n\t\t\t\telse\n\t\t\t\t\t$isonline = ( is_file( \"$CONF[CHAT_IO_DIR]/online_$deptid.info\" ) ) ? 1 : 0 ;\n\n\t\t\t\tif ( $isonline )\n\t\t\t\t{\n\t\t\t\t\tif ( !is_file( \"$CONF[TYPE_IO_DIR]/$ip.txt\" ) )\n\t\t\t\t\t\ttouch( \"$CONF[TYPE_IO_DIR]/$ip.txt\" ) ;\n\t\t\t\t\t$i_initiate = $now + $reset ;\n\t\t\t\t\t$i_footprints = 0 ;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$i_initiate = $ipinfo[\"i_initiate\"] ;\n\t\t\t\t\t$i_footprints = $ipinfo[\"i_footprints\"] + $i_footprints ;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( $initiate )\n\t\t\t{\n\t\t\t\t$i_initiate = $ipinfo[\"i_initiate\"] ;\n\t\t\t\t$i_footprints = $ipinfo[\"i_footprints\"] + $i_footprints ;\n\t\t\t}\n\t\t\telse if ( $t_initiate || $request )\n\t\t\t{\n\t\t\t\t// if initiated by opertaor, reset the auto initiate values\n\t\t\t\t$i_initiate = $now + $reset ;\n\t\t\t\t$i_footprints = 0 ;\n\t\t\t}\n\n\t\t\tif ( !$i_timestamp )\n\t\t\t\t$i_timestamp = $ipinfo[\"i_timestamp\"] ;\n\n\t\t\t/* end auto initiate area */\n\t\t\t/*****************************************/\n\t\t}\n\t\telse\n\t\t\t$i_initiate = 0 ;\n\n\t\tif ( isset( $ipinfo[\"ip\"] ) )\n\t\t\t$query = \"UPDATE p_ips SET created = $now, $t_query i_footprints = $i_footprints, i_timestamp = $i_timestamp, i_initiate = $i_initiate WHERE ip = '$ip_md5'\" ;\n\t\telse\n\t\t\t$query = \"INSERT INTO p_ips VALUES ( '$ip_md5', $now, $t_footprints, $t_requests, $t_initiate, $i_footprints, $i_timestamp, $i_initiate )\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\n\t\tif ( $dbh[ 'ok' ] )\n\t\t\treturn true ;\n\t\treturn false ;\n\t}", "function setTimestamp($lastVisit, $faqid){\n\t\tglobal $connection;\n\t\t\n\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t\n\t\t$query = \"INSERT INTO faq_tbllog\n\t\t\t(faqid, viewdate, visitorIP)\n\t\t\tVALUES ('$faqid', '$lastVisit', '$ip')\";\n\t\t$faq_set = mysql_query($query, $connection);\n\t\tconfirm_query($faq_set);\n\t}", "public static function addVisitor() {\n $now = time();\n $today = date( 'Ymd', time() );\n $ip = ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) ? md5( $_SERVER['REMOTE_ADDR'] ) : 'empty:ip:address';\n file_put_contents ( self::RAW_FILE_VISITORS . $today . '.php' , $now . ';' . $ip . PHP_EOL, FILE_APPEND | LOCK_EX );\n }", "function add_banned_ip($ip=null){\r\n\t\tif(empty($ip)){$ip=$_SERVER['REMOTE_ADDR'];}\r\n\t\tglobal $auto_restrict;\r\n\t\t\r\n\t\tif (isset($auto_restrict[\"banned_ip\"][$ip])){\r\n\t\t\t$auto_restrict[\"banned_ip\"][$ip]['nb']++;\r\n\t\t}else{\r\n\t\t\t$auto_restrict[\"banned_ip\"][$ip]['nb']=1;\r\n\t\t}\r\n\t\t\r\n\t\t$auto_restrict[\"banned_ip\"][$ip]['date']=@date('U')+$auto_restrict['IP_banned_expiration_delay'];\r\n\t\tfile_put_contents(PATH.$auto_restrict[\"banned_ip_filename\"],'<?php /*Banned IP*/ $auto_restrict[\"banned_ip\"]='.var_export($auto_restrict[\"banned_ip\"],true).' ?>');\r\n\t}", "function noteLimit($action) {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }\n //whether ip is from proxy\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n //whether ip is from remote address\n else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n\n $cryptIP = hash(\"sha512\", $_ENV['SALT'].\"-\".$ip);\n\n // Create connection\n $conn = new mysqli($_ENV['DB_SERVER'], $_ENV['USERNAME'], $_ENV['PASSWORD'], $_ENV['DB_NAME']);\n\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n\n $rateLimitCheck = \"SELECT COUNT(*) FROM `hits` where `date` > (CURRENT_TIMESTAMP - 60) AND `iphash` = '$cryptIP'\";\n $rateLimitCheckResult = $conn->query($rateLimitCheck);\n while ($row = $rateLimitCheckResult->fetch_assoc()) {\n $count = $row[\"COUNT(*)\"];\n break;\n }\n \n if($count > 15) {\n http_response_code(429);\n die(\"Rate Limited\");\n }\n\n $sqlquery = \"INSERT INTO hits (id, iphash, date, operation) VALUES (NULL, '$cryptIP', NOW(), '$action') \";\n $result = $conn->query($sqlquery);\n if ($result === FALSE) {\n echo \"Error: \" . $sqlquery . \"<br>\" . $conn->error;\n return false;\n }\n\n return true;\n}", "function increase_attempt($ip_address, $login)\n {\n $la = new LoginAttempts();\n $la->ip_address = $ip_address;\n $la->login = $login;\n $la->save();\n \n //$this->db->insert(self::TABLE, array('ip_address' => $ip_address, 'login' => $login));\n }", "public function updateProxyStats($ip, $data)\n\t{\n\t\t// Check if IP is set\n\t\tif(is_null($ip))\n\t\t\treturn false;\n\n\t\tif($proxy = Proxy::whereIp($ip)->first())\n\t\t{\n\t\t\t$proxy->last_result\t\t= $data['last_result'];\n\t\t\t$proxy->last_load_time\t= $data['last_load_time'];\n\t\t\t$proxy->error_html\t\t= $data['error_html'];\n\n\t\t\tif($proxy->save())\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn false;\n\t}", "function ttc_add_to_ip_blacklist( $ip )\n{\n global $wpdb;\n $ip_table_name = $wpdb->prefix . \"ttc_ip_blacklist\";\n\t\t\t\n\t\t\n // sanity check user input\n $ip = htmlentities($ip);\n\t\t\t\n // add cleaned input into the database\n $sql = \"INSERT INTO \" . $ip_table_name . \" ( ip ) VALUES ( '$ip' )\";\n $result = $wpdb->query( $sql );\n}", "protected function putIPOnBlacklist($ip): void\n {\n $time = time();\n\n if($ip != \"\"){\n $update = $this->db->prepare(\"INSERT INTO `ip_blacklist` VALUES ('$ip', $time) ON DUPLICATE KEY UPDATE `last_update` = $time;\");\n $update->execute();\n }\n }", "function addsip($account,$callerid,$action) {\n sipexists();\n global $db;\n\n if ($action == \"add\") {\n\n $devices = extension_list();\n if (is_array($devices)) {\n foreach($devices as $device) {\n if ($device[0] === $account) {\n echo \"<script>javascript:alert('\"._(\"This SIP Extension [\").$device[0].(\"] is already in use\").\"');</script>\";\n return false;\n }\n }\n }\n\n }\n\n $sipfields = array(array($account,'account',$account),\n array($account,'accountcode',(isset($_REQUEST['accountcode']))?$_REQUEST['accountcode']:''),\n array($account,'secret',(isset($_REQUEST['secret']))?$_REQUEST['secret']:''),\n array($account,'canreinvite',(isset($_REQUEST['canreinvite']))?$_REQUEST['canreinvite']:'no'),\n array($account,'context',(isset($_REQUEST['context']))?$_REQUEST['context']:'from-internal'),\n array($account,'dtmfmode',(isset($_REQUEST['dtmfmode']))?$_REQUEST['dtmfmode']:'rfc2833'),\n array($account,'host',(isset($_REQUEST['host']))?$_REQUEST['host']:'dynamic'),\n array($account,'type',(isset($_REQUEST['type']))?$_REQUEST['type']:'friend'),\n array($account,'mailbox',(isset($_REQUEST['mailbox']))?$_REQUEST['mailbox']:''),\n array($account,'username',(isset($_REQUEST['username']))?$_REQUEST['username']:''),\n array($account,'nat',(isset($_REQUEST['nat']))?$_REQUEST['nat']:'no'),\n array($account,'port',(isset($_REQUEST['port']))?$_REQUEST['port']:'5060'),\n array($account,'qualify',(!empty($_REQUEST['qualify']))?$_REQUEST['qualify']:'no'),\n array($account,'callgroup',(isset($_REQUEST['callgroup']))?$_REQUEST['callgroup']:''),\n array($account,'pickupgroup',(isset($_REQUEST['pickupgroup']))?$_REQUEST['pickupgroup']:''),\n array($account,'disallow',(isset($_REQUEST['disallow']))?$_REQUEST['disallow']:''),\n array($account,'allow',(isset($_REQUEST['allow']))?$_REQUEST['allow']:''),\n array($account,'record_in',(isset($_REQUEST['record_in']))?$_REQUEST['record_in']:'Never'),\n array($account,'record_out',(isset($_REQUEST['record_out']))?$_REQUEST['record_out']:'Never'),\n array($account,'nocall',(isset($_REQUEST['nocall']))?$_REQUEST['nocall']:''),\n array($account,'allowcall',(isset($_REQUEST['allowcall']))?$_REQUEST['allowcall']:''),\n array($account,'subscribecontext',(isset($_REQUEST['subscribecontext']))?$_REQUEST['subscribecontext']:'ext-local'),\n array($account,'rob',(isset($_REQUEST['rob']))?$_REQUEST['rob']:'Never'),\n array($account,'cw',(isset($_REQUEST['cw']))?$_REQUEST['cw']:'Never'),\n array($account,'allowsubscribe',(isset($_REQUEST['allowsubscribe']))?$_REQUEST['allowsubscribe']:''),\n array($account,'call-limit',(!empty($_REQUEST['calllimit']))?$_REQUEST['calllimit']:'99'),\n array($account,'videosupport',(isset($_REQUEST['videosupport']))?$_REQUEST['videosupport']:''),\n array($account,'t38pt_udptl',(isset($_REQUEST['t38pt_udptl']))?$_REQUEST['t38pt_udptl']:''),\n array($account,'language',(isset($_REQUEST['language']))?$_REQUEST['language']:''),\n array($account,'callerid',$callerid));\n\n\n $compiled = $db->prepare('INSERT INTO sip (id, keyword, data) values (?,?,?)');\n $result = $db->executeMultiple($compiled,$sipfields);\n if(DB::IsError($result)) {\n die($result->getMessage().\"<br><br>\".'error adding to SIP table');\n }\n\n $sql = \"INSERT INTO globals VALUES ('E$account', 'SIP')\";\n $result = $db->query($sql);\n if(DB::IsError($result)) {\n die($result->getMessage().\"<br><br>\".'error adding to Globals table');\n }\n\n\n if ($_REQUEST['outcid'] != '') {\n\n $outcid = $_REQUEST['outcid'];\n $sql = \"INSERT INTO globals VALUES ('ECID$account', '$outcid')\";\n $result = $db->query($sql);\n if(DB::IsError($result)) {\n die($result->getMessage().\"<br><br>\".'error adding to Globals table');\n }\n\n }\n\n if ($_REQUEST['ringtime'] != '') {\n\n $ringtime = $_REQUEST['ringtime'];\n $sql = \"INSERT INTO globals VALUES ('RINGTIME$account', '$ringtime')\";\n $result = $db->query($sql);\n if(DB::IsError($result)) {\n die($result->getMessage().\"<br><br>\".'error adding to Globals table');\n }\n\n }\n\n return true;\n}", "function updateAdmin($MyIP)\r\r\n {\r\r\n global $db;\r\r\n $sql = \"update \".TBL_ADMIN.\" set \".LOGINIP.\"='\".$MyIP.\"', \".LASTACCESS.\"=now()\";\r\r\n $db->query($sql);\r\r\n }", "public function LoginUpdate()\n\t{\n\t\t$time = time();\n\t\t$uid = $this->user['loggedin'] ? $this->user['id'] : 0;\n\t\t\n\t\t//Build UPDATE Query for existing entry\n\t\t$query = new MMQueryBuilder();\n\t\t$query->Update(\"`online`\")->Where(\"`uid` = '%s' AND `ip` = '%s'\", $uid, GetIp())\n\t\t->Columns(array(\n\t\t\t'`lastvisit`'\t=> \"'%s'\",\n\t\t\t'`online`'\t\t=> \"'1'\",\t\n\t\t), time());\n\t\t\n\t\tif($this->firstvisit) //If firstvisit\n\t\t{\n\t\t\t$query->AddColumns(array('`firstvisit`' => \"CURRENT_TIMESTAMP\"));\n\t\t}\n\t\tif($GLOBALS['AJAX_PAGE'] != true) //If it is not an ajax page, add extra columns\n\t\t{\n\t\t\t$query->AddColumns(array(\n\t\t\t\t'`request_uri`' => \"'%s'\",\n\t\t\t\t'`visits`' => \"`visits` + 1\",\n\t\t\t\t'`header_host`'\t\t\t=> \"'%s'\",\n\t\t\t\t'`header_connection`'\t=> \"'%s'\",\n\t\t\t\t'`header_user_agent`'\t=> \"'%s'\",\n\t\t\t\t'`header_cache_control`'=> \"'%s'\",\n\t\t\t\t'`header_accept`'\t\t=> \"'%s'\",\n\t\t\t\t'`header_accept_encoding`'=>\"'%s'\",\n\t\t\t\t'`header_accept_language`'=>\"'%s'\",\n\t\t\t\t'`header_accept_charset`'=> \"'%s'\",\n\t\t\t), $_SERVER['REQUEST_URI'], $_SERVER['HTTP_HOST'], $_SERVER['HTTP_CONNECTION'], $_SERVER['HTTP_USER_AGENT'], $_SERVER['HTTP_CACHE_CONTROL'], $_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_ENCODING'], $_SERVER['HTTP_ACCEPT_LANGUAGE'], $_SERVER['HTTP_ACCEPT_CHARSET']);\n\t\t}\n\t\t$query->Build();\n\t\t$result = $this->db->query($query, DBNAME);\n\t\t\n\t\t//Build INSERT Query for new entry\n\t\tif($this->db->affected_rows < 1 && $GLOBALS['AJAX_PAGE'] != true)\n\t\t{\n\t\t\t$query = new MMQueryBuilder();\n\t\t\t$query->Insert(\"`online`\")\n\t\t\t->Columns(array(\n\t\t\t\t'`uid`'\t\t\t\t\t=> \"'%s'\",\n\t\t\t\t'`ip`'\t\t\t\t\t=> \"'%s'\",\n\t\t\t\t'`lastvisit`'\t\t\t=> \"'%s'\",\n\t\t\t\t'`online`'\t\t\t\t=> \"'1'\",\n\t\t\t\t'`visits`'\t\t\t\t=> \"'1'\",\n\t\t\t\t'`request_uri`'\t\t\t=> \"'%s'\",\n\t\t\t\t'`header_host`'\t\t\t=> \"'%s'\",\n\t\t\t\t'`header_connection`'\t=> \"'%s'\",\n\t\t\t\t'`header_user_agent`'\t=> \"'%s'\",\n\t\t\t\t'`header_cache_control`'=> \"'%s'\",\n\t\t\t\t'`header_accept`'\t\t=> \"'%s'\",\n\t\t\t\t'`header_accept_encoding`'=>\"'%s'\",\n\t\t\t\t'`header_accept_language`'=>\"'%s'\",\n\t\t\t\t'`header_accept_charset`'=> \"'%s'\",\t\n\t\t\t),\n\t\t\t$uid, GetIp(), time(), $_SERVER['REQUEST_URI'], $_SERVER['HTTP_HOST'], $_SERVER['HTTP_CONNECTION'], $_SERVER['HTTP_USER_AGENT'], $_SERVER['HTTP_CACHE_CONTROL'], $_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_ENCODING'], $_SERVER['HTTP_ACCEPT_LANGUAGE'], $_SERVER['HTTP_ACCEPT_CHARSET']);\n\t\n\t\t\tif($this->firstvisit)\n\t\t\t{\n\t\t\t\t$query->AddColumns(array('`firstvisit`' => \"CURRENT_TIMESTAMP\"));\n\t\t\t}\n\t\t\t$query->Build();\n\t\t\t$result = $this->db->query($query, DBNAME);\n\t\t}\n\t}", "function addIP_toBlackList($ip, $time_of)\n{\n $conn = new PDO('mysql:dbname=DB;host=HOST;charset=utf8', USER, PASS);\n $conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $stmt = $conn->prepare(\"INSERT INTO blacklisted VALUES(:blacklisted_ips, :time_of)\");\n $stmt->bindValue(':blacklisted_ips', $ip);\n $stmt->bindValue(':time_of', $time_of);\n\n $stmt->execute();\n}", "function logInsert() {\n\t\t\treturn \"'\".Modul::getUserName().\"','\".date('Y-m-d H:i:s').\"','\".$_SERVER['REMOTE_ADDR'].\"'\";\n\t\t}", "function stat_insertHit()\n\t{\n\t\t$OBJ =& get_instance();\n\t\t\n\t\tif (!$OBJ)\n\t\t{\n\t\t\t$OBJ =& load_class('core', true, 'lib');\n\t\t}\n\t\n\t\t$stat = $this->stat_doStats();\n\t\t\n\t\t// ignore ip's listed in the config file\n\t\t//if ($this->stat_ignore_hit($stat['ip']) == true) return;\n\t\t\n\t\t// it needs to end with a '/' for it to be a stat\n\t\t//if ((substr($stat['uri'], -1) != '/')) return;\n\n\t\t// we don't refer to ourselves\n\t\t$found = strpos($this->stat_reduceURL($stat['ref']), $this->stat_reduceURL(BASEURL));\n\t\t$stat['ref'] = ($found === false) ? $stat['ref'] : '';\n\t\t\n\t\t// get country if the database exists\n\t\t/*\n\t\tif ($stat['ip'] != '')\n\t\t{\n\t\t\t$ip = sprintf(\"%u\", ip2long($stat['ip']));\n\t\t\n\t\t\t$rs = $OBJ->db->fetchRecord(\"SELECT country_name FROM iptocountry \n\t\t\t\tWHERE ip_from <= \" . $OBJ->db->escape($ip) . \" AND ip_to >= \" . $OBJ->db->escape($ip) . \"\");\n\t\n\t\t\tif ($rs) \n\t\t\t{\n\t\t\t\t$c = trim(ucwords(preg_replace(\"/([A-Z\\xC0-\\xDF])/e\",\n\t\t\t\t\t\"chr(ord('\\\\1')+32)\", $rs['country_name'])));\n\t\t\t\t\n\t\t\t\t$clean['hit_country'] = $c;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t\t\n\t\t$clean['hit_addr']\t\t= $stat['ip'];\n\t\t//$clean['hit_lang']\t\t= $stat['lang'];\n\t\t$clean['hit_referrer']\t= $stat['ref'];\n\t\t$clean['hit_page']\t\t= $stat['uri'];\n\t\t$clean['hit_keyword']\t= $stat['keywords'];\n\t\t$clean['hit_time']\t\t= getNow();\n\t\t$clean['hit_month']\t\t= substr($clean['hit_time'], 0, 7);\n\t\t$clean['hit_day']\t\t= substr($clean['hit_time'], 0, 10);\n\t\t\n\t\t$OBJ->db->insertArray(PX.\"stats\", $clean);\n\t\t\n\t\t$this->add_page_count($clean['hit_page']);\n\t\t\n\t\t// what about archiving stats_absolute_deviation\n\t\t$this->archive_stats();\n\t\n\t\treturn;\n\t}", "protected function updateUserBucket($userid, $ip): void\n {\n if (\\is_numeric($userid) && $ip != \"\"){\n $time = time();\n $update = $this->db->prepare(\"INSERT INTO `sec_user_bucket` VALUES($userid, 1, $time)\n ON DUPLICATE KEY UPDATE `bucket` = `bucket` + 1, `last_failure` = $time;\");\n $update->execute(); \n }\n }", "function add_member_hours($newActivity, $newLocation, $sqlDate, $newHours, $memberId, $newProject){\n //added by drdan\n writeDrDanLog($memberId,$sqlDate,$newProject,$newActivity,$newLocation,$newHours);\n\n $dsn = 'localhost';\n $username = 'root';\n $dbpass = '';\n $db_name = 'db358933030'; \n $conn = mysqli_connect($dsn, $username, $dbpass, $db_name) or die (\"could not connect to mysql\");\n \n\t\tmysqli_query($conn, \"INSERT INTO VolunteerHours \n\t\t(activity, location ,volDate, numHours, memberId, projectId) VALUES ('$newActivity', '$newLocation', '$sqlDate', $newHours, $memberId, $newProject)\")\n\t\tor die(mysqli_error($conn));\n\t}", "function insert(){\n $sql = \"INSERT INTO `user_info` (`user_id`, `name`, `passwd`, `grp`, `type`, `scid`, `ipaddr`)\n VALUES (?, ?, ?, ?, ?, ?, ?)\";\n $this->db->query($sql,array($this->user_id, $this->name, $this->passwd, $this->grp, $this->type, $this->scid, $this->ipaddr));\n }", "function log_greetcard($to, $from, $pic, $msg)\n{\n global $wpdb;\n \n $now = gmdate(\"Y-m-d H:i:s\",time() + ( get_option('gmt_offset') * 60 * 60 ));\n \n $sql = \"insert into \". $wpdb->prefix . \"wpgreet_stats values (0,'\" . $now . \"', '\" . $from . \"','\" . $to . \"','\" . $pic . \"','\" . esc_sql($msg). \"','\". $_SERVER[\"REMOTE_ADDR\"] . \"');\" ;\n\n $wpdb->query($sql); \n}", "function insertStat($db, $event_id, $stat, $site_id) {\n\t$identifier = value($stat, 'id');\n\t$object_id = lookupObject($db, $stat, $site_id);\n\t$count = value($stat, 'count');\n\n\t// NB: Purge sensitive details uploaded from early versions of imagej-usage.\n\t// While these versions were only available for a couple of hours,\n\t// let's avoid polluting the objects table with things like file paths.\n\t//\n\t// This regex culls any legacy arg containing a forward slash.\n\t$identifier = preg_replace('/^(legacy:[^?]*)\\?.*\\/.*$/', '$1', $identifier);\n\n\t$statement = $db->prepare(\"INSERT INTO stats \" .\n\t\t\"(event_id, object_id, count) VALUES (?, ?, ?)\");\n\t$statement->bind_param('iii', $event_id, $object_id, $count);\n\treturn insert($db, $statement);\n}", "function common($db){\r\n $con=$db->start();\r\n if($db->status){\r\n $agent=$_SERVER['HTTP_USER_AGENT'];\r\n $ip=$_SERVER['REMOTE_ADDR'];\r\n $page=$_SERVER['REQUEST_URI'];\r\n $query=\"INSERT INTO `visitors`(`ip`, `time`, `page`, `agent`) VALUES ('$ip',now(),'$page','$agent')\";\r\n mysqli_query($con, $query);\r\n }\r\n}", "function addLocationForUser($userId, $longitude, $latitude) {\n\n $stmt = $this->conn->prepare(\"INSERT INTO n2u_user_history(user_id, longitude, latitude, date_visited) values(?, ?, ?, NOW())\");\n $stmt->bind_param(\"idd\", $userId, $longitude, $latitude);\n\n $stmt->execute();\n\n $stmt->close();\n return \"Success \";\n }", "function db_exec($dbh,$sql,$skipauth=0,$skiphist=0,&$wantlastid=0)\n{\nglobal $authstatus,$userdata, $remaddr, $dblogsize,$errorstr,$errorbt;\n\n //if (!$skipauth && !$authstatus) {echo \"<big><b>Not logged in</b></big><br>\";return 0;}\n if (stristr($sql,\"insert \")) $skiphist=1; //for lastid function to work.\n\n //find user access\n $usr=$userdata[0]['username'];\n $sqlt=\"SELECT usertype FROM users where username='$usr'\";\n $sth=$dbh->prepare($sqlt);\n $sth->execute();\n $ut=$sth->fetch(PDO::FETCH_ASSOC);\n $usertype=($ut['usertype']);\n $sth->closeCursor();\n\n if (!$skipauth && $usertype && (stristr($sql,\"DELETE\") || stristr($sql,\"UPDATE\") || stristr($sql,\"INSERT\")) \n && !stristr($sql,\" tt \")) { /*tt:temporary table used for complex queries*/\n echo \"<big><b>Access Denied, user '$usr' is read-only</b></big><br>\";\n return 0;\n }\n\n $r=$dbh->exec($sql);\n $error = $dbh->errorInfo();\n if($error[0] && isset($error[2])) {\n $errorstr= \"<br><b>db_exec:DB Error: ($sql): \".$error[2].\"<br></b>\";\n $errorbt = debug_backtrace();\n echo \"</table></table></div>\\n<pre>\".$errorstr;\n print_r ($errorbt);\n return 0;\n }\n $wantlastid=$dbh->lastInsertId();\n\n if (!$skiphist) {\n $hist=\"\";\n $t=time();\n $escsql=str_replace(\"'\",\"''\",$sql);\n $histsql=\"INSERT into history (date,`sql`,ip,authuser) VALUES ($t,'$escsql','$remaddr','\".$_COOKIE[\"itdbuser\"].\"')\";\n //update history table\n $rh=$dbh->exec($histsql);\n $lasthistid=$dbh->lastInsertId();\n\n $error = $dbh->errorInfo();\n if($error[0] && isset($error[2])) {\n $errorstr= \"<br><b>HIST DB Error: ($histsql): \".$error[2].\"<br></b>\";\n $errorbt = debug_backtrace();\n echo $errorstr;\n print_r ($errorbt);\n return 0;\n }\n else { /* remove old history entries */\n\t$lastkeep=(int)($lasthistid)-$dblogsize;\n\t$sql=\"DELETE from history where id<$lastkeep\";\n\t$sth=$dbh->exec($sql);\n }\n\n }\n return $r;\n}", "function member_tracking_update()\n{\n\tglobal $ZONE;\n\t$page=get_param('page',$ZONE['zone_default_page']);\n\t$type=get_param('type','/');\n\t$id=get_param('id','/',true);\n\tif ($type=='/') $type='';\n\tif ($id=='/') $id='';\n\n\t$GLOBALS['SITE_DB']->query('DELETE FROM '.get_table_prefix().'member_tracking WHERE mt_time<'.strval(time()-60*intval(get_option('users_online_time'))).' OR (mt_member_id='.strval((integer)get_member()).' AND '.db_string_equal_to('mt_type',$type).' AND '.db_string_equal_to('mt_id',$id).' AND '.db_string_equal_to('mt_page',$page).')');\n\n\t$GLOBALS['SITE_DB']->query_insert('member_tracking',array(\n\t\t'mt_member_id'=>get_member(),\n\t\t'mt_cache_username'=>$GLOBALS['FORUM_DRIVER']->get_username(get_member()),\n\t\t'mt_time'=>time(),\n\t\t'mt_page'=>$page,\n\t\t'mt_type'=>$type,\n\t\t'mt_id'=>$id\n\t),false,true); // Ignore errors for race conditions\n}", "public function log_attempts($activity, $user_id) {\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n $ip = $_SERVER['REMOTE_ADDR'];\n\n $log = new UserHistory; //initiate Model\n $log->user_id = $user_id;\n $log->activity = $activity;\n $log->ip = $ip;\n $log->browser = $_SERVER['HTTP_USER_AGENT'];\n\n $log->referral = isset($_SERVER[\"HTTP_REFERER\"]) && !empty($_SERVER[\"HTTP_REFERER\"]) ? $_SERVER[\"HTTP_REFERER\"] : '';\n\n\n $log->save(); //save\n }", "public function sauver() {\n $db = DBMySQL::getInstance();\n $id_user = $this->id_user ?: 'DEFAULT';\n $req = \"INSERT INTO user VALUES ({$id_user}, {$db->esc($this->log)}, {$db->esc($this->mdp)}, {$db->esc($this->nom)}, {$db->esc($this->prenom)}, {$db->esc($this->telephone)}, {$this->admin}) ON DUPLICATE KEY UPDATE log = {$db->esc($this->log)}, mdp = {$db->esc($this->mdp)}, nom = {$db->esc($this->nom)}, prenom = {$db->esc($this->prenom)}, telephone = {$db->esc($this->telephone)}, admin = {$this->admin}\";\n $db->xeq($req);\n $this->id_user = $this->id_user ?: $db->pk();\n }", "public function insertEntry(Request $request)\n {\n $pageId = explode('/', $request->server('HTTP_REFERER'));\n $geoData = $this->getIPLocation($request->ip());\n $insert_object = new \\stdClass;\n foreach ($geoData as $key => $value) {\n $newInsertInStatsDB = new Ip2locationClientStats();\n $newInsertInStatsDB->ip_number = $this->convertIpAddressToIpNumber($request->ip());\n $newInsertInStatsDB->ip_address = $request->ip();\n $newInsertInStatsDB->date_action = date('Y-m-d H:i:s');\n $newInsertInStatsDB->country_code = $value->country_code;\n $newInsertInStatsDB->country_name = $value->country_name;\n $newInsertInStatsDB->region_name = $value->region_name;\n $newInsertInStatsDB->city_name = $value->city_name;\n $newInsertInStatsDB->latitude = $value->latitude;\n $newInsertInStatsDB->longitude = $value->longitude;\n $newInsertInStatsDB->zip_code = $value->zip_code;\n $newInsertInStatsDB->user_agent = $request->server('HTTP_USER_AGENT');\n $newInsertInStatsDB->stream_name = $request->guid; //\"test\"; //$pageId[6]\n $newInsertInStatsDB->title = $request->title;\n $newInsertInStatsDB->ip_version = 4;\n $newInsertInStatsDB->save();\n dd($newInsertInStatsDB);\n }\n return $insert_object;\n }", "function _set_last_ip_and_last_login($user_id) {\n\n $user_data['person_last_ip'] = $this->ci->input->ip_address();\n $user_data['person_last_login'] = date('Y-m-d H:i:s', strtotime('now'));\n\n $this->ci->backend_model->update_table('mm_person', $user_data, array('person_id' => $user_id));\n }", "function update_hits($ip, $domain, $agent) {\n global $con;\n\n $sel_query = \"\n SELECT Hits \n FROM ip \n WHERE ip = ? AND agent = ? AND domain = ? \";\n\n $upd_query = \"\n UPDATE ip \n SET Hits = ? \n WHERE ip = ? AND agent = ? AND domain = ? \";\n\n try {\n //first acquiring current hits\n $stmt = $con->prepare_statement($sel_query);\n\n //checking if query well written\n if (!$stmt)\n throw new Exception();\n\n $stmt->bind_param(\"sss\", $ip, $agent, $domain);\n $stmt->execute();\n\n $stmt->bind_result($hitsB);\n while ($stmt->fetch())\n $hits = ((int) $hitsB) + 1;\n\n $stmt->close();\n $stmt = null;\n\n //now updating them\n $stmt = $con->prepare_statement($upd_query);\n\n //checking if query well written again\n if (!$stmt)\n throw new Exception();\n\n $stmt->bind_param(\"isss\", $hits, $ip, $agent, $domain);\n\n $stmt->execute();\n if ($stmt->affected_rows != 1)\n throw new Exception();\n\n $stmt->close();\n return true;\n } catch (Exception $x) {\n return false;\n }\n}", "function addPageview() {\n\t\t$dayzero = mktime( 0, 0, 0, date( \"m\" ), date( \"d\" ), date( \"Y\" ));\n\t\t$this->mDb->StartTrans(); // base method StartTrans will clearFromCache\n\t\t$query = \"UPDATE `\".BIT_DB_PREFIX.\"stats_pageviews` SET `pageviews`=`pageviews`+1 WHERE `stats_day`=?\";\n\t\t$this->mDb->query( $query, array( $dayzero ));\n\t\t// if the above didn't affect the db, we know that the entry doesn't exist yet.\n\t\tif( !$this->mDb->Affected_Rows() ) {\n\t\t\t$query = \"INSERT INTO `\".BIT_DB_PREFIX.\"stats_pageviews`( `pageviews`, `stats_day` ) VALUES( ?, ? )\";\n\t\t\t$this->mDb->query( $query, array( 1, $dayzero ));\n\t\t}\n\t\t$this->mDb->CompleteTrans();\n\t}", "function log_stats($string, $pg_time)\n{\n if (!addon_installed('stats')) {\n return;\n }\n\n if ((get_option('site_closed') == '1') && (get_option('stats_when_closed') == '0')) {\n return;\n }\n\n if ((get_option('super_logging') == '1') || (get_param_string('track', null) !== null)) {\n $get = substr(flatten_slashed_array($_GET), 0, 255);\n $post2 = $_POST;\n unset($post2['password']);\n unset($post2['password_confirm']);\n unset($post2['decrypt']);\n $post = flatten_slashed_array($post2);\n } else {\n $get = '';\n $post = '';\n }\n $page = $string;\n $ip = get_ip_address();\n $session_id = get_session_id();\n global $IS_ACTUALLY;\n $member = ($IS_ACTUALLY === null) ? get_member() : $IS_ACTUALLY;\n $time = time();\n $referer = cms_mb_substr(cms_srv('HTTP_REFERER'), 0, 255);\n $browser = cms_mb_substr(get_browser_string(), 0, 255);\n $os = cms_mb_substr(get_os_string(), 0, 255);\n if ($os === null) {\n $os = '';\n }\n\n if ((get_option('bot_stats') == '1') && ((stripos($browser, 'http:') !== false) || (stripos($browser, 'bot') !== false) || (get_bot_type() !== null))) {\n return;\n }\n\n $GLOBALS['SITE_DB']->query_insert('stats', array(\n 'access_denied_counter' => 0,\n 'browser' => $browser,\n 'operating_system' => $os,\n 'the_page' => $page,\n 'ip' => $ip,\n 'session_id' => $session_id,\n 'member_id' => $member,\n 'date_and_time' => $time,\n 'referer' => $referer,\n 's_get' => $get,\n 'post' => $post,\n 'milliseconds' => intval($pg_time),\n ), false, true);\n if (mt_rand(0, 100) == 1) {\n if (!$GLOBALS['SITE_DB']->table_is_locked('stats')) {\n $GLOBALS['SITE_DB']->query('DELETE FROM ' . get_table_prefix() . 'stats WHERE date_and_time<' . strval(time() - 60 * 60 * 24 * intval(get_option('stats_store_time'))), 500/*to reduce lock times*/);\n }\n }\n\n global $SITE_INFO;\n if (isset($SITE_INFO['throttle_bandwidth_views_per_meg'])) {\n if (!$GLOBALS['SITE_DB']->table_is_locked('values')) {\n set_value('page_views', strval(intval(get_value('page_views')) + 1));\n }\n }\n}", "public function add_user_activity($activity_info)\n {\n $activity_info[\"HTTP_USER_AGENT\"] = $_SERVER[\"HTTP_USER_AGENT\"];\n $activity_info[\"REMOTE_ADDR\"] = $_SERVER[\"REMOTE_ADDR\"];\n \n $this->query_insert($this->table_user_activity, $activity_info);\n }", "function putLogin($username) \n {\n $insert = \"INSERT INTO logins (ipaddress,logged_time,username)\n VALUES (:ip, DATETIME('now'), :username)\";\n $stmt = $this->handle->prepare($insert);\n \n // Bind parameters to statement variables\n $ip = inet_pton($_SERVER[\"REMOTE_ADDR\"]);\n $username = sqlite_escape_string($username);\n \n $stmt->bindParam(':ip', $ip);\n $stmt->bindParam(':username', $username);\n \n try {\n $stmt->execute();\n } catch (PDOException $e) {\n throw new Exception('SQLITE ERROR:' .$e->getMessage());\n }\n \n\t}", "public function setLoginHistory()\r\n\t\t{\r\n\t\t\t\tif ($this->_formUsername != '') {\r\n\t\t\t\t\t\t$Db = Db::classCache();\r\n\t\t\t\t\t\t$Db->connect('classautomate');\r\n\t\t\t\t\t\t$intend = array(\r\n\t\t\t\t\t\t\t\t'table'=>'login_history',\r\n\t\t\t\t\t\t\t\t'columns'=>\"`dateTime`,`dbName`,`username`,`clientIp`,`result`\",\r\n\t\t\t\t\t\t\t\t'values'=>\"'\" . $this->_login['logDateTime'] . \"', '\" . $this->_login[dbName] .\r\n\t\t\t\t\t\t\t\t\"', '\" . $this->_login[username] . \"', '\" . $this->_login[ip] . \"', '\" . $this->_login[fullLogResult] . \"'\"\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$Db->insertSql($intend);\r\n\t\t\t\t}\r\n\t\t}", "function update_tracker($batch){\n\t\t$this->db->insert($this->tables['tracking'], $batch);\n\t}", "function update_log($description, $id, $id_type, $action_type) {\n global $db;\n \n //determine ID type, assign variables accordingly\n if ($id_type == \"employee\") {\n $employee_id = isset($_SESSION[\"employee_id\"]) ? $_SESSION[\"employee_id\"] : $id;\n $customer_id = null;\n $person_id = $employee_id;\n } else if ($id_type == \"customer\") {\n $customer_id = $id;\n $employee_id = null;\n $person_id = $customer_id;\n } else {\n $customer_id = null;\n $employee_id = null;\n $person_id = null;\n }\n \n $ip_address = $_SERVER['REMOTE_ADDR'];\n $timestamp = date(\"Y-m-d H:i:s\");\n \n /*\n echo \"Description: \" . $description . \"<br>\";\n echo \"ID: \" . $id . \"<br>\";\n echo \"ID type: \" . $id_type . \"<br>\";\n echo \"Customer ID: \" . $customer_id . \"<br>\";\n echo \"Employee ID: \" . $employee_id . \"<br>\";\n echo \"IP address: \" . $ip_address . \"<br>\";\n echo \"Timestamp: \" . $timestamp . \"<br>\";\n echo \"Action type: \" . $action_type . \"<br>\";\n */\n \n $status = false;\n $stmt = $db->prepare(\"INSERT INTO log (description, customer_id, employee_id, ip_address, timestamp, type) VALUES (?,?,?,?,?,?);\"); \n if (!$stmt->bind_param(\"siisss\", $description, $customer_id, $employee_id, $ip_address, $timestamp, $action_type))\n error(\"Unable to update log: failed to bind parameters.\");\n else if (!($status = $stmt->execute())) {\n error(\"Unable to update log: failed to update the database.\");\n echo $stmt->error;\n }\n $stmt->close();\n return $status;\n }", "function logaccess( $p_db, $p_user, $p_source, $p_detail ) {\n include('settings.php');\n $package = \"function.php\";\n\n $query = \"insert into inv_log set \" .\n \"log_id = NULL, \" .\n \"log_user = \\\"\" . $p_user . \"\\\", \" .\n \"log_source = \\\"\" . $p_source . \"\\\", \" .\n \"log_detail = \\\"\" . $p_detail . \"\\\"\";\n\n $insert = mysqli_query($p_db, $query) or die(header(\"Location: \" . $Siteroot . \"/error.php?script=\" . $package . \"&error=\" . $q_string . \"&mysql=\" . mysqli_error($p_db)));\n}", "public function insertUser()\n {\n $sql =\n \"INSERT INTO ip_numbers (ip, refresh, moment, blocked) VALUES\".\n \" ('\".\n $this->ip.\n \"', '\".\n $this->refreshs.\n \"', '\".\n $this->moment.\n \"', '\".\n $this->blocked.\n \"');\"\n ;\n \n return $this->influenceUser($sql);\n }", "function logVisit(){\n\t\t$user['subId']=$this->user_id;\n\t\t$user['time']=strtotime(\"now\");\n\t\tif($this->userProducts){\n\t\t\t$user['products']=implode(\",\",$this->userProducts);\n\t\t\tset_sess_vars(\"activeProducts\",\"-\".implode(\"-\",$this->userProducts).\"-\");\n\t\t}\n\t\t$id=insert_query(\"user_audit\",$user);\n\t\treturn $id;\n\t}", "function activity_log($user_id, $activity_type, $status_id = \"\", $descriptions = \"\")\n\t{\n\t\tglobal $conn;\n\t\t$user_ip = getUserIP();\n\t\t$date_time = date(\"Y-m-d H:i:s\");\n\t\t$strQuery = \"INSERT INTO tbllog (user_id, computer_name , activity_type, status_id, date_time, descriptions)\n\t\t\t\tVALUES ('\".(int)$user_id.\"', '\".$user_ip.\"', '\".$activity_type.\"', '\".(int)$status_id.\"' ,'\".$date_time.\"' ,'\".$descriptions.\"')\";\n\t\t\t\t//echo $sql_log; die;\n\t\tMySQLQuery($strQuery);\t\n\t}", "function update_user_in_db() {\n\n global $db, $USER, $REMOTE_ADDR, $CFG;\n\n if (!isset($USER->id))\n return false;\n\n $timenow = time();\n if ($db->Execute(\"UPDATE {$CFG->prefix}user SET lastIP='$REMOTE_ADDR', lastaccess='$timenow'\n WHERE id = '$USER->id' \")) {\n return true;\n } else {\n return false;\n }\n}", "public function updateSeedingHistory(): array {\n self::$db->prepared_query(\"\n CREATE TEMPORARY TABLE tmp_users_torrent_history (\n UserID int NOT NULL PRIMARY KEY,\n NumTorrents int NOT NULL DEFAULT 0,\n SumTime bigint NOT NULL DEFAULT 0,\n SeedingAvg int NOT NULL DEFAULT 0,\n KEY numtorrents_idx (NumTorrents)\n ) ENGINE=InnoDB\n \");\n\n // Find seeders that have announced within the last hour\n self::$db->prepared_query(\"\n INSERT INTO tmp_users_torrent_history\n (UserID, NumTorrents)\n SELECT uid, COUNT(DISTINCT fid)\n FROM xbt_files_users\n WHERE mtime > unix_timestamp(now() - INTERVAL 1 HOUR)\n AND Remaining = 0\n GROUP BY uid\n \");\n $info = ['new' => self::$db->affected_rows()];\n\n // Mark new records as \"checked\" and set the current time as the time\n // the user started seeding <NumTorrents> seeded.\n // Finished = 1 means that the user hasn't been seeding exactly <NumTorrents> earlier today.\n // This query will only do something if the next one inserted new rows last hour.\n self::$db->prepared_query(\"\n UPDATE users_torrent_history AS h\n INNER JOIN tmp_users_torrent_history AS t ON (t.UserID = h.UserID AND t.NumTorrents = h.NumTorrents)\n SET h.Finished = '0',\n h.LastTime = UNIX_TIMESTAMP(now())\n WHERE h.Finished = '1'\n AND h.Date = UTC_DATE() + 0\n \");\n $info['updated'] = self::$db->affected_rows();\n\n // Insert new rows for users who haven't been seeding exactly <NumTorrents> torrents earlier today\n // and update the time spent seeding <NumTorrents> torrents for the others.\n // Primary table index: (UserID, NumTorrents, Date).\n self::$db->prepared_query(\"\n INSERT INTO users_torrent_history\n (UserID, NumTorrents, Date)\n SELECT UserID, NumTorrents, UTC_DATE() + 0\n FROM tmp_users_torrent_history\n ON DUPLICATE KEY UPDATE\n Time = Time + UNIX_TIMESTAMP(now()) - LastTime,\n LastTime = UNIX_TIMESTAMP(now())\n \");\n $info['history'] = self::$db->affected_rows();\n\n return $info;\n }" ]
[ "0.6912838", "0.6686238", "0.66509545", "0.63986856", "0.6394218", "0.6366362", "0.62678784", "0.62334687", "0.6151393", "0.61446494", "0.61207724", "0.61177677", "0.6083804", "0.60785955", "0.60442495", "0.59818405", "0.59722847", "0.59629446", "0.59062237", "0.5881842", "0.58307177", "0.5822009", "0.58198434", "0.5760837", "0.57587624", "0.5741459", "0.5739764", "0.5720682", "0.5711619", "0.57010853", "0.5692983", "0.5692937", "0.5675483", "0.56726044", "0.5632503", "0.56230026", "0.56132245", "0.5611736", "0.56110597", "0.5605626", "0.5570283", "0.55492896", "0.5533935", "0.55329674", "0.5516752", "0.5502603", "0.54975784", "0.54955715", "0.54882354", "0.54804844", "0.5460978", "0.5459101", "0.545739", "0.542274", "0.54146516", "0.5409864", "0.53971434", "0.5369899", "0.5342891", "0.5340927", "0.53371525", "0.53323966", "0.53272617", "0.53249574", "0.53241915", "0.5320145", "0.5319627", "0.5301858", "0.5292692", "0.5275682", "0.5273381", "0.5271929", "0.5258413", "0.52491456", "0.52490723", "0.52480525", "0.52469134", "0.52415204", "0.52400565", "0.5224623", "0.5223604", "0.5205239", "0.52031016", "0.5201324", "0.5199724", "0.51934487", "0.51902217", "0.5185921", "0.51807815", "0.51557624", "0.5152445", "0.51522887", "0.51503646", "0.5146807", "0.5138211", "0.51377636", "0.5134435", "0.5129798", "0.5122703", "0.5121686" ]
0.8005047
0
check_username rebuild_all_preferences This rebuilds the user preferences for all installed users, called by the plugin functions
check_username rebuild_all_preferences Это пересоздает пользовательские предпочтения для всех установленных пользователей, вызывается функциями плагина
public static function rebuild_all_preferences() { $sql = "SELECT * FROM `user`"; $db_results = Dba::query($sql); User::fix_preferences('-1'); while ($row = Dba::fetch_assoc($db_results)) { User::fix_preferences($row['id']); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function force_userdata() {\n global $data_dir, $username;\n\n include(\"../plugins/retrieveuserdata/config.php\");\n\n if ($force != 0 && isset($username)) {\n $got_external_userdata = getPref($data_dir, $username, \"got_external_userdata\");\n if ($got_external_userdata == 0) {\n // if we have never got the user data before, ask someone\n retrieve_external_userdata();\n } else {\n // use backed up user data to avoid external data source access\n $common_name = getPref($data_dir, $username, \"full_name_backup\");\n $mail_address = getPref($data_dir, $username, \"email_address_backup\");\n set_userdata($common_name, $mail_address);\n }\n }\n }", "public static function rebuild_preferences() { \n\n\t\t// First remove garbage\n\t\t$sql = \"DELETE FROM `user_preference` USING `user_preference` LEFT JOIN `preference` ON `preference`.`id`=`user_preference`.`preference` \" . \n\t\t\t\"WHERE `preference`.`id` IS NULL\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t// Now add anything that we are missing back in, except System\n\t\t$sql = \"SELECT * FROM `preference` WHERE `type`!='system'\"; \t\n\n\t}", "protected function reloadUsers() {\n $this->auth = new auth_plugin_authplain();\n }", "function update_all_users(){\n\tglobal $wp_filesystem;\n\t$users = get_users();\n\techo \"updating all users theme...\";\n\tforeach ($users as $user) {\n\t\t$filename = get_theme_root() . \"/environment-\" . $user->user_login;\n\t\tif(file_exists($filename)){\n\t\t\t$wp_filesystem->delete($filename,true);\n\t\t\twp_mkdir_p($filename);\n\t\t\tcopy_dir(get_template_directory(), $filename);\t\t\t\n\t\t}\n\t}\n}", "function wp_set_all_user_settings($user_settings)\n{\n}", "function check_userdata() {\n global $data_dir, $username;\n\n include (\"../plugins/retrieveuserdata/config.php\");\n\n if (isset($username)) {\n $got_external_userdata = getPref($data_dir, $username, \"got_external_userdata\");\n\n // write initial value \n if ($got_external_userdata != 1 && $got_external_userdata != 0) {\n $got_external_userdata = 0;\n setPref($data_dir, $username, \"got_external_userdata\", 0);\n }\n\n // avoid unnecessary access of external data source\n if (($got_external_userdata == 0) || ($retrieve_on_every_login == 1)) {\n retrieve_external_userdata();\n } \n } \n }", "public function set_preferences() {\n\n\t\t$user_id = Dba::escape($this->id); \n\n\t\t$sql = \"SELECT preference.name,user_preference.value FROM preference,user_preference WHERE user_preference.user='$user_id' \" .\n\t\t\t\"AND user_preference.preference=preference.id AND preference.type != 'system'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\twhile ($r = Dba::fetch_assoc($db_results)) {\n\t\t\t$key = $r['name'];\n\t\t\t$this->prefs[$key] = $r['value'];\n\t\t} \n\t}", "function delete_all_user_settings()\n{\n}", "function get_all_user_settings()\n{\n}", "function user_pref_update( $p_user_id, $p_project_id, $p_prefs ) {\n\tstatic $t_vars;\n\t$c_user_id = db_prepare_int( $p_user_id );\n\t$c_project_id = db_prepare_int( $p_project_id );\n\n\tuser_ensure_unprotected( $p_user_id );\n\n\t$t_user_pref_table = db_get_table( 'mantis_user_pref_table' );\n\n\tif ($t_vars == null ) {\n\t\t$t_vars = getClassProperties( 'UserPreferences', 'protected');\n\t}\n\n\t$t_pairs = array();\n\t$t_values = array();\n\n\tforeach( $t_vars as $var => $val ) {\n\t\tarray_push( $t_pairs, \"$var = \" . db_param() ) ;\n\t\tarray_push( $t_values, $p_prefs->$var );\n\t}\n\n\t$t_pairs_string = implode( ', ', $t_pairs );\n\t$t_values[] = $c_user_id;\n\t$t_values[] = $c_project_id;\n\n\t$query = \"UPDATE $t_user_pref_table\n\t\t\t\t SET $t_pairs_string\n\t\t\t\t WHERE user_id=\" . db_param() . \" AND project_id=\" . db_param();\n\tdb_query_bound( $query, $t_values );\n\n\tuser_pref_clear_cache( $p_user_id, $p_project_id );\n\n\t# db_query errors on failure so:\n\treturn true;\n}", "function user_pref_set( $p_user_id, $p_prefs, $p_project_id = ALL_PROJECTS ) {\n\tif( user_pref_exists( $p_user_id, $p_project_id ) ) {\n\t\treturn user_pref_update( $p_user_id, $p_project_id, $p_prefs );\n\t} else {\n\t\treturn user_pref_insert( $p_user_id, $p_project_id, $p_prefs );\n\t}\n}", "function squirrelmail_plugin_init_retrieveuserdata() {\n global $squirrelmail_plugin_hooks;\n\n $squirrelmail_plugin_hooks[\"loading_prefs\"][\"retrieveuserdata\"] = \"check_userdata\";\n $squirrelmail_plugin_hooks[\"options_personal_save\"][\"retrieveuserdata\"] = \"force_userdata\";\n }", "function fillPrefsCache($user) {\n global $prefs_cache, $use_pdo, $pdo_show_sql_errors;\n\n if (!$this->open()) {\n return;\n }\n\n $prefs_cache = array();\n if ($use_pdo) {\n if (!($sth = $this->dbh->prepare('SELECT ' . $this->identifier_quote_char . $this->key_field . $this->identifier_quote_char . ' AS prefkey, ' . $this->identifier_quote_char . $this->val_field . $this->identifier_quote_char . ' AS prefval FROM ' . $this->identifier_quote_char . $this->table . $this->identifier_quote_char . ' WHERE ' . $this->identifier_quote_char . $this->user_field . $this->identifier_quote_char . ' = ?'))) {\n if ($pdo_show_sql_errors)\n $this->error = implode(' - ', $this->dbh->errorInfo());\n else\n $this->error = _(\"Could not prepare query\");\n $this->failQuery();\n }\n if (!($res = $sth->execute(array($user)))) {\n if ($pdo_show_sql_errors)\n $this->error = implode(' - ', $sth->errorInfo());\n else\n $this->error = _(\"Could not execute query\");\n $this->failQuery();\n }\n\n while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {\n $prefs_cache[$row['prefkey']] = $row['prefval'];\n }\n } else {\n $query = sprintf(\"SELECT %s as prefkey, %s as prefval FROM %s \".\n \"WHERE %s = '%s'\",\n $this->key_field,\n $this->val_field,\n $this->table,\n $this->user_field,\n $this->dbh->quoteString($user));\n $res = $this->dbh->query($query);\n if (DB::isError($res)) {\n $this->failQuery($res);\n }\n\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $prefs_cache[$row['prefkey']] = $row['prefval'];\n }\n }\n }", "function list_preferences()\n{\n echo \n '<table border=0 cellspacing=2 cellpadding=2><tr>\n <td colspan=\"1\" valign=\"top\" width=\"250\">\n <table border=0 cellspacing=2 cellpadding=2>\n <tr><td class=\"smallTitle\">User Preferences</td></tr>\n <tr><td> \n <a href=\"index.php?action=preferences&subcommand=changepasswordform\" class=\"preference\">\n change password</a>\n </td></tr>\n </table></td>';\n\n // check if user is an admin \n $cmd = \"../py/chiara.py user -u \" . $_SERVER['PHP_AUTH_USER'] . ' --is_admin ' .\n $_SERVER['PHP_AUTH_USER'];\n $output = shell_exec($cmd);\n if(intval($output) == 1){\n /* display a list of all admin preferences */\n echo\n '<td colspan=\"1\" valign=\"top\" width=\"250\">\n <table border=0 cellspacing=2 cellpadding=2>\n <tr><td class=\"smallTitle\">Admin Preferences</td></tr>\n <tr><td class=\"subTitle\">Manage users</td></tr>\n <tr><td>\n <a href=\"index.php?action=preferences&subcommand=adduserform\" class=\"preference\">Add user</a>\n </td></tr>\n <tr><td>\n <a href=\"index.php?action=preferences&subcommand=removeuserform\" class=\"preference\">Remove user</a>\n </td></tr>\n <tr><td>\n <a href=\"index.php?action=preferences&subcommand=listallusers\" class=\"preference\">List all users</a>\n </td></tr>\n\n <tr><td class=\"subTitle\">Manage groups</td></tr>\n <tr><td>\n <a href=\"index.php?action=preferences&subcommand=addgroupform&nrgroups=1&more=false&add=false\" class=\"preference\">Add groups</a>\n </td></tr>\n <tr><td>\n <a href=\"index.php?action=preferences&subcommand=removegroupform&nrgroups=1&more=false&remove=false\" class=\"preference\">Remove groups</a>\n </td></tr>\n <tr><td>\n <a href=\"index.php?action=preferences&subcommand=adduserstogroupform&nrusers=1&more=false&add=false\" class=\"preference\">Add users to group</a>\n </td></tr>\n <tr><td>\n <a href=\"index.php?action=preferences&subcommand=removeusersfromgroupform&nrusers=1&more=false&remove=false\" class=\"preference\">Remove users from group</a>\n </td></tr>\n <tr><td>\n <a href=\"index.php?action=preferences&subcommand=listallgroups\" class=\"preference\">List all groups</a>\n </td></tr>\n </table></td>';\n }\n echo '</tr></table>';\n}", "private function addUsernameAndPasswordChecksFromConfig()\n {\n // Minimum username length set in config?\n $min_length = $this->app->config->get('user.username.min_length');\n $this->scheme['fields']['username']['validate'][] = [\n 'TxtMinLength',\n $min_length,\n sprintf($this->app->language->get('user.error.username.length'), $min_length)\n ];\n\n // Regexp check für username set in config?\n $regexp = $this->app->config->get('user.username.regexp');\n\n if (!empty($regexp)) {\n $this->scheme['fields']['username']['validate'][] = [\n 'CustomRegexp',\n $regexp,\n sprintf($this->app->language->get('user.error.username.regexp'), $regexp)\n ];\n }\n\n // Password min and/or maxlength set in config?\n $min_length = $this->app->config->get('user.password.min_length');\n $max_length = $this->app->config->get('user.password.max_length');\n\n if (!empty($max_length)) {\n $this->scheme['fields']['password']['validate'][] = [\n 'TxtLengthBetween',\n [\n $min_length,\n $max_length\n ],\n sprintf($this->app->language->get('user.error.password.range'), $min_length, $max_length)\n ];\n }\n else {\n $this->scheme['fields']['password']['validate'][] = [\n 'TxtMinLength',\n $min_length,\n sprintf($this->app->language->get('user.error.password.min_length'), $min_length)\n ];\n }\n\n // Password regex check wanted by config?\n $regexp = $this->app->config->get('user.password.regexp');\n\n if (!empty($regexp)) {\n $this->scheme['fields']['password']['validate'][] = [\n 'CustomRegexp',\n $regexp,\n sprintf($this->app->language->get('user.error.password.regexp'), $regexp)\n ];\n }\n }", "function PREF_loadAllPreferenceValues()\n{\n\t$prefName = $_SESSION['preferenceName'];\n\tCHECK_FW(CC_clientpreferencesname, $prefName);\n\n\t$sql = \"SELECT DISTINCT var, value FROM `clientpreferences` WHERE name = '$prefName'\";\n\t$res = DB_query($sql); //FW ok\n\n\twhile($data = mysqli_fetch_assoc($res))\n\t{\n\t\t// If the group contains \"###\", it is intrepreted as a imploded array and needs to be converted back into an array\n\t\tif (preg_match('/###/',$data['value']))\n\t\t\t$data['value'] = explode(\"###\", $data['value']);\n\n\t\t$_SESSION['preferenceSpace'][$data['var']] = $data['value'];\n\t}\n\n\t$_SESSION['preferenceForceHTMLReloadValues'] = true;\n}", "function check_all_usernames($users, $course_list, $id_session)\n {\n $table_user = Database::get_main_table(TABLE_MAIN_USER);\n $usernames = array();\n $new_users = array();\n foreach ($users as $index => $user) {\n $desired_username = array();\n if (empty($user['UserName'])) {\n $desired_username = MySpace::make_username($user['FirstName'], $user['LastName'], '');\n $pre_username = $desired_username['username'].$desired_username['sufix'];\n $user['UserName'] = $pre_username;\n $user['create'] = '1';\n } else {\n if (UserManager::is_username_available($user['UserName'])) {\n $desired_username = MySpace::make_username($user['FirstName'], $user['LastName'], $user['UserName']);\n $user['UserName'] = $desired_username['username'].$desired_username['sufix'];\n $user['create'] = '1';\n } else {\n $is_session_avail = MySpace::user_available_in_session($user['UserName'], $course_list, $id_session);\n if ($is_session_avail == 0) {\n $user_name = $user['UserName'];\n $sql_select = \"SELECT user_id FROM $table_user WHERE username ='$user_name' \";\n $rs = Database::query($sql_select);\n $user['create'] = Database::result($rs, 0, 0); // This should be the ID because the user exists.\n } else {\n $user['create'] = $is_session_avail;\n }\n }\n }\n // Usernames is the current list of users in the file.\n $result_array = MySpace::check_user_in_array($usernames, $desired_username);\n $usernames = $result_array[0];\n $desired_username = $result_array[1];\n $user['UserName'] = $desired_username['username'].$desired_username['sufix'];\n $new_users[] = $user;\n }\n return $new_users;\n }", "function user_pref_delete_all( $p_user_id ) {\n\t$c_user_id = db_prepare_int( $p_user_id );\n\n\tuser_ensure_unprotected( $p_user_id );\n\n\t$t_user_pref_table = db_get_table( 'mantis_user_pref_table' );\n\n\t$query = 'DELETE FROM ' . $t_user_pref_table . ' WHERE user_id=' . db_param();\n\tdb_query_bound( $query, Array( $c_user_id ) );\n\n\tuser_pref_clear_cache( $p_user_id );\n\n\t# db_query errors on failure so:\n\treturn true;\n}", "function update_user_setting() {\n\t\t\n\t\t// options\n\t\t$options = wp_parse_args( $_POST, array(\n\t\t\t'name'\t\t=> '',\n\t\t\t'value'\t\t=> '',\n\t\t\t'nonce'\t\t=> '',\n\t\t));\n\t\t\n\t\t\n\t\t// validate\n\t\tif( ! wp_verify_nonce($options['nonce'], 'acf_nonce') || empty($options['name']) ) {\n\t\t\n\t\t\tdie('0');\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// upadte setting\n\t\tacf_update_user_setting( $options['name'], $options['value'] );\n\t\t\n\t\t\n\t\t// return\n\t\tdie('1');\n\t\t\n\t}", "function sharei_wp_settings_username() {\n add_option( 'sharei_wp_option_username', '');\n register_setting( 'sharei_wp_options_group','sharei_wp_option_username', 'sharei_wp_callback' );\n }", "public static function fix_preferences($user_id) { \n\n\t\t$user_id = Dba::escape($user_id); \n\n\t\t/* Get All Preferences for the current user */\n\t\t$sql = \"SELECT * FROM `user_preference` WHERE `user`='$user_id'\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t$results = array(); \n\n\t\twhile ($r = Dba::fetch_assoc($db_results)) { \n\t\t\t$pref_id = $r['preference'];\n\t\t\t/* Check for duplicates */\n\t\t\tif (isset($results[$pref_id])) { \n\t\t\t\t$r['value'] = Dba::escape($r['value']); \n\t\t\t\t$sql = \"DELETE FROM `user_preference` WHERE `user`='$user_id' AND `preference`='\" . $r['preference'] . \"' AND\" . \n\t\t\t\t\t\" `value`='\" . Dba::escape($r['value']) . \"'\"; \n\t\t\t\t$delete_results = Dba::query($sql); \n\t\t\t} // if its set\n\t\t\telse { \n\t\t\t\t$results[$pref_id] = 1; \n\t\t\t} \n\t\t} // end while\n\t\n\t\t/* If we aren't the -1 user before we continue grab the -1 users values */\n\t\tif ($user_id != '-1') { \n $sql = \"SELECT `user_preference`.`preference`,`user_preference`.`value` FROM `user_preference`,`preference` \" .\n \"WHERE `user_preference`.`preference` = `preference`.`id` AND `user_preference`.`user`='-1' AND `preference`.`catagory` !='system'\";\n $db_results = Dba::query($sql);\n\t\t\t/* While through our base stuff */\n while ($r = Dba::fetch_assoc($db_results)) {\n\t\t\t\t$key = $r['preference']; \n $zero_results[$key] = $r['value'];\n }\n } // if not user -1\n\n\t\t// get me _EVERYTHING_ \n $sql = \"SELECT * FROM `preference`\";\n\n\t\t// If not system, exclude system... *gasp*\n if ($user_id != '-1') {\n $sql .= \" WHERE catagory !='system'\";\n }\n $db_results = Dba::query($sql);\n\n while ($r = Dba::fetch_assoc($db_results)) {\n\n\t\t\t$key = $r['id'];\n\n /* Check if this preference is set */\n if (!isset($results[$key])) {\n if (isset($zero_results[$key])) {\n $r['value'] = $zero_results[$key];\n }\n\t\t\t\t$value = Dba::escape($r['value']); \n $sql = \"INSERT INTO user_preference (`user`,`preference`,`value`) VALUES ('$user_id','$key','$value')\";\n $insert_db = Dba::query($sql);\n }\n } // while preferences\n\n /* Let's also clean out any preferences garbage left over */\n $sql = \"SELECT DISTINCT(user_preference.user) FROM user_preference \" .\n \"LEFT JOIN user ON user_preference.user = user.id \" .\n \"WHERE user_preference.user!='-1' AND user.id IS NULL\";\n $db_results = Dba::query($sql);\n\n $results = array();\n\n while ($r = Dba::fetch_assoc($db_results)) {\n $results[] = $r['user'];\n }\n\n foreach ($results as $data) {\n $sql = \"DELETE FROM user_preference WHERE user='$data'\";\n $db_results = Dba::query($sql);\n }\n\n\t}", "function user_pref_set_pref( $p_user_id, $p_pref_name, $p_pref_value, $p_project_id = ALL_PROJECTS ) {\n\t$t_prefs = user_pref_get( $p_user_id, $p_project_id );\n\n\t$t_prefs->$p_pref_name = $p_pref_value;\n\n\tuser_pref_set( $p_user_id, $t_prefs, $p_project_id );\n\n\treturn true;\n}", "function init_userprefs($userdata)\n{\n\tglobal $board_config, $theme, $images, $db, $table_prefix;\n\tglobal $template, $lang, $phpEx, $phpbb_root_path, $db;\n\tglobal $nav_links;\n\n//-- mod : mods settings ---------------------------------------------------------------------------\n//-- add\n\tglobal $db, $mods, $list_yes_no, $userdata;\n\n\t//\tget all the mods settings\n\t$dir = @opendir($phpbb_root_path . 'includes/mods_settings');\n\twhile( $file = @readdir($dir) )\n\t{\n\t\tif( preg_match(\"/^mod_.*?\\.\" . $phpEx . \"$/\", $file) )\n\t\t{\n\t\t\tinclude_once($phpbb_root_path . 'includes/mods_settings/' . $file);\n\t\t}\n\t}\n\t@closedir($dir);\n//-- fin mod : mods settings -----------------------------------------------------------------------\n\n\tif ( $userdata['user_id'] != ANONYMOUS )\n\t{\n\t\tif ( !empty($userdata['user_lang']))\n\t\t{\n\t\t\t$default_lang = phpbb_ltrim(basename(phpbb_rtrim($userdata['user_lang'])), \"'\");\n\t\t}\n\n\t\tif ( !empty($userdata['user_dateformat']) )\n\t\t{\n\t\t\t$board_config['default_dateformat'] = $userdata['user_dateformat'];\n\t\t}\n\n\t\tif ( isset($userdata['user_timezone']) )\n\t\t{\n\t\t\t$board_config['board_timezone'] = $userdata['user_timezone'];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$default_lang = phpbb_ltrim(basename(phpbb_rtrim($board_config['default_lang'])), \"'\");\n\t}\n\n\tif ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) )\n\t{\n\t\tif ( $userdata['user_id'] != ANONYMOUS )\n\t\t{\n\t\t\t// For logged in users, try the board default language next\n\t\t\t$default_lang = phpbb_ltrim(basename(phpbb_rtrim($board_config['default_lang'])), \"'\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// For guests it means the default language is not present, try english\n\t\t\t// This is a long shot since it means serious errors in the setup to reach here,\n\t\t\t// but english is part of a new install so it's worth us trying\n\t\t\t$default_lang = 'english';\n\t\t}\n\n\t\tif ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) )\n\t\t{\n\t\t\tmessage_die(CRITICAL_ERROR, 'Could not locate valid language pack');\n\t\t}\n\t}\n\n\t// If we've had to change the value in any way then let's write it back to the database\n\t// before we go any further since it means there is something wrong with it\n\tif ( $userdata['user_id'] != ANONYMOUS && $userdata['user_lang'] !== $default_lang )\n\t{\n\t\t$sql = 'UPDATE ' . USERS_TABLE . \"\n\t\t\tSET user_lang = '\" . $default_lang . \"'\n\t\t\tWHERE user_lang = '\" . $userdata['user_lang'] . \"'\";\n\n\t\tif ( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(CRITICAL_ERROR, 'Could not update user language info');\n\t\t}\n\n\t\t$userdata['user_lang'] = $default_lang;\n\t}\n\telseif ( $userdata['user_id'] === ANONYMOUS && $board_config['default_lang'] !== $default_lang )\n\t{\n\t\t$sql = 'UPDATE ' . CONFIG_TABLE . \"\n\t\t\tSET config_value = '\" . $default_lang . \"'\n\t\t\tWHERE config_name = 'default_lang'\";\n\n\t\tif ( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(CRITICAL_ERROR, 'Could not update user language info');\n\t\t}\n\t}\n\n\t$board_config['default_lang'] = $default_lang;\n\n\tinclude($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);\n\tinclude($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_cback_ctracker.' . $phpEx);\n\n//-- mod : quick title edition -------------------------------------------------\n//-- add\n\tinclude($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_quick_title.'.$phpEx);\n//-- fin mod : quick title edition ---------------------------------------------\n\n\tif ( defined('IN_ADMIN') )\n\t{\n\t\tif( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.'.$phpEx)) )\n\t\t{\n\t\t\t$board_config['default_lang'] = 'english';\n\t\t}\n\n\t\tinclude($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx);\n\t\tinclude($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin_captcha.' . $phpEx);\n\t}\n\n//-- mod : language settings -----------------------------------------------------------------------\n//-- add\n\tinclude($phpbb_root_path . './includes/lang_extend_mac.' . $phpEx);\n//-- fin mod : language settings -------------------------------------------------------------------\n\n\tinclude_attach_lang();\n\n\t//\n\t// Set up style\n\t//\n\tif ( !$board_config['override_user_style'] )\n\t{\n\t\tif ( $userdata['user_id'] != ANONYMOUS && $userdata['user_style'] > 0 )\n\t\t{\n\t\t\tif ( $theme = setup_style($userdata['user_style']) )\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t\tif (IS_ROBOT)\n\t{\n\t\t$sql = \"SELECT bot_style FROM \" . $table_prefix . \"bots WHERE bot_name='\" . IS_ROBOT . \"'\";\n\t\t$result = $db->sql_query($sql);\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$theme = setup_style($row['bot_style']);\t\n\t} else {\n\t\t$theme = setup_style($board_config['default_style']);\n\t}\n\n\t//\n\t// Mozilla navigation bar\n\t// Default items that should be valid on all pages.\n\t// Defined here to correctly assign the Language Variables\n\t// and be able to change the variables within code.\n\t//\n\t$nav_links['top'] = array ( \n\t\t'url' => append_sid($phpbb_root_path . 'index.' . $phpEx),\n\t\t'title' => sprintf($lang['Forum_Index'], $board_config['sitename'])\n\t);\n\t$nav_links['search'] = array ( \n\t\t'url' => append_sid($phpbb_root_path . 'search.' . $phpEx),\n\t\t'title' => $lang['Search']\n\t);\n\t$nav_links['help'] = array ( \t\t'url' => append_sid($phpbb_root_path . 'faq.' . $phpEx),\n\t\t'title' => $lang['FAQ']\n\t);\n\t$nav_links['author'] = array ( \n\t\t'url' => append_sid($phpbb_root_path . 'memberlist.' . $phpEx),\n\t\t'title' => $lang['Memberlist']\n\t);\n\n\treturn;\n}", "function dev_clear_get_users_cache() {\n\n\tglobal $wpdb;\n\n\t$wpdb->get_results( $wpdb->prepare( \"DELETE FROM $wpdb->options WHERE option_name LIKE '%s'\", '_transient_dev_list_users_%' ) );\n\n}", "function check_cred(){\n\t\n\t//check_admin_referer();\n\t\n\t$form_fields = array('allUsers');\n\t$method = '';\n\t\n\tif (isset($_POST['allUsers'])){\n\t\t$url = 'themes.php?page=otto';\n\t\tif (false === ($creds = request_filesystem_credentials($url, $method, false, false, $form_fields) ) ) {\n\t\t\n\t\t\t// if we get here, then we don't have credentials yet,\n\t\t\t// but have just produced a form for the user to fill in, \n\t\t\t// so stop processing for now\n\t\t\t\n\t\t\treturn true; // stop the normal page form from displaying\n\t\t}\n\t\t\t\n\t\t// now we have some credentials, try to get the wp_filesystem running\n\t\tif ( ! WP_Filesystem($creds) ) {\n\t\t\t// our credentials were no good, ask the user for them again\n\t\t\trequest_filesystem_credentials($url, $method, true, false, $form_fields);\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t//global $wp_filesystem;\n\t\tupdate_all_users();\n\t}\n\t\n\t\n\t$form_fields = array('user');\n\t$method = '';\n\t\n\tif (isset($_GET['user']) && isset($_GET['action'])){\n\t\t$url = 'themes.php?page=otto';\n\t\tif (false === ($creds = request_filesystem_credentials($url, $method, false, false, $form_fields) ) ) {\n\t\t\n\t\t\t// if we get here, then we don't have credentials yet,\n\t\t\t// but have just produced a form for the user to fill in, \n\t\t\t// so stop processing for now\n\t\t\treturn true; // stop the normal page form from displaying\n\t\t}\n\t\t\t\n\t\t// now we have some credentials, try to get the wp_filesystem running\n\t\tif ( ! WP_Filesystem($creds) ) {\n\t\t\t// our credentials were no good, ask the user for them again\n\t\t\trequest_filesystem_credentials($url, $method, true, false, $form_fields);\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t\n\t\t//global $wp_filesystem;\n\t\tif($_GET['action'] == \"update\"){\n\t\t\tupdate_env_by_ID($_GET['user']);\n\t\t}\n\t\t \n\t\telse if($_GET['action']== \"delete\"){\n\t\t\tdelete_by_ID($_GET['user']);\n\t\t}\n\t\t\n\t\telse if($_GET['action']== \"create\"){\n\t\t\tcreate_by_ID($_GET['user']);\n\t\t}\n\t\n\t}\n\t\n}", "private static function populate_users()\n\t{\n\t\t$user=\\Model_User::forge(array(\n\t\t\t'username' => 'admin',\n\t\t\t'password' => crypt('admin','!2y!'.\\Config::get('blowfish_difficulty').'!admin!'),\n\t\t\t'email' => 'admin@something.com',\n\t\t\t'status' => 1,\n\t\t\t'level' => 1\n\t\t));\n\n\t\t$user->save();\n\n\t\t$user=\\Model_User::forge(array(\n\t\t\t'username' => 'johndoe',\n\t\t\t'password' => crypt('admin','!2y!'.\\Config::get('blowfish_difficulty').'!johndoe!'),\n\t\t\t'email' => 'johndoe@something.com',\n\t\t\t'status' => 1,\n\t\t\t'level' => 2\n\t\t));\n\n\t\t$user->save();\n\n\t\t$user=\\Model_User::forge(array(\n\t\t\t'username' => 'janedoe',\n\t\t\t'password' => crypt('admin','!2y!'.\\Config::get('blowfish_difficulty').'!janedoe!'),\n\t\t\t'email' => 'janedoe@something.com',\n\t\t\t'status' => 1,\n\t\t\t'level' => 2\n\t\t));\n\n\t\t$user->save();\n\t}", "function wp_user_settings()\n{\n}", "private function load_user_locales( $to ) {\n\t\t// Todo: Checking on User object and array...\n\t\tadd_filter( 'plugin_locale', array( $this, 'set_temporary_locale' ) );\n\n\t\t$this->temp_locale = bppl()->polylang()->get_user_locale( $to );\n\t\t$this->reload_locales = apply_filters( 'bppl_reload_locales', array( 'buddypress' ) );\n\n\t\tforeach( $this->reload_locales AS $locale ) {\n\t\t\tunload_textdomain( $locale );\n\t\t\tdo_action( 'bppl_unload_plugin_textdomain' );\n\n\t\t\tload_plugin_textdomain( $locale );\n\t\t\tdo_action( 'bppl_load_plugin_textdomain' );\n\t\t}\n\t}", "function manage_preferences()\n{\n if (array_key_exists('subcommand', $_GET)) {$subcommand = $_GET['subcommand'];}\n elseif (array_key_exists('subcommand', $_POST)) {$subcommand = $_POST['subcommand'];}\n else {$subcommand = ''; }\n switch ($subcommand)\n {\n case '':\n /* initial click on \"Preferences\" -> list all preferences */\n list_preferences();\n break;\n case 'changepasswordform':\n view_change_password_form();\n break;\n case 'changepassword':\n change_password();\n break;\n case 'adduserform':\n add_user_form();\n break;\n case 'adduser':\n add_user();\n break;\n case 'removeuserform':\n remove_user_form();\n break;\n case 'removeuser':\n remove_user();\n break;\n case 'listallusers':\n list_all_users();\n break;\n case 'addgroupform':\n add_group_form();\n break;\n case 'addgroup':\n add_group();\n break;\n case 'removegroupform':\n remove_group_form();\n break;\n case 'removegroup':\n remove_group();\n break;\n case 'adduserstogroupform':\n add_users_to_group_form();\n break;\n case 'adduserstogroup':\n add_users_to_group();\n break;\n case 'removeusersfromgroupform':\n remove_users_from_group_form();\n break;\n case 'removeusersfromgroup':\n remove_users_from_group();\n break;\n case 'listallgroups':\n list_all_groups();\n break;\n default:\n echo '<span class=\"failure\">failure!<br />invalid subcommand given</span>';\n echo 'invalid command was: |'. $subcommand . \"|\\n\";\n break;\n }\n}", "function users() {\n\t\tinclude \"settings.php\";\n\t\t\n\t\t# Creer het settings object\n\t\t$settings = SpotSettings::singleton($this->_db, $settings);\n\t\t$spotUserUpgrader = new SpotUserUpgrader($this->_db, $settings);\n\t\t$spotUserUpgrader->update();\n\t}", "function reactivateAllAccounts(){\n\t\t$user_collection = new Doctrine_Collection(Doctrine_Core::getTable(\"UserAccount\"));\n\t\t$users = $this->getUsers(); //debugMessage($users->toArray());\n\t\tif($users->count() > 0){\n\t\t\tforeach ($users as $user){\n\t\t\t\tif($user->isUserInActive() && $user->getActivationKey() == md5($this->getCompanyID())){\n\t\t\t\t\t$user->setStatus(1);\n\t\t\t\t\t$user->setActivationKey('');\n\t\t\t\t\t$user_collection->add($user);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// debugMessage($user_collection->toArray());\n\t\t}\n\t\tif($user_collection->count() > 0){\n\t\t\ttry {\n\t\t\t\t$user_collection->save();\n\t\t\t} catch (Exception $e) {\n\t\t\t\tdebugMessage(\"An error occured in updating status. \".$e->getMessage());\n\t\t\t}\n\t\t}\n\t\n\t\treturn true;\n\t}", "public static function init() { \n\t\t\n\t\t$user_id = $GLOBALS['user']->id ? Dba::escape($GLOBALS['user']->id) : '-1'; \n\n\t\t// First go ahead and try to load it from the preferences\n\t\tif (self::load_from_session($user_id)) { \n\t\t\treturn true; \t\n\t\t} \n\n\t /* Get Global Preferences */\n\t\t$sql = \"SELECT `preference`.`name`,`user_preference`.`value`,`syspref`.`value` AS `system_value` FROM `preference` \" . \n\t\t\t\"LEFT JOIN `user_preference` `syspref` ON `syspref`.`preference`=`preference`.`id` AND `syspref`.`user`='-1' AND `preference`.`catagory`='system' \" . \n\t\t\t\"LEFT JOIN `user_preference` ON `user_preference`.`preference`=`preference`.`id` AND `user_preference`.`user`='$user_id' AND `preference`.`catagory`!='system'\"; \n\t $db_results = Dba::read($sql);\n\n\t while ($row = Dba::fetch_assoc($db_results)) {\n\t\t\t$value = $row['system_value'] ? $row['system_value'] : $row['value']; \n\t $name = $row['name'];\n\t $results[$name] = $value; \n\t } // end while sys prefs\n\n\t /* Set the Theme mojo */\n\t if (strlen($results['theme_name']) > 0) {\n\t $results['theme_path'] = '/themes/' . $results['theme_name'];\n\t }\n\t // Default to the classic theme if we don't get anything from their\n\t // preferenecs because we're going to want at least something otherwise\n\t // the page is going to be really ugly\n\t else {\n\t $results['theme_path'] = '/themes/classic';\n\t }\n\n\t Config::set_by_array($results,1);\n\t\t$_SESSION['userdata']['preferences'] = $results; \n\t\t$_SESSION['userdata']['uid'] = $user_id; \n\n\t}", "public function hUserSettingsChanged( &$user )\n\t{\n\t\t// case 1: new account creation\n\t\t// Just bail out.\n\t\tglobal $wgUser;\n\t\tif ( $wgUser->getID() == 0 )\n\t\t\treturn true;\n\n\t\t// Case 2:\n\t\t// we need some protection against multiple saves per transaction.\n\t\t// SpecialPreferences.php does multiple saves regularly...\n\t\tstatic $firstTimePassed = false;\n\t\t\n\t\tif ($firstTimePassed === false)\n\t\t{\n\t\t\t$firstTimePassed = true;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$this->doUpdate( $user );\n\t\treturn true;\n\t}", "function dev_get_users( $args = array() ) {\n\n\t$defaults = array(\n\t\t'exclude' => array(),\n\t\t'cap' => '',\n\t\t'cap_exclude' => '',\n\t);\n\n\t/* The array where we save all users we want to keep. */\n\t$list = array();\n\n\t/* Merge arguments. */\n\t$args = wp_parse_args( $args, $defaults );\n\n\t/* Get the hash of the arguments that's used for caching the result. */\n\t$hash = substr( md5( serialize( $args ) ), 0, 10 ); // Limit the length of the hash in order to avoid issues with option_name being too long in the database (https://core.trac.wordpress.org/ticket/15058)\n\n\t/* Check if we have a result already cached. */\n\t$result = get_transient( \"dev_list_users_$hash\" );\n\n\t/* If there is a cached result we return it and don't run the expensive query. */\n\tif ( false !== $result ) {\n\t\treturn apply_filters( 'dev_get_users', get_users( array( 'include' => (array) $result ) ) );\n\t}\n\n\t/* Get all WordPress users */\n\t$all_users = get_users();\n\n\t/**\n\t * Store the selected user IDs for caching.\n\t *\n\t * On database with a lot of users, storing the entire WP_User\n\t * object causes issues (eg. \"Got a packet bigger than ‘max_allowed_packet’ bytes\").\n\t * In order to avoid that we only store the user IDs and then get the users list\n\t * later on only including those IDs.\n\t *\n\t * @since 1.0.0\n\t */\n\t$users_ids = array();\n\n\t/* Loop through the users list and filter them */\n\tforeach ( $all_users as $user ) {\n\n\t\t/* Check for required capability */\n\t\tif ( ! empty( $args['cap'] ) ) {\n\t\t\tif ( ! user_can( $user, $args['cap'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t/* Check for excluded capability */\n\t\tif ( ! empty( $args['cap_exclude'] ) ) {\n\t\t\tif ( user_can( $user, $args['cap_exclude'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t/* Maybe exclude this user from the list */\n\t\tif ( in_array( $user->ID, (array) $args['exclude'] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* Now we add this user to our final list. */\n\t\tarray_push( $list, $user );\n\t\tarray_push( $users_ids, $user->ID );\n\n\t}\n\n\t/* Let's cache the result so that we can avoid running this query too many times. */\n\tset_transient( \"dev_list_users_$hash\", $users_ids, apply_filters( 'dev_list_users_cache_expiration', 60 * 60 * 24 ) );\n\n\treturn apply_filters( 'dev_get_users', $list );\n\n}", "function srh_check_username() {\n $user = wp_get_current_user();\n \n if( $user && isset( $user->user_login ) && 'jamie' !== $user->user_login ) {\n /* Hide other users menus */\n /* Top level core menu items */\n remove_menu_page('link-manager.php');\n remove_menu_page('srh-tricks');\n //remove_menu_page('edit.php?post_type=slide');\n remove_menu_page('edit.php?post_type=portfolio');\n remove_menu_page('edit-comments.php');\n remove_menu_page('edit.php?post_type=feedback');\n remove_menu_page('tools.php');\n //remove_menu_page('plugins.php');\n //remove_menu_page('options-general.php');\n remove_menu_page('update-core.php');\n /* Top level plugin menu items */\n remove_menu_page('edit.php?post_type=logos');\n remove_menu_page('viva_plugins');\n remove_menu_page('easy-content-types');\n remove_menu_page('ot-settings');\n remove_menu_page('pb_backupbuddy_getting_started');\n remove_menu_page('wp_stream');\n remove_menu_page( 'jetpack' );\n /* Sub Menus */\n remove_submenu_page( 'themes.php', 'theme-editor.php' );\n //remove_submenu_page( 'themes.php', 'widgets.php' );\n remove_submenu_page( 'themes.php', 'customize.php' );\n remove_submenu_page( 'themes.php', 'editcss' );\n remove_submenu_page( 'themes.php', 'themes.php' );\n remove_submenu_page( 'themes.php', 'ot-theme-options' );\n remove_submenu_page( 'index.php', 'update-core.php' );\n remove_submenu_page( 'plugins.php', 'plugin-editor.php' );\n remove_submenu_page( 'woothemes', 'woo-meta-manager' );\n remove_submenu_page( 'woothemes', 'woo-hook-manager' );\n remove_submenu_page( 'woothemes', 'woo-layout-manager' );\n remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=post_tag' );\n remove_submenu_page( 'edit.php', 'ce-post-column-editor' );\n remove_submenu_page( 'edit.php?post_type=page', 'ce-page-column-editor' );\n\t\t\tremove_submenu_page( 'edit.php?post_type=feature', 'ce-feature-column-editor');\n\t\t\tremove_submenu_page( 'edit.php?post_type=products', 'ce-products-column-editor');\n\t\t\tremove_submenu_page( 'edit.php?post_type=slides', 'ce-slides-column-editor');\n\t\t\tremove_submenu_page( 'tools.php', 'admin-color-schemer' );\n \n \n remove_submenu_page( 'gf_edit_forms', 'gf_settings' );\n remove_submenu_page( 'gf_edit_forms', 'gf_export' );\n remove_submenu_page( 'gf_edit_forms', 'gf_update' );\n remove_submenu_page( 'gf_edit_forms', 'gf_addons' );\n remove_submenu_page( 'gf_edit_forms', 'gf_help' );\n \n remove_submenu_page( 'edit.php', 'ce-post-column-editor' );\n remove_submenu_page( 'edit.php', 'ce-post-column-editor' );\n \n /**\n\t\t\t * Remove \"Breadcrumb NavXT Settings\" plugins settings menu item.\n\t\t\t */\n remove_submenu_page( 'options-general.php', 'breadcrumb-navxt' );\n \n remove_submenu_page( 'edit.php?post_type=page', 'ce-page-column-editor' );\n\t\t\t//remove_submenu_page( 'edit.php?post_type=projects', 'ce-projects-column-editor');\n\t\t\tremove_submenu_page( 'edit.php?post_type=testimonial', 'ce-testimonial-column-editor');\n } else {\n /* hide admin menus from user_login 'jamie' */\n remove_menu_page('link-manager.php');\n //remove_menu_page('edit.php?post_type=slide');\n remove_menu_page('edit.php?post_type=portfolio');\n remove_menu_page('edit.php?post_type=feedback');\n remove_menu_page('tools.php');\n /* Sub Menus */\n //remove_submenu_page( 'plugins.php', 'plugin-editor.php' );\n remove_submenu_page( 'edit.php', 'ce-post-column-editor' );\n remove_submenu_page( 'woothemes', 'woo-meta-manager' );\n remove_submenu_page( 'woothemes', 'woo-hook-manager' );\n remove_submenu_page( 'woothemes', 'woo-layout-manager' );\n remove_submenu_page( 'edit.php?post_type=page', 'easy-content-types' );\n remove_submenu_page( 'edit.php?post_type=page', 'ce-page-column-editor' );\n }\n }", "public static function update($preference,$user_id,$value,$applytoall='') { \n\n\t\t// First prepare\n\t\tif (!is_numeric($preference)) { \n\t\t\t$id = self::id_from_name($preference); \n\t\t\t$name = $preference; \n\t\t} \n\t\telse { \n\t\t\t$name = self::name_from_id($preference); \n\t\t\t$id = $preference; \n\t\t} \n\t\tif ($applytoall AND Access::check('interface','100')) { \n\t\t\t$user_check = \"\";\n\t\t}\n\t\telse { \n\t\t\t$user_check = \" AND `user`='$user_id'\";\n\t\t} \n\n\t\t// Now do\n\t\tif (self::has_access($name)) { \n\t\t\t$value \t\t= Dba::escape($value); \n\t\t\t$user_id\t= Dba::escape($user_id); \n\t\t\t$sql = \"UPDATE `user_preference` SET `value`='$value' \" . \n\t\t\t\t\"WHERE `preference`='$id'$user_check\"; \n\t\t\t$db_results = Dba::query($sql); \n\t\t\tPreference::clear_from_session();\n\t\t\treturn true; \n\t\t} \n\t\telse { \n\t\t\tdebug_event('denied',$GLOBALS['user']->username . ' attempted to update ' . $name . ' but does not have sufficient permissions','3'); \n\t\t}\n\n\t\treturn false; \n\t}", "function getDefaultUserPreferences(){\n\t\t\t\t$userPreferences = array();\n\t\t\t\t$userPreferences[\"supportedVersions\".$this->pluginVersion] = array( );\n\t\t\t\treturn $userPreferences;\n\t\t\t}", "private function clearAllPluginSettings() {\r\n\t\t$plugins = elgg_get_plugins();\r\n\t\tif ($plugins) {\r\n\t\t\tforeach ( $plugins as $plugin ) {\r\n\t\t\t\tremove_all_private_settings ( $plugin->guid );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function PREF_saveAllPreferenceValues()\n{\n\t$prefName = $_SESSION['preferenceName'];\n\n\tforeach ($_SESSION['preferenceSpace'] as $var => $value)\n\t\tPREF_putValue($prefName, $var, $value);\n}", "public function update()\n\t{\n\t\t$preferenceStatus = $this->configKey->get(PREFERENCES_KEY);\n\n\t\tif ($preferenceStatus === 'Close')\n\t\t{\n\t\t\treturn redirect('preferences/index');\n\t\t}\n\n\t\t$data = array(\n\t\t\t'userid' => $this->input->post('userid'),\n\t\t\t'role' => $this->input->post('role'),\n\t\t\t'names' => array_filter($this->input->post('names'))\n\t\t);\n\t\t$this->form_validation->set_data($data);\n\n\t\t$seenNames = array();\n\t\t$that = $this;\n\n\t\t$filteredNames = array_filter($this->input->post('names'));\n\t\t// If no name was provided, ignore all names validation\n\t\tif (!empty($filteredNames))\n\t\t{\n\t\t\t$length = NULL;\n\n\t\t\t$distinctFunction = function ($name) use (&$seenNames, &$that)\n\t\t\t{\n\t\t\t\t$name = strtolower($name);\n\t\t\t\tif (in_array($name, $seenNames) || $that->user->isCurrentNetid($name))\n\t\t\t\t{\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$seenNames[] = $name;\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t$lengthFunction = function ($name) use (&$length, &$that)\n\t\t\t{\n\t\t\t\tif ($length === NULL)\n\t\t\t\t{\n\t\t\t\t\t$numberOfPreferences = count(array_filter($that->input->post('names')));\n\t\t\t\t\t$length = $numberOfPreferences >= MINIMUM_NUMBER_OF_PREFERENCES\n\t\t\t\t\t\t&& $numberOfPreferences <= MAXIMUM_NUMBER_OF_PREFERENCES;\n\t\t\t\t}\n\n\t\t\t\treturn $length;\n\t\t\t};\n\n\t\t\t$existsFunction = function($name) use (&$that)\n\t\t\t{\n\t\t\t\t$bool = $that->student->existsByNetid(strtolower($name));\n\t\t\t\tif (!$bool)\n\t\t\t\t{\n\t\t\t\t\t$that->form_validation->set_message('existsByNetid', 'Netid \"' . $name . '\" could not be found in the database.');\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\treturn TRUE;\n\t\t\t};\n\n\t\t\t$this->form_validation->set_rules(\n\t\t\t\t'names[]',\n\t\t\t\t'Names',\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'existsByNetid',\n\t\t\t\t\t\t$existsFunction\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'distinct',\n\t\t\t\t\t\t$distinctFunction\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'length',\n\t\t\t\t\t\t$lengthFunction\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'distinct' => 'The provided students contain duplicate/incorrect values.',\n\t\t\t\t\t'length' => 'Provide at least ' . MINIMUM_NUMBER_OF_PREFERENCES . ' and at most ' . MAXIMUM_NUMBER_OF_PREFERENCES . ' students'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->form_validation->set_rules(\n\t\t\t'userid',\n\t\t\t'Net ID',\n\t\t\tarray(\n\t\t\t\t'required',\n\t\t\t\tarray(\n\t\t\t\t\t'isCurrentUser',\n\t\t\t\t\tarray($this->user, 'isCurrentUser')\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'isCurrentUser' => 'Net ID does not exist.'\n\t\t\t)\n\t\t);\n\n\t\t$sumOfRoles = 0;\n\t\t$acceptedRoles = array(\n\t\t\t\"Bedrijfsman\",\n\t\t\t\"Brononderzoeker\",\n\t\t\t\"Plant\",\n\t\t\t\"Monitor\",\n\t\t\t\"Vormer\",\n\t\t\t\"Voorzitter\",\n\t\t\t\"Zorgdrager\",\n\t\t\t\"Groepswerker\",\n\t\t\t\"Specialist\"\n\t\t);\n\n\t\t$allRolesFunction = function ($role) use (&$acceptedRoles, &$that)\n\t\t{\n\t\t\tif (count($acceptedRoles) > 0)\n\t\t\t{\n\t\t\t\t$providedRoles = array_keys($that->input->post('role'));\n\n\t\t\t\tif (count($providedRoles) !== count($acceptedRoles))\n\t\t\t\t{\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\t$acceptedRoles = array_diff(\n\t\t\t\t\t$providedRoles,\n\t\t\t\t\t$acceptedRoles\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn count($acceptedRoles) === 0;\n\t\t};\n\n\t\t$sumFunction = function ($role) use (&$sumOfRoles, &$that)\n\t\t{\n\t\t\tif ($sumOfRoles === 0)\n\t\t\t{\n\t\t\t\tforeach ($that->input->post('role') as $role)\n\t\t\t\t{\n\t\t\t\t\t$sumOfRoles += ($role > 0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $sumOfRoles === 2;\n\t\t};\n\n\t\t$this->form_validation->set_rules(\n\t\t\t'role[]',\n\t\t\t'Role',\n\t\t\tarray(\n\t\t\t\t'required',\n\t\t\t\t'less_than[25]',\n\t\t\t\tarray(\n\t\t\t\t\t'represented',\n\t\t\t\t\t$allRolesFunction\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'sum',\n\t\t\t\t\t$sumFunction\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'required' => 'You must provide all numbers for all roles.',\n\t\t\t\t'less_than' => 'Role percentages must be less than 25.',\n\t\t\t\t'sum' => 'You must provide 2 role percentages.',\n\t\t\t\t'represented' => 'Not all roles are represented.'\n\t\t\t)\n\t\t);\n\n\t\tif ($this->form_validation->run() === FALSE)\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->user->getUserId(),\n\t\t\t\t'preferences' => $this->preference->get(),\n\t\t\t\t'roles' => $this->preference->getRoles(),\n\t\t\t\t'status' => $this->configKey->get(PREFERENCES_KEY) === 'Close',\n\t\t\t\t'wasSuccess' => false\n\t\t\t);\n\n\t\t\t$this->load->page('preferences/index', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->preference->update($seenNames, $this->input->post('role'));\n\n\t\t\treturn redirect('preferences/index/success');\n\t\t}\n\t}", "function user_clear() {\n\t $this->is_error = 0;\n\t $this->error_message = \"\";\n\t $this->user_exists = 0;\n\n\t $this->user_info = \"\";\n\t $this->profile_info = \"\";\n\t $this->level_info = \"\";\n\t $this->subnet_info = \"\";\n\n\t $this->new_pms_total = \"\";\n\t $this->friend_requests_total = \"\";\n\n\t $this->profile_tabs = \"\";\n\t $this->profile_fields = \"\";\n\t $this->profile_fields_new = \"\";\n\t $this->profile_field_query = \"\";\n\t}", "protected function loadUserIds() {\n\t\t// -------------- collect list of existing (GO) usernames\n\t\t$auth_user_table = AUTH_USER_TABLE;\n\t\t$sql = \"select id, username from {$auth_user_table} order by id\";\n\t\t$this->all_workers = array();\n\t\t$result = $this->mysql_api->get($sql);\n\t\tif ($result === FALSE) {\n\t\t\techo \"failed to execute: $sql\\n\";\n\t\t\texit;\n\t\t}\n\n\t\tforeach ($this->mysql_api->get($sql) as $row) {\n\t\t\t$this->all_workers[$row['username']] = $row['id'];\n\t\t}\n\n\t\tif (empty($this->all_workers)) {\n\t\t\techo \"no users found\\n\";\n\t\t\texit;\n\t\t}\n\t}", "public function refreshOnlineUsers(){\r\n\t}", "function update_company_prefs( $params, $pref = TB_PREF )\n{\n\t$sql = \"UPDATE {$pref}sys_prefs SET value = \";\n\tforeach($params as $name => $value) {\n\t\tif (!db_query($sql. db_escape($value). \" WHERE name=\".db_escape($name),\n\t\t\t \"The company prefferences could not be updated \"))\n\t\t\treturn false;\n\t\t// update cached value\n\t\t$_SESSION['SysPrefs']->prefs[$name] = $value;\n\t}\n\treturn true;\n}", "function filterUserSettings() {\n\treturn array(\n\t\t'name'\t\t=> 'users.name',\n\t\t'username'\t=> 'users.username',\n\t\t'level'\t\t=> 'users.level'\n\t);\t\n}", "public static function onGetPreferences( $user, &$defaultPreferences ) {\n global $wgOAuth2Client;\n\n if(OAuth2Helper::isExternalUser($user) && $defaultPreferences['password']) {\n $url = $wgOAuth2Client['config']['change_endpoint'];\n // https://github.com/wikimedia/mediawiki-extensions-GlobalPreferences/blob/master/GlobalPreferences.hooks.php\n $link = '<a href=\"' . $url . '\" target=\"_blank\">' . wfMessage( 'prefs-resetpass' )->escaped() . '</a>';\n $defaultPreferences['password'] = [\n 'type' => 'info',\n 'raw' => true,\n 'default' => $link,\n 'label-message' => 'yourpassword',\n 'section' => 'personal/info',\n ];\n }\n }", "function uninstall()\n{\n\tforeach ( relevant_users() as $user )\n\t\tdelete_user_meta( $user->ID, opt_name );\n}", "private function update_users() {\n\t\t\t$users = get_users();\n\t\t\tforeach ( $users as $user ) {\n\t\t\t\t$this->connection->hmSet(\n\t\t\t\t\t'user:' . $user->ID,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'user_id' => $user->ID,\n\t\t\t\t\t\t'login' => $user->data->user_login,\n\t\t\t\t\t\t'display_name' => $user->data->display_name,\n\t\t\t\t\t\t'email' => $user->data->user_email,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}", "function ep_multisite_username_hack ($result) {\n\t\n\t\t\t// check for user_name errors, and that we have a user_name\n\tif ($result['user_name'] && isset($result['errors']->errors['user_name'])) {\n\t\t\n\t\t\t// get just the user_name errors\n\t\t$errors = $result['errors']->errors['user_name'];\n\t\t\n\t\t\t// make sure it's a character validation error, and no others\n\t\tif (count($errors) === 1 && $errors[0] === __('Usernames can only contain lowercase letters (a-z) and numbers.')) {\n\t\t\t\n\t\t\t\t// get a clean user_name again\n\t\t\t$user_name = preg_replace('/\\s+/', '', sanitize_user($result['user_name'], true));\n\t\t\t\n\t\t\t\t// make sure user_name is an email address\n\t\t\tif (is_email($user_name)) {\n\t\t\t\t\t// set clean user_name and clear the user_name error\n\t\t\t\t$result['user_name'] = $user_name;\n\t\t\t\t$result['errors']->remove('user_name');\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}", "public static function update_350006() {\n\n\t\t$sql = \"INSERT INTO `preference` VALUES (69,'show_lyrics','0','Show Lyrics',0,'boolean','interface')\";\n\t\t$db_results = Dba::write($sql);\n\n\t\t$sql = \"INSERT INTO `user_preference` VALUES (1,69,'0')\";\n\t\t$db_results = Dba::write($sql);\n\n $sql = \"SELECT `id` FROM `user`\";\n $db_results = Dba::query($sql);\n\n User::fix_preferences('-1');\n\n while ($r = Dba::fetch_assoc($db_results)) {\n User::fix_preferences($r['id']);\n } // while we're fixing the useres stuff\n\n\t\tself::set_version('db_version','350006');\n\n\t\treturn true;\n\n\t}", "public static function onGetPreferences( $user, &$defaultPreferences ) {\n\t\tglobal $wgLang;\n\t\t// Overwrite core edit count\n\t\t$defaultPreferences['editcount']['default'] =\n\t\t\t$wgLang->formatNum( self::getRealEditcount( $user ) );\n\t}", "function profile_manager_username_change_hook($hook_name, $entity_type, $return_value, $parameters){\r\n\t\t$user_guid = (int) get_input('guid');\r\n\t\t$new_username = get_input('username');\r\n\t\t\r\n\t\t$enable_username_change = elgg_get_plugin_setting(\"enable_username_change\", \"profile_manager\");\r\n\t\tif($enable_username_change == \"yes\" || ($enable_username_change == \"admin\" && elgg_is_admin_logged_in())){\r\n\t\t\r\n\t\t\tif(!empty($user_guid) && !empty($new_username)){\r\n\t\t\t\tif(profile_manager_validate_username($new_username)){\r\n\t\t\t\t\tif($user = get_user($user_guid)){\r\n\t\t\t\t\t\tif($user->canEdit()){\r\n\t\t\t\t\t\t\tif($user->username !== $new_username){\r\n\t\t\t\t\t\t\t\t$user->username = $new_username;\r\n\t\t\t\t\t\t\t\tif($user->save()){\r\n\t\t\t\t\t\t\t\t\telgg_register_plugin_hook_handler(\"forward\", \"system\", \"profile_manager_username_change_forward_hook\");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tsystem_message(elgg_echo('profile_manager:action:username:change:succes'));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function opfbs_username_alter(&$name, $account) { \n $user = user_load($account->uid);\n if (!empty($user->profile_forename) && !empty($user->profile_surname)) {\n $name = $user->profile_forename . \" \" . $user->profile_surname;\n }\n}", "public function checkUsers()\n {\n if (!$this->isAdminPath()) {\n return;\n }\n\n // check for existence of a user account\n $account_dir = $this->grav['locator']->findResource('account://');\n $user_check = (array) glob($account_dir . '/*.yaml');\n\n // If no users found, create the first one\n if (!count($user_check) > 0) {\n if (!$username = $this->createUserFromYnh()) {\n $this->grav['log']->error('User creation failed, credentials missing');\n throw new \\RuntimeException('User creation failed, credentials missing');\n }\n // then authenticate, and redirect to admin panel\n // @todo: autodisable plugin\n $this->authenticateUser($username);\n $this->redirectToAdminPanel();\n }\n }", "function initialUsersLoad ()\n\t{\n\t\t$this->loadNewUsers( true );\n\t}", "function _yubikey_login_user_update_all_users_have_credentials_metadata() {\n $query = db_select('users', 'users');\n $query->addExpression('COUNT(*)', 'user_count');\n $user_count = $query->execute()->fetchField();\n\n $query = db_select('yubikey_login_credentials', 'credentials');\n $query->addExpression('COUNT(*)', 'credentials_count');\n $credentials_count = $query->execute()->fetchField();\n\n\t// Need to subtract one because there's row for anonymous users at uid = 0.\n\t$all_users_have_credentials = (bool) ($credentials_count == ($user_count - 1));\n\n\tvariable_set('yubikey_login_all_users_have_credentials', $all_users_have_credentials);\n}", "function update_core_prefs($type='')\r\r\n{\r\r\n\tglobal $e107info; // $pref, $pref must be kept as global \r\r\n\t\r\r\n\t$pref = e107::getConfig('core', true, true)->getPref();\r\r\n\t$admin_log = e107::getAdminLog();\r\r\n\t$do_save = FALSE;\r\r\n\t$should = get_default_prefs();\r\r\n\r\r\n\t$just_check = $type == 'do' ? FALSE : TRUE;\t\t// TRUE if we're just seeing if an update is needed\r\r\n \r\r\n\tforeach ($should as $k => $v)\r\r\n\t{\r\r\n\t\tif ($k && !array_key_exists($k,$pref))\r\r\n\t\t{\r\r\n\t\t\tif ($just_check) return update_needed('Missing pref: '.$k);\r\r\n\t\t//\t$pref[$k] = $v;\r\r\n\t\t\te107::getConfig()->set($k,$v);\r\r\n\t\t\t$admin_log->logMessage($k.' => '.$v, E_MESSAGE_NODISPLAY, E_MESSAGE_INFO);\r\r\n\t\t\t$do_save = TRUE;\r\r\n\t\t}\r\r\n\t}\r\r\n\tif ($do_save)\r\r\n\t{\r\r\n\t\t//save_prefs();\r\r\n\t\te107::getConfig('core')->save(false,true);\r\r\n\t\t$admin_log->logMessage(LAN_UPDATE_14.$e107info['e107_version'], E_MESSAGE_NODISPLAY, E_MESSAGE_INFO);\r\r\n\t\t$admin_log->flushMessages('UPDATE_03',E_LOG_INFORMATIVE);\r\r\n\t\t//e107::getLog()->add('UPDATE_03',LAN_UPDATE_14.$e107info['e107_version'].'[!br!]'.implode(', ',$accum),E_LOG_INFORMATIVE,'');\t// Log result of actual update\r\r\n\t}\r\r\n\treturn $just_check;\r\r\n}", "function edit_user_profile() {\n\tglobal $user_id;\n\t$GA_enabled = trim( get_user_option( 'googleauthenticator_enabled', $user_id ) );\n\t$GA_hidefromuser = trim( get_user_option( 'googleauthenticator_hidefromuser', $user_id ) );\n\techo \"<h3>\".__('Google Authenticator Settings','google-authenticator').\"</h3>\\n\";\n\techo \"<table class=\\\"form-table\\\">\\n\";\n\techo \"<tbody>\\n\";\n\n\techo \"<tr>\\n\";\n\techo \"<th scope=\\\"row\\\">\".__('Hide settings from user','google-authenticator').\"</th>\\n\";\n\techo \"<td>\\n\";\n\techo \"<div><input name=\\\"GA_hidefromuser\\\" id=\\\"GA_hidefromuser\\\" class=\\\"tog\\\" type=\\\"checkbox\\\"\" . checked( $GA_hidefromuser, 'enabled', false ) . \"/>\\n\";\n\techo \"</td>\\n\";\n\techo \"</tr>\\n\";\n\n\techo \"<tr>\\n\";\n\techo \"<th scope=\\\"row\\\">\".__('Active','google-authenticator').\"</th>\\n\";\n\techo \"<td>\\n\";\n\techo \"<div><input name=\\\"GA_enabled\\\" id=\\\"GA_enabled\\\" class=\\\"tog\\\" type=\\\"checkbox\\\"\" . checked( $GA_enabled, 'enabled', false ) . \"/>\\n\";\n\techo \"</td>\\n\";\n\techo \"</tr>\\n\";\n\n\techo \"</tbody>\\n\";\n\techo \"</table>\\n\";\n}", "function refresh_user($data) {\n $CI = & get_instance();\n $user = get_user();\n foreach ($data as $key => $value) {\n $user[$key] = $value;\n }\n\n // store updated users to session\n $CI->session->set_userdata(USER_KEY, $user);\n}", "function bp_core_flush_illegal_names() {\r\n\t$illegal_names = get_site_option( 'illegal_names' );\r\n\tupdate_site_option( 'illegal_names', $illegal_names );\r\n}", "function retrieve_external_userdata() {\n global $data_dir, $username, $password;\n\n include(\"../plugins/retrieveuserdata/config.php\");\n include (\"../plugins/retrieveuserdata/$retrieve_data_from\");\n\n $cleartext_password = OneTimePadDecrypt($password, $onetimepad);\n $userdata = retrieve_data($username, $cleartext_password);\n\n if (!$userdata[\"error\"]) {\n set_userdata($userdata[\"common_name\"], $userdata[\"mail_address\"]);\n set_userdata_backup($userdata[\"common_name\"], $userdata[\"mail_address\"]);\n setPref($data_dir, $username, \"got_external_userdata\", 1);\n }\n }", "function _modify_user()\n {\n if (FALSE == $this->_check_delete_user())\n {\n $this->_reset_old_fields_data();\n return FALSE;\n } \n if (FALSE == $this->_check_empty_fields())\n {\n $this->_reset_old_fields_data();\n return FALSE;\n }\n if (FALSE == $this->_check_own_changes())\n {\n $this->_reset_old_fields_data();\n return FALSE;\n } \n if (FALSE == $this->_check_rights_level_changes())\n {\n $this->_reset_old_fields_data();\n return FALSE;\n } \n if (FALSE == $this->_check_set_status())\n {\n $this->_reset_old_fields_data();\n return FALSE;\n } \n if (FALSE == $this->_update_user_data())\n {\n $this->_reset_old_fields_data();\n return FALSE;\n } \n return TRUE;\n }", "function get_all_users(){ // Get all users\n\t\t\n\t}", "function theme_wpdc_settings_importer() {\n if (!current_user_can('manage_options')) {\n wp_die('You do not have sufficient permissions to access this page.');\n }else{ ?>\n\n <style>\n .update-nag input {\n margin: 0;\n padding: 0;\n background: transparent;\n border: 0;\n font-size: inherit;\n color: #0073aa;\n text-decoration: underline;\n cursor: pointer;\n }\n </style>\n <div class=\"wrap\" class=\"\">\n\n <?php if (isset($_POST[\"update_settings_opuser\"])) { ?>\n <div class=\"wrap updated\">\n <?php $users = get_users();\n foreach ($users as $user){\n $user_meta = get_user_meta($user->ID);\n if(isset($user_meta['op_user'])) continue;\n add_op_user_meta( $user->ID );\n echo \"<p>UsuarioID: \".$user->ID.\" usermeta updated.</p>\";\n } ?>\n </div>\n <?php }else {\n $users = get_users();\n $cleared_users = 0;\n foreach ($users as $user){\n $user_meta = get_user_meta($user->ID);\n if(!isset($user_meta['op_user'])) $cleared_users++;\n }\n }\n ?>\n \n <h2>Configuración de usuarios y roles</h2>\n <form method=\"POST\" action=\"\">\n <?php if($cleared_users > 0) {?>\n <div class=\"wrap update-nag\">\n <p><strong>Se ha observado <?php echo $cleared_users;?> usuarios sin datos meta necesarios para el correcto funcionamiento del sitio. ¿Desea actualizarlos? </strong><input type=\"submit\" name=\"update_settings_opuser\" value=\"Actualizar usuarios\"/>\n <br>Message: Set $user_meta->op_user with default values in users with null op_user (news or imported users)</p>\n </div>\n <?php } ?>\n </form>\n\n <form method=\"POST\" action=\"\">\n <h2>Importar usuarios de AEDI</h2>\n <table class=\"form-table\">\n <tr valign=\"top\">\n <th scope=\"row\"><label for=\"automate_twitter\">Activar automatización</label></th>\n <td><input type=\"checkbox\" name=\"automate_twitter\" value=\"true\" <?php if($automate_twitter == true) echo 'checked';?>/></td>\n </tr>\n </table>\n <p class=\"submit\">\n <input type=\"hidden\" name=\"update_settings_twitter\" value=\"Y\" />\n <input type=\"submit\" class=\"button button-primary\" value=\"Guardar cambios\">\n </p>\n </form>\n\n </div>\n <?php }\n}", "function load_user_locale_translations() {\n\t\t$this->need_to_change_locale = ( get_locale() != $this->user->locale );\n\t\tif ( ! $this->need_to_change_locale )\n\t\t\treturn;\n\t\t/*\n\t\t$this->previous_translations = get_translations_for_domain( 'default' );\n\t\t$this->adminbar_locale_filter = lambda( '$_', '$GLOBALS[\"wp_admin_bar\"]->user->locale;' );\n\t\tunload_textdomain( 'default' );\n\t\tadd_filter( 'locale', $this->adminbar_locale_filter );\n\t\tload_default_textdomain();\n\t\t$this->changed_locale = true;\n\t\t*/\n\t}", "function delete_user_setting($names)\n{\n}", "function myplugin_registration_save( $user_id ) {\n update_user_meta($user_id, 'prefix_first_login', '1');\n\n}", "public function get_users_for_login(){\n\t\t\t$this->users_for_login = array(\n\t\t\t\t'User_1' => '&plkoji19>',\n\t\t\t\t'User_2' => '!hugzft28<',\n\t\t\t\t'User_3' => '*37rdeswa&',\n\t\t\t);\n\t\t\t\n\t\t\treturn apply_filters( 'quicklogin_users_array', $this->users_for_login );\n\t\t}", "function my_save_user_emailprefs_terms( $user_id ) {\n\tglobal $wpdb;\n\t$tax = get_taxonomy( 'cwt_carwash_types' );\n\n\t/* Make sure the current user can edit the user and assign terms before proceeding. */\n\tif ( !current_user_can( 'edit_user', $user_id ) && current_user_can( $tax->cap->assign_terms ) )\n\t\treturn false;\n\n\t$carwashes = $_POST['carwashes'];\n\t$forsale = $_POST['forsale'];\n\t$prodsupp = $_POST['prodsupp'];\n\t$jobs = $_POST['jobs'];\n\n\t/* Remove all current terms and reset where checked */\n\t$wpdb->query('DELETE FROM cwt_email_prefs WHERE user_id = '.$user_id);\n\tfor($c=0; $c<sizeof($carwashes); $c++) {\n\t\t$wpdb->query('INSERT INTO cwt_email_prefs (user_id, term_id) VALUES ('.$user_id.','.$carwashes[$c].')');\n\t}\n\tfor($f=0; $f<sizeof($forsale); $f++) {\n\t\t$wpdb->query('INSERT INTO cwt_email_prefs (user_id, term_id) VALUES ('.$user_id.','.$forsale[$f].')');\n\t}\n\tfor($p=0; $p<sizeof($prodsupp); $p++) {\n\t\t$wpdb->query('INSERT INTO cwt_email_prefs (user_id, term_id) VALUES ('.$user_id.','.$prodsupp[$p].')');\n\t}\n\tfor($j=0; $j<sizeof($jobs); $j++) {\n\t\t$wpdb->query('INSERT INTO cwt_email_prefs (user_id, term_id) VALUES ('.$user_id.','.$jobs[$j].')');\n\t}\n}", "protected function parseUserPrefs(Gadget &$gadget) {\n foreach ($gadget->gadgetSpec->userPrefs as $key => $pref) {\n $queryKey = 'up_' . $pref['name'];\n $gadget->gadgetSpec->userPrefs[$key]['value'] = isset($_GET[$queryKey]) ? trim(urldecode($_GET[$queryKey])) : $pref['defaultValue'];\n }\n }", "public function registration_check_disallowed_usernames(){\n\t\tif ( isset( $_POST[ 'signup_username' ] ) ) {\n\t\t\t$maybe_error = $this->username_laundry( $_POST[ 'signup_username' ] );\n\t\t}\n\n\t\tif ( ! empty( $maybe_error ) ) {\n\t\t\t$bp = buddypress();\n\t\t\t$bp->signup->errors['signup_username'] = $maybe_error;\n\t\t}\n\t}", "function doUserSynchronization($username) {\n\t\t$plugins = JPluginHelper :: getPlugin('usersource');\n\t\tforeach ($plugins as $plugin) {\n\t\t\t$className = 'plg' . $plugin->type . $plugin->name;\n\t\t\tif (class_exists($className)) {\n\t\t\t\t$plugin = new $className ($this, (array)$plugin);\n\t\t\t} else {\n\t\t\t\tJError :: raiseWarning('SOME_ERROR_CODE', 'JAuthUserSource::doUserSynchronization: Could not load ' . $className);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Fire a user sync event; this is done poorly, we will fix this for 1.6\n\t\t\tif(method_exists($plugin, 'doUserSync') && $user = $plugin->doUserSync($username)) {\n\t\t\t\t// if we succeeded then lets bail out\n\t\t\t\t// means the first system gets priority\n\t\t\t\t// and no other system will overwrite the values\n\t\t\t\t// but first we need to save our user\n\t\t\t\t$my =& JFactory::getUser(); // get who we are now\n\t\t\t\t// by default we demote users\n\t\t\t\tif(isset($options['demoteuser']) && !$options['demoteuser']) {\n\t\t\t\t\t// reset the gid if new gid less than old gid or new gid is 29 (public frontend)\n\t\t\t\t\tif($user->get('gid') == 29 && $my->get('gid') < $user->get('gid')) $user->set('gid',$my->get('gid'));\n\t\t\t\t}\n\t\t\t\t$oldgid = $my->get('gid');\t// grab the current gid\n\t\t\t\t$my->set('gid', 25); \t\t// and fake things to by pass security\n\t\t\t\t$result = $user->save(); \t// save us, now the db is up\n\t\t\t\t$my->set('gid', $oldgid);\t// set back to old value\n\n\t\t\t\t// Contribution from Mark Snead via the forums\n\t\t\t\t// @see http://forum.joomla.org/viewtopic.php?p=1811943#p1811943\n\t\t\t\t// UPDATE SESSION ARRAY\n\t\t\t\t$instance = $my;\n\n\t\t\t\t// Get an ACL object\n\t\t\t\t$acl =& JFactory::getACL();\n\n\t\t\t\t// Get the newly updated user group from the ACL\n\t\t\t\tif ($instance->get('tmp_user') == 1) {\n\t\t\t\t\t$grp = new JObject;\n\t\t\t\t\t// This should be configurable at some point\n\t\t\t\t\t$grp->set('name', 'Registered');\n\t\t\t\t} else {\n\t\t\t\t\t$grp = $acl->getAroGroup($instance->get('id'));\n\t\t\t\t}\n\n\t\t\t\t// Update the aid to 2 for Authors, Editors, Publishers and Super Administrators into the special access group\n\t\t\t\tif ($acl->is_group_child_of($grp->name, 'Registered') ||\n\t\t\t\t$acl->is_group_child_of($grp->name, 'Public Backend')) {\n\t\t\t\t\t$instance->set('aid', 2);\n\t\t\t\t}\n\t\t\t\t//Set the usertype and gid based on the ACL group name\n\t\t\t\t$instance->set('usertype', $grp->name);\n\t\t\t\t$instance->set('gid', $grp->id);\n\n\t\t\t\t// Register the needed session variables\n\t\t\t\t$session =& JFactory::getSession();\n\t\t\t\t$session->set('user', $instance);\n\n\t\t\t\treturn true;\t\t\t\t// thats all folks\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function update_company_prefs( $params, $pref = TB_PREF ){\n global $ci;\n $model = $ci->model('common',true);\n foreach($params as $name => $value) {\n $model->update( array('value'=>$value),'sys_prefs',array('name'=>$name));\n // update cached value\n $_SESSION['SysPrefs']->prefs[$name] = $value;\n }\n return true;\n}", "function sync()\n\t{\n\t\tif (!empty($this->plaintext_passwd)) {\n\t\t\tif (empty($this->salt)) {\n\t\t\t\t$this->salt = generate_salt();\n\t\t\t}\n\t\t\t$passwd = 'passwd=\\''. sha1($this->salt . sha1($this->plaintext_passwd)) .'\\', salt=\\''. $this->salt .'\\', ';\n\t\t} else {\n\t\t\t$passwd = '';\n\t\t}\n\n\t\t$this->alias = make_alias((!($GLOBALS['FUD_OPT_2'] & 128) || !$this->alias) ? $this->login : $this->alias);\n\t\t$this->icq = (int)$this->icq ? (int)$this->icq : 'NULL';\n\n\t\t$rb_mod_list = (!($this->users_opt & 524288) && ($is_mod = q_singleval('SELECT id FROM fud30_mod WHERE user_id='. $this->id)) && (q_singleval('SELECT alias FROM fud30_users WHERE id='. $this->id) == $this->alias));\n\n\t\t$this->html_fields();\n\n\t\tq('UPDATE fud30_users SET '. $passwd .'\n\t\t\tname='. _esc($this->name) .',\n\t\t\talias='. _esc($this->alias) .',\n\t\t\temail='. _esc($this->email) .',\n\t\t\ticq='. $this->icq .',\n\t\t\taim='. ssn(urlencode($this->aim)) .',\n\t\t\tyahoo='. ssn(urlencode($this->yahoo)) .',\n\t\t\tmsnm='. ssn($this->msnm) .',\n\t\t\tjabber='. ssn(htmlspecialchars($this->jabber)) .',\n\t\t\taffero='. ssn(urlencode($this->affero)) .',\n\t\t\tgoogle='. ssn($this->google) .',\n\t\t\tskype='. ssn(urlencode($this->skype)) .',\n\t\t\ttwitter='. ssn(urlencode($this->twitter)) .',\n\t\t\tposts_ppg='. (int)$this->posts_ppg .',\n\t\t\ttime_zone='. _esc($this->time_zone) .',\n\t\t\tbirthday='. ssn($this->birthday) .',\n\t\t\tuser_image='. ssn(htmlspecialchars($this->user_image)) .',\n\t\t\tlocation='. ssn($this->location) .',\n\t\t\toccupation='. ssn($this->occupation) .',\n\t\t\tinterests='. ssn($this->interests) .',\n\t\t\tavatar='. (int)$this->avatar .',\n\t\t\ttheme='. (int)$this->theme .',\n\t\t\tavatar_loc='. ssn($this->avatar_loc) .',\n\t\t\tsig='. ssn($this->sig) .',\n\t\t\thome_page='. ssn(htmlspecialchars($this->home_page)) .',\n\t\t\tbio='. ssn($this->bio) .',\n\t\t\tusers_opt='. (int)$this->users_opt .',\n\t\t\ttopics_per_page='. (int)$this->topics_per_page .',\n\t\t\tcustom_fields='. _esc($this->custom_fields) .'\n\t\tWHERE id='. $this->id);\n\n\t\tif ($rb_mod_list) {\n\t\t\trebuildmodlist();\n\t\t}\n\t}", "function LoadUsers()\n{\n global $users;\n\n if (count($users) == 1 && $users['root']['password'] == \"\")\n return \"\\$users = array();\\r\\n\";\n\n $u = \"\\$users = array(\\r\\n\";\n $i = 0;\n foreach($users as $username => $user)\n {\n if ($i > 0)\n $u .= \",\\r\\n\";\n $acc = \"array(\";// array(\".\" => 2)\n $ii = 0;\n foreach($user['access'] as $acxd => $acx)\n {\n if ($ii > 0)\n $acc .= \",\";\n $acc .= sprintf(\"'%s' => %s\",$acxd,$acx);\n $ii++;\n }\n $acc .= \")\";\n $u .= sprintf(\"'%s' => array('admin' => '%s','password' => '%s','root' => '%s','access' => %s)\",$username,$user['admin'],$user['password'],$user['root'],$acc);\n $i++;\n }\n\n $u .= \"\\r\\n);\";\n return $u;\n}", "function init_userprefs($userdata)\r{\r\tglobal $CBT_config, $theme, $images;\r\tglobal $template, $lang, $phpEx, $somCBT_root_path;\r\tglobal $nav_links;\r\r\t$CBT_config['default_lang'] = 'english';\r\t\t \r\t$theme = setup_style( $CBT_config['default_style']);\r\r\treturn;\r}", "function user_pref_get( $p_user_id, $p_project_id = ALL_PROJECTS ) {\n\tstatic $t_vars;\n\tglobal $g_cache_current_user_pref;\n\n\tif ( isset( $g_cache_current_user_pref[(int)$p_project_id] ) &&\n\t\tauth_is_user_authenticated() &&\n\t\tauth_get_current_user_id() == $p_user_id ) {\n\t\treturn $g_cache_current_user_pref[(int)$p_project_id];\n\t}\n\n\t$t_prefs = new UserPreferences( $p_user_id, $p_project_id );\n\n\t$row = user_pref_cache_row( $p_user_id, $p_project_id, false );\n\n\t# If the user has no preferences for the given project\n\tif( false === $row ) {\n\t\tif( ALL_PROJECTS != $p_project_id ) {\n\t\t\t# Try to get the prefs for ALL_PROJECTS (the defaults)\n\t\t\t$row = user_pref_cache_row( $p_user_id, ALL_PROJECTS, false );\n\t\t}\n\n\t\t# If $row is still false (the user doesn't have default preferences)\n\t\tif( false === $row ) {\n\t\t\t# We use an empty array\n\t\t\t$row = array();\n\t\t}\n\t}\n\n\tif ($t_vars == null ) {\n\t\t$t_vars = getClassProperties( 'UserPreferences', 'protected');\n\t}\n\n\t$t_row_keys = array_keys( $row );\n\n\t# Check each variable in the class\n\tforeach( $t_vars as $var => $val ) {\n\t\t# If we got a field from the DB with the same name\n\t\tif( in_array( $var, $t_row_keys, true ) ) {\n\t\t\t# Store that value in the object\n\t\t\t$t_prefs->$var = $row[$var];\n\t\t}\n\t}\n\tif ( auth_is_user_authenticated() && auth_get_current_user_id() == $p_user_id ) {\n\t\t$g_cache_current_user_pref[ (int)$p_project_id ] = $t_prefs;\n\t}\n\treturn $t_prefs;\n}", "function set_user_setting( $name, $value ) {\n\t\t$all_user_settings = get_all_user_settings();\n\t\t$all_user_settings[ $name ] = $value;\n\n\t\treturn wp_set_all_user_settings( $all_user_settings );\n\t}", "public function auto_map_user_preferences($headers)\n {\n }", "public static function refreshUserdata() {\r\n\t\tif( Security::loginMethod() != SECURITY_TABLE ) \r\n\t\t\treturn;\r\n\t\tif( !isLogged() || Security::isGuest() )\r\n\t\t\treturn;\r\n\t\t$userData = Security::fetchUserData( Security::getUserName(), \"\", true );\r\n\t\tstorageSet( \"UserData\", $userData );\r\n\t}", "public function update_usersettings($p) {\r\n\tif ($_SESSION['loginuser'])\r\n\t\t$myuser = mysql_real_escape_string($_SESSION['loginuser']);\r\n\tif (!empty($_POST['usersettings_opt'])) { \r\n\t\t$usropt = $_POST['usersettings_opt'];\r\n\t\t\r\n\t\t$this->switch_users_table();\r\n\t\t$q = \"UPDATE users SET Avatar='$usropt' WHERE Username = '$myuser'\";\r\n\t\t$r = mysql_query($q);\r\n\t}\r\n\t\r\n\tif (!empty($_POST['usersettings_name'])) { \r\n\t\t$usrname = $_POST['usersettings_name'];\r\n\t\t\r\n\t\t$this->switch_users_table();\r\n\t\t$q = \"UPDATE users SET Name='$usrname' WHERE Username = '$myuser'\";\r\n\t\t$r = mysql_query($q);\r\n\t}\r\n\t\r\n\tif (!empty($_POST['usersettings_surname'])) { \r\n\t\t$usrsname = $_POST['usersettings_surname'];\r\n\t\t\r\n\t\t$this->switch_users_table();\r\n\t\t$q = \"UPDATE users SET Surname='$usrsname' WHERE Username = '$myuser'\";\r\n\t\t$r = mysql_query($q);\r\n\t}\r\n\t\r\n\t//if (!empty($_POST['usersettingsbg_opt'])) { \r\n\t\t//$usrbgopt = $_POST['usersettingsbg_opt'];\r\n\t\t\r\n\t\t//$_SESSION['bodycss']=$usrbgopt;\r\n\t\t\t\t\r\n\t\t//$this->switch_users_table();\r\n\t\t//$q = \"UPDATE users SET Avatar='$usropt' WHERE Username = '$myuser'\";\r\n\t\t//$r = mysql_query($q);\r\n\t//}\r\n\t\r\n\tif (!empty($_POST['usersettings_info'])) { \r\n\t\t$infopt = $_POST['usersettings_info'];\r\n\t\t\r\n\t\t$this->switch_users_table();\r\n\t\t$q = \"UPDATE users SET Inform='$infopt' WHERE Username = '$myuser'\";\r\n\t\t$r = mysql_query($q);\r\n\t}\r\n\t\r\n\techo(\"<div class=\\\"hehe\\\"><div class=\\\"smallfont\\\"><center><b><a href=\\\"index.php\\\">Refresh Page</a></b></center></div></div>\");\r\n}", "function wyz_reset_user_pass() {\n\tif ( isset( $_POST['wyz_user_Identifier'] ) && wp_verify_nonce( $_POST['wyz_reset_pass_nonce'], 'wyz-reset_pass-nonce' ) ) {\n\t\tif ( is_user_logged_in() ) {\n\t\t\twp_redirect( home_url() );\n\t\t\texit;\n\t\t}\n\t\t$user_email = email_exists( $_POST['wyz_user_Identifier'] );\n\t\t$user_name = username_exists( $_POST['wyz_user_Identifier'] );\n\t\t$user_data = '';\n\t\t$user_login = '';\n\t\t$verified = false;\n\t\tif ( $user_email ) {\n\t\t\t$user_data = get_userdata( $user_email );\n\t\t\t$verified = true;\n\t\t} elseif ( $user_name ) {\n\t\t\t$user_data = get_userdata( $user_name );\n\t\t\t$verified = true;\n\t\t}\n\t\tif ( $verified ) {\n\t\t\t$user_email = $user_data->user_email;\n\t\t\t$user_name = $user_data->display_name;\n\t\t\t$user_login = $user_data->user_login;\n\t\t\twyz_send_pass_email( $user_email, $user_name, $user_data->first_name, $user_data->last_name, $user_login );\n\t\t} else {\n\t\t\twyz_errors()->add( 'username_email_invalid', esc_html__( 'Username/Email not found', 'wyzi-business-finder' ) );\n\t\t}\n\n\t\twyz_override_errors( apply_filters( 'wyz_reset_user_pass_errors', wyz_errors() ) );\n\n\t\t// Retrieve all error messages.\n\t\t$errors = wyz_errors()->get_error_messages();\n\t}\n}", "function users_settings() {\n\treturn array(\n\t\t'name' => 'users',\n\t\t'shortName' => 'users',\n\t\t'version' => '1.0.1'\n\t);\n}", "public function getUsersWithPref($_preferenceName, $_value, $_limitToUserIds = array())\n {\n $result = array();\n\n $queryResult = $this->_getPrefs($_preferenceName);\n\n if (empty($queryResult)) {\n $pref = $this->getApplicationPreferenceDefaults($_preferenceName);\n } else {\n $pref = new Tinebase_Model_Preference($queryResult[0]);\n }\n\n if ($pref->value == $_value) {\n\n if (! empty($_limitToUserIds)) {\n $result = Tinebase_User::getInstance()->getMultiple($_limitToUserIds)->getArrayOfIds();\n } else {\n $result = Tinebase_User::getInstance()->getUsers()->getArrayOfIds();\n }\n\n if ($pref->type == Tinebase_Model_Preference::TYPE_FORCED) {\n // forced: get all users -> do nothing here\n\n } else if ($pref->type == Tinebase_Model_Preference::TYPE_DEFAULT) {\n // default: remove all users/groups who don't have default\n $filter = new Tinebase_Model_PreferenceFilter(array(\n array('field' => 'account_type', 'operator' => 'equals', 'value' => Rights::ACCOUNT_TYPE_USER),\n array('field' => 'name', 'operator' => 'equals', 'value' => $_preferenceName),\n array('field' => 'value', 'operator' => 'not', 'value' => $_value),\n ));\n $accountsWithOtherValues = $this->search($filter)->account_id;\n $result = array_diff($result, $accountsWithOtherValues);\n\n } else {\n throw new Tinebase_Exception_UnexpectedValue('Preference should be of type \"forced\" or \"default\".');\n }\n\n } else {\n // not default or forced: get all users/groups who have the setting\n $filter = new Tinebase_Model_PreferenceFilter(array(\n array('field' => 'account_type', 'operator' => 'equals', 'value' => Rights::ACCOUNT_TYPE_USER),\n array('field' => 'name', 'operator' => 'equals', 'value' => $_preferenceName),\n array('field' => 'value', 'operator' => 'equals', 'value' => $_value),\n ));\n $result = $this->search($filter)->account_id;\n }\n\n return $result;\n }", "private function unlink_all_accounts() {\n global $wpdb;\n $where = array ('1' => '1');\n $result = $wpdb->query(\"UPDATE $wpdb->usermeta SET \"\n . \"meta_value='' WHERE meta_key='\" . DKOFBLOGIN_USERMETA_KEY_TOKEN . \"'\");\n $result = $wpdb->query(\"UPDATE $wpdb->usermeta SET \"\n . \"meta_value='' WHERE meta_key='\" . DKOFBLOGIN_USERMETA_KEY_FBID . \"'\");\n $this->destroyed = true;\n }", "function ym_user_profille_update($username,$password,$ymuser)\r\n{\r\n\tglobal $wpdb;\r\n\t\t\r\n\t\r\n\t//prepre user meta data\r\n\t$user_meta = array();\r\n\t\r\n\t$geo_states =\tym_get_helper_states();\r\n\t$geo_countries =\tym_helper_country();\r\n\t \r\n\t$user_meta['paupress_pp_prefix'] = $ymuser['NamePrefix'];\r\n\t\r\n\t$user_meta['first_name'] = $ymuser['FirstName'];\r\n\t$user_meta['last_name'] = $ymuser['LastName'];\r\n\t$user_meta['soak_pp_job_title'] = $ymuser['Title'];\r\n\t$user_meta['paupress_address_one_1'] = $ymuser['EmpAddrLine1'];\r\n\t$user_meta['paupress_address_two_1'] = $ymuser['EmpAddrLine2'];\r\n\t$user_meta['paupress_address_city_1'] = $ymuser['EmpCity'];\r\n\t$user_meta['paupress_address_postal_code_1'] = $ymuser['EmpPostalCode'];\r\n\t$user_meta['paupress_address_country_1'] = array_search($ymuser['EmpCountry'],$geo_countries,true);\r\n\t$user_meta['paupress_address_state_1'] = array_search($ymuser['EmpLocation'],$geo_states[$user_meta['paupress_address_country_1']],true);\r\n\t//$user_meta['wp_capabilities'] = 'a:2:{s:4:\"user\";b:1;s:8:\"key-user\";b:1;}';\r\n\tif(empty($user_meta['paupress_address_state_1']) )\r\n\t\t$user_meta['paupress_address_state_1'] = $ymuser['EmpLocation'];\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t$user_meta['soak_organization_id'] = $ymuser['member_id'];\r\n\t\r\n\t//$user_meta['paupress_pp_relationship'] = 'a:1:{i:0;a:2:{s:5:\"value\";i:701;s:4:\"type\";s:12:\"organization\";}}';\r\n\t$user_meta['paupress_pp_relationship'] = array( \"0\" => array( \"value\" => $ymuser['member_id'] ,\"type\" => \"organization\" ));\r\n\t$user_meta['organization'] = $ymuser['Employer'];\r\n\t\r\n\t\r\n\t$user_meta['wp_user_level'] = 0;\r\n\t$user_meta['paupress_pp_ind_type'] = \"user\";\r\n\t$user_meta['paupress_pp_user_type'] = \"ind\";\r\n\t$user_meta['soak_pp_ind_status'] = \"ACTIVE\";\r\n\t\r\n\tif($ymuser['Keyuser'] == \"Yes\" )\r\n\t{\r\n\t\t$user_meta['wp_capabilities'] = array(\"user\"=>1,\"key_user\"=>TRUE);\r\n\t\t$user_meta['soak_pp_key_user'] = \"true\";\r\n\t}\r\n\telse\r\n\t{\t\r\n\t\t$user_meta['wp_capabilities'] = array(\"user\"=>1);\r\n\t\t$user_meta['soak_pp_key_user'] = \"false\";\r\n\t}\r\n\t\r\n\t$user_meta['description'] = $ymuser['Biography'];\r\n\t$user_meta['rich_editing'] = \"TRUE\";\r\n\t$user_meta['syntax_highlighting'] = \"TRUE\";\r\n\t$user_meta['admin_color'] = \"fresh\";\r\n\t\r\n\t$user_meta['use_ssl'] = 0;\r\n\t$user_meta['show_admin_bar_front'] = \"TRUE\";\r\n\t\r\n\t$user_meta['paupress_pp_public'] = 'a:16:{s:21:\"soak_pp_last_modified\";s:5:\"false\";s:18:\"soak_pp_last_login\";s:5:\"false\";s:19:\"soak_pp_login_count\";s:5:\"false\";s:18:\"soak_pp_ind_status\";s:5:\"false\";s:17:\"soak_pp_job_title\";s:5:\"false\";s:23:\"soak_pp_last_event_date\";s:5:\"false\";s:29:\"soak_pp_events_attended_count\";s:5:\"false\";s:11:\"description\";s:5:\"false\";s:9:\"telephone\";s:5:\"false\";s:13:\"address_one_1\";s:5:\"false\";s:13:\"address_two_1\";s:5:\"false\";s:14:\"address_city_1\";s:5:\"false\";s:15:\"address_state_1\";s:5:\"false\";s:17:\"address_country_1\";s:5:\"false\";s:21:\"address_postal_code_1\";s:5:\"false\";s:20:\"soak_pp_linkedin_url\";s:5:\"false\";}';\r\n\t\r\n\t\r\n\t$user_meta['telephone'] = array(array(\"value\" => $ymuser['EmpPhone'],\"type\" => \"work\"),array(\"value\" => \"\",\"type\" => \"private\"),\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => $ymuser['Mobile'],\"type\" => \"mobile\"),array(\"value\" => \"\",\"type\" => \"fax\"));\r\n\t$user_meta['soak_pp_subscription_type'] = \"NONE\";\r\n\t\t\r\n\t\r\n\t\r\n\t$user_meta['soak_new_user_email_sent'] = 1;\r\n\t$user_meta['soak_pp_linkedin_url'] = $ymuser['linkedinURL'];\r\n\t\r\n\t$querystr = \"SELECT tt.description as `Practice Area`, CONCAT('soak_channel__', t.name) AS `meta_key`, tt.term_id AS `meta_value` FROM wp_term_taxonomy AS tt INNER JOIN wp_terms AS t ON tt.term_id = t.term_id AND taxonomy = 'soak_channel' \";\r\n\t$results = $wpdb->get_results($querystr);\r\n\r\n\t$pa_count = count($ymuser['Practiceareas']);\r\n\t$delete_user_meta = array();\r\n\tfor($i=0;$i<count($results);$i++)\r\n\t{\t\r\n\r\n\t\t$pa_key = $results[$i]->{\"meta_key\"};\r\n\t\t$pa_value = $results[$i]->{\"meta_value\"};\r\n\t\t$delete_user_meta[] = $pa_key;\r\n\t\t\r\n\t\tif( $pa_count >= 1 )\r\n\t\t{\r\n\r\n\t\t\tfor($j=0;$j<$pa_count; $j++)\r\n\t\t\t{\r\n\t\t\t\t$pa_current = html_entity_decode($results[$i]->{\"Practice Area\"});\r\n\t\t\t\t$pa_update = $ymuser['Practiceareas'][$j];\r\n\r\n\t\t\t\tif( strcasecmp(trim($pa_update),trim($pa_current)) == 0 ) \r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t$user_meta[$pa_key] = $pa_value;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t\t\t$user_meta[$pa_key] = $pa_value;\r\n\t\t}\r\n\t}\r\n\t//die();\r\n\t\r\n\t$user_meta['soak_pp_last_modified'] = date(\"m/d/y H:i\");\r\n\t\r\n\t\r\n\t//To check the same user exists in CRF website or not. If not exists will create new account in CRF website\r\n\t$user_id = username_exists( $username );\r\n\r\n\tif(!$user_id)\r\n\t\t$user_id = email_exists($username);\r\n\r\n\t\r\n\tif ( !$user_id and email_exists($ymuser['EmailAddr']) == false ) {\r\n\t\t$user_id = wp_create_user( $username, $password, $ymuser['EmailAddr'] );\r\n\r\n\t\t$user_meta['soak_pp_show_contact_email'] = \"FALSE\";\r\n\t\t$user_meta['soak_pp_show_contact_telephone'] = \"FALSE\";\r\n\t\t\r\n\t\t\r\n\t\t//update meta data\r\n\t\tupdate_user_meta_data($user_id,$user_meta);\r\n\t\t\r\n\t\treturn $user_id;\r\n\t\t\r\n\t} \r\n\t\t//if user exist in CRF site\r\n\telseif ($user_id)\r\n\t{\r\n\t\t//If user exists update password for user CRF website to sysnch password in both YM and CRF website. \r\n\t\t//Also update member profile information to synch both YM and CRF website\r\n\t\twp_set_password($password,$user_id);\r\n\t\t\r\n\t\t//update email address\r\n\t\twp_update_user( array( 'ID' => $user_id, 'user_email' => $ymuser['EmailAddr'] ) );\r\n\t\t\r\n\t\t//delete meta practice areas\r\n\t\tdelete_user_meta_data($user_id,$delete_user_meta);\r\n\t\t\r\n\t\t//update meta data\r\n\t\tupdate_user_meta_data($user_id,$user_meta);\r\n\t\t\r\n\t\t\t\t\r\n\treturn $user_id;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t echo $user->login; //if both cases or not valied then redirecting to login.\r\n\t}\r\n\r\n\t//if user exists in YM and if password entered wrong then it will redirected to login CRF website.\r\n\tif ( is_wp_error($user) )\r\n\t\techo $user->login;\t\r\n\t\r\n\r\n\t return false;\r\n}", "function Communicator_user_settings() {\r\n return pnRedirect(pnModURL('Communicator'));\r\n}", "function lim_process_user_profile(&$vars) {}", "function user_permission_configuration_rebuild($identifiers, $module_name = 'configuration') {\n if ($defaults = configuration_get_default('user_permission', $module_name)) {\n // Make sure the list of available node types is up to date, especially when\n // installing multiple configuration at once, for example from an install profile\n // or via drush.\n node_types_rebuild();\n\n $roles = _user_configuration_get_roles();\n $permissions_by_role = _user_configuration_get_permissions(FALSE);\n foreach ($defaults as $permission) {\n $perm = $permission['name'];\n if (in_array($perm, $identifiers)) {\n foreach ($roles as $role) {\n if (in_array($role, $permission['roles']) || $identifiers[0] == '#import_all') {\n $permissions_by_role[$role][$perm] = TRUE;\n }\n else {\n $permissions_by_role[$role][$perm] = FALSE;\n }\n }\n }\n }\n // Write the updated permissions.\n foreach ($roles as $rid => $role) {\n if (isset($permissions_by_role[$role])) {\n user_role_change_permissions($rid, $permissions_by_role[$role]);\n \n }\n }\n foreach ($identifiers as $identifier) {\n configuration_check_user_permission($identifier);\n }\n cache_clear_all('config_export', 'cache');\n }\n}", "public function save_user_settings() {\n \n // Saves user settings\n (new MidrubBaseAdminCollectionUserHelpers\\Settings)->save_user_settings();\n \n }", "function user_pref_clear_cache( $p_user_id = null, $p_project_id = null ) {\n\tglobal $g_cache_user_pref;\n\n\tif( null === $p_user_id ) {\n\t\t$g_cache_user_pref = array();\n\t} else if( null === $p_project_id ) {\n\t\tunset( $g_cache_user_pref[(int)$p_user_id] );\n\t} else {\n\t\tunset( $g_cache_user_pref[(int)$p_user_id][(int)$p_project_id] );\n\t}\n\n\treturn true;\n}", "protected function fixItAll()\n {\n // Manage overrides\n $this->uninstallOverrides();\n $this->installOverrides();\n\n // Register hooks\n foreach ($this->hooks as $hook) {\n $this->registerHook($hook);\n }\n\n $this->updateAllValue('PS_DISABLE_NON_NATIVE_MODULE', false);\n $this->updateAllValue('PS_DISABLE_OVERRIDES', false);\n\n // Redirect in order to load the latest settings\n Tools::redirectAdmin($this->moduleUrl);\n }", "public static function ensureAllUserGroupsProcessed()\n {\n if (static::$_processedUserGroups) {\n return;\n }\n static::$_processedUserGroups = true;\n\n $projectConfig = Craft::$app->getProjectConfig();\n $allGroups = $projectConfig->get(UserGroups::CONFIG_USERPGROUPS_KEY, true);\n\n if (is_array($allGroups)) {\n foreach ($allGroups as $groupUid => $groupData) {\n $path = UserGroups::CONFIG_USERPGROUPS_KEY . '.';\n // Ensure group is processed\n $projectConfig->processConfigChanges($path . $groupUid);\n }\n }\n }", "function learn_press_update_user_profile_basic_information() {\n\t$user_id = learn_press_get_current_user_id();\n\t$update_data = array(\n\t\t'ID' => $user_id,\n\t\t'first_name' => filter_input( INPUT_POST, 'first_name', FILTER_SANITIZE_STRING ),\n\t\t'last_name' => filter_input( INPUT_POST, 'last_name', FILTER_SANITIZE_STRING ),\n\t\t'display_name' => filter_input( INPUT_POST, 'display_name', FILTER_SANITIZE_STRING ),\n\t\t'nickname' => filter_input( INPUT_POST, 'nickname', FILTER_SANITIZE_STRING ),\n\t\t'description' => filter_input( INPUT_POST, 'description', FILTER_SANITIZE_STRING ),\n\t);\n\t$res = wp_update_user( $update_data );\n\tif ( $res ) {\n\t\t$message = __( 'Your change is saved', 'learnpress' );\n\t} else {\n\t\t$message = __( 'Error on update your profile info', 'learnpress' );\n\t}\n\t$current_url = learn_press_get_current_url();\n\tlearn_press_add_message( $message );\n\twp_redirect( $current_url );\n\texit();\n}", "function ura_users_default_settings_panel(){\r\n\t\t$defaults = ura_users_screen_options_default_settings();\r\n\t\t\r\n\t\t//Output checkboxes \r\n\t\t$fields = array(\r\n\t\t\t'disable_wptexturize' \t\t=> 'Disable wptexturize',\r\n\t\t\t'disable_wpautop' \t\t\t=> 'Disable automatic paragraphs',\r\n\t\t\t'disable_convert_chars' \t=> 'Disable convert_chars',\r\n\t\t\t'disable_convert_smilies' \t=> 'Disable smilies',\r\n\t\t );\r\n\t\t \r\n\t\t$output = '';\r\n\t\tforeach( $fields as $field => $legend ){\r\n\t\t\t$esc_field = esc_attr( $field );\r\n\t\t\t$output .= sprintf(\r\n\t\t\t\t'<label for=\"ura_users_default-%s\" style=\"line-height: 20px;\">\r\n\t\t\t\t\t<input type=\"checkbox\" name=\"ura_users_default-%s\" id=\"ura_users_default-%s\"%s>\r\n\t\t\t\t\t%s\r\n\t\t\t\t</label><br>',\r\n\t\t\t\t$esc_field,\r\n\t\t\t\t$esc_field,\r\n\t\t\t\t$esc_field,\r\n\t\t\t\t( $defaults[$field]?' checked=\"checked\"':'' ),\r\n\t\t\t\t$legend\r\n\t\t\t);\r\n\t\t}\r\n\t\t \r\n\t\treturn $output;\r\n\t\t\r\n\t}", "function load_data(&$preferences, $userid) {\n global $USER;\n return true;\n }", "function wp_install_defaults($user_id)\n{\n}", "private static function profile_load_all_profile(&$user) {\n // don't do anything unless in Drupal, with the profile module enabled, and the user logged in.\n if ($user->uid > 0 && function_exists('profile_load_profile')) {\n\t\tif(version_compare(hostsite_get_cms_version(), '8', '<')) {\n\t\t\t$result = db_query('SELECT f.name, f.type, v.value FROM {profile_fields} f LEFT JOIN {profile_values} v ON f.fid = v.fid AND uid = %d', $user->uid);\n\t\t while ($field = db_fetch_object($result)) {\n\t\t\tif (empty($user->{$field->name})) {\n\t\t\t if (empty($field->value))\n\t\t\t\t$user->{$field->name} = '';\n\t\t\t else\n\t\t\t\t$user->{$field->name} = _profile_field_serialize($field->type) ? unserialize($field->value) : $field->value;\n\t\t\t}\n\t\t }\n\t\t}\n\t\t else {\n\t\t $results = \\Drupal::database()->query('SELECT uid, name FROM {users_field_data} WHERE uid <> 0'); // drupal8 & above\n foreach ($results as $result) { // DB processing is different in 8 & above\n if($result->uid){\n $account = user_load($result->uid); /* this loads the field_ fields, so no need for profile_load_profile */\n if(isset($account->profile_indicia_user_id) && isset($uList[$account->profile_indicia_user_id]) && $uList[$account->profile_indicia_user_id])\n $userList[$account->uid] = $account;\n }\n }\n\t\t}\n }\n }", "function updateUsername($userinfo, &$existinguser, &$status)\r\n {\r\n }", "public function afterValidate()\n {\n parent::afterValidate();\n\n foreach ($this->usernames as $username) {\n $user = $this->githubUserInfo($username);\n\n if (!$user) {\n $this->addError('usernames', 'User ' . $username . ' do not exists');\n continue;\n }\n\n if (!$user['email']) {\n $this->addError('usernames', 'User ' . $username . ' has no email');\n continue;\n }\n\n $this->_foundGithubUsers[] = [\n 'email' => $user['email'],\n 'location' => $user['location'],\n ];\n }\n }" ]
[ "0.6025147", "0.59283024", "0.5901776", "0.5880591", "0.5849506", "0.5798186", "0.5723186", "0.57099754", "0.56204635", "0.5615975", "0.5593442", "0.5566284", "0.55101913", "0.5394372", "0.5388693", "0.5369685", "0.5356419", "0.5351832", "0.53111416", "0.5308078", "0.5307406", "0.5263456", "0.5263342", "0.5260093", "0.5255095", "0.5195274", "0.5165103", "0.51558906", "0.514539", "0.51400256", "0.51310134", "0.5127614", "0.5123743", "0.5120707", "0.5109546", "0.50978416", "0.5078141", "0.50769484", "0.50762343", "0.5076187", "0.5071079", "0.5066594", "0.50578225", "0.5052307", "0.50470334", "0.5046267", "0.5043927", "0.5038389", "0.50338924", "0.5026459", "0.5021086", "0.5019924", "0.5008173", "0.50080097", "0.50036794", "0.49876365", "0.49867585", "0.49720147", "0.49683902", "0.49655297", "0.49609756", "0.49571723", "0.49464774", "0.49461666", "0.49449298", "0.49316943", "0.49241066", "0.49203464", "0.49109098", "0.4908197", "0.49069655", "0.49061444", "0.4901604", "0.488303", "0.4880536", "0.48762232", "0.48755872", "0.4868392", "0.4864592", "0.4862253", "0.4860209", "0.4856552", "0.4851872", "0.48489866", "0.48484254", "0.48439977", "0.4841405", "0.4839921", "0.48376802", "0.48371306", "0.48260617", "0.4818872", "0.48181534", "0.48170847", "0.48161998", "0.48154697", "0.48149195", "0.48084503", "0.4806789", "0.48057526" ]
0.7398365
0
Return the rules of this league.
Верните правила этой лиги.
public function getLeagueRules() { return $this->leagueRules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRules();", "public function getRules();", "public function getRules();", "public function getRules();", "public function getRules();", "public function getRules();", "protected function rules()\n {\n return $this->getRules();\n }", "public function rules()\n {\n return $this->getRules();\n }", "public function rules()\n {\n return $this->getRules();;\n }", "public function getRules() {\n return $this->rules;\n }", "public function getRules() {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n\t{\n\t\treturn $this->rules;\n\t}", "public function getRules()\n\t{\n\t\treturn $this->rules;\n\t}", "public function getRules() {\n\t\treturn $this->rules;\n\t}", "public function getRules() {\n\t\treturn $this->rules;\n\t}", "public function getRules() {\n\t\treturn $this->rules;\n\t}", "public function GetRules() {\n\n return $this->Rules;\n }", "public function getRules(){\n\t\treturn $this->rules;\n\t}", "public function rules()\n\t{\n\t\t$rules = \\App\\Tournamenttype::$rules;\n\n\t\treturn $rules;\n\t}", "protected function getRules()\n {\n return $this->rules;\n }", "protected function getRules()\n {\n return $this->rules;\n }", "public function getMatchingRules()\n {\n return $this->matchingRules;\n }", "public static function rules()\n {\n return static::$rules;\n }", "public function rules()\n {\n return $this->getSectionRules($this->getSection());\n }", "public function rules()\n\t{\n\t\treturn absences::$rules;\n\t}", "public function getRules(): array\n {\n return $this->rules;\n }", "public function get_rules() {\n\t\treturn $this->rules;\n\t}", "function getRules()\r\n {\r\n $rules = $this->_dbGetRules();\r\n $rules = $this->_prepareRules($rules);\r\n return $rules;\r\n }", "public function rules()\n {\n return $this->phrealestateRepository->rules();\n }", "public function get_all_rules() {\n\t\treturn $this->rules;\n\t}", "public static function getRules(){\n\t\t\treturn self::$ruleSet;\n\t\t}", "public function rules()\n {\n return $this->getMainRules() + $this->getPhoneRules();\n }", "public function getRules(): array\n\t{\n\t\treturn $this->rules;\n\t}", "abstract public function getRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function Rules()\n\t{\n\t return [];\n\t}", "public function getRules ()\n {\n if ( !empty( $this->_rule ) )\n {\n return array ($this->_rule => true);\n }\n }", "public function getRules()\n {\n return isset($this->rules) ? $this->rules : [];\n }", "public function rules()\n {\n return static::$rules;\n }", "protected function getRules(): array\n {\n return $this->rules;\n }", "public function getRules(): array;", "public function getRules(): array;", "public function getRules(): array;", "public function getRules()\n {\n $code = $this->getAdapter()->getCurrentLanguage();\n $rules[$code] = $this->priority;\n\n return [$rules];\n }", "public function rules()\n {\n $rules = Community::$rules;\n \n return $rules;\n }", "public function getRules()\n {\n $query = (new Query)->from($this->ruleCollection);\n \n $rules = [];\n foreach ($query->all($this->mongodb) as $row) {\n $rules[$row['name']] = unserialize($row['data']);\n }\n \n return $rules;\n }", "public function rules()\n {\n return Grader::$rules;\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getMatchRules() {\n return $this->matchRules; \n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->sequentialRules;\n }", "public function rules(){\n \n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n $rules = [\n\n ];\n\n return $rules;\n }", "protected function getRules()\n {\n return array_merge($this->_instanceRules, static::$_rules);\n }", "public function getRules()\n {\n $rules = [\n 'phone' => '',\n 'gender' => 'in:male,female',\n 'available' => 'in:1,0'\n ];\n return $rules;\n }", "public function getRules() {\n return array(\n 'nombre_habitacion' => array(\n array( 'maxlength',150, 'El Nombre no puede contener mas de 150 caracteres' ),\n array( 'notempty', 'El nombre no puede estar vacio' ),\n array( 'notnull' ),\n ),\n\n 'url_visitavirtual' => array(\n array( 'maxlength',150, 'La url no puede contener mas de 150 caracteres' ),\n array( 'notempty', 'La Url no puede estar vacio' ),\n array( 'notnull' ),\n ),\n );\n }", "public function getRules() : array\n {\n return $this->rules ?: [];\n }", "public function rules()\n {\n $rules = array_merge(Employee::createRules(), (new Manager())->subordinateRules());\n return $rules;\n }", "public function rules()\n {\n return Tesouraria::$rules;\n }", "public function rules()\n {\n $getConstant = $this->segment(2).'_'.$this->segment(3);\n\n $this->rulesArray = Config('advantageacl.'.$getConstant);\n\n return $this->rulesArray['rules'];\n }", "public function getRules()\n {\n return $this->getFieldManager()->rules();\n }", "public function getContestRules()\n {\n return $this->_contestRules;\n }", "public function rules(): array\n {\n return $this->rules;\n }", "public function rules()\n {\n return Slide::$rules;\n }", "public function rules()\n\t{\n\t\treturn $this->rules;\n\t}", "public static function rules()\n {\n return $rules = array();\n }", "public function getRules()\n {\n\n }", "public function getRules()\n\t{\n\t\treturn $this->inputRules;\n\t}", "public function rules()\n {\n return $this->processRules;\n }", "public function rules(): array;", "public function rules()\n {\n return ValidationManager::getRules($this->komposer);\n }", "public function getRules() {\r\n if (is_null($this->rules)) {\r\n $this->rules = new Aloi_Phigester_RulesBase();\r\n $this->rules->setDigester($this);\r\n }\r\n return $this->rules;\r\n }", "public function rules()\n\t{\n\t\treturn HostHelper::getRules();\n\t}", "public static function rules();", "public function getValidationRules();", "public function getValidationRules();", "protected function getRules()\n {\n return array('max', 'min', 'exact', 'blacklist', 'whitelist');\n }", "abstract public function getRules(): array;", "public function rules()\n {\n return array_merge($this->defaultRules, $this->addRules());\n }", "public function getRules(): array {\n return [];\n }", "public function getRules(): array\n {\n return isset($this->rules) && is_array($this->rules) ? $this->rules : [];\n }", "public function getRules(): array\n {\n return array_combine(\n array_keys($this->_field_data),\n arrayExtractProperty($this->_field_data, 'rules')\n );\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n return $this->validationRules;\n }" ]
[ "0.80584514", "0.80584514", "0.80584514", "0.80584514", "0.80584514", "0.80584514", "0.7957838", "0.79159725", "0.7902698", "0.78234065", "0.78234065", "0.7817051", "0.7817051", "0.7817051", "0.7817051", "0.7817051", "0.7817051", "0.7817051", "0.7749178", "0.7749178", "0.7736105", "0.7736105", "0.7736105", "0.7718446", "0.7711126", "0.7699316", "0.7675214", "0.7675214", "0.7649514", "0.7633189", "0.76131517", "0.7591839", "0.75815606", "0.75778806", "0.75678515", "0.75655586", "0.75621724", "0.7552005", "0.754848", "0.75335485", "0.75296736", "0.75106645", "0.7499599", "0.7494406", "0.74900943", "0.7480959", "0.7437692", "0.74370134", "0.74370134", "0.74370134", "0.7413421", "0.7410681", "0.74095845", "0.7406054", "0.7391342", "0.7391342", "0.7391342", "0.7391342", "0.7391342", "0.7377814", "0.7356648", "0.7356648", "0.7356648", "0.7356648", "0.7338248", "0.73369443", "0.7323003", "0.7307556", "0.7290686", "0.72852385", "0.728062", "0.7276033", "0.7273863", "0.7265782", "0.72555596", "0.72553957", "0.72218055", "0.72204685", "0.7209047", "0.7208574", "0.7191242", "0.71557266", "0.71502256", "0.7143972", "0.713326", "0.7132846", "0.7132449", "0.71223706", "0.7113279", "0.71114385", "0.71114385", "0.7072119", "0.7065673", "0.7063796", "0.70635617", "0.705678", "0.7056512", "0.7027583", "0.7027583", "0.7027583" ]
0.85509175
0
Set the new rules of this league.
Задайте новые правила этой лиги.
public function setLeagueRules( $leagueRules ){ $this->leagueRules = $leagueRules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRules($rules);", "public function setRules(array $rules);", "public static function setRules($rules){\n\t\t\tself::$ruleSet = $rules;\n\t\t}", "public function setRules($rules = array())\n\t{\n\t\t$this->rules = $rules;\n\t}", "protected function setRule(): void\n {\n }", "public function set_rules($rules)\n\t{\n\t\t$this->rules = array_merge($this->rules, $rules);\n\t}", "public function setRule($rule);", "public function setRules(array $rules)\n {\n $this->rules = $rules;\n }", "public function setRules(array $rules)\n {\n $this->rules = $rules;\n }", "public function setRules(Aloi_Phigester_Rules $rules) {\r\n $this->rules = $rules;\r\n $this->rules->setDigester($this);\r\n }", "public function setRulesAttribute(array $rules): void\n {\n if (isset($this->attributes['rules'])) {\n $rules = array_filter(array_merge($this->rules, $rules), function ($rule) {\n return ! is_null($rule);\n });\n }\n $this->attributes['rules'] = json_encode($rules);\n }", "public function setRules(array $rules = null);", "private function setRules(): void\n {\n if ($this->hasValidationRulesMethod()) {\n $this->rules = static::validationRules();\n }\n\n if ($this->rules === null) {\n $this->rules = [];\n }\n }", "public static function setRules($rules){\r\n $_this = & Inflector::getInstance();\r\n\r\n $_this->rules = $rules;\r\n }", "public function setRules($rules)\n {\n if (empty($rules)) {\n return;\n }\n foreach ($rules as $key => $rule) {\n if (!is_array($rule)) {\n $rules[$key] = array($rule);\n }\n }\n $this->rules = $rules;\n }", "public function setRules(array $rules)\n {\n $this->rules = array_merge($this->rules, $rules);\n return $this;\n }", "public function rules($rules)\n\t{\n\t\t$this->_rules\t=\tarray_merge($this->_rules, $rules);\n\t}", "public function setRules(array $rules)\n {\n $this->rules = $rules;\n return $this;\n }", "public function setDraftGroupRules()\n {\n $this->rules = new Rules($this->gameTypeId);\n }", "public function setRules($rules)\n\t{\n\t\tif (!$rules)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t$this->filterRules = array();\n\t\t$this->validatorRules = array();\n\n\t\tif (isset($rules['filter']))\n\t\t{\n\t\t\t$this->setFilters($rules['filter']);\t\t\t\n\t\t}\t\t\n\t\t\t\n\t\tif (isset($rules['validator']))\n\t\t{\n\t\t\t$this->setValidators($rules['validator']);\n\t\t}\t\t\n\t}", "public function rules(array $rules): self;", "protected function setupRules()\n {\n $this->rules = (new Rules($this))->getRules();\n }", "private function addRules(): void\n {\n $ruleService = Yii::$container->get(RuleService::class);\n $ruleService->addRules($this->rules);\n }", "public function setRules(array $rules)\n {\n $this->rules = $rules;\n\n return $this;\n }", "public function rules($rules) {\r\n $this->_rules = $rules;\r\n return $this;\r\n }", "public function setRules(array $rules)\n {\n $this->ensureRulesEnabled();\n $this->rules = $rules;\n\n return $this;\n }", "public function setRules(Blackbox_IRule $rules)\n\t{\n\t\t$this->rules = $rules;\n\t}", "public function setRules($resource, array $rules);", "public function setRule($rule)\n {\n $this->rule = $rule;\n }", "public function & rules(array $rules){\n foreach ((array)$rules as $varname => $rule){\n $this->rules[$varname] = $rule;\n }\n $this->pattern = $this->compilePatternAsRegex( $this->URLPattern, $this->rules );\n $this->matcher_pattern = $this->compilePatternAsRegex( $this->URLPattern, $this->rules, false );\n return $this;\n }", "public function setRules(array $rules = null)\n {\n $this->rules = $rules;\n }", "public function populateRules($rules)\n {\n foreach($rules as $key=>$value) {\n \n $method = 'set'. ucfirst(str_replace('_', '',$key));\n \n if(method_exists($this, $method) && isset($value)) {\n $this->$method($value);\n } \n }\n \n }", "public function setRules($rules = array())\n {\n if (empty($rules) || !is_array($rules)) {\n return $this;\n }\n $this->_rules = $rules;\n\n return $this;\n }", "public function defineRules();", "public function updateRules(RuleSet $ruleSet): void;", "function _setValidation(&$model, $rules) {\n\t\t$rule = array_shift($rules);\n\t\t$this->__oldRules[$model->name] = $model->validate;\n\t\t$model->validate = $model->validationSets[$rule];\n }", "public function setMatchRules( $matchRules ) {\n $this->matchRules = $matchRules; \n }", "public function rule($rule)\n\t{\n\t\t$this->_rules[]\t=\t$rule;\n\t}", "protected function setRules($value)\n {\n $this->attributes['rules'] = is_array($value) ? array_merge($this->getRules(), $value) : $value;\n }", "public function setRules(array $map)\n {\n $this->rules = $map;\n }", "private function setRules() {\n\n $this->requestRules = [\n 'mailable' => [\n 'required',\n 'max:255'\n ],\n 'subject' => [\n 'array'\n ],\n 'html_template' => [\n 'required',\n 'array'\n ],\n 'text_template' => [\n 'array'\n ]\n ];\n }", "public function updateRules()\n {\n return [\n //\n ];\n }", "public function setValidationRules()\n\t{\n\t\tForm::setValidationRules(static::validationRules((int) $this->id));\n\t}", "public function runRules()\n {\n foreach ($this->_rules AS $rule) {\n $rule->rule($this);\n }\n }", "public function testUpdateRuleset()\n {\n }", "public function rules($rules = array())\n {\n $this->routes[$this->last]['rules'] = $rules;\n return $this;\n }", "private function __construct($rules){\n\t\t$this->addRules($rules);\n\t}", "abstract protected function initRules();", "public function setRules(array $rules): void\n {\n foreach ($rules as $key => $rule) {\n // Skip empty rules (why, must be well defined already?).\n if (empty($rule)) {\n continue;\n }\n\n // Nested (eg: [user => [image => [@fields => [id => [type => string], url => [type => url], ..]]]]).\n if (isset($rule['@fields'])) {\n if (empty($rule['@fields'])) {\n throw new ValidationException('Rule `@fields` must be a non-empty array');\n } elseif (!is_array($rule['@fields'])) {\n throw new ValidationException('Rule `@fields` must be an array, %t given', $rule);\n }\n\n $this->rules[$key] = new Rules($rule['@fields']);\n }\n // Single (eg: [image => [id => [type => string], url => [type => url], ..]]).\n else {\n $this->rules[$key] = new Rule($key, $rule);\n }\n }\n }", "private function setRules() {\n\n $this->requestRules = [\n 'name' => [\n 'required',\n 'max:255'\n ],\n 'first_name' => [\n 'required',\n 'max:255'\n ],\n 'email' => [\n 'required',\n 'max:255',\n 'email',\n 'unique:users,email,' . $this->modelId . ',id'\n ],\n 'login' => [\n 'required',\n 'max:255',\n 'unique:users,login,' . $this->modelId . ',id'\n ],\n 'password' => [\n $this->setRule('required', 'nullable'),\n 'min:8',\n 'max:120',\n 'confirmed',\n 'regex:/^.*(?=.{8,120})(?=.*[a-z])(?=.*[A-Z])(?=.*[\\d])(?=.*[^a-zA-Z\\d\\s]).*$/'\n ],\n 'theme' => [\n 'boolean'\n ]\n ];\n }", "public function rules($rules)\n {\n $this->rules = FieldRuleManager::parseRules($rules);\n return $this;\n }", "public function setRules(array $rules): ConfigInterface\n {\n $this->rules = array_merge($this->rules, $rules);\n\n return $this;\n }", "public function rules($rules)\n {\n $this->rules = ($rules instanceof Rule || is_string($rules) || $rules instanceof Unique) ? func_get_args() : $rules;\n\n return $this;\n }", "public function add_rules()\n {\n foreach($this->rules as $regex => $rule)\n {\n add_rewrite_rule($regex, $rule['rewrite'], $rule['prio']);\n }\n }", "public static function addRules($rules)\n {\n foreach ($rules as $regex => $replace) {\n self::addRule($regex, $replace);\n }\n }", "public abstract function rules();", "public function setBusinessRules(array $rules)\n\t{\n\t\t$this->business_rules = $rules;\n\t}", "public function addRule($rule);", "public function setRules(?array $value): void {\n $this->getBackingStore()->set('rules', $value);\n }", "protected function updateRules(array $rules): void\n {\n foreach ($rules as $rule => $value) {\n $this->rulesProvider->$rule = $value;\n }\n\n $this->rules = $this->rulesProvider->getRules();\n\n $this->rulesProvider->clearRules();\n }", "public function updateRules($rules)\n {\n $this->updateRules = is_string($rules) ? func_get_args() : $rules;\n\n return $this;\n }", "public function updateRules(...$rules) : self\n {\n $this->updateRules = $rules;\n\n return $this;\n }", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "public function addRule($val) {\n\t\t$this->rules[] = $val;\n\t}", "public function addRule($val) {\n\t\t$this->rules[] = $val;\n\t}", "public function addRule($val) {\n\t\t$this->rules[] = $val;\n\t}", "public function rules($rules)\n {\n $this->rules = is_string($rules) ? func_get_args() : $rules;\n\n return $this;\n }", "public function rules(array $array)\n\t{\n\t\tforeach ($array as $options)\n\t\t{\n\t\t\tcall_user_func_array(array($this, 'rule'), $options);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function clearRules () {\n $this->_rules = array();\n }", "private function setRules()\r\n {\r\n // Field map kontrolü yapılıyor\r\n $map = new FieldMap($this->getFieldMap());\r\n\r\n // Sabit kurallar ekleniyor\r\n $rules = $this->getRules();\r\n foreach ($rules as $key => $rules) \r\n {\r\n $this->CI->form_validation->set_rules(\r\n $key,\r\n CI::lang(\"field_$key\"),\r\n $map->addRule($key, $rules)\r\n );\r\n }\r\n \r\n // Standart tanımlama içinde bulunmayan, ama zorunlu olarak belirtilen \r\n // alanlar için required kuralı oluşturulur.\r\n foreach ($map->getNetFields() as $key => $name)\r\n {\r\n $this->CI->form_validation->set_rules($name, CI::lang(\"field_$name\"), 'required');\r\n }\r\n }", "public function updatingRules($rules)\n {\n $this->updatingRules = ($rules instanceof Rule || is_string($rules) || $rules instanceof Unique) ? func_get_args() : $rules;\n\n return $this;\n }", "public function saveNewRules() {\n /** @var modActionDom $newRule */\n foreach ($this->newRules as $newRule) {\n $newRule->save();\n }\n }", "public function withRules(array $rules): HasRulesContract\n {\n $this->updateRules($rules);\n\n return $this;\n }", "public function setRules(array $rules, array $messages = []): ValidationInterface;", "public function setRules($rules)\n {\n Yii::configure($this, $rules);\n if (!is_array($this->lockedFields)) {\n throw new InvalidConfigException('The property \"lockedFields\" must be an array in ' . get_class($this) . '.');\n }\n }", "public function getLeagueRules() {\n return $this->leagueRules; \n }", "public function updateRules(): array\n {\n // TODO: Implement updateRules() method.\n }", "public function overrideRules()\n {\n }", "public function setRule(string $field, ?string $label, $rules, array $errors = []);", "public function update_rules($rules) {\n global $DB;\n \n $oldrules = $this->get_rules();\n $rulestodelete = array();\n\n foreach ($oldrules as $oldrule) {\n foreach ($rules as $rule) {\n if ($rule->selector == $oldrule->selector) {\n $rule->id = $oldrule->id;\n continue 2;\n }\n }\n $rulestodelete[] = $oldrule->id;\n }\n\n if (count($rulestodelete) > 0) {\n $DB->delete_records_list('block_css_theme_tool', 'id', $rulestodelete);\n $DB->delete_records_list('block_css_theme_tool_styles', 'ruleid', $rulestodelete);\n }\n\n if (count($rules) > 0) {\n foreach ($rules as $rule) {\n $rule->save();\n }\n }\n $this->rules = $rules;\n }", "public static function rules();", "function add_rules( $rules ) {\n\t\tforeach( $rules as $name => $rule )\n\t\t\t$this->add_rule( $name, $rule );\n\t}", "public function rules();", "public function rules();", "public function rules();", "public function addRulesFromClass(string $rulesClass): self;", "public function addAcceptRules(array $rules): self\n\t{\n\t\tforeach ($rules as $path => $roles) {\n\t\t\t$rules[$path] = array_map('strtolower', $roles);\n\t\t}\n\n\t\t$this->acceptRules = array_merge($this->acceptRules, $rules);\n\n\t\treturn $this;\n\t}", "public function setRule(string $rule): self \n {\n $this->rule = $rule;\n\n return $this;\n }", "public function addRules(array $rules): UnitType\n {\n $this->rules = array_merge($this->rules, $rules);\n\n return $this;\n }", "abstract protected function rules();" ]
[ "0.72093695", "0.7074415", "0.7021559", "0.69539785", "0.6885455", "0.6749553", "0.67403394", "0.673128", "0.673128", "0.66848105", "0.66518384", "0.6629505", "0.66190845", "0.66185516", "0.65870136", "0.65045744", "0.64531446", "0.64118344", "0.637165", "0.6351879", "0.6327171", "0.63167644", "0.62969023", "0.6295422", "0.62620574", "0.6260953", "0.61944014", "0.61904484", "0.61831707", "0.6179948", "0.61719006", "0.6148013", "0.60421836", "0.6041729", "0.6006604", "0.5998777", "0.59290063", "0.59285086", "0.59111863", "0.58888066", "0.58788705", "0.5852151", "0.5835567", "0.5831874", "0.5823374", "0.5818956", "0.5806243", "0.58028316", "0.57916856", "0.57854366", "0.57216775", "0.5707649", "0.56886035", "0.56874883", "0.5649537", "0.5643832", "0.5642755", "0.56427455", "0.5632572", "0.5631629", "0.56118685", "0.56054103", "0.560512", "0.560512", "0.560512", "0.560512", "0.560512", "0.560512", "0.560512", "0.560512", "0.560512", "0.560512", "0.560512", "0.560119", "0.560119", "0.560119", "0.55997384", "0.55768144", "0.5573788", "0.5564007", "0.55636036", "0.5563377", "0.55565244", "0.55348146", "0.5533996", "0.5532979", "0.55091494", "0.5462502", "0.54544955", "0.5444622", "0.5438747", "0.5428798", "0.5426705", "0.5426705", "0.5426705", "0.54201794", "0.5416201", "0.54135036", "0.54058254", "0.53983855" ]
0.7678505
0
Return the match rules of this league.
Верните правила соответствия этого чемпионата.
public function getMatchRules() { return $this->matchRules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMatchingRules()\n {\n return $this->matchingRules;\n }", "public function getLeagueRules() {\n return $this->leagueRules; \n }", "public function getRules();", "public function getRules();", "public function getRules();", "public function getRules();", "public function getRules();", "public function getRules();", "protected function rules()\n {\n return $this->getRules();\n }", "public function rules()\n {\n return $this->getRules();\n }", "public function rules()\n {\n return $this->getRules();;\n }", "public function rules()\n\t{\n\t\t$rules = \\App\\Tournamenttype::$rules;\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n return $this->getMainRules() + $this->getPhoneRules();\n }", "public static function rules()\n {\n return static::$rules;\n }", "public function rules()\n {\n return $this->getSectionRules($this->getSection());\n }", "public function getRules() {\n return $this->rules;\n }", "public function getRules() {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n return $this->phrealestateRepository->rules();\n }", "public function getRules()\n\t{\n\t\treturn $this->rules;\n\t}", "public function getRules()\n\t{\n\t\treturn $this->rules;\n\t}", "function getRules()\r\n {\r\n $rules = $this->_dbGetRules();\r\n $rules = $this->_prepareRules($rules);\r\n return $rules;\r\n }", "public function rules()\n\t{\n\t\treturn absences::$rules;\n\t}", "abstract public function getRules();", "public function getRules() {\n\t\treturn $this->rules;\n\t}", "public function getRules() {\n\t\treturn $this->rules;\n\t}", "public function getRules() {\n\t\treturn $this->rules;\n\t}", "public function get_all_rules() {\n\t\treturn $this->rules;\n\t}", "public function getRules(){\n\t\treturn $this->rules;\n\t}", "public static function getRules(){\n\t\t\treturn self::$ruleSet;\n\t\t}", "public function rules()\n {\n return Grader::$rules;\n }", "protected function getRules()\n {\n return $this->rules;\n }", "protected function getRules()\n {\n return $this->rules;\n }", "public function GetRules() {\n\n return $this->Rules;\n }", "public function getRules ()\n {\n if ( !empty( $this->_rule ) )\n {\n return array ($this->_rule => true);\n }\n }", "public function getRules()\n {\n $rules = [\n 'phone' => '',\n 'gender' => 'in:male,female',\n 'available' => 'in:1,0'\n ];\n return $rules;\n }", "public function get_rules() {\n\t\treturn $this->rules;\n\t}", "public function rules()\n {\n return static::$rules;\n }", "public function rules()\n {\n $rules = Community::$rules;\n \n return $rules;\n }", "public function getRules(): array\n {\n return $this->rules;\n }", "public function getRules(): array\n\t{\n\t\treturn $this->rules;\n\t}", "public function getRules()\n {\n $code = $this->getAdapter()->getCurrentLanguage();\n $rules[$code] = $this->priority;\n\n return [$rules];\n }", "public function getRules() {\n return array(\n 'nombre_habitacion' => array(\n array( 'maxlength',150, 'El Nombre no puede contener mas de 150 caracteres' ),\n array( 'notempty', 'El nombre no puede estar vacio' ),\n array( 'notnull' ),\n ),\n\n 'url_visitavirtual' => array(\n array( 'maxlength',150, 'La url no puede contener mas de 150 caracteres' ),\n array( 'notempty', 'La Url no puede estar vacio' ),\n array( 'notnull' ),\n ),\n );\n }", "protected function getRules()\n {\n return array('max', 'min', 'exact', 'blacklist', 'whitelist');\n }", "public static function rules();", "public function rules()\n {\n $rules = [\n\n ];\n\n return $rules;\n }", "public function getRules(): array;", "public function getRules(): array;", "public function getRules(): array;", "public function getContestRules()\n {\n return $this->_contestRules;\n }", "protected function getRules()\n {\n return array_merge($this->_instanceRules, static::$_rules);\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return ValidationManager::getRules($this->komposer);\n }", "protected function getRules(): array\n {\n return $this->rules;\n }", "public function rules(){\n \n return $this->rules;\n }", "public static function rules()\n {\n return $rules = array();\n }", "public function getRules()\n {\n $query = (new Query)->from($this->ruleCollection);\n \n $rules = [];\n foreach ($query->all($this->mongodb) as $row) {\n $rules[$row['name']] = unserialize($row['data']);\n }\n \n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function Rules()\n\t{\n\t return [];\n\t}", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n return isset($this->rules) ? $this->rules : [];\n }", "public function rules()\n {\n $rules = array_merge(Employee::createRules(), (new Manager())->subordinateRules());\n return $rules;\n }", "public function rules()\n {\n $getConstant = $this->segment(2).'_'.$this->segment(3);\n\n $this->rulesArray = Config('advantageacl.'.$getConstant);\n\n return $this->rulesArray['rules'];\n }", "public function rules()\n\t{\n\t\treturn HostHelper::getRules();\n\t}", "public function rules()\n\t{\n\t\treturn $this->rules;\n\t}", "public function rules()\n {\n return array_merge($this->defaultRules, $this->addRules());\n }", "public function rules()\n {\n $rules = AttendanceLogfinger::$rules;\n\n $rules = $this->excludeKeys ? array_diff_key($rules, array_combine($this->excludeKeys, $this->excludeKeys)) : $rules;\n return $rules;\n }", "public function rules(): array\n {\n return $this->rules;\n }", "public function rules(): array;", "public function get_rules($league_id) {\n\t\n\t\t$league_id\t= $this->sanitize( $league_id );\n\t\t$data = $this->fetch(\"SELECT league, rules FROM `\" . $this->prefix . \"leagues` WHERE id = '$league_id'\");\n\t\tif( $data ) {\n\t\t\t$league = array(\n\t\t\t\t\t'league' => $data['0']['league'],\n\t\t\t\t\t'rules' => $data['0']['rules']\n\t\t\t);\n\t\t\treturn $league;\n\t\t}\n\t\n\t}", "public function rules()\n {\n return $this->processRules;\n }", "public function getRules()\n {\n return $this->getFieldManager()->rules();\n }", "public function getValidationRules();", "public function getValidationRules();", "public function rules();", "public function rules();", "public function rules();", "public function getRules()\n {\n return $this->sequentialRules;\n }", "public function rules()\n {\n return Tesouraria::$rules;\n }", "public function getRule();", "public function rules()\n {\n $supportedLocales = Language::getPackageLanguageKeys();\n\n $rules = [\n 'language_key' => [\n 'required', 'string', 'max:10',\n $this->getUniqueRule(\"languages\", \"language_key\"),\n Rule::in($supportedLocales)\n ],\n 'native_name' => 'required|string|max:20',\n 'latin_name' => 'nullable|string|max:20',\n 'script' => 'nullable|string|max:20',\n 'regional' => 'nullable|string|max:10',\n 'order_no' => 'nullable|numeric|min:0|max:99',\n 'remark' => 'nullable|string|max:500'\n ];\n\n $rules = $this->addActiveFlgRules($rules);\n\n return $rules;\n }", "public function rules()\n {\n return $this->isUpdate() ?\n $this->updateRules() :\n $this->baseRules();\n }", "public function rules()\n {\n return $this->registerRules();\n }", "public function rules()\n {\n return Slide::$rules;\n }", "public function getRules()\n\t{\n\t\treturn $this->inputRules;\n\t}", "public function rules()\n {\n if ($this->isUpdate())\n {\n //\n }\n\n return $this->rules;\n }" ]
[ "0.81317335", "0.7977773", "0.7227043", "0.7227043", "0.7227043", "0.7227043", "0.7227043", "0.7227043", "0.71902186", "0.71267515", "0.7106587", "0.7066387", "0.696151", "0.68378365", "0.6830886", "0.6807661", "0.6807661", "0.67996854", "0.67996854", "0.67996854", "0.67996854", "0.67996854", "0.67996854", "0.67996854", "0.67903054", "0.6778939", "0.6767772", "0.6767772", "0.67620236", "0.6744959", "0.67444104", "0.67329276", "0.67329276", "0.67329276", "0.6709644", "0.6708545", "0.67050314", "0.6703351", "0.6678669", "0.6678669", "0.66636515", "0.66627634", "0.6662193", "0.6659646", "0.66552645", "0.6644598", "0.6628099", "0.6626276", "0.6622502", "0.66185707", "0.66176677", "0.66004616", "0.65993196", "0.65599155", "0.65599155", "0.65599155", "0.6545547", "0.6542465", "0.65380114", "0.65380114", "0.65380114", "0.65380114", "0.65341944", "0.65268195", "0.65119094", "0.65023154", "0.64993376", "0.6491829", "0.64905375", "0.64904344", "0.64904344", "0.64904344", "0.64904344", "0.64904344", "0.6488014", "0.648645", "0.6474193", "0.6465267", "0.64625317", "0.64528185", "0.64525205", "0.64497536", "0.64494884", "0.6443761", "0.6441381", "0.6439531", "0.6420415", "0.6420415", "0.63985085", "0.63985085", "0.63985085", "0.6397251", "0.63896394", "0.6389485", "0.6386876", "0.6383281", "0.63704437", "0.6364799", "0.63509", "0.6345104" ]
0.82366925
0
Set the new match rules of this league.
Установите новые правила встреч этого турнира.
public function setMatchRules( $matchRules ) { $this->matchRules = $matchRules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setLeagueRules( $leagueRules ){\n $this->leagueRules = $leagueRules; \n }", "public function setRules($rules);", "protected function setRule(): void\n {\n }", "public static function setRules($rules){\n\t\t\tself::$ruleSet = $rules;\n\t\t}", "public function setRules(array $rules);", "public function setRule($rule);", "public function setRules($rules = array())\n\t{\n\t\t$this->rules = $rules;\n\t}", "public function set_rules($rules)\n\t{\n\t\t$this->rules = array_merge($this->rules, $rules);\n\t}", "public static function setRules($rules){\r\n $_this = & Inflector::getInstance();\r\n\r\n $_this->rules = $rules;\r\n }", "public function & rules(array $rules){\n foreach ((array)$rules as $varname => $rule){\n $this->rules[$varname] = $rule;\n }\n $this->pattern = $this->compilePatternAsRegex( $this->URLPattern, $this->rules );\n $this->matcher_pattern = $this->compilePatternAsRegex( $this->URLPattern, $this->rules, false );\n return $this;\n }", "public function setRules(Aloi_Phigester_Rules $rules) {\r\n $this->rules = $rules;\r\n $this->rules->setDigester($this);\r\n }", "public function setRules(array $rules)\n {\n $this->rules = $rules;\n }", "public function setRules(array $rules)\n {\n $this->rules = $rules;\n }", "public function setDraftGroupRules()\n {\n $this->rules = new Rules($this->gameTypeId);\n }", "private function setRules(): void\n {\n if ($this->hasValidationRulesMethod()) {\n $this->rules = static::validationRules();\n }\n\n if ($this->rules === null) {\n $this->rules = [];\n }\n }", "protected function loadMatchingRules()\n {\n $this->matchingRules = [];\n foreach ($this->getAttribute('matchingRules') as $value) {\n $val = $this->parseMatchingRule($value);\n $this->matchingRules[$val['name']] = $val;\n }\n ksort($this->matchingRules, SORT_STRING);\n }", "public function setRules($rules)\n {\n if (empty($rules)) {\n return;\n }\n foreach ($rules as $key => $rule) {\n if (!is_array($rule)) {\n $rules[$key] = array($rule);\n }\n }\n $this->rules = $rules;\n }", "public function setRules(array $rules = null);", "public function rules(array $rules): self;", "public function setRules(array $rules)\n {\n $this->rules = array_merge($this->rules, $rules);\n return $this;\n }", "public function setRules($rules)\n\t{\n\t\tif (!$rules)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t$this->filterRules = array();\n\t\t$this->validatorRules = array();\n\n\t\tif (isset($rules['filter']))\n\t\t{\n\t\t\t$this->setFilters($rules['filter']);\t\t\t\n\t\t}\t\t\n\t\t\t\n\t\tif (isset($rules['validator']))\n\t\t{\n\t\t\t$this->setValidators($rules['validator']);\n\t\t}\t\t\n\t}", "public function rules($rules)\n\t{\n\t\t$this->_rules\t=\tarray_merge($this->_rules, $rules);\n\t}", "public function setRulesAttribute(array $rules): void\n {\n if (isset($this->attributes['rules'])) {\n $rules = array_filter(array_merge($this->rules, $rules), function ($rule) {\n return ! is_null($rule);\n });\n }\n $this->attributes['rules'] = json_encode($rules);\n }", "protected function setupRules()\n {\n $this->rules = (new Rules($this))->getRules();\n }", "public function setRules(array $rules)\n {\n $this->rules = $rules;\n return $this;\n }", "public function rules($rules) {\r\n $this->_rules = $rules;\r\n return $this;\r\n }", "public function setRule($rule)\n {\n $this->rule = $rule;\n }", "public function populateRules($rules)\n {\n foreach($rules as $key=>$value) {\n \n $method = 'set'. ucfirst(str_replace('_', '',$key));\n \n if(method_exists($this, $method) && isset($value)) {\n $this->$method($value);\n } \n }\n \n }", "public function setRules(array $rules)\n {\n $this->rules = $rules;\n\n return $this;\n }", "public function setRules($resource, array $rules);", "public function setRules(array $map)\n {\n $this->rules = $map;\n }", "public function getMatchRules() {\n return $this->matchRules; \n }", "public function setRules(array $rules)\n {\n $this->ensureRulesEnabled();\n $this->rules = $rules;\n\n return $this;\n }", "public function add_rules()\n {\n foreach($this->rules as $regex => $rule)\n {\n add_rewrite_rule($regex, $rule['rewrite'], $rule['prio']);\n }\n }", "public function testUpdateRuleset()\n {\n }", "public function defineRules();", "public function updateRules(RuleSet $ruleSet): void;", "public function setRules(Blackbox_IRule $rules)\n\t{\n\t\t$this->rules = $rules;\n\t}", "private function addRules(): void\n {\n $ruleService = Yii::$container->get(RuleService::class);\n $ruleService->addRules($this->rules);\n }", "public function setRules(array $rules = null)\n {\n $this->rules = $rules;\n }", "function _setValidation(&$model, $rules) {\n\t\t$rule = array_shift($rules);\n\t\t$this->__oldRules[$model->name] = $model->validate;\n\t\t$model->validate = $model->validationSets[$rule];\n }", "public function setMatch($match);", "abstract protected function initRules();", "public function setRules($rules = array())\n {\n if (empty($rules) || !is_array($rules)) {\n return $this;\n }\n $this->_rules = $rules;\n\n return $this;\n }", "public function rules($rules = array())\n {\n $this->routes[$this->last]['rules'] = $rules;\n return $this;\n }", "public static function addRules($rules)\n {\n foreach ($rules as $regex => $replace) {\n self::addRule($regex, $replace);\n }\n }", "public function rules($rules)\n {\n $this->rules = FieldRuleManager::parseRules($rules);\n return $this;\n }", "public function updateRules()\n {\n return [\n //\n ];\n }", "public function rule($rule)\n\t{\n\t\t$this->_rules[]\t=\t$rule;\n\t}", "public function setMatchMode($mode)\n {\n }", "private function setRules()\r\n {\r\n // Field map kontrolü yapılıyor\r\n $map = new FieldMap($this->getFieldMap());\r\n\r\n // Sabit kurallar ekleniyor\r\n $rules = $this->getRules();\r\n foreach ($rules as $key => $rules) \r\n {\r\n $this->CI->form_validation->set_rules(\r\n $key,\r\n CI::lang(\"field_$key\"),\r\n $map->addRule($key, $rules)\r\n );\r\n }\r\n \r\n // Standart tanımlama içinde bulunmayan, ama zorunlu olarak belirtilen \r\n // alanlar için required kuralı oluşturulur.\r\n foreach ($map->getNetFields() as $key => $name)\r\n {\r\n $this->CI->form_validation->set_rules($name, CI::lang(\"field_$name\"), 'required');\r\n }\r\n }", "public abstract function rules();", "private function setRules() {\n\n $this->requestRules = [\n 'mailable' => [\n 'required',\n 'max:255'\n ],\n 'subject' => [\n 'array'\n ],\n 'html_template' => [\n 'required',\n 'array'\n ],\n 'text_template' => [\n 'array'\n ]\n ];\n }", "public function getLeagueRules() {\n return $this->leagueRules; \n }", "public function setMatches(array $matches): static\n {\n $this->matches = $matches;\n return $this;\n }", "private function setRules() {\n\n $this->requestRules = [\n 'name' => [\n 'required',\n 'max:255'\n ],\n 'first_name' => [\n 'required',\n 'max:255'\n ],\n 'email' => [\n 'required',\n 'max:255',\n 'email',\n 'unique:users,email,' . $this->modelId . ',id'\n ],\n 'login' => [\n 'required',\n 'max:255',\n 'unique:users,login,' . $this->modelId . ',id'\n ],\n 'password' => [\n $this->setRule('required', 'nullable'),\n 'min:8',\n 'max:120',\n 'confirmed',\n 'regex:/^.*(?=.{8,120})(?=.*[a-z])(?=.*[A-Z])(?=.*[\\d])(?=.*[^a-zA-Z\\d\\s]).*$/'\n ],\n 'theme' => [\n 'boolean'\n ]\n ];\n }", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "public function setValidationRules()\n\t{\n\t\tForm::setValidationRules(static::validationRules((int) $this->id));\n\t}", "public function setMatches($allMatches)\n {\n $this->_matches = $allMatches;\n return $this;\n }", "private function __construct($rules){\n\t\t$this->addRules($rules);\n\t}", "public function runRules()\n {\n foreach ($this->_rules AS $rule) {\n $rule->rule($this);\n }\n }", "public function setScoreMatch($score)\n {\n $this->scoreMatch = $score;\n }", "public function setMatchMode($mode)\n\t{\n\t\t$this->sphinx->setMatchMode($mode);\n\t}", "protected function setRules($value)\n {\n $this->attributes['rules'] = is_array($value) ? array_merge($this->getRules(), $value) : $value;\n }", "public function overrideRules()\n {\n }", "public function updateRules($rules)\n {\n $this->updateRules = is_string($rules) ? func_get_args() : $rules;\n\n return $this;\n }", "public function getMatchingRules()\n {\n return $this->matchingRules;\n }", "public function updateRules(...$rules) : self\n {\n $this->updateRules = $rules;\n\n return $this;\n }", "public function addRule($rule);", "public function setRules(array $rules): void\n {\n foreach ($rules as $key => $rule) {\n // Skip empty rules (why, must be well defined already?).\n if (empty($rule)) {\n continue;\n }\n\n // Nested (eg: [user => [image => [@fields => [id => [type => string], url => [type => url], ..]]]]).\n if (isset($rule['@fields'])) {\n if (empty($rule['@fields'])) {\n throw new ValidationException('Rule `@fields` must be a non-empty array');\n } elseif (!is_array($rule['@fields'])) {\n throw new ValidationException('Rule `@fields` must be an array, %t given', $rule);\n }\n\n $this->rules[$key] = new Rules($rule['@fields']);\n }\n // Single (eg: [image => [id => [type => string], url => [type => url], ..]]).\n else {\n $this->rules[$key] = new Rule($key, $rule);\n }\n }\n }", "public function resetMatch() {\n $reset_match = &drupal_static(__FUNCTION__, TRUE);\n foreach ($this->getGameIds() as $game_id) {\n // Unset the winners so that self::cleanGames can delete them.\n $game = tourney_game_load($game_id);\n if (is_object($game)) {\n $game->winner = NULL;\n $game->save();\n }\n }\n $this->addGame();\n $this->winner = \"\";\n $this->save();\n drupal_static_reset(__FUNCTION__);\n }", "public function setMatch( $match )\n {\n $this->_match = $match ;\n\treturn $this;\n }", "public function rules($rules)\n {\n $this->rules = is_string($rules) ? func_get_args() : $rules;\n\n return $this;\n }", "public function rules($rules)\n {\n $this->rules = ($rules instanceof Rule || is_string($rules) || $rules instanceof Unique) ? func_get_args() : $rules;\n\n return $this;\n }", "abstract protected function rules();", "public static function rules();", "public function rules(array $array)\n\t{\n\t\tforeach ($array as $options)\n\t\t{\n\t\t\tcall_user_func_array(array($this, 'rule'), $options);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function addRulesFromClass(string $rulesClass): self;", "public function addAcceptRules(array $rules): self\n\t{\n\t\tforeach ($rules as $path => $roles) {\n\t\t\t$rules[$path] = array_map('strtolower', $roles);\n\t\t}\n\n\t\t$this->acceptRules = array_merge($this->acceptRules, $rules);\n\n\t\treturn $this;\n\t}", "public function clearRules () {\n $this->_rules = array();\n }", "public function setRulesProvider(): void\n {\n $this->rulesProvider = resolve(RulerContract::class);\n }", "public function updatingRules($rules)\n {\n $this->updatingRules = ($rules instanceof Rule || is_string($rules) || $rules instanceof Unique) ? func_get_args() : $rules;\n\n return $this;\n }", "public function rules();", "public function rules();", "public function rules();", "public function addMatches(array $matches) : void;", "public function setRule(string $rule): self \n {\n $this->rule = $rule;\n\n return $this;\n }", "public function setRules(array $rules): ConfigInterface\n {\n $this->rules = array_merge($this->rules, $rules);\n\n return $this;\n }", "public function setContestRules($_contestRules)\n {\n $_contestRules = !empty($_contestRules) ? $_contestRules : get_option('wpProQuiz_content_rules');\n $this->_contestRules = (string)$_contestRules;\n\n return $this;\n }", "private function add_rules()\n\t{\n\t\t$this->PAMFuzzy_rules = array(\"1 0 0 0 1 0 0, 1 (1) : 1\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"1 0 0 0 2 0 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"1 0 0 0 3 0 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"1 0 0 0 4 0 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"1 0 0 0 5 0 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"2 0 0 0 1 0 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"2 0 0 0 2 0 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"2 0 0 0 3 0 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"2 0 0 0 4 0 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"2 0 0 0 5 0 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"3 0 0 0 1 0 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"3 0 0 0 2 0 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"3 0 0 0 3 0 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"3 0 0 0 4 0 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"3 0 0 0 5 0 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 1 0 0 1, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 1 0 0 2, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 1 0 0 3, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 1 0 0 4, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 1 0 0 5, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 2 0 0 1, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 2 0 0 2, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 2 0 0 3, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 2 0 0 4, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 3 0 0 1, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 3 0 0 2, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 3 0 0 3, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 3 0 0 4, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 3 0 0 5, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 0 0 2 0 0 5, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 1 0 0 1 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 1 0 0 2 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 1 0 0 3 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 1 0 0 4 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 1 0 0 5 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 2 0 0 1 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 2 0 0 2 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 2 0 0 3 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 2 0 0 4 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 2 0 0 5 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 3 0 0 1 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 3 0 0 2 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 3 0 0 3 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 3 0 0 4 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 3 0 0 5 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 4 0 0 1 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 4 0 0 2 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 4 0 0 3 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 4 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 4 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 5 0 0 1 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 5 0 0 2 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 5 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 5 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 1 5 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 1 0 0 1 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 1 0 0 2 0, 1 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 1 0 0 3 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 1 0 0 4 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 1 0 0 5 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 2 0 0 1 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 2 0 0 2 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 2 0 0 3 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 2 0 0 4 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 2 0 0 5 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 3 0 0 1 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 3 0 0 2 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 3 0 0 3 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 3 0 0 4 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 3 0 0 5 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 4 0 0 1 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 4 0 0 2 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 4 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 4 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 4 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 5 0 0 1 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 5 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 5 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 5 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 2 5 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 1 0 0 1 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 1 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 1 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 1 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 1 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 2 0 0 1 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 2 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 2 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 2 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 2 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 3 0 0 1 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 3 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 3 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 3 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 3 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 4 0 0 1 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 4 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 4 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 4 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 4 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 5 0 0 1 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 5 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 5 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 5 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 3 5 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 1 0 0 1 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 1 0 0 2 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 1 0 0 3 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 1 0 0 4 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 1 0 0 5 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 2 0 0 1 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 2 0 0 2 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 2 0 0 3 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 2 0 0 4 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 2 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 3 0 0 1 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 3 0 0 2 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 3 0 0 3 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 3 0 0 4 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 3 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 4 0 0 1 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 4 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 4 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 4 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 4 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 5 0 0 1 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 5 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 5 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 5 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 4 5 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 1 0 0 1 0, 2 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 1 0 0 2 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 1 0 0 3 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 1 0 0 4 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 1 0 0 5 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 2 0 0 1 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 2 0 0 2 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 2 0 0 3 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 2 0 0 4 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 2 0 0 5 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 3 0 0 1 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 3 0 0 2 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 3 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 3 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 3 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 4 0 0 1 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 4 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 4 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 4 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 4 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 5 0 0 1 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 5 0 0 2 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 5 0 0 3 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 5 0 0 4 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"0 5 5 0 0 5 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"4 0 0 0 1 0 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"4 0 0 0 2 0 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"4 0 0 0 3 0 0, 3 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"4 0 0 0 4 0 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"4 0 0 0 5 0 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"5 0 0 0 1 0 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"5 0 0 0 2 0 0, 4 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"5 0 0 0 3 0 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"5 0 0 0 4 0 0, 5 (1) : 1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"5 0 0 0 5 0 0, 5 (1) : 1\",);\n\t\t$this->PAMFuzzy->clearRules();\n\t\t// iJab 2013/01/23: Try to parse trues and add to Fuzzy Functions\n\t\t$this->PAMFuzzy->addRules($this->PAMFuzzy_rules);\n\t}" ]
[ "0.71638787", "0.64206725", "0.64087665", "0.6370166", "0.6232575", "0.6185766", "0.61779743", "0.6094375", "0.6050113", "0.60132253", "0.59296685", "0.5921175", "0.5921175", "0.58760726", "0.5870947", "0.581215", "0.58077914", "0.57997984", "0.5791801", "0.57733506", "0.57645226", "0.57550615", "0.5718941", "0.5692716", "0.5679401", "0.5629985", "0.5613893", "0.5600739", "0.5563826", "0.5538625", "0.55371654", "0.55087787", "0.54935277", "0.54848635", "0.5452179", "0.543025", "0.54272085", "0.5420039", "0.5386856", "0.5386822", "0.5383193", "0.53667575", "0.53581977", "0.535268", "0.5315789", "0.52869636", "0.5281493", "0.52665293", "0.52625", "0.52434015", "0.5242136", "0.52335846", "0.52308273", "0.52124506", "0.52011687", "0.52008855", "0.5184989", "0.5184989", "0.5184989", "0.5184989", "0.5184989", "0.5184989", "0.5184989", "0.5184989", "0.5184989", "0.5184989", "0.5184989", "0.518426", "0.516974", "0.515907", "0.5136117", "0.51330423", "0.5110275", "0.5093016", "0.5091957", "0.5090675", "0.5086718", "0.50854254", "0.5070504", "0.50664055", "0.5063963", "0.50634503", "0.5057467", "0.50492424", "0.504765", "0.5043607", "0.50276864", "0.50179774", "0.50141203", "0.4994567", "0.4973594", "0.49673137", "0.49625263", "0.49625263", "0.49625263", "0.49444205", "0.49407226", "0.49372098", "0.49303508", "0.4907013" ]
0.7028137
1
Return the indoor status of this league.
Верните внутренний статус этого лига.
public function getIsIndoor() { return $this->isIndoor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInjuryStatus()\n {\n return $this->injuryStatus;\n }", "public function getIndoor()\n {\n return $this->indoor;\n }", "public function getIndoor()\n {\n return $this->_indoor;\n }", "public function getLeagueStatus() {\n\t\t\t\n\t\tif ($this->ToursPlayed() == 0)\n\t\t\t$status = 'new';\n\t\t\n\t\telseif ($this->ToursToPlay() == 0) {\n\t\t\t$status = 'finished';\t\n\t\t}\n\t\telse {\n\t\t\t$status = 'playing';\n\t\t}\n\t\t\n\t\treturn $status;\n\t}", "public function getAIStatus()\n {\n $instance = $this->getNewInstance();\n $instance = $instance->where('type', 'status');\n $instance = $instance->where('value', '<>', 'B');\n return $instance->get();\n }", "public function getStatus(){\n return $this->statue;\n }", "public function getOrginState()\n\t{\n\t\treturn $this->orgin_state;\n\t}", "private function status()\n {\n $identifier = GameIdentifier::fromString($this->id());\n $game = $this->repository()->get($identifier);\n\n echo 'Get game status: ' . $game->id() . PHP_EOL;\n echo (string) $game;\n\n $result = '';\n $status = $game->status();\n foreach ($status as $fireResult) {\n $result .= '- ' . $fireResult . PHP_EOL;\n }\n\n return 'STATUS' . PHP_EOL\n . '- SCORE ' . $game->score() . PHP_EOL\n . $result;\n }", "public function getInviteStatus();", "public function getOnlineStatus() {\n return $this->online;\n }", "public function status()\n {\n return $this->status;\n }", "public function status()\n {\n return $this->status;\n }", "public function status()\n {\n return $this->status;\n }", "public function status()\n {\n return $this->status;\n }", "public function status() {\n\t\treturn $this->status;\n\t}", "public function status()\n\t{\n\t\treturn $this->status;\n\t}", "public function get_status()\n {\n return $this->status;\n }", "public function status() {\n return $this->status;\n }", "function get_status() {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->intStatus;\n }", "public function get_status() {\n\t\treturn $this->status;\n\t}", "public function get_status() {\n\t\treturn $this->status;\n\t}", "public function status()\n {\n return $this->_status;\n }", "public function get_status(){\n\t\t\t\n\t\t\treturn $this->status;\n\t\t}", "public function status ()\n {\n return $this->status;\n }", "public function getStatus()\r\r\n {\r\r\n return $this->status;\r\r\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getLeaverStatus()\n {\n return $this->getProperty('leaver_status');\n }", "public function get_status()\r\n { \r\n return $this->status;\r\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->object->Status;\n }", "public function getOutdoor()\n {\n return $this->outdoor;\n }", "function getStatus() {\n\n\t\t\treturn $this->status;\n\t\t}", "public static function get_status()\n {\n return static::getInstance()->getStatus();\n }", "public function getStatus () {\n\t\treturn $this->status;\n\t}", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }" ]
[ "0.7173044", "0.6904104", "0.68326086", "0.6805894", "0.6580323", "0.64724165", "0.641415", "0.63930357", "0.63833255", "0.6358393", "0.63266605", "0.63266605", "0.63266605", "0.63266605", "0.6309638", "0.6305246", "0.630395", "0.62997985", "0.6299745", "0.6292231", "0.6282238", "0.6282238", "0.6277593", "0.62763435", "0.62739325", "0.62700707", "0.62690383", "0.62646866", "0.62581444", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.6245077", "0.62449104", "0.62449104", "0.6244594", "0.62434894", "0.6243188", "0.62407506", "0.62405246", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133" ]
0.72888976
0
Return the maximum number of teams in this league.
Верните максимальное количество команд в этом лиге.
public function getMaxTeams() { return $this->maxTeams; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNumberOfTeams()\n {\n return $this->numberOfTeams;\n }", "public function get_tours_count():int {\n\t\t\treturn sizeof($this->teams )*2 - 2;\n\t}", "public function getMaxPlayers()\n\t{\n\t\treturn self::MAX_PLAYERS;\n\t}", "public function getMaxPlayers() : int {\r\n\r\n return (int) $this->getConfig()->get(\"Max players\");\r\n\r\n }", "public function countPendingTeams()\n\t{\n\t\t$table = $this->getTable('Teams');\n\t\t$select = $table->select()\n\t\t\t->from($table, array(\"teamcount\" => 'COUNT(*)'))\n\t\t\t->where('turnir = ?', self::PENDING_TURNIR);\n\t\t$res = $table->fetchRow($select);\n\t\tif($res) {\n\t\t\treturn $res->teamcount;\n\t\t}\n\t\treturn 0;\n\t}", "public function getMaxNumberOfIterations(): int\n {\n return $this->maxNumberOfIterations;\n }", "public function getMaxPlayers();", "function getTotalGames() {\r\n return sizeof($this->gameList);\r\n }", "function getNbActiveGameForAll()\r\n{\r\n\t$res = countActiveGameForAll();\r\n\treturn $res['nbGames'];\r\n}", "public function getMaxNumberOfNames()\n {\n $max = 0;\n foreach ($this->variables as $variable) {\n if (count(Container::getData()->getVariable($variable)) > $max) {\n $max = count(Container::getData()->getVariable($variable));\n }\n }\n\n return $max;\n }", "public function countMax(): int\n {\n return $this->countMax;\n }", "public function getMaxTeleports() {\n return $this->maxTeleports;\n }", "public function getMaxPlayers()\n {\n $serverInfo = $this->getServerInfo();\n\n return (int)$this->_array2String($serverInfo, 3);\n }", "public function getMaxcount()\n {\n return $this->maxcount;\n }", "public function getMltMaxNumTokens(): int {}", "public function getMltMaxNumTokens(): int {}", "protected function getMaxCount() {}", "public function getNbPlayers()\n {\n return $this->nbPlayers;\n }", "public function getMax(): int\n {\n return $this->max;\n }", "public function getGamesQuantity(): int\n {\n return count($this->games);\n }", "function getNbActiveTournamentGames($tournamentID)\r\n{\r\n\t$res = countActiveTournamentGames($tournamentID);\r\n\treturn $res['nbGames'];\r\n}", "public function setMaxTeams( $maxTeams ) { //throws RDException;\n if($maxTeams < 0 || $maxTeams < $this->minTeams) {\n throw new RDException('Max teams cannot be smaller than the minimum number of teams or negative.');\n } else {\n $this->maxTeams = $maxTeams;\n }\n }", "public function getMaxResults()\n {\n return $this->max_results;\n }", "public function getMaxMembers() {\n return $this->maxMembers; \n }", "public static function get_max_number_of_people () {\n\t\t\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t$max_number_of_people = 0;\n\t\t\t\n\t\t\t$_term_args = array(\n\t\t\t\t\t\t\t\t'hide_empty' => 0, \n\t\t\t\t\t\t\t\t'fields' => 'ids', \n\t\t\t\t\t\t\t\t'hierarchical' => false\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t$_terms = get_terms( array('tables'), $_term_args );\n\t\t\t\n\t\t\tif ( $_terms ) {\n\t\t\t\n\t\t\t\t$_terms_string = join( ',', $_terms );\n\t\t\t\t\n\t\t\t\t$query = \"SELECT meta_value as number_of_seats \n\t\t\t\t\t\t FROM \" . $wpdb->prefix . \"woo_tables_meta \n\t\t\t\t\t\t WHERE meta_key = 'number_of_seats' \n\t\t\t\t\t\t AND woo_tables_id IN (\" . $_terms_string . \") GROUP BY number_of_seats ORDER BY number_of_seats DESC\";\n\t\t\t\n\t\t\t\t$rs = $wpdb->get_results($query, ARRAY_A);\n\t\t\t\t\n\t\t\t\tif ( $rs ) {\n\t\t\t\t\n\t\t\t\t\t$max_number_of_people = $rs[0]['number_of_seats'];\n\t\t\t\t\t\n\t\t\t\t} // End IF Statement\n\t\t\t\n\t\t\t} // End IF Statement\n\t\t\t\n\t\t\treturn $max_number_of_people;\n\t\t\t\n\t\t}", "public function getMax(): int\n\t{\n\t\treturn $this->max;\n\t}", "public function getMaxRounds()\n {\n // TODO: Das geht nur, wenn der Scope auf eine Liga zeigt\n $league = $this->getLeague();\n\n return $league ? count($league->getRounds()) : 0;\n }", "public function getNumMaxEvents()\n {\n return $this->num_max_events;\n }", "public function getTeamNumber()\n {\n return $this->getXml()->getElementsByTagName('NumberOfTeams')->item(0)->nodeValue;\n }", "public function get_num_of_players()\n\t{\n\n\t\treturn $this->num_of_players;\n\t}", "public function getMaxIteration() {\r\n\t\treturn $this->_maxIteration;\r\n\t}", "public function getTeamPlayersCount($team)\n {\n $query = $this->getEntityManager()\n ->createQueryBuilder()\n ->select('COUNT(t.user)')\n ->from('BasketPlannerTeamBundle:TeamUser','t')\n ->where('t.team = ?1')\n ->setParameter(1, $team);\n\n return $query->getQuery()->getSingleScalarResult();\n }", "public function getMaxResults(): int;", "public function getLeaguesCount()\n {\n return $this->count(self::LEAGUES);\n }", "public function getMaxNumberOfMessages()\n {\n return $this->MaxNumberOfMessages;\n }", "public function maxTries()\n {\n return $this->maxTries;\n }", "public function getMaxEnrollments(): int\n {\n return $this->maxEnrollment;\n }", "public function getMaxResults(): int\n {\n return (int) Craft::parseEnv($this->maxResults);\n }", "public function challengesNumber() {\n $projects = $this->projects()->get();\n $challengeNumber = 0;\n foreach ($projects as $project) {\n $challengeNumber += $project->challenges()->count();\n }\n return $challengeNumber;\n }", "public function getMaxResults() \n\t{\n\t\treturn $this->maxResults;\n\t}", "public function getMaxAttempts()\n {\n return $this->maxAttempts;\n }", "public function getMaxEncounters()\n {\n return $this->_maxEncounters;\n }", "public function getMaximumAttendeesCount()\n {\n if (array_key_exists(\"maximumAttendeesCount\", $this->_propDict)) {\n return $this->_propDict[\"maximumAttendeesCount\"];\n } else {\n return null;\n }\n }", "public function maxResults($maxResults = null)\n\t{\n\t\tif ($maxResults !== null) {\n\t\t\t$this->maxResults = (int) $maxResults;\n\t\t}\n\t\treturn $this->maxResults;\n\t}", "public function getMaxThreads()\n {\n return $this->max_threads;\n }", "protected function maxAttempts(): int \n {\n return property_exists($this, 'maxAttempts') ? $this->maxAttempts : 5;\n }", "public function getMaximumItemCount()\n {\n return $this->maximumItemCount;\n }", "public function getNbMaxGamme() {\n return $this->nbMaxGamme;\n }", "public function getMaxLaps()\n {\n return $this->max_laps;\n }", "public static function getMaxLength(): int {\n\t\treturn self::$maxLength;\n\t}", "public static function Max()\n\t{\n\t\treturn $max;\n\t}", "public function getMax()\n {\n return isset($this->max) ? $this->max : 0;\n }", "public function getLastedLaps()\n {\n // No laps by default\n $laps = 0;\n\n // Loop each participant to get number of laps\n foreach ($this->getParticipants() as $part)\n {\n // Number of laps greater than current highest value\n if ($part->getNumberOfLaps() > $laps)\n {\n // Set number of laps\n $laps = $part->getNumberOfLaps();\n }\n }\n\n // Return number of laps lasted\n return $laps;\n }", "public function get_search_max_nb_items_by_facet() {\n\t\treturn $this->to_integer( $this->get_option_value( __FUNCTION__, self::OPTION_SEARCH, self::OPTION_SEARCH_ITEM_max_nb_items_by_facet, 10 ), 'Max items by facet' );\n\t}", "public function max() : int\n {\n return (int) max($this->counts);\n }", "public static function getMaxErrors(): int\n {\n return self::$maxErrors;\n }", "public function getNumberOfTeamsCreatedBy($creator);", "public function getMaxResults()\n {\n return $this->qb->getMaxResults();\n }", "public function getMax() {\n return $this->max;\n }", "public function getMax() {\n return $this->max;\n }", "private function getMinimumGamesPlayed() : int\n {\n $topGames = DB::table('goalers_stats_years AS goaler')\n ->where('players.year', '=', current_year())\n ->join('players', 'players.id', '=', 'goaler.player_id')\n ->max('games');\n\n\n return $topGames / 4;\n }", "public function getMax()\n {\n return $this->max;\n }", "public function getMax()\n {\n return $this->max;\n }", "public function getMax()\n {\n return $this->max;\n }", "public function getMax()\n {\n return $this->max;\n }", "public function getMax()\n {\n return $this->max;\n }", "protected function maxAttempts()\n {\n return property_exists($this, 'maxAttempts') ? $this->maxAttempts : 5;\n }", "public function getMaxSeatCount() {\r\n\t\treturn $this->ilRoomSharingDatabaseRoom->getMaxSeatCount();\r\n\t}", "public function getMaxInstances()\n {\n return $this->max_instances;\n }", "public function maxCount($var = null)\n {\n if ($var !== null) {\n $this->max_count = (int) $var;\n }\n if (empty($this->max_count)) {\n /** @var Config $config */\n $config = self::getGrav()['config'];\n $this->max_count = (int) $config->get('system.pages.list.count');\n }\n return $this->max_count;\n }", "public function getMaxPosition()\n {\n // Max position\n $max_position = 1;\n\n // Loop each participant\n foreach ($this->getParticipants() as $part)\n {\n if ( ! $part->getLaps()) {\n continue;\n }\n\n if ($part->getGridPosition() AND\n $part->getGridPosition() > $max_position)\n {\n $max_position = $part->getGridPosition();\n }\n\n // Loop each lap\n foreach ($part->getLaps() as $lap)\n {\n // Position is higher than current max\n if ($lap->getPosition() AND\n $lap->getPosition() > $max_position)\n {\n // Set new max\n $max_position = $lap->getPosition();\n }\n }\n }\n\n // Return max position\n return $max_position;\n }", "public function get_maximum_score()\n {\n $max = 0;\n $options = $this->get_options();\n foreach ($options as $option)\n {\n $max += $option->get_score();\n }\n return $max;\n }", "public function getMaxSuccessiveFailures()\n {\n return $this->maxFails;\n }", "public function countLevels()\n {\n $query = $this->entityManager->createQuery(\n \"SELECT MAX(c.lvl) FROM $this->class c\"\n );\n\n $maxLevelArray = $query->setMaxResults(1)->getSingleResult();\n\n return (int)$maxLevelArray[1];\n }", "public function getCollectionMax()\n {\n return $this->collectionMax;\n }", "public function get_teams() {\n\t\t\treturn $this->run( 'teams' );\n\t\t}", "public function getMaximumCount($option)\n {\n return isset($this->maximumCounts[$option]) ? $this->maximumCounts[$option] : null;\n }", "public function getLimit(){\n return $this->max_num;\n }", "public function GetMaxCount ();", "public function getMaxTries()\n {\n return $this->maxTries;\n }", "public function maxAttempts(): int\n {\n return 15;\n }", "public function getNumberOfResults()\n {\n return $this->helper->getConfigValue(self::MAX_RESULT);\n }", "public function getMaxResults() : int {}", "public function getMaxOutstandingMessages()\n {\n return $this->max_outstanding_messages;\n }", "public function getMaxValue() {\r\n return $this->maximum;\r\n }", "public function getMaxLevel(): int\n {\n return $this->maxLevel;\n }", "public function count()\n {\n return $this->getPlayersList()->count();\n }", "public function getMax()\n {\n return $this->options['max'];\n }", "public function getMaxTurnChange()\n { return $this->m_maxTurnChange; }", "public function getMaxItems()\r\r\n {\r\r\n return $this->maxItems;\r\r\n }", "public function setNumberOfTeams($numberOfTeams)\n {\n $this->numberOfTeams = intval($numberOfTeams);\n\n return $this;\n }", "public function getMaxPerPage()\n {\n return $this->maxPerPage;\n }", "public function getMaxPerPage()\n {\n return $this->maxPerPage;\n }", "public function getMaxSpeakerCount()\n {\n return $this->max_speaker_count;\n }", "public function getPlayersNbr ()\r\n {\r\n return $this->playersNbr;\r\n }", "public function getNumberOfPeople()\n {\n return $this->numberOfPeople;\n }", "public function getMax()\n {\n return $this->_max;\n }", "public function getMax()\n {\n return $this->_max;\n }", "public function getMaxRecurrences()\n {\n return $this->maxRecurrences;\n }", "function get_player_team_games($pid){\n $allgames = get_player_record($pid);\n if($allgames):\n $count = array_count_values($allgames );\n endif;\n return $count;\n}" ]
[ "0.78252476", "0.6703327", "0.6671475", "0.65167964", "0.6363188", "0.634127", "0.63072145", "0.62881625", "0.62369376", "0.62147844", "0.61986274", "0.6139038", "0.6115477", "0.60858715", "0.60537153", "0.60537153", "0.6051941", "0.60467213", "0.6028404", "0.60250145", "0.602003", "0.5942551", "0.59406245", "0.5933718", "0.59194565", "0.591909", "0.59169847", "0.5901952", "0.59005415", "0.5851145", "0.5846548", "0.58388585", "0.58369017", "0.58075994", "0.58050454", "0.5786649", "0.57735795", "0.57352316", "0.5732156", "0.5727125", "0.57166284", "0.57051957", "0.57045764", "0.5683002", "0.5658864", "0.5638669", "0.5634484", "0.5615545", "0.56112975", "0.56075525", "0.55965775", "0.55961657", "0.55797416", "0.55795", "0.5577126", "0.55738425", "0.5572172", "0.5562362", "0.55566484", "0.55566484", "0.5555239", "0.55526817", "0.55526817", "0.55526817", "0.55526817", "0.55526817", "0.5547221", "0.5545484", "0.55445457", "0.5541184", "0.5540421", "0.5537119", "0.5536361", "0.55359924", "0.5535498", "0.5528683", "0.5526047", "0.55250454", "0.55246085", "0.55181015", "0.55143195", "0.5513931", "0.5512295", "0.55016404", "0.55012345", "0.5488594", "0.5481974", "0.54793906", "0.54767984", "0.547626", "0.546835", "0.5465732", "0.5465732", "0.546043", "0.5449031", "0.5448021", "0.5447978", "0.5447978", "0.54434043", "0.54408544" ]
0.8061653
0
Generate a password hash using a config string.
Создайте хэш пароля с использованием строки конфигурации.
public static function genHash($password, $config);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function hash($password, $config = array ());", "private function generatePasswordHash($string)\n\t{\n\t\t$string = is_string($string) ? $string : strval($string);\n\t\t$pwHash = encrypto($string);\n\t\treturn $pwHash;\n\t}", "public static function genHash($password, $config)\n {\n $hash = ($config == '*0') ? '*1' : '*0';\n\n $config = self::parseConfig($config);\n if (is_array($config)) {\n $rounds = $config['rounds'];\n $checksum = hash_hmac('sha1', $config['salt'] . '$sha1$' . $rounds--, $password, true);\n if ($rounds) {\n do {\n $checksum = hash_hmac('sha1', $checksum, $password, true);\n } while (--$rounds);\n }\n\n $tmp = '';\n foreach (array (2, 1, 0, 5, 4, 3, 8, 7, 6, 11, 10, 9, 14, 13, 12, 17, 16, 15, 0, 19, 18) as $offset) {\n $tmp .= $checksum[$offset];\n }\n $checksum = Utilities::encode64($tmp);\n\n $hash = self::genConfig($config) . '$' . $checksum;\n }\n\n return $hash;\n }", "public static function make($text)\n {\n return password_hash($text, PASSWORD_DEFAULT);\n }", "public function generateHash($string)\n {\n return password_hash($string, $this->algorithm, ['cost' => $this->cost]);\n }", "public static function generatePassword($str)\n {\n $res = sha1(\"::Holmes::{$str}\");\n\n return $res;\n }", "public static function hash($password, $config = array ())\n {\n if (is_array($config)) {\n $config = self::genConfig($config);\n }\n\n return self::genHash($password, $config);\n }", "protected function buildHash($string)\n {\n return md5(sha1($this->secret) . $string);\n }", "public function hash($str)\n\t{\n\t\t// TODO: switch back to hmac when option is in place for users to update their current passwords\n\t\t//return hash_hmac($this->_config['hash_method'], $str, $this->_config['key']);\n\n\t\treturn hash($this->config['hash_method'],$str);\n\t}", "public static function make($input) {\r\n\t\treturn password_hash($input, PASSWORD_DEFAULT);\r\n\t}", "function do_hash( $str )\n{\n $hasher = new PasswordHash(8, FALSE);\n return $hasher->HashPassword($str);\n}", "function genpwd() {\r\n echo password_hash(\"123\", PASSWORD_BCRYPT);\r\n }", "public function hash_string(string $password):string\n{\n return base64_encode(password_hash($password, PASSWORD_BCRYPT, array('COST' => 11)));\n}", "private function generateHash ($string) {\n return sha1($string);\n }", "public function hash($string) {\n\t\treturn hash(\"sha512\", $string . config_item(\"encryption_key\"));\n }", "function password($str) { \n return '*'.strtoupper(sha1(pack('H*',sha1($str)))); \n }", "function getHash($str)\n{\n return password_hash($str, PASSWORD_BCRYPT);\n}", "private function _create_hash() {\n //uses dev/urandom to generate salt then encrpyts password using bcrypt php module.\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n $salt = sprintf(\"$2a$%02d$\", $this->cost) . $salt;\n return crypt($this->password, $salt);\n }", "private function hashPassword()\r\n {\r\n $salted = md5($this->password . BaseConfig::PASSWORD_SALT);\r\n return sha1($salted);\r\n }", "public static function phpassDoHash($string)\n\t{\n\t\treturn Hash::HashPassword($string);\n\t}", "public static function make($string, $salt = '') {\r\n\t\t$options = array(\r\n\t\t\t'salt' => $salt\r\n\t\t);\r\n\t\treturn password_hash($string, PASSWORD_BCRYPT, $options);\r\n\t}", "private function makeHash(string $password): string\n {\n $salt = openssl_random_pseudo_bytes(SODIUM_CRYPTO_PWHASH_SALTBYTES);\n $hash = sodium_crypto_pwhash(\n 16,\n $password,\n $salt,\n SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,\n SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE,\n SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13\n );\n \n return bin2hex($hash) . \"$\" . bin2hex($salt);\n }", "public function hash(string $password): string;", "public static function create($string) {\n if(empty(self::$salt)) {\n $salt = self::getBytes(16);\n } else {\n $salt = self::$salt;\n }\n $salt64 = substr(str_replace('+', '.', base64_encode($salt)), 0, 22);\n\n #$prefix = '$2a$';\n $prefix = '$2y$';\n\n $hash = crypt($string, $prefix . self::$cost . '$' . $salt64);\n if(strlen($hash) <= 13) {\n throw new Exception\\RuntimeException('Error during the bcrypt generation');\n }\n return $hash;\n }", "static public function hashpwd($str, $salt = '') {\r\n if ($salt == '') {\r\n global $SETTINGS;\r\n $salt = $SETTINGS['auth']['salt'];\r\n }\r\n $str = md5(crypt($str, $salt));\r\n return '$1$' . $str;\r\n }", "protected function generateHashedPassword() {}", "function generatePasswordHash($password) {\n\t\treturn md5($password.$this->userinfo['salt']);\n\t}", "public static function generateHash($string, $salt = ''){\r\n return hash('sha256', $string . $salt);\r\n }", "function passw_hash($password){return hash('sha256', $password.'salt1234!@#$');}", "public function hash_generate_password($password)\n\t{\n\t\t// Hash\n\t\t$password = password_hash($password, PASSWORD_BCRYPT,[5]);\n\t\t// Hash\n\t\t$hash = substr($password, 0, 60);\n\t\treturn $hash;\n\t}", "function getPasswordHash($string) {\n $hash = password_hash($string, PASSWORD_DEFAULT);\n return $hash;\n}", "public static function get_hash($string){\n $string = HASHING_SALT.$string;\n return sha1($string);\n }", "function hashit($password){\n\t$salt = config('password.salt');\n\t$salt = sha1( md5($password.$salt) );\n\treturn md5( $password.$salt );\t\n}", "public function hashPassword(string $password): string;", "public function make($value)\r\n {\r\n return password_hash(trim($value), PASSWORD_BCRYPT);\r\n }", "static function Crypt($string)\n {\n $hash = password_hash($string,PASSWORD_BCRYPT) ;\n return $hash;\n }", "public function hashPassword()\n {\n if ($this->config->get('hashMethod') == 'sha1')\n {\n if ($this->config->get('storeSalt') && $salt)\n {\n return sha1($this->password . $salt);\n }\n else\n {\n $salt = $this->salt();\n return $salt . substr(sha1($salt . $password), 0, -$this->config->get('saltLength'));\n }\n }\n else\n {\n return password_hash($password, PASSWORD_BCRYPT, array(\"cost\" => $this->_bcryptCost));\n }\n }", "public static function make($string, $salt = ''){\n return hash('sha256', $string.$salt);\n }", "public static function fnGenerateHash($sPassword){\n return password_hash($sPassword.self::$_peber, PASSWORD_DEFAULT);\n }", "protected function createMacHash ($string)\n {\n return strtoupper(hash('sha512', $string . $this->getSecretKey()));\n }", "public function hashPassword($password);", "function yourls_hash_passwords_now( $config_file ) {\n\tif( !is_readable( $config_file ) ) {\n yourls_debug_log( 'Cannot hash passwords: cannot read file ' . $config_file );\n return 'cannot read file'; // not sure that can actually happen...\n }\n\n\tif( !is_writable( $config_file ) ) {\n yourls_debug_log( 'Cannot hash passwords: cannot write file ' . $config_file );\n\t\treturn 'cannot write file';\n }\n\n $yourls_user_passwords = [];\n\t// Include file to read value of $yourls_user_passwords\n\t// Temporary suppress error reporting to avoid notices about redeclared constants\n\t$errlevel = error_reporting();\n\terror_reporting( 0 );\n\trequire $config_file;\n\terror_reporting( $errlevel );\n\n\t$configdata = file_get_contents( $config_file );\n\n if( $configdata == false ) {\n yourls_debug_log('Cannot hash passwords: file_get_contents() false with ' . $config_file);\n return 'could not read file';\n }\n\n\t$to_hash = 0; // keep track of number of passwords that need hashing\n\tforeach ( $yourls_user_passwords as $user => $password ) {\n // avoid \"deprecated\" warning when password is null -- see test case in tests/data/auth/preg_replace_problem.php\n $password ??= '';\n\t\tif ( !yourls_has_phpass_password( $user ) && !yourls_has_md5_password( $user ) ) {\n\t\t\t$to_hash++;\n\t\t\t$hash = yourls_phpass_hash( $password );\n\t\t\t// PHP would interpret $ as a variable, so replace it in storage.\n\t\t\t$hash = str_replace( '$', '!', $hash );\n\t\t\t$quotes = \"'\" . '\"';\n\t\t\t$pattern = \"/[$quotes]\" . preg_quote( $user, '/' ) . \"[$quotes]\\s*=>\\s*[$quotes]\" . preg_quote( $password, '/' ) . \"[$quotes]/\";\n\t\t\t$replace = \"'$user' => 'phpass:$hash' /* Password encrypted by YOURLS */ \";\n\t\t\t$count = 0;\n\t\t\t$configdata = preg_replace( $pattern, $replace, $configdata, -1, $count );\n\t\t\t// There should be exactly one replacement. Otherwise, fast fail.\n\t\t\tif ( $count != 1 ) {\n\t\t\t\tyourls_debug_log( \"Problem with preg_replace for password hash of user $user\" );\n\t\t\t\treturn 'preg_replace problem';\n\t\t\t}\n\t\t}\n\t}\n\n\tif( $to_hash == 0 ) {\n yourls_debug_log('Cannot hash passwords: no password found in ' . $config_file);\n return 'no password found';\n }\n\n\t$success = file_put_contents( $config_file, $configdata );\n\tif ( $success === FALSE ) {\n\t\tyourls_debug_log( 'Failed writing to ' . $config_file );\n\t\treturn 'could not write file';\n\t}\n\n yourls_debug_log('Successfully encrypted passwords in ' . basename($config_file));\n\treturn true;\n}", "public static function make($string, $salt='') {\n\t\treturn hash('sha256', $string . $salt);\n\t}", "private function generateHash($password) {\n return crypt($password, '$2a$10$'.substr(sha1(mt_rand()),0,22));\n }", "function generatePassword($pass){\r\n\t\t$salt = \"abacareAbvt\";\r\n\t\t$md5 = md5($pass . $salt);\r\n\r\n\t\treturn $md5.\":\".$salt;\r\n\t}", "function hash_internal_user_password($password) \n{\n global $CFG;\n return md5($password.$CFG->passwordsaltmain);\n}", "public static function make($string, $salt = '') {\r\n\t\treturn hash('sha256', $string . $salt);\r\n\t}", "public function hash(string $string): string;", "private function _hash_password($password = '')\n\t{\n\t\t$method = strtolower($this->CI->config->item('hash_method'));\n\n\t\tif(!in_array($method, $this->_hashing_algorithms)) return '';\n\n\t\t$this->CI->load->helper('str_hex');\n\n\t\t$salt\t\t=\t(string) mt_rand(39543312, mt_getrandmax());\n\n\t\t$key_hex\t=\tstrToHex($password);\n\t\t$salt_hex\t=\tstrToHex($salt);\n\n\t\t$key_bytes\t=\tpack(\"H*\", $key_hex);\n\t\t$salt_bytes\t=\tpack(\"H*\", $salt_hex);\n\n\t\t$key_basis \t=\t$key_bytes . $salt_bytes;\n\t\t$key \t\t=\thash($method, $key_basis, true);\n\t\t$key_hash \t=\thash($method, $key);\n\n\t\t$hash\t\t=\tstrtoupper(\"$method:$key_hash.$salt_hex\");\n\n\t\treturn $hash;\n\t}", "function getPwdHash($pwd) {\n\t$hpwd = \"\";\n\tglobal $g_pwdSalt;\n\tif (strlen($pwd) > 15)\n\t\t$pwd = substr($pwd,0,15);\n\t$hpwd = md5($g_pwdSalt . $pwd);\n\treturn $hpwd;\n}", "public function generatePassword(){\n $this->password = password_hash($this->password, PASSWORD_BCRYPT, ['salt' => Yii::$app->service['salt']]);\n }", "public static function make($string, $salt = '') {\n return hash('sha256', $string . $salt);\n }", "public static function make($string, $salt = '') {\n return hash('sha256', $string . $salt);\n }", "function my_hash($string) {\r\n\t\treturn md5($string);\r\n\t}", "public function generateHash()\n {\n $amount = ($this->amount ? $this->amount : \"0.00\");\n return strtoupper(md5($this->md5_setting . $this->api_login_id . $this->transaction_id . $amount));\n }", "function genhashamd5($string){\n\t\t// return substr(str_replace('+', '.',base64_encode(sha1(md5($string)))),0,32);\n\t\treturn $this->__genhash($string);\n\t}", "function hashPassword($pPassword, $pSalt1=\"2345#$%@3e\", $pSalt2=\"taesa%#@2%^#\") { \n return sha1(md5($pSalt2 . $pPassword . $pSalt1)); \n}", "public static function generate_hash() {\n return neoform\\encrypt\\lib::rand(40);\n }", "private static function generatePasswordHash($fields) {\n $password=$fields['password'];\n $password_hash=md5($password.date(\"Y\"));\n $hash=sha1($password_hash.date(\"Y\"));\n return $hash;\n }", "public static function password($raw) {\n return password_hash($raw, PASSWORD_BCRYPT);\n }", "function createPassword($password){\n return password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]);\n}", "public static function password($raw)\n {\n return password_hash($raw, PASSWORD_BCRYPT);\n }", "public static function generateUserPassword(): string\n {\n return HashTool::getRandomHash64(12);\n }", "function pHash($password){return password_hash($password,PASSWORD_BCRYPT,array(\"cost\"=>10));}", "public static function passwordHash(string $s_password):string\r\n {\r\n static $a_delimiter=[\r\n 'r',\r\n '4S',\r\n 'zqX',\r\n 'zqiOK',\r\n 'TLVS75V',\r\n 'Ue5aLaIIG75',\r\n 'uODJYM2JsCX4G',\r\n 'kt58wZfHHGQkHW4QN',\r\n 'Lh9Fl5989crMU4E7P6E'\r\n ];\r\n\r\n // Unlike server side, in JS only HEX hash is supported.\r\n // For this reason, API expects HEX string and not a raw hash.\r\n return hash('sha3-512', implode($s_password,$a_delimiter).$s_password,/*Important! See comment above.*/false);\r\n }", "private function init_hash() {\n\n\t\t$area = pow( $this->grid_size, 2 );\n\t\t$needed = $area*6; // 6 = length of color hex code\n\t\t$repeat = ceil( $needed/40 ); // 40 = length of sha1 output\n\n\t\t$hash = sha1( $this->salt );\n\t\t$hash = str_repeat( $hash, $repeat );\n\n\t\t$hash = str_split(\n\t\t\tsubstr( $hash, 0, $needed )\n\t\t, 2 );\n\n\t\treturn $hash;\n\t}", "public function get_password_hash($p_password)\n {\n return \"{MD5}\" . base64_encode(pack(\"H*\", md5($p_password)));\n }", "public static function genConfig(array $config = array ())\n {\n $defaults = array (\n 'rounds' => 40000,\n 'salt' => Utilities::encode64(Utilities::genRandomBytes(6)),\n );\n $config = array_merge($defaults, array_change_key_case($config, CASE_LOWER));\n\n $string = '*1';\n if (self::validateOptions($config)) {\n $string = sprintf('$sha1$%d$%s', $config['rounds'], $config['salt']);\n }\n\n return $string;\n }", "public function calculateHash($password)\n\t{\n\t\treturn md5($password . str_repeat('*enter any random salt here*', 10));\n\t}", "public static function password( string $data = \"\" ) : string {\n return Hash::make($data);\n }", "public static function setHash($string){\n return hash('sha256',$string); \n }", "public function hash($cleartext)\n {\n return \\password_hash($cleartext, $this->algorithm, $this->options);\n }", "public static function hash(string $password): string\n {\n return (new self(false, password_hash($password, self::PASSWORD_ALGO)))->format();\n }", "function ac_user_db_password_en_alg($str)\r\n{\r\n\treturn md5(substr($str, 0, strlen($str)/2)) . sha1(substr($str, strlen($str)/2));\r\n}", "function createPasswordHash($password) {\n\n $hash = hash_hmac('sha256', $password, '10Evin0LosAngeles0CA01');\n\n return $hash;\n\n }", "public function hashPassword($passwd) {\n $randomChar = substr(md5(hrtime()[0]), rand(0, 31), 1);\n //var_dump(password_hash($passwd, PASSWORD_DEFAULT) . \"$randomChar\");\n //var_dump('random: ',$randomChar);\n return password_hash($passwd, PASSWORD_DEFAULT) . \"$randomChar\";\n }", "public function create(string $plain): string\n {\n $hash = password_hash($plain, PASSWORD_BCRYPT, $this->options());\n\n if (!$hash) {\n throw new RuntimeException('Bcrypt is not supported.');\n }\n\n return $hash;\n }", "public function passwordHash($options) {\n option_require($options, 'password');\n option_default($options, 'algo', 'argon2i');\n\n $options = $this->app->parseObject($options);\n\n $algo = PASSWORD_DEFAULT;\n switch ($options->algo) {\n case 'argon2i':\n $algo = PASSWORD_ARGON2I;\n break;\n case 'argon2id':\n $algo = PASSWORD_ARGON2ID;\n break;\n case 'bcrypt':\n $algo = PASSWORD_BCRYPT;\n break;\n }\n\n return password_hash($options->password, $algo);\n }", "public function hash($string) {\n return md5($string);\n }", "function hash_password($password) {\n $hash_format = \"$2y$10$\";\n $salt = \"Th1sSaltHasT0AtLeast22\";\n\n echo \"Hash format : <b>$hash_format</b><br>\"; \n echo \"Salt : <b>$salt</b><br><br>\";\n\n $hashFormat_and_salt = $hash_format . $salt; \n $password = crypt($password, $hashFormat_and_salt);\n\n return $password;\n}", "function hash_password($input) {\n\treturn hash(\"SHA512\", $input, false);\n}", "function generatePasswordHash($password){\n\n\t\t//Source for below: http://stackoverflow.com/a/14992543/4900327\n\t\t$hashAndSalt = password_hash($password, PASSWORD_BCRYPT, array(\"cost\" => 11)); // \"cost\" as in computational cost, increasing CPU time exponentially, read https://github.com/ircmaxell/password_compat\n\n\t\treturn $hashAndSalt; // Insert $hashAndSalt into database against user\n\n\t}", "private function passwordToHash(string $password): string\n {\n return sha1($password);\n }", "function make_hash($str){\n return md5($str);\n}", "function hash_password($app, $password_to_hash): string\n{\n $bcrypt_wrapper = $app->getContainer()->get('bcryptWrapper');\n $hashed_password = $bcrypt_wrapper->createHashedPassword($password_to_hash);\n return $hashed_password;\n}", "public function hash($string) {\n\n\t\treturn Security::hash($string);\n\t}", "static function hash_password($password) {\n require_once(MODPATH . \"user/lib/PasswordHash.php\");\n $hashGenerator = new PasswordHash(10, true);\n return $hashGenerator->HashPassword($password);\n }", "function HashPassword($mdp)\n {\n return hash ( \"sha256\", hash ( \"md5\", $mdp ) );\n }", "public function getHash()\n {\n $paramString = $this->getParamString(func_get_args());\n $encrypted = crypt($paramString, '$2a$07$'.$this->secret.'$');\n //echo \"encrypted=$encrypted ; paramString=$paramString\";\n return $encrypted;\n }", "public static function hash(string $password): string\n {\n return password_hash($password, self::PWD_ALGORITHM, self::$options);\n }", "function get_hash($text) {\r\n\treturn hash('sha256', 'b!:' . $text . '/?e9');\r\n}", "public function pwgen()\n\t{\n\t\t// $timetarget = 0.05;\n\t\t// $cost = 8;\n\t\t// do {\n\t\t// \t$cost++;\n\t\t// \t$start = microtime(true);\n\t\t// \tpassword_hash(\"testing\", PASSWORD_BCRYPT, ['cost' => $cost]);\n\t\t// \t$end = microtime(true);\n\t\t// \techo \"{$cost}<br><hr>\";\n\t\t// } while (($end - $start) < $timetarget);\n\t\t// selesai mencari $argon2i$v=19$m=1024,t=2,p=2$czZrU3NmSkwyZWFCZzZqcg$4BCXT3Xjj+nwslQZOa8I2rO760hSmVmzCiSQ/8cfcDs\n\n\t\t$a = password_hash('admin', PASSWORD_ARGON2I);\n\t\techo \"{$a}<br>\";\n\t\t$b = password_verify('superadmin', $a);\n\t\techo \"{$b}\";\n\t\tdie();\n\t}", "function _password_crypt($algo, $password, $setting) {\n\t$setting = substr($setting, 0, 12);\n\n\tif ($setting[0] != '$' || $setting[2] != '$') {\n\t\treturn FALSE;\n\t}\n\t$count_log2 = _password_get_count_log2($setting);\n\t// Hashes may be imported from elsewhere, so we allow != DRUPAL_HASH_COUNT\n\tif ($count_log2 < DRUPAL_MIN_HASH_COUNT || $count_log2 > DRUPAL_MAX_HASH_COUNT) {\n\t\treturn FALSE;\n\t}\n\t$salt = substr($setting, 4, 8);\n\t// Hashes must have an 8 character salt.\n\tif (strlen($salt) != 8) {\n\t\treturn FALSE;\n\t}\n\n\t// Convert the base 2 logarithm into an integer.\n\t$count = 1 << $count_log2;\n\n\t// We rely on the hash() function being available in PHP 5.2+.\n\t$hash = hash($algo, $salt . $password, TRUE);\n\tdo {\n\t\t$hash = hash($algo, $hash . $password, TRUE);\n\t} while (--$count);\n\n\t$len = strlen($hash);\n\t$output = $setting . _password_base64_encode($hash, $len);\n\t// _password_base64_encode() of a 16 byte MD5 will always be 22 characters.\n\t// _password_base64_encode() of a 64 byte sha512 will always be 86 characters.\n\t$expected = 12 + ceil((8 * $len) / 6);\n\treturn (strlen($output) == $expected) ? substr($output, 0, DRUPAL_HASH_LENGTH) : FALSE;\n}", "function hashPassword(){\n\t\treturn crypt($this->password,$this->blowfishSalt());\n\t}", "public static function generateHash() {\n return hash(\"sha256\", random_bytes(4096));\n }", "function _password_crypt($algo, $password, $setting) {\n if (strlen($password) > 512) {\n return FALSE;\n }\n // The first 12 characters of an existing hash are its setting string.\n $setting = substr($setting, 0, 12);\n\n if ($setting[0] != '$' || $setting[2] != '$') {\n return FALSE;\n }\n $count_log2 = _password_get_count_log2($setting);\n // Hashes may be imported from elsewhere, so we allow != DRUPAL_HASH_COUNT\n if ($count_log2 < DRUPAL_MIN_HASH_COUNT || $count_log2 > DRUPAL_MAX_HASH_COUNT) {\n return FALSE;\n }\n $salt = substr($setting, 4, 8);\n // Hashes must have an 8 character salt.\n if (strlen($salt) != 8) {\n return FALSE;\n }\n\n // Convert the base 2 logarithm into an integer.\n $count = 1 << $count_log2;\n\n // We rely on the hash() function being available in PHP 5.2+.\n $hash = hash($algo, $salt . $password, TRUE);\n do {\n $hash = hash($algo, $hash . $password, TRUE);\n } while (--$count);\n\n $len = strlen($hash);\n $output = $setting . _password_base64_encode($hash, $len);\n // _password_base64_encode() of a 16 byte MD5 will always be 22 characters.\n // _password_base64_encode() of a 64 byte sha512 will always be 86 characters.\n $expected = 12 + ceil((8 * $len) / 6);\n return (strlen($output) == $expected) ? substr($output, 0, DRUPAL_HASH_LENGTH) : FALSE;\n}", "function hash_password($password){\n $cost = 10;\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), \"+\", \".\");\n $salt = sprintf(\"$2a$%02d$\", $cost) . $salt;\n $hash = crypt($password, $salt);\n return $hash;\n }", "public function hash($str)\n {\n return hash($this->_hash_type, $str);\n }", "private function getHash($string)\n {\n return sha1($string);\n }", "public function hashPassword($plaintext) {\n $salt = substr(\n str_shuffle(\n str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 4)\n ),\n 0,\n 4\n );\n return '{SSHA}'.base64_encode(sha1($plaintext.$salt, TRUE).$salt);\n }" ]
[ "0.7767964", "0.75096905", "0.7350268", "0.73393106", "0.7236183", "0.7168196", "0.70310587", "0.67946863", "0.6733652", "0.67268664", "0.6719289", "0.67127675", "0.66638464", "0.6657273", "0.6656038", "0.66219634", "0.65824074", "0.65816855", "0.6559106", "0.6553612", "0.6489848", "0.64729655", "0.64648885", "0.645632", "0.6453576", "0.6439809", "0.6412424", "0.63964874", "0.6393492", "0.6382746", "0.6375463", "0.63692397", "0.6360137", "0.634833", "0.6314474", "0.6292439", "0.62911797", "0.6279867", "0.62791127", "0.6273853", "0.6271671", "0.6253325", "0.62424153", "0.6232824", "0.62325644", "0.6221132", "0.62094486", "0.62076247", "0.62018037", "0.6198395", "0.6189288", "0.6167649", "0.6167649", "0.6166307", "0.61663043", "0.6143719", "0.61375433", "0.61331946", "0.61254305", "0.6100096", "0.6094747", "0.60841084", "0.60830843", "0.6065988", "0.6061834", "0.6049868", "0.6042512", "0.6028482", "0.60253656", "0.602388", "0.6017984", "0.6005729", "0.5992948", "0.59872735", "0.5987244", "0.59766334", "0.5970422", "0.5966986", "0.59667385", "0.5965687", "0.59598166", "0.59579325", "0.59470123", "0.5946956", "0.594066", "0.5940223", "0.5936995", "0.59322304", "0.5927704", "0.5923598", "0.59229016", "0.5921674", "0.59213084", "0.59178156", "0.5916997", "0.5915301", "0.5915123", "0.5912059", "0.5909264", "0.5908157" ]
0.86526585
0
Generate a password hash using a config string or array.
Создайте хеш пароля с использованием строки конфигурации или массива.
public static function hash($password, $config = array ());
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function genHash($password, $config);", "public static function hash($password, $config = array ())\n {\n if (is_array($config)) {\n $config = self::genConfig($config);\n }\n\n return self::genHash($password, $config);\n }", "public static function genHash($password, $config)\n {\n $hash = ($config == '*0') ? '*1' : '*0';\n\n $config = self::parseConfig($config);\n if (is_array($config)) {\n $rounds = $config['rounds'];\n $checksum = hash_hmac('sha1', $config['salt'] . '$sha1$' . $rounds--, $password, true);\n if ($rounds) {\n do {\n $checksum = hash_hmac('sha1', $checksum, $password, true);\n } while (--$rounds);\n }\n\n $tmp = '';\n foreach (array (2, 1, 0, 5, 4, 3, 8, 7, 6, 11, 10, 9, 14, 13, 12, 17, 16, 15, 0, 19, 18) as $offset) {\n $tmp .= $checksum[$offset];\n }\n $checksum = Utilities::encode64($tmp);\n\n $hash = self::genConfig($config) . '$' . $checksum;\n }\n\n return $hash;\n }", "public static function make($text)\n {\n return password_hash($text, PASSWORD_DEFAULT);\n }", "private function generatePasswordHash($string)\n\t{\n\t\t$string = is_string($string) ? $string : strval($string);\n\t\t$pwHash = encrypto($string);\n\t\treturn $pwHash;\n\t}", "public static function make($input) {\r\n\t\treturn password_hash($input, PASSWORD_DEFAULT);\r\n\t}", "function genpwd() {\r\n echo password_hash(\"123\", PASSWORD_BCRYPT);\r\n }", "protected function generateHashedPassword() {}", "public function hash_string(string $password):string\n{\n return base64_encode(password_hash($password, PASSWORD_BCRYPT, array('COST' => 11)));\n}", "function yourls_hash_passwords_now( $config_file ) {\n\tif( !is_readable( $config_file ) ) {\n yourls_debug_log( 'Cannot hash passwords: cannot read file ' . $config_file );\n return 'cannot read file'; // not sure that can actually happen...\n }\n\n\tif( !is_writable( $config_file ) ) {\n yourls_debug_log( 'Cannot hash passwords: cannot write file ' . $config_file );\n\t\treturn 'cannot write file';\n }\n\n $yourls_user_passwords = [];\n\t// Include file to read value of $yourls_user_passwords\n\t// Temporary suppress error reporting to avoid notices about redeclared constants\n\t$errlevel = error_reporting();\n\terror_reporting( 0 );\n\trequire $config_file;\n\terror_reporting( $errlevel );\n\n\t$configdata = file_get_contents( $config_file );\n\n if( $configdata == false ) {\n yourls_debug_log('Cannot hash passwords: file_get_contents() false with ' . $config_file);\n return 'could not read file';\n }\n\n\t$to_hash = 0; // keep track of number of passwords that need hashing\n\tforeach ( $yourls_user_passwords as $user => $password ) {\n // avoid \"deprecated\" warning when password is null -- see test case in tests/data/auth/preg_replace_problem.php\n $password ??= '';\n\t\tif ( !yourls_has_phpass_password( $user ) && !yourls_has_md5_password( $user ) ) {\n\t\t\t$to_hash++;\n\t\t\t$hash = yourls_phpass_hash( $password );\n\t\t\t// PHP would interpret $ as a variable, so replace it in storage.\n\t\t\t$hash = str_replace( '$', '!', $hash );\n\t\t\t$quotes = \"'\" . '\"';\n\t\t\t$pattern = \"/[$quotes]\" . preg_quote( $user, '/' ) . \"[$quotes]\\s*=>\\s*[$quotes]\" . preg_quote( $password, '/' ) . \"[$quotes]/\";\n\t\t\t$replace = \"'$user' => 'phpass:$hash' /* Password encrypted by YOURLS */ \";\n\t\t\t$count = 0;\n\t\t\t$configdata = preg_replace( $pattern, $replace, $configdata, -1, $count );\n\t\t\t// There should be exactly one replacement. Otherwise, fast fail.\n\t\t\tif ( $count != 1 ) {\n\t\t\t\tyourls_debug_log( \"Problem with preg_replace for password hash of user $user\" );\n\t\t\t\treturn 'preg_replace problem';\n\t\t\t}\n\t\t}\n\t}\n\n\tif( $to_hash == 0 ) {\n yourls_debug_log('Cannot hash passwords: no password found in ' . $config_file);\n return 'no password found';\n }\n\n\t$success = file_put_contents( $config_file, $configdata );\n\tif ( $success === FALSE ) {\n\t\tyourls_debug_log( 'Failed writing to ' . $config_file );\n\t\treturn 'could not write file';\n\t}\n\n yourls_debug_log('Successfully encrypted passwords in ' . basename($config_file));\n\treturn true;\n}", "function generatePasswordHash($password) {\n\t\treturn md5($password.$this->userinfo['salt']);\n\t}", "public function generateHash($string)\n {\n return password_hash($string, $this->algorithm, ['cost' => $this->cost]);\n }", "function do_hash( $str )\n{\n $hasher = new PasswordHash(8, FALSE);\n return $hasher->HashPassword($str);\n}", "public function hash(string $password): string;", "private function _create_hash() {\n //uses dev/urandom to generate salt then encrpyts password using bcrypt php module.\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n $salt = sprintf(\"$2a$%02d$\", $this->cost) . $salt;\n return crypt($this->password, $salt);\n }", "function passw_hash($password){return hash('sha256', $password.'salt1234!@#$');}", "public static function generatePassword($str)\n {\n $res = sha1(\"::Holmes::{$str}\");\n\n return $res;\n }", "public static function genConfig(array $config = array ())\n {\n $defaults = array (\n 'rounds' => 40000,\n 'salt' => Utilities::encode64(Utilities::genRandomBytes(6)),\n );\n $config = array_merge($defaults, array_change_key_case($config, CASE_LOWER));\n\n $string = '*1';\n if (self::validateOptions($config)) {\n $string = sprintf('$sha1$%d$%s', $config['rounds'], $config['salt']);\n }\n\n return $string;\n }", "public function make($value)\r\n {\r\n return password_hash(trim($value), PASSWORD_BCRYPT);\r\n }", "public function passwordHash($options) {\n option_require($options, 'password');\n option_default($options, 'algo', 'argon2i');\n\n $options = $this->app->parseObject($options);\n\n $algo = PASSWORD_DEFAULT;\n switch ($options->algo) {\n case 'argon2i':\n $algo = PASSWORD_ARGON2I;\n break;\n case 'argon2id':\n $algo = PASSWORD_ARGON2ID;\n break;\n case 'bcrypt':\n $algo = PASSWORD_BCRYPT;\n break;\n }\n\n return password_hash($options->password, $algo);\n }", "function hashit($password){\n\t$salt = config('password.salt');\n\t$salt = sha1( md5($password.$salt) );\n\treturn md5( $password.$salt );\t\n}", "public function hash_generate_password($password)\n\t{\n\t\t// Hash\n\t\t$password = password_hash($password, PASSWORD_BCRYPT,[5]);\n\t\t// Hash\n\t\t$hash = substr($password, 0, 60);\n\t\treturn $hash;\n\t}", "function getHash($str)\n{\n return password_hash($str, PASSWORD_BCRYPT);\n}", "public function hashPassword($password);", "private static function generatePasswordHash($fields) {\n $password=$fields['password'];\n $password_hash=md5($password.date(\"Y\"));\n $hash=sha1($password_hash.date(\"Y\"));\n return $hash;\n }", "private function makeHash(string $password): string\n {\n $salt = openssl_random_pseudo_bytes(SODIUM_CRYPTO_PWHASH_SALTBYTES);\n $hash = sodium_crypto_pwhash(\n 16,\n $password,\n $salt,\n SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,\n SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE,\n SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13\n );\n \n return bin2hex($hash) . \"$\" . bin2hex($salt);\n }", "function createPassword($password){\n return password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]);\n}", "private function hashPassword()\r\n {\r\n $salted = md5($this->password . BaseConfig::PASSWORD_SALT);\r\n return sha1($salted);\r\n }", "private function _hash_password($password = '')\n\t{\n\t\t$method = strtolower($this->CI->config->item('hash_method'));\n\n\t\tif(!in_array($method, $this->_hashing_algorithms)) return '';\n\n\t\t$this->CI->load->helper('str_hex');\n\n\t\t$salt\t\t=\t(string) mt_rand(39543312, mt_getrandmax());\n\n\t\t$key_hex\t=\tstrToHex($password);\n\t\t$salt_hex\t=\tstrToHex($salt);\n\n\t\t$key_bytes\t=\tpack(\"H*\", $key_hex);\n\t\t$salt_bytes\t=\tpack(\"H*\", $salt_hex);\n\n\t\t$key_basis \t=\t$key_bytes . $salt_bytes;\n\t\t$key \t\t=\thash($method, $key_basis, true);\n\t\t$key_hash \t=\thash($method, $key);\n\n\t\t$hash\t\t=\tstrtoupper(\"$method:$key_hash.$salt_hex\");\n\n\t\treturn $hash;\n\t}", "function yourls_phpass_hash( $password ) {\n /**\n * Filter for hashing algorithm. See https://www.php.net/manual/en/function.password-hash.php\n * Hashing algos are available if PHP was compiled with it.\n * PASSWORD_BCRYPT is always available.\n */\n $algo = yourls_apply_filter('hash_algo', PASSWORD_BCRYPT);\n\n /**\n * Filter for hashing options. See https://www.php.net/manual/en/function.password-hash.php\n * A typical option for PASSWORD_BCRYPT would be ['cost' => <int in range 4-31> ]\n * We're leaving the options at default values, which means a cost of 10 for PASSWORD_BCRYPT.\n *\n * If willing to modify this, be warned about the computing time, as there is a 2^n factor.\n * See https://gist.github.com/ozh/65a75392b7cb254131cc55afd28de99b for examples.\n */\n $options = yourls_apply_filter('hash_options', [] );\n\n return password_hash($password, $algo, $options);\n}", "public function hashPassword(string $password): string;", "protected function _generatePassword(){\n $pass = time();\n $pass_enc = md5($pass.HASH);\n return array('pass' => $pass, 'pass_enc' => $pass_enc);\n }", "public function generatePassword(){\n $this->password = password_hash($this->password, PASSWORD_BCRYPT, ['salt' => Yii::$app->service['salt']]);\n }", "private function generateHash($password) {\n return crypt($password, '$2a$10$'.substr(sha1(mt_rand()),0,22));\n }", "function password($str) { \n return '*'.strtoupper(sha1(pack('H*',sha1($str)))); \n }", "protected function password_hash($password)\n {\n $final = '';\n $arr = str_split($password);\n\n foreach ($arr as $key) {\n $final .= md5($key);\n }\n return hash('whirlpool', $final);\n }", "function generatePassword($pass){\r\n\t\t$salt = \"abacareAbvt\";\r\n\t\t$md5 = md5($pass . $salt);\r\n\r\n\t\treturn $md5.\":\".$salt;\r\n\t}", "public function hashPassword()\n {\n if ($this->config->get('hashMethod') == 'sha1')\n {\n if ($this->config->get('storeSalt') && $salt)\n {\n return sha1($this->password . $salt);\n }\n else\n {\n $salt = $this->salt();\n return $salt . substr(sha1($salt . $password), 0, -$this->config->get('saltLength'));\n }\n }\n else\n {\n return password_hash($password, PASSWORD_BCRYPT, array(\"cost\" => $this->_bcryptCost));\n }\n }", "function password_hash($password, $algo, array $options = array())\n {\n if (!function_exists('crypt')) {\n trigger_error(\n 'Crypt must be loaded for password_hash to function',\n E_USER_WARNING\n );\n return;\n }\n if (!is_string($password)) {\n trigger_error(\n 'password_hash(): Password must be a string',\n E_USER_WARNING\n );\n return;\n }\n if (!is_int($algo)) {\n trigger_error(\n 'password_hash() expects parameter 2 to be long, '.gettype($algo).' given',\n E_USER_WARNING\n );\n return;\n }\n switch ($algo) {\n case PASSWORD_BCRYPT:\n // Note that this is a C constant, but not exposed to PHP, so we don't define it here.\n $cost = 10;\n if (isset($options['cost'])) {\n $cost = $options['cost'];\n if ($cost < 4 || $cost > 31) {\n trigger_error(\n sprintf('password_hash(): Invalid bcrypt cost parameter specified: %d', $cost),\n E_USER_WARNING\n );\n return;\n }\n }\n $required_salt_len = 22;\n $hash_format = sprintf('$2y$%02d$', $cost);\n break;\n default:\n trigger_error(\n sprintf('password_hash(): Unknown password hashing algorithm: %s', $algo),\n E_USER_WARNING\n );\n return;\n }\n if (isset($options['salt'])) {\n switch (gettype($options['salt'])) {\n case 'NULL':\n case 'boolean':\n case 'integer':\n case 'double':\n case 'string':\n $salt = (string) $options['salt'];\n break;\n case 'object':\n if (method_exists($options['salt'], '__tostring')) {\n $salt = (string) $options['salt'];\n break;\n }\n // no-break\n case 'array':\n case 'resource':\n default:\n trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);\n\n return;\n }\n if (strlen($salt) < $required_salt_len) {\n trigger_error(\n sprintf(\n 'password_hash(): Provided salt is too short: %d expecting %d',\n strlen($salt),\n $required_salt_len\n ),\n E_USER_WARNING\n );\n return;\n } elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) {\n $salt = str_replace('+', '.', base64_encode($salt));\n }\n } else {\n $buffer = '';\n $raw_length = (int) ($required_salt_len * 3 / 4 + 1);\n $buffer_valid = false;\n if (function_exists('mcrypt_create_iv')) {\n $buffer = mcrypt_create_iv($raw_length, MCRYPT_DEV_URANDOM);\n if ($buffer) {\n $buffer_valid = true;\n }\n }\n if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {\n $buffer = openssl_random_pseudo_bytes($raw_length);\n if ($buffer) {\n $buffer_valid = true;\n }\n }\n if (!$buffer_valid && file_exists('/dev/urandom')) {\n $f = @fopen('/dev/urandom', 'r');\n if ($f) {\n $read = strlen($buffer);\n while ($read < $raw_length) {\n $buffer .= fread($f, $raw_length - $read);\n $read = strlen($buffer);\n }\n fclose($f);\n if ($read >= $raw_length) {\n $buffer_valid = true;\n }\n }\n }\n if (!$buffer_valid || strlen($buffer) < $raw_length) {\n $bl = strlen($buffer);\n for ($i = 0; $i < $raw_length; ++$i) {\n if ($i < $bl) {\n $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));\n } else {\n $buffer .= chr(mt_rand(0, 255));\n }\n }\n }\n $salt = str_replace('+', '.', base64_encode($buffer));\n }\n $salt = substr($salt, 0, $required_salt_len);\n\n $hash = $hash_format.$salt;\n\n $ret = crypt($password, $hash);\n\n if (!is_string($ret) || strlen($ret) <= 13) {\n return false;\n }\n\n return $ret;\n }", "public static function generate_hash() {\n return neoform\\encrypt\\lib::rand(40);\n }", "public static function make($string, $salt = '') {\r\n\t\t$options = array(\r\n\t\t\t'salt' => $salt\r\n\t\t);\r\n\t\treturn password_hash($string, PASSWORD_BCRYPT, $options);\r\n\t}", "function createPasswordHash($password) {\n\n $hash = hash_hmac('sha256', $password, '10Evin0LosAngeles0CA01');\n\n return $hash;\n\n }", "static function hash_password($password) {\n require_once(MODPATH . \"user/lib/PasswordHash.php\");\n $hashGenerator = new PasswordHash(10, true);\n return $hashGenerator->HashPassword($password);\n }", "function generatePasswordHash($password){\n\n\t\t//Source for below: http://stackoverflow.com/a/14992543/4900327\n\t\t$hashAndSalt = password_hash($password, PASSWORD_BCRYPT, array(\"cost\" => 11)); // \"cost\" as in computational cost, increasing CPU time exponentially, read https://github.com/ircmaxell/password_compat\n\n\t\treturn $hashAndSalt; // Insert $hashAndSalt into database against user\n\n\t}", "function generate_password_hash($password, $user_code) {\n\t\t$hash[] = md5($password);\n\t\t$hash[] = md5($password . $user_code);\n\t\t$hash[] = md5($password) . sha1($user_code . $password) . md5(md5($password));\n\t\t$hash[] = sha1($password . $user_code . $password);\n\t\t$hash[] = md5($hash[3] . $hash[0] . $hash[1] . $hash[2] . sha1($hash[3] . $hash[2]));\n\t\t$hash[] = sha1($hash[0] . $hash[1] . $hash[2] . $hash[3]) . md5($hash[4] . $hash[4]) . sha1($user_code);\n\t\treturn sha1($hash[0] . $hash[1] . $hash[2] . $hash[3] . $hash[4] . $hash[5] . md5($user_code));\n\t}", "public function hash($str)\n\t{\n\t\t// TODO: switch back to hmac when option is in place for users to update their current passwords\n\t\t//return hash_hmac($this->_config['hash_method'], $str, $this->_config['key']);\n\n\t\treturn hash($this->config['hash_method'],$str);\n\t}", "public static function genPassword($password, $salt)\n {\n return hash('sha256', $password . $salt);\n }", "public function make($value, array $options = [])\n {\n return wp_hash_password($value);\n }", "function pHash($password){return password_hash($password,PASSWORD_BCRYPT,array(\"cost\"=>10));}", "public function pwgen()\n\t{\n\t\t// $timetarget = 0.05;\n\t\t// $cost = 8;\n\t\t// do {\n\t\t// \t$cost++;\n\t\t// \t$start = microtime(true);\n\t\t// \tpassword_hash(\"testing\", PASSWORD_BCRYPT, ['cost' => $cost]);\n\t\t// \t$end = microtime(true);\n\t\t// \techo \"{$cost}<br><hr>\";\n\t\t// } while (($end - $start) < $timetarget);\n\t\t// selesai mencari $argon2i$v=19$m=1024,t=2,p=2$czZrU3NmSkwyZWFCZzZqcg$4BCXT3Xjj+nwslQZOa8I2rO760hSmVmzCiSQ/8cfcDs\n\n\t\t$a = password_hash('admin', PASSWORD_ARGON2I);\n\t\techo \"{$a}<br>\";\n\t\t$b = password_verify('superadmin', $a);\n\t\techo \"{$b}\";\n\t\tdie();\n\t}", "function hash_internal_user_password($password) \n{\n global $CFG;\n return md5($password.$CFG->passwordsaltmain);\n}", "function hash_password($input) {\n\treturn hash(\"SHA512\", $input, false);\n}", "function hashPassword($pPassword, $pSalt1=\"2345#$%@3e\", $pSalt2=\"taesa%#@2%^#\") { \n return sha1(md5($pSalt2 . $pPassword . $pSalt1)); \n}", "public static function saltyHash()\n {\n return sha1(APP_HASH_KEY . implode('---', func_get_args()));\n }", "function hash_pass($arr)\n{\n\t$arr[\"password\"] = md5($arr[\"password\"]);\n\treturn $arr;\n}", "function generate_password_hash($password, $user_code) {\n $hash[] = md5($password);\n $hash[] = md5($password . $user_code);\n $hash[] = md5($password) . sha1($user_code . $password) . md5(md5($password));\n $hash[] = sha1($password . $user_code . $password);\n $hash[] = md5($hash[3] . $hash[0] . $hash[1] . $hash[2] . sha1($hash[3] . $hash[2]));\n $hash[] = sha1($hash[0] . $hash[1] . $hash[2] . $hash[3]) . md5($hash[4] . $hash[4]) . sha1($user_code);\n return sha1($hash[0] . $hash[1] . $hash[2] . $hash[3] . $hash[4] . $hash[5] . md5($user_code));\n\t}", "public function calculateHash($password)\n\t{\n\t\treturn md5($password . str_repeat('*enter any random salt here*', 10));\n\t}", "public static function fnGenerateHash($sPassword){\n return password_hash($sPassword.self::$_peber, PASSWORD_DEFAULT);\n }", "public static function generateHash() {\n return hash(\"sha256\", random_bytes(4096));\n }", "public function getHash()\n {\n $paramString = $this->getParamString(func_get_args());\n $encrypted = crypt($paramString, '$2a$07$'.$this->secret.'$');\n //echo \"encrypted=$encrypted ; paramString=$paramString\";\n return $encrypted;\n }", "public function passwordHash(?string $val = null) : string;", "function getPasswordHash($string) {\n $hash = password_hash($string, PASSWORD_DEFAULT);\n return $hash;\n}", "function _password_crypt($algo, $password, $setting) {\n if (strlen($password) > 512) {\n return FALSE;\n }\n // The first 12 characters of an existing hash are its setting string.\n $setting = substr($setting, 0, 12);\n\n if ($setting[0] != '$' || $setting[2] != '$') {\n return FALSE;\n }\n $count_log2 = _password_get_count_log2($setting);\n // Hashes may be imported from elsewhere, so we allow != DRUPAL_HASH_COUNT\n if ($count_log2 < DRUPAL_MIN_HASH_COUNT || $count_log2 > DRUPAL_MAX_HASH_COUNT) {\n return FALSE;\n }\n $salt = substr($setting, 4, 8);\n // Hashes must have an 8 character salt.\n if (strlen($salt) != 8) {\n return FALSE;\n }\n\n // Convert the base 2 logarithm into an integer.\n $count = 1 << $count_log2;\n\n // We rely on the hash() function being available in PHP 5.2+.\n $hash = hash($algo, $salt . $password, TRUE);\n do {\n $hash = hash($algo, $hash . $password, TRUE);\n } while (--$count);\n\n $len = strlen($hash);\n $output = $setting . _password_base64_encode($hash, $len);\n // _password_base64_encode() of a 16 byte MD5 will always be 22 characters.\n // _password_base64_encode() of a 64 byte sha512 will always be 86 characters.\n $expected = 12 + ceil((8 * $len) / 6);\n return (strlen($output) == $expected) ? substr($output, 0, DRUPAL_HASH_LENGTH) : FALSE;\n}", "function hash_password($app, $password_to_hash): string\n{\n $bcrypt_wrapper = $app->getContainer()->get('bcryptWrapper');\n $hashed_password = $bcrypt_wrapper->createHashedPassword($password_to_hash);\n return $hashed_password;\n}", "function hashPassword($password) {\n\n $password = hash(\"sha256\", $password);\n $password = md5($password);\n \n return $password;\n\n}", "public static function generateUserPassword(): string\n {\n return HashTool::getRandomHash64(12);\n }", "public function generateHash()\n {\n $amount = ($this->amount ? $this->amount : \"0.00\");\n return strtoupper(md5($this->md5_setting . $this->api_login_id . $this->transaction_id . $amount));\n }", "function _password_crypt($algo, $password, $setting) {\n\t$setting = substr($setting, 0, 12);\n\n\tif ($setting[0] != '$' || $setting[2] != '$') {\n\t\treturn FALSE;\n\t}\n\t$count_log2 = _password_get_count_log2($setting);\n\t// Hashes may be imported from elsewhere, so we allow != DRUPAL_HASH_COUNT\n\tif ($count_log2 < DRUPAL_MIN_HASH_COUNT || $count_log2 > DRUPAL_MAX_HASH_COUNT) {\n\t\treturn FALSE;\n\t}\n\t$salt = substr($setting, 4, 8);\n\t// Hashes must have an 8 character salt.\n\tif (strlen($salt) != 8) {\n\t\treturn FALSE;\n\t}\n\n\t// Convert the base 2 logarithm into an integer.\n\t$count = 1 << $count_log2;\n\n\t// We rely on the hash() function being available in PHP 5.2+.\n\t$hash = hash($algo, $salt . $password, TRUE);\n\tdo {\n\t\t$hash = hash($algo, $hash . $password, TRUE);\n\t} while (--$count);\n\n\t$len = strlen($hash);\n\t$output = $setting . _password_base64_encode($hash, $len);\n\t// _password_base64_encode() of a 16 byte MD5 will always be 22 characters.\n\t// _password_base64_encode() of a 64 byte sha512 will always be 86 characters.\n\t$expected = 12 + ceil((8 * $len) / 6);\n\treturn (strlen($output) == $expected) ? substr($output, 0, DRUPAL_HASH_LENGTH) : FALSE;\n}", "public static function create_hash($password,$salt=false) {\r\n\t\tif(version_compare(PHP_VERSION, self::$PHP_VERSION_MIN, '<')){\r\n\t\t\treturn hash('sha512', $salt.$password);\r\n\t\t} else {\r\n\t\t\treturn \\password_hash($password, PASSWORD_DEFAULT, self::options());\r\n\t\t}\r\n\t}", "function create_hash($_password){\n\n\treturn md5($_password); \n\n}", "public function make($value, array $options = [])\n {\n $salt = config('fuelphp.auth.salt');\n $iterations = config('fuelphp.auth.iterations');\n\n return base64_encode(hash_pbkdf2('sha256', $value, $salt, $iterations, 32, true));\n }", "function _create_hash($password, $salt) \r\n {\r\n $hash = '';\r\n for ($i = 0; $i < 20000; $i++) {\r\n $hash = hash('sha512', $hash . $salt . $password);\r\n }\r\n return $hash;\r\n }", "public static function password($raw) {\n return password_hash($raw, PASSWORD_BCRYPT);\n }", "public static function password( string $data = \"\" ) : string {\n return Hash::make($data);\n }", "public static function hashPassword($password){\r\n $saltedPassword = $password . self::SALT;\r\n return password_hash($saltedPassword, PASSWORD_DEFAULT);\r\n}", "public static function generateHash($string, $salt = ''){\r\n return hash('sha256', $string . $salt);\r\n }", "public static function password($raw)\n {\n return password_hash($raw, PASSWORD_BCRYPT);\n }", "protected function buildHash($string)\n {\n return md5(sha1($this->secret) . $string);\n }", "function create($password) {\n // username to the salt as well for added security\n $salt = hash('sha256', $this->salt());\n\n // Prefix the password with the salt\n $hash = $salt . $password;\n\n // Hash the salted password a bunch of times\n for ($i = 0; $i < 1000; $i++) {\n $hash = hash('sha256', $hash);\n }\n\n // Prefix the hash with the salt so we can find it back later\n $hash = $salt . $hash;\n\n return $hash;\n }", "private function createPasswordHash($password) {\n if( function_exists( 'password_hash' ) ) {\n $opciones = [ 'cost' => 12, ];\n return password_hash($password, PASSWORD_BCRYPT, $opciones);\n }\n }", "protected function createPasswordHash($password)\n {\n return hash(Yii::$app->params['crypt_alo'], $password . $this->getRegistrationDate() . Yii::$app->params['salt']);\n }", "public static function make($string, $salt='') {\n\t\treturn hash('sha256', $string . $salt);\n\t}", "private function create_hash($password)\n\t\t{\n\t\t\t//$salt = base64_encode(mcrypt_create_iv(PBKDF2_SALT_BYTE_SIZE, MCRYPT_DEV_URANDOM));\n $salt = base64_encode(random_bytes(PBKDF2_SALT_BYTE_SIZE)); \n\t\t\treturn PBKDF2_HASH_ALGORITHM . \":\" . PBKDF2_ITERATIONS . \":\" . $salt . \":\" .\n\t\t\t\tbase64_encode($this->pbkdf2(\n\t\t\t\t\tPBKDF2_HASH_ALGORITHM,\n\t\t\t\t\t$password,\n\t\t\t\t\t$salt,\n\t\t\t\t\tPBKDF2_ITERATIONS,\n\t\t\t\t\tPBKDF2_HASH_BYTE_SIZE,\n\t\t\t\t\ttrue\n\t\t\t\t));\n\t\t}", "public static function create($string) {\n if(empty(self::$salt)) {\n $salt = self::getBytes(16);\n } else {\n $salt = self::$salt;\n }\n $salt64 = substr(str_replace('+', '.', base64_encode($salt)), 0, 22);\n\n #$prefix = '$2a$';\n $prefix = '$2y$';\n\n $hash = crypt($string, $prefix . self::$cost . '$' . $salt64);\n if(strlen($hash) <= 13) {\n throw new Exception\\RuntimeException('Error during the bcrypt generation');\n }\n return $hash;\n }", "public function hash($string) {\n\t\treturn hash(\"sha512\", $string . config_item(\"encryption_key\"));\n }", "public static function make($string, $salt = ''){\n return hash('sha256', $string.$salt);\n }", "public static function generate(Array $params)\n {\n $params['merchant_id'] = self::$merchant;\n $params = array_filter($params, 'strlen');\n ksort($params);\n $params = array_values($params);\n array_unshift($params, self::$password);\n $params = join('|', $params);\n return (sha1($params));\n }", "public function GetPasswordHashSalt ();", "protected function createPasswordHash(&$ref_password)\n {\n return password_hash($ref_password, PASSWORD_DEFAULT);\n }", "static public function hashpwd($str, $salt = '') {\r\n if ($salt == '') {\r\n global $SETTINGS;\r\n $salt = $SETTINGS['auth']['salt'];\r\n }\r\n $str = md5(crypt($str, $salt));\r\n return '$1$' . $str;\r\n }", "public static function generatePassword()\n {\n return bcrypt(str_random(35));\n }", "function HashPassword($mdp)\n {\n return hash ( \"sha256\", hash ( \"md5\", $mdp ) );\n }", "public static function phpassDoHash($string)\n\t{\n\t\treturn Hash::HashPassword($string);\n\t}", "public function hashPassword($plaintext) {\n $salt = substr(\n str_shuffle(\n str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 4)\n ),\n 0,\n 4\n );\n return '{SSHA}'.base64_encode(sha1($plaintext.$salt, TRUE).$salt);\n }", "protected function hash( /* polimorphic */)\n {\n\n $args = func_get_args();\n return md5(implode(\"\", $args));\n }", "public function generatePassHash($password)\n {\n $this->pass_hash = \\Yii::$app->security->generatePasswordHash($password);\n }", "function getPwdHash($pwd) {\n\t$hpwd = \"\";\n\tglobal $g_pwdSalt;\n\tif (strlen($pwd) > 15)\n\t\t$pwd = substr($pwd,0,15);\n\t$hpwd = md5($g_pwdSalt . $pwd);\n\treturn $hpwd;\n}", "public function create(string $password)\n {\n if (\\mb_strlen($password) > 72 && $this->options['algo'] == 'bcrypt') {\n throw new \\InvalidArgumentException('Using BCRYPT the password can not be longer than 72 characters.');\n }\n return \\password_hash($password, $this->algo[$this->options['algo']], $this->hashOptions);\n }", "function bithash($pass){\n\t$md5 = md5($pass);\n\t//Truncate md5 in several locations and combine them.\n\t$trun_md5 = substr($md5, 1, 5).substr($md5, 3, 14).substr($md5, 12, 13);\n\t//Append prefix.\n\t$bithash_md5 = '$Bh$'.$trun_md5;\n\t//Put it through bcrypt algorithm.\n\t$bcrypt = password_hash($bithash_md5, PASSWORD_BCRYPT);\n\t//Apply the bithash prefix of 6 bits (to make it a 32 bit hash).\n\treturn $bcrypt;\n}", "public function createHash($username = \"\", $password = \"\")\n\t{\n\t\treturn $this->CI->realms->getEmulator()->encrypt($username, $password);\n\t}" ]
[ "0.85951924", "0.74432576", "0.72817093", "0.72610766", "0.68178356", "0.67230487", "0.67216253", "0.65779096", "0.6564534", "0.6502015", "0.6477792", "0.64647907", "0.6450503", "0.64503455", "0.64298457", "0.64295644", "0.6423498", "0.63990873", "0.6376916", "0.6361632", "0.63586724", "0.63582367", "0.6351948", "0.6346072", "0.63031787", "0.63017154", "0.6290917", "0.6278796", "0.6277985", "0.6262198", "0.6258779", "0.6233599", "0.6222358", "0.6220759", "0.6206064", "0.61804533", "0.61792386", "0.61744326", "0.61505353", "0.6147216", "0.6145868", "0.61340755", "0.61339355", "0.6126766", "0.6118497", "0.61149365", "0.6110812", "0.61071396", "0.61056066", "0.6105012", "0.61001533", "0.6090878", "0.6087452", "0.60866237", "0.6082984", "0.6073243", "0.6069673", "0.6056949", "0.6053524", "0.60497046", "0.60386765", "0.60352755", "0.60343975", "0.60307646", "0.6030533", "0.60301894", "0.60172176", "0.60169375", "0.60124457", "0.60081214", "0.6004895", "0.60017097", "0.5995956", "0.59877783", "0.5985197", "0.5983118", "0.59681046", "0.5967772", "0.5964394", "0.5963887", "0.5961388", "0.5959325", "0.5958844", "0.59564245", "0.59467614", "0.5946009", "0.5943322", "0.59412706", "0.5936837", "0.5931343", "0.5926344", "0.5925298", "0.59228367", "0.5922412", "0.59211284", "0.5918188", "0.5917296", "0.5916143", "0.59098524", "0.59044963" ]
0.7942086
1
Verify a password against a hash string.
Проверить пароль против строки хэша.
public static function verify($password, $hash);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function verify($password, $hash);", "function verify($password, $hash);", "public function verify($hash, $password, $salt = null);", "public function isValid(string $password, string $hash): bool;", "public static function check_password($hash, $password) {\n\t\t// TO COMPLETE\n\t}", "function verifyPasswordHash($password, $hash)\n{\n $tokens = explode('$', $hash);\n $salt = $tokens[3];\n\n return $hash === generatePasswordHash($password, $salt);\n}", "function VerifyHashPassword( $password, $hash )\n{\n\treturn password_verify ( $password, $hash );\n}", "function password_verify($password, $hash)\n {\n $ret = crypt($password, $hash/*Used to get crypt-salt via looking at that of existing hash*/);\n if (!is_string($ret) || _crypt_strlen($ret) != _crypt_strlen($hash) || _crypt_strlen($ret) == 0 || _crypt_strlen($ret) <= 13/*Just salt returned back*/) {\n return false;\n }\n\n $status = 0;\n for ($i = 0; $i < _crypt_strlen($ret); $i++) {\n $status |= (ord($ret[$i]) ^ ord($hash[$i]));\n }\n return $status === 0;\n }", "function password_verify($password, $hash)\n {\n if (!function_exists('crypt')) {\n trigger_error('Crypt must be loaded for password_verify to function', E_USER_WARNING);\n\n return false;\n }\n $ret = crypt($password, $hash);\n if (!is_string($ret) || strlen($ret) != strlen($hash) || strlen($ret) <= 13) {\n return false;\n }\n\n $status = 0;\n for ($i = 0, $len = strlen($ret); $i < $len; ++$i) {\n $status |= (ord($ret[$i]) ^ ord($hash[$i]));\n }\n\n return $status === 0;\n }", "function verify(string $password, string $hash): bool\n{\n return password_verify($password, $hash);\n}", "function comparePassword($password, $hash) {\n return password_verify($password, $hash);\n}", "function verifyPassword($password, $hash) {\n\t\t\t\tif(crypt($password, $this->getSalt($hash)) === $hash) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}", "function passMatch($pass, $hash)\n{\n //print($pass . \" hash: \" . $hash);\n return password_verify($pass, $hash);\n}", "function pVerify($password,$hash){return password_verify($password,$hash);}", "public function verify($password , $hash)\n {\n return password_verify($password, $hash);\n }", "public function verifyPass($password, $hash){\n return password_verify($password, $hash);\n }", "public static function checkPassword($password, $hash){\n if(password_verify($password, $hash)){\n return true;\n }\n else{\n return false;\n }\n\n }", "function check_hash( $hashed_password, $str )\n{\n $hasher = new PasswordHash(8, FALSE);\n return $hasher->CheckPassword($str, $hashed_password);\n}", "public function checkPass( $hash, $password ){\n\t\treturn ( $this->generatePass( $password, substr( $hash, 0, 29 ) ) === $hash );\n\t}", "public static function verify($string, $hash) {\n return $hash === crypt($string, $hash);\n }", "public function passwordHashMatch(string $password, string $hashedPassword) : bool \r\n{\r\n if(password_verify($password, $hashedPassword)){\r\n \r\n $this->errorThrown = false;\r\n $this->errorPassword = false;\r\n return true;\r\n \r\n }\r\n\r\n $this->errorThrown = true;\r\n $this->errorPassword = true;\r\n return false;\r\n\r\n}", "public function passwordCheck($password, $hash) {\n\t\treturn password_verify($password, $hash);\n\t}", "function validate_password($password, $hash)\n\t{\n\t\t// Split the hash into 4 parts.\n\t\t\n\t\t$params = explode(':', $hash);\n\t\tif (count($params) < 4) return false;\n\t\t\n\t\t// Recalculate the hash and compare it with the original.\n\t\t\n\t\t$pbkdf2 = base64_decode($params[3]);\n\t\t$pbkdf2_check = pbkdf2_default($params[0], $password, $params[2], (int)$params[1], strlen($pbkdf2));\n\t\treturn slow_equals($pbkdf2, $pbkdf2_check);\n\t}", "function ck_password($password, $hash) {\n if (password_verify($password, $hash))\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "private function verify($password,$hash)\n {\n $password = $this->hash($password);\n return $password == $hash;\n }", "public function VerifyHash($pass, $hash){\n $filteredHash = end(explode(\"||\", $hash)); // Filter the hash from database and give the real hash\n return password_verify($pass, $filteredHash); \n }", "function password_check($password, $storedHash){\n return (password_verify($password, $storedHash));\n }", "public static function verifyPassword($username,$password,$hash)\n {\n $result = false;\n \tif (password_verify($username.$password, $hash)) {\n $result = true; \n }\n return $result;\n }", "public static function fnVerifyPassword($sPassword, $sHash){\n if(password_verify($sPassword.self::$_peber, $sHash))\n return true;\n else\n return false;\n }", "public function verify(string $string, string $hash): bool;", "function check_password($password, $hash)\n{\n //$hash == crypt($password, $hash)\n return hash_equals($hash, crypt($password, $hash));\n}", "function check($password, $hash) {\n $salt = substr($hash, 0, 64);\n $hash_check = $salt . $password;\n\n // Hash the password as we did before\n for ($i = 0; $i < 1000; $i++) {\n $hash_check = hash('sha256', $hash_check);\n }\n \n $hash_check = $salt . $hash_check;\n\n if ($hash_check == $hash) {\n return true;\n }\n else {\n return false;\n }\n }", "public static function verify($password, $hash)\n {\n return password_verify($password, $hash);\n }", "public static function verify($password, $hash)\n {\n return \\password_verify($password, $hash);\n }", "public function testHashVerifyPositive()\n {\n $string = \"MY_PASSWORD\";\n $hash = BCrypt::hash($string);\n $this->assertTrue(\n BCrypt::verify($string, $hash)\n );\n }", "public static function verify($password, $hash)\n\t{\n\t\treturn password_verify($password, $hash);\n\t}", "function verifyPassword($password_string, $hash_value) {\n $value = false;\n\n\n if (password_verify($password_string, $hash_value)) {\n $value = true;\n } else {\n $value = false;\n }\n\n return $value;\n}", "public static function check($text, $hash)\n {\n return password_verify($text, $hash);\n }", "public static function check_password($hash, $password) {\n \n $full_salt = substr($hash, 0, 29);\n \n $new_hash = crypt($password, $full_salt);\n \n return ($hash === $new_hash);\n }", "public static function phpassHashCheck($string, $hash)\n\t{\n\t\t//if ( !class_exists('Hash') )\n\t\t//\treturn FALSE;\n\t\t\n\t\t$check = Hash::CheckPassword($string, $hash);\n\t\t\n\t\tif (!$check) {\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\treturn TRUE;\n\t\t}\n\t}", "function check_password($password, $dbhash)\n{\n\t$salt = substr($dbhash, 0, 64);\n\n\t// get the SHA256 hash\n\t$valid_hash = substr($dbhash, 64, 64);\n\n\t// hash the password\n\t$test_hash = hash(\"sha256\", $password . $salt);\n\n\t// test\n\treturn $test_hash === $valid_hash;\n}", "public static function passwordVerify($password, $hash)\n {\n return (true === password_verify($password, $hash));\n }", "public function verifyPassword(string $password) {\n\t\t$hash = $this->passwordHash;\n\n\t\treturn ($hash === crypt($password, $hash));\n\t}", "private static function check_password($hash, $password) {\n $full_salt = substr($hash, 0, 29);\n $new_hash = crypt($password, $full_salt);\n return ($hash == $new_hash);\n }", "public function verifyHashedPassword($hashedPassword, $providedPassword);", "public function validate(string $password, string $hash): bool\n {\n return password_verify($password, $hash);\n }", "public function passwordMatch($hash, $password) {\n if (!is_null($hash)) {\n if (password_verify($password, $hash)) {\n return \"Hit\";\n } else {\n return \"Found\";\n }\n } elseif ($hash != \"Error\") {\n return \"Miss\";\n } else {\n return \"Error\";\n }\n }", "public static function verifyPassword($raw, $hash)\n {\n return password_verify($raw, $hash);\n }", "function pluVerify($plushie,$hash){return password_verify($plushie,$hash);}", "function verify($password, $hashedPassword) {\n return crypt($password, $hashedPassword) == $hashedPassword;\n}", "public static function verify(string $password, string $hash): bool\n {\n $hash = self::parse($hash);\n return $hash->isLegacy\n ? self::verifyLegacy($password, $hash->hashData)\n : password_verify($password, $hash->hashData);\n }", "function yourls_phpass_check( $password, $hash ) {\n\treturn password_verify($password, $hash);\n}", "public function validatePasswordHash($password, $hash) {\n if (!is_string($password))\n \t $password = '';\n\n return password_verify($password, $hash);\n }", "public function hashPassword($password);", "public static function checkPass($hash, $password)\n {\n $bcrypt = new Bcrypt();\n return $bcrypt->verify($password, $hash);\n }", "private function checkPass($hash, $salt, $password)\n {\n return hash(\"whirlpool\", $salt . $password) === $hash;\n }", "function verify_password($password, $passwordHash)\n {\n //crypt($string, $salt) —- Note, we are letting blowfish determine the key from hash. It's smart enough to do that :)\n if (crypt($password, $passwordHash) == $passwordHash)\n {\n //password is correct\n return true;\n }\n else\n {\n //password is incorrect\n return false;\n }\n }", "function comparePassword( $password, $hash ) {\n $salt = substr($hash, 0, 8);\n return $hash == getPasswordHash( $salt, $password );\n}", "function phpbb_check_hash($password, $hash)\n{\n\t$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n\tif (strlen($hash) == 34)\n\t{\n\t\treturn (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;\n\t}\n\n\treturn (md5($password) === $hash) ? true : false;\n}", "public static function checkHash($hash, $password) {\n return crypt($password, $hash) == $hash;\n }", "function pass_verify($query,$hash){\n\tglobal $salt;\n $hash='$2y$10$'.$hash; #This is algorithm specific\n $ask=$query.$salt;\n if(password_verify($ask,$hash)){\n return TRUE;\n }\n else{\n return FALSE;\n }\n}", "function verifyHash($password, $hashedPass){\n $verify = password_verify($password, $hashedPass);\n\n return $verify;\n }", "public function verify($pswd, $pswd_hash){\n return password_verify($pswd, $pswd_hash);\n }", "function verify_password($pass){\n return password_verify($pass, $this->password);\n \n }", "protected static function cmpPasswordHash($password, $hash)\n {\n return password_verify($password, $hash);\n }", "public static function verify($password, $hash)\n {\n return ($hash === self::hash($password, $hash));\n }", "function verifyPassword( $password )\n {\n return password_verify( $password, $this->password_hash );\n }", "function bithash_verify($pass, $hash){\n\t$md5 = md5($pass);\n\t//Truncate md5 in several locations and combine them.\n\t$trun_md5 = substr($md5, 1, 5).substr($md5, 3, 14).substr($md5, 12, 13);\n\t//Append prefix.\n\t$bithash_pass = '$Bh$'.$trun_md5;\n\t//Return a true or false value depending on whether the pass matches the hash.\n\treturn password_verify($bithash_pass, $hash);\n}", "public function verify($string, $hash, array $arguments = []);", "function verify($pw,$hash) {\n\t\t$val=crypt($pw,$hash);\n\t\t$len=strlen($val);\n\t\tif ($len!=strlen($hash) || $len<14)\n\t\t\treturn FALSE;\n\t\t$out=0;\n\t\tfor ($i=0;$i<$len;++$i)\n\t\t\t$out|=(ord($val[$i])^ord($hash[$i]));\n\t\treturn $out===0;\n\t}", "function password_check($password, $existing_hash)\n {\n\t$hash = crypt($password, $existing_hash);\n return $hash === $existing_hash;\n }", "protected function doPasswordsMatch($hash, $password)\n {\n $retVal = false;\n if(password_verify($password, $hash)) $retVal = true;\n \n #\n return $retVal;\n }", "public function testHashVerifyPositive()\n {\n $string = \"MY_PASSWORD\";\n $hash = Argon2id::hash($string);\n $this->assertTrue(\n Argon2id::verify($string, $hash)\n );\n }", "function phpbb_check_hash($password, $hash)\n{\n $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n\n if (strlen($hash) == 34)\n {\n return (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;\n }\n\n return (md5($password) === $hash) ? true : false;\n}", "private function checkHash($password, $hash) {\n // Works without retrieving/storing salt, crypt stores it in $hash\n // See http://www.yiiframework.com/wiki/425/use-crypt-for-password-storage/\n return ($hash === crypt($password, $hash));\n }", "public function checkHash($password, $passwordHash, $maxPassLength = 0)\n {\n return password_verify($password, $passwordHash);\n }", "public static function verify($password, $hash)\n {\n return self::getHasher()->verify($password, $hash);\n }", "public function verify(Hash $token, string $password): bool\n {\n return password_verify($password, $token->toString());\n }", "function phpbb_check_hash($password, $hash)\n{\n $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n if (strlen($hash) == 34)\n {\n return (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;\n }\n\n return (md5($password) === $hash) ? true : false;\n}", "function PasswordCheck($password, $existing_hash) {\r $hash = crypt($password, $existing_hash); \r if($hash == $existing_hash) { \r return true; \r } else { \r return false; \r } \r }", "public function checkUserPasswordHash(string $hash, string $password)\n {\n return Hash::check($hash, $password) ? true : false;\n }", "public function VerifyPassword($password, $hashedPW){\n $hp = $this->Hashword($password);\n $r = $hp===$hashedPW;\n $retval;\n if($r!=1){\n $r = 0;\n }\n return $r;\n }", "function password_check($password, $existing_hash) {\n $hash = crypt($password, $existing_hash);\n if($hash == $existing_hash) {\n return true;\n } else {\n return false;\n }\n }", "public function testPasswordHashAndFailVerify()\n {\n $hash = $this->password->hash('password');\n \n $this->assertFalse($this->password->verify('otherpassword', $hash));\n }", "public function validateHash($password, $hash)\n {\n $hashArr = explode(':', $hash);\n switch (count($hashArr)) {\n case 1:\n return $this->hash($password) === $hash;\n case 2:\n return $this->hash($hashArr[1] . $password) === $hashArr[0];\n\n }\n Mage::throwException('Invalid hash.');\n }", "public function passwordCheck($input, $password)\n {\n return Hash::check($password, $input);\n }", "function password_check($password, $existing_hash) {\n\t // existing hash contains format and salt at start\n\t $hash = crypt($password, $existing_hash);\n\t if ($hash === $existing_hash) {\n\t return true;\n\t }\n\t else {\n\t return false;\n\t }\n\t}", "function passwordCheck($password, $existing_hash) : bool\n {\n $hash = crypt($password, $existing_hash);\n\n if($hash === $existing_hash)\n {\n return true;\n }\n\n return false;\n }", "public function hashPassword(string $password): string;", "function pw_verify($password, $pwhash) \n{\n return password_verify($password, $pwhash);\n}", "function verify_password($password,$hashed_password){\n\t// extracting the undigested salt from the stored password value\n $salt = substr($hashed_password,-8);\n\tif($hashed_password== hash_password($password,$salt))\n\t\treturn true ; \n\telse \n\t\treturn false; \n// I love code reviews :]\n}", "function password_check($password, $existing_hash) {\n\t $hash = crypt($password, $existing_hash);\n\t if ($hash === $existing_hash) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t}", "function password_check($password, $existing_hash) {\n\t $hash = crypt($password, $existing_hash);\n\t if ($hash === $existing_hash) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t}", "function password_check($password, $existing_hash) {\n\t $hash = crypt($password, $existing_hash);\n\t if ($hash === $existing_hash) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t}", "function password_check($password, $existing_hash) {\n\t $hash = crypt($password, $existing_hash);\n\t if ($hash === $existing_hash) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t}", "static public function checkPasswordHash($password, $hash)\n\t{\n\t\t$salt = substr($hash, 29, 10);\n\n\t\tif (self::hashWithSalt($password, $salt) == $hash) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function password_check($password, $existing_hash) {\n $hash = crypt($password, $existing_hash);\n if ($hash === $existing_hash) {\n return true;\n } else {\n return false;\n }\n}", "function hashEncryptVerify($input, $hash)\n{\n if (password_verify($input, $hash)) {\n return true;\n } else {\n return false;\n }\n}", "function wp_check_password( $password, $hash, $user_id = '' ) {\n\n\tif ( strpos( $hash, WP_OLD_HASH_PREFIX ) === 0 ) {\n\n\t\tglobal $wp_hasher;\n\n\t\tif ( empty( $wp_hasher ) ) {\n\n\t\t\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\n\t\t\t$wp_hasher = new PasswordHash( 8, true );\n\n\t\t}\n\n\t\t$check = $wp_hasher->CheckPassword( $password, $hash );\n\n\t\tif ( $check && $user_id ) {\n\t\t\t$hash = wp_set_password( $password, $user_id );\n\t\t}\n\t}\n\n\t$check = password_verify( $password, $hash );\n\n\treturn apply_filters( 'check_password', $check, $password, $hash, $user_id );\n}", "public function checkPassword ($password, $hashPass, $salt)\n\t{\n\t\t//compare hashPass from database with hashed given password +salt\n\t\tif (strcmp($hashPass, hash(\"sha256\", $password.$salt))== 0)\n\t\t{\n\t\t\treturn true;\n\t\t} \n\t\telse\n\t\t{\n\t\t\t//die(\"HashPass: \".$hashPass.\"<br>Pass+Salt Hash: \".hash(\"sha256\",$password.$salt).\"<br>Password: \".$password.\"<br>Salt : \".$salt);\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.83578163", "0.8085599", "0.79460627", "0.7928682", "0.7873255", "0.7820014", "0.774856", "0.77288735", "0.77212775", "0.76449263", "0.7610624", "0.7591399", "0.7579986", "0.75727755", "0.7558698", "0.7542896", "0.7525957", "0.74758035", "0.74714714", "0.7466049", "0.7461148", "0.7442908", "0.7430016", "0.7418559", "0.74064976", "0.7394262", "0.739199", "0.737606", "0.7369524", "0.7368764", "0.7365142", "0.7365115", "0.7348192", "0.734708", "0.73194766", "0.7313038", "0.7307557", "0.7305758", "0.7304108", "0.7291854", "0.72882605", "0.72802556", "0.7276377", "0.7275372", "0.7264679", "0.7264234", "0.7261353", "0.7258985", "0.7258107", "0.72342396", "0.7231908", "0.721889", "0.72169256", "0.72026277", "0.7196499", "0.7187926", "0.71654034", "0.7160621", "0.7141627", "0.71364725", "0.71183294", "0.7104873", "0.7102463", "0.70995873", "0.70971483", "0.7093773", "0.7059026", "0.7048421", "0.7041688", "0.7032139", "0.70320404", "0.702937", "0.7022207", "0.702057", "0.70171726", "0.70104605", "0.6999332", "0.6998901", "0.69977665", "0.69934183", "0.6981543", "0.6978524", "0.69714427", "0.6969823", "0.6958678", "0.6957083", "0.69447374", "0.6943452", "0.69336057", "0.69303125", "0.69276863", "0.692612", "0.692612", "0.692612", "0.692612", "0.69134855", "0.6908146", "0.69032896", "0.6894632", "0.68932825" ]
0.8526068
0
Retourne l'URL publique'vers le fichier XSD.
Возвращает публичный URL файла XSD.
public function getFileExportXsdUrl() { $packageHandle = Package::getByID($this->c->pkgID)->getPackageHandle(); $fileExportName = $this->fileExportXsdName; $fileExportUrl = BASE_URL . DIR_REL. '/packages/' . $packageHandle . '/' . $fileExportName; return $fileExportUrl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFileExportXsdPath()\n {\n //détermine le chemin vers la racine du package\n $packagePath = Package::getByID($this->c->pkgID)->getPackagePath();\n\n $fileExportName = $this->fileExportXsdName;\n $fileExportUrl = $packagePath . '/' . $fileExportName;\n\n return $fileExportUrl;\n }", "public function getWsdlUrl() {}", "function getSchemaURL() {\n\t\treturn \"http://api.steampowered.com/IEconItems_570/GetSchemaURL/v0001/?key=\".APIKEY();\n\t}", "public function getXmlSourceUrl() {\n\t\t\n\t\tif ($this->xmlSourceUrl === '') {\n\t\t\t$this->xmlSourceUrl = 'https://' . $this->extConf->getExtConfArray()['host'] . '/' . $this->extConf->getExtConfArray()['mode'];\n\t\t}\n\t\treturn $this->xmlSourceUrl;\n\t}", "public function getXmlSourceUrl() {\n\t\t\n\t\tif ($this->xmlSourceUrl === '') {\n\t\t\t$this->xmlSourceUrl = 'http://' . $this->extConf->getExtConfArray()['host'] . '/' . $this->extConf->getExtConfArray()['mode'];\n\t\t}\n\t\treturn $this->xmlSourceUrl;\n\t}", "public function getDocumentUrl(): string;", "public function getURL();", "public function getURL();", "public function getURL();", "function getDocumentUrl()\n {\n if($this->etat > 0)\n return OW_URL.$this->type->repertoire.'/'.$this->infos->repertoire.'/';\n else\n return '';\n }", "public function getSchema()\n {\n return $this->urnResolver->getRealPath('urn:magesquare:module:MageSquare_Base:etc/less_to_css.xsd');\n }", "public function getUrl()\n {\n $subscription = new pm_Domain($this->subscriptionId);\n return 'http://' . $subscription->getName() . substr($this->path, strlen('/httpdocs'));\n }", "function get_publication_url()\r\n {\r\n return $this->get_url(array(self :: PARAM_ACTION => self :: ACTION_VIEW_MY_PUBLICATIONS), array(), false);\r\n }", "public function getFileExportXmlPath()\n {\n //détermine le chemin vers le fichier temporaire\n $tempPath = sys_get_temp_dir();\n\n $fileExportName = $this->fileExportXmlName;\n $fileExportUrl = $tempPath . '/' . $fileExportName;\n\n return $fileExportUrl;\n }", "protected function _getXsdPath()\n {\n return $this->componentRegistrar->getPath(ComponentRegistrar::LIBRARY, 'magento/framework')\n . '/DataObject/etc/fieldset_file.xsd';\n }", "function getXslFilename() {\n return HBO_PLUGIN_DIR. '/include/generate_payment_link.xsl';\n }", "function getContentUrl() {\n if ($this->iSubscriptionType == SubscriptionConstants::subscriptionType(\"DocumentSubscription\")) {\n return generateControllerUrl(\"viewDocument\", \"fDocumentID=$this->iExternalID\");\n } else if ($this->iSubscriptionType == SubscriptionConstants::subscriptionType(\"FolderSubscription\")) {\n return generateControllerUrl(\"browse\", \"fBrowseType=folder&fFolderID=$this->iExternalID\");\n }\n }", "function getContentUrl() {\n if ($this->iSubscriptionType == SubscriptionConstants::subscriptionType(\"DocumentSubscription\")) {\n return generateControllerUrl(\"viewDocument\", \"fDocumentId=$this->iExternalID\");\n } else if ($this->iSubscriptionType == SubscriptionConstants::subscriptionType(\"FolderSubscription\")) {\n return generateControllerUrl(\"browse\", \"fBrowseType=folder&fFolderId=$this->iExternalID\");\n }\n }", "function GetXmlUrl($forceAuto=false) {\n\n\t\tif(!$forceAuto && $this->GetOption(\"b_location_mode\")==\"manual\") {\n\t\t\treturn $this->GetOption(\"b_fileurl_manual\");\n\t\t} else {\n\t\t\treturn trailingslashit(get_bloginfo('siteurl')). $this->GetOption(\"b_filename\");\n\t\t}\n\t}", "public function getExternalUrl() {\n $path = str_replace('\\\\', '/', $this->getTarget());\n\n return $this->url('dam.get_file_download', [\n 'filepath' => $path,\n ], [\n 'absolute' => TRUE,\n ]);\n }", "public function getRelUrl():string;", "public function getUrl(): string\n {\n return $this->definition->formatUrl($this->values);\n }", "public function getXmlUrl(): string\n {\n if ($this->checkStatus()) {\n return $this->toArray()['xmlUrl'];\n }\n // Revert back to status if not done.\n return $this->getStatus();\n }", "protected function getAPIUrl() {\n\t\t// Use own API-URL if set\n\t\tif($this->getCustomAPIURL() !== null)\n\t\t\treturn $this->getCustomAPIURL();\n\n\t\t// todo check if up to date & if file exists\n\t\treturn self::getWSDLDirURL() . $this->getVersion() . '/geschaeftskundenversand-api-' . $this->getVersion() . '.wsdl';\n\t}", "public function getResourceURL()\n {\n \n }", "function getSchemaFilename() {\n\t\treturn 'native.xsd';\n\t}", "abstract public function getURL();", "public function getResourceUrl() {\n $path = '/content-hub/';\n $rewrite_localdomain = variable_get('content_hub_connector_rewrite_localdomain', 0);\n if ($this->getUuid()) {\n if ($rewrite_localdomain) {\n $url = url($path . $this->getCdf()->getType() . '/' . $this->getUuid(), array(\n 'base_url' => $rewrite_localdomain,\n 'absolute' => TRUE,\n ));\n }\n else {\n $url = url($path . $this->getCdf()->getType() . '/' . $this->getUuid(), array(\n 'absolute' => TRUE,\n ));\n }\n return $url;\n }\n return FALSE;\n }", "public function getUri() : string\n {\n\n // Lvd.\n $result = rtrim(str_replace('\\\\', '/', $this->settings['schemaSettingsUri']), '/') . '/';\n $result .= $this->settings['srcDir'];\n $result .= $this->model->getClass('parentClassName');\n $result .= '\\\\Core\\\\';\n $result .= $this->model->getClass('modelClassName');\n $result .= '.php';\n\n return $result;\n }", "public function getURL() {\n\t\treturn RELATIVE_WCF_DIR.$this->smileyPath;\n\t}", "function getInstallSchemaFile() {\n\t\treturn $this->getPluginPath() . '/' . 'schema.xml';\n\t}", "public function url(): string;", "public function getBaseUri(): string {\n return \"https://{$this->publication}.bbvms.com\";\n }", "public function getNamespaceUrl(string $namespace): string;", "public function getOryginalBundlePackageURL() {\n\t}", "function getURL() {\n\t\treturn Director::baseURL() . $this->getFilename();\n\t}", "public function getExternalURL(): ?string;", "function get_url( $file = '' ){\r\n if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {\r\n // Windows\r\n $content_dir = str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR );\r\n $content_url = str_replace( $content_dir, WP_CONTENT_URL, trailingslashit( dirname( $file ) ) );\r\n $url = str_replace( DIRECTORY_SEPARATOR, '/', $content_url );\r\n } else {\r\n $url = str_replace(\r\n array( WP_CONTENT_DIR, WP_PLUGIN_DIR ),\r\n array( WP_CONTENT_URL, WP_PLUGIN_URL ),\r\n trailingslashit( dirname( $file ) )\r\n );\r\n }\r\n return set_url_scheme( $url );\r\n }", "public function getFullUrl():string;", "private function getSchemaContents()\n {\n $schemaContents = file_get_contents(__DIR__.'/xliff-core-1.2-strict.xsd');\n\n $localSchemaPath = __DIR__.'/xml.xsd';\n $localSchemaUri = 'file:///'.implode('/', array_map('rawurlencode', explode('/', $localSchemaPath)));\n $remoteSchemaUri = 'http://www.w3.org/2001/xml.xsd';\n\n $modifiedSchemaContents = str_replace($remoteSchemaUri, $localSchemaUri, $schemaContents);\n\n return $modifiedSchemaContents;\n }", "public function getExportUrl();", "public function fileExportXsd($XSD)\n {\n $fileExportUrl = $this->getFileExportXsdPath();\n $filePointer = fopen($fileExportUrl, 'w');\n //add BOM to fix UTF-8 in Excel\n fputs($filePointer, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) ));\n fputs($filePointer, $XSD);\n fclose($filePointer);\n\n if (file_exists($fileExportUrl)) {\n $this->set('XSDExportUrl', $fileExportUrl);\n return true;\n } else {\n return false;\n }\n }", "protected function getProjectXFilePath()\n {\n return $this->getProjectFileUrl($this->projectFileName);\n }", "public function getFileUrl($fileName);", "public function getFileUrl($fileName);", "function buildUrl($packageName)\n{\n $url = 'https://github.com/'.$packageName.'/releases.atom';\n return $url;\n}", "public function getUrl() {\n if (empty($this->url)) {\n if ($this->isIcon()) {\n $this->url = $this->getDatastreamUrl($this->dsid);\n }\n else {\n $this->url = $this->getUrlFromRelsInt();\n if (empty($this->url)) {\n $this->url = $this->getUrlFromName();\n if (empty($this->url)) {\n $this->url = $this->getDefaultIconUrl();\n }\n }\n }\n }\n return $this->url;\n }", "public function getContentUrl();", "public function getContentUrl();", "private function buildFileUrl(){\n\t\treturn $this->buildDownloadUrl(self::WORKFLOW_FILE_URL, self::WORKFLOW_FILE_EXTENSION);\n\t}", "public function getUrl() {}", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "function getExternalUrl() {\n // Return the direct image.\n $parts = $this->parameters;\n return 'http://'. $parts['u'] . $this->base_url .'images/' . $parts['p'] .'/'. $parts['s'];\n }", "public function getFile_url()\n {\n return $this->file_url;\n }", "public function getDocUrl()\n {\n return $this->docUrl;\n }", "function rogue_display_svg_files_backend() {\r\n\r\n\t$url = '';\r\n\t$attachmentID = isset($_REQUEST['attachmentID']) ? $_REQUEST['attachmentID'] : '';\r\n\r\n\tif ($attachmentID) {\r\n\t\t$url = wp_get_attachment_url($attachmentID);\r\n\t}\r\n\techo $url;\r\n\r\n\tdie();\r\n}", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl(): string;", "public function getValidationUrl()\n {\n //return $this->getUrl('adminhtml/*/validate', ['_current' => true]);\n }", "function getUrl() {\r\n\t\treturn rex_getUrl($this->getId(),$this->getClang());\r\n\t}", "public function getUrlDTD(){\n\t\treturn $this->module->id.'/dtdMRJ/Admin';\n\t}", "public function getUrl()\n {\n return Yii::getAlias('@storageUrl/source/'.$this->path);\n }", "public function getFileUrl() {\n return $this->path;\n }", "function mbo_report_url($fname){\n $upload = wp_upload_dir();\n return $upload['baseurl'].\"/\".MBO_UPLOAD_XL_REPORT.\"/\".$fname;\n}", "public function importsToAbsUrl($schemaPath, $relPath = '')\n {\n $dom = new \\DOMDocument();\n $dom->load($schemaPath);\n\n $xpath = new \\DOMXPath($dom);\n $query = \"//*[local-name()='schema']/*[local-name()='import']\";\n $imports = $xpath->query($query);\n $urlParts = parse_url($this->getLocation());\n $rootUrl = $this->composeUrl($urlParts);\n $url = $rootUrl.$this->getPublicUrl().\"/\".basename($schemaPath);\n if (!is_object($imports->item(0))) {\n return $url;\n }\n\n $urlParts = parse_url($this->getLocation());\n $rootUrl = $this->composeUrl($urlParts);\n\n foreach ($imports as $import) {\n $scPath = realpath($relPath.DIRECTORY_SEPARATOR.$import->getAttribute('schemaLocation'));\n $copiedSchema = $this->copyToPublic($scPath, true);\n\n $schemaUrl = $rootUrl.$this->getPublicUrl().\"/\".basename($copiedSchema);\n $import->setAttribute('schemaLocation', $schemaUrl);\n\n $this->importsToAbsUrl($copiedSchema, dirname($scPath));\n }\n $dom->save($schemaPath);\n return $url;\n }", "public function getURI();", "public function url();", "public function url();", "public function url();", "public function getWSDLStoragePath();", "public function getInterdirePubliDocWeb() {\n return $this->interdirePubliDocWeb;\n }", "public function getUri(): string;", "protected function getSchema() {\n $schema = \"http\";\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {\n $schema = 'https';\n }\n return $schema;\n }", "function acf_get_url($filename = '') {}", "public function getUrl()\n {\n return str_replace($_SERVER['DOCUMENT_ROOT'], '', $this->getPath());\n }", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "public function get_xml_full_path() {\n return $this->has_xml() ? $this->settings['file_loc'] . $this->files['xml'] : false;\n }", "function getXslFilename() {\n return HBO_PLUGIN_DIR. '/include/lh_manual_charge.xsl';\n }" ]
[ "0.70158637", "0.64655286", "0.6269691", "0.60883385", "0.5947804", "0.5823806", "0.58054173", "0.58054173", "0.58054173", "0.57500637", "0.57299274", "0.571798", "0.5696914", "0.5674659", "0.56315386", "0.56171477", "0.5615036", "0.560202", "0.5596299", "0.5580766", "0.55741113", "0.55601174", "0.5514559", "0.5507496", "0.55005246", "0.5481776", "0.54804385", "0.5456978", "0.544934", "0.54414445", "0.5424683", "0.54221874", "0.54201245", "0.54043156", "0.53754985", "0.5374138", "0.5374069", "0.5372569", "0.5357829", "0.53374946", "0.53315073", "0.53283066", "0.532738", "0.53261065", "0.53261065", "0.53088206", "0.52980155", "0.52943397", "0.52943397", "0.5294015", "0.5291527", "0.52843225", "0.52843225", "0.52843225", "0.52843225", "0.52843225", "0.52843225", "0.52843225", "0.52843225", "0.52843225", "0.52843225", "0.52843225", "0.52843225", "0.5281383", "0.5281207", "0.52736074", "0.5265003", "0.5262005", "0.5262005", "0.5262005", "0.5262005", "0.5258537", "0.52557504", "0.52458954", "0.52422416", "0.52212834", "0.5211793", "0.52060837", "0.5191496", "0.51893425", "0.51893425", "0.51893425", "0.5186442", "0.5184277", "0.51769847", "0.51725495", "0.51725256", "0.5170976", "0.5165399", "0.5165399", "0.5165399", "0.5165399", "0.5165399", "0.5165399", "0.5165399", "0.5165399", "0.5165399", "0.5165399", "0.5163156", "0.5160336" ]
0.739834
0
Exporte le fichier XSD.
Экспортируйте файл XSD.
public function fileExportXsd($XSD) { $fileExportUrl = $this->getFileExportXsdPath(); $filePointer = fopen($fileExportUrl, 'w'); //add BOM to fix UTF-8 in Excel fputs($filePointer, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) )); fputs($filePointer, $XSD); fclose($filePointer); if (file_exists($fileExportUrl)) { $this->set('XSDExportUrl', $fileExportUrl); return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function exportXmlAction()\n {\n $fileName = 'docx.xml';\n $content = $this->getLayout()->createBlock('bs_docx/adminhtml_docx_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportPackage(SchemaPackage $package): void\n {\n }", "public function fileExportXml($xml)\n {\n // Todo : vérifier les droits d'écriture et gérer les cas d'erreur\n // Todo : vérifier l'utilité du BOM fix\n\n $fileExportUrl = $this->getFileExportXmlPath();\n $filePointer = fopen($fileExportUrl, 'w');\n //add BOM to fix UTF-8 in Excel\n fputs($filePointer, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) ));\n fputs($filePointer, $xml);\n fclose($filePointer);\n\n if (file_exists($fileExportUrl)) {\n return true;\n } else {\n return false;\n }\n }", "public function exportXmlAction()\n {\n $fileName = 'exam.xml';\n $content = $this->getLayout()->createBlock('bs_docwise/adminhtml_exam_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportXmlAction(){\r\n\t\t$fileName = 'entry.xml';\r\n\t\t$content\t= $this->getLayout()->createBlock('autoimport/adminhtml_entry_grid')->getXml();\r\n\t\t$this->_prepareDownloadResponse($fileName, $content);\r\n\t}", "protected function saveFile()\n {\n $domxml = new \\DOMDocument('1.0');\n $domxml->preserveWhiteSpace = false;\n $domxml->formatOutput = true;\n $domxml->loadXML($this->xml->asXML());\n $domxml->save($this->xmlFilePath);\n }", "public function exportXmlAction() {\r\n $fileName = 'lookbook.xml';\r\n $content = $this->getLayout()->createBlock('lookbook/adminhtml_lookbook_grid')\r\n ->getXml();\r\n\r\n $this->_sendUploadResponse($fileName, $content);\r\n }", "public function exportXmlAction()\n {\n $fileName = 'kpi.xml';\n $content = $this->getLayout()->createBlock('bs_kpi/adminhtml_kpi_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportXmlAction()\n {\n $fileName = 'cofa.xml';\n $content = $this->getLayout()->createBlock('bs_cofa/adminhtml_cofa_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public static function exportXML()\r\n {\r\n $productos = self::findAll();\r\n $xml=\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\r\n $xml.=\"<productos>\\n\";\r\n foreach ($productos as $producto) {\r\n $xml.=\"<producto>\\n\";\r\n foreach ($producto as $key=>$value) {\r\n $xml.=\"<$key>\".$value.\"</$key>\\n\"; \r\n } \r\n $xml.=\"</producto>\\n\";\r\n }\r\n $xml .= \"</productos>\";\r\n return $xml;\r\n }", "public function exportXmlAction()\n {\n $this->_exportXmlAction('shipping_table_rates.xml', 'shippingtablerate/adminhtml_tablerate_grid');\n }", "function export_dasar()\n\t{\n\t\t$return = \"\";\n\t\t$return.=$this->_build_schema('tweb_penduduk', 'penduduk');\n\t\t$return.=$this->_build_schema('tweb_keluarga', 'keluarga');\n\t\t$return.=$this->_build_schema('tweb_wil_clusterdesa', 'cluster');\n\n\t\tHeader('Content-type: application/octet-stream');\n\t\tHeader('Content-Disposition: attachment; filename=data_dasar('.date(\"d-m-Y\").').sid');\n\t\techo $return;\n\t}", "function buildExportFile()\n\t{\n\t\tswitch ($this->mode)\n\t\t{\n\t\t\tdefault:\n\t\t\t\treturn $this->buildExportFileXML();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function getFileExportXsdPath()\n {\n //détermine le chemin vers la racine du package\n $packagePath = Package::getByID($this->c->pkgID)->getPackagePath();\n\n $fileExportName = $this->fileExportXsdName;\n $fileExportUrl = $packagePath . '/' . $fileExportName;\n\n return $fileExportUrl;\n }", "public function exportXmlAction(){\n $fileName = 'netgopricereminder.xml';\n $content = $this->getLayout()->createBlock('netgo_pricereminder/adminhtml_netgopricereminder_grid')->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportXlxAction()\n {\n BootstrapConstantsFunctions::constantsUploadAndRootPathForDefaultModule($scriptFileName = '');\n $localeForFileName = LOCALE != \"\" ? \"-\".strtoupper(LOCALE) : \"-NL\";\n $localeForFolderName = LOCALE != \"\" ? LOCALE : \"\";\n $file = UPLOAD_DATA_FOLDER_EXCEL_PATH .$localeForFolderName.'/excels/offerList'.$localeForFileName.'.csv';\n $fileName = $this->view->translate($file);\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n $this->getResponse()\n ->setHeader('Content-Disposition', 'attachment;filename=' . basename($fileName))\n ->setHeader('Content-type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')\n ->setHeader('Cache-Control', 'max-age=0')\n ->setBody(file_get_contents($fileName));\n }", "public function exportXmlAction()\n {\n $fileName = 'subject.xml';\n $content = $this->getLayout()->createBlock('bs_subject/adminhtml_subject_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportXmlAction() {\r\n $fileName = 'pincodes.xml';\r\n $content = $this->getLayout()->createBlock('lastmile/adminhtml_pincode_grid')\r\n ->getXml();\r\n\r\n $this->_sendUploadResponse($fileName, $content);\r\n }", "public function exportXmlAction()\n {\n $fileName = 'coursecost.xml';\n $content = $this->getLayout()->createBlock('bs_coursecost/adminhtml_coursecost_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function testPostExport_xml_workbook()\n {\n $assemblyTestXlsx = \"assemblytest.xlsx\";\n $book1Xlsx = \"Book1.xlsx\";\n\n $format = \"xml\";\n $objectType = \"workbook\";\n\n $mapFiles = array ();\n $mapFiles[$assemblyTestXlsx] = CellsApiTestBase::getfullfilename($assemblyTestXlsx);\n $mapFiles[$book1Xlsx] = CellsApiTestBase::getfullfilename($book1Xlsx);\n \n $request = new PostExportRequest();\n $request->setFile( $mapFiles);\n $request->setObjectType( $objectType);\n $request->setFormat( $format);\n $this->instance->postExport($request);\n }", "function buildExportFileXML()\n\t{\n\t\tglobal $ilBench;\n\n\t\t$ilBench->start(\"SurveyExport\", \"buildExportFile\");\n\n\t\t// create directories\n\t\t$this->survey_obj->createExportDirectory();\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\tilUtil::makeDir($this->export_dir.\"/\".$this->subdir);\n\t\tilUtil::makeDir($this->export_dir.\"/\".$this->subdir.\"/objects\");\n\n\t\t// get Log File\n\t\t$expDir = $this->survey_obj->getExportDirectory();\n\t\tinclude_once \"./Services/Logging/classes/class.ilLog.php\";\n\t\t$expLog = new ilLog($expDir, \"export.log\");\n\t\t$expLog->delete();\n\t\t$expLog->setLogFormat(\"\");\n\t\t$expLog->write(date(\"[y-m-d H:i:s] \").\"Start Export\");\n\n\t\t// write xml file\n\t\t$xmlFile = fopen($this->export_dir.\"/\".$this->subdir.\"/\".$this->filename, \"w\");\n\t\tfwrite($xmlFile, $this->survey_obj->toXML());\n\t\tfclose($xmlFile);\n\n\t\t// add media objects which were added with tiny mce\n\t\t$this->exportXHTMLMediaObjects($this->export_dir.\"/\".$this->subdir);\n\n\t\t// zip the file\n\t\t$ilBench->start(\"SurveyExport\", \"buildExportFileXML_zipFile\");\n\t\tilUtil::zip($this->export_dir.\"/\".$this->subdir, $this->export_dir.\"/\".$this->subdir.\".zip\");\n\t\t$ilBench->stop(\"SurveyExport\", \"buildExportFileXML_zipFile\");\n\n\t\tif (@file_exists($this->export_dir.\"/\".$this->subdir.\".zip\"))\n\t\t{\n\t\t\t// remove export directory and contents\n\t\t\tif (@is_dir($this->export_dir.\"/\".$this->subdir))\n\t\t\t{\n\t\t\t\tilUtil::delDir($this->export_dir.\"/\".$this->subdir);\n\t\t\t}\n\t\t}\n\t\t$expLog->write(date(\"[y-m-d H:i:s] \").\"Finished Export\");\n\t\t$ilBench->stop(\"SurveyExport\", \"buildExportFile\");\n\n\t\treturn $this->export_dir.\"/\".$this->subdir.\".zip\";\n\t}", "public function exportXmlAction()\n {\n $fileName = 'routine.xml';\n $content = $this->getLayout()->createBlock('bs_routine/adminhtml_routine_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportXmlAction()\n {\n $fileName = 'app.xml';\n $content = $this->getLayout()->createBlock('share_refund/adminhtml_app_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportXmlAction() {\n $fileName = 'madapter.xml';\n $content = $this->getLayout()->createBlock('madapter/adminhtml_madapter_grid')->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "function export_file_extension() {\r\n // override default type so extension is .xml\r\n return \".xml\";\r\n }", "function export_file_extension() {\r\n // override default type so extension is .xml\r\n return \".xml\";\r\n }", "function export_file_extension() {\r\n // override default type so extension is .xml\r\n return \".xml\";\r\n }", "function export_file_extension() {\r\n // override default type so extension is .xml\r\n return \".xml\";\r\n }", "function export_file_extension() {\r\n // override default type so extension is .xml\r\n return \".xml\";\r\n }", "function export_file_extension() {\r\n // override default type so extension is .xml\r\n return \".xml\";\r\n }", "public function exportXmlAction()\n {\n $fileName = 'best.xml';\n $content = $this->getLayout()->createBlock('weber_best/adminhtml_best_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function export()\r\n {\r\n $dom = new DOMDocument();\r\n $dom->loadXML(\"<surcharges></surcharges>\");\r\n\r\n foreach ($this->_surcharges as $surcharge)\r\n {\r\n $surchargeEl = $dom->createElement('surcharge');\r\n $exportFieldsCount = 0;\r\n foreach ($this->_exportFields as $field)\r\n {\r\n if (isset($surcharge[$field]) && $exportFieldsCount < 2)\r\n {\r\n $exportFieldsCount++;\r\n $node = $dom->createElement($field, $surcharge[$field]);\r\n $surchargeEl->appendChild($node);\r\n }\r\n }\r\n $dom->documentElement->appendChild($surchargeEl);\r\n }\r\n\r\n return $dom->saveXML($dom->documentElement);\r\n }", "public function generateXML();", "public function getFileExportXsdUrl()\n {\n $packageHandle = Package::getByID($this->c->pkgID)->getPackageHandle();\n\n $fileExportName = $this->fileExportXsdName;\n $fileExportUrl = BASE_URL . DIR_REL. '/packages/' . $packageHandle . '/' . $fileExportName;\n\n return $fileExportUrl;\n }", "public function exportSchema()\n {\n return [$this->hasIncludes, $this->declarations, $this->functions, $this->namespaces];\n }", "public function testPostExport_xml_worksheet()\n {\n $assemblyTestXlsx = \"assemblytest.xlsx\";\n $book1Xlsx = \"Book1.xlsx\";\n\n $format = \"xml\";\n $objectType = \"worksheet\";\n\n $mapFiles = array ();\n $mapFiles[$assemblyTestXlsx] = CellsApiTestBase::getfullfilename($assemblyTestXlsx);\n $mapFiles[$book1Xlsx] = CellsApiTestBase::getfullfilename($book1Xlsx);\n \n $request = new PostExportRequest();\n $request->setFile( $mapFiles);\n $request->setObjectType( $objectType);\n $request->setFormat( $format);\n $this->instance->postExport($request);\n }", "public function export(File $file);", "public function exportXmlAction() {\n $fileName = 'geoip.xml';\n $content = $this->getLayout()->createBlock('aydus_visitorlog/adminhtml_geoip_grid')->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function export();", "public function export();", "public function export();", "public function export();", "public function export();", "public function export() {\n\t\t$this->export_data();\n\t}", "public function exportXmlAction()\n {\n $fileName = 'ordersbycustomer.xml';\n $content = $this->getLayout()->createBlock('misc_productcustomers/adminhtml_catalog_product_edit_tab_customerslist')\n ->getExcelFile();\n\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function generate_file() {\n\t\tif ( 1 === $this->get_page() ) {\n\t\t\t@unlink( $this->get_file_path() ); // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_unlink, Generic.PHP.NoSilencedErrors.Discouraged,\n\t\t}\n\t\t$this->prepare_data_to_export();\n\t\t$xml_product_str = implode('', $this->get_xml_data());\n\t\t$xml_product_str = str_replace('<?xml version=\"1.0\" encoding=\"UTF-8\"?>', '', $xml_product_str);\n\t\t$this->write_xml_data( $xml_product_str );\n\t}", "public function get_export_public_schema()\n {\n }", "public function exportXmlAction() {\n $fileName = 'visitorlog.xml';\n $content = $this->getLayout()->createBlock('aydus_visitorlog/adminhtml_visitorlog_grid')->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "function doExport(&$dbHandler,$filename)\r\n{\r\n\t$tables = tlObjectWithDB::getDBTables(array('custom_fields','cfield_node_types'));\r\n $adodbXML = new ADODB_XML(\"1.0\", \"ISO-8859-1\");\r\n $sql = \" SELECT name,label,type,possible_values,default_value,valid_regexp, \" .\r\n\t\t \" length_min,length_max,show_on_design,enable_on_design,show_on_execution,\" .\r\n\t\t \" enable_on_execution,show_on_testplan_design,enable_on_testplan_design, \" .\r\n\t\t \" node_type_id \" .\r\n// \t\t \" FROM {$tables['custom_fields']} CF,{$tables['cfield_node_types']} \" .\t\t \r\n \" FROM \" . $dbHandler->get_table('custom_fields').\" CF,\" . $dbHandler->get_table('cfield_node_types').\" \" . \r\n\t\t \" WHERE CF.id=field_id \";\r\n \r\n $adodbXML->setRootTagName('custom_fields');\r\n $adodbXML->setRowTagName('custom_field');\r\n $content = $adodbXML->ConvertToXMLString($dbHandler->db, $sql);\r\n downloadContentsToFile($content,$filename);\r\n\texit();\r\n}", "public function export()\n {\n }", "function exportData() {\n\t\t$out = \"<?xml version='1.0'?>\\n\";\n\t\t$out .= \"<!DOCTYPE recipe SYSTEM \\\"phprecipebook.dtd\\\">\\n\";\n\t\t$out .= \"<RECIPES>\\n\";\n\t\tforeach ($this->exportRecipes as $recipeObj) {\n\t\t\t$out .= $this->getBody($recipeObj);\n\t\t}\n\t\t$out .= \"</RECIPES>\\n\";\n\t\t// Save the XML data to a session variable for later download\n\t\t$_SESSION[$this->sessionVar] = $out;\n\t\t// Translate the special characters to HTML save types so it can be printed\n\t\t$out = str_replace( \"<\", '&lt;', $out);\n\t\t$out = str_replace( \">\", '&gt;', $out);\n\t\t$out = str_replace( \"&\", '&amp;', $out);\n\t\treturn $out;\n\t}", "public function export()\n { \n // When there is no class name, no file has to be written to disk\n if(!$this->name) {\n return;\n }\n \n if($this->getFormBuilder()) {\n foreach($this->getFormBuilder()->getElements() as $name => $element) {\n $this->postAddElement($name, $element);\n $this->postBuildElement($name, $element);\n }\n }\n \n $this->getBlueprint()->build(DB::connection(), DB::connection()->getSchemaGrammar());\n\n \n foreach ($this->relations as $relation) {\n $relation->export();\n }\n\n\t\treturn $this;\n }", "public function exportXmlAction()\n {\n $fileName = 'notification.xml';\n $content = $this->getLayout()->createBlock('webspeaks_notifycustomer/adminhtml_notification_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function toXML(){\n header('content-type: text/xml');\n echo \"<Produto><nome>\". $this->nome .\"</nome><valor>\". $this->valor .\"</valor></Produto>\";\n }", "public function xslAction(){\n die(file_get_contents(dirname(__FILE__).\"/../Libs/xsl/wsdl-viewer.xsl\"));\n }", "private function saveToXml() {\n\t\t\n\t\t// XML-Object\n\t\t$xml = new LegosXmlWriter ();\n\t\t\n\t\t// Name Worksheet\n\t\t$xml->setWorksheetName ( \"Maintenance Tows $this->from_str\" );\n\t\t\n\t\t$i = 0;\n\t\tforeach ( $this->mainTows as $maint ) {\n\t\t\t\n\t\t\t++ $i;\n\t\t\t$xml->writeData ( \"Maint-Tow Start\", $i, 1 );\n\t\t\t$xml->writeData ( $maint->maintStartDate, $i, 2 );\n\t\t\t\n\t\t\t++ $i;\n\t\t\t$xml->writeData ( \"Maint-Tow End\", $i, 1 );\n\t\t\t$xml->writeData ( $maint->maintEndDate, $i, 2 );\n\t\t\t\n\t\t\t++ $i;\n\t\t\t$xml->writeData ( \"Maint TIME\", $i, 1 );\n\t\t\t$xml->writeData ($maint->maintTotalTime, $i, 2 );\n\t\t\t\n\t\t\t++ $i;\n\t\t\t$xml->writeData ( \"Left Engine Fuel\", $i, 1 );\n\t\t\t$xml->writeData ( $maint->leftEngineFuel, $i, 2 );\n\t\t\t\n\t\t\t++ $i;\n\t\t\t$xml->writeData ( \"Right Engine Fuel\", $i, 1 );\n\t\t\t$xml->writeData ( $maint->rightEngineFuel, $i, 2 );\n\t\t\t\n\t\t\t++ $i;\n\t\t}\n\t\t\n\t\t$exportFilename = \"Export_Mission_$this->missionId \" . date ( 'Y-m-d h:i:s' ) . '.xls';\n\t\t\n\t\tfile_put_contents ( sfConfig::get ( 'app_export_path' ) . \"/\" . $exportFilename, $xml->getFile () );\n\t\t\n\t\treturn $exportFilename;\n\t}", "function exportStructureToFile(StructureElementInterface $structure,\n\t\t$filename);", "abstract public function __toXml();", "public function exportAction()\n {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('AppBundle:SortieCaisse')->findAll();\n $date = new \\DateTime(\"now\");\n $phpExcelObject = $this->get('phpexcel')->createPHPExcelObject();\n $phpExcelObject->getProperties()->setCreator(\"2SInnovation\")\n ->setTitle(\"SortieCaisse\".$date->format('Y-m-d H:i:s'));\n $this->writeRapport($phpExcelObject, $entities);\n $writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');\n $response = $this->get('phpexcel')->createStreamedResponse($writer);\n $filename = 'SortieCaisse'.$date->format('Y_m_d_H_i_s').'.xls';\n $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');\n $response->headers->set('Content-Disposition', 'attachment;filename='.$filename);\n $response->headers->set('Pragma', 'public');\n $response->headers->set('Cache-Control', 'maxage=1');\n return $response; \n }", "function transformers_actions_xml_export($xml) {\n if (get_class($xml) == 'DOMNode') {\n $doc = new DOMDocument();\n $doc->appendChild($xml);\n }\n elseif (get_class($xml) == 'DOMDocument') {\n $doc = $xml;\n }\n else {\n // TODO: throw error.\n }\n $string = $doc->saveXML();\n return array('xml_text' => $string);\n}", "public function toXml();", "public function export()\r\n\t{\r\n\t\t// Get data\r\n\t\t$metaModel = BluApplication::getModel('meta');\r\n\t\t$exportData = $metaModel->exportLanguageMetaValues();\r\n\r\n\t\t// Build CSV\r\n\t\t$exportFile = new Csv(array('Category ID', 'Name', 'Description', 'Keywords (comma separated)'));\r\n\t\tif (!empty($exportData)) {\r\n\t\t\tforeach ($exportData as $valueId => $langValue) {\r\n\t\t\t\t$exportFile->appendRow($langValue);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Output\r\n\t\t$this->_doc->setFormat('raw');\r\n\t\t$this->_doc->setMimeType('text/csv');\r\n\t\t$this->_doc->setDisposition('attachment; file=\"languageMetaValuesExport-'.date('Ymd').'.csv\"');\r\n\t\t$exportFile->output();\r\n\t}", "public abstract function exportToXML($root, &$xmlMapping, $fieldID);", "public function expandExportFile(\\SimpleXMLElement $xml)\n {\n Modules\\ImportExport\\Export\\PodcastExporter::exportTable($xml, 'contributors', 'contributor', '\\Podlove\\Modules\\Contributors\\Model\\Contributor');\n Modules\\ImportExport\\Export\\PodcastExporter::exportTable($xml, 'contributor-groups', 'contributor-group', '\\Podlove\\Modules\\Contributors\\Model\\ContributorGroup');\n Modules\\ImportExport\\Export\\PodcastExporter::exportTable($xml, 'contributor-roles', 'contributor-role', '\\Podlove\\Modules\\Contributors\\Model\\ContributorRole');\n Modules\\ImportExport\\Export\\PodcastExporter::exportTable($xml, 'contributor-episode-contributions', 'contributor-episode-contribution', '\\Podlove\\Modules\\Contributors\\Model\\EpisodeContribution');\n Modules\\ImportExport\\Export\\PodcastExporter::exportTable($xml, 'contributor-show-contributions', 'contributor-show-contribution', '\\Podlove\\Modules\\Contributors\\Model\\ShowContribution');\n }", "public function exportXmlAction() {\n $fileName = 'adjustment.xml';\n $content = $this->getLayout()\n ->createBlock('inventoryplus/adminhtml_adjuststock_listadjuststock_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function wsdlAction(){\n header(\"Content-Type: text/xml\");\n $uri = $this->getRequest()->getUri();\n $soapURL = sprintf('%s://%s%s', $uri->getScheme(), $uri->getHost(), dirname($uri->getPath()));\n \n $autodiscover = new AutoDiscover();\n $autodiscover->setComplexTypeStrategy(new SoapDoctrineArrayOfTypeComplex());\n $autodiscover->setClass('Onyx\\Service\\Soap');\n \n //$autodiscover->setBindingStyle(array('style' => 'document'));\n //$autodiscover->setOperationBodyStyle(array('use' => 'literal'));\n $autodiscover->setUri($soapURL);\n $autodiscover->setServiceName(\"Onyx\");\n \n $xml = $autodiscover->toXml();\n \n // Append the stylesheet\n $document = new \\DOMDocument(\"1.0\", \"UTF-8\");\n if($document->loadXML($xml)):\n $xpath = new \\DOMXPath($document);\n $document->insertBefore($document->createProcessingInstruction(\"xml-stylesheet\",'type=\"text/xsl\" href=\"xsl\"'), $xpath->evaluate('/*[1]')->item(0)); \n $xml = $document->saveXML();\n endif;\n \n die($xml);\n }", "public function exportsalestaxExcelAction()\r\n {\r\n Mage::register('report_filter_order_tax_report',1);\r\n \r\n $fileName = 'salestax.xml';\r\n $grid = $this->getLayout()->createBlock('newreports/adminhtml_salesreport_tax_grid');\r\n $this->_initReportAction($grid);\r\n $this->_prepareDownloadResponse($fileName, $grid->getExcel($fileName));\r\n }", "public function export(Request $request){\n \t$this->validate($request, [ \n \t\t'name' => 'bail|required|string',\n \t\t'extension' => 'bail|required|string|in:xlsx,csv'\n \t]);\n\n \t// 2. Le nom du fichier avec l'extension : .xlsx ou .csv\n \t$file_name = $request->name.\".\".$request->extension;\n\n \t// 3. On récupère données de la table \"clients\"\n \t$clients = Client::select(\"name\", \"email\", \"phone\", \"adress\")->get();\n\n \t// 4. $writer : Objet Spatie\\SimpleExcel\\SimpleExcelWriter\n \t$writer = SimpleExcelWriter::streamDownload($file_name);\n\n \t\t// 5. On insère toutes les lignes au fichier Excel $file_name\n \t$writer->addRows($clients->toArray());\n\n // 6. Lancer le téléchargement du fichier\n $writer->toBrowser();\n \n\n\n }", "public function createXML() {}", "public function exportExcelAction()\n {\n $fileName = 'docx.xls';\n $content = $this->getLayout()->createBlock('bs_docx/adminhtml_docx_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "function generateXML ($filename) {\n\n // deliver header (as recommended in php manual)\n header(\"Content-Type: application/vnd.ms-excel; charset=UTF-8\");\n header(\"Content-Disposition: inline; filename=\\\"\" . $filename . \".xls\\\"\");\n\n // print out document to the browser\n // need to use stripslashes for the damn \">\"\n echo stripslashes ($this->header);\n echo \"\\n<Worksheet ss:Name=\\\"\" . $this->worksheet_title . \"\\\">\\n<Table>\\n\";\n echo \"<Column ss:Index=\\\"1\\\" ss:AutoFitWidth=\\\"0\\\" ss:Width=\\\"110\\\"/>\\n\";\n echo implode (\"\\n\", $this->lines);\n echo \"</Table>\\n</Worksheet>\\n\";\n echo $this->footer;\n\n }", "function reporteFacturaXML()\r\n\t{\r\n\r\n\t\t$this->objFunc = $this->create('MODCajero');\r\n\t\t$this->res = $this->objFunc->listarFactura($this->objParam);\r\n\r\n\r\n\t\t$xml_recuperado = $this->res->datos[0]['xml_impuestos'];\r\n\r\n\t\t//var_dump(\"aqui la respuesta va ser\",$this->res->datos[0]['xml_impuestos']);exit;\r\n\r\n\r\n\t\t$nombreArchivo = $this->crearArchivoXML($xml_recuperado);\r\n\r\n\t\t$this->mensajeExito=new Mensaje();\r\n\t\t$this->mensajeExito->setMensaje('EXITO','Reporte.php','Se genero con exito el archivo LCV '.$nombreArchivo, 'Se genero con exito el archivo LCV '.$nombreArchivo,'control');\r\n\r\n\r\n\t\t$this->mensajeExito->setArchivoGenerado($nombreArchivo);\r\n\t\t$this->mensajeExito->imprimirRespuesta($this->mensajeExito->generarJson());\r\n\t}", "public function exportConfiguration() {}", "function xml_save( $filename )\n\t{\n\t\tif ( $this->xml->xml_document )\n\t\t{\n\t\t\tif ( $FH = @fopen( $filename, 'wb' ) )\n\t\t\t{\n\t\t\t\t@fwrite( $FH, $this->xml->xml_document );\n\t\t\t\t@fclose( $FH );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->error_number = '003';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error_number = '004';\n\t\t}\n\t}", "public function exportExcelAction_()\r\n{\r\n\t$fileName = 'plans.xml';\r\n\t$grid = $this->getLayout()->createBlock('pagarme/adminhtml_plans_grid');\r\n\t$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\r\n}", "public function generate()\n {\n $this->beforeGeneration();\n\n foreach($this->XSDMap as $fhirElementName=>$mapEntry)\n {\n $classTemplate = ClassGenerator::buildFHIRElementClassTemplate($this->XSDMap, $mapEntry);\n\n FileUtils::createDirsFromNS($this->outputPath, $classTemplate->getNamespace(), $this->logger);\n\n // Generate class file\n $classTemplate->writeToFile($this->outputPath);\n\n $this->_mapTemplate->addEntry($classTemplate);\n $this->_autoloadMap->addPHPFHIRClassEntry($classTemplate);\n }\n\n $this->afterGeneration();\n }", "function export($action, $asFilename) {\n\n\t\t\tif ( 'csv' == $action ) {\n\n\t\t\t\theader( 'Content-Type: text/csv' );\n\t\t\t\theader( 'Content-Disposition: attachment;filename=\"'.$asFilename.'.csv\"' );\n\t\t\t\t$fp = fopen( 'php://output', 'w' );\n\n\t\t\t\tif ( ! empty( $this->data ) ) {\n\t\t\t\t\t$csv_array = $this->columns;\n\t\t\t\t\tfputcsv( $fp, $csv_array );\n\t\t\t\t\tforeach ( $this->data as $key => $result ) {\n\t\t\t\t\t\tfputcsv( $fp, array_values( $result ), ',', '\"' );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfclose( $fp );\n\n\t\t\t} elseif ( 'excel' == $action ) {\n\t\t\t\theader( 'Content-Type: application/xls' );\n\t\t\t\theader( 'Content-Disposition: attachment; filename=\"'.$asFilename.'.xls\"' );\n\t\t\t\tif ( ! empty( $this->data ) ) {\n\t\t\t\t\t$separator = \"\\t\";\n\t\t\t\t\techo implode( $separator,$this->columns ).\"\\n\";\n\t\t\t\t\tforeach ( $this->data as $key => $result ) {\n\t\t\t\t\t\techo implode( $separator,$result ).\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ( 'xml' == $action ) {\n\t\t\t\theader( 'Content-type: text/xml' );\n\t\t\t\theader( 'Content-Disposition: attachment; filename=\"'.$asFilename.'.xml\"' );\n\n\t\t\t\tif ( ! empty( $this->data ) ) {\n\t\t\t\t\t$wpp_tab = \"\\t\";\n\t\t\t\t\t$wpp_br = \"\\n\";\n\t\t\t\t\t$wpp_xml_writter = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.$wpp_br;\n\t\t\t\t\t$wpp_xml_writter .= '<items>'.$wpp_br;\n\n\t\t\t\t\tforeach ( $this->data as $key => $result ) {\n\t\t\t\t\t\t$wpp_xml_writter .= $wpp_tab.'<item>'.$wpp_br;\n\t\t\t\t\t\tforeach ( $result as $node_key => $node_value ) {\n\t\t\t\t\t\t\t$wpp_xml_writter .= $wpp_tab.$wpp_tab.'<'.$node_key.'>'.htmlspecialchars( stripslashes( $node_value ) ).'</'.$node_key.'>'.$wpp_br;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$wpp_xml_writter .= $wpp_tab.'</item>'.$wpp_br;\n\t\t\t\t\t}\n\n\t\t\t\t\t$wpp_xml_writter .= '</items>';\n\t\t\t\t\techo $wpp_xml_writter;\n\t\t\t\t}\n\t\t\t} elseif ( 'json' == $action ) {\n\n\t\t\t\theader( 'Content-Type: text/json' );\n\t\t\t\theader( 'Content-Disposition: attachment;filename=\"'.$asFilename.'.json\"' );\n\t\t\t\t$fp = fopen( 'php://output', 'w' );\n\n\t\t\t\tif ( ! empty( $this->data ) ) {\n\t\t\t\t\tforeach ( $this->data as $key => $result ) {\n\t\t\t\t\t\t$json_data[] = $result;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$json_pretty_data = json_encode( $json_data, JSON_PRETTY_PRINT ).\"\\n\";\n\t\t\t\tfwrite( $fp, $json_pretty_data );\n\t\t\t\tfclose( $fp );\n\t\t\t}\n\t\t}", "abstract protected function generateXML();", "public function export() {\n\t\t$this->send_headers();\n\t\t$this->send_content( $this->get_file() );\n\t\t@unlink( $this->get_file_path() ); // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_unlink, Generic.PHP.NoSilencedErrors.Discouraged\n\t\tdie();\n\t}", "public function export(): void\n {\n $generator = $this->makeGenerator();\n\n while ($generator->valid()) {\n $generator->next();\n }\n\n $this->closeOutputStream();\n\n die();\n }", "public function asXml();", "function saveFormattedXML(SimpleXMLElement $simpleXMLElement, string $outputPath) {\n $xmlDocument = new DOMDocument('1.0');\n $xmlDocument->preserveWhiteSpace = false;\n $xmlDocument->formatOutput = true;\n $xmlDocument->loadXML($simpleXMLElement->asXML());\n\n return $xmlDocument->save($outputPath);\n}", "public function exportAction()\n {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('AppBundle:Genre')->findAll();\n $date = new \\DateTime(\"now\");\n $phpExcelObject = $this->get('phpexcel')->createPHPExcelObject();\n $phpExcelObject->getProperties()->setCreator(\"2SInnovation\")\n ->setTitle(\"GENRE\".$date->format('Y-m-d H:i:s'));\n $this->writeRapport($phpExcelObject, $entities);\n $writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');\n $response = $this->get('phpexcel')->createStreamedResponse($writer);\n $filename = 'GENRE'.$date->format('Y_m_d_H_i_s').'.xls';\n $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');\n $response->headers->set('Content-Disposition', 'attachment;filename='.$filename);\n $response->headers->set('Pragma', 'public');\n $response->headers->set('Cache-Control', 'maxage=1');\n return $response; \n }", "public function writeXsl() {\n $xls_url = Url::fromRoute('xmlsitemap.sitemap_xsl')->toString();\n $settings = \\Drupal::config('language.negotiation');\n if ($settings) {\n $url_settings = $settings->get('url');\n if (isset($url_settings['source']) && $url_settings['source'] == 'domain') {\n $scheme = \\Drupal::request()->getScheme();\n $context = $this->sitemap->getContext();\n $base_url = $scheme . '://' . $url_settings['domains'][$context['language']];\n $xls_url = Url::fromRoute('xmlsitemap.sitemap_xsl');\n $xls_url = $base_url . '/' . $xls_url->getInternalPath();\n }\n }\n $this->writePi('xml-stylesheet', 'type=\"text/xsl\" href=\"' . $xls_url . '\"');\n $this->writeRaw(PHP_EOL);\n }", "function doExport($msg = '') {\n\t\tglobal $data, $misc;\n\t\tglobal $lang;\n\n\t\t$misc->printTrail('schema');\n\t\t$misc->printTabs('schema','export');\n\t\t$misc->printMsg($msg);\n\n\t\techo \"<form action=\\\"dbexport.php\\\" method=\\\"post\\\">\\n\";\n\t\techo \"<table>\\n\";\n\t\techo \"<tr><th class=\\\"data\\\">{$lang['strformat']}</th><th class=\\\"data\\\" colspan=\\\"2\\\">{$lang['stroptions']}</th></tr>\\n\";\n\t\t// Data only\n\t\techo \"<tr><th class=\\\"data left\\\" rowspan=\\\"\". ($data->hasServerOids() ? 2 : 1) .\"\\\">\";\n\t\techo \"<input type=\\\"radio\\\" id=\\\"what1\\\" name=\\\"what\\\" value=\\\"dataonly\\\" checked=\\\"checked\\\" /><label for=\\\"what1\\\">{$lang['strdataonly']}</label></th>\\n\";\n\t\techo \"<td>{$lang['strformat']}</td>\\n\";\n\t\techo \"<td><select name=\\\"d_format\\\">\\n\";\n\t\techo \"<option value=\\\"copy\\\">COPY</option>\\n\";\n\t\techo \"<option value=\\\"sql\\\">SQL</option>\\n\";\n\t\techo \"</select>\\n</td>\\n</tr>\\n\";\n\t\tif ($data->hasServerOids()) {\n\t\t\techo \"<tr><td><label for=\\\"d_oids\\\">{$lang['stroids']}</label></td><td><input type=\\\"checkbox\\\" id=\\\"d_oids\\\" name=\\\"d_oids\\\" /></td>\\n</tr>\\n\";\n\t\t}\n\t\t// Structure only\n\t\techo \"<tr><th class=\\\"data left\\\"><input type=\\\"radio\\\" id=\\\"what2\\\" name=\\\"what\\\" value=\\\"structureonly\\\" /><label for=\\\"what2\\\">{$lang['strstructureonly']}</label></th>\\n\";\n\t\techo \"<td><label for=\\\"s_clean\\\">{$lang['strdrop']}</label></td><td><input type=\\\"checkbox\\\" id=\\\"s_clean\\\" name=\\\"s_clean\\\" /></td>\\n</tr>\\n\";\n\t\t// Structure and data\n\t\techo \"<tr><th class=\\\"data left\\\" rowspan=\\\"\". ($data->hasServerOids() ? 3 : 2) .\"\\\">\";\n\t\techo \"<input type=\\\"radio\\\" id=\\\"what3\\\" name=\\\"what\\\" value=\\\"structureanddata\\\" /><label for=\\\"what3\\\">{$lang['strstructureanddata']}</label></th>\\n\";\n\t\techo \"<td>{$lang['strformat']}</td>\\n\";\n\t\techo \"<td><select name=\\\"sd_format\\\">\\n\";\n\t\techo \"<option value=\\\"copy\\\">COPY</option>\\n\";\n\t\techo \"<option value=\\\"sql\\\">SQL</option>\\n\";\n\t\techo \"</select>\\n</td>\\n</tr>\\n\";\n\t\techo \"<tr><td><label for=\\\"sd_clean\\\">{$lang['strdrop']}</label></td><td><input type=\\\"checkbox\\\" id=\\\"sd_clean\\\" name=\\\"sd_clean\\\" /></td>\\n</tr>\\n\";\n\t\tif ($data->hasServerOids()) {\n\t\t\techo \"<tr><td><label for=\\\"sd_oids\\\">{$lang['stroids']}</label></td><td><input type=\\\"checkbox\\\" id=\\\"sd_oids\\\" name=\\\"sd_oids\\\" /></td>\\n</tr>\\n\";\n\t\t}\n\t\techo \"</table>\\n\";\n\n\t\techo \"<h3>{$lang['stroptions']}</h3>\\n\";\n\t\techo \"<p><input type=\\\"radio\\\" id=\\\"output1\\\" name=\\\"output\\\" value=\\\"show\\\" checked=\\\"checked\\\" /><label for=\\\"output1\\\">{$lang['strshow']}</label>\\n\";\n\t\techo \"<br/><input type=\\\"radio\\\" id=\\\"output2\\\" name=\\\"output\\\" value=\\\"download\\\" /><label for=\\\"output2\\\">{$lang['strdownload']}</label>\\n\";\n\t\t// MSIE cannot download gzip in SSL mode - it's just broken\n\t\tif (!(strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && isset($_SERVER['HTTPS']))) {\n\t\t\techo \"<br /><input type=\\\"radio\\\" id=\\\"output3\\\" name=\\\"output\\\" value=\\\"gzipped\\\" /><label for=\\\"output3\\\">{$lang['strdownloadgzipped']}</label>\\n\";\n\t\t}\n\t\techo \"</p>\\n\";\n\t\techo \"<p><input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"export\\\" />\\n\";\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"subject\\\" value=\\\"schema\\\" />\\n\";\n echo \"<input type=\\\"hidden\\\" name=\\\"database\\\" value=\\\"\", htmlspecialchars($_REQUEST['database']), \"\\\" />\\n\";\n echo \"<input type=\\\"hidden\\\" name=\\\"schema\\\" value=\\\"\", htmlspecialchars($_REQUEST['schema']), \"\\\" />\\n\";\n\t\techo $misc->form;\n\t\techo \"<input type=\\\"submit\\\" value=\\\"{$lang['strexport']}\\\" /></p>\\n\";\n\t\techo \"</form>\\n\";\n\t}", "function exportXml ( )\n\t{\n\t\t$ret = false;\n\n\t\tif ( is_array( $this->display) )\n\t\t{\n\t\t\t$writer = new SimonsXmlWriter( \"\\t\" );\n\t\t\t\t$writer->push( 'company' );\n\t\t\t\t\t$writer->push( 'global', array( 'companyId' => $this->id ) );\n\t\t\t\t\t\t$writer->push( 'general', array( 'display' => ( $this->display['display'] ) ? 'true' : 'false',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'displayName' => $this->display['displayName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name' => $this->display['name'] ) );\n\t\t\t\t\t\t\t$writer->element( 'comments', $this->display['comments'] );\n\n\t\t\t\t\t\t\t$writer->push( 'ctxs' );\n\n\t\t\t\t\t\t\t\t//$contexts = Context::Unserialize( $record[self::F_STUFFCTXS] );\n\n\t\t\t\t\t\t\t\tif ( $this->general['contexts'] && is_array( $this->general['contexts'] ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ( $this->general['contexts'] as $cid => $val )\n\t\t\t\t\t\t\t\t\t\t$writer->element( 'ctx', $cid );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$writer->pop( );\n\n\t\t\t\t\t\t$writer->pop( );\n\t\t\t\n\t\t\t\t\t\t$this->ExportXmlPartial( $writer );\n\n\t\t\t\t\t$writer->pop( );\n\t\t\t\t$writer->pop( );\n\n\t\t\t$ret = $writer->getXml( );\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function exportAction()\n {\n $invoiceId = $this->_getParam('invoice_id');\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $this->_model->setInvoiceId($invoiceId);\n $fileName = $this->_model->getPdfFileLocation();\n $file = file_get_contents($fileName);\n \n ini_set('zlib.output_compression','0');\n $this->getResponse()\n ->setHeader('Content-Type', 'application/pdf')\n ->setHeader('Content-Disposition', 'inline; filename=\"invoice.pdf\"')\n ->setHeader('Content-Length', strlen($file))\n ->setHeader('Pragma: public')\n ->setHeader('Cache-Control: private, max-age=0, must-revalidate')\n ->appendBody($file); \n }", "public function exportData(){\n\t\tswitch($_POST['export_to']){\n\t\t\tcase 'csv':\n\t\t\t\treturn $this->exportCSV();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'json':\n\t\t\t\treturn $this->exportJSON();\n\t\t\t\tbreak;\n\t\t\t \n\t\t\tcase 'xml':\n\t\t\t\treturn $this->exportXML();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function toXml()\n {\n }", "function exportDomain($domain_name,$adm_login){\n\t$dom_ar = array(\n\t\t\"domains\" => array(\n\t\t\t$domain_name => getDomainData($domain_name,$adm_login)\n\t\t\t)\n\t\t);\n\n\t// Serialize into a XML document\n\t$options = array(\n\t\t\"indent\" => \"\\t\",\n\t\t\"linebreak\" => \"\\n\",\n\t\t\"addDecl\" => true,\n\t\t\"encoding\" => \"UTF-8\",\n\t\t\"rootAttributes\" => array(\"version\" => \"0.1\"),\n\t\t\"rootName\" => \"dtc-export-file\",\n\t\t\"defaultTagName\" => \"item\",\n\t\t\"attributesArray\" => \"_attributes\"\n\t);\n\t$serializer = new XML_Serializer($options);\n\t$serializer->serialize($dom_ar);\n\t$xml = $serializer->getSerializedData();\n\treturn $xml;\n}", "function testValidateXMLwithSchemaOK() {\n $this->assertIdentical(\n binarypool_validate::validate('XML', 'test', realpath(dirname(__FILE__).'/../res/xmlfile.xml')),\n true);\n }", "public function exportVendor(SchemaVendor $vendor): void\n {\n }", "function convertXmlToCsvFile($xml_file_input, $csv_file_output) {\r\n\t$xml = simplexml_load_file($xml_file_input);\r\n\t\r\n\t$output_file = fopen($csv_file_output, 'w');\r\n\t\r\n\t$header = false;\r\n\t\r\n\tforeach($xml as $key => $value){\r\n\t\tif(!$header) {\r\n\t\t\tfputcsv($output_file, array_keys(get_object_vars($value)));\r\n\t\t\t$header = true;\r\n\t\t}\r\n\t\tfputcsv($output_file, get_object_vars($value));\r\n\t}\r\n\t\r\n\tfclose($output_file);\r\n echo \"File conversion completed \" . $csv_file_output;\r\n}", "public function toXml()\n {\n\n }", "public function export()\n {\n \\Excel::create('customers', function($excel) {\n $excel->sheet('customers', function($sheet) {\n $sheet->fromModel(Customer::filter(request()->input())->get()->makeHidden([\n 'id', 'company_id', 'created_at', 'updated_at', 'deleted_at'\n ]));\n });\n })->download('xlsx');\n }", "public function toXML(){\n\t\t//todo\n\t}", "public function exporterXML($usager) {\n\n\t\t$this->log->debug(\"Questionnaire::exporterXML() Début\");\n\t\t\n\t\t$succes = 0;\n\t\t$urlFichierZip = \"\";\n\n\t\t// Déterminer le nom du fichier zip\n\t\t$ts = date( \"Y-m-d_H-i-s\" );\n\t\t$nomRepertoireZip = Securite::nettoyerNomfichier($this->get(\"titre\")) . \"_\" . $ts . \"_xml\"; \n\t\t$nomFichierZip = $nomRepertoireZip . \".zip\";\n\t\t$urlFichierZip = URL_PUBLICATION . Securite::nettoyerNomfichier($usager->get(\"code_usager\")) . \"/\" . REPERTOIRE_PREFIX_APERCU . $nomFichierZip;\n\t\t\n\t\t// Déterminer le répertoire de publication de l'aperçu\n\t\t$repertoireDestinationUsager = REPERTOIRE_PUB . Securite::nettoyerNomfichier($usager->get(\"code_usager\")) . \"/\";\n\t\t$repertoireDestination = REPERTOIRE_PUB . Securite::nettoyerNomfichier($usager->get(\"code_usager\")) . \"/\" . REPERTOIRE_PREFIX_APERCU . $nomRepertoireZip . \"/\";\n\n\t\t// Vérifier que le répertoire de destination n'existe pas\n\t\tif (!is_dir($repertoireDestination)) {\n\t\t\t\n\t\t\t$this->log->debug(\"Questionnaire:exporterXML() Exportation du questionnaire\");\n\n\t\t\t// Exporter le questionnaire\t\n\t\t\t$publication = new Publication($this->log, $this->dbh);\n\t\t\t$succes = $publication->preparerRepertoire($repertoireDestinationUsager, $repertoireDestination);\n\t\t\tif ($succes) {\n\t\t\t\t// Créer le répertoire média\n\t\t\t\t$succes = $publication->creerRepertoireMedia($repertoireDestination);\n\t\t\t}\n\t\n\t\t\t// Exporter le contenu en format XML\n\t\t\t$contenu = $this->exporterXMLContenu($repertoireDestination);\n\t\t\t\n\t\t\t// Écrire le contenu dans un fichier XML\n\t\t\t$publication->ecrireFichier($repertoireDestination . FICHIER_EXPORTATION_XML, $contenu);\n\t\t\t\n\t\t} else {\n\t\t\t$this->log->debug(\"Questionnaire::exporterXML() Impossible de publier le questionnaire - le répertoire existe déjà\");\n\t\t}\t\t\n\t\t\t\n\t\tif ($succes == 1) {\n\t\t\t// Déterminer le répertoire source\n\t\t\t$repertoireSourceZip = REPERTOIRE_PUB . Securite::nettoyerNomfichier($usager->get(\"code_usager\")) . \"/\" . REPERTOIRE_PREFIX_APERCU ;\n\t\t\t\t\t\n\t\t\t// Préparer le fichier zip\n\t\t\t$fichierZip = $repertoireSourceZip . $nomFichierZip;\n\t\t\t\n\t\t\t// Zip des fichiers\n\t\t\tFichiers::Zip($repertoireDestination, $fichierZip);\n\t\t\t\n\t\t\t// Supprimer le répertoire temporaire\n\t\t\t$this->log->debug(\"Questionnaire::exporterXML() Suppression du répertoire '$repertoireDestination'\");\n\t\t\tFichiers::rmdirr($repertoireDestination);\n\t\t} else {\n\t\t\t$urlFichierZip = \"\";\n\t\t}\n\t\t\n\t\t$this->log->debug(\"Questionnaire::exporterXML() Fin\");\n\t\treturn $urlFichierZip;\n\t}", "public function exportAction ()\n {\n $grid1 = Bvb_Grid::factory('Bvb_Grid_Deploy_JqGrid', $this->_config, '', // this is the defualt grid class used to render on page\narray('csv' => array($this, 'configG1PostCsv'))// do post config for Csv export\n);\n $this->configG1($grid1, $this->_getParam('onlyFromPolynesia', 'false') === 'true');\n // pass grids to view and deploy() them there\n $this->view->g1 = $grid1->deploy();\n\n $this->render('index');\n }", "public function xml(Request $request){\n $column = isset($request->column)?$request->column:'';\n $books = Book::query();\n if(isset($request->column)){\n $books->select($column);\n } else {\n $books->select('title', 'author');\n }\n $results = $books->get();\n\n $xml = new \\XMLWriter();\n $xml->openMemory();\n $xml->setIndent(true);\n $xml->startDocument();\n $xml->startElement('Books');\n\n foreach ($results as $result) {\n $xml->startElement('Book');\n if(!isset($request->column) || $request->column == 'title'){\n $xml->writeAttribute('title', $result->title);\n }\n if(!isset($request->column) || $request->column == 'author'){\n $xml->writeAttribute('author', $result->author);\n }\n $xml->endElement();\n }\n\n $xml->endElement();\n $xml->endDocument();\n $contents = $xml->outputMemory();\n $name = 'output_'.time().'.xml';\n File::put(public_path('assets/xml_exports/'.$name),$contents);\n return Response::download(public_path('assets/xml_exports/'.$name));\n }", "protected function render_xml($struct,$filename='') {\n header('Content-Type: text/xml');\n \n if(!$this->is_debug() and !empty($filename))\n header(\"Content-Disposition: attachment; filename=\\\"{$filename}.xml\\\"\");\n\n die(DapiUtils::to_xml($struct));\n }" ]
[ "0.6265983", "0.6224205", "0.6072026", "0.5993754", "0.59156144", "0.58673453", "0.58417404", "0.58212954", "0.58120286", "0.580841", "0.57955384", "0.5783918", "0.5769735", "0.57681274", "0.57560605", "0.5747344", "0.57462114", "0.5711712", "0.5680807", "0.564618", "0.5620848", "0.5593801", "0.5590424", "0.5584583", "0.5564539", "0.5564539", "0.5564539", "0.5564539", "0.5564539", "0.5564539", "0.54860884", "0.54836303", "0.5443807", "0.54295516", "0.5410984", "0.540863", "0.5405658", "0.5395561", "0.5378251", "0.5378251", "0.5378251", "0.5378251", "0.5378251", "0.5377751", "0.5372134", "0.537109", "0.5314412", "0.5292484", "0.5288638", "0.527888", "0.527789", "0.5267733", "0.5249897", "0.52384806", "0.52328116", "0.52278966", "0.5213534", "0.52115977", "0.519745", "0.51826423", "0.51782805", "0.51622087", "0.51517445", "0.514294", "0.51352865", "0.51246554", "0.5119353", "0.5117228", "0.50986606", "0.50976545", "0.50830775", "0.50727886", "0.50693023", "0.5065177", "0.5049847", "0.5044973", "0.5043553", "0.5040375", "0.50211847", "0.50101465", "0.5001049", "0.49978557", "0.49964502", "0.49935353", "0.49914283", "0.4985203", "0.49768355", "0.4967708", "0.49661288", "0.4961717", "0.4944851", "0.49443045", "0.49398437", "0.49252933", "0.4903029", "0.49029934", "0.4900808", "0.48986092", "0.4886478", "0.48801482" ]
0.7269582
0
Provides a set of valid values for 'enabled' option.
Предоставляет набор допустимых значений для параметра 'enabled'.
public function validEnabledOptionDataProvider(): array { return [ 'Enabled' => [ 'enabled' => true, ], 'Disabled' => [ 'enabled' => false, ], ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEnabledValues() : array;", "public function getAllowedValues(): array;", "public function getProofDisabledAllowableValues()\n {\n return [\n self::PROOF_DISABLED_FALSE,\n self::PROOF_DISABLED_TRUE,\n self::PROOF_DISABLED_NOT_DEFINED,\n ];\n }", "public function getValidOptions()\n\t{\n\t\treturn array('animate', 'classes', 'disabled', 'max', 'min', 'orientation', 'range', 'step', 'value', 'values');\n\t}", "protected function getEnabled()\n\t{\n\t\t$list = array();\n\t\t$params = $this->getParams();\n\n\t\tforeach ($params->toArray() as $param => $value)\n\t\t{\n\t\t\tif (!$value)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$list[] = $param;\n\t\t}\n\n\t\treturn $list;\n\t}", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_ENABLED,\r\n self::STATUS_DISABLED,\r\n ];\r\n }", "public function getAllowedValues();", "private function __validate_enabled() {\n if ($this->initial_data[\"enabled\"] !== false) {\n $this->validated_data[\"enabled\"] = \"on\";\n }\n }", "public function getEnabled();", "public function allEnabled();", "public function getAllowedValues()\n {\n return $this->allowed_values;\n }", "function getEnabled();", "public function getOptionArray()\n {\n $options = ['1' => __('Enabled'),'0' => __('Disabled')];\n return $options;\n }", "public function getOptionArray()\n {\n $options = ['1' => __('Enabled'),'0' => __('Disabled')];\n return $options;\n }", "public function getEnabled() {\n $this->getAll();\n $enabled = [];\n foreach ($this->getConfiguration() as $key => $value) {\n if (isset($value['enabled']) && $value['enabled'] == TRUE) {\n $enabled[$key] = $this->get($key);\n }\n }\n return $enabled;\n }", "public function getEnabledValue() {\n return TRUE;\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_JAILED_BY_NOTIFICATIONS_VOLUME,\n self::STATUS_PENDING_DELETION,\n self::STATUS_DISABLED_ARGUMENT_EXCEPTION,\n self::STATUS_DISABLED_PROJECT_INVALID,\n self::STATUS_DISABLED_MISSING_PERMISSIONS,\n self::STATUS_DISABLED_FROM_PROBATION,\n self::STATUS_DISABLED_INACTIVE_IDENTITY,\n self::STATUS_DISABLED_MESSAGE_QUEUE_NOT_SUPPORTED,\n self::STATUS_DISABLED_MISSING_IDENTITY,\n self::STATUS_DISABLED_INVALID_ROLE_EXPRESSION,\n self::STATUS_DISABLED_INVALID_PATH_CLAUSE,\n self::STATUS_DISABLED_AS_DUPLICATE_OF_DEFAULT,\n self::STATUS_DISABLED_BY_ADMIN,\n self::STATUS_DISABLED,\n self::STATUS_ENABLED,\n self::STATUS_ENABLED_ON_PROBATION,\n ];\n }", "protected static function allowedOptions()\n\t{\n\t\treturn array();\n\t}", "protected static function allowedOptions()\n\t{\n\t\treturn array(\n\t\t\t\t\t\t'class' => 1,\n\t\t\t\t\t\t'style' => 1,\n\t\t\t\t\t\t'language' => 2\n\t\t\t\t\t);\n\t}", "public function getAllowedConfigValues()\n {\n return $this->allowed_config_values;\n }", "public function getEnabledStates(): array;", "protected static function allowedOptions()\n\t{\n\t\t$additional = array(\n\t\t\t\t\t\t\t'dir' => 1,\n\t\t\t\t\t\t\t'lang' => 1,\n\t\t\t\t\t\t\t'xml:lang' => 1,\n\t\t\t\t\t\t\t'disabled' => 1,\n\t\t\t\t\t\t\t'size' => 1\n\t\t\t\t\t\t\t);\n\t\treturn array_merge(parent::allowedOptions(), $additional);\n\t}", "public function getModeAllowableValues()\n {\n return [\n self::MODE_TEST,\n self::MODE_LIVE,\n ];\n }", "public static function Enabled() {\n return ArrayHelper::GetValue( self::$params, 'enabled', false );\n }", "public function canBeDisabledAndEnabled() {}", "protected static function allowedOptions()\n\t{\n\t\t$additional = array(\n\t\t\t\t\t\t\t'dir' => 1,\n\t\t\t\t\t\t\t'lang' => 1,\n\t\t\t\t\t\t\t'xml:lang' => 1,\n\t\t\t\t\t\t\t'accesskey' => 1,\n\t\t\t\t\t\t\t'tabindex' => 1,\n\t\t\t\t\t\t\t'disabled' => 1,\n\t\t\t\t\t\t\t'size' => 1,\n\t\t\t\t\t\t\t'multiple' => 1,\n\t\t\t\t\t\t\t'showEmpty' => 2,\n\t\t\t\t\t\t\t'data-placeholder' => 1 // added for support of chosen jQuery plugin\n\t\t\t\t\t\t\t);\n\t\treturn array_merge(parent::allowedOptions(), $additional);\n\t}", "public function allDisabled();", "public function getEnterpriseAdminAccessAllowableValues()\n {\n return [\n self::ENTERPRISE_ADMIN_ACCESS_DISABLED,\n self::ENTERPRISE_ADMIN_ACCESS_ENABLED,\n ];\n }", "public function getAllowedOptionValues(array $options);", "public function getEnableFieldsToBeIgnored() {}", "function getEnableFieldsToBeIgnored() ;", "function getEnabled() {\n\t\treturn $this->getData('enabled');\n\t}", "public function enabled();", "public function enabled();", "public function getAvailabilityAllowableValues()\n {\n return [\n self::AVAILABILITY__PUBLIC,\n self::AVAILABILITY_PERSONAL,\n self::AVAILABILITY_CORPORATION,\n self::AVAILABILITY_ALLIANCE,\n ];\n }", "public function getEncryptionModeAllowableValues()\n {\n return [\n self::ENCRYPTION_MODE_WEP,\n self::ENCRYPTION_MODE_WPA,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::FORBIDDEN,\n self::PERMITTED_NON_TARGET_ENABLE,\n self::PERMITTED_NON_TARGET_DISABLE,\n self::FIXED,\n self::UNKNOWN,\n ];\n }", "private static function valid_options() {\n\t\treturn array(\n\t\t\t'storage_period',\n\t\t\t'show_debug',\n\t\t);\n\t}", "public function getAllowed() : array\n {\n return $this->allowed;\n }", "protected function get__enabled()\n\t{\n\t\treturn $this->enabled;\n\t}", "public static function getAllowableEnumValues()\n {\n return [\n self::SELLER_LABEL,\nself::AMAZON_LABEL_ONLY,\nself::AMAZON_LABEL_PREFERRED, ];\n }", "public function getIsActiveAllowableValues()\n {\n return [\n self::IS_ACTIVE_0,\n self::IS_ACTIVE_1,\n ];\n }", "public function getFlagsAllowableValues()\n {\n return [\n self::FLAGS_COMPARED_TO,\n self::FLAGS_MY_OWN_OFFER,\n self::FLAGS_EXCLUDED_BY_ITEM_ID,\n ];\n }", "protected static function allowedOptions()\n\t{\n\t\t$additional = array(\n\t\t\t\t\t\t\t'width' => 1,\n\t\t\t\t\t\t\t'height' => 1,\n\t\t\t\t\t\t\t'dir' => 1,\n\t\t\t\t\t\t\t'lang' => 1,\n\t\t\t\t\t\t\t'xml:lang' => 1,\n\t\t\t\t\t\t\t'tabindex' => 1,\n\t\t\t\t\t\t\t'accesskey' => 1,\n\t\t\t\t\t\t\t'disabled' => 1,\n\t\t\t\t\t\t\t'readonly' => 1,\n\t\t\t\t\t\t\t'type' => 2\n\t\t\t\t\t\t\t);\n\t\treturn array_merge(parent::allowedOptions(), $additional);\n\t}", "public function getValueAllowableValues()\n {\n return [\n self::VALUE_NOT_SPECIFIED,\n self::VALUE_AD,\n self::VALUE_AE,\n self::VALUE_AF,\n self::VALUE_AG,\n self::VALUE_AI,\n self::VALUE_AL,\n self::VALUE_AM,\n self::VALUE_AO,\n self::VALUE_AQ,\n self::VALUE_AR,\n self::VALUE__AS,\n self::VALUE_AT,\n self::VALUE_AU,\n self::VALUE_AW,\n self::VALUE_AX,\n self::VALUE_AZ,\n self::VALUE_BA,\n self::VALUE_BB,\n self::VALUE_BD,\n self::VALUE_BE,\n self::VALUE_BF,\n self::VALUE_BG,\n self::VALUE_BH,\n self::VALUE_BI,\n self::VALUE_BJ,\n self::VALUE_BL,\n self::VALUE_BM,\n self::VALUE_BN,\n self::VALUE_BO,\n self::VALUE_BQ,\n self::VALUE_BR,\n self::VALUE_BS,\n self::VALUE_BT,\n self::VALUE_BV,\n self::VALUE_BW,\n self::VALUE_BY,\n self::VALUE_BZ,\n self::VALUE_CA,\n self::VALUE_CC,\n self::VALUE_CD,\n self::VALUE_CF,\n self::VALUE_CG,\n self::VALUE_CH,\n self::VALUE_CI,\n self::VALUE_CK,\n self::VALUE_CL,\n self::VALUE_CM,\n self::VALUE_CN,\n self::VALUE_CO,\n self::VALUE_CR,\n self::VALUE_CU,\n self::VALUE_CV,\n self::VALUE_CW,\n self::VALUE_CX,\n self::VALUE_CY,\n self::VALUE_CZ,\n self::VALUE_DE,\n self::VALUE_DJ,\n self::VALUE_DK,\n self::VALUE_DM,\n self::VALUE__DO,\n self::VALUE_DZ,\n self::VALUE_EC,\n self::VALUE_EE,\n self::VALUE_EG,\n self::VALUE_EH,\n self::VALUE_ER,\n self::VALUE_ES,\n self::VALUE_ET,\n self::VALUE_FI,\n self::VALUE_FJ,\n self::VALUE_FK,\n self::VALUE_FM,\n self::VALUE_FO,\n self::VALUE_FR,\n self::VALUE_GA,\n self::VALUE_GB,\n self::VALUE_GD,\n self::VALUE_GE,\n self::VALUE_GF,\n self::VALUE_GG,\n self::VALUE_GH,\n self::VALUE_GI,\n self::VALUE_GL,\n self::VALUE_GM,\n self::VALUE_GN,\n self::VALUE_GP,\n self::VALUE_GQ,\n self::VALUE_GR,\n self::VALUE_GS,\n self::VALUE_GT,\n self::VALUE_GU,\n self::VALUE_GW,\n self::VALUE_GY,\n self::VALUE_HK,\n self::VALUE_HM,\n self::VALUE_HN,\n self::VALUE_HR,\n self::VALUE_HT,\n self::VALUE_HU,\n self::VALUE_ID,\n self::VALUE_IE,\n self::VALUE_IL,\n self::VALUE_IM,\n self::VALUE_IN,\n self::VALUE_IO,\n self::VALUE_IQ,\n self::VALUE_IR,\n self::VALUE_IS,\n self::VALUE_IT,\n self::VALUE_JE,\n self::VALUE_JM,\n self::VALUE_JO,\n self::VALUE_JP,\n self::VALUE_KE,\n self::VALUE_KG,\n self::VALUE_KH,\n self::VALUE_KI,\n self::VALUE_KM,\n self::VALUE_KN,\n self::VALUE_KP,\n self::VALUE_KR,\n self::VALUE_KW,\n self::VALUE_KY,\n self::VALUE_KZ,\n self::VALUE_LA,\n self::VALUE_LB,\n self::VALUE_LC,\n self::VALUE_LI,\n self::VALUE_LK,\n self::VALUE_LR,\n self::VALUE_LS,\n self::VALUE_LT,\n self::VALUE_LU,\n self::VALUE_LV,\n self::VALUE_LY,\n self::VALUE_MA,\n self::VALUE_MC,\n self::VALUE_MD,\n self::VALUE_ME,\n self::VALUE_MF,\n self::VALUE_MG,\n self::VALUE_MH,\n self::VALUE_MK,\n self::VALUE_ML,\n self::VALUE_MM,\n self::VALUE_MN,\n self::VALUE_MO,\n self::VALUE_MP,\n self::VALUE_MQ,\n self::VALUE_MR,\n self::VALUE_MS,\n self::VALUE_MT,\n self::VALUE_MU,\n self::VALUE_MV,\n self::VALUE_MW,\n self::VALUE_MX,\n self::VALUE_MY,\n self::VALUE_MZ,\n self::VALUE_NA,\n self::VALUE_NC,\n self::VALUE_NE,\n self::VALUE_NF,\n self::VALUE_NG,\n self::VALUE_NI,\n self::VALUE_NL,\n self::VALUE_NO,\n self::VALUE_NP,\n self::VALUE_NR,\n self::VALUE_NU,\n self::VALUE_NZ,\n self::VALUE_OM,\n self::VALUE_PA,\n self::VALUE_PE,\n self::VALUE_PF,\n self::VALUE_PG,\n self::VALUE_PH,\n self::VALUE_PK,\n self::VALUE_PL,\n self::VALUE_PM,\n self::VALUE_PN,\n self::VALUE_PR,\n self::VALUE_PS,\n self::VALUE_PT,\n self::VALUE_PW,\n self::VALUE_PY,\n self::VALUE_QA,\n self::VALUE_RE,\n self::VALUE_RO,\n self::VALUE_RS,\n self::VALUE_RU,\n self::VALUE_RW,\n self::VALUE_SA,\n self::VALUE_SB,\n self::VALUE_SC,\n self::VALUE_SD,\n self::VALUE_SE,\n self::VALUE_SG,\n self::VALUE_SH,\n self::VALUE_SI,\n self::VALUE_SJ,\n self::VALUE_SK,\n self::VALUE_SL,\n self::VALUE_SM,\n self::VALUE_SN,\n self::VALUE_SO,\n self::VALUE_SR,\n self::VALUE_SS,\n self::VALUE_ST,\n self::VALUE_SV,\n self::VALUE_SX,\n self::VALUE_SY,\n self::VALUE_SZ,\n self::VALUE_TC,\n self::VALUE_TD,\n self::VALUE_TF,\n self::VALUE_TG,\n self::VALUE_TH,\n self::VALUE_TJ,\n self::VALUE_TK,\n self::VALUE_TL,\n self::VALUE_TM,\n self::VALUE_TN,\n self::VALUE_TO,\n self::VALUE_TR,\n self::VALUE_TT,\n self::VALUE_TV,\n self::VALUE_TW,\n self::VALUE_TZ,\n self::VALUE_UA,\n self::VALUE_UG,\n self::VALUE_UM,\n self::VALUE_US,\n self::VALUE_UY,\n self::VALUE_UZ,\n self::VALUE_VA,\n self::VALUE_VC,\n self::VALUE_VE,\n self::VALUE_VG,\n self::VALUE_VI,\n self::VALUE_VN,\n self::VALUE_VU,\n self::VALUE_WF,\n self::VALUE_WS,\n self::VALUE_YE,\n self::VALUE_YT,\n self::VALUE_ZA,\n self::VALUE_ZM,\n self::VALUE_ZW,\n ];\n }", "public function getModeAllowableValues()\n {\n return [\n self::MODE_DIRECT,\n ];\n }", "public function getLgAllowableValues()\n {\n return [\n self::LG_UK,\n self::LG_RU,\n self::LG_EN,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_ACTIVE,\r\n self::STATUS_DOWN,\r\n ];\r\n }", "protected static function allowedOptions()\n\t{\n\t\t$additional = array(\n\t\t\t\t\t\t\t'dir' => 1,\n\t\t\t\t\t\t\t'lang' => 1,\n\t\t\t\t\t\t\t'xml:lang' => 1,\n\t\t\t\t\t\t\t);\n\t\treturn array_merge( parent::allowedOptions(), $additional );\n\t}", "public static function getAllowableEnumValues()\n {\n return [\n self::GEO_TARGET_TYPE_SETTING,\n self::TARGET_LIST_SETTING,\n self::DYNAMIC_ADS_FOR_SEARCH_SETTING,\n self::UNKNOWN,\n ];\n }", "static public function getOptionArray()\r\n {\r\n return array(\r\n self::STATUS_ENABLED => Mage::helper('bannerslider')->__('Yes'),\r\n self::STATUS_DISABLED => Mage::helper('bannerslider')->__('No')\r\n );\r\n }", "public function getStatutAllowableValues()\n {\n return [\n self::STATUT_0,\n self::STATUT_1,\n self::STATUT_MINUS_1,\n ];\n }", "public function getStateAllowableValues(): array\n {\n return [\n self::STATE_PENDING,\nself::STATE_ACTIVE,\nself::STATE_BLOCKED,\nself::STATE_CANCELLED,\nself::STATE_EXPIRED, ];\n }", "public function getDisabledFields() {\n return [];\n }", "protected function getAllowedOptions()\n {\n return [\n 'proxy' => '/.+/', // Custom url for\n 'debug' => '/^(0|1)?$/', // boolean\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::EMPTY,\n self::POWER_OFF,\n ];\n }", "public function getV3PrivModeAllowableValues()\n {\n return [\n self::V3_PRIV_MODE_DES,\n self::V3_PRIV_MODE_AES128,\n ];\n }", "function enabled ($enabled = null);", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_DRAFT,\n self::STATUS_AUTHORING,\n self::STATUS_ACTIVE,\n self::STATUS_DOCUMENTS_NOT_YET_PROCESSED,\n self::STATUS_DISABLED,\n self::STATUS_DISCARDED,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_FREEZED,\r\n self::STATUS_BIND_ERROR,\r\n self::STATUS_BINDING,\r\n self::STATUS_PENDING_DELETE,\r\n self::STATUS_PENDING_CREATE,\r\n self::STATUS_NOTIFYING,\r\n self::STATUS_NOTIFY_DELETE,\r\n self::STATUS_PENDING_UPDATE,\r\n self::STATUS_DOWN,\r\n self::STATUS_ACTIVE,\r\n self::STATUS_ELB,\r\n self::STATUS_ERROR,\r\n self::STATUS_VPN,\r\n ];\r\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_INACTIVE, ];\n }", "public function getProtectionStatusAllowableValues()\r\n {\r\n return [\r\n self::PROTECTION_STATUS_NON_PROTECTION,\r\n self::PROTECTION_STATUS_CONSOLE_PROTECTION,\r\n ];\r\n }", "public function getProtectionStatusAllowableValues()\r\n {\r\n return [\r\n self::PROTECTION_STATUS_NON_PROTECTION,\r\n self::PROTECTION_STATUS_CONSOLE_PROTECTION,\r\n ];\r\n }", "public function getTaxCalcModeAllowableValues()\n {\n return [\n self::TAX_CALC_MODE_TAX_SETTING,\n self::TAX_CALC_MODE_GROSS,\n self::TAX_CALC_MODE_NET,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_BUYABLE,\n self::STATUS_DISCOVERABLE,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::PUBLIC_PLAYBACK_POLICY,\n self::SIGNED_PLAYBACK_POLICY,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_0,\nself::STATUS_1, ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNIFORM,\n self::_DEFAULT,\n self::UNKNOWN,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::GA_ACCELERATORS,\n self::GA_LISTENERS,\n ];\n }", "public function getEnabledFields()\n {\n return $this->fields->enabled();\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ECOMMERCE_PRODUCT,\n self::LINK_AD,\n self::OCPA,\n ];\n }", "public function getModerationStatusAllowableValues()\n {\n return [\n self::MODERATION_STATUS_HELD_FOR_REVIEW,\n self::MODERATION_STATUS_LIKELY_SPAM,\n self::MODERATION_STATUS_PUBLISHED,\n self::MODERATION_STATUS_REJECTED,\n ];\n }", "public function getStateAllowableValues()\n {\n return [\n self::STATE_DRAFT,\n self::STATE_ACTIVE,\n self::STATE_AUTHORING,\n ];\n }", "public function provideNonTrueValues()\n\t{\n\t\treturn array(\n\t\t\tarray(false),\n\t\t\tarray(0),\n\t\t\tarray(1),\n\t\t\tarray('on'),\n\t\t\tarray('true')\n\t\t);\n\t}", "public static function getAllowableEnumValues()\n {\n return [\n self::_PUBLIC,\n self::_PRIVATE,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::BRONZE,\n self::GOLD,\n self::SILVER,\n self::UNLIMITED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_Q,\n self::STATUS_S,\n self::STATUS_E,\n self::STATUS_R,\n self::STATUS_A,\n self::STATUS_D,\n self::STATUS_B,\n self::STATUS_F,\n self::STATUS_U,\n self::STATUS_J,\n self::STATUS_I,\n self::STATUS_P,\n self::STATUS_H,\n ];\n }", "public function GetDisabled ();", "public function getStatusOptions() {\n return array(\n self::STATUS_ENABLED => 'Yes',\n self::STATUS_DISABLED => 'No',\n );\n }", "public function getIgnoreEnableFields() {}", "public function getStateAllowableValues()\n {\n return [\n self::STATE_ACTIVE,\n self::STATE_DELETING,\n self::STATE_UPGRADING,\n ];\n }", "public static function AllowedValues()\n {\n $calledClass = get_called_class();\n return self::AllowedClassValues($calledClass);\n }", "function getIgnoreEnableFields() ;", "public function getEANTypesOptions()\n {\n return array(\n //'E5','EA','SA','SG' -- Frische-EAN values disabled\n 'HE','HK','I6','UC',\n 'IC','IE','IK','VC'\n );\n }", "public function getIsDisabled() {}", "public static function getAllowableEnumValues()\n {\n return [\n self::DE,\nself::EN,\nself::FR,\nself::HR,\nself::HU,\nself::IT,\nself::RO,\nself::SK,\nself::US, ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_EXPIRED,\n ];\n }", "public function getDisabledValue() {\n return FALSE;\n }", "public function is_disabled();", "public function getChargingModeAllowableValues()\r\n {\r\n return [\r\n self::CHARGING_MODE_PERIOD,\r\n self::CHARGING_MODE_ON_DEMAND,\r\n ];\r\n }", "public function get_enabled() : bool\n {\n }", "public function getProductCategoryAllowableValues(): array\n {\n return [\n self::PRODUCT_CATEGORY_BASE,\nself::PRODUCT_CATEGORY_ADD_ON,\nself::PRODUCT_CATEGORY_STANDALONE, ];\n }", "public function getAllowSkipAllowableValues()\n {\n return [\n self::ALLOW_SKIP_0,\n self::ALLOW_SKIP_1,\n ];\n }", "public function getAllEnabled()\n {\n $enabled = $this->config->item('languages_enabled');\n $out = array();\n\n foreach ($enabled as $code) {\n\n $out[] = $this->getByCode($code);\n }\n\n return array_filter($out);\n }", "public function getFeaturesAllowableValues()\n {\n return [\n self::FEATURES_DUAL_SYNC,\n self::FEATURES_SUBMISSION,\n self::FEATURES_SUPPRESSION,\n self::FEATURES_SUPPRESS_BY_URL,\n self::FEATURES_REVIEW_MONITORING,\n self::FEATURES_PUBLISHER_SUGGESTIONS,\n self::FEATURES_ANALYTICS,\n ];\n }", "public function getStateAllowableValues()\n {\n return [\n self::STATE_0,\n self::STATE_1,\n self::STATE_2,\n ];\n }", "public function allowed(): array\n {\n return [\n 'productId' => 'string', // the unique product id. To get a list of products and their ids, see /settings/products,\n 'startTime' => 'string:datetime',\n 'endTime' => 'string:datetime',\n 'peopleNumbers' => 'array[PeopleNumber]',\n 'options' => 'array[BookingOption]',\n 'resources' => 'array[Resource]',\n ];\n }", "public function availableSettings(): array;", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_SUCCESS,\r\n self::STATUS_SKIPPED,\r\n self::STATUS_FAILED,\r\n self::STATUS_RUNNING,\r\n self::STATUS_TIMEOUT,\r\n self::STATUS_WAITING,\r\n ];\r\n }", "function GetEnabledAlgos()\r\n\t\t{\r\n\t\t\treturn array_values($this->EnabledAlgos);\r\n\t\t}" ]
[ "0.757848", "0.69517285", "0.68708986", "0.68606454", "0.6833895", "0.68282145", "0.68038535", "0.68015456", "0.67354757", "0.67331666", "0.6714915", "0.6617912", "0.66028357", "0.66028357", "0.6570093", "0.6526168", "0.65077394", "0.6506124", "0.64800775", "0.64712024", "0.6466307", "0.64623153", "0.64542884", "0.6410051", "0.6397265", "0.63902783", "0.6366108", "0.63573956", "0.635543", "0.63374233", "0.63180876", "0.6312217", "0.6299368", "0.6299368", "0.6292195", "0.6286516", "0.627085", "0.62664896", "0.62484634", "0.62329", "0.62310064", "0.62279433", "0.62268203", "0.62212926", "0.62142444", "0.62094504", "0.6208417", "0.6206432", "0.6179728", "0.6179264", "0.6165871", "0.6153452", "0.61419344", "0.61414623", "0.6133505", "0.6126172", "0.61184", "0.61168814", "0.61116606", "0.6107605", "0.6102891", "0.6095872", "0.6095872", "0.60829175", "0.60760325", "0.6074898", "0.6074454", "0.60706544", "0.60704935", "0.606921", "0.60652137", "0.6062442", "0.6057281", "0.6055568", "0.60555303", "0.6048858", "0.60482526", "0.6046486", "0.6044906", "0.6038767", "0.6037457", "0.6035966", "0.60334283", "0.6031759", "0.6028568", "0.60282415", "0.6019112", "0.60156906", "0.6011994", "0.60110027", "0.60045475", "0.60007197", "0.59997916", "0.59925115", "0.59900117", "0.59878516", "0.59874153", "0.5987151", "0.5983218", "0.5983142" ]
0.72415304
1
Check a user The third parameter, which is optional, defines if this command should send messages to the target if $nick is not authed.
Проверьте пользователя Третий параметр, который является необязательным, определяет, отправлять ли эту команду сообщения в целевой канал, если $nick не аутентифицирован.
protected function _checkUser($nick, $target = '', $sendMessage = false) { if ($this->_isAuthed($nick)) { if (null !== $this->_getUserId($nick)) { return true; } if ($sendMessage) { $this->_client->send('I dunno who the fuck ' . $nick . ' is.', $target); } return false; } if ($sendMessage) { $this->_client->send('I dunno who the fuck ' . $nick . ' is.', $target); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user ($user = \"\")\n {\n\n if(empty($user))\n {\n $this->ERROR = \"POP3 user: no user id submitted\";\n return false;\n }\n if(!isset($this->FP))\n {\n $this->ERROR = \"POP3 user: connection not established\";\n return false;\n }\n $reply = $this->send_cmd(\"USER $user\");\n\n if(!$this->is_ok($reply))\n {\n $this->ERROR = \"POP3 user: Error [$reply]\";\n return false;\n }\n return true;\n }", "protected function check_user($user)\n\t{\n\t\t\n\t}", "private function check_user() {\n $cond = NULL;\n if($this->type != 'add') {\n $cond = \"AND id != {$this->id}\";\n }\n $ch = $this->select(\"*\", \"admins\", \"WHERE username = ? {$cond}\");\n $ch->execute(array($this->user));\n $info = $ch->rowCount();\n if($info > 0) {\n return true;\n }\n return false;\n }", "function checkUsername($sender, $param)\n\t{\n\t\t$manager = $this->Application->Modules['users'];\n\t\tif($manager->usernameExists($this->username->Text))\n\t\t\t$param->IsValid = false;\n\t}", "function checkNick($nick){\n self::setNames();\n $sql = \"SELECT u.usuario_nick FROM usuarios AS u WHERE u.usuario_nick = ?\";\n $res = $this->con->prepare($sql);\n $res->bindParam(1, $nick, PDO::PARAM_STR);\n $res->execute();\n\n while($row = $res->fetch(PDO::FETCH_ASSOC)){\n $datos[] = $row;\n return true;\n }\n }", "protected function CheckIfUserExist($nick){\n $CountUser = Users::where('nick',$nick)->count();\n if($CountUser > 0){\n return true;\n }else{\n return false;\n }\n }", "function checkUser($params = null)\n {\n // globals\n global $functions;\n\n // check if has permission\n if (!$this->user->hasPermission(\"als_SELF(USER)_checkUser\")) {\n $this->printError(\"You don't have the permission to perform this action\");\n }\n\n // check if params is null\n if ($params['username'] == \"\") {\n parent::printError(\"No username Supplied\");\n }\n\n $username = \"\";\n\n // check if the supplied parameters is an array or string\n if (is_string($params)) {\n $username = $params;\n } else {\n $username = $params['username'];\n }\n\n // check if the user exists\n if ($functions->userExist($username)) {\n //parent::printMSG(true);\n parent::setExecutable(1);\n } else {\n //parent::printMSG(false);\n parent::setExecutable(-1);\n }\n }", "protected function _isAuthed($nick)\n {\n return isset($this->_confirmed[strtolower($nick)]) && $this->_confirmed[strtolower($nick)];\n }", "static function Forgot( $user ) {\n return TRUE;\n }", "public function user($check = false);", "protected function noMatchesMessage( $userName, $checkLast = true ) {\n\t\tglobal $wgLang;\n\t\tif ( $checkLast ) {\n\t\t\t$dbr = wfGetDB( DB_SLAVE );\n\t\t\t$user_id = User::idFromName( $userName );\n\t\t\tif ( $user_id ) {\n\t\t\t\t$revEdit = $dbr->selectField( 'revision',\n\t\t\t\t\t'rev_timestamp',\n\t\t\t\t\tarray( 'rev_user' => $user_id ),\n\t\t\t\t\t__METHOD__,\n\t\t\t\t\tarray( 'ORDER BY' => 'rev_timestamp DESC' )\n\t\t\t\t);\n\t\t\t\t$logEdit = $dbr->selectField( 'logging',\n\t\t\t\t\t'log_timestamp',\n\t\t\t\t\tarray( 'log_user' => $user_id ),\n\t\t\t\t\t__METHOD__,\n\t\t\t\t\tarray( 'ORDER BY' => 'log_timestamp DESC' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$revEdit = $dbr->selectField( 'revision',\n\t\t\t\t\t'rev_timestamp',\n\t\t\t\t\tarray( 'rev_user_text' => $userName ),\n\t\t\t\t\t__METHOD__,\n\t\t\t\t\tarray( 'ORDER BY' => 'rev_timestamp DESC' )\n\t\t\t\t);\n\t\t\t\t$logEdit = false; // no log_user_text index\n\t\t\t}\n\t\t\t$lastEdit = max( $revEdit, $logEdit );\n\t\t\tif ( $lastEdit ) {\n\t\t\t\t$lastEditDate = $wgLang->date( wfTimestamp( TS_MW, $lastEdit ), true );\n\t\t\t\t$lastEditTime = $wgLang->time( wfTimestamp( TS_MW, $lastEdit ), true );\n\t\t\t\t// FIXME: don't pass around parsed messages\n\t\t\t\treturn wfMsgExt( 'checkuser-nomatch-edits', 'parse', $lastEditDate, $lastEditTime );\n\t\t\t}\n\t\t}\n\t\treturn wfMsgExt( 'checkuser-nomatch', 'parse' );\n\t}", "protected function checkIfCliUserExists() {}", "public static function verifyOwner($id, $user_type = 'user_destinatario'){\n\t\t$mensajes = new mensajes();\n\t\t$mensaje_data = $mensajes->getMensajes(\" AND id_mensaje=\".$id.\" \");\n\t\treturn ($mensaje_data[0][$user_type] == $_SESSION['user_name']);\n\t}", "function nick_unico($nick) {\n require_once('model/user_manager.php');\n $manager = new user_manager($this->db);\n if (null == $nick || !regexp::nick($nick)) {\n echo 'lettere, numeri, \\'-\\', \\'_\\' da 3 a 16';\n }\n if ($manager->count_users(\"nick = \\\"\" . $nick . \"\\\"\") > 0) {\n echo 'Nome utente gi&agrave; esistente';\n } else {\n echo 'OK';\n }\n }", "function userCheck($user)\n{\n\t$xsql = new phpSQL();\n\t$xsql->query(\"SELECT user_id FROM port_user WHERE user_name like '\".addslashes($user).\"'\");\n\t$res=$xsql->runquery();\n\tif(mysql_num_rows($res)>0)\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function validateUser()\n{\n if(isUser('scoutmaster'))\n {\n\t\t\treturn 1;\n }\n return 0;\n}", "function check_user() {\n if (!isset($_SESSION['id']))\n return false;\n if ($_SESSION['client_type'] != 3)\n return false;\n else\n return true;\n }", "public function sendCheckEmail(string $user){\n $this->checkNotConnected();\n if(!$this->checkUserExists($user)) throw new UserNotFound(\"There's no user '$user'!\", 1);\n $usr_data = $this->connection->query(\"SELECT vl_key, vl_email, checked FROM tb_users WHERE nm_user = \\\"$user\\\";\")->fetch_array();\n if($usr_data['checked'] == 1) return true; // will end the execution\n $headers = \"MIME-Version: 1.0\\n\";\n $headers .= \"Content-Type: text/html; charset=iso-8859-1\\n\";\n $headers .= \"From: \" . self::EMAIL_USING . \"\\n\";\n $headers .= \"Cc: \" . $usr_data['vl_email'] . \"\\n\";\n $content = $this->fetchTemplateEmail($user, $usr_data['vl_key']);\n return mail($usr_data['vl_email'], \"Your LPGP account!\", $content, $headers);\n }", "public function get_nick( $_id_user ) {\n }", "function EXISTE_USER($nick)\n\n{\n\n\n\ninclude(\"./config.php\"); // Incluimos la configuracion\n\n\n$array_nicks=OBTENER_NICKS();\n\n\n\n\n$total = TOTAL_ARRAY($array_nicks);\n\nfor($j=0;$j<$total;$j++){\n\n\tif($array_nicks[$j]==$nick){\n\t\treturn(true);\n\t\tdie;\n\t}\n\n\n}\n\nreturn(false);\ndie;\n\n\n\n}", "protected function checkUser()\n {\n if (is_null($this->user)) {\n if (!is_null($this->json)) {\n if (array_key_exists('username', $this->json) && !empty($this->json['username'])) {\n $this->user = $this->json['username'];\n }\n }\n }\n \n if (is_null($this->user)) {\n echo \"\\033[0;31mERROR:\\n\";\n echo \"No database username provided\\n\";\n echo \"Aborting\\033[0m\\n\";\n exit(1);\n }\n }", "function checkUsername($user) {\r\n // create database object\r\n $db = new Mysql();\r\n\r\n // *** get user ***\r\n $userobj = $db->getUser($user);\r\n\r\n // *** results? ***\r\n if(isset($userobj)) {\r\n // set error\r\n $_SESSION['error'] = getMessage(\"Hinweis:\", \"Benutzer existiert schon\", \"Bitte geben Sie einen anderen Benutzernamen ein\");\r\n } else {\r\n $_SESSION['error'] = null;\r\n }\r\n }", "public function usernameCheck($user)\n\t{\n\t\t$db = new Database_Model;\n\t\tif($db->usernameCheck($user))\n\t\t\treturn true;\n\t}", "public function checkModerator() {\n $users = new UserModel();\n $username = $this->request->getVar(\"modUsername\");\n\n\n $taken = $users->find($username);\n\n if($taken != null){\n echo \"User with that username already exists\";\n }\n echo \"\";\n }", "public function view_check_user($param_req)\n {\n // continue...\n if($this->exists_user_require == 0)\n {\n print \"FALSE!\";\n return false;\n }\n else\n {\n if($this->objDbFunctions->checkUserExists($this->exists_user_require) == true)\n {\n print \"TRUE\";\n return true;\n }\n }\n }", "public function testUserExists( $username, $flags = User::READ_NORMAL ) {\n $username = User::getCanonicalName( $username, 'usable' );\n \n global $wgImapAuthorizationActive;\n if ( $wgImapAuthorizationActive === false ) {\n return false;\n } else if ( $username === false ) {\n return false;\n } else {\n global $wgImapAuthorizationSmtpServerAddress;\n global $wgImapAuthorizationSmtpServerPort;\n\n // Open socket to the SMTP server\n $fp = fsockopen($wgImapAuthorizationSmtpServerAddress, \n $wgImapAuthorizationSmtpServerPort, $errno, $errstr, 30);\n if ( $fp ) {\n // Check if welcome message is 220\n $line = fgets($fp, 4096);\n $res = (substr($line, 0, 3) == '220');\n \n // Send HELO command\n $out = \"helo hi\\r\\n\";\n fwrite($fp, $out);\n \n // Check if response message is 250\n $line = fgets($fp, 4096);\n $res &= (substr($line, 0, 3) == '250');\n \n /* Send a fake sender address; since there will be no mail sent, this\n is not important*/\n $out = \"mail from: <user@request.com>\\r\\n\";\n fwrite($fp, $out);\n \n // Check if response message is 250\n $line = fgets($fp, 4096);\n $res &= (substr($line, 0, 3) == '250');\n \n // Send recipient name\n $out = \"rcpt to: <$username>\\r\\n\";\n fwrite($fp, $out);\n \n // Check if response message is 250\n $line = fgets($fp, 4096);\n $exists = (substr($line, 0, 3) == '250');\n \n // Send QUIT command and close socket\n $out = \"quit\\r\\n\";\n fwrite($fp, $out);\n fclose($fp);\n if (!$res) {\n return false;\n } else {\n return $exists;\n }\n }\n return true;\n }\n }", "public function checkfor_username($username = '', $giveuid = false)\n {\n $qid = $this->query('SELECT 1 FROM '.$this->DB['tbl_user'].' WHERE username=\"'.mysql_escape_string($username).'\"');\n if (!mysql_num_rows($qid)) return false;\n return (!$giveuid) ? true : 1;\n }", "function checkNewUser(&$bOK, &$strMsg)\n\n\n\n{\n\n\n\n\tglobal $strUsername;\n\n\n\n\tif ( !empty($strUsername) )\n\n\n\n\t{\n\n\n\n\t\t$bOK = true;\n\n\n\n\t}\n\n\n\n\telse\n\n\n\n\t{\n\n\n\n\t\t$bOK = false;\n\n\n\n\t\t$strMsg = 'Account cannot be empty.';\n\n\n\n\t}\n\n\n\n}", "public function validateUser($sender,$param)\r\n {\r\n \t$this->errorMessage->Text=\"\";\r\n \t$authManager=$this->Application->getModule('auth');\r\n \ttry\r\n \t{\r\n\t\t\tif($authManager->login($this->username->Text, $this->password->Text))\r\n\t\t\t{\r\n\t\t\t\t$this->Response->redirect('/admin/');\r\n\t\t\t}\r\n \t}\r\n \tcatch(AuthenticationException $ex)\r\n \t{\r\n\t \t$this->errorMessage->Text=\"Invalid User!\";\r\n \t}\r\n }", "static function userexists($control) { \n // get all usernames \n $db_users = \\Nette\\Environment::getService('usersmanager');\n $users = $db_users->getUsers();\n \n $usernamesArray = array();\n foreach ($users as $user) {\n $usernamesArray[] = $user->username;\n }\n \n $text = $control->value;\n $text = trim($text);\n if ($text !== '') {\n if (in_array($text, $usernamesArray)) {\n return false;\n } else {\n return true;\n }\n } \n// return true;\n }", "function SERVER_commandAvailable($cmd, $user=\"root\")\n{\n\t$ret = SERVER_runInBackground(\"CheckFor\".uniqid($cmd), \"(type $cmd 2>&1) > /dev/null && echo ok\",$user,false);\n\treturn (\"ok\\n\" == $ret);\n}", "public function checkFreeUsername() {\r\n\t\t// Select the user's id.\r\n\t\t$query = 'SELECT `id` FROM `user` WHERE `username` = :username';\n\t\t$params = array(\n\t\t\t'username' => $this->username\n\t\t);\n\t\treturn $this->db->query($query, $params, 'column') == false;\n\t}", "function _check_user()\n\t{\n\t\tglobal $SESS;\n\t\t\n\t\t// Don't check if we don't have to check logged-in members\n\t\tif ($this->settings['check_members'] === 'n' AND $SESS->userdata['member_id'] != 0)\n\t\t{\n\t\t\t$do_check = FALSE;\n\t\t}\n\t\t// Don't check if user is not in selected member groups\n\t\telseif (is_array($this->settings['check_members']) AND !in_array($SESS->userdata['group_id'], $this->settings['check_members']))\n\t\t{\n\t\t\t$do_check = FALSE;\n\t\t}\n\t\t// Every other case, perform check\n\t\telse\n\t\t{\n\t\t\t$do_check = TRUE;\n\t\t}\n\t\t\n\t\treturn $do_check;\n\t}", "function checkUserChallenged($username1, $username2) {\n\t\t$results = $this->mdb->query(\"SELECT * FROM challenge WHERE (gameUser1Id = %s AND gameUser2Id = %s) \n\t\t\tOR (gameUser1Id = %s AND gameUser2Id = %s)\", $username1, $username2, $username2, $username1);\n\t\t// Check if already challenged\n\t\tif (count($results) > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkUser($user){\n\t\t$sql = \"SELECT * FROM users WHERE user='$user'\";\n\t\t$prepare = $this->connection->prepare($sql);\n $prepare-> execute();\n $resultat = $prepare->rowCount();\n if($resultat === 0){\n \treturn true;\n }\n else{\n \treturn false;\n }\n }", "public function setUserExistsMessage() {\n\t\t$this->message .= 'User exists, pick another username.<br />';\n\t}", "function is_user() { return ( $this->user_id != 0 ); }", "public function canSendToUser(UserInterface $user): bool;", "public function CheckUSER()\n {\n if (!isset($_SESSION['username'])) {\n header('location: ' . URL . 'home/index');\n }\n }", "public function chk_user(&$user, $servertime, $nonce)\n\t{\n $gPsw = sf\\decrypted_rsa_ciphertext($user->password);\n //should use email as unique key for an user\n $dbuser = md\\User::find_by_email($user->email);\n\n if($servertime.\"\\t\".$nonce.\"\\n\".$dbuser[0]->password == $gPsw)\n {\n $user->id($dbuser[0]->id)\n ->name($dbuser[0]->name)\n ->password($dbuser[0]->password);\n\n sf\\write_session('uid', $user->id);\n\t\t\tsf\\write_session('email', $user->email);\n sf\\write_session('uname', $user->name);\n\t\t\treturn true;\n }\n\t\treturn false;\n\t}", "public function checkUser()\n {\n if (!($user = $this->model->getLoggedInUser())) {\n $this->hardRedirect($this->url('login_page'));\n }\n\n if (!$user->canAccess(get_class($this), $this->route['method'])) {\n $this->hardRedirect($this->url('no_access'));\n }\n\n $this->refreshSession();\n }", "public function check()\n {\n return (bool) $this->user();\n }", "public static function allowUsers()\r\n\t{\r\n\t\tglobal $lang;\r\n\t\t// Set error message\r\n\t\t$error_msg = \"<div style='background-color:#FFE1E1;border:1px solid red;max-width:700px;padding:6px;color:#800000;'>\r\n\t\t\t\t\t\t<img src='\" . APP_PATH_IMAGES . \"exclamation.png' class='imgfix'> \r\n\t\t\t\t\t\t<b>{$lang['global_05']}</b> {$lang['config_05']}\r\n\t\t\t\t\t</div>\";\r\n\t\t// Get arguments passed\r\n\t\t$args = func_get_args();\r\n\t\t// If authentication has been disabled, then return false with no error warning\r\n\t\tif (defined(\"NOAUTH\")) return false;\r\n\t\t// If userid is not defined OR if no userid's were provided, then display error message\r\n\t\tif (!defined(\"USERID\") || empty($args)) exit($error_msg);\r\n\t\t// Set flag if the userid does not exist as a parameter\r\n\t\t$userIdNotFound = true;\r\n\t\t// Loop through all project_ids as parameter\r\n\t\tforeach ($args as $item) {\r\n\t\t\tif (is_array($item)) {\r\n\t\t\t\tif (empty($item)) return false;\r\n\t\t\t\tforeach ($item as $userid) {\r\n\t\t\t\t\tif ($userid == USERID) {\r\n\t\t\t\t\t\t$userIdNotFound = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($item == USERID) {\r\n\t\t\t\t\t$userIdNotFound = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Now do a check if the userid was not set as parameter\r\n\t\tif ($userIdNotFound) exit($error_msg);\r\n\t\t// If we made it this far, return true\r\n\t\treturn true;\r\n\t}", "protected function queryInfoByUsername($obj = '') {\n\t\tglobal $query, $lang, $wtcDB;\n\n\t\tif(!empty($obj)) {\n\t\t\t$getUser = $obj;\n\t\t}\n\n\t\telse {\n\t\t\t$getUser = new Query($query['global']['get_user_byUsername'], Array(1 => $this->username));\n\t\t}\n\n\t\tif(!$wtcDB->numRows($getUser) AND !$this->doError) {\n\t\t\tif($this->userReq) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tnew WtcBBException($lang['error_userDoesNotExist']);\n\t\t}\n\n\t\t$this->info = $wtcDB->fetchArray($getUser);\n\t}", "public function doesUserExist($user);", "function nick($nick) {\n if (null == $nick || !regexp::nick($nick)) {\n echo 'lettere, numeri, \\'-\\', \\'_\\' da 3 a 16';\n } else {\n echo 'OK';\n }\n }", "function sumo_verify_current_user($username='sumo')\n{\n\tGLOBAL $SUMO;\n\n\tif(!is_array($username)) $username = array($username);\n\n\treturn (sumo_array_is_inarray($SUMO['user']['user'], $username) ||\n\t\t\t$SUMO['user']['user'] == 'sumo') ? true : false;\n}", "function checkAccess($uid='') {\n\t\t\n\t\t// link to login page\n\t\tif ($this->conf['loginPid']) {\n\t\t\t$linkConf['parameter'] = $this->conf['loginPid'];\n\t\t\t$loginpagelink = $this->cObj->typoLink($this->pi_getLL('loginpagelink'),$linkConf);\n\t\t} else $loginpagelink = '';\n\t\t\n\t\t// no user logged in\n\t\tif (!$GLOBALS['TSFE']->loginUser) {\n\t\t\t$content = $this->cObj->getSubpart($this->templateCode,'###NO_ACCESS###');\n\t\t\t$content = $this->cObj->substituteMarker($content,'###ERRORMESSAGE###',$this->pi_getLL('no_login'));\n\t\t\t#$content = $this->cObj->substituteMarker($content,'###LOGINPAGE###',$loginpagelink);\n\t\t\t$content = $this->cObj->substituteMarker($content,'###FORM###',$this->showLoginForm());\n\t\t\treturn $content;\n\t\t}\n\t\telse {\n\t\t\t// check for single message\n\t\t\tif ($uid) {\n\t\t\t\t// get data from db\n\t\t\t\t$where = 'uid=\"'.intval($uid).'\"';\n\t\t \t\t$where .= $this->cObj->enableFields($this->table);\n\t\t \t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*',$this->table,$where,$groupBy='',$orderBy='',$limit='1');\n\t\t\t\t$row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\t\t\t\t\n\t\t\t\t// user is recipient\n\t\t\t\tt3lib_div::devlog('user', $this->extKey, $severity=0, $GLOBALS['TSFE']->fe_user->user['uid']);\n\t\t\t\tt3lib_div::devlog('RECIPIENT', $this->extKey, $severity=0, $row['recipient']);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// user is sender\n\t\t\t\tt3lib_div::devlog('SENDER ', $this->extKey, $severity=0, $row['sender']);\n\t\t\t\tif ($row['sender'] == $GLOBALS['TSFE']->fe_user->user['uid']) $sender = true;\n\t\t\t\t\n\t\t\t\tt3lib_div::devlog('MODE', $this->extKey, $severity=0, $this->piVars['mode']);\n\t\t\t\t\n\t\t\t\tif ( ($this->piVars['mode'] == 'outbox' && !$sender) || ($this->piVars['mode'] == 'inbox' && !$recipient) ) {\n\t\t\t\t\t$content = $this->cObj->getSubpart($this->templateCode,'###NO_ACCESS###');\n\t\t\t\t\t$content = $this->cObj->substituteMarker($content,'###ERRORMESSAGE###',$this->pi_getLL('no_access'));\n\t\t\t\t\t$content = $this->cObj->substituteMarker($content,'###FORM###',$this->linkBackToInbox());\n\t\t\t\t\treturn $content;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// return empty if user is logged in\n\t\treturn '';\n\t}", "public function userOwnsMessage()\n {\n\t\t$user = $this->User->get($this->parent['user_id']);\n\t\tif ($user['username'] == $this->modelData['reply_to_username'])\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n }", "function ft_check_user($username) {\n global $ft;\n if ($username == USERNAME) {\n return TRUE;\n } elseif (is_array($ft['users']) && sizeof($ft['users']) > 0 && array_key_exists($username, $ft['users'])) {\n return TRUE;\n }\n return FALSE;\n}", "function nick_exist($nick, $id=-1){\n if ($id < 0)\n $query = $this->db->where(array('NICKNAME' => $nick))->get('users');\n else{\n $query = $this->db->where(array('NICKNAME' => $nick, 'ID !=' => $id))->get('users');\n }\n return ($query->num_rows > 0)?TRUE:FALSE;\n }", "public static function check()\n\t{\n\t\treturn ! is_null(static::user());\n\t}", "public static function check()\n\t{\n\t\treturn ! is_null(static::user());\n\t}", "public function checkUser(){\n\n\t\t\n\n\t\tif($_SESSION['LOGIN_USER_TYPE'] == 1 && $_SESSION['ADMIN_LOGIN_SWISS'] == 1 ){\n\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t}", "private function sendWinMessage($nick)\n {\n $red = \"\\x034\"; \n $message = \"Woohoo {$nick}!! You got it...{$red}{$this->word}\";\n\n $this->sendMessage($message);\n }", "public function nickOk(){\n\n\t\t\t// cargamos la vista registro y le pasamos valores\n\t\t\t$this->view(\"nickOk\", array(\n\t\t\t\t));\n\t\t}", "function checkExistUser() {\n\t\tglobal $db;\n\t\t$email = FSInput::get ( 'email' );\n\t\t$username = FSInput::get ( 'username' );\n\t\n\t}", "public function check_request( $_id_user1 ) {\n }", "protected function checkUser()\n {\n if ($this->user === null && !Yii::$app->user->isGuest) {\n $this->user = Yii::$app->user->getIdentity();\n }\n }", "public function allowUser(User $user, $option = '') {\n\t\t$itmperm = $this->userItmp($user->loginid);\n\t\t$exists = array_key_exists($option, self::PERMISSIONS_DEFAULT);\n\t\treturn $exists ? $itmperm->is_true($option) : true;\n\t}", "public function userTest($user){\n $username = htmlspecialchars($user);\n $reqUserTest = $this->findFirst(array(\"conditions\"=>\"`username`='$username'\"));\n if (!$reqUserTest) {\n return false;\n }else{\n return true;\n }\n }", "public function check_user($username)\t//проверка на существование пользователя (функцию необходимо проверить)\n\t{\n\t\t$sth = $this->db->prepare(\"SELECT username FROM accounts WHERE username = :username\");\n\t\t$sth->execute(array(\n\t\t\t\t\t\t\t\t':username' => $username\n\t\t\t\t\t\t\t));\n\t\t\n\t\t$count = $sth ->rowCount();\n\n\t\tif($count > 0)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "function check_user(&$ms_user) {\t\n\tglobal $db;\n\tuser_is_guest($ms_user);\n\t$ms_user['banned'] = false;\n\tif (isset($_SESSION['uid']) && $_SESSION['uid']) {\n\t\t/*if ($_SESSION['userhash'] != $_SERVER['HTTP_USER_AGENT']) {\n\t\t\tsession_destroy();\n\t\t\treturn;\n\t\t}*/\n\t\t$result = $db->query('SELECT * FROM users\n\t\tWHERE id=' . $_SESSION['uid']) or error('Failed to check user info', __FILE__, __LINE__, $db->error());\n\t\tif ($db->num_rows($result)) {\n\t\t\t$ms_user = $db->fetch_assoc($result);\n\t\t\t$ms_user['id'] = $_SESSION['uid'];\n\t\t\t$ms_user['valid'] = true;\n\t\t\tif ($ms_user['permission'] > 1) {\n\t\t\t\t$ms_user['is_mod'] = true;\n\t\t\t}\n\t\t\tif ($ms_user['permission'] > 2) {\n\t\t\t\t$ms_user['is_admin'] = true;\n\t\t\t}\n\t\t}\n\t}\n}", "function send_user($user, $message) {\n $user = messaging_user_object($user);\n $simple = Messaging_Simple::build($user, $message);\n return (bool)$simple->save();\n }", "private function checkUser($headers) {\n\t\t$user = $this->getUser(isset($headers['X-Public']) ? $headers['X-Public'] : null);\n\t\t$this->logRequest($user); //Log the user/non-user request\t\t\n\t\tif(empty($user)) {\n\t\t\t$this->setRequestFail('403', $this->messages->forbiddenUser);\n\t\t}\n\n\t\treturn $user;\n\t}", "public function checked_sendConfirmationCode($screenname, $code, $user) {\n $this->fake_irc->doPrivmsg('NickServ', 'INFO '.$screenname);\n $this->enqueueOutgoingRaw(\n array(\n 'type' => 'nickcheck',\n 'prioritise' => 1,\n 'data' => $this->fake_irc->would_be_sent,\n 'nickdata' =>\n array(\n 'screenname' => $screenname,\n 'code' => $code,\n 'user' => $user\n )\n )\n );\n return true;\n }", "function checkUser()\n\t{\n\t\tif($this->session->userdata('UsID'))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "private function _check_user()\n {\n /* if already login */\n if($this->kulkul_auth->user())\n {\n $user = (object) $this->kulkul_auth->user();\n if($user->is_admin != 1)\n {\n show_error('You do not have sufficient permissions to access this page', \n '403',\n 'Access Forbidden');\n exit();\n }elseif($user->is_admin == 1){\n redirect('admin');\n }\n }\n }", "public function askUser()\n {\n if ($this->option('user')) {\n $user = $this->option('user') == '#first-item' ? ServerUser::first() : ServerUser::where('name', $this->option('user'))->first();\n } else {\n $users = ServerUser::get();\n\n $options = [];\n foreach ($users as $user) {\n $options[] = $user->name;\n }\n\n if (count($options) > 0) {\n $user = ServerUser::where('name', $this->choice('Select user', $options))->first();\n }\n }\n\n if ($user) {\n return $user;\n }\n\n throw new Exception(\"Could not find user.\");\n }", "public function test_user($user)\n\t{\n\t\tif($user ==\"\"){\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$result = $this->select('SELECT * FROM users WHERE username=\"'. $user .'\"');\n\t\t\tif(!empty($result)){\n\t\t\t\t// user exists\t\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\t\n\t}", "public static function check()\n\t{\n\t\treturn ( ! is_null(static::user()));\n\t}", "public function checkUser(User $user) {\r\n //$selected = mysql_select_db(\"libsystem\",$dbhandle);\r\n $con = mysqli_connect($this->hostname, $this->username, $this->password, \"libsystem\");\r\n $sql = 'SELECT * FROM User where uname = ?;';\r\n\r\n $stmt = $con->prepare($sql);\r\n\r\n $stmt->bind_param('s', $user->getUname());\r\n\r\n\r\n $no_rows = 0;\r\n $stmt->execute();\r\n\r\n $returned_name = null;\r\n $returned_name2 = null;\r\n $result = $stmt->get_result();\r\n $rows = $result->fetch_object();\r\n\r\n\r\n if (sizeof($rows) != 0) {\r\n mysqli_close($con);\r\n return true;\r\n }\r\n mysqli_close($con);\r\n return false;\r\n }", "function isUser() {\n\t\tglobal $O_O;\n\t\treturn $O_O->isUser();\n\t}", "function user_exists($user)\n{\n\tglobal $conn;\n\tif ((int)$user){\n\t\t$qry = $conn->prepare(\"SELECT COUNT(*) AS entries FROM `account`.`account` WHERE id = ?\");\n\t\t$ret = $qry->execute([$user]);\n\n\t\tif ($qry->fetchObject()->entries >= 1) {\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\t$qry = $conn->prepare(\"SELECT COUNT(*) AS entries FROM `account`.`account` WHERE login = ?\");\n\t\t$ret = $qry->execute([$user]);\n\n\t\tif ($qry->fetchObject()->entries >= 1) {\n\t\t\treturn true;\n\t\t}\n\t}\n}", "function check_owner_bool($owner, $loggedUser)\n{\n return !($loggedUser === $owner || $loggedUser === \"admin\");\n}", "function check_guest() {\n\tglobal $mysqlMainDb, $uid;\n\tif (isset($uid)) {\n\t\t$res = db_query(\"SELECT statut FROM user WHERE user_id = '$uid'\", $mysqlMainDb);\n\t\t$g = mysql_fetch_row($res);\n\n\t\tif ($g[0] == 10) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n}", "public function action_user()\n\t{\n\t\t$this->g->user('shadowhand');\n\t}", "public function post_checkUser() {\n return $this->response(array('user id' => AuxWelcome::loginUser()));\n }", "public function __invoke($user) {\n if ($user->is_super_admin) {\n return true;\n }\n else if ($user->tokenCan('server:update')) {\n return true;\n }else {\n return false;\n }\n }", "public function user($param = null) {\n\n\t\tif ($param != null) {\n\n\t\t\t$this->data->requestedUser = $param;\n\t\t\tif (is_numeric($param)) {\n\t\t\t\t$searchParam = \"mixer_id\";\n\t\t\t\t$sql_query = \"SELECT * FROM mixer_users WHERE mixer_id=?\";\n\t\t\t} else {\n\t\t\t\t$searchParam = \"name_token\";\n\t\t\t\t$sql_query = \"SELECT * FROM mixer_users WHERE name_token=?\";\n\t\t\t}\t\t\t\n\n\n\t\t\t$this->data->message = \"looking for user\";\n\t\t\t$this->data->error = \"function incomplete\";\n\n\t\t\t$criteria = array($param);\n\t\t\t$query = $this->db->query($sql_query, $criteria);\n\t\t\t$this->data->user = $query->result()[0];\n\n\t\t\t$this->data->message = \"collected user\";\n\t\t\t$this->data->error = \"no error\";\n\n\n\n\t\t} else {\n\t\t\t$this->data->requestedUser = $param;\n\t\t\t$this->data->message = \"no user provided\";\n\t\t\t$this->data->error = \"failure\";\n\t\t}\n\n\t\t$this->returnData();\n\t}", "function cookieCheck($command = 'send', $pageLocation = '',\n\t$sessionUserName = 'username')\n{\n\tif (!isset($_SESSION))\n\t{\n\t\ttrigger_error('Sessions not started', E_USER_WARNING);\n\t}\n\n\tswitch ($command)\n\t{\n\t\tcase 'check':\n\t\t\tif (isset($_SESSION['cookieCheck']) && $_SESSION['cookieCheck'] == true)\n\t\t\t{\n\t\t\t\t// set the global user if it exists\n\t\t\t\tif (!empty($_SERVER['REMOTE_USER']))\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[$sessionUserName] = $_SERVER['REMOTE_USER'];\n\t\t\t\t}\n\n\t\t\t\tif (!empty($_GET['u']))\n\t\t\t\t{\n\t\t\t\t\t$url = rawurldecode($_GET['u']);\n\t\t\t\t\t// parase the url\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$url = 'http://'.$_SERVER['HTTP_HOST'].'/';\n\t\t\t\t\tif ((isset($_SERVER['HTTPS']) &&\n\t\t\t\t\t\t$_SERVER['HTTPS'] == 'on')\n\t\t\t\t\t\t||\n\t\t\t\t\t\t(isset($_SERVER['SERVER_PORT']) &&\n\t\t\t\t\t\t$_SERVER['SERVER_PORT'] == 443))\n\t\t\t\t\t{\n\t\t\t\t\t\t$url = 'https://'.$_SERVER['HTTP_HOST'].'/';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\theader('Location: '.$url);\n\t\t\t\texit();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'send':\n\t\tdefault:\n\t\t\tif (!isset($_SESSION['cookieCheck']) || $_SESSION['cookieCheck'] == false)\n\t\t\t{\n\t\t\t\t// set the cookie to check\n\t\t\t\t$_SESSION['cookieCheck'] = true;\n\n\t\t\t\t// if no pageLocation is given default to PHP_SELF\n\t\t\t\tif (empty($pageLocation))\n\t\t\t\t{\n\t\t\t\t\t$pageLocation = $_SERVER['PHP_SELF'];\n\t\t\t\t}\n\n\t\t\t\t$url = 'http://'.$_SERVER['HTTP_HOST'];\n\t\t\t\tif ((isset($_SERVER['HTTPS']) &&\n\t\t\t\t\t$_SERVER['HTTPS'] == 'on')\n\t\t\t\t\t||\n\t\t\t\t\t(isset($_SERVER['SERVER_PORT']) &&\n\t\t\t\t\t$_SERVER['SERVER_PORT'] == 443))\n\t\t\t\t{\n\t\t\t\t\t$url = 'https://'.$_SERVER['HTTP_HOST'];\n\t\t\t\t}\n\t\t\t\t$url .= $pageLocation.'?u='.\n\t\t\t\t\trawurlencode($url.$_SERVER['REQUEST_URI']);\n\t\t\t\theader('Location: '.$url);\n\t\t\t\texit();\n\t\t\t}\n\t}\n}", "public function CheckUser()\r\n\t{\r\n\t\t$now = new \\DateTime(\"now\");\r\n\r\n\t\t// If the user id doesn't exist or the session has expired\r\n\t\tif ( !isset($_SESSION['user_id']) || $_SESSION['expires'] < $now )\r\n\t\t{\r\n\t\t\t// Store the url the user has requested - once logged back in they can then be directed back\r\n\t\t\t$_SESSION['calling_url'] = $this->urls->get_requested_url();\r\n\r\n\t\t\t// Redirect to the home page\r\n\t\t\t$this->urls->redirect();\r\n\r\n\t\t\t// Stop running this code\r\n\t\t\texit();\r\n\t\t}\r\n\r\n\t\t// Set the time the session expires\r\n\t\t$expires = new \\DateTime(\"now +\" . $this->session_length . \" minutes\");\r\n\t\t$_SESSION['expires'] = $expires;\r\n\r\n\t\treturn true;\r\n\t}", "function f_userAuthen($user)\n\t{\n\t\tglobal $db;\n\t\t$sql_query = \"select * from user where user_name = '$user'\";\n\t\t$result = $db->query($sql_query) or die($db->error);\n\t\tif(($result->num_rows) > 0) return true;\n\t\t\n\t\treturn false;\n\t}", "public function checkAuth(user $user);", "public function getUserByNickname($nickname)\n {\n }", "public function chkUser($username, $password);", "public function checkUserData()\n {\n $_extConfig = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(\n 'janolawservice'\n );\n\n $userid = $_extConfig['user_id'];\n $shopid = $_extConfig['shop_id'];\n\n if (!$this->requestFactory)\n {\n //injection does not seem to work in context of\n //ext_conf_template.txt type=user\n $this->requestFactory = new RequestFactory();\n }\n if ($this->hasValidUserData($userid, $shopid)) {\n $result = 'Ihre Daten sind o.k., der Janolaw Server ist erreichbar.<br/>';\n $this->janolawGetVersion($userid, $shopid, $result);\n } else {\n if (isset($userid) && isset($shopid) && ($shopid != '') && ($userid != '')) {\n $result = 'Für Ihre Shop ID und User ID ist kein Janolaw Service erreichbar.';\n } else {\n $result = 'Bitte geben Sie Shop ID und User ID ein!';\n }\n }\n\n return $result;\n }", "function checkUser($S) {\n \n if($userEmail = explode(\":\", $_COOKIE['SiteId'])[1]) {\n $sql = \"select name from members where email='$userEmail'\";\n\n if($n = $S->query($sql)) {\n list($memberName) = $S->fetchrow('num');\n if($memberName != \"Barton Phillips\") {\n echo \"<h1>Go Away</h1>\";\n exit();\n }\n }\n } else {\n echo \"<h1>Go Away</h1>\";\n exit();\n }\n}", "public function hasUser(): bool;", "public function is_registered_for_ttt($user_nick) {\n return $this->is_registered(\"ttt_registrations\", $user_nick);\n }", "public function checkUser($username){\n \t$pdo = $this->Connect();\n\t\t$sql = $pdo->prepare(\"SELECT * FROM admin WHERE \n username = :username or email = :email\");\n\t\t$sql -> execute([\"username\"=>$username,\"email\"=>$username]);\n\t\tif ($sql->rowCount()) {\n\t\t\treturn 'User Exist';\n\t\t} else {\n\t\t\treturn 'Premission Denied';\n\t\t}\n }", "public function is_user()\n\t{\n\t\treturn $this->acl()->check();\n\t}", "function check_user($user)\n\t{\n\t\t$con = connect();\n\t\t$user = mysqli_real_escape_string($con, $user);\n\t\t$get_user = \"SELECT user_id FROM user_accounts WHERE user_accounts.user_name = '$user'\";\n\t\t$result = mysqli_query($con, $get_user);\n\t\t$ret_val = (mysqli_num_rows($result) > 0);\n\t\tmysqli_close($con);\n\t\treturn $ret_val;\n\t}", "private function check_valid_user() {\n\n // Create oauth service\n $oauth2Service = new \\Google_Oauth2Service($this->client);\n\n // Get user info\n $userinfo = $oauth2Service->userinfo->get();\n\n // Get email and match to config user\n $user = $userinfo[\"email\"];\n\n // If user doesn't match configured auth user simply sign out\n if ($user !== $this->config->api_user) $this->sign_out();\n }", "function is_allowed_user(&$usr, $simple=0)\n{\n\tif (($banned = $usr->users_opt & 65536) && $usr->ban_expiry && $usr->ban_expiry < __request_timestamp__) {\n\t\tq('UPDATE fud30_users SET users_opt = '. q_bitand('users_opt', ~65536) .' WHERE id='. $usr->id);\n\t\t$usr->users_opt ^= 65536;\n\t\t$banned = 0;\n\t} \n\n\tif ($banned || is_email_blocked($usr->email) || is_login_blocked($usr->login) || is_ip_blocked(get_ip())) {\n\t\t$ban_expiry = (int) $usr->ban_expiry;\n\t\tif (!$simple) { // On login page we already have anon session.\n\t\t\tses_delete($usr->sid);\n\t\t\t$usr = ses_anon_make();\n\t\t}\n\t\tsetcookie($GLOBALS['COOKIE_NAME'].'1', 'd34db33fd34db33fd34db33fd34db33f', ($ban_expiry ? $ban_expiry : (__request_timestamp__ + 63072000)), $GLOBALS['COOKIE_PATH'], $GLOBALS['COOKIE_DOMAIN']);\n\t\tif ($banned) {\n\t\t\terror_dialog('Fout: u bent geblokkeerd.', 'Uw gebruiker is '.($ban_expiry ? 'tijdelijk geblokkeerd tot '.strftime('%a, %d %B %Y %H:%M', $ban_expiry) : 'permanent geblokkeerd' ) .'. U hebt geen toegang tot de site wegens het overtreden van de forumregels.');\n\t\t} else {\n\t\t\terror_dialog('Fout: uw gebruiker is uitgefilterd.', 'Uw gebruiker is verbannen van het forum vanwege een ingestelde filter.');\n\t\t}\n\t}\n\n\tif ($simple) {\n\t\treturn;\n\t}\n\n\tif ($GLOBALS['FUD_OPT_1'] & 1048576 && $usr->users_opt & 262144) {\n\t\terror_dialog('Fout: uw gebruiker is nog niet bevestigd', 'We hebben geen toestemming ontvangen van uw ouder of voogd. Dit is nodig om berichten toe te kunnen voegen. Als u uw COPPA-formulier kwijt bent, kunt u het <a href=\"index.php?t=coppa_fax&amp;'._rsid.'\">opnieuw bekijken</a>.');\n\t}\n\n\tif ($GLOBALS['FUD_OPT_2'] & 1 && !($usr->users_opt & 131072)) {\n\t\tstd_error('emailconf');\n\t}\n\n\tif ($GLOBALS['FUD_OPT_2'] & 1024 && $usr->users_opt & 2097152) {\n\t\terror_dialog('Gebruiker nog niet goedgekeurd', 'De beheerder heeft ervoor gekozen om handmatig alle gebruikers te beoordelen alvorens ze te activeren. Totdat uw gebruiker gecontroleerd is door een beheerder kunt u niet alle functies gebruiken.');\n\t}\n}", "public function check(){\n return ! is_null($this->user());\n }", "public function bienvenida_usuario_sin_nickname()\n {\n $this->get('/saludo/yeison')->assertStatus(200)->assertSee('Hola Yeison.');\n }", "public function testHasUser()\n {\n echo 'Test HasUser' . \"\\n\";\n $team = self::getTeam('Test');\n $user = self::getUser('teammember@team.com');\n $user2 = self::getUser('teammember2@team.com');\n $this->assertTrue($team->hasUser($user));\n $this->assertFalse($team->hasUser($user2));\n }", "function user_check($mdp, $identifiant)\n {\n $bdd = db_connect();\n\n $sql = 'SELECT id_user FROM user WHERE identifiant = ? and mdp = SHA1(?) ';\n $req = $bdd->prepare ($sql) ;\n $req->execute([$identifiant, $mdp]);\n\n $data = $req->fetch();\n $row = $req->rowCount(); \n\n // si le row est égal à 1 alors un utilisateur ac le combo mdp/nom existe\n if ($row == 1 )\n {\n return true;\n }\n }", "public function remind() {\n\t\t\n\t\t// SET: $process global\n\t\t$process \t= Process::get_instance();\n\t\t\n\t\t// GET: data of user\n\t\t$this->get_data();\n\t\t\n\t\t// CHECK: process state\n\t\tif ($process->run()) {\n\t\t\t\n\t\t\t// GET: send login credentiials\n\t\t\t$mailer = new Mailer();\n\t\t\t$mailer->add_to($this->tell('email'), $this->tell('firstName').' '.$this->tell('lastName'));\n\t\t\t$mailer->set_from(STRING_SETTING_PROJECT_EMAIL, STRING_SETTING_PROJECT_NAME);\n\t\t\t$mailer->set_subject('Important!');\n\n\t\t\t$html = str_replace('[[NAME]]', $this->display('firstName'), TEXT_CLASS_USER_EMAIL_REMIND);\n\t\t\t$html = str_replace('[[EMAIL]]', $this->display('email'), $html);\n\t\t\t$html = str_replace('[[PASS]]', $this->display('password'), $html);\n\t\t\t$mailer->set_body($html);\n\t\t\t\n\t\t\tif ($mailer->send()) {\n\t\t\t\t// REPORT: success\n\t\t\t\t$process->add_note(STRING_CLASS_USER_DONE_SEND_REMINDER, 'DONE');\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// REPORT: failure\n\t\t\t\t$process->add_note(STRING_CLASS_USER_FAIL_SEND_REMINDER);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t} else {\n\t\t\t// REPORT: failure\n\t\t\t$process->add_note(STRING_CLASS_USER_FAIL_SEND_REMINDER);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}" ]
[ "0.6267266", "0.6129915", "0.60928327", "0.5961406", "0.5869991", "0.58698285", "0.57785136", "0.5686952", "0.56436116", "0.5631862", "0.56115174", "0.5601807", "0.55563617", "0.5555333", "0.5552162", "0.5499293", "0.5455004", "0.54497665", "0.54473615", "0.54465747", "0.54397565", "0.5431761", "0.5429074", "0.54146916", "0.5408719", "0.54025614", "0.5386205", "0.53861475", "0.5358074", "0.53545463", "0.5340558", "0.5328049", "0.5320944", "0.5311418", "0.5303861", "0.53025943", "0.5299072", "0.52932143", "0.528211", "0.526849", "0.5237728", "0.52354497", "0.5227063", "0.52176905", "0.52173173", "0.521728", "0.5213349", "0.5194063", "0.5193593", "0.5188616", "0.518566", "0.51823825", "0.51823825", "0.51705927", "0.51609933", "0.51593333", "0.5155308", "0.51526695", "0.51524556", "0.5152121", "0.5146364", "0.5141882", "0.5140493", "0.51256603", "0.51249295", "0.5123752", "0.51192355", "0.5118531", "0.5115793", "0.5109587", "0.5109001", "0.5108647", "0.5106982", "0.51050204", "0.51038206", "0.5102196", "0.5099219", "0.5093985", "0.50856036", "0.50835043", "0.5057796", "0.5056233", "0.5052954", "0.5052554", "0.50514996", "0.50502104", "0.5042536", "0.503741", "0.50360763", "0.50334436", "0.5032969", "0.5028303", "0.50228214", "0.50182813", "0.5013832", "0.50118834", "0.5010083", "0.50086236", "0.5008608", "0.5007771" ]
0.71255755
0
Get the achievements of a user
Получить достижения пользователя
protected function _getAchievements($user) { $stmt = $this->_db->getAdapter()->prepare($this->_db->getAdapter()->select() ->from('achievements') ->where('user_id=:user') ->order(new Zend_Db_Expr( "FIELD(achieved, 'true', 'false')" ))); $stmt->bindParam('user', $user, Zend_Db::PARAM_INT); $stmt->execute(); return $stmt->fetchAll(Zend_Db::FETCH_ASSOC); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function playerAchievements() {\n $achievements = new Achievement();\n $list = array();\n\t\t$player = User::getUser();\n \n\t\tif($player->canAccess('Edit achievement information') === FALSE) {\n\t\t\tDooUriRouter::redirect(MainHelper::site_url('admin'));\n\t\t}\n\t\t\n\t\t//$pager = $this->appendPagination($list, new stdClass(), $users->getTotalPlayers($player), MainHelper::site_url('admin/users/page'), Doo::conf()->adminPlayersLimit);\n\t\t$list['achievements'] = $achievements->getAllPlayerAchievements();\n\t\t\n\t\t$data['title'] = $this->__('Achievements');\n\t\t$data['body_class'] = 'index_player_achievements';\n\t\t$data['selected_menu'] = 'achievements';\n\t\t$data['left'] = $this->renderBlock('achievements/common/leftColumn');\n\t\t$data['right'] = 'right';\n\t\t$data['content'] = $this->renderBlock('achievements/player_achievements', $list);\n\t\t$data['header'] = $this->getMenu();\n\t\t$this->render3Cols($data); \n\t}", "public function achievements()\n\t{\n\t\t$config \t= Foundry::config();\n\n\t\tif( !$config->get( 'badges.enabled' ) )\n\t\t{\n\t\t\treturn $this->redirect( FRoute::dashboard( array() , false ) );\n\t\t}\n\n\t\t// Get the current user id that should be displayed\n\t\t$userId \t= JRequest::getInt( 'userid' , null );\n\n\t\t$user \t\t= Foundry::user( $userId );\n\n\t\t// If user is not found, we need to redirect back to the dashboard page\n\t\tif( !$user->id )\n\t\t{\n\t\t\treturn $this->redirect( FRoute::dashboard( array() , false ) );\n\t\t}\n\n\t\t$title \t\t= JText::_( 'COM_EASYSOCIAL_PAGE_TITLE_ACHIEVEMENTS' );\n\n\n\t\tif( !$user->isViewer() )\n\t\t{\n\t\t\t$title\t\t= JText::sprintf( 'COM_EASYSOCIAL_PAGE_TITLE_ACHIEVEMENTS_USER' , $user->getName() );\n\n\t\t\t// Let's test if the current viewer is allowed to view this user's achievements.\n\t\t\t$my \t\t= Foundry::user();\n\t\t\t$privacy\t= $my->getPrivacy();\n\t\t\t$allowed \t= $privacy->validate( 'profiles.view' , $user->id , SOCIAL_TYPE_USER );\n\n\t\t\tif( !$allowed )\n\t\t\t{\n\t\t\t\t$this->set( 'user' , $user );\n\t\t\t\tparent::display( 'site/profile/restricted' );\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Set the page title\n\t\tFoundry::page()->title( $title );\n\n\t\t// Set the page breadcrumb\n\t\tFoundry::page()->breadcrumb( JText::_( 'COM_EASYSOCIAL_PAGE_TITLE_ACHIEVEMENTS' ) , FRoute::badges( array( 'userid' => $userId , 'layout' => 'achievements' ) ) );\n\n\t\t// @TODO: Check for privacy\n\n\t\t$model \t\t\t= Foundry::model( 'badges' );\n\t\t$badges \t\t= $model->getBadges( $user->id );\n\t\t$totalBadges\t= count( $badges );\n\n\t\t$this->set( 'totalBadges' , $totalBadges );\n\t\t$this->set( 'badges' , $badges );\n\t\t$this->set( 'user'\t, $user );\n\n\t\tparent::display( 'site/badges/achievements' );\n\t}", "public function getAchievements($app, $user = 'ChetFaliszek')\n\t{\n\t\t// Initialise variables\n\t\t$achievements = array();\n\n\t\ttry\n\t\t{\n\t\t\t$game = $this->getGame($app, $user);\n\t\t\t$url = isset($game->statsLink) ? $game->statsLink.'/?xml=1' : STEAMWORKS_API_SERVER.'/'.$user.'/stats/appid/'.$game->appID.'/?xml=1';\n\t\t\t$xml = $this->getData($url);\n\t\t\t\n\t\t\t// Check for an error\n\t\t\tif(isset($xml->error))\n\t\t\t{\n\t\t\t\tthrow new JException($xml->error);\n\t\t\t}\n\n\t\t\tforeach ($xml->achievements->achievement as $achievement)\n\t\t\t{\n\t\t\t\t$achievements[] = array('iconClosed' => (string)$achievement->iconClosed, 'iconOpen' => (string)$achievement->iconOpen, 'name' => (string)$achievement->name, 'description' => (string)$achievement->description);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(JException $e){throw $e;}\n\n\t\treturn $achievements;\n\t}", "public function getAchievements()\r\n\t{\r\n\t\tif(empty($this->achievements))\r\n\t\t{\r\n\t\t\tforeach($this->xmlData->achievements as $achievement)\r\n\t\t\t{\r\n\t\t\t\t$this->achievements[] = new GameAchievement($this->steamId, $this->appId, $achievement->name, ($achievement->closed == 1));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $this->achievements;\r\n\t}", "public function showAchievements($userId)\n {\n $user = User::find($userId);\n\n if (!$user) {\n return response()->json(['message' => 'Invalid user ID'])\n ->setStatusCode(404);\n }\n\n $achievementTypes = Achievement::select('type')\n ->groupBy('type')\n ->get();\n\n $achievements = Achievement::orderBy('type')\n ->orderBy('requirement', 'DESC')\n ->get();\n\n $unlockedAchievements = [];\n $currentBadge = ['title' => 'Beginner'];\n foreach ($user->achievements as $userAchievement) {\n if ($userAchievement->type == 'badges') {\n $currentBadge = [\n 'title' => $userAchievement->title\n ];\n\n continue;\n }\n\n $unlockedAchievements[] = [\n 'type' => $userAchievement->type,\n 'title' => $userAchievement->title,\n ];\n }\n\n $nextAvailableAchievements = [];\n $nextBadge = [];\n $nextBadgeRequirement = 0;\n\n foreach ($achievementTypes as $achievementType) {\n $achievementType = $achievementType->type;\n\n $unlockedTypeAchievements = [];\n $nextAvailableAchievement = [];\n\n foreach ($unlockedAchievements as $unlockedAchievement) {\n if ($unlockedAchievement['type'] == $achievementType) {\n $unlockedTypeAchievements[] = $unlockedAchievement['title'];\n }\n }\n\n foreach ($achievements as $achievement) {\n if (!in_array($achievement->title, $unlockedTypeAchievements) && $achievement->type == $achievementType && $achievement->type != 'badges') {\n $nextAvailableAchievement = [\n 'type' => $achievement->type,\n 'title' => $achievement->title,\n ];\n }\n }\n\n foreach ($achievements as $achievement) {\n if ($achievement->type == 'badges' && $achievement->title != $currentBadge['title']) {\n $nextBadge = [\n 'title' => $achievement->title\n ];\n\n $nextBadgeRequirement = $achievement->requirement;\n } else {\n break;\n }\n }\n\n if ($nextAvailableAchievement) {\n $nextAvailableAchievements[] = $nextAvailableAchievement;\n }\n }\n\n $remainingToUnlockNextBadge = $nextBadgeRequirement - $user->achievements\n ->where('type', '!=', 'badges')\n ->count();\n\n return response()->json([\n 'unlocked_achievements' => $unlockedAchievements,\n 'next_available_achievements' => $nextAvailableAchievements,\n 'current_badge' => $currentBadge,\n 'next_badge' => $nextBadge,\n 'remaining_to_unlock_next_badge' => $remainingToUnlockNextBadge\n ]);\n }", "public function getAchievementResource() {\r\n\t\t$url = 'http://eu.battle.net/api/wow/data/character/achievements';\r\n\t\treturn $this->makeRequest($url);\r\n\t}", "public function getAchievements($userId, $gameId) : AchievementList\n {\n // Create the URL to get the user's achievements.\n $url1 = $this->baseAPIUrl . 'ISteamUserStats/GetPlayerAchievements/v0001/';\n $parameters1 = '?key=' . $this->apiKey . '&steamid=' . $userId . '&appid=' . $gameId;\n $url1 = $url1 . $parameters1;\n // Create the URL to get the game's achievements.\n $url2 = $this->baseAPIUrl . 'ISteamUserStats/GetSchemaForGame/v0002/';\n $parameters2 = '?key=' . $this->apiKey . '&appid=' . $gameId;\n $url2 = $url2 . $parameters2;\n // Make the requests to get JSON objects.\n $jsonObject1 = $this->performRequest($url1);\n $jsonObject2 = $this->performRequest($url2);\n // Check if the JSON objects have errors. Return an empty object if so.\n if ($this->hasErrors($jsonObject1) || $this->hasErrors($jsonObject2)) {\n return new AchievementList();\n }\n // Check if both requests were made successfully. If not, return an empty AchievementList.\n $success1 = $jsonObject1['playerstats']['success'];;\n if ($success1 == false || count($jsonObject2) == 0) {\n return new AchievementList();\n }\n // Get the lists of achievements in both JSON objects and use them to load the AchievementList.\n $playerAchievements = $jsonObject1['playerstats']['achievements'] ?? [];\n $gameAchievements = $jsonObject2['game']['availableGameStats']['achievements'] ?? [];\n return $this->loadAchievements($playerAchievements, $gameAchievements);\n }", "public function getDashboardAchievements($userId)\n {\n $user = User::find($userId);\n if ($user->isSuperAdmin()) {\n $totalAccounts = Account::all();\n $totalCharities = Charity::all();\n $totalEvents = Event::all();\n $totalUsers = User::all()->except(Auth::id());\n\n return [\n 'total_accounts' => json_encode($totalAccounts),\n 'total_charities' => json_encode($totalCharities),\n 'total_events' => json_encode($totalEvents),\n 'total_users' => json_encode($totalUsers)\n ];\n }\n $userAccounts = $user->accounts;\n $userCharities = $user->charities;\n $userEvents = $user->events;\n\n return [\n 'user_accounts' => json_encode($userAccounts),\n 'user_charities' => json_encode($userCharities),\n 'user_events' => json_encode($userEvents)\n ];\n }", "public function checkAchievements($player){\r\n\r\n $res = array();\r\n // 100 pts achievement\r\n if ($player->totalPoints >= 100 && $player->totalPoints < 200){\r\n\r\n $tmpres = $player->addAchievement(\"first100\");\r\n if (!empty( $tmpres)){\r\n $res[] = $tmpres;\r\n }\r\n\r\n \r\n //500 pts achievemnet\r\n }elseif ($player->totalPoints >= 500 && $player->totalPoints < 600){\r\n \r\n $tmpres = $player->addAchievement(\"first500\");\r\n if (!empty( $tmpres)){\r\n $res[] = $tmpres;\r\n }\r\n }\r\n return $res;\r\n }", "private function loadAchievements($playerAchievements, $gameAchievements) : AchievementList\n {\n // Iterate over the lists of achievements and create Achievement objects.\n $achievementList = new AchievementList();\n $lastIndex = count($playerAchievements) - 1;\n for ($i = 0; $i <= $lastIndex; $i++) {\n // Get the player and game achievements.\n $playerAchievement = $playerAchievements[$i];\n $gameAchievement = $gameAchievements[$i];\n // Get each attribute to construct an Achievement object.\n $name = $gameAchievement['displayName'];\n $description = $gameAchievement['description'] ?? 'No Description';\n $earned = $this->getBooleanValue($playerAchievement['achieved']);\n $dateEarned = $playerAchievement['unlocktime'];\n $dateEarned = $this->convertUnixEpochTimeToDate($dateEarned);\n $iconImage = $gameAchievement['icon'] ?? \"/svg/default_image.png\";\n\n // Create and add the Achievement object to the AchievementList object.\n $achievement = new Achievement($name, $description, $earned, $dateEarned);\n $achievement->setIconImage($iconImage);\n $achievementList->addAchievement($achievement);\n }\n // Return the AchievementList object.\n return $achievementList;\n }", "public function loadAchievements(){\n $this->cacheData = WCF::getCache()->get('achievements-'.PACKAGE_ID, 'achievements');\n\n foreach($this->cacheData as $achievementID => $achievementData){\n if($achievementData['objectName'] == $this->objectName)\n $this->achievements[$achievementID] = new Achievement(null, $achievementData);\n }\n\t\t\n\t\t$this->compareAchievements();\n }", "public function getAchievements(string $id): array\n {\n return $this->parser->parseAchievements($id);\n }", "function getAvailableAchievements($con, $player_id)\n{\n\n\t$sql = \"SELECT ac.ID FROM ac WHERE ac.ac_visibility = 'Sichtbar' AND NOT EXISTS (SELECT null FROM ac_player WHERE ac_player.player_id = '$player_id' AND ac_player.ac_id = ac.ID)\";\n\t$result = mysqli_query($con,$sql);\n\twhile($row=mysqli_fetch_assoc($result))\n\t{\n\t\t$basic_ac[] = $row[\"ID\"];\n\t}\n\n\treturn $basic_ac;\n}", "public function achievement()\n\t{\n\t\treturn $this->belongs_to('Achievement');\n\t}", "public function index()\n {\n $achieves = Achieve::all()->take(4);\n\n return AchieveResource::collection($achieves);\n }", "public function show(User $user)\n {\n if ($user->id !== auth()->user()->id && auth()->user()->cannot('View Members'))\n {\n abort(403);\n }\n $achievements = Achievement::all();\n return view('user.show', compact('user', 'achievements'));\n }", "public function get_availabilities($event_id, $user_id);", "public function getGoals()\n {\n /** @var Stopwatch $timer */\n $timer = new Stopwatch();\n $timer->start('Get Goals', 'Jawbone UP API');\n\n try\n {\n $body = array();\n /** @var object $goals */\n $goals = $this->makeApiRequest('/users/@me/goals', 'GET', $body);\n $timer->stop('Get Goals');\n return $goals;\n }\n catch (\\Exception $e)\n {\n $timer->stop('Get Goals');\n throw new JawboneException('Unable to get goals for the user.', 501, $e);\n }\n }", "public function index()\n {\n $achievements = Achievement::all();\n return view('admin.achievement.index', compact('achievements'));\n }", "public function forUser(User $user) {\n\t\treturn Goal::where ( 'user_id', $user->id )->orderBy ( 'created_at', 'asc' )->get ();\n\t}", "public function getAchievement($id)\n {\n $responseObject = $this->prepareResponseObject($id);\n $rewardItemService = new RewardItemService();\n $criteriaService = new CriteriaService();\n\n $achievement = new AchievementValueObject(\n $responseObject->id,\n $responseObject->title,\n $responseObject->points,\n $responseObject->description,\n $responseObject->reward,\n $rewardItemService->prepareRewardItemValueObject($responseObject->rewardItems),\n $responseObject->icon,\n $criteriaService->prepareMultipleCriteriaValueObject($responseObject->criteria),\n $responseObject->accoountWide,\n $responseObject->factionId\n );\n\n return $achievement;\n }", "public function achievement()\n {\n return $this->belongsTo('App\\Models\\Achievement');\n }", "public function userprofile_customtabs($intUserID){\n\t\tif($this->user->check_auths(array('u_awards_view', 'a_awards_manage'), 'OR', false)){\n\t\t\t$arrAchIDs\t\t= $this->pdh->get('awards_achievements', 'id_list');\n\t\t\t$intUserID\t\t= $intUserID['user_id'];\n\t\t\t$intViewerID\t= $this->user->id;\n\t\t\t$allAwards\t\t= array();\n\t\t\t$intAP\t\t\t= $awReachedCounter = 0;\n\t\t\t$awReached\t\t= 'reached';\n\t\t\t$content\t\t= '';\n\t\t\t\n\t\t\t\n\t\t\t//sorting -- newest date = up, false = unreached\n\t\t\tforeach($arrAchIDs as $intAchID){\n\t\t\t\t$award = $this->awards->award($intAchID, $intUserID);\n\t\t\t\tif(isset($award['member_r'][$intUserID])){\n\t\t\t\t\t$allAwards[$award['id']] = $award['date'];\n\t\t\t\t\t$intAP += $award['points']; $awReachedCounter++;\n\t\t\t\t\t\n\t\t\t\t}else{ $allAwards[$award['id']] = false; }\n\t\t\t}\n\t\t\tarsort($allAwards);\n\t\t\t\n\t\t\t//split $allAwards for pagination\n\t\t\t$intPage = $this->in->get('page', 0);\n\t\t\t$arrUserSettings = $this->pdh->get('user', 'plugin_settings', array($intViewerID));\n\t\t\t$arrUserSettings['aw_pagination'] = (isset($arrUserSettings['aw_pagination']))? $arrUserSettings['aw_pagination'] : 25;\n\t\t\t$allAwardsCount = count($allAwards);\n\t\t\t$allAwards = array_slice($allAwards, $intPage * $arrUserSettings['aw_pagination'], $arrUserSettings['aw_pagination'], true);\n\t\t\t\n\t\t\t\n\t\t\tforeach($allAwards as $intAchID => $status){\n\t\t\t\t$award = $this->awards->award($intAchID, $intUserID);\n\t\t\t\t\n\t\t\t\t$strAchIcon = $this->awards->build_icon($intAchID, $award['icon'], unserialize($award['icon_colors']));\n\t\t\t\t\n\t\t\t\tif(!isset($award['member_r'][$intViewerID])) $awReached = 'unreached';\n\t\t\t\t\n\t\t\t\t$this->tpl->assign_block_vars('award', array(\n\t\t\t\t\t'ID'\t\t=> $intAchID,\n\t\t\t\t\t'TITLE'\t\t=> $this->user->multilangValue($award['name']),\n\t\t\t\t\t'DESC'\t\t=> $this->user->multilangValue($award['desc']),\n\t\t\t\t\t'DATE'\t\t=> ($award['date'])? $this->time->user_date($award['date']) : '',\n\t\t\t\t\t'ICON'\t\t=> $strAchIcon,\n\t\t\t\t\t'ACTIVE'\t=> $award['active'],\n\t\t\t\t\t'SPECIAL'\t=> $award['special'],\n\t\t\t\t\t'AP'\t\t=> $award['points'],\n\t\t\t\t\t'DKP'\t\t=> $award['dkp'],\n\t\t\t\t\t'REACHED'\t=> $awReached,\n\t\t\t\t\t'USER_R'\t=> (isset($award['member_r'][$intViewerID]))? true : false,\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t//build the members\n\t\t\t\tif(isset($award['member_r'][$intUserID]))\n\t\t\t\t\tforeach($award['member_r'][$intUserID] as $intMemberID => $intMemberDate){\n\t\t\t\t\t\t$this->tpl->assign_block_vars('award.members', array(\n\t\t\t\t\t\t\t'MEMBER'\t=> $this->pdh->get('member', 'name_decorated', array($intMemberID, 15)),\n\t\t\t\t\t\t\t'DATE'\t\t=> ($intMemberDate)? '- '.$this->time->user_date($intMemberDate) : $this->user->lang('aw_member_unreached'),\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\tif(isset($award['member_u'][$intUserID]))\n\t\t\t\t\tforeach($award['member_u'][$intUserID] as $intMemberID => $intMemberDate){\n\t\t\t\t\t\t$this->tpl->assign_block_vars('award.members', array(\n\t\t\t\t\t\t\t'MEMBER'\t=> $this->pdh->get('member', 'name_decorated', array($intMemberID, 15)),\n\t\t\t\t\t\t\t'DATE'\t\t=> $this->user->lang('aw_member_unreached'),\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->tpl->add_js('\n\t\t\t\t$(\"#my_aw_progress\").progressbar({\n\t\t\t\t\tvalue: '.$awReachedCounter.',\n\t\t\t\t\tmax: '.$allAwardsCount.',\n\t\t\t\t});\n\t\t\t\t$(\".progress-label\").text(\"'.$awReachedCounter.' / '.$allAwardsCount.'\");\n\t\t\t\t$(\"#achievement-points\").text(\"'.$intAP.'\");\n\t\t\t', 'docready');\n\t\t\t\n\t\t\t$template_file = file_get_contents($this->root_path.$this->pm->get_data('awards', 'template_path').'base_template/user_awards.html');\n\t\t\t$content = $this->tpl->compileString($template_file, array(\n\t\t\t\t'AP'\t\t\t=> $intAP,\n\t\t\t\t'PAGINATION'\t=> generate_pagination($this->strPath.$this->SID, $allAwardsCount, $arrUserSettings['aw_pagination'], $intPage, 'page'),\n\t\t\t));\n\t\t\t\n\t\t}else{ $content = $this->user->lang('aw_no_permission'); }\n\t\t\n\t\t//-----------------------------------------------------------------------------------\n\t\t\t$output = array(\n\t\t\t\t'title' => $this->user->lang('aw_customtab_title'),\n\t\t\t\t'content' => $content,\n\t\t\t);\n\t\t\treturn $output;\n\t}", "public function getName()\n {\n return 'achievements';\n }", "private function get_achievement_info($aid) {\n global $DB;\n $rec = $DB->get_record('achievements', array('id' => $aid, 'deleted' => 0));\n\n if ($rec) {\n $block_info = $DB->get_record('block_instances', array('id' => $rec->blockinstanceid));\n $instance = block_instance('game_achievements', $block_info);\n\n $rec->blocktitle = $instance->title;\n\n return $rec;\n } else {\n return null;\n }\n }", "public function getAwardedBountyUsers();", "public function getExperiences($userId)\n {\n }", "private function getAchievementRatio($userId, $gameId) : array\n {\n // Create the URL.\n $url = $this->baseAPIUrl . 'ISteamUserStats/GetPlayerAchievements/v0001/';\n $parameters1 = '?key=' . $this->apiKey . '&steamid=' . $userId . '&appid=' . $gameId;\n $url = $url . $parameters1;\n // Make the request to get a JSON object.\n $jsonObject = $this->performRequest($url);\n // Check if the JSON object has errors. Return an empty object if so.\n if ($this->hasErrors($jsonObject)) {\n return array(-1 , -1);\n }\n // Check if the provided game ID was valid. Return an empty object if not.\n $success = $jsonObject['playerstats']['success'];\n if ($success == false) {\n $this->errorLog['getAchievementRatio(' . $userId . ', ' . $gameId . ')'] =\n 'The Steam game ID is invalid or the user has not played this game.';\n return array(-1, -1);\n }\n // Get the JSON array of achievements.\n $achievements = $jsonObject['playerstats']['achievements'] ?? [];\n $total = count($achievements);\n // Iterate over the array to count the number of earned achievements.\n $earned = 0;\n foreach ($achievements as $achievement) {\n $achieved = $achievement['achieved'];\n if ($achieved == 1) {\n $earned++;\n }\n }\n // Return the number of earned and total achievements in an array of size two.\n return array($earned, $total);\n }", "function template_preprocess_achiever_achievement(&$vars) {\n $account = $vars['account'];\n\n /** @var AchieverAchievement $achievement */\n $achievement = $vars['achievement'];\n\n $vars['title'] = $achievement->getTitle();\n $vars['description'] = $achievement->getDescription();\n $vars['classes_array'][] = $achievement->isUnlocked($account) ? 'achiever-unlocked' : 'achiever-locked';\n $vars['classes_array'][] = achiever_css_identifier($achievement->getKey());\n}", "public function show(User $user)\n {\n $userLevel = User::getLevel(json_decode($user, true)[\"user_xp\"]);\n $nextLevel = User::getNextLevel(json_decode($user, true)[\"user_xp\"]);\n $achievements = Achievement::getAchievementsWithProgress(json_decode($user, true)[\"id\"]);\n\n $first = DB::table('period_awards')->where(\"user_id\", \"=\", $user->id)->where(\"place\", \"=\", \"1\")->get();\n $second = DB::table('period_awards')->where(\"user_id\", \"=\", $user->id)->where(\"place\", \"=\", \"2\")->get();\n $third = DB::table('period_awards')->where(\"user_id\", \"=\", $user->id)->where(\"place\", \"=\", \"3\")->get();\n\n\n return view('user.show', compact('user', 'userLevel', 'nextLevel', 'achievements', 'first', 'second', 'third'));\n }", "public function __construct(UserAchievements $user_achievement, User $user)\n {\n $this->user_achievement = $user_achievement;\n $this->user = $user;\n }", "public function actionIndex()\n {\n $searchModel = new AchievementSearch();\n\n $dataProvider = $searchModel->search();\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ]);\n }", "public function index($user_id)\n\t{\n\t\t$user = User::findOrFail($user_id);\n\t\treturn $user->expenses;\n\t}", "public function abilities()\n {\n // Only handle gets\n if ($this->method != 'GET') {\n return self::NOT_GET_RESPONSE;\n }\n $abilitiesData = $this->getJsonFromFile(self::ABILITIES_FILENAME);\n return $this->getBasicNamedStructure($abilitiesData);\n }", "public function getUserAssistances()\n {\n return $this->hasMany(UserAssistance::class, ['gym_discipline_id' => 'id']);\n }", "public function achievements($identity, $params = [])\n {\n if (!is_array($identity) && !is_int($identity) && !(is_string($identity) && ctype_digit($identity))) {\n throw new ParameterTypeMismatchException(\"Parameter 'identities' type mismatch.\");\n }\n if (is_array($identity)) {\n if (count($identity) > 1) {\n throw new MultipleAccountIdException(\"Method 'achievements' expects an identity with single account_id\");\n } else {\n $identity = $identity[0];\n }\n }\n \n $accountId = $this->extractId($identity);\n $params['account_id'] = $accountId;\n\n $array = $this->request('tanks/achievements/', $params);\n $achievements = [];\n foreach ($array['data'][$accountId] as $info) {\n $achievements[$info['tank_id']] = new Dto\\Tanks($info);\n }\n\n return $achievements;\n }", "public static function getStartingAchievements($gameType,$avatar){\n switch ($gameType){\n case \"Main\":\n $avatar->addAchievement(\"A001\");\n break;\n default:\n break;\n }\n }", "function template_preprocess_achiever_achievement_group(&$vars) {\n $account = $vars['account'];\n\n /** @var AchieverAchievementGroup $achievement */\n $achievement = $vars['achievement'];\n $achievements = $achievement->getAchievements();\n\n $vars['title'] = $achievement->getTitle();\n $vars['description'] = $achievement->getDescription();\n $vars['classes_array'][] = $achievement->isUnlocked($account) ? 'achiever-unlocked' : 'achiever-locked';\n $vars['classes_array'][] = achiever_css_identifier($achievement->getKey());\n $vars['achievements'] = $achievements;\n $vars['unlocked'] = 0;\n $vars['total'] = 0;\n\n foreach ($achievements as $sub_achievement) {\n if ($sub_achievement->isUnlocked($account)) {\n $vars['unlocked']++;\n }\n\n $vars['total']++;\n }\n\n if ($vars['unlocked'] > 0) {\n $vars['classes_array'][] = 'achiever-in-progress';\n }\n}", "public function getAchieve()\n {\n return $this->Achieve;\n }", "public function index()\n {\n// $user_id = Auth::id();\n// $goals = Goal::where('user_id', Auth::id())->orderBy('created_at', 'asc')->get();\n $goals = Auth::user()->goals()->orderBy('created_at', 'desc')->get();\n\n return view('list_goals', [\n 'goals' => $goals\n ]);\n }", "public function getAccountActivities ();", "public function getAuthorities();", "public function parseGuildAchievementOverview($arrAchievs){\n\t\t\t$this->game->new_object('bnet_armory', 'armory', array($this->config->get('uc_server_loc'), $this->config->get('uc_data_lang')));\n\n\t\t\t$arrGuildAchievementsData = $this->game->obj['armory']->getdata('guild', 'achievements');\n\t\t\t$arrOut = array();\n\t\t\t$done = array();\n\t\t\t$doneIDs = array();\n\t\t\t$arrOut['total'] = array(\n\t\t\t\t'total' => 0\n\t\t\t);\n\t\t\tforeach ($arrGuildAchievementsData['achievements'] as $arrCatAchievs){\n\t\t\t\t$completed = 0;\n\t\t\t\t$achievs = 0;\n\n\t\t\t\tforeach ($arrCatAchievs['achievements'] as $arrCatAchievs2){\n\n\t\t\t\t\t//if (isset($done[$arrCatAchievs2['title']])) continue;\n\t\t\t\t\tif (isset($doneIDs[$arrCatAchievs2['id']])) continue;\n\t\t\t\t\t$done[$arrCatAchievs2['title']] = true;\n\t\t\t\t\t$doneIDs[$arrCatAchievs2['id']] = true;\n\n\t\t\t\t\tif (in_array((int)$arrCatAchievs2['id'], $arrAchievs['achievementsCompleted'])) $completed++;\n\t\t\t\t\t$achievs++;\n\t\t\t\t}\n\n\t\t\t\tif (isset($arrCatAchievs['categories'])){\n\t\t\t\t\tforeach ($arrCatAchievs['categories'] as $arrCatAchievs2){\n\n\t\t\t\t\t\tforeach ($arrCatAchievs2['achievements'] as $arrCatAchievs3){\n\t\t\t\t\t\t\t//if (isset($done[$arrCatAchievs3['title']])) continue;\n\t\t\t\t\t\t\tif (isset($doneIDs[$arrCatAchievs3['id']])) continue;\n\t\t\t\t\t\t\t$done[$arrCatAchievs3['title']] = true;\n\t\t\t\t\t\t\t$doneIDs[$arrCatAchievs3['id']] = true;\n\n\t\t\t\t\t\t\tif (in_array((int)$arrCatAchievs3['id'], $arrAchievs['achievementsCompleted'])) $completed++;\n\t\t\t\t\t\t\t$achievs++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$arrOut[$arrCatAchievs['id']] = array(\n\t\t\t\t\t'id'\t=> $arrCatAchievs['id'],\n\t\t\t\t\t'name'\t=> $arrCatAchievs['name'],\n\t\t\t\t\t'total' => $achievs,\n\t\t\t\t\t'completed' => $completed,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t//Now, let's cheat a bit\n\t\t\t$arrOut[15088]['total'] = $arrOut[15088]['total'] - 8;\n\t\t\t$arrOut[15078]['total'] = $arrOut[15078]['total'] - 13;\n\t\t\t$arrOut[15079]['total'] = $arrOut[15079]['total'] - 2;\n\t\t\t$arrOut[15089]['total'] = $arrOut[15089]['completed'];\n\t\t\t$arrOut[15093]['total'] = $arrOut[15093]['completed'];\n\n\t\t\t$total = 0;\n\t\t\tforeach ($arrOut as $val){\n\t\t\t\t$total += $val['total'];\n\t\t\t}\n\n\t\t\t$arrOut['total'] = array(\n\t\t\t\t'total' \t=> $total,\n\t\t\t\t'completed' => count($arrAchievs['achievementsCompleted']),\n\t\t\t\t'name' \t\t=> $this->glang('guildachievs_total_completed'),\n\t\t\t);\n\n\t\t\treturn $arrOut;\n\t\t}", "public static function getAchievementDetails($steamID, $appID)\n\t\t{\n\t\t\t$apiResponse = file_get_contents(self::BASE_URL . \"ISteamUserStats/GetPlayerAchievements/v0001/?appid=\" . urlencode($appID) .\"&key=\" . self::API_KEY . \"&steamid=\" . urlencode($steamID) .\"&format=json&l=english\");\n\t\t\treturn json_decode($apiResponse, true);\n\t\t}", "public function getAwardsByUser($db, $user){ \n $query = \"SELECT * FROM awards_report_page WHERE user= :user\";\n $pdostm = $db->prepare($query);\n $pdostm->bindValue(':make', $user, \\PDO::PARAM_STR);\n $pdostm->execute();\n $s = $pdostm->fetchAll(PDO::FETCH_OBJ);\n return $s;\n }", "public function getUserAgreements(string $user): array\n {\n $user = urlencode($user);\n $url = \"/$user/agreements\";\n\n $req = $this->createRequest($url);\n $res = $this->doRequest($req);\n\n // no paging for user agreements -> no need to evaluate headers\n return $res[0];\n }", "function wpgp_db_govr_get_user_stats($user) {\r\n global $wpdb;\r\n\r\n /* How many contribs */\r\n $sql = \"SELECT count(user_id) FROM \" . WPGP_GOVR_CONTRIB_TABLE . \"\r\n WHERE user_id = %d\";\r\n $contribs = $wpdb->get_var($wpdb->prepare($sql, array($user)));\r\n\r\n /* How many votes */\r\n $sql = \"SELECT count(user_id) FROM \" . WPGP_GOVR_USER_VOTES . \"\r\n WHERE user_id = %d\";\r\n $votes = $wpdb->get_var($wpdb->prepare($sql, array($user)));\r\n return array(\"contribs\" => $contribs, \"votes\" => $votes);\r\n}", "public function getGamesUser()\n {\n $games = Game::whereHas('users', function($query){\n $query->where('user_id', Auth::user()->id);\n })\n ->get();\n \n return $games;\n }", "public function listByUser($userId)\n {\n $badges = Badge::\n where('user_id', $userId)\n // ->where(function ($query) {\n // $query->groupBy('chapter_id');\n // })\n ->get();\n return response()->json($badges);\n }", "static function getLevelsToModerate(User $user, array $params=[]){\n $toModerates = AddonController::getLevel(NULL, LEVEL_TYPE::TOMODERATE);\n echo json_encode($toModerates);\n }", "public static function getAnnouncebyuser() {\r\n\r\n global $db; \r\n\r\n $reqAnnounces = $db->prepare('SELECT * FROM users WHERE pseudo = \"'.$_SESSION['pseudo'].'\"');\r\n $reqAnnounces->execute([]);\r\n return $reqAnnounces->fetchAll();\r\n }", "public function getUserOrganizations(User $user): array;", "function getGrantedUsers()\n {\n $users = [];\n if ($results = \\MySQL::getDB()->getRows(\"select u.*\n from users u\n inner join users_auth_groups_users g on g.userid = u.id\n where g.authgroupid = ?\"\n , [$this->id]))\n {\n foreach ($results as $result)\n {\n $user = new \\users\\model\\User();\n $user->load($result);\n $users[] = $user;\n }\n }\n\n return $users;\n }", "public function getUserAchievement($uid)\n {\n $result = $this->_mg->mixi_island->user_achievement->findOne(array('uid' => (string)$uid));\n \n if ($result) {\n return $result;\n }\n \n return false;\n }", "public function listEventsAttending($user) {\n\t\t$sql = \"SELECT p.name as creator_name, e.* FROM events e, profile p WHERE p.user_id=e.creator AND e.event_date >= CURDATE() AND (SELECT COUNT(*) FROM events_attendees a WHERE a.event_id=e.ID AND a.user_id={$user} AND a.status='attending') > 0\";\n\t\t$cache = $this->registry->getObject('db')->cacheQuery($sql);\n\t\treturn $cache;\n\t}", "public function getAwardsAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $categoryAwards = $em->getRepository(CategoryAwards::class)->findAll();\n\n return $categoryAwards;\n }", "public function index()\n {\n return Auth::user()->fluentCredits()->with(['group'])->get();\n }", "public function tampil_goals_forcoach($id_user)\n {\n // $id_user = $data['id_user'];\n return $this->db->query(\"SELECT * FROM goals WHERE id_user = $id_user AND action_plan_true = 'Y'\");\n }", "public function forGoalId(User $user, $goal_id) {\n\t\treturn Goal::where ( 'user_id', $user->id )->where ( 'id', $goal_id )->get ();\n\t}", "public function getAccess($user)\n {\n $this->has_hr_access = $this->getHRAccess();\n\n // List edit rights are checked only for HR users. \n // If user has manager access then it doesnt matter if he has access to list\n if (!$this->getListEditRights($user)) {\n $this->has_hr_access = false;\n }\n\n if (!$this->has_hr_access) {\n $this->has_manager_access = $this->getManagerAccess($user);\n }\n }", "public function get( $args, $assoc_args ) {\n\t\t$user = $this->fetcher->get_check( $args[0] );\n\t\t$user_data = $user->to_array();\n\t\t$user_data['roles'] = implode( ', ', $user->roles );\n\n\t\t$formatter = $this->get_formatter( $assoc_args );\n\t\t$formatter->display_item( $user_data );\n\t}", "public static function GetChallenges($user){\n $sql = \"SELECT * FROM Points WHERE UserId=?\";\n $aParams = array();\n $aParams[] = $user->ID();\n $aPoints = self::getDB()->executeQuery($sql, $aParams);\n\t\t$sql = \"SELECT COUNT(*) FROM Game\";\n \t$iNumGames = self::getDB()->executeQuery($sql);\n if (count($aPoints) != $iNumGames) \n \t{\n\t\t\tfor($i = 0; $i < $iNumGames; $i++)\n\t\t\t{\n\t \t\t$sql = \"INSERT INTO Points (GameID, UserID, Points, Is_Active) VALUES(?,?,?,?)\";\n\t\t\t\t$aToInsert = array();\n\t\t\t\t$aToInsert[] = $iNumGames;\n\t\t\t\t$aToInsert[] = $user->ID();\n\t\t\t\t$aToInsert[] = \"0\";\n\t\t\t\t$aToInsert[] = \"1\";\n\t\t\t\tself::getDB()->executeQuery($sql, $aToInsert);\n\t\t\t\tself::GetChallenges($user);\n\t \t\t$sql = \"SELECT * FROM Points WHERE UserId=?\";\n\t\t\t\t$aPoints = self::getDB()->executeQuery($sql, $aParams);\n\t\t\t}\n\t\t}\n $aChallenges = array();\n $sql = \"SELECT * FROM Challenge WHERE Game_ID=?\";\n foreach ($aPoints as $point){\n $aChallenges[] = self::getDB()->executeQuery($sql, array($point['gameid']));\n }\n return $aChallenges;\n }", "function get_user_enterprises()\n{\n return (auth('api')->payload())['enterprises'];\n}", "static function getApprovers() {\n global $user;\n $mdb2 = getConnection();\n\n $user_id = $user->getUser();\n $group_id = $user->getGroup();\n $org_id = $user->org_id;\n\n $approvers = array();\n $rank = ttUserHelper::getUserRank($user_id);\n $sql = \"select u.id, u.name, u.email\".\n \" from tt_users u\".\n \" left join tt_roles r on (r.id = u.role_id)\".\n \" where u.status = 1 and u.email is not null and u.group_id = $group_id and u.org_id = $org_id\".\n \" and (r.rank > $rank and r.rights like '%approve_timesheets%')\";\n $res = $mdb2->query($sql);\n if (!is_a($res, 'PEAR_Error')) {\n while ($val = $res->fetchRow()) {\n $approvers[] = $val;\n }\n }\n return $approvers;\n }", "protected function getBadges()\n\t{\n\t\t$userBadges = User::with('badges.badge')->find(Auth::user()->id);\n\t\t$allBadges = Badge::all();\n\n\t\t$userBadgeCount = $userBadges->badges->count();\n\t\t$userBadges->unlocked = $userBadgeCount;\n\t\t$userBadges->locked = $allBadges->count() - $userBadgeCount;\n\n\t\treturn $userBadges;\n\n\t}", "public function getAwardsById($id, $db){\n $sql = \"SELECT * FROM awards INNER JOIN user ON user.id = awards.user_id where awards.id = :id\";\n $pst = $db->prepare($sql);\n $pst->bindParam(':id', $id);\n $pst->execute();\n return $pst->fetch(\\PDO::FETCH_OBJ);\n }", "public function all($user)\n {\n return DB::table('budgets')\n ->join('activities', 'budgets.id', '=', 'activities.budget_id')\n ->where('activities.user_id', '=', $user)\n ->orderBy('activities.date', 'desc')\n ->get();\n }", "public function getUser()\n {\n return $this->user()->getResults();\n }", "function getStrengthGoals()\n {\n //query to get all strength goals of logged in user\n $sql = \"SELECT FITNESS_GOAL_ID,FITNESS_GOAL_TYPE,FITNESS_GOAL_DURATION,FITNESS_GOAL_MAXWEIGHT FROM FITNESS_GOALS WHERE FITNESS_GOAL_OWNER='$this->goalOwner' AND FITNESS_GOAL_TYPE LIKE 'STRENGTH-%' AND FITNESS_GOAL_ACTIVE='1'\";\n $query = $this->comMod->queryDatabase($sql);\n\n //make array of all goals\n $strengthGoals = [];\n $index = 0;\n\n //create goal objects and add into array\n while($currGoal = mysqli_fetch_array($query))\n {\n //get goal details from database\n $days = $currGoal['FITNESS_GOAL_DURATION'];\n $type = $currGoal['FITNESS_GOAL_TYPE'];\n $maxWeight = $currGoal['FITNESS_GOAL_MAXWEIGHT'];\n $id = $currGoal['FITNESS_GOAL_ID'];\n\n //create new goal object and add to array\n $goal = new StrengthGoal($days, $type, $maxWeight, $id);\n $strengthGoals[$index] = $goal;\n\n //increase array index\n $index++;\n }//end while\n\n //return array of goals\n return $strengthGoals;\n }", "public function getGoals($id) {\n require \"database.php\";\n if(mysqli_real_escape_string($conn, $id)) {\n //This query will get all information from a users goals\n $sql = \"SELECT * FROM goals WHERE from_user = '$id'\";\n $result = mysqli_query($conn, $sql);\n $resultCheck = mysqli_num_rows($result);\n if($resultCheck > 0) {\n $this->goals = $result;\n } else {\n $this->goals = \"\";\n }\n }\n }", "public function getListUserByLeader(){\n \n $res = array();\n \n User::getAllCapduoi($res, $this->user_id, $this->company_id);\n\n if(!in_array($this->user_id, $res)){\n $res[] = $this->user_id; \n }\n \n $user_list = array();\n \n \n sort($res);\n \n foreach ($res as $key => $u) {\n $user_list[] = User::getByID($u, $this->company_id);\n }\n \n return $user_list;\n }", "public function index(User $user)\n {\n return (new Authorize($user, 'view_attribute'))->check();\n }", "public function levels() {\n $achievements = new Achievement();\n $list = array();\n\t\t$player = User::getUser();\n \n\t\tif($player->canAccess('Edit achievement information') === FALSE) {\n\t\t\tDooUriRouter::redirect(MainHelper::site_url('admin'));\n\t\t}\n\t\t\n\t\t$pager = $this->appendPagination($list, new stdClass(), $achievements->getTotalLevels(), MainHelper::site_url('admin/achievements/levels/page'), Doo::conf()->adminAchievementsLimit);\n\t\t$list['levels'] = $achievements->getAllLevels($pager->limit);\n\t\t\n\t\t$data['title'] = $this->__('Levels');\n\t\t$data['body_class'] = 'index_levels';\n\t\t$data['selected_menu'] = 'achievements';\n\t\t$data['left'] = $this->renderBlock('achievements/common/leftColumn');\n\t\t$data['right'] = 'right';\n\t\t$data['content'] = $this->renderBlock('achievements/levels', $list);\n\t\t$data['header'] = $this->getMenu();\n\t\t$this->render3Cols($data); \n\t}", "public abstract function getusercapabilities($user);", "function getAcctInfo($user){\n\n}", "function getMemberAssets($userId) {\n global $db;\n \n try {\n $query = \"SELECT * FROM MemberAssets WHERE user_id = :user_id\";\n $stmt = $db->prepare($query);\n $stmt->bindParam(':user_id', $userId);\n $stmt->execute();\n $member_assets = $stmt->fetch(PDO::FETCH_ASSOC);\n return $member_assets;\n } catch (\\Exception $e) {\n throw $e;\n }\n}", "public function getBadges($user) {\n $user->load('badges');\n\n $categories = Category::has('badge')->get();\n\n $badges = [];\n\n foreach ($categories as $category) {\n if ($category->badge->image_name != null && $category->badge->image_name != \"\" && in_array($category->badge->id, $user->badges->lists('id')->toArray()))\n array_push($badges, $category->badge->image_name);\n }\n\n return $badges;\n }", "function wpachievements_invite_accepted($invited_user_id, $inviters){\n if( is_array($inviters) ){\n foreach($inviters as $inviter_id){\n $type='inviteacceptance'; $uid=$inviter_id; $postid='';\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\n if(function_exists('is_multisite') && is_multisite()){\n $points = (int)get_blog_option(1, 'wpachievements_iv_invite_acceptance_points');\n } else{\n $points = (int)get_option('wpachievements_iv_invite_acceptance_points');\n }\n }\n if(empty($points)){$points=0;}\n wpachievements_new_activity($type, $uid, $postid, $points);\n }\n } else{\n $type='inviteacceptance'; $uid=$inviters; $postid='';\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\n if(function_exists('is_multisite') && is_multisite()){\n $points = (int)get_blog_option(1, 'wpachievements_iv_invite_acceptance_points');\n } else{\n $points = (int)get_option('wpachievements_iv_invite_acceptance_points');\n }\n }\n if(empty($points)){$points=0;}\n wpachievements_new_activity($type, $uid, $postid, $points);\n }\n }", "public function schedaAllievo($user){\n\n return User::with('iscrizione')->with('iscrizione2')->where('id', $user)->get();\n }", "private function percent($user){\n\n //Check if user has client role\n if($user->hasRole('30')){\n\n // Take Initial Invest From User\n $userInitials = $user->funds()->where('type', 'initial')->get();\n $userInvest = 0;\n foreach ($userInitials as $initial) {\n $userInvest += $initial->amount;\n }\n\n // Take Initial Invest From Fund\n $fundInitial = Fund::Where('user_id', null)->where('type', 'initial')->where('period_id', null)->first();\n $fundInvest = $fundInitial->amount;\n $percent = $userInvest / $fundInvest;\n\n // Return user Fund Percent\n return $percent;\n }\n }", "public function getGoal()\n {\n $id = $_SESSION['id'];\n $goal = null;\n \n if ( null !== $this->getDB() )\n {\n $dbPrep = $this->getDB()->prepare('select goal_name, amount from goals where user_id = :id');\n \n $dbPrep->bindParam(':id', $id, PDO::PARAM_INT);\n }\n \n if ( $dbPrep->execute() && $dbPrep->rowCount() > 0 )\n {\n $goal = $dbPrep->fetch(PDO::FETCH_ASSOC);\n return $goal;\n }\n else\n {\n $error = $dbPrep->errorInfo();\n error_log(\"\\n\".$error[2], 3, \"logs/errors.log\");\n return $goal;\n }\n }", "public function index()\n {\n $user = User::find(Auth::id());\n if($user->isAbleTo('student_details')){\n\n $data = Achievements::join('preference_category','student_achievements.preference_category_id','preference_category.id')\n ->join('student_details','student_achievements.student_id','student_details.id')\n ->select('student_achievements.id', 'student_achievements.title',\n 'student_achievements.image',\n 'student_achievements.approval_status',\n 'student_achievements.approved_on',\n 'student_achievements.is_active',\n 'student_achievements.preference_category_id',\n 'preference_category.category_name',\n 'student_details.first_name',\n 'student_details.middle_name',\n 'student_details.last_name')\n ->where('student_achievements.is_deleted', 0)->orderBy('id','desc')->get();\n \n return view('studentAchievements.achievementslist',compact('data'));\n }else{\n abort(403,\"You don't have permission to access this page\");\n }\n }", "public function parseCharAchievementOverview($chardata){\n\t\t\t$this->game->new_object('bnet_armory', 'armory', array($this->config->get('uc_server_loc'), $this->config->get('uc_data_lang')));\n\n\t\t\t$arrAchievs = $chardata['achievements'];\n\t\t\t$arrCharAchievementsData = $this->game->obj['armory']->getdata('character', 'achievements');\n\t\t\t$arrOut = array();\n\t\t\t$done = array();\n\t\t\t$doneIDs = array();\n\t\t\t$arrOut['total'] = array(\n\t\t\t\t'total' => 0\n\t\t\t);\n\t\t\tif(is_array($arrCharAchievementsData['achievements'])){\n\t\t\t\tforeach ($arrCharAchievementsData['achievements'] as $arrCatAchievs){\n\t\t\t\t\t$completed = 0;\n\t\t\t\t\t$achievs = 0;\n\n\t\t\t\t\tforeach ($arrCatAchievs['achievements'] as $arrCatAchievs2){\n\n\t\t\t\t\t\t//if (isset($done[$arrCatAchievs2['title']])) continue;\n\t\t\t\t\t\tif (isset($doneIDs[$arrCatAchievs2['id']])) continue;\n\t\t\t\t\t\t$done[$arrCatAchievs2['title']] = true;\n\t\t\t\t\t\t$doneIDs[$arrCatAchievs2['id']] = true;\n\n\t\t\t\t\t\tif (is_array($arrAchievs['achievementsCompleted']) && in_array((int)$arrCatAchievs2['id'], $arrAchievs['achievementsCompleted'])) $completed++;\n\t\t\t\t\t\t$achievs++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($arrCatAchievs['categories'])){\n\t\t\t\t\t\tforeach ($arrCatAchievs['categories'] as $arrCatAchievs2){\n\n\t\t\t\t\t\t\tforeach ($arrCatAchievs2['achievements'] as $arrCatAchievs3){\n\t\t\t\t\t\t\t\t//if (isset($done[$arrCatAchievs3['title']])) continue;\n\t\t\t\t\t\t\t\tif (isset($doneIDs[$arrCatAchievs3['id']])) continue;\n\t\t\t\t\t\t\t\t$done[$arrCatAchievs3['title']] = true;\n\t\t\t\t\t\t\t\t$doneIDs[$arrCatAchievs3['id']] = true;\n\n\t\t\t\t\t\t\t\tif (is_array($arrAchievs['achievementsCompleted']) && in_array((int)$arrCatAchievs3['id'], $arrAchievs['achievementsCompleted'])) $completed++;\n\t\t\t\t\t\t\t\t$achievs++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$arrOut[$arrCatAchievs['id']] = array(\n\t\t\t\t\t\t'id'\t=> $arrCatAchievs['id'],\n\t\t\t\t\t\t'name'\t=> $arrCatAchievs['name'],\n\t\t\t\t\t\t'total' => $achievs,\n\t\t\t\t\t\t'completed' => $completed,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$total = 0;\n\t\t\tforeach ($arrOut as $val){\n\t\t\t\t$total += $val['total'];\n\t\t\t}\n\n\t\t\t$arrOut['total'] = array(\n\t\t\t\t'total' \t=> $total,\n\t\t\t\t'completed' => count($arrAchievs['achievementsCompleted']),\n\t\t\t\t'name' \t\t=> $this->glang('guildachievs_total_completed'),\n\t\t\t);\n\n\t\t\treturn $arrOut;\n\t\t}", "function acf_get_user_result($user) {}", "public function getByUsers();", "function apiGetAgencyAdverts()\n {\n\n $agencyToken = file_get_contents(codecept_data_dir('agency_token.json'));\n $this->restModule->haveHttpHeader('token', $agencyToken);\n $this->restModule->haveHttpHeader('Content-Type', 'application/json');\n $this->restModule->sendGET('/profiles/announcements/1/24');\n $this->restModule->seeResponseIsJson();\n $this->restModule->seeResponseCodeIs(200);\n $this->restModule->seeResponseMatchesJsonType([\n 'total' => 'integer',\n 'count' => 'integer',\n 'page' => 'integer',\n 'data' => 'array'\n ]);\n }", "public function findByUser(User $user)\n {\n return $user->assets()->get()->first();\n }", "public function getAppartmentsByUser(User $user): array\n {\n $data = $this->appartmentRepository->findByUser($user);\n\n return ['data' => $data];\n }", "function getMemberAnnuity($userId) {\n global $db;\n \n try {\n $query = \"SELECT * FROM MemberAnnuity WHERE user_id = :user_id\";\n $stmt = $db->prepare($query);\n $stmt->bindParam(':user_id', $userId);\n $stmt->execute();\n $member_annuity = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $member_annuity;\n } catch (\\Exception $e) {\n throw $e;\n }\n}", "public function getLoan()\n {\n return User::whereHas('transact', function($query){\n $query->where('type', 'loan')\n ->where('book_id', $this->attributes['id'])\n ->where('expires', '>', Carbon::now());\n })->get();\n }", "public function getAllEnabledUsers() {\r\n\t\t$user = \\creamy\\CreamyUser::currentUser();\r\n\t\t$userGroup = $this->getUserGroup($user->getUserId());\r\n\t\t\r\n\t\t// $this->dbConnector->where(\"status\", \"1\");\r\n\t\t$this->dbConnectorAsterisk->where(\"active\", \"Y\");\r\n\t\t$this->dbConnectorAsterisk->where(\"user\", array('VDAD', 'VDCL', 'goAPI'), 'not in');\r\n\t\tif ($user->getUserRole() == CRM_DEFAULTS_USER_ROLE_AGENT) {\r\n\t\t\t$this->dbConnectorAsterisk->where('user_level', '7', '>=');\r\n\t\t\tif ($userGroup != false) {\r\n\t\t\t\t$userGroup = ($userGroup == 'AGENTS') ? 'ADMIN' : $userGroup;\r\n\t\t\t\t$this->dbConnectorAsterisk->where('user_group', $userGroup);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// $cols = array(\"id\", \"name\", \"email\", \"phone\", \"role\", \"avatar\", \"creation_date\", \"status\");\r\n\t\t$cols = array(\"user_id\", \"user\", \"email\", \"phone_login\", \"user_level\", \"active\", \"full_name\");\r\n\t\treturn $this->dbConnectorAsterisk->get(CRM_USERS_TABLE_NAME_ASTERISK, null, $cols);\r\n\t}", "public function progress()\n {\n return $this->hasMany('Gstt\\Achievements\\Model\\AchievementProgress', 'achievement_id');\n }", "public function findMyOrganizations(UserInterface $user);", "public function getActive(int $userId): Collection;", "public function abilities ()\n {\n return $this->roles->map->abilities->flatten()->pluck('name')->unique(); // This relationship isn't eloquent though\n }", "function getAllPermitUser() {\n \n $service = connectSheet();\n\n $spreadsheetId = \"<YOUR_SPREADSHEET_ID>\"; //It is present in your URL\n\n $get_range = \"<SHEET_NAME:RANGE>\";\n\n //Request to get data from spreadsheet.\n\n $response = $service->spreadsheets_values->get($spreadsheetId, $get_range);\n\n $values = $response->getValues();\n\n return $values;\n}", "function show_badges( $user_id ) {\n\n\t\tif ( ! function_exists( 'mycred_get_users_badges' ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\twp_enqueue_script( 'um_mycred' );\n\t\twp_enqueue_style( 'um_mycred' );\n\n\t\t$output = '';\n\t\t$size = UM()->options()->get( 'mycred_badge_size' );\n\n\t\t$users_badges = mycred_get_users_badges( $user_id );\n\t\t$all_badges = mycred_get_badge_ids();\n\t\t$user_points = $this->get_points_clean( $user_id );\n\n\t\tif ( ! empty( $all_badges ) ) {\n\n\t\t\t$output .= '<span class=\"um-badges\">';\n\t\t\t$current_assigned_badges = 0;\n\t\t\tforeach ( $all_badges as $badge_id ) {\n\t\t\t\t$image_identification = false;\n\n\t\t\t\tif ( array_key_exists( $badge_id, $users_badges ) ) {\n\t\t\t\t\t$level = $users_badges[ $badge_id ];\n\t\t\t\t\t$badge = mycred_get_badge( $badge_id, $level );\n\t\t\t\t\t$image_identification = $badge->levels[ $level ]['image_url'];\n\n\t\t\t\t\tif ( $badge->levels[ $level ]['attachment_id'] > 0 ){\n\t\t\t\t\t\t$image_identification = $badge->levels[ $level ]['attachment_id'];\n\t\t\t\t\t\t$level_title = $badge->levels[ $level ]['label'];\n\n\t\t\t\t\t\tif ( ! empty( $level_title ) ) {\n\t\t\t\t\t\t\t$badge->title = \"{$badge->title} - {$level_title}\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$level++;\n\t\t\t\t\t\t\t$badge->title = \"{$badge->title} - Level {$level}\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( $image_identification ) {\n\t\t\t\t\t$image_url = wp_get_attachment_url( $image_identification );\n\t\t\t\t\t$title = apply_filters( 'um_mycred_badge_loop_title', $badge->title, $badge );\n\n\t\t\t\t\t$output .= '<span class=\"the-badge\">';\n\t\t\t\t\t$output .= '<img src=\"' . esc_url( $image_url ) . '\" title=\"'.esc_attr( $title ).'\" alt=\"' . esc_attr( $title ) . '\" width=\"' .$size . '\" height=\"' .$size. '\" class=\"mycred-badge earned um-tip-n\" />';\n\t\t\t\t\t$output .= '</span>';\n\t\t\t\t\t$current_assigned_badges++;\n\t\t\t\t}\n\n\t\t\t} // endforeach\n\n\t\t\t$output .= '</span>';\n\n\t\t\tif ( $current_assigned_badges <= 0 ) {\n\t\t\t\t$output = '';\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "private function checkMissionsForMembership($user)\n {\n $userMissions = collect([]);\n\n $this->games->each(function ($game) use (&$userMissions,&$user) {\n $game->missions->each(\n function ($mission) use (&$userMissions, $game,&$user) {\n $mission->venue_id = $game->venue_id;\n $mission->campaign_id = $game->campaign_id;\n $segmentId = explode(',',$mission->target_segments);\n\n\n Log::channel('custom')->info('segments',['segments'=>$segmentId]);\n if ($this->filterUserInSegmentsForSignUp($segmentId, ['type' => 'member_group'], $user)) {\n $userMissions->push($mission);\n }\n\n });\n });\n\n return $userMissions;\n }", "public function indexAction()\n {\n $user = Engine_Api::_()->user()->getViewer();\n\n if (isset($user['user_id'])) {\n $user_id = $user['user_id'];\n } else {\n $user_id = null;\n }\n\n // Get Member Level ID\n if (isset($user['level_id'])) {\n $user_member_level_id = $user['level_id'];\n } else {\n // Get Public Member Level ID\n $auth_level_table = Engine_Api::_()->getDbtable('levels', 'authorization');\n $auth_level_select = $auth_level_table->select('level_id')->where('flag = ?', 'public');\n $auth_level_id_query = $auth_level_table->fetchRow($auth_level_select);\n $user_member_level_id = $auth_level_id_query['level_id'];\n }\n\n // Get Network IDs\n if ($user_id != null) {\n $network_table = Engine_Api::_()->getDbtable('membership', 'network');\n $network_select = $network_table->select('resource_id')->where('user_id = ?', $user_id);\n $network_id_query = $network_table->fetchAll($network_select);\n $network_id_query_count = count($network_id_query);\n $network_id_array = array();\n for ($i = 0; $i < $network_id_query_count; $i++) {\n $network_id_array[$i] = $network_id_query[$i]['resource_id'];\n }\n\n // Get Profile Type\n $profile_table = Engine_Api::_()->fields()->getTable('user', 'values');\n $profile_select = $profile_table->select('value')->where('field_id = 1 AND item_id = ?', $user_id);\n $profile_type_query = $profile_table->fetchRow($profile_select);\n $profile_type_id = $profile_type_query['value'];\n } else {\n $network_id_array = null;\n $profile_type_id = null;\n }\n\n // Get Announcements\n // Get paginator\n $table = Engine_Api::_()->getDbtable('announcements', 'announcement');\n $announcement_select = $table->select()->order('creation_date DESC');\n $announcement_query = $table->fetchAll($announcement_select);\n\n // Keep only Relevent Announcements\n $announcement_keep_list = array();\n $announcement_count = count($announcement_query);\n // Expand JSON Arrays into Annoucement Arrays\n for ($i = 0; $i < $announcement_count; $i++) {\n // Convert JSON strings to Arrays\n $continue = false;\n $network_array = json_decode($announcement_query[$i]['networks']);\n // Check if Member Networks Match Annoucement Networks\n if ($network_array != null) {\n foreach ($network_array as $value) {\n if ($network_id_array != null && in_array($value, $network_id_array) != false) {\n array_push($announcement_keep_list, $announcement_query[$i]);\n $continue = true;\n break;\n }\n }\n }\n if ($continue) {\n continue;\n }\n\n $member_level_array = (array) json_decode($announcement_query[$i]['member_levels'], true);\n // Check if Member Level Matches Annoucement Level\n if ($member_level_array != null && $user_member_level_id != null && in_array($user_member_level_id, $member_level_array) != false) {\n array_push($announcement_keep_list, $announcement_query[$i]);\n continue;\n }\n\n $profile_type_array = (array) json_decode($announcement_query[$i]['profile_types'], true);\n // Check Member Profile Type Matches Anncounement Profile Type\n if ($profile_type_array != null && $profile_type_id != null && in_array($profile_type_id, $profile_type_array) != false) {\n array_push($announcement_keep_list, $announcement_query[$i]);\n continue;\n }\n }\n\n $paginator = Zend_Paginator::factory($announcement_keep_list);\n\n // Set item count per page and current page number\n $paginator->setItemCountPerPage($this->_getParam('itemCountPerPage', 2));\n $paginator->setCurrentPageNumber($this->_getParam('page', 1));\n\n // Hide if nothing to show\n if ($paginator->getTotalItemCount() <= 0) {\n return $this->setNoRender();\n }\n\n $this->view->announcements = $paginator;\n }", "function getMemberAlimony($userId) {\n global $db;\n \n try {\n $query = \"SELECT * FROM MemberAlimony WHERE user_id = :user_id\";\n $stmt = $db->prepare($query);\n $stmt->bindParam(':user_id', $userId);\n $stmt->execute();\n $member_alimony = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $member_alimony;\n } catch (\\Exception $e) {\n throw $e;\n }\n}" ]
[ "0.7652412", "0.74453557", "0.7401702", "0.73663205", "0.7156461", "0.71339655", "0.6903168", "0.67614627", "0.6595894", "0.64998704", "0.6443095", "0.6223723", "0.6120191", "0.61020935", "0.6098675", "0.60235494", "0.5969383", "0.59571666", "0.5934967", "0.59220684", "0.59142256", "0.58222735", "0.5816225", "0.5725164", "0.5715181", "0.56915116", "0.5662799", "0.5627528", "0.5570245", "0.5568363", "0.55529106", "0.55456173", "0.5520357", "0.54587084", "0.5418504", "0.5408308", "0.53813916", "0.5376973", "0.53646034", "0.5357446", "0.535447", "0.53542197", "0.5337834", "0.53325474", "0.5319741", "0.53141654", "0.5290119", "0.52867293", "0.5284314", "0.52817523", "0.5268959", "0.52479136", "0.5242822", "0.52392244", "0.52346313", "0.52178717", "0.52158844", "0.5198092", "0.51766366", "0.51697594", "0.5157923", "0.5151017", "0.51345813", "0.5134101", "0.5132315", "0.513111", "0.5119896", "0.51108176", "0.511056", "0.5104149", "0.51004237", "0.51001185", "0.50995743", "0.50964105", "0.5091839", "0.50896174", "0.5085466", "0.50853205", "0.5083348", "0.5070027", "0.5069889", "0.5066705", "0.50659037", "0.50630987", "0.5057895", "0.5057538", "0.5052139", "0.505085", "0.5036239", "0.50317955", "0.5028556", "0.50250924", "0.5016046", "0.501112", "0.49989074", "0.4986153", "0.4980516", "0.4975681", "0.49730438", "0.49724483" ]
0.78204143
0
Creates a form to delete a Topics entity.
Создает форму для удаления сущности Topics.
private function createDeleteForm(Topics $topic) { return $this->createFormBuilder() ->setAction($this->generateUrl('topics_delete', array('id' => $topic->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDeleteForm($topicNumber) {\n return View::make('/deleteTopic')\n \t ->with('topicNumber', $topicNumber);\n }", "function forschungsatlas_admin_topic_delete_confirm($form, &$form_state, $topic) {\n $form_state['NEFO']['tid'] = $topic['tid'];\n $form_state['NEFO']['name'] = $topic['name'];\n $form_state['NEFO']['parent'] = $topic['parent'];\n $form['tid'] = array('#type' => 'value', '#value' => $topic['tid']);\n if ($topic['parent']) {\n $output = t('Are you sure you want to delete this topic: <em>@name</em>?', array('@name' => $topic['name']));\n }\n else {\n $output = t('Delete this parent topic with all its children: <em>@name</em>?', array('@name' => $topic['name']));\n }\n return confirm_form($form,\n $output,\n FORSCHUNGSATLAS_CONFIG_PATH. '/categories/topics',\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}", "private function createDeleteForm(Articles $articles)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('communication_articles_delete', array('id' => $articles->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id) {\r\n $icon = '<i class=\"icon icon-remove\"></i>';\r\n //$icon = html_ ($icon);\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('article_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', LegacyFormHelper::getType('Symfony\\Component\\Form\\Extension\\Core\\Type\\SubmitType'), array('label' => 'Supprimer l\\'article courant'))\r\n ->getForm()\r\n ;\r\n }", "public function deleteTopicAction()\n {\n\t\t$topic_id = $this->_request->getParam('topic_id');\n\t\t$topicModel = new Model_Topic();\n\t\t$topicModel->deleteTopic($topic_id);\n\t\treturn $this->_redirect('/admin/view-course/course_id/'.$this->_getParam('course_id'));\n }", "private function createDeleteForm( $id ) {\n\t\treturn $this->createFormBuilder()\n\t\t ->setAction( $this->generateUrl( 'tips_delete', array( 'id' => $id ) ) )\n\t\t ->setMethod( 'DELETE' )\n\t\t ->add( 'submit', 'submit', array( 'label' => 'Delete' ) )\n\t\t ->getForm();\n\t}", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "public function destroy()\n\t{\n\t\t// Check to make sure it is admin to delete\n\t\tif(Auth::user()->id == 1) {\n\t\t\t// get the id of the topic from the form input\n\t\t\t$topic_id = Input::get('topic_id');\n\t\t\t// Cannot delete initial topic so display notice\n\t\t\tif($topic_id == 1) {\n\t\t\t\treturn Redirect::route('topics.index')\n\t \t->with('flash_error', 'Cannot delete initial topic.');\n\t\t\t} else { // Delete if not initial topic\n\t\t\t\t// Delete any replies that have the topic id\n\t\t\t\tDB::table('replies')->where('topic_id', '=', $topic_id)->delete();\n\n\t\t\t\t// Delete the topic with the id passed in\n\t\t\t\tTopics::find($topic_id)->delete();\n\n\t\t\t\t// Go back to member area\n\t\t\t\treturn Redirect::route('topics.index')\n\t\t\t ->with('flash_notice', 'Deleted topic sucessfully!');\n\t\t\t}\n\t\t} else {\n\t\t\t// display notice saying user cant delete (user shouldnt get here unless they spoof request)\n\t\t\treturn Redirect::route('topics.index')\n\t\t ->with('flash_error', 'You do not have permission to delete anything!');\n\t\t}\n\t}", "protected function templateForDeleteAction()\n {\n return 'UnitedOneBundle:Form:form.html.twig';\n }", "private function createDeleteForm($id) {\n\t\treturn $this->createFormBuilder()\n\t\t->setAction($this->generateUrl('adminDocumentation_delete', array('id' => $id)))\n\t\t->setMethod('DELETE')\n\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tutorias_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => \"Eliminar\", 'attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm(TheTargetAudienceEvents $theTargetAudienceEvent)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('thetargetaudienceevents_delete', array('id' => $theTargetAudienceEvent->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(tsdoc $tsdoc)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('home_tsdoc_delete', array('id' => $tsdoc->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Tva $tva)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_tva_delete', array('id' => $tva->getId())))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, ['label' => 'Delete'])\n ->getForm();\n }", "private function createDeleteForm(EmailTemplate $emailTemplate)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('app_emailtemplate_delete', array('id' => $emailTemplate->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sites_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addHidden('id_produkt');\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "public function getTopicForm() {\n return View::make('/createTopic');\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('grhcontrats_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', LegacyFormHelper::getType('Symfony\\Component\\Form\\Extension\\Core\\Type\\SubmitType'), array('label' => 'Supprimer'))\r\n ->getForm()\r\n ;\r\n }", "protected function formForDeleteAction($entity = null)\n {\n return $this->createForm(new DeleteFormType(), $entity);\n }", "public function delete()\n {\n \tif($this->topic_id != null)\n \t{\n \t\t$this->db->where(\"topic_id\", $this->topic_id);\n \t\t$this->db->delete(\"Topics\");\n \t}\n }", "public function destroy(Topics $topic)\n {\n $topic->delete();\n return redirect('admin/topics');\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('notifications_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('notifications_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('secteur_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //--\n ->add('submit', 'submit', array('label' => ' ','attr'=>array('class'=>'btn-supp','title'=>'Supprimer')))\n //--\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('terceros_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Forum $forum)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('forum_delete', array('idArticle' => $forum->getIdarticle())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('messages_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_subcategoria_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar',\n 'attr'=>array('class'=>'botonpanel'))\n )\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('masdocumentos_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Subject $subject)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('subject_delete', array('id' => $subject->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('category_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'btn btn-xs btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administracion_tiposervicio_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('supprimer_signalisation', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm();\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('message_delete', array('id' => $id)))\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('documento_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clientes_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('campodocumento_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Tarea $tarea)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tarea_delete', array('id' => $tarea->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Personas $persona)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personas_delete', array('idPersona' => $persona->getIdpersona())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solicitud_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('supprimer_instance', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm();\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eventos_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Subject $subject)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_subject_delete', array('id' => $subject->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('typetable_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('komentarz_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, array('label' => 'Skasuj Komentarz','attr' => array('class' => 'btn btn-danger' )))\n ->getForm()\n ;\n }", "function delete_topic(){\n // check :topic_id\n $topic_id = $this->get_topic_id();\n\n // only admin can delete Topic, get logged_in user role\n $user = $this->Session->read('user'); // get $user from Session\n $role = strToLower( $user['ForumRole']['title'] ); // get Role Title\n \n switch( $role ){\n \n case 'admin':\n // admin can delete topic now\n $this->ForumCategory->ForumTopic->delete( $topic_id );\n break;\n \n } // endSwitch\n \n // Give message and redirect to referer()\n $this->Session->setFlash(\" Topic #$topic_id deleted \");\n \n // redirect to category list\n $options['controller'] = 'Board';\n $options['action'] = 'category';\n $options['category_id'] = $this->passedArgs['category_id'];\n $this->redirect( $options );\n \n $this->autoRender = FALSE; // this action don't have view\n \n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('evento_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Actucamp $actucamp)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_actucamp_delete', array('id' => $actucamp->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(DatosDemograficos $datosDemografico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('datosdemograficos_delete', array('id' => $datosDemografico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(test_symfony $test_symfony)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('test_symfony_delete', array('id' => $test_symfony->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ArtisticCurrent $artisticCurrent)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('artisticcurrent_delete', array('id' => $artisticCurrent->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function actionCreate(){\n\t\t$topicForm = new TopicForm();\n\t\t$sectionTextModel = new SectionText();\n\t\t$sectionList = $this->getSectionList();\n\t\t\n\t\t$sectionId = Yii::$app->request->get(\"sectionId\",\"\");\n\t\t$topicList = [];\n\t\t$editTopic = 0;\n\t\tif(Yii::$app->request->isPost)\n\t\t{\n\t\t\t$request\t = Yii::$app->request;\n\t\t\t$form = $request->post('TopicForm');\n\t\t\t$topicForm->body = trim($form['body']);\n\t\t\t$topicForm->title = trim($form['title']);\n\t\t\t$topicForm->parent = $form['parent'];\n\t\t\t$topicForm->section = $form['section'];\n\t\t\t$topicForm->sectionText = trim($form['sectionText']);\n\t\t\t\n\t\t\t$topicModel = new Topic();\n\t\t\t$textModel = new TopicText();\n\t\t\t\n\t\t\tif ($topicForm->validate()){\n\t\t\t\tif (DataManagement::createTopic(\n\t\t\t\t\t\t$topicForm,\n\t\t\t\t\t\t$topicModel,\n\t\t\t\t\t\t$textModel,\n\t\t\t\t\t\t$sectionTextModel,\n\t\t\t\t\t\t$topicForm->sectionText)\n\t\t\t\t\t){\n\t\t\t\t\t$this->redirect(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\"index\",\n\t\t\t\t\t\t\t\t\"sectionId\" => $sectionId\n\t\t\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t$topicForm->section = $sectionId;\n\t\treturn $this->render(\n\t\t\t\t\"create\",\n\t\t\t\t[\n\t\t\t\t\t'sectionList' => $sectionList,\n\t\t\t\t\t'sectionId' => $sectionId,\n\t\t\t\t\t'topicList' => $topicList,\n\t\t\t\t\t'topicForm' => $topicForm,\n\t\t\t\t\t'sectionTextModel' => $sectionTextModel,\n\t\t\t\t\t'parentId' => '',\n\t\t\t\t\t'editTopic' => $editTopic\n\t\t]);\n\t\t\n\t}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pensumanio_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('issuenews_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('Publicacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('curso_delete', array('id' => $id)))\n ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mensaje_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(FASubspecie $fASubspecie)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fasubspecie_delete', array('id' => $fASubspecie->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n\t{\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('agencycategory_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Delete'))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('grhemployes_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', LegacyFormHelper::getType('Symfony\\Component\\Form\\Extension\\Core\\Type\\SubmitType'), array('label' => 'Supprimer'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('kidskulaemailnotification_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tecnico_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('language_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_event_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cdeudas_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('organizer_event_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Löschen ', 'attr' => array('class' => 'btn btn-danger pull-right deleteEvent')))\n ->getForm()\n ;\n }", "private function createDeleteForm( TextoDefinitivo $textoDefinitivo ) {\n\t\treturn $this->createFormBuilder()\n\t\t ->setAction( $this->generateUrl( 'texto_definitivo_delete',\n\t\t\t array( 'id' => $textoDefinitivo->getId() ) ) )\n\t\t ->setMethod( 'DELETE' )\n\t\t ->getForm();\n\t}", "public function showAddTopicForm() {\n return view('admin.add-topic');\n }", "private function createDeleteForm(Pub $pub)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pub_delete', array('id' => $pub->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('datosdistritos_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(tapisserie $tapisserie)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tapisserie_delete', array('id' => $tapisserie->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('categories_delete_category', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', [\n 'label' => 'Delete',\n 'attr' => [\n 'class' => 'btn btn-default'\n ]\n ]\n )\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('modelo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('productsection_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('termofuse_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('service_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer', 'attr'=> array('class'=>'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('additionalinformations_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm(ExtendedForm $extendedForm)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('extendedform_delete', array('id' => $extendedForm->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('usuarios_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => ' Eliminar', 'attr' => array('icon' => 'remove' )))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tache_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Configs $config)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_configs_delete', array('id' => $config->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fshare_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('causencias_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id) {\n\t\t\treturn $this->createFormBuilder()\n\t\t\t ->setAction($this->generateUrl('voie_delete', array('id' => $id)))\n\t\t\t ->setMethod('DELETE')\n\t\t\t ->add('submit', 'submit', array('label' => 'Delete'))\n\t\t\t ->getForm();\n\t\t}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('publicidad_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cuestionarios_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('front_event_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => /** @Ignore */ $this->get('translator')->trans('delete')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Contenido $contenido)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('contenido_delete', array('id' => $contenido->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(CmsStzefPages $cmsStzefPage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admstzef_pages_delete', array('id' => $cmsStzefPage->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Timeline $timeline)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('timeline_delete', array('id' => $timeline->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('node_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('typecourse_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('preguntaFormato__delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('menu_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('alumno_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('femme_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('user-post_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm(Formation $formation)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('formation_delete', array('id' => $formation->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }" ]
[ "0.689047", "0.6807421", "0.6733994", "0.6626597", "0.6507529", "0.6414675", "0.63944274", "0.6392604", "0.634922", "0.6320697", "0.6315173", "0.6308417", "0.63049084", "0.6302533", "0.62953717", "0.62863374", "0.6286229", "0.6265442", "0.6259364", "0.6249762", "0.62438595", "0.6243075", "0.6227774", "0.6227774", "0.62238127", "0.6208889", "0.6208232", "0.6207632", "0.61940753", "0.61927", "0.61802936", "0.6180136", "0.61758417", "0.6175318", "0.617429", "0.6171324", "0.61701345", "0.61679286", "0.6166757", "0.6161241", "0.61516577", "0.6150384", "0.6145616", "0.61418086", "0.61412394", "0.6140764", "0.61300254", "0.6126108", "0.6126076", "0.6119868", "0.6117644", "0.61152345", "0.6111293", "0.6102422", "0.6101208", "0.6097429", "0.6097137", "0.6096786", "0.60954607", "0.6094743", "0.60946995", "0.6090771", "0.6086831", "0.60867673", "0.60857576", "0.60802335", "0.60780174", "0.6077185", "0.60766274", "0.6075638", "0.6074596", "0.6074554", "0.6068789", "0.6068643", "0.6067576", "0.6067443", "0.6065207", "0.606342", "0.6062467", "0.6061218", "0.6057596", "0.6057487", "0.6057018", "0.6055395", "0.6054485", "0.60478306", "0.6047773", "0.60453844", "0.60446084", "0.6043202", "0.60429037", "0.6042614", "0.6037794", "0.6037648", "0.60369325", "0.60340834", "0.6031529", "0.602646", "0.60249436", "0.60226136" ]
0.79911375
0
create two taxonomies, genres and writers for the post type "film"
создайте два таксономии, жанры и авторы, для типа записи "фильм"
function create_film_taxonomies() { // Add new taxonomy, make it hierarchical (like categories) $labels = array( 'name' => _x( 'Genres', 'taxonomy general name', 'unite-child' ), 'singular_name' => _x( 'Genre', 'taxonomy singular name', 'unite-child' ), 'search_items' => __( 'Search Genres', 'unite-child' ), 'all_items' => __( 'All Genres', 'unite-child' ), 'parent_item' => __( 'Parent Genre', 'unite-child' ), 'parent_item_colon' => __( 'Parent Genre:', 'unite-child' ), 'edit_item' => __( 'Edit Genre', 'unite-child' ), 'update_item' => __( 'Update Genre', 'unite-child' ), 'add_new_item' => __( 'Add New Genre', 'unite-child' ), 'new_item_name' => __( 'New Genre Name', 'unite-child' ), 'menu_name' => __( 'Genre', 'unite-child' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'film_genre' ), ); register_taxonomy( 'film_genre', array( 'film' ), $args ); $labels = array( 'name' => _x( 'Countries', 'taxonomy general name', 'unite-child' ), 'singular_name' => _x( 'Country', 'taxonomy singular name', 'unite-child' ), 'search_items' => __( 'Search Countries', 'unite-child' ), 'all_items' => __( 'All Countries', 'unite-child' ), 'parent_item' => __( 'Parent Country', 'unite-child' ), 'parent_item_colon' => __( 'Parent Country:', 'unite-child' ), 'edit_item' => __( 'Edit Country', 'unite-child' ), 'update_item' => __( 'Update Country', 'unite-child' ), 'add_new_item' => __( 'Add New Country', 'unite-child' ), 'new_item_name' => __( 'New Country Name', 'unite-child' ), 'menu_name' => __( 'Country', 'unite-child' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'film_country' ), ); register_taxonomy( 'film_country', array( 'film' ), $args ); $labels = array( 'name' => _x( 'Years', 'taxonomy general name', 'unite-child' ), 'singular_name' => _x( 'Year', 'taxonomy singular name', 'unite-child' ), 'search_items' => __( 'Search Years', 'unite-child' ), 'all_items' => __( 'All Years', 'unite-child' ), 'parent_item' => __( 'Parent Year', 'unite-child' ), 'parent_item_colon' => __( 'Parent Year:', 'unite-child' ), 'edit_item' => __( 'Edit Year', 'unite-child' ), 'update_item' => __( 'Update Year', 'unite-child' ), 'add_new_item' => __( 'Add New Year', 'unite-child' ), 'new_item_name' => __( 'New Year Name', 'unite-child' ), 'menu_name' => __( 'Year', 'unite-child' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'film_year' ), ); register_taxonomy( 'film_year', array( 'film' ), $args ); $labels = array( 'name' => _x( 'Actors', 'taxonomy general name', 'unite-child' ), 'singular_name' => _x( 'Actor', 'taxonomy singular name', 'unite-child' ), 'search_items' => __( 'Search Actors', 'unite-child' ), 'all_items' => __( 'All Actors', 'unite-child' ), 'parent_item' => __( 'Parent Actor', 'unite-child' ), 'parent_item_colon' => __( 'Parent Actor:', 'unite-child' ), 'edit_item' => __( 'Edit Actor', 'unite-child' ), 'update_item' => __( 'Update Actor', 'unite-child' ), 'add_new_item' => __( 'Add New Actor', 'unite-child' ), 'new_item_name' => __( 'New Actor Name', 'unite-child' ), 'menu_name' => __( 'Actor', 'unite-child' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'film_actors' ), ); register_taxonomy( 'film_actors', array( 'film' ), $args ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_movie_taxonomies() {\n\t\n\t// Add new taxonomy, make it hierarchical (like categories)\n\t$labels = array(\n\t\t'name' => _x( 'Genres', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Genre', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Genres' ),\n\t\t'all_items' => __( 'All Genres' ),\n\t\t'parent_item' => __( 'Parent Genre' ),\n\t\t'parent_item_colon' => __( 'Parent Genre:' ),\n\t\t'edit_item' => __( 'Edit Genre' ),\n\t\t'update_item' => __( 'Update Genre' ),\n\t\t'add_new_item' => __( 'Add New Genre' ),\n\t\t'new_item_name' => __( 'New Genre Name' ),\n\t\t'menu_name' => __( 'Genres' ),\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'genre' ),\n\t);\n\n\tregister_taxonomy( 'genre', array( 'movies' ), $args );\n\n\t// Add new taxonomy, NOT hierarchical (like tags)\n\t$labels = array(\n\t\t'name' => _x( 'Writers', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Writer', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Writers' ),\n\t\t'popular_items' => __( 'Popular Writers' ),\n\t\t'all_items' => __( 'All Writers' ),\n\t\t'parent_item' => null,\n\t\t'parent_item_colon' => null,\n\t\t'edit_item' => __( 'Edit Writer' ),\n\t\t'update_item' => __( 'Update Writer' ),\n\t\t'add_new_item' => __( 'Add New Writer' ),\n\t\t'new_item_name' => __( 'New Writer Name' ),\n\t\t'separate_items_with_commas' => __( 'Separate writers with commas' ),\n\t\t'add_or_remove_items' => __( 'Add or remove writers' ),\n\t\t'choose_from_most_used' => __( 'Choose from the most used writers' ),\n\t\t'not_found' => __( 'No writers found.' ),\n\t\t'menu_name' => __( 'Writers' ),\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'update_count_callback' => '_update_post_term_count',\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'writer' ),\n\t);\n\n\tregister_taxonomy( 'writer', 'movies', $args );\n}", "function create_genres_taxonomy() {\n $labels = array(\n 'name' => 'Genres',\n 'singular_name' => 'Genre',\n 'search_items' => 'Search Genres',\n 'all_items' => 'All Genres',\n 'edit_item' => 'Edit Genre',\n 'update_item' => 'Update Genre',\n 'add_new_item' => 'Add New Genre',\n 'new_item_name' => 'New Genre Name',\n 'menu_name' => 'Genre',\n 'view_item' => 'View Genre',\n 'popular_items' => 'Popular Genre',\n 'separate_items_with_commas' => 'Separate genres with commas',\n 'add_or_remove_items' => 'Add or remove genres',\n 'choose_from_most_used' => 'Choose from the most used genres',\n 'not_found' => 'No genres found'\n );\n\tregister_taxonomy(\n\t\t'genre',\n\t\t'movie',\n\t\tarray(\n\t\t\t'hierarchical' => true,\n 'labels' => $labels,\n\t\t)\n\t);\n}", "function add_films_taxonomies() {\n $labels = array(\n 'name' => _x( 'Жанры', 'taxonomy general name', 'textdomain'),\n 'singular_name' => _x( 'Жанр', 'taxonomy general name', 'textdomain'),\n 'search_items' => __( 'Найти жанр', 'textdomain'),\n 'all_items' => __( 'Все жанры', 'textdomain'),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Редактировать жанр', 'textdomain'),\n 'update_item' => __( 'Обновить жанр', 'textdomain'),\n 'add_new_item' => __( 'Добавить новый жанр', 'textdomain'),\n 'new_item_name' => __( 'Название нового жанра', 'textdomain'),\n 'menu_name' => __( 'Жанры', 'textdomain'),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'genre' ),\n );\n register_taxonomy( 'genre', 'acme_films', $args );\n // Add new taxonomy, country\n $labels = array(\n 'name' => _x( 'Страны', 'taxonomy general name', 'textdomain'),\n 'singular_name' => _x( 'Страна', 'taxonomy general name', 'textdomain'),\n 'search_items' => __( 'Найти страну', 'textdomain'),\n 'all_items' => __( 'Все страны', 'textdomain'),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Редактировать страну', 'textdomain'),\n 'update_item' => __( 'Обновить страну', 'textdomain'),\n 'add_new_item' => __( 'Добавить новую страну', 'textdomain'),\n 'new_item_name' => __( 'Название новой страны', 'textdomain'),\n 'menu_name' => __( 'Страны', 'textdomain'),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'country' ),\n );\n register_taxonomy( 'country', 'acme_films', $args );\n // Add new taxonomy, year\n $labels = array(\n 'name' => _x( 'Года выпуска', 'taxonomy general name', 'textdomain'),\n 'singular_name' => _x( 'Год выпуска', 'taxonomy general name', 'textdomain'),\n 'search_items' => __( 'Найти год выпуска', 'textdomain'),\n 'all_items' => __( 'Все года выпуска', 'textdomain'),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Редактировать год выпуска', 'textdomain'),\n 'update_item' => __( 'Обновить год выпуска', 'textdomain'),\n 'add_new_item' => __( 'Добавить новый год выпуска', 'textdomain'),\n 'new_item_name' => __( 'Новый год выпуска', 'textdomain'),\n 'menu_name' => __( 'Года выпуска', 'textdomain'),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'year' ),\n );\n register_taxonomy( 'year', 'acme_films', $args );\n // Add new taxonomy, actor\n $labels = array(\n 'name' => _x( 'Актеры', 'taxonomy general name', 'textdomain'),\n 'singular_name' => _x( 'Актер', 'taxonomy general name', 'textdomain'),\n 'search_items' => __( 'Найти актера', 'textdomain'),\n 'all_items' => __( 'Все актеры', 'textdomain'),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Редактировать актера', 'textdomain'),\n 'update_item' => __( 'Обновить актеры', 'textdomain'),\n 'add_new_item' => __( 'Добавить нового актера', 'textdomain'),\n 'new_item_name' => __( 'Новое наименование актера', 'textdomain'),\n 'menu_name' => __( 'Актеры', 'textdomain'),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'actor' ),\n );\n register_taxonomy( 'actor', 'acme_films', $args );\n}", "function create_taxonomies() {\n\n}", "function add_custom_taxonomies() {\n\n new_taxonomy(\"year_exhibitions\", array('exhibitions'));\n new_taxonomy(\"year_works\", array('works'));\n new_taxonomy(\"biography_steps\", array('biography'));\n new_taxonomy(\"press_type\", array('press'));\n new_taxonomy(\"year_publications\", array('publication'));\n}", "function unte_register_film_type() {\n\t$labels = array(\n 'name' => _x( 'Films', 'Post type general name', 'minimal-film' ),\n 'singular_name' => _x( 'Film', 'Post type singular name', 'minimal-film' ),\n 'menu_name' => _x( 'Films', 'Admin Menu text', 'minimal-film' ),\n 'name_admin_bar' => _x( 'Film', 'Add New on Toolbar', 'minimal-film' ),\n 'add_new' => __( 'Add New', 'minimal-film' ),\n 'add_new_item' => __( 'Add New film', 'minimal-film' ),\n 'new_item' => __( 'New Film', 'minimal-film' ),\n 'edit_item' => __( 'Edit Film', 'minimal-film' ),\n 'view_item' => __( 'View Film', 'minimal-film' ),\n 'all_items' => __( 'All Films', 'minimal-film' ),\n 'search_items' => __( 'Search Films', 'minimal-film' ),\n 'parent_item_colon' => __( 'Parent Films:', 'minimal-film' ),\n 'not_found' => __( 'No Films found.', 'minimal-film' ),\n 'not_found_in_trash' => __( 'No Films found in Trash.', 'minimal-film' ),\n \n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'film' ),\n 'capability_type' => 'post',\n 'taxonomies' => array(),\n 'has_archive' => true,\n 'hierarchical' => false,\n 'menu_position' => null,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail' ),\n );\n \n register_post_type( 'film', $args );\n\n}", "function create_posttype_movies() {\n\n\tregister_post_type( 'movie',\n\t// CPT Options\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Movies' ),\n\t\t\t\t'singular_name' => __( 'Movie' ),\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => array('slug' => 'movie'),\n\t\t\t'menu_icon' => 'dashicons-editor-video',\n\t\t\t'show_in_rest' => true\n\t\t)\n\t);\n}", "function wpfolio_create_taxonomies() {\nregister_taxonomy('medium', 'post', array( \n\t'label' => 'Medium',\n\t'hierarchical' => false, \n\t'query_var' => true, \n\t'rewrite' => true,\n\t'public' => true,\n\t'show_ui' => true,\n\t'show_tagcloud' => true,\n\t'show_in_nav_menus' => true,));\n}", "function create_taxonomies() {\n\t\tforeach ($this->config as $tax => $tax_info) {\n\t\t\tif (!is_taxonomy($tax_info['tax_name'])) {\n\t\t\t\tregister_taxonomy($tax_info['tax_name'], $tax_info['tax_scope'], array('hierarchical'=>FALSE, 'label'=>$tax_info['tax_label'], 'query_var'=>$tax_info['tax_name'], 'rewrite'=>$tax_info['tax_rewrite']));\n\t\t\t}\n\t\t\tif (!empty($tax_info['tax_meta_key'])) {\n\t\t\t\t$convert_tax = new CFPostMetaToTax($tax_info['tax_meta_key'],$tax_info['tax_name']);\n\t\t\t\t$convert_tax->assign_terms_to_posts($tax_info['tax_remove_meta']);\n\t\t\t}\n\t\t}\n\t}", "function register_taxonomies() {\n }", "function register_taxonomies() {\n\t\t// Show\n\t\t$show_labels = array(\n\t\t\t'name' => _x( 'Podcasts', 'Taxonomy General Name', 'westeleventh' ),\n\t\t\t'singular_name' => _x( 'Podcast', 'Taxonomy Singular Name', 'westeleventh' ),\n\t\t\t'menu_name' => __( 'Podcast', 'westeleventh' ),\n\t\t\t'all_items' => __( 'All Podcasts', 'westeleventh' ),\n\t\t\t'parent_item' => __( 'Parent Podcast', 'westeleventh' ),\n\t\t\t'parent_item_colon' => __( 'Parent Podcast:', 'westeleventh' ),\n\t\t\t'new_item_name' => __( 'New Podcast Name', 'westeleventh' ),\n\t\t\t'add_new_item' => __( 'Add New Podcast', 'westeleventh' ),\n\t\t\t'edit_item' => __( 'Edit Podcast', 'westeleventh' ),\n\t\t\t'update_item' => __( 'Update Podcast', 'westeleventh' ),\n\t\t\t'view_item' => __( 'View Podcast', 'westeleventh' ),\n\t\t\t'separate_items_with_commas' => __( 'Separate Podcasts with commas', 'westeleventh' ),\n\t\t\t'add_or_remove_items' => __( 'Add or remove Podcasts', 'westeleventh' ),\n\t\t\t'choose_from_most_used' => __( 'Choose from the most used', 'westeleventh' ),\n\t\t\t'popular_items' => __( 'Popular Podcasts', 'westeleventh' ),\n\t\t\t'search_items' => __( 'Search Podcasts', 'westeleventh' ),\n\t\t\t'not_found' => __( 'Not Found', 'westeleventh' ),\n\t\t\t'no_terms' => __( 'No Podcasts', 'westeleventh' ),\n\t\t\t'items_list' => __( 'Podcasts list', 'westeleventh' ),\n\t\t\t'items_list_navigation' => __( 'Podcasts list navigation', 'westeleventh' ),\n\t\t);\n\t\t$show_args = array(\n\t\t\t'labels' => $show_labels,\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => false,\n\t\t\t'show_in_rest' => true,\n\t\t\t'rest_controller_class' => 'WP_REST_Shows_Controller',\n\t\t);\n\t\tregister_taxonomy( 'podcast', array( 'episode' ), $show_args );\n\t}", "function register_taxonomies(){\n\t\t}", "function register_taxonomies(){\n\t\t}", "function register_taxonomies() {\r\n }", "function register_taxonomies() {\n }", "public function register_taxonomies() {\n\t\tforeach ( $this->taxonomies as $taxonomy ) {\n\t\t\tregister_taxonomy_for_object_type( $taxonomy, $this->name );\n\t\t}\n\t}", "function register_taxonomies()\n {\n }", "public function create_custom_taxonomy()\n {\n foreach ($this->taxonomies as $name => $tax_info)\n {\n $tax_info['labels'] = $this->create_taxonomy_label(isset($tax_info['labels']['singular']) ? $tax_info['labels']['singular'] : $name, isset($tax_info['labels']['plural']) ? $tax_info['labels']['plural'] : $name, isset($tax_info['labels']['gender']) ? $tax_info['labels']['gender'] : 'm');\n $post_type = isset($tax_info['post_type']) ? $tax_info['post_type'] : [];\n register_taxonomy($name, $post_type, $tax_info);\n\n }\n }", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\n\t}", "function create_taxonomies() {\n\t\t\n\t\t$args = array(\t'label' => 'Topics',\t\n\t\t\t\t\t\t'show_tagcloud' => false,\n\t\t\t\t\t\t);\n\t\t\n\t\tregister_taxonomy( 'cunyj_database_topics', 'cunyj_database', $args );\n\t\t\n\t\t\n\t}", "function register_taxonomies(){\r\n }", "function create_movie() {\n register_post_type( 'movie',\n array(\n 'labels' => array(\n 'name' => 'Movies',\n 'singular_name' => 'Movie',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Movie',\n 'edit' => 'Edit',\n 'edit_item' => 'Edit Movie',\n 'new_item' => 'New Movie',\n 'view' => 'View',\n 'view_item' => 'View Movie',\n 'search_items' => 'Search Movie',\n 'not_found' => 'No Movies found',\n 'not_found_in_trash' => 'No Movies found in Trash',\n 'parent' => 'Parent Movie'\n ),\n\n 'public' => true,\n 'menu_position' => 15,\n 'supports' => array('thumbnail', 'title'),\n 'taxonomies' => array( 'genre' ),\n 'menu_icon' => 'dashicons-format-video',//plugins_url( ),\n 'has_archive' => true\n )\n );\n}", "function create_post_type_movies()\n {\n // creates label names for the post type in the dashboard the post panel and in the toolbar.\n $labels = array(\n 'name' => __('Movies'),\n 'singular_name' => __('Movie'),\n 'add_new' => 'Add new movie',\n 'add_new_type' => 'Add new type',\n 'edit_item' => 'Name of edit item'\n );\n // creates the post functionality that you want for a full listing see the link attached above\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'movies'),\n 'menu_position' => 0,\n 'menu_icon' => 'dashicons-format-video',\n 'supports'=> array('title', 'editor', 'custom-fields')\n );\n\n register_post_type('movies', $args );\n }", "function add_taxonomies_to_pages() {\n register_taxonomy_for_object_type( 'post_tag', 'page' );\n register_taxonomy_for_object_type( 'category', 'page' );\n }", "function register_taxonomies() {\n\n}", "function create_dia_diem_taxonomies()\n{\n $labels = array(\n 'name' => __('địa điểm'),\n 'singular_name' => __( 'Địa điểm' ),\n 'search_items' => __( 'Tìm địa điểm' ),\n 'popular_items' => __( 'Địa điểm phổ biến' ),\n 'all_items' => __( 'Danh sách địa điểm' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Sửa' ),\n 'update_item' => __( 'Cập nhật' ),\n 'add_new_item' => __( 'Thêm địa điểm' ),\n 'new_item_name' => __( 'New place Name' ),\n 'separate_items_with_commas' => __( 'Ngăn cách bởi dấu phẩy' ),\n 'add_or_remove_items' => __( 'Thêm hoặc xóa địa điểm' ),\n 'choose_from_most_used' => __( 'Choose from the most used writers' ),\n 'not_found' => __( 'Không tìm thấy địa điểm.' ),\n 'menu_name' => __( 'Địa điểm' )\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n // 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'dia-diem','with_front'=>false ),\n 'sort' => true\n );\n\n register_taxonomy( 'dia-diem', array('post','page'), $args );\n}", "public function attach_taxonomies() {\n\t\tregister_taxonomy_for_object_type('governance_categories', 'system-memos');\n\t\tregister_taxonomy_for_object_type('governance_tags', 'system-memos');\n\t\tregister_taxonomy_for_object_type('audiences', 'system-memos');\n\t\tregister_taxonomy_for_object_type('contacts', 'system-memos');\n\t\tregister_taxonomy_for_object_type('lifecycle_phases', 'system-memos');\n\t\tregister_taxonomy_for_object_type('org_units', 'system-memos');\n\t\tregister_taxonomy_for_object_type('owners', 'system-memos');\n\t\tregister_taxonomy_for_object_type('privacy_levels','system-memos');\n\t}", "function create_post_movie_type() {\r\n // set up labels\r\n $labels = array(\r\n 'name' => 'Movies',\r\n 'singular_name' => 'Movie Item',\r\n 'add_new' => 'Add New',\r\n 'add_new_item' => 'Add New Movie Item',\r\n 'edit_item' => 'Edit Movie Item',\r\n 'new_item' => 'New Movie Item',\r\n 'all_items' => 'All Movies',\r\n 'view_item' => 'View Movie Item',\r\n 'search_items' => 'Search Movies',\r\n 'not_found' => 'No Movies Found',\r\n 'not_found_in_trash' => 'No Movies found in Trash',\r\n 'parent_item_colon' => '',\r\n 'menu_name' => 'Movies',\r\n );\r\n register_post_type(\r\n 'movies',\r\n array(\r\n 'labels' => $labels,\r\n 'has_archive' => true,\r\n 'public' => true,\r\n 'hierarchical' => true,\r\n 'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'thumbnail','page-attributes' ),\r\n 'taxonomies' => array( 'post_tag', 'category' ),\r\n 'exclude_from_search' => true,\r\n 'capability_type' => 'post',\r\n )\r\n );\r\n}", "function register_taxonomy() {\n\n\t\t// We need to make sure taxonomy is registered for all of the post types that support it\n\t\t$supported_post_types = $this->get_post_types_for_module( $this->module );\n\t\n\t\tregister_taxonomy( self::metadata_taxonomy, $supported_post_types,\n\t\t\tarray(\n\t\t\t\t'public' => false,\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => _x( 'Editorial Metadata', 'taxonomy general name', 'edit-flow' ),\n\t\t\t\t\t'singular_name' => _x( 'Editorial Metadata', 'taxonomy singular name', 'edit-flow' ),\n\t\t\t\t\t\t'search_items' => __( 'Search Editorial Metadata', 'edit-flow' ),\n\t\t\t\t\t\t'popular_items' => __( 'Popular Editorial Metadata', 'edit-flow' ),\n\t\t\t\t\t\t'all_items' => __( 'All Editorial Metadata', 'edit-flow' ),\n\t\t\t\t\t\t'edit_item' => __( 'Edit Editorial Metadata', 'edit-flow' ),\n\t\t\t\t\t\t'update_item' => __( 'Update Editorial Metadata', 'edit-flow' ),\n\t\t\t\t\t\t'add_new_item' => __( 'Add New Editorial Metadata', 'edit-flow' ),\n\t\t\t\t\t\t'new_item_name' => __( 'New Editorial Metadata', 'edit-flow' ),\n\t\t\t\t\t),\n\t\t\t\t'rewrite' => false,\n\t\t\t)\n\t\t);\n\t}", "function add_custom_taxonomies() {\n\t\tregister_taxonomy('builder-type', array('website-builders','builder-boxes', 'faq'), array(\n\t\t\t// Hierarchical taxonomy (like categories)\n\t\t\t'hierarchical' => true,\n\t\t\t// This array of options controls the labels displayed in the WordPress Admin UI\n\t\t\t'labels' => array(\n\t\t\t\t'name' => 'Builder Types',\n\t\t\t\t'singular_name' => 'Builder Type',\n\t\t\t\t'search_items' => 'Search Builder Types',\n\t\t\t\t'all_items' => 'All Builder Types' ,\n\t\t\t\t'parent_item' => 'Parent Builder Type',\n\t\t\t\t'parent_item_colon' => 'Parent Builder Type:' ,\n\t\t\t\t'edit_item' => 'Edit Builder Type' ,\n\t\t\t\t'update_item' => 'Update Builder Type' ,\n\t\t\t\t'add_new_item' => 'Add New Builder Type' ,\n\t\t\t\t'new_item_name' => 'New Builder Type Name' ,\n\t\t\t\t'menu_name' => 'Builder Types' ,\n\t\t\t),\n\t\t\t'show_admin_column' => true,\n\t\t\t// Control the slugs used for this taxonomy\n\t\t\t'rewrite' => array(\n\t\t\t\t'slug' => 'website-builder-type', // This controls the base slug that will display before each term\n\t\t\t\t'with_front' => false, // Don't display the category base before \"/locations/\"\n\t\t\t\t'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n\t\t\t),\n\t\t));\n\t\t\n\t\tregister_taxonomy('faq-tag', array('website-builders', 'faq'), array(\n\t\t\t// Hierarchical taxonomy (like categories)\n\t\t\t'hierarchical' => false,\n\t\t\t// This array of options controls the labels displayed in the WordPress Admin UI\n\t\t\t'labels' => array(\n\t\t\t\t'name' => 'FAQ Tag',\n\t\t\t\t'singular_name' => 'FAQ Tag',\n\t\t\t\t'search_items' => 'Search FAQ Tags',\n\t\t\t\t'all_items' => 'All FAQ Tags' ,\n\t\t\t\t'parent_item' => 'Parent FAQ Tag',\n\t\t\t\t'parent_item_colon' => 'Parent FAQ Tag:' ,\n\t\t\t\t'edit_item' => 'Edit FAQ Tag' ,\n\t\t\t\t'update_item' => 'Update FAQ Tag' ,\n\t\t\t\t'add_new_item' => 'Add New FAQ Tag' ,\n\t\t\t\t'new_item_name' => 'New FAQ Tag Name' ,\n\t\t\t\t'menu_name' => 'FAQ Tags' ,\n\t\t\t),\n\t\t\t// Control the slugs used for this taxonomy\n\t\t\t'rewrite' => array(\n\t\t\t\t'slug' => 'builder-type', // This controls the base slug that will display before each term\n\t\t\t\t'with_front' => false, // Don't display the category base before \"/locations/\"\n\t\t\t\t'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n\t\t\t),\n\t\t));\n\t}", "private function create_taxonomy() {\n\t\t//Capitilize the words and make it plural\n\t\t$name = $this->helper->beautify_title($this->tax_name);\n\t\t$plural = $this->helper->pluralize($name);\n\n\t\t$default_labels = array(\n\t\t\t'name' => $plural,\n\t\t\t'singular_name' => $name,\n\t\t\t'search_items' => sprintf(__('Search %s', 'lexi'), $plural),\n\t\t\t'all_items' => sprintf(__('All %s', 'lexi'), $plural),\n\t\t\t'parent_item' => sprintf(__('Parent %s', 'lexi'), $name),\n\t\t\t'parent_item_colon' => sprintf(__('Parent %s:', 'lexi'), $name),\n\t\t\t'edit_item' => sprintf(__('Edit %s', 'lexi'), $name),\n\t\t\t'update_item' => sprintf(__('Update %s', 'lexi'), $name),\n\t\t\t'add_new_item' => sprintf(__('Add New %s', 'lexi'), $name),\n\t\t\t'new_item_name' => sprintf(__('New %s Name', 'lexi'), $name),\n\t\t\t'menu_name' => $name,\n\t\t);\n\n\t\t// Default labels, overwrite them with the given labels.\n\t\t$labels = array_merge($default_labels, $this->labels);\n\n\t\t$default_args = array(\n\t\t\t'label' => $plural,\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'_builtin' => false,\n\t\t);\n\n\t\t// Default arguments, overwritten with the given arguments\n\t\t$args = array_merge($default_args, $this->args);\n\n\t\tregister_taxonomy( $this->tax_name, $this->post_type, $args );\n\t}", "public function register_taxonomies() {\n\t\tforeach ( $this->taxonomies as $taxonomy_class ) {\n\t\t\t$this->register_content_type( new $taxonomy_class() );\n\t\t}\n\t}", "function add_taxonomies_to_pages() {\n register_taxonomy_for_object_type( 'post_tag', 'page' );\n register_taxonomy_for_object_type( 'category', 'page' );\n}", "function smille_field_add_press_types() {\n\t\tregister_post_type('medlemsfiler', array(\n\t\t\t'label' => __('Medlems pdf'),\n\t\t\t'singular_label' => __('medlemsfiler'),\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true, // UI in admin panel\n\t\t\t'_builtin' => false, // It's a custom post type, not built in\n\t\t\t'_edit_link' => 'post.php?post=%d',\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t\t'rewrite' => array(\"slug\" => \"medlemsfiler\"), // Permalinks\n\t\t\t'query_var' => \"medlemsfiler\", // This goes to the WP_Query schema\n\t\t\t'supports' => array('title','author', 'editor'/*'excerpt', ,'custom-fields'*/) // Let's use custom fields for debugging purposes only\n\t\t));\n\t\t\n\t\t\n\t\tregister_taxonomy(\n\t\t'medlemsfiler_cats',\t\t// internal name = machine-readable taxonomy name\n\t\t'medlemsfiler',\t\t// object type = post, page, link, or custom post-type\n\t\tarray(\n\t\t\t'hierarchical' => true,\n\t\t\t'label' => 'Categories',\t// the human-readable taxonomy name\n\t\t\t'query_var' => true,\t// enable taxonomy-specific querying\n\t\t\t'rewrite' => array( 'slug' => 'medlemsfiler' ),\t// pretty permalinks for your taxonomy?\n\t\t)\n\t);\n\n}", "function create_taxonomies() {\n\n\n\tregister_taxonomy(\n\t\t'Projects', // Your taxonomy title //\n\t\t'projects', // The Custom Post Type it will belong to //\n\t\tarray(\n\t\t\t'hierarchical' => true,\n\t\t\t'label' => 'All Projects',\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array( 'slug' => 'all-projects' )\n\t\t)\n\t);\n\n}", "function create_year_taxonomies() {\n\t// Add new taxonomy, make it hierarchical (like categories)\n\t$labels = array(\n\t\t'name' => _x( 'Year', 'Year general name' ),\n\t\t'singular_name' => _x( 'Year', 'Addon singular name' ),\n\t\t'search_items' => __( 'Search Years' ),\n\t\t'all_items' => __( 'All Years' ),\n\t\t'parent_item' => __( 'Parent Year' ),\n\t\t'parent_item_colon' => __( 'Parent Year:' ),\n\t\t'edit_item' => __( 'Edit Year' ),\n\t\t'update_item' => __( 'Update Year' ),\n\t\t'add_new_item' => __( 'Add New Year' ),\n\t\t'new_item_name' => __( 'New Year Name' ),\n\t); \t\n\n\tregister_taxonomy( 'eventyear', array( 'gevent' ), array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels, /* NOTICE: Here is where the $labels variable is used */\n\t\t'show_ui' => true,\n\t\t'query_var' => true,\n\t\t//'rewrite' => array( 'slug' => 'type' ),\n\t));\n\n}", "private function create_taxonomy()\n\t{\n\t\t$labels = array(\n\t\t\t\t'name' => _x( $this->singular_label.' Categories', 'taxonomy general name' ),\n\t\t\t\t'singular_name' => _x( $this->singular_label.' Category', 'taxonomy singular name' ),\n\t\t\t\t'search_items' => __( 'Search '.$this->singular_label.' Categories' ),\n\t\t\t\t'all_items' => __( 'All '.$this->singular_label.' Categories' ),\n\t\t\t\t'parent_item' => __( 'Parent '.$this->singular_label.' Category' ),\n\t\t\t\t'parent_item_colon' => __( 'Parent '.$this->singular_label.' Category:' ),\n\t\t\t\t'edit_item' => __( 'Edit '.$this->singular_label.' Category' ),\n\t\t\t\t'update_item' => __( 'Update '.$this->singular_label.' Category' ),\n\t\t\t\t'add_new_item' => __( 'Add New '.$this->singular_label.' Category' ),\n\t\t\t\t'new_item_name' => __( 'New '.$this->singular_label.' Category Name' ),\n\t\t\t\t'menu_name' => __( $this->singular_label.' Categories' ),\n\t\t\t);\n\n\t\t// Now register the taxonomy\n\n\t\t\tregister_taxonomy('team_categories',array('team'), array(\n\t\t\t\t'public' => true,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'labels' => $labels,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_admin_column' => true,\n\t\t\t\t'query_var' => true,\n\t\t\t\t'rewrite' => array( 'slug' => 'team', 'with_front' => true, ),\n\t\t\t));\n\t}", "function my_taxonomies_movies_collection() {\n\t$labels = array(\n\t\t'name' => _x( 'Collection Categories', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Collection Category', 'taxonomy singular name' ),\n\t\t'menu_name' => __( 'Collection Categories' ),\n\t\t'show_in_rest' => true\n\t\t\n\t);\n\t$args = array(\n\t\t'show_in_rest' => true,\n\t\t'labels' => $labels,\n\t\t'hierarchical' => true,\n\t);\n\tregister_taxonomy( 'movie_collection_category', 'movies_collection', $args );\n}", "function custom_taxonomy() {\n // Contibutor type\n register_taxonomy(\n 'contributor-type',\n 'contributor',\n array(\n 'label' => __( 'Contributor types', 'opp' ),\n 'rewrite' => array( 'slug' => 'contributor-type' ),\n 'hierarchical' => true\n )\n );\n\n // Category\n register_taxonomy(\n 'theme',\n array( 'photos-gallery', 'videos-gallery', 'expedition' ),\n array(\n 'label' => __( 'Themes', 'opp' ),\n 'rewrite' => array( 'slug' => 'theme' ),\n 'hierarchical' => true\n )\n );\n\n // Region\n register_taxonomy(\n 'region',\n array( 'photos-gallery', 'videos-gallery', 'expedition' ),\n array(\n 'label' => __( 'Regions', 'opp' ),\n 'rewrite' => array( 'slug' => 'region' ),\n 'hierarchical' => true\n )\n );\n}", "public function create_custom_taxonomy() {\n\t\t$slideshow_labels = array(\n\t\t\t'name' => __( 'Slideshows', 'byobfps' ),\n\t\t\t'singular_name' => __( 'Slideshow', 'byobfps' ),\n\t\t\t'search_items' => __( 'Search Slideshows', 'byobfps' ),\n\t\t\t'all_items' => __( 'All Slideshows', 'byobfps' ),\n\t\t\t'parent_item' => __( 'Parent Slideshow', 'byobfps' ),\n\t\t\t'parent_item_colon' => __( 'Parent Slideshow:', 'byobfps' ),\n\t\t\t'edit_item' => __( 'Edit Slideshow', 'byobfps' ),\n\t\t\t'update_item' => __( 'Update Slideshow', 'byobfps' ),\n\t\t\t'add_new_item' => __( 'Add New Slideshow', 'byobfps' ),\n\t\t\t'new_item_name' => __( 'New Slideshow Name', 'byobfps' ),\n\t\t\t'menu_name' => __( 'Slideshow', 'byobfps' ),\n\t\t);\n\n\t\t$slide_args = array(\n\t\t\t'hierarchical' => false,\n\t\t\t'labels' => $slideshow_labels,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus' => false,\n\t\t\t'show_admin_column' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array( 'slug' => 'slideshow' ),\n\t\t);\n\n\t\tregister_taxonomy( 'byob_slideshow', array( 'slide' ), $slide_args );\n\t}", "function add_taxonomies_to_pages()\n{\n register_taxonomy_for_object_type('post_tag', 'page');\n register_taxonomy_for_object_type('category', 'page');\n}", "function add_taxonomies_to_pages() {\r\n\t// register_taxonomy_for_object_type( 'post_tag', 'page' );\r\n\tregister_taxonomy_for_object_type( 'category', 'page' );\r\n}", "public function register_taxonomies() {\n\n }", "public function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\n\t$taxonomies = array(\n\t\tarray(\n\t\t\t'slug' => 'locations',\n\t\t\t'single_name' => 'Location',\n\t\t\t'plural_name' => 'Locations',\n\t\t\t'post_type' => array(\n\t\t\t\t'ski_domain' => 'ski-domain',\n\t\t\t\t'ski_resort' => 'ski-resort',\n\t\t\t\t'webcams' => 'ski-resort-webcams',\n\t\t\t\t'weather_forecast' => 'weather-forecast',\n\t\t\t),\n\t\t\t'hierarchical' => false,\n\t\t\t'rewrite' => array(\n\t\t\t\t'slug' => 'ski-resorts',\n\t\t\t),\n\t\t),\n\t\tarray(\n\t\t\t'slug' => 'tabbed-groups',\n\t\t\t'single_name' => 'Tabbed Group',\n\t\t\t'plural_name' => 'Tabbed Groups',\n\t\t\t'post_type' => array(\n\t\t\t\t'ski_resort' => 'ski-resort',\n\t\t\t\t'webcams' => 'ski-resort-webcams',\n\t\t\t\t'weather_forecast' => 'weather-forecast',\n\t\t\t),\n\t\t\t'hierarchical' => false,\n\t\t\t'rewrite' => array(\n\t\t\t\t'slug' => 'tabbed-groups',\n\t\t\t),\n\t\t\t'show_in_nav_menus' => false,\n\t\t),\n\t\tarray(\n\t\t\t'slug' => 'domain-groups',\n\t\t\t'single_name' => 'Domain Group',\n\t\t\t'plural_name' => 'Domain Groups',\n\t\t\t'post_type' => array(\n\t\t\t\t'ski_resort' => 'ski-resort',\n\t\t\t\t'webcams' => 'ski-resort-webcams',\n\t\t\t\t'weather_forecast' => 'weather-forecast',\n\t\t\t),\n\t\t\t'hierarchical' => false,\n\t\t\t'rewrite' => array(\n\t\t\t\t'slug' => 'ski-domains',\n\t\t\t),\n\t\t\t'show_in_nav_menus' => false,\n\t\t),\n\t);\n\n\tforeach ( $taxonomies as $taxonomy ) {\n\n\t\t$labels = array(\n\t\t\t'name' => _x( $taxonomy['plural_name'], 'Taxonomy General Name', CHILD_TEXT_DOMAIN ),\n\t\t\t'singular_name' => _x( $taxonomy['single_name'], 'Taxonomy Singular Name', CHILD_TEXT_DOMAIN ),\n\t\t\t'menu_name' => __( $taxonomy['plural_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'all_items' => __( 'All ' . $taxonomy['plural_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'parent_item' => __( 'Parent ' . $taxonomy['single_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'parent_item_colon' => __( 'Parent ' . $taxonomy['single_name'] . ':', CHILD_TEXT_DOMAIN ),\n\t\t\t'new_item_name' => __( 'New ' . $taxonomy['single_name'] . ' Name', CHILD_TEXT_DOMAIN ),\n\t\t\t'add_new_item' => __( 'Add new ' . $taxonomy['single_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'edit_item' => __( 'Edit ' . $taxonomy['single_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'update_item' => __( 'Update ' . $taxonomy['single_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'view_item' => __( 'View ' . $taxonomy['single_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'separate_items_with_commas' => __( 'Separate ' . $taxonomy['plural_name'] . ' with commas', CHILD_TEXT_DOMAIN ),\n\t\t\t'add_or_remove_items' => __( 'Add or remove ' . $taxonomy['plural_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'choose_from_most_used' => __( 'Choose from the most used', CHILD_TEXT_DOMAIN ),\n\t\t\t'popular_items' => __( 'Popular ' . $taxonomy['plural_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'search_items' => __( 'Search ' . $taxonomy['plural_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'not_found' => __( 'Not Found', CHILD_TEXT_DOMAIN ),\n\t\t\t'no_terms' => __( 'No ' . $taxonomy['plural_name'], CHILD_TEXT_DOMAIN ),\n\t\t\t'items_list' => __( $taxonomy['plural_name'] . ' list', CHILD_TEXT_DOMAIN ),\n\t\t\t'items_list_navigation' => __( $taxonomy['plural_name'] . ' list navigation', CHILD_TEXT_DOMAIN ),\n\t\t);\n\n\t\t$rewrite = isset( $taxonomy['rewrite'] ) ? $taxonomy['rewrite'] : array( 'slug' => $taxonomy['slug'] );\n\t\t$hierarchical = isset( $taxonomy['hierarchical'] ) ? $taxonomy['hierarchical'] : true;\n\t\t$show_in_nav_menus = isset( $taxonomy['show_in_nav_menus'] ) ? $taxonomy['show_in_nav_menus'] : true;\n\n\t\tregister_taxonomy( $taxonomy['slug'], $taxonomy['post_type'], array(\n\t\t\t'hierarchical' => $hierarchical,\n\t\t\t'labels' => $labels,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => $show_in_nav_menus,\n\t\t\t'rewrite' => $rewrite,\n\t\t) );\n\n\t}\n\n}", "function film_post_type() {\n\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Films', 'Post Type General Name', 'unite-child' ),\n\t\t\t'singular_name' => _x( 'Film', 'Post Type Singular Name', 'unite-child' ),\n\t\t\t'menu_name' => __( 'Films', 'unite-child' ),\n\t\t\t'name_admin_bar' => __( 'Film', 'unite-child' ),\n\t\t\t'archives' => __( 'Item Archives', 'unite-child' ),\n\t\t\t'attributes' => __( 'Item Attributes', 'unite-child' ),\n\t\t\t'parent_item_colon' => __( 'Parent Item:', 'unite-child' ),\n\t\t\t'all_items' => __( 'All Films', 'unite-child' ),\n\t\t\t'add_new_item' => __( 'Add New Film', 'unite-child' ),\n\t\t\t'add_new' => __( 'Add New Film', 'unite-child' ),\n\t\t\t'new_item' => __( 'New Film', 'unite-child' ),\n\t\t\t'edit_item' => __( 'Edit Film', 'unite-child' ),\n\t\t\t'update_item' => __( 'Update Film', 'unite-child' ),\n\t\t\t'view_item' => __( 'View Film', 'unite-child' ),\n\t\t\t'view_items' => __( 'View Flims', 'unite-child' ),\n\t\t\t'search_items' => __( 'Search Film', 'unite-child' ),\n\t\t\t'not_found' => __( 'Not found', 'unite-child' ),\n\t\t\t'not_found_in_trash' => __( 'Not found in Trash', 'unite-child' ),\n\t\t\t'featured_image' => __( 'Featured Image', 'unite-child' ),\n\t\t\t'set_featured_image' => __( 'Set featured image', 'unite-child' ),\n\t\t\t'remove_featured_image' => __( 'Remove featured image', 'unite-child' ),\n\t\t\t'use_featured_image' => __( 'Use as featured image', 'unite-child' ),\n\t\t\t'insert_into_item' => __( 'Insert into film', 'unite-child' ),\n\t\t\t'uploaded_to_this_item' => __( 'Uploaded to this film', 'unite-child' ),\n\t\t\t'items_list' => __( 'Flims list', 'unite-child' ),\n\t\t\t'items_list_navigation' => __( 'Films list navigation', 'unite-child' ),\n\t\t\t'filter_items_list' => __( 'Filter films list', 'unite-child' ),\n\t\t);\n\t\t$args = array(\n\t\t\t'label' => __( 'Film', 'unite-child' ),\n\t\t\t'description' => __( 'Films Description', 'unite-child' ),\n\t\t\t'labels' => $labels,\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t\t'taxonomies' => array( 'film_genre', 'film_country', 'film_year', 'film_actors' ),\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'menu_position' => 5,\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'can_export' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'capability_type' => 'post',\n\t\t);\n\t\tregister_post_type( 'film', $args );\n\n\t}", "public function register_taxonomies()\n {\n }", "public function register_taxonomies()\n {\n }", "public function register_taxonomies()\n {\n }", "public function register_taxonomies()\n {\n }", "function taxonomies_for_pages() {\n register_taxonomy_for_object_type( 'post_tag', 'page' );\n register_taxonomy_for_object_type( 'category', 'page' );\n }", "function custom_taxonomy_wie_init() {\n // create a new taxonomy\n register_taxonomy(\n 'webdevelopment',\n 'post',\n array(\n 'hierarchical' => true,\n 'label' => 'Web Development',\n\t\t\t'query_var' => true\n )\n );\n}", "public function setup_custom_taxonomies() {\n\t\tregister_taxonomy_for_object_type( 'wsuwp_university_category', $this->point_content_type_slug );\n\t\tregister_taxonomy_for_object_type( 'wsuwp_university_location', $this->point_content_type_slug );\n\t}", "function setup_taxonomies() {\n if ( !$this->options['use-taxonomies'] ) {\n return;\n }\n\n foreach ( $this->options['taxonomies'] as $key => $taxonomy ) {\n\n if ( isset($taxonomy['active']) and isset($taxonomy['plural']) ) {\n $labels = array(\n 'name' => $taxonomy['plural'],\n 'singular_name' => $taxonomy['singular'],\n 'search_items' => sprintf(__('Search %1$s', 'calendar-press'), $taxonomy['plural']),\n 'popular_items' => sprintf(__('Popular %1$s', 'calendar-press'), $taxonomy['plural']),\n 'all_items' => sprintf(__('All %1$s', 'calendar-press'), $taxonomy['plural']),\n 'parent_item' => sprintf(__('Parent %1$s', 'calendar-press'), $taxonomy['singular']),\n 'edit_item' => sprintf(__('Edit %1$s', 'calendar-press'), $taxonomy['singular']),\n 'update_item' => sprintf(__('Update %1$s', 'calendar-press'), $taxonomy['singular']),\n 'add_new_item' => sprintf(__('Add %1$s', 'calendar-press'), $taxonomy['singular']),\n 'new_item_name' => sprintf(__('New %1$s', 'calendar-press'), $taxonomy['singular']),\n 'add_or_remove_items' => sprintf(__('Add ore remove %1$s', 'calendar-press'), $taxonomy['plural']),\n 'choose_from_most_used' => sprintf(__('Choose from the most used %1$s', 'calendar-press'), $taxonomy['plural'])\n );\n\n $args = array(\n 'hierarchical' => isset($taxonomy['hierarchical']),\n 'label' => $taxonomy['plural'],\n 'labels' => $labels,\n 'public' => true,\n 'show_ui' => true,\n 'rewrite' => true\n );\n\n register_taxonomy($key, array('event'), $args);\n }\n }\n }", "public function registerTaxonomy()\n {\n if (!taxonomy_exists($this->name)) {\n // create options for the Taxonomy\n $options = $this->createOptions();\n // register the Taxonomy with WordPress\n register_taxonomy($this->name, null, $options);\n }\n }", "function create_posttypes() {\r\n\t$labels1 = array(\r\n\t\t\t\t'name' => __( 'Teachings' ),\r\n \t\t'singular_name' => __( 'Teaching' ),\r\n\t\t\t\t'all_items' => __( 'All Teachings' ),\r\n\t\t\t\t'view_item' => __( 'View Teaching' ),\r\n\t\t\t\t'add_new_item' => __( 'Add New Teaching' ),\r\n\t\t\t\t'edit_item' => __( 'Edit Teaching' ),\r\n\t\t\t\t'update_item' => __( 'Update Teaching' ),\r\n\t\t\t\t'search_items' => __( 'Search Teachings' ),\r\n\t\t\t\t'not_found' => __( 'Not Found' ),\r\n\t\t\t\t'not_found_in_trash' => __( 'Not Found in Trash' ),\r\n\t\t\t);\r\n\t$args1 = array(\r\n\t\t\t\t'label' => 'Teachings',\r\n\t\t\t\t'description' => 'Directory of Teachings',\r\n\t\t\t\t'labels' => $labels1,\r\n\t\t\t\t'public' => true,\r\n\t\t\t\t'query_var' => true,\r\n\t\t\t\t'has_archive' => false,\r\n\t\t\t\t'rewrite' => array('slug'=> 'teachings', 'with_front' => true),\r\n\t\t\t\t'hierarchical' => false,\r\n 'taxonomies' => array('post_tag'),\r\n\t\t\t\t'show_ui' => true,\r\n\t\t\t\t'show_in_menu' => true,\r\n\t\t\t\t'show_in_rest' => true,\r\n\t\t\t\t'show_in_nav_menus' => true,\r\n\t\t\t\t'show_in_admin_bar' => true,\r\n\t\t\t\t'menu_position' => 5,\r\n\t\t\t\t'can_export' => true,\r\n\t\t\t\t'exclude_from_search' => false,\r\n\t\t\t\t'publicly_queryable' => true,\r\n\t\t\t\t'capability_type' => 'post',\r\n\t\t\t\t'supports' => array('title','thumbnail', 'revisions', 'excerpt', 'editor')\r\n\t\t\t);\r\n\tregister_post_type( 'teachings', $args1 );\r\n \r\n $labels2 = array(\r\n\t\t\t\t'name' => __( 'Books' ),\r\n \t\t'singular_name' => __( 'Book' ),\r\n\t\t\t\t'all_items' => __( 'All Books' ),\r\n\t\t\t\t'view_item' => __( 'View Book' ),\r\n\t\t\t\t'add_new_item' => __( 'Add New Book' ),\r\n\t\t\t\t'edit_item' => __( 'Edit Book' ),\r\n\t\t\t\t'update_item' => __( 'Update Book' ),\r\n\t\t\t\t'search_items' => __( 'Search Books' ),\r\n\t\t\t\t'not_found' => __( 'Not Found' ),\r\n\t\t\t\t'not_found_in_trash' => __( 'Not Found in Trash' ),\r\n\t\t\t);\r\n\t$args2 = array(\r\n\t\t\t\t'label' => 'Books',\r\n\t\t\t\t'description' => 'Directory of Books',\r\n\t\t\t\t'labels' => $labels2,\r\n\t\t\t\t'public' => true,\r\n\t\t\t\t'query_var' => true,\r\n\t\t\t\t'has_archive' => false,\r\n\t\t\t\t'rewrite' => array('slug'=> 'books', 'with_front' => true),\r\n\t\t\t\t'hierarchical' => false,\r\n 'taxonomies' => array('post_tag'),\r\n\t\t\t\t'show_ui' => true,\r\n\t\t\t\t'show_in_menu' => true,\r\n\t\t\t\t'show_in_rest' => true,\r\n\t\t\t\t'show_in_nav_menus' => true,\r\n\t\t\t\t'show_in_admin_bar' => true,\r\n\t\t\t\t'menu_position' => 5,\r\n\t\t\t\t'can_export' => true,\r\n\t\t\t\t'exclude_from_search' => false,\r\n\t\t\t\t'publicly_queryable' => true,\r\n\t\t\t\t'capability_type' => 'post',\r\n\t\t\t\t'supports' => array('title','thumbnail', 'revisions', 'excerpt', 'editor')\r\n\t\t\t);\r\n\tregister_post_type( 'books', $args2 );\r\n \r\n $labels3 = array(\r\n\t\t\t\t'name' => __( 'Study Guides' ),\r\n \t\t'singular_name' => __( 'Study Guide' ),\r\n\t\t\t\t'all_items' => __( 'All Study Guides' ),\r\n\t\t\t\t'view_item' => __( 'View Study Guide' ),\r\n\t\t\t\t'add_new_item' => __( 'Add New Study Guide' ),\r\n\t\t\t\t'edit_item' => __( 'Edit Study Guide' ),\r\n\t\t\t\t'update_item' => __( 'Update Study Guide' ),\r\n\t\t\t\t'search_items' => __( 'Search Study Guides' ),\r\n\t\t\t\t'not_found' => __( 'Not Found' ),\r\n\t\t\t\t'not_found_in_trash' => __( 'Not Found in Trash' ),\r\n\t\t\t);\r\n\t$args3 = array(\r\n\t\t\t\t'label' => 'Study Guide',\r\n\t\t\t\t'description' => 'Directory of Study Guides',\r\n\t\t\t\t'labels' => $labels3,\r\n\t\t\t\t'public' => true,\r\n\t\t\t\t'query_var' => true,\r\n\t\t\t\t'has_archive' => false,\r\n\t\t\t\t'rewrite' => array('slug'=> 'guides', 'with_front' => true),\r\n\t\t\t\t'hierarchical' => false,\r\n 'taxonomies' => array('post_tag'),\r\n\t\t\t\t'show_ui' => true,\r\n\t\t\t\t'show_in_menu' => true,\r\n\t\t\t\t'show_in_rest' => true,\r\n\t\t\t\t'show_in_nav_menus' => true,\r\n\t\t\t\t'show_in_admin_bar' => true,\r\n\t\t\t\t'menu_position' => 5,\r\n\t\t\t\t'can_export' => true,\r\n\t\t\t\t'exclude_from_search' => false,\r\n\t\t\t\t'publicly_queryable' => true,\r\n\t\t\t\t'capability_type' => 'post',\r\n\t\t\t\t'supports' => array('title','thumbnail', 'revisions', 'excerpt', 'editor')\r\n\t\t\t);\r\n\tregister_post_type( 'study_guides', $args3 );\r\n \r\n $labels4 = array(\r\n\t\t\t\t'name' => __( 'Donation Pages' ),\r\n \t\t'singular_name' => __( 'Donation Page' ),\r\n\t\t\t\t'all_items' => __( 'All Donation Pages' ),\r\n\t\t\t\t'view_item' => __( 'View Donation Page' ),\r\n\t\t\t\t'add_new_item' => __( 'Add New Donation Page' ),\r\n\t\t\t\t'edit_item' => __( 'Edit Donation Page' ),\r\n\t\t\t\t'update_item' => __( 'Update Donation Page' ),\r\n\t\t\t\t'search_items' => __( 'Search Donation Pages' ),\r\n\t\t\t\t'not_found' => __( 'Not Found' ),\r\n\t\t\t\t'not_found_in_trash' => __( 'Not Found in Trash' ),\r\n\t\t\t);\r\n\t$args4 = array(\r\n\t\t\t\t'label' => 'Donation Page',\r\n\t\t\t\t'description' => 'Directory of Donation Pages',\r\n\t\t\t\t'labels' => $labels4,\r\n\t\t\t\t'public' => true,\r\n\t\t\t\t'query_var' => true,\r\n\t\t\t\t'has_archive' => false,\r\n\t\t\t\t//'rewrite' => array('slug'=> 'donate', 'with_front' => true),\r\n\t\t\t\t'rewrite' => false,\r\n\t\t\t\t'hierarchical' => false,\r\n 'taxonomies' => array('post_tag'),\r\n\t\t\t\t'show_ui' => true,\r\n\t\t\t\t'show_in_menu' => true,\r\n\t\t\t\t'show_in_rest' => true,\r\n\t\t\t\t'show_in_nav_menus' => true,\r\n\t\t\t\t'show_in_admin_bar' => true,\r\n\t\t\t\t'menu_position' => 5,\r\n\t\t\t\t'can_export' => true,\r\n\t\t\t\t'exclude_from_search' => true,\r\n\t\t\t\t'publicly_queryable' => true,\r\n\t\t\t\t'capability_type' => 'post',\r\n\t\t\t\t'supports' => array('title','thumbnail', 'revisions', 'excerpt', 'editor')\r\n\t\t\t);\r\n\tregister_post_type( 'donation_page', $args4 );\r\n \r\n //custom rewrites for Donation pages\r\n add_rewrite_rule( '[^/]+/attachment/([^/]+)/?$', 'index.php?attachment=$matches[1]', 'bottom');\r\n add_rewrite_rule( '[^/]+/attachment/([^/]+)/trackback/?$', 'index.php?attachment=$matches[1]&tb=1', 'bottom');\r\n add_rewrite_rule( '[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?attachment=$matches[1]&feed=$matches[2]', 'bottom');\r\n add_rewrite_rule( '[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$', 'index.php?attachment=$matches[1]&feed=$matches[2]', 'bottom');\r\n add_rewrite_rule( '[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$', 'index.php?attachment=$matches[1]&cpage=$matches[2]', 'bottom');\r\n add_rewrite_rule( '[^/]+/attachment/([^/]+)/embed/?$', 'index.php?attachment=$matches[1]&embed=true', 'bottom');\r\n add_rewrite_rule( '([^/]+)/embed/?$', 'index.php?donation_page=$matches[1]&embed=true', 'bottom');\r\n add_rewrite_rule( '([^/]+)/trackback/?$', 'index.php?donation_page=$matches[1]&tb=1', 'bottom');\r\n add_rewrite_rule( '([^/]+)/page/?([0-9]{1,})/?$', 'index.php?donation_page=$matches[1]&paged=$matches[2]', 'bottom');\r\n add_rewrite_rule( '([^/]+)/comment-page-([0-9]{1,})/?$', 'index.php?donation_page=$matches[1]&cpage=$matches[2]', 'bottom');\r\n add_rewrite_rule( '([^/]+)(?:/([0-9]+))?/?$', 'index.php?donation_page=$matches[1]', 'bottom');\r\n add_rewrite_rule( '[^/]+/([^/]+)/?$', 'index.php?attachment=$matches[1]', 'bottom');\r\n add_rewrite_rule( '[^/]+/([^/]+)/trackback/?$', 'index.php?attachment=$matches[1]&tb=1', 'bottom');\r\n add_rewrite_rule( '[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?attachment=$matches[1]&feed=$matches[2]', 'bottom');\r\n add_rewrite_rule( '[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$', 'index.php?attachment=$matches[1]&feed=$matches[2]', 'bottom');\r\n add_rewrite_rule( '[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$', 'index.php?attachment=$matches[1]&cpage=$matches[2]', 'bottom');\r\n add_rewrite_rule( '[^/]+/([^/]+)/embed/?$', 'index.php?attachment=$matches[1]&embed=true', 'bottom');\r\n}", "function ic_custom_taxonomy(){\n global $ic_custom_taxonomies;\n \n foreach( $ic_custom_taxonomies as $taxonomy => $params ) {\n register_taxonomy($taxonomy, $params['object_type'], $params); \n }\n}", "function create_staff_taxonomies()\n{\n $labels = array(\n 'name' => __('行政人員分類'),\n 'singular_name' => __('行政人員分類'),\n 'search_items' => __('搜尋行政人員分類'),\n 'all_items' => __('全部分類'),\n 'parent_item' => __('上層'),\n 'parent_item_colon' => __('上層分類:'),\n 'edit_item' => __('編輯行政人員分類'),\n 'update_item' => __('更新行政人員分類'),\n 'new_item_name' => __('新行政人員分類名稱'),\n 'menu_name' => __('行政人員分類'),\n );\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'show_in_nav_menus' => true,\n 'rewrite' => array('slug' => 'staffs', 'with_front' => true),\n );\n $postTypes = array('staff');\n register_taxonomy('staffs', $postTypes, $args);\n}", "function register_taxonomy() {\n $labels = array(\n 'name' => __('Tags', 'muiteer'),\n 'singular_name' => __('Tag', 'muiteer'),\n 'menu_name' => __('Tags', 'muiteer'),\n 'all_items' => __('All Tags', 'muiteer'),\n 'parent_item' => __('Parent Tag', 'muiteer'),\n 'parent_item_colon' => __('Parent Tag:', 'muiteer'),\n 'new_item_name' => __('New Tag', 'muiteer'),\n 'add_new_item' => __('Add New Item', 'muiteer'),\n 'edit_item' => __('Edit Tag', 'muiteer'),\n 'update_item' => __('Update Documentation Tag', 'muiteer'),\n 'view_item' => __('View Tag', 'muiteer'),\n 'separate_items_with_commas' => __('Separate items with commas', 'muiteer'),\n 'add_or_remove_items' => __('Add or remove items', 'muiteer'),\n 'choose_from_most_used' => __('Choose from the most used', 'muiteer'),\n 'popular_items' => __('Popular Tags', 'muiteer'),\n 'search_items' => __('Search Tags', 'muiteer'),\n 'not_found' => __('No tags found.', 'muiteer'),\n 'no_terms' => __('No items', 'muiteer'),\n 'items_list' => __('Tags list', 'muiteer'),\n 'items_list_navigation' => __('Tags list navigation', 'muiteer'),\n );\n $rewrite = array(\n 'slug' => 'doc-tag',\n 'with_front' => true,\n 'hierarchical' => false,\n );\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n 'show_in_rest' => true,\n 'rewrite' => $rewrite\n );\n register_taxonomy('doc_tag', array('docs'), $args);\n }", "function register_book_genre_taxonomy()\n{\n register_taxonomy('book_genre', 'book', [\n 'rewrite' => [\n 'slug' => 'books/genre',\n 'with_front' => true,\n 'hierarchical' => true,\n ],\n 'hierarchical' => true,\n 'public' => true,\n 'labels' => [\n 'name' => _x('Genres', 'taxonomy general name', config('textdomain')),\n 'singular_name' => _x('Genre', 'taxonomy singular name', config('textdomain')),\n 'search_items' => __('Search Genres', config('textdomain')),\n 'all_items' => __('All Genres', config('textdomain')),\n 'parent_item' => __('Parent Genre', config('textdomain')),\n 'parent_item_colon' => __('Parent Genre:', config('textdomain')),\n 'edit_item' => __('Edit Genre', config('textdomain')),\n 'update_item' => __('Update Genre', config('textdomain')),\n 'add_new_item' => __('Add New Genre', config('textdomain')),\n 'new_item_name' => __('New Genre Name', config('textdomain')),\n 'menu_name' => __('Genre', config('textdomain')),\n ],\n ]);\n}", "public function registerTaxonomyToObjects()\n {\n // register Taxonomy to each of the PostTypes assigned\n if (!empty($this->posttypes)) {\n foreach ($this->posttypes as $posttype) {\n register_taxonomy_for_object_type($this->name, $posttype);\n }\n }\n }", "function create_cpt_taxonomies()\n{\n $labels = array(\n 'name' => _x('Categorieën', 'taxonomy general name'),\n 'singular_name' => _x('Categorie', 'taxonomy singular name'),\n 'search_items' => __('Categorieën doorzoeken'),\n 'all_items' => __('All Categories'),\n 'parent_item' => __('Parent Category'),\n 'parent_item_colon' => __('Parent Category:'),\n 'edit_item' => __('Edit Category'),\n 'update_item' => __('Update Category'),\n 'add_new_item' => __('Add New Category'),\n 'new_item_name' => __('New Category Name'),\n 'menu_name' => __('Categories'),\n );\n\n $args = array(\n 'hierarchical' => true, // Set this to 'false' for non-hierarchical taxonomy (like tags)\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'mediatheek' ),\n );\n\n register_taxonomy('create_cpt_taxonomies', array( 'mediatheek' ), $args);\n}", "public function register_taxonomy()\n {\n\n // Default labels, overwrite them with the given labels.\n $labels = array_merge(\n [\n 'name' => sprintf(_x('%s', 'taxonomy general name', 'rebe'), $this->plural),\n 'singular_name' => sprintf(_x('%s', 'taxonomy singular name', 'rebe'), $this->title),\n 'search_items' => sprintf(__('Search %s', 'rebe'), $this->plural),\n 'popular_items' => sprintf(__('Popular %s', 'rebe'), $this->plural),\n 'all_items' => sprintf(__('All %s', 'rebe'), $this->plural),\n 'parent_item' => sprintf(__('Parent %s', 'rebe'), $this->title),\n 'parent_item_colon' => sprintf(__('Parent %s:', 'rebe'), $this->title),\n 'edit_item' => sprintf(__('Edit %s', 'rebe'), $this->title),\n 'update_item' => sprintf(__('Update %s', 'rebe'), $this->title),\n 'add_new_item' => sprintf(__('Add New %s', 'rebe'), $this->title),\n 'new_item_name' => sprintf(__('New %s Name', 'rebe'), $this->title),\n 'separate_items_with_commas' => sprintf(__('Separate %s with commas', 'rebe'), $this->plural),\n 'add_or_remove_items' => sprintf(__('Add or remove %s writers', 'rebe'), $this->plural),\n 'choose_from_most_used' => sprintf(__('Choose from the most used', 'rebe'), $this->plural),\n 'not_found' => sprintf(__('No %s found.', 'rebe'), $this->plural),\n 'menu_name' => sprintf(__('%s', 'rebe'), $this->plural),\n 'no_terms' => sprintf(__('No %s', 'rebe'), $this->plural),\n 'items_list_navigation' => sprintf(__('%s list navigation', 'rebe'), $this->plural),\n 'items_list' => sprintf(__('%s list', 'rebe'), $this->plural),\n 'show_in_rest' => true,\n 'rest_base' => $this->plural,\n 'rest_controller_class' => 'WP_REST_Posts_Controller',\n ],\n $this->labels\n );\n // Default arguments, overwitten with the given arguments\n $args = array_merge(\n [\n 'label' => sprintf(__('%s', 'rebe'), $this->plural),\n 'labels' => $labels,\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_nav_menus' => true,\n '_builtin' => false,\n 'show_admin_column' => false\n ],\n $this->args\n );\n\n register_taxonomy($this->name, $this->post_type, $args);\n }", "public function Generate_taxonomies()\r\n {\r\n // Taxonomie type d'estimation\r\n\r\n $labels_type = array(\r\n 'name' \t\t\t=> _x( 'Types', 'taxonomy general name'),\r\n 'singular_name' \t\t\t=> _x( 'Types', 'taxonomy singular name'),\r\n //'search_items' \t\t\t=> __( 'Chercher un lieux'),\r\n 'all_items' \t\t\t\t=> __( 'Tous les types'),\r\n 'edit_item' \t\t\t=> __( 'Editer un type'),\r\n 'update_item' \t\t\t=> __( 'Mettre à jour un type'),\r\n 'add_new_item' \t\t\t\t=> __( 'Ajouter un nouveau type'),\r\n 'new_item_name' \t\t\t=> __( 'Valeur du nouveau type'),\r\n 'menu_name' => __( 'type'),\r\n );\r\n\r\n $args_type = array(\r\n // Si 'hierarchical' est défini à false, notre taxonomie se comportera comme une étiquette standard\r\n 'hierarchical' => true,\r\n 'labels' => $labels_type,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'query_var' => true,\r\n //'rewrite' => array( 'slug' => '' ),\r\n );\r\n\r\n\r\n\r\n register_taxonomy( 'type', 'estimater', $args_type);\r\n // On déclare ici les différentes dénominations de notre taxonomie qui seront affichées et utilisées dans l'administration de WordPress\r\n $labels_caracteristique = array(\r\n 'name' \t\t\t=> _x( 'Caracteristiques', 'taxonomy general name'),\r\n 'singular_name' \t\t\t=> _x( 'Caracteristique', 'taxonomy singular name'),\r\n 'search_items' \t\t\t=> __( 'Chercher une caracteristique'),\r\n 'all_items' \t\t\t\t=> __( 'Toutes les caracteristiques'),\r\n 'edit_item' \t\t\t=> __( 'Editer une caracteristique'),\r\n 'update_item' \t\t\t=> __( 'Mettre à jour une caracteristique'),\r\n 'add_new_item' \t\t\t\t=> __( 'Ajouter une nouvelle caracteristique'),\r\n 'new_item_name' \t\t\t=> __( 'Valeur de la nouvelle caracteristique'),\r\n 'menu_name' => __( 'caracteristique'),\r\n );\r\n\r\n $args_caracteristique = array(\r\n // Si 'hierarchical' est défini à false, notre taxonomie se comportera comme une étiquette standard\r\n 'hierarchical' => true,\r\n 'labels' => $labels_caracteristique,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'query_var' => true,\r\n 'public' =>false\r\n //'rewrite' => array( 'slug' => 'annees' ),\r\n );\r\n\r\n register_taxonomy( 'caracteristiques', 'estimater', $args_caracteristique);\r\n\r\n\r\n $labels_projet = array(\r\n 'name' \t\t\t=> _x( 'projets', 'taxonomy general name'),\r\n 'singular_name' \t\t\t=> _x( 'projet', 'taxonomy singular name'),\r\n 'all_items' \t\t\t\t=> __( 'Tous les projets'),\r\n 'edit_item' \t\t\t=> __( 'Editer un projet'),\r\n 'update_item' \t\t\t=> __( 'Mettre à jour un projet'),\r\n 'add_new_item' \t\t\t\t=> __( 'Ajouter un projet'),\r\n 'new_item_name' \t\t\t=> __( 'Valeur du projet'),\r\n 'menu_name' => __( 'projet'),\r\n );\r\n\r\n $args_projet = array(\r\n // Si 'hierarchical' est défini à false, notre taxonomie se comportera comme une étiquette standard\r\n 'hierarchical' => true,\r\n 'labels' => $labels_projet,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'query_var' => true,\r\n 'public' =>false\r\n //'rewrite' => array( 'slug' => 'annees' ),\r\n );\r\n\r\n register_taxonomy( 'projet', 'estimater', $args_projet);\r\n\r\n\r\n $labels_statut_projet = array(\r\n 'name' \t\t\t=> _x( 'statut_projets', 'taxonomy general name'),\r\n 'singular_name' \t\t\t=> _x( 'statut_projet', 'taxonomy singular name'),\r\n 'all_items' \t\t\t\t=> __( 'Tous les statut_projets'),\r\n 'edit_item' \t\t\t=> __( 'Editer un statut_projet'),\r\n 'update_item' \t\t\t=> __( 'Mettre à jour un statut_projet'),\r\n 'add_new_item' \t\t\t\t=> __( 'Ajouter un statut_projet'),\r\n 'new_item_name' \t\t\t=> __( 'Valeur du statut_projet'),\r\n 'menu_name' => __( 'statut_projet'),\r\n );\r\n\r\n $args_statut_projet = array(\r\n // Si 'hierarchical' est défini à false, notre taxonomie se comportera comme une étiquette standard\r\n 'hierarchical' => true,\r\n 'labels' => $labels_statut_projet,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'query_var' => true,\r\n 'public' =>false\r\n //'rewrite' => array( 'slug' => 'annees' ),\r\n );\r\n\r\n register_taxonomy( 'statut_projet', 'estimater', $args_statut_projet);\r\n\r\n\r\n\r\n\r\n\r\n\r\n }", "function create_doctor_taxonomy()\n{\n\n // Add new taxonomy, make it hierarchical (like categories)\n $labels = array(\n 'name' => __( 'Regions' ),\n 'singular_name' => __( 'Region' ),\n 'search_items' => __( 'Search Regions' ),\n 'all_items' => __( 'All Regions' ),\n 'parent_item' => __( 'Parent Region' ),\n 'parent_item_colon' => __( 'Parent Region:' ),\n 'edit_item' => __( 'Edit Region' ),\n 'update_item' => __( 'Update Region' ),\n 'add_new_item' => __( 'Add New Region' ),\n 'new_item_name' => __( 'New Region Name' ),\n 'menu_name' => __( 'Regions' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n // 'rewrite' => array( 'slug' => 'regions' ),\n );\n\n register_taxonomy( 'regions', array( 'doctors' ), $args );\n}", "public function register_existing_tax() {\n\t\tif(is_array($this->post_type)) {\n\t\t\tforeach($this->post_type as $pt) {\n\t\t\t\tregister_taxonomy_for_object_type($this->tax_name, $pt);\n\t\t\t}\n\t\t} else {\n\t\t\tregister_taxonomy_for_object_type($this->tax_name, $this->post_type);\n\t\t}\n\t}", "function rpd_taxonomies() {\n\n\t$taxonomies = array(\n\t\tarray(\n\t \t\t'slug' => 'podcast_categories',\n\t\t\t'single_name' => 'Podcast Category',\n\t\t\t'plural_name' => 'Podcast Categories',\n\t\t\t'post_type' => 'podcasts',\n\t\t\t//\t'rewrite' => array( 'slug' => 'podcast_category' ),\n\t),\n\t\t\n\tarray(\n\t\t\t'slug' => 'podcast_tags',\n\t\t\t'single_name' => 'Podcast Tags',\n\t\t\t'plural_name' => 'Podcast Tags',\n\t\t\t'post_type' => 'podcasts',\n\t\t\t//\t'rewrite' => array( 'slug' => 'department' ),\n\t),\n\n\t);\n\n\tforeach( $taxonomies as $taxonomy ) {\n\t\t$labels = array(\n\t\t\t\t'name' => $taxonomy['plural_name'],\n\t\t\t\t'singular_name' => $taxonomy['single_name'],\n\t\t\t\t'search_items' => 'Search ' . $taxonomy['plural_name'],\n\t\t\t\t'all_items' => 'All ' . $taxonomy['plural_name'],\n\t\t\t\t'parent_item' => 'Parent ' . $taxonomy['single_name'],\n\t\t\t\t'parent_item_colon' => 'Parent ' . $taxonomy['single_name'] . ':',\n\t\t\t\t'edit_item' => 'Edit ' . $taxonomy['single_name'],\n\t\t\t\t'update_item' => 'Update ' . $taxonomy['single_name'],\n\t\t\t\t'add_new_item' => 'Add New ' . $taxonomy['single_name'],\n\t\t\t\t'new_item_name' => 'New ' . $taxonomy['single_name'] . ' Name',\n\t\t\t\t'menu_name' => $taxonomy['plural_name']\n\t\t);\n\n\t\t$rewrite = isset( $taxonomy['rewrite'] ) ? $taxonomy['rewrite'] : array( 'slug' => $taxonomy['slug'] );\n\t\t$hierarchical = isset( $taxonomy['hierarchical'] ) ? $taxonomy['hierarchical'] : true;\n\n\t\tregister_taxonomy( $taxonomy['slug'], $taxonomy['post_type'], array(\n\t\t'hierarchical' => $hierarchical,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => $rewrite,\n\t\t//'public' => false\n\t\t));\n\t}\n\n\t//ADD ABILITIY TO ASSIGN A CATEGORY TO AN IMAGE ATTACHMENT\n\n\tregister_taxonomy_for_object_type( 'category', 'attachments' );\n}", "function create_sports_taxonomy() {\n $labels = array(\n 'name' => 'Custom Attributes',\n 'singular_name' => 'Attribute',\n 'search_items' => 'Search Attributes',\n 'all_items' => 'All Attributes',\n 'parent_item' => 'Parent Attribute',\n 'parent_item_colon' => 'Parent Attribute:',\n 'edit_item' => 'Edit Attribute',\n 'update_item' => 'Update Attribute',\n 'add_new_item' => 'Add New Attribute',\n 'new_item_name' => 'New Attribute Name',\n 'menu_name' => 'Attribute'\n );\n // register the taxonomy\n register_taxonomy(\n 'attribute', array('sports', 'fruit'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true\n )\n );\n}", "public function add_custom_taxonomies() {\n register_taxonomy('team_member_category', 'team', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Categories', 'taxonomy general name' ),\n 'singular_name' => _x( 'Category', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Categories' ),\n 'all_items' => __( 'All Categories' ),\n 'parent_item' => __( 'Parent Category' ),\n 'parent_item_colon' => __( 'Parent Category:' ),\n 'edit_item' => __( 'Edit Category' ),\n 'update_item' => __( 'Update Category' ),\n 'add_new_item' => __( 'Add New Category' ),\n 'new_item_name' => __( 'New Category Name' ),\n 'menu_name' => __( 'Categories' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'team_member_category', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n }", "function rl_create_book_taxonomies() {\n\t$labels = array(\n\t\t'name' \t\t\t\t\t\t\t=> __( 'Authors', 'readinglist' ),\n\t\t'singular_name' \t\t\t\t=> __( 'Author', 'readinglist' ),\n\t\t'search_items' \t\t\t\t\t=> __( 'Search Authors', 'readinglist' ),\n\t\t'all_items' \t\t\t\t\t=> __( 'All Authors', 'readinglist' ),\n\t\t'edit_item' \t\t\t\t\t=> __( 'Edit Author', 'readinglist' ), \n\t\t'update_item' \t\t\t\t\t=> __( 'Update Author', 'readinglist' ),\n\t\t'add_new_item' \t\t\t\t\t=> __( 'Add New Author', 'readinglist' ),\n\t\t'new_item_name' \t\t\t\t=> __( 'New Author Name', 'readinglist' ),\n\t\t'separate_items_with_commas' \t=> __( 'Separate authors with commas', 'readinglist' ),\n\t\t'choose_from_most_used' \t\t=> __( 'Choose from the most used authors', 'readinglist' ),\n\t\t'menu_name' \t\t\t\t\t=> __( 'Authors', 'readinglist' ),\n\t); \t\n\t\t\n\tregister_taxonomy( 'book-author', array( 'rl_book' ), array(\n\t\t'hierarchical' \t\t=> false,\n\t\t'labels' \t\t\t=> $labels,\n\t\t'show_ui' \t\t\t=> true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' \t\t=> true,\n\t\t'rewrite' \t\t\t=> array( 'slug' => 'book-author' ),\n\t));\n}", "function wh_taxo_creats() {\n $posts = getPostypes();\n if ($posts) {\n foreach ($posts as $postType) {\n $id_post = $postType->getId();\n // creation de taxonomie lier aux poste type\n if (get_option($id_post)) {\n $Taxonomies = get_option($postType->getId())->getTabTaxonomie();\n foreach ($Taxonomies as $Taxonomie) {\n wh_add_taxonomies($Taxonomie, $id_post);\n }\n }\n }\n }\n}", "function create_ow_post_type() \n{\n\tregister_taxonomy(\n\t\t'owscat',\n\t\tarray('ow'),\n\t\tarray(\n\t\t\t'label' => __( 'Рубрики' ),\n\t\t\t'hierarchical' => true, \t\t\t\n\t\t\t'query_var' => true, \n\t\t\t'rewrite' => array( 'slug' => 'owscat' )\n\t\t)\n\t);\n\n\tregister_post_type('ow', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Наші роботи' ),\n\t\t\t'singular_name' => __( 'ow' )\n\n\t\t\t),\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'supports' => array( 'title', 'thumbnail', 'editor', 'author', 'custom-fields', 'comments'),\n\t\t'rewrite' => array( 'slug' => 'ow' ),\n\t\t'taxonomies' => array('owscat')\n\t\t)\n\t);\n\n}", "function affwp_setup_taxonomies() {\n\n\t$labels = array(\n\t\t'name' \t\t\t\t=> _x( 'Category', 'taxonomy general name', 'affwp' ),\n\t\t'singular_name' \t=> _x( 'Category', 'taxonomy singular name', 'affwp' ),\n\t\t'search_items' \t\t=> __( 'Search Categories', 'affwp' ),\n\t\t'all_items' \t\t=> __( 'All Categories', 'affwp' ),\n\t\t'parent_item' \t\t=> __( 'Parent Category', 'affwp' ),\n\t\t'parent_item_colon' => __( 'Parent Category:', 'affwp' ),\n\t\t'edit_item' \t\t=> __( 'Edit Category', 'affwp' ),\n\t\t'update_item' \t\t=> __( 'Update Category', 'affwp' ),\n\t\t'add_new_item' \t\t=> __( 'Add New Category', 'affwp' ),\n\t\t'new_item_name' \t=> __( 'New Category Name', 'affwp' ),\n\t\t'menu_name' \t\t=> __( 'Categories', 'affwp' ),\n\t);\n\n\t$args = array(\n\t\t'hierarchical' \t=> true,\n\t\t'labels' \t\t=> $labels,\n\t\t'show_ui' \t\t=> true,\n\t\t'query_var' \t=> 'doc_category',\n\t\t'public'\t\t=> true,\n\t\t'rewrite' \t\t=> array( 'slug' => 'docs' . '/section', 'with_front' => false, 'hierarchical' => true )\n\t);\n\n\tregister_taxonomy( 'doc_category', array( 'docs' ), $args );\n}", "function pm_create_taxonomy() {\n\n $labels = array(\n 'name' => _x( 'Meal Types', 'taxonomy general name', 'picobelly-meals' ),\n 'singular_name' => _x( 'Meal Type', 'taxonomy singular name', 'picobelly-meals' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'meal-type' ),\n );\n\n register_taxonomy('pm_meal_type', 'pm_meals', $args );\n}", "function set_custom_post_types()\n{\n $post_types = array();\n\n /*\n *\n * Left empty : populate after examples library\n *\n */\n\n if ($post_types) {\n foreach ($post_types as $post_type) {\n // Register post type\n if ( $post_type['post_type_name'] && $post_type['post_type_args'] ) {\n register_post_type($post_type['post_type_name'], $post_type['post_type_args']);\n // Register taxonomy for post type\n if ($post_type['taxonomy_name'] && $post_type['taxonomy_args']) {\n register_taxonomy($post_type['taxonomy_name'], $post_type['post_type_name'], $post_type['taxonomy_args']);\n }\n }\n }\n }\n\n}", "public function register_taxonomies() {\n\n }", "function business_register_taxonomy_for_images() {\n register_taxonomy_for_object_type( 'category', 'attachment' ); \n\tregister_taxonomy_for_object_type( 'content_type', 'attachment' );\n}", "function wpv_add_filter_term_taxonomy($filters) {\n $filters['taxonomy_term'] = array('name' => 'Taxonomy term',\n\t\t\t\t\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t\t\t\t\t'callback' => 'wpv_add_term_taxonomy',\n\t\t\t\t\t\t\t\t\t\t'args' => array());\n return $filters;\n }", "function create_sport_taxonomy() {\n $labels = array(\n 'name' => 'Custom Attributes',\n // shows in the front end, whatis seen as the category set of names\n 'singular_name' => 'Attribute',\n 'search_items' => 'Search Attributes',\n // so user can search\n 'all_items' => 'All Attributes',\n 'parent_item' => 'Parent Attribute',\n 'parent_item_colon' => 'Parent Attribute:',\n // for how it displays on the dash\n 'edit_item' => 'Edit Attribute',\n 'update_item' => 'Update Attribute',\n 'add_new_item' => 'Add new Attribute',\n 'new_item_name' => 'New Attribute Name',\n 'menu_name' => 'Attribute'\n );\n\n // within the function, register the taxonomy\n register_taxonomy(\n 'attribute',\n // taxonomy key! the dataname for it! or whatevs!\n array('sports'),\n array(\n 'hierarchical' => true,\n // taxonomy type- relates to the use of parents, whether you use them or not.\n 'labels' => $labels,\n // pluggin in our labelsz\n 'show_ui' => true\n // show it in the dashboard\n )\n );\n // wp funciton that takes our labels\n // 1st arg = taxonomy name\n // 2nd arg = custom post type u want to associate it to, taken as an array\n // 3rd arg = array of the labels and other taxonomy stuff, including taxonomy type\n}", "function skwp_taxonomies_for_pages() {\n\t\tregister_taxonomy_for_object_type('post_tag', 'page');\n\t\tregister_taxonomy_for_object_type('category', 'page');\n\t}", "function build_taxonomies() {\n register_taxonomy( 'portcats', 'portfolio',\n\t array( \n\t'hierarchical' => true, \n\t'label' => 'Portfolio Categories', \n\t'query_var' => true, \n\t'rewrite' => true ,\n\t'public' => true,\n\t'rewrite' => array( 'slug' => 'portfolio-categories' ),\n\t'show_admin_column' => true,\n\t'_builtin' => true\n ) ); \n\n register_taxonomy( 'service_type', 'portfolio',\n\t array( \n\t'hierarchical' => true, \n\t'label' => 'Service Type', \n\t'query_var' => true, \n\t'rewrite' => true ,\n\t'public' => true,\n\t'rewrite' => array( 'slug' => 'service-type' ),\n\t'show_admin_column' => true,\n\t'_builtin' => true\n ) ); \n \n register_taxonomy( 'people_categories', 'people',\n array( \n 'hierarchical' => true, \n 'label' => 'People Categories', \n 'query_var' => true, \n 'rewrite' => true ,\n 'public' => true,\n 'rewrite' => array( 'slug' => 'people-categories' ),\n 'show_admin_column' => true,\n '_builtin' => true\n ) );\n\t\n\t// Add some custom categories to the post type \n/*\n register_taxonomy( 'groups', 'portfolio',\n\t array( \n\t'hierarchical' => false, \n\t'label' => 'Portfolio Groups', \n\t'query_var' => true, \n\t'rewrite' => true ,\n\t'public' => true,\n\t//'rewrite' => array( 'slug' => 'portfolio-categories' ),\n\t'show_admin_column' => true,\n\t'_builtin' => true\n\t) );*/\n\n\t\n\t\n}", "function register_custom_taxonomies() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Aircraft Types', 'Taxonomy General Name', '_glad' ),\n\t\t'singular_name' => _x( 'Aircraft Type', 'Taxonomy Singular Name', '_glad' ),\n\t\t'menu_name' => __( 'Aircraft Type', '_glad' ),\n\t\t'all_items' => __( 'All Aircraft Types', '_glad' ),\n\t\t'parent_item' => __( 'Parent Item', '_glad' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', '_glad' ),\n\t\t'new_item_name' => __( 'New Aircraft Type', '_glad' ),\n\t\t'add_new_item' => __( 'Add New Aircraft Type', '_glad' ),\n\t\t'edit_item' => __( 'Edit Item', '_glad' ),\n\t\t'update_item' => __( 'Update Item', '_glad' ),\n\t\t'view_item' => __( 'View Item', '_glad' ),\n\t\t'separate_items_with_commas' => __( 'Separate items with commas', '_glad' ),\n\t\t'add_or_remove_items' => __( 'Add or remove items', '_glad' ),\n\t\t'choose_from_most_used' => __( 'Choose from the most used', '_glad' ),\n\t\t'popular_items' => __( 'Popular Items', '_glad' ),\n\t\t'search_items' => __( 'Search Items', '_glad' ),\n\t\t'not_found' => __( 'Not Found', '_glad' ),\n\t\t'no_terms' => __( 'No items', '_glad' ),\n\t\t'items_list' => __( 'Items list', '_glad' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', '_glad' ),\n\t);\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_tagcloud' => true,\n\t);\n\tregister_taxonomy( 'aircraft', array( 'listing', 'comp' ), $args );\n\n $labels = array(\n 'name' => _x( 'Market Status', 'Taxonomy General Name', '_glad' ),\n 'singular_name' => _x( 'Market Status', 'Taxonomy Singular Name', '_glad' ),\n 'menu_name' => __( 'Market Status', '_glad' ),\n 'all_items' => __( 'All Types', '_glad' ),\n 'parent_item' => __( 'Parent Item', '_glad' ),\n 'parent_item_colon' => __( 'Parent Item:', '_glad' ),\n 'new_item_name' => __( 'New Status', '_glad' ),\n 'add_new_item' => __( 'Add New Status', '_glad' ),\n 'edit_item' => __( 'Edit Item', '_glad' ),\n 'update_item' => __( 'Update Item', '_glad' ),\n 'view_item' => __( 'View Item', '_glad' ),\n 'separate_items_with_commas' => __( 'Separate items with commas', '_glad' ),\n 'add_or_remove_items' => __( 'Add or remove items', '_glad' ),\n 'choose_from_most_used' => __( 'Choose from the most used', '_glad' ),\n 'popular_items' => __( 'Popular Items', '_glad' ),\n 'search_items' => __( 'Search Items', '_glad' ),\n 'not_found' => __( 'Not Found', '_glad' ),\n 'no_terms' => __( 'No items', '_glad' ),\n 'items_list' => __( 'Items list', '_glad' ),\n 'items_list_navigation' => __( 'Items list navigation', '_glad' ),\n );\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'rewrite' => array(\n 'slug' => 'listings',\n 'with_front' => false\n ),\n 'public' => true,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n );\n register_taxonomy( 'marketstatus', array( 'listing', 'comp' ), $args );\n\n $labels = array(\n 'name' => _x( 'Types', 'Taxonomy General Name', '_glad' ),\n 'singular_name' => _x( 'Type', 'Taxonomy Singular Name', '_glad' ),\n 'menu_name' => __( 'Types', '_glad' ),\n 'all_items' => __( 'All Types', '_glad' ),\n 'new_item_name' => __( 'New Type', '_glad' ),\n 'add_new_item' => __( 'Add New Type', '_glad' ),\n );\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'rewrite' => array(\n 'slug' => 'type',\n 'with_front' => false\n ),\n 'public' => true,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n );\n register_taxonomy( 'opptype', array( 'opportunity' ), $args );\n\n $labels = array(\n 'name' => _x( 'Referral Type', 'Taxonomy General Name', '_glad' ),\n 'singular_name' => _x( 'Referral Type', 'Taxonomy Singular Name', '_glad' ),\n 'menu_name' => __( 'Referral Type', '_glad' ),\n 'all_items' => __( 'All Types', '_glad' ),\n 'new_item_name' => __( 'New Type', '_glad' ),\n 'add_new_item' => __( 'Add New Type', '_glad' ),\n );\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'rewrite' => array(\n 'slug' => 'referraltype',\n 'with_front' => false\n ),\n 'public' => true,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n );\n register_taxonomy( 'referraltype', array( 'referrals' ), $args );\n\n $labels = array(\n 'name' => _x( 'Coupon Type', 'Taxonomy General Name', '_glad' ),\n 'singular_name' => _x( 'Coupon Type', 'Taxonomy Singular Name', '_glad' ),\n 'menu_name' => __( 'Coupon Type', '_glad' ),\n 'all_items' => __( 'All Types', '_glad' ),\n 'new_item_name' => __( 'New Type', '_glad' ),\n 'add_new_item' => __( 'Add New Type', '_glad' ),\n );\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'rewrite' => array(\n 'slug' => 'coupontype',\n 'with_front' => false\n ),\n 'public' => true,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n );\n register_taxonomy( 'coupontype', array( 'coupons' ), $args );\n\n $labels = array(\n 'name' => _x( 'Alert Type', 'Taxonomy General Name', '_glad' ),\n 'singular_name' => _x( 'Alert Type', 'Taxonomy Singular Name', '_glad' ),\n 'menu_name' => __( 'Alert Type', '_glad' ),\n 'all_items' => __( 'All Types', '_glad' ),\n 'new_item_name' => __( 'New Type', '_glad' ),\n 'add_new_item' => __( 'Add New Type', '_glad' ),\n );\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'rewrite' => array(\n 'slug' => 'alerttype',\n 'with_front' => false\n ),\n 'public' => true,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n );\n register_taxonomy( 'alerttype', array( 'alert' ), $args );\n\n}", "function register_taxonomies() {\n\t\tinclude('functions/project_categories.tax.php');\n\t\tinclude('functions/project_keywords.tax.php');\n\t}", "public function add_terms(){\n $this->add_video_project_taxonomies();\n $this->register_terms();\n }", "public function typeTaxonomyRegister() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Rodzaj sprzętu', 'webwolf-engine' ),\n\t\t\t'singular_name' => _x( 'Rodzaj sprzętu', 'webwolf-engine' ),\n\t\t\t'menu_name' => __( 'Rodzaj sprzętu', 'webwolf-engine' ),\n\t\t\t'all_items' => __( 'Wszystkie rodzaje strzętów', 'webwolf-engine' ),\n\t\t\t'add_new_item' => __( 'Dodaj rodzaj sprzętu', 'webwolf-engine' ),\n\t\t\t'edit_item' => __( 'Edytuj rodzaj sprzętu', 'webwolf-engine' ),\n\t\t\t'update_item' => __( 'Aktualizuj rodzaj sprzętu', 'webwolf-engine' ),\n\t\t\t'search_items' => __( 'Szukaj rodzaj sprzętu', 'webwolf-engine' ),\n\t\t);\n\t\t \n\t// Set other options for Custom Post Type\n\t\t \n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_in_rest' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'device-type' ),\n\t);\n\t\t \n\t\t// Registering your Custom Post Type\n\t\tregister_taxonomy( 'device-types', [ 'model' ], $args );\n\t}", "function create_zapas_taxonomy_team() {\n\n// Add new taxonomy, make it hierarchical like categories\n//first do the translations part for GUI\n\n $labels = array(\n 'name' => _x( 'Soutěž', 'pasos' ),\n 'singular_name' => _x( 'Soutěž', 'pasos' ),\n 'search_items' => __( 'Najít Soutěž' ),\n 'all_items' => __( 'Všechny soutěže' ),\n 'parent_item' => __( 'Parent Topic' ),\n 'parent_item_colon' => __( 'Parent Topic:' ),\n 'edit_item' => __( 'Upravit Soutěž' ), \n 'update_item' => __( 'Aktualizovat soutěž' ),\n 'add_new_item' => __( 'Přidat novou soutěž' ),\n 'new_item_name' => __( 'Název nové soutěže' ),\n 'menu_name' => __( 'Týmy' ),\n ); \t\n\n// Now register the taxonomy\n\n register_taxonomy('soutez',array('zapas'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'soutez' ),\n ));\n\n}", "public function registerTaxonomy()\n {\n $postTypeName = $this->postTypeName;\n\n // Taxonomy properties\n $taxonomyLabels = $this->taxonomyLabels;\n $taxonomyArgs = $this->taxonomyArgs;\n\n // Default labels, overwrite them with the given labels.\n $this->taxonomyLabels = array_merge(\n // Default\n array(\n 'name' => $this->namePlural,\n 'singular_name' => $this->nameSingular,\n 'search_items' => sprintf(__('Search %s', APIPROJECTMANAGER_TEXTDOMAIN), strtolower($this->namePlural)),\n 'all_items' => sprintf(__('All %s', APIPROJECTMANAGER_TEXTDOMAIN), strtolower($this->namePlural)),\n 'parent_item' => sprintf(__('Parent %s:', APIPROJECTMANAGER_TEXTDOMAIN), strtolower($this->nameSingular)),\n 'parent_item_colon' => sprintf(__('Parent %s:', APIPROJECTMANAGER_TEXTDOMAIN), strtolower($this->nameSingular)) . ':',\n 'edit_item' => sprintf(__('Edit %s', APIPROJECTMANAGER_TEXTDOMAIN), strtolower($this->nameSingular)),\n 'update_item' => sprintf(__('Update %s', APIPROJECTMANAGER_TEXTDOMAIN), strtolower($this->nameSingular)),\n 'add_new_item' => sprintf(__('Add new %s', APIPROJECTMANAGER_TEXTDOMAIN), strtolower($this->nameSingular)),\n 'new_item_name' => sprintf(__('New %s Name', APIPROJECTMANAGER_TEXTDOMAIN), strtolower($this->nameSingular)),\n 'menu_name' => $this->namePlural,\n ),\n // Given labels\n $taxonomyLabels\n );\n\n // Default arguments, overwitten with the given arguments\n $this->taxonomyArgs = array_merge(\n array(\n 'label' => $this->namePlural,\n 'labels' => $this->taxonomyLabels,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_nav_menus' => true,\n '_builtin' => false,\n ),\n $taxonomyArgs\n );\n\n register_taxonomy($this->taxonomyName, $postTypeName, $this->taxonomyArgs);\n }", "public function register_taxonomies() {\n\n\t\t// Add new taxonomy, make it hierarchical (like categories)\n $labels = array(\n 'name' => _x( 'Event Type', 'taxonomy general name' ),\n 'singular_name' => _x( 'Event Type', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Event Types' ),\n 'all_items' => __( 'All Event Types' ),\n 'parent_item' => __( 'Parent Type' ),\n 'parent_item_colon' => __( 'Parent Type:' ),\n 'edit_item' => __( 'Edit Event Type' ),\n 'update_item' => __( 'Update Event Type' ),\n 'add_new_item' => __( 'Add New Event Type' ),\n 'new_item_name' => __( 'New Event Type Name' ),\n 'menu_name' => __( 'Event Type' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'events' ),\n );\n\n register_taxonomy( 'custom_event_type', array( 'custom_events' ), $args );\n\t\n\t}", "function create_artist_taxonomies() {\n $labels = array(\n 'name' => _x( 'Artist Categories', 'Artist Categories','rekord' ),\n 'singular_name' => _x( 'Artist Category', 'Artist Category','rekord' ),\n 'search_items' => __( 'Search Category','rekord' ),\n 'all_items' => __( 'All Categories','rekord' ),\n 'parent_item' => __( 'Parent Category','rekord' ),\n 'parent_item_colon' => __( 'Parent Category','rekord' ),\n 'edit_item' => __( 'Edit Category','rekord' ),\n 'update_item' => __( 'Update Category','rekord' ),\n 'add_new_item' => __( 'Add New Category','rekord' ),\n 'new_item_name' => __( 'New Category Name','rekord' ),\n 'menu_name' => __( 'Artist Categories','rekord' ),\n 'taxonomies' => array( 'artist-categories' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n \n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'artist-categories','with_front' => true ),\n 'capability_type' => 'post',\n );\n\n register_taxonomy( 'artist-categories', array( 'artist'), $args );\n}", "public function register_taxonomies(){\n\n\t\tfunction wptp_create_task_types_taxonomies(){\n\t\t \n\t\t $labels = array(\n\t\t 'name' => _x( 'Task types', 'taxonomy general name' ),\n\t\t 'singular_name' => _x( 'Task type', 'taxonomy singular name' ),\n\t\t 'search_items' => __( 'Search Task types' ),\n\t\t 'all_items' => __( 'All Task types' ),\n\t\t 'parent_item' => __( 'Parent Task type' ),\n\t\t 'parent_item_colon' => __( 'Parent Task type:' ),\n\t\t 'edit_item' => __( 'Edit Task type' ),\n\t\t 'update_item' => __( 'Update Task type' ),\n\t\t 'add_new_item' => __( 'Add New Task type' ),\n\t\t 'new_item_name' => __( 'New Task type Name' ),\n\t\t 'menu_name' => __( 'Task types' ),\n\t\t );\n\n\t\t // Add taxonomie 'home dimension' (as category)\n\t\t register_taxonomy('task-type', array('task'), array(\n\t\t 'hierarchical' => true,\n\t\t 'labels' => $labels,\n\t\t 'show_ui' => true,\n\t\t 'query_var' => true,\n\t\t \t'rewrite' => true\n\t\t ));\n\t\t}\n\t\tadd_action( 'init', 'wptp_create_task_types_taxonomies', 0 );\n\t}", "function jan19_init() {\n register_taxonomy_for_object_type( 'category', 'attachment' );\n register_taxonomy_for_object_type( 'post_tag', 'attachment' );\n /*\n * Register custom post types. You can also move this code to a plugin.\n */\n /* Pinegrow generated Custom Post Types Begin */\n\n /* Pinegrow generated Custom Post Types End */\n \n /*\n * Register custom taxonomies. You can also move this code to a plugin.\n */\n /* Pinegrow generated Taxonomies Begin */\n\n /* Pinegrow generated Taxonomies End */\n}", "public function init_taxonomies() {\n\t\tregister_taxonomy(\n\t\t\t'thespa-message-tax',\n\t\t\tapply_filters( 'thespa_taxonomy_objects_message', array( 'thespa-message' ) ),\n\t\t\tapply_filters( 'thespa_taxonomy_args_message', array(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => 'thespa Message',\n\t\t\t\t),\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'show_ui' => false,\n\t\t\t\t'query_var' => true,\n\t\t\t\t'rewrite' => false,\n\t\t\t) )\n\t\t);\n\t}", "function create_danh_muc_taxonomies()\n{\n $labels = array(\n 'name' => __('Page category'),\n 'singular_name' => __( 'Page category' ),\n 'search_items' => __( 'Tìm Page category' ),\n 'popular_items' => __( 'Page category phổ biến' ),\n 'all_items' => __( 'Danh sách Page category' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Sửa' ),\n 'update_item' => __( 'Cập nhật' ),\n 'add_new_item' => __( 'Thêm Page category' ),\n 'new_item_name' => __( 'Page category mới' ),\n 'separate_items_with_commas' => __( 'Ngăn cách bởi dấu phẩy' ),\n 'add_or_remove_items' => __( 'Thêm hoặc xóa Page category' ),\n 'choose_from_most_used' => __( 'Choose from the most used writers' ),\n 'not_found' => __( 'Không tìm thấy danh mục.' ),\n 'menu_name' => __( 'Page category' )\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n // 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'page-cat','with_front'=>false ),\n 'sort' => true\n );\n\n register_taxonomy( 'page-cat', array('page'), $args );\n}", "public function define_taxonomies( $taxonomies ) {\n\n /** Init Settings */\n $this->settings = new \\UsabilityDynamics\\Settings( array(\n 'key' => 'wpp_terms',\n 'store' => 'options',\n 'data' => array(\n 'name' => $this->name,\n 'version' => $this->args[ 'version' ],\n 'domain' => $this->domain,\n 'types' => array(\n 'multiple' => array(\n 'label' => __( 'Multiple Terms', $this->domain ),\n 'desc' => __( 'Property can have multiple terms. It\\'s a native WordPress functionality.', $this->domain ),\n ),\n 'unique' => array(\n 'label' => __( 'Unique Term', $this->domain ),\n 'desc' => __( 'Property can have only one term. ', $this->domain ),\n ),\n )\n )\n ));\n\n $this->prepare_taxonomies( $taxonomies );\n\n /**\n * Rich Taxonomies ( adds taxonomy post type )\n */\n $this->maybe_extend_taxonomies();\n\n /**\n * Extend Property Search with Taxonomies\n */\n $this->extend_wpp_settings();\n\n return $this->get( 'config.taxonomies', array() );\n }", "function tax_registration() {\n\n\t\t\t/**\n\t\t\t * Filter that gathers taxonomies that need to be registered\n\t\t\t * add_filters are currently added during the add_post_type() method in swfd_cpt.php\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t * \n\t\t\t * @param array\n\t\t\t */\n\t\t\t$taxes = apply_filters( 'sfwd_cpt_register_tax', array() );\n\n\t\t\t/**\n\t\t\t * The expected return form of the array is:\n\t\t\t *\tarray(\n\t\t\t *\t\t'tax_slug1' => \tarray(\n\t\t\t *\t\t\t\t\t\t\t'post_types' => array('sfwd-courses', 'sfwd-lessons'),\n\t\t\t * \t\t\t\t\t\t\t'tax_args' => array() // See register_taxonomy() third parameter for valid args options\n\t\t\t *\t\t\t\t\t\t),\n\t\t\t *\t\t'tax_slug2' => \tarray(\n\t\t\t *\t\t\t\t\t\t\t'post_types' => array('sfwd-lessons'),\n\t\t\t * \t\t\t\t\t\t\t'tax_args' => array() \n\t\t\t *\t\t\t\t\t\t),\n\t\t\t *\t)\n\t\t\t */\n\n\t\t\tif ( ! empty( $taxes ) ) {\n\t\t\t\tforeach( $taxes as $tax_slug => $tax_options ) {\n\t\t\t\t\tif ( !taxonomy_exists( $tax_slug ) ) {\n\t\t\t\t\t\tif ( ( isset( $tax_options['post_types'] ) ) && ( !empty( $tax_options['post_types'] ) ) ) {\n\t\t\t\t\t\t\tif ( ( isset( $tax_options['tax_args'] ) ) && ( !empty( $tax_options['tax_args'] ) ) ) {\n\n\t\t\t\t\t\t\t\t// Via the LD post type setup when the 'taxonomies' option is defined we can associate other taxonomies\n\t\t\t\t\t\t\t\t// with our custom post types by setting the tax slug and value as the same\n\t\t\t\t\t\t\t\tif ( $tax_slug !== $tax_options['tax_args']['rewrite']['slug'] ) {\n\t\t\t\t\t\t\t\t\t$tax_options = apply_filters( 'learndash_taxonomy_args', $tax_options, $tax_slug );\n\t\t\t\t\t\t\t\t\tif ( !empty( $tax_options ) ) {\n\t\t\t\t\t\t\t\t\t\tregister_taxonomy( $tax_slug, $tax_options['post_types'], $tax_options['tax_args'] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\t// If the taxonomy already exists we only need to then assocated the post_types \n\t\t\t\t\t\tif ( ( isset( $tax_options['post_types'] ) ) && ( !empty( $tax_options['post_types'] ) ) ) {\n\t\t\t\t\t\t\tforeach( $tax_options['post_types'] as $post_type ) {\n\t\t\t\t\t\t\t\tregister_taxonomy_for_object_type( $tax_slug, $post_type );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\n/*\n\t\t\t\tforeach ( $taxes as $k => $v ) {\n\n\t\t\t\t\tif ( ! empty( $v ) ) {\n\n\t\t\t\t\t\tforeach ( $v as $tax ) {\n\n\t\t\t\t\t\t\tif ( ! is_array( $tax[0] ) ) { \n\t\t\t\t\t\t\t\t$tax[0] = array( $tax[0] );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$post_types = array_merge( $post_types, $tax[0] );\n\n\t\t\t\t\t\t\tif ( empty( $tax_options ) ) {\n\t\t\t\t\t\t\t\t$tax_options = $tax[1];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tforeach ( $tax[1] as $l => $w ) {\n\t\t\t\t\t\t\t\t\t$tax_options[ $l] = $w;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} // end foreach\n\n\t\t\t\t\t} // endif\n\n\t\t\t\t}// end foreach\n*/\n//\t\t\t\tregister_taxonomy( $k, $post_types, $tax_options );\t\t\t\t\n\t\t\t} // endif\n\n\t\t}" ]
[ "0.8206082", "0.7365074", "0.71840525", "0.6886301", "0.6885997", "0.6877524", "0.68414974", "0.6817879", "0.68044776", "0.6774443", "0.6765802", "0.6751008", "0.6751008", "0.6745587", "0.6708066", "0.6701526", "0.66970867", "0.66969293", "0.6687027", "0.6687027", "0.6687027", "0.6687027", "0.6687027", "0.66649055", "0.6659919", "0.66502297", "0.6606073", "0.65633756", "0.65503365", "0.6547647", "0.65429235", "0.6542567", "0.6506906", "0.65037256", "0.6503247", "0.6499511", "0.6456253", "0.64014345", "0.6398255", "0.6392237", "0.63910806", "0.63735235", "0.6367875", "0.63678735", "0.6358258", "0.63577616", "0.635472", "0.6352086", "0.63261116", "0.6299596", "0.6272443", "0.6271796", "0.6271796", "0.6271796", "0.6271796", "0.626009", "0.6254345", "0.6254317", "0.62457365", "0.6240444", "0.6221882", "0.62205356", "0.62199485", "0.62185615", "0.62096775", "0.61978143", "0.61931586", "0.61926186", "0.61899173", "0.6189781", "0.6187043", "0.6181319", "0.61703473", "0.6169842", "0.61648494", "0.61645824", "0.6162626", "0.61537457", "0.614823", "0.6144378", "0.61392343", "0.61382335", "0.61370087", "0.61354846", "0.61321485", "0.6122903", "0.6106148", "0.6103952", "0.61007386", "0.6088514", "0.608436", "0.60540783", "0.6053098", "0.60400933", "0.60385865", "0.6034216", "0.6031879", "0.60274047", "0.6014364", "0.6012583" ]
0.82229793
0
filter the pool by color
фильтруйте пул по цвету
public function filterColor($p) { $colorPool = array(); // for each card in pool... foreach($p as $card) { //if card has no color ID, add it to colorPool if($card->getColors() == null) { $colorPool[] = $card; } else { // for each color of card... foreach($card->getColors() as $cardCol) { //for each color selected... foreach($this->model->getColors() as $selCol) { //add card to colorPool if there is a color match! if($cardCol == $selCol) { $colorPool[] = $card; break 2; } } } } } return $colorPool; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterColor($p) {\r\n\t\t// for each card in pool...\r\n\t\tforeach($p as $index => $card) {\r\n\t\t\t// for each color of card...\r\n\t\t\tforeach($card->getColors() as $cardCol) {\r\n\t\t\t\t$r = 0;\r\n\t\t\t\t// for each color selected...\r\n\t\t\t\tforeach($this->model->getColors() as $selCol) {\r\n\t\t\t\t\t// if color is selected, the card stays\r\n\t\t\t\t\tif($cardCol == $selCol) {\r\n\t\t\t\t\t\t$r = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// remove card if it has a color not selected\r\n\t\t\t\tif($r == 0) {\r\n\t\t\t\t\tunset($p[$index]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $p;\r\n\t}", "public function processPool($p) {\r\n\t\t$colorPool = $this->filterColor($p);\r\n\t\treturn $colorPool;\r\n\t}", "protected function filterModel()\n {\n return Color::class;\n }", "function imagetruecolortopalette($image,$dither,$ncolors)\n{\n}", "public function filter();", "function imagetruecolortopalette($image, $dither, $ncolors)\n{\n}", "public function uniqueImageColors () {}", "public function colorList() {}", "function pickcolor($img, $data_array, $row, $col)\r\n{\r\n $d = $data_array[$row][$col+1]; // col+1 skips over the row's label\r\n if ($d >= $_GET[\"r2\"]) return 0;\r\n if ($d >= $_GET[\"r1\"]) return 1;\r\n return 2;\r\n}", "public function agruparColorStock()\n {\n $sql = \"SELECT DISTINCT UCASE(color) color FROM stock WHERE color<>''\";\n $data = $this->con->prepare($sql);\n\n $data->execute();\n #retornamos los datos como objeto\n return $data->fetchAll(PDO::FETCH_OBJ);\n }", "private function any_filter()\r\n {\r\n //==================================================================\r\n // Count custom filter recorded in your current lisha\r\n //==================================================================\r\n $sql = \"\r\n SELECT\r\n 1\r\n FROM\r\n \".__LISHA_TABLE_FILTER__.\"\r\n WHERE 1 = 1\r\n AND `id` = '\".$this->protect_sql($this->c_id,$this->link).\"'\r\n \";\r\n $this->exec_sql($sql,__LINE__,__FILE__,__FUNCTION__,__CLASS__,$this->link);\r\n //==================================================================\r\n\r\n if($this->rds_num_rows($this->resultat) > 0)\r\n {\r\n // Not grey\r\n return true;\r\n }\r\n else\r\n {\r\n // Greyed\r\n return false;\r\n }\r\n }", "public function listarColorSel() {\n $sql = \"SELECT id,nombre from color where estado='disponible' ORDER BY nombre\";\n $this->objCon->Execute($sql);\n }", "public function getColorRange();", "public function getColor();", "public function getColor();", "public function applyFilter();", "function imagecolorclosest($image,$red,$green,$blue)\n{\n\treturn 0;\n}", "function filters()\n {\n }", "function imagecolorclosest($image, $red, $green, $blue)\n{\n return 0;\n}", "public function getImageColors () {}", "public function filters();", "protected function filterIdColumn()\n {\n return 'colors';\n }", "public function filter($r, $g, $b)\r\n {\r\n $this->canvas->colorize($r, $g, $b);\r\n\r\n return $this->canvas;\r\n }", "function imagecolorresolve($image, $red, $green, $blue)\n{\n return 0;\n}", "protected function dither()\n {\n if ( ! imageistruecolor($this->image)) {\n imagepalettetotruecolor($this->image);\n }\n\n imagefilter($this->image, IMG_FILTER_GRAYSCALE);\n imagetruecolortopalette($this->image, true, 2);\n }", "static function filter($gd,$data){\r\n\t\tif(!isset($data['x']) || !isset($data['y']) || !isset($data['w']) || !isset($data['h']) || \r\n\t\t\t!is_numeric($data['x']) || !is_numeric($data['y']) || !is_numeric($data['w']) || !is_numeric($data['h'])){\r\n\t\t\treturn $gd;\r\n\t\t}\r\n\t\t\r\n\t\t$width = imagesx($gd);\r\n\t\t$height = imagesy($gd);\r\n\r\n\t\t\r\n\t\t$gd2 = imagecreatetruecolor($data['w'], $data['h']);\r\n\t\t\r\n\t\timagecopy($gd2, $gd, 0, 0, $data['x'], $data['y'], $data['w'], $data['h']);\r\n\t\t\r\n\t\treturn $gd2;\r\n\t}", "public function forcebw() {\n /*\n vboxes = this.vboxes;\n vboxes.sort(function(a,b) { return pv.naturalOrder(pv.sum(a.color), pv.sum(b.color) )});\n\n // force darkest color to black if everything < 5\n var lowest = vboxes[0].color;\n if (lowest[0] < 5 && lowest[1] < 5 && lowest[2] < 5)\n vboxes[0].color = [0,0,0];\n\n // force lightest color to white if everything > 251\n var idx = vboxes.length-1,\n highest = vboxes[idx].color;\n if (highest[0] > 251 && highest[1] > 251 && highest[2] > 251)\n vboxes[idx].color = [255,255,255];\n */\n }", "function imageistruecolor($image)\n{\n}", "function imagecolorexact($image, $red, $green, $blue)\n{\n return 0;\n}", "public function filter (ImagickKernel $ImagickKernel , $CHANNEL = Imagick::CHANNEL_DEFAULT) { }", "public function getColorQuantum() { }", "function imagecolorresolve($image,$red,$green,$blue)\n{\n\treturn 0;\n}", "function imageistruecolor($image)\n{\n return true;\n}", "public function filter(array $images);", "public function colors();", "public function filter()\n {\n \n }", "function isColorUsed($args)\r\n{\r\n $id=(int)$args[0];\r\n $cnx_num=$args[1];\r\n\r\n $request=new requete(\"SELECT use_color_postit_type,color,color_id \r\n FROM kados_colors_uses,kados_colors \r\n WHERE color=color_name\r\n AND use_color_id=\".$id,$cnx_num);\r\n $colorUse=$request->getObject(); \r\n $table=''; \r\n if ($colorUse->use_color_postit_type=='NONE')\r\n {\r\n return 1;\r\n }\r\n switch ($colorUse->use_color_postit_type)\r\n {\r\n case 'US':\r\n $table='kados_user_stories';\r\n break; \r\n\r\n case 'TASK':\r\n $table='kados_tasks';\r\n break; \r\n\r\n case 'ACTIV':\r\n $table='kados_activities';\r\n break; \r\n\r\n case 'ACTIO':\r\n $table='kados_actions';\r\n break; \r\n }\r\n \r\n if ($table!='')\r\n { \r\n $request->envoi(\"SELECT COUNT(*) AS nbItem \r\n FROM \".$table.\" \r\n WHERE active=1 AND color='\".$colorUse->color.\"'\");\r\n $request->getObject(); \r\n $colorIsUsedInPostit=$request->objet->nbItem;\r\n // check if no project uses the color\r\n $request->envoi(\"SELECT COUNT(*) AS nbItem \r\n FROM kados_projects_colors\r\n WHERE project_id_fk=\".$colorUse->color_id.\"\r\n AND object_type='\".$colorUse->use_color_postit_type.\"'\");\r\n $request->getObject(); \r\n $colorIsUsedInProject=$request->objet->nbItem; \r\n return (!$colorIsUsedInProject && !$colorIsUsedInPostit);\r\n }\r\n else \r\n {\r\n return 0;\r\n }\r\n \r\n}", "function imagecolorsforindex($image,$color)\n{\n\treturn array();\n}", "function imagecolorclosestalpha($image,$red,$green,$blue,$alpha)\n{\n\treturn 0;\n}", "function colorTheGraph()\n {\n $this->d++; //No. of colors\n\n for($i=1;$i<=$this->vertexTotal;$i++)\n {\n for($j=1;$j<=$this->vertexTotal;$j++)\n {\n if($this->graph[$i][$j] == 1)\n {\n $this->vertexNo = $this->vertexNo - 1; //remaining vertices\n $this->k++;\n $this->colored[$this->k] = $i; // storage of colored vertices\n $this->colors[$this->d][$this->k] = $i; // storage of colored vertices\n $this->processGraph($i);\n }\n else\n {\n $this->graph[$i][$j] = 0;\n }\n }\n }\n }", "protected function color($value)\n {\n return $this->collection =\n $this->processMultipleFilters(\n $this->collection,\n 'color_name',\n $this->getMultipleFilters($value)\n );\n }", "function imagecolorsforindex($image, $color)\n{\n return array();\n}", "function imagecolorclosestalpha($image, $red, $green, $blue, $alpha)\n{\n}", "public function getImageColorspace () {}", "public function filterBreakPoints()\r\n {\r\n foreach (Nestor____stuff::$breakPoints as $bp) {\r\n if($bp->group){\r\n if(!isset(NestorGroup::$all[$bp->group])){\r\n $gr=new NestorGroup($bp->group);\r\n }\r\n $gr=NestorGroup::$all[$bp->group];\r\n $gr->count++;\r\n $gr->duration+=$bp->info->getDuration();\r\n\r\n if(!$gr->color && ($bp->color && $bp->color != \"group\")){\r\n $gr->color=$bp->color;\r\n }\r\n if($bp->color==\"group\" || !$bp->color){\r\n $bp->color=$gr->color;\r\n }\r\n }\r\n\r\n\r\n if($bp->isMainStep){\r\n $this->mainSteps[]=$bp;\r\n }\r\n }\r\n $this->groups=NestorGroup::$all;\r\n }", "function filter( $img, $filter ) {\r\n\r\n\r\n\t\tswitch ($filter) {\r\n\r\n\t\t\tcase \"none\":\r\n\t\t\t\t//print \"no filter applied\\n\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"poisson\":\r\n\t\t\t //print \"add poisson noise\\n\";\r\n\t\t\t\t$img->addNoiseImage ( imagick::NOISE_POISSON );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"laplacian\":\r\n\t\t\t //print \"add laplacian noise\\n\";\r\n\t\t\t\t$img->addNoiseImage ( imagick::NOISE_LAPLACIAN );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"blurHigh\":\r\n\t\t\t\t//print \"add blur high \\n\";\r\n\t\t\t\t$img->blurImage( 50, 10 );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"blurMid\":\r\n\t\t\t\t//print \"add blur mid \\n\";\r\n\t\t\t\t$img->blurImage( 25, 5 );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"blurLow\":\r\n\t\t\t\t//print \"add blur low \\n\";\r\n\t\t\t\t$img->blurImage( 5, 3 );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"blurRadialHigh\":\r\n\t\t\t\t//print \"add high radial blur\\n\";\r\n\t\t\t\t$img->radialBlurImage(2);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"blurRadialLow\":\r\n\t\t\t\t//print \"add low radial blur\\n\";\r\n\t\t\t\t$img->radialBlurImage(1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"darken\":\r\n\t\t\t\t//print \"add darken\\n\";\r\n\t\t\t\t$img->gammaImage(0.4);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"brighten\":\r\n\t\t\t\t//print \"add brighten\\n\";\r\n\t\t\t\t$img->gammaImage(1.5);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn $img;\r\n\r\n\r\n\t}", "public function selectProductsByColors($model)\n {\n $id_color = $model->getIdColor();\n $id_product = $model->getIdProduct();\n $response_result;\n\n $this->db->select('*');\n $this->db->from($this->table);\n $this->db->where('id_product', $id_product );\n $this->db->where('id_color', $id_color);\n $query = $this->db->get();\n $result = $query->result_array();\n\n if(count($result) <= 0){\n\n $response_result = \"not exist\";\n return $response_result;\n } else {\n\n $response_result = \"exist\";\n return $response_result;\n }\n }", "function imagecolorexact($image,$red,$green,$blue)\n{\n\treturn 0;\n}", "function imagecolorclosestalpha($image, $red, $green, $blue, $alpha)\n{\n return 0;\n}", "public function processPool($p) {\r\n\t\t$p = $this->filterColor($p);\r\n\t\t$p = $this->filterBasics($p);\r\n\r\n\t\t$cardCount = count($p);\r\n\t\t$avgCMC = $this->averageCMC($p);\r\n\r\n\t\t// trim a card until we hit the sweet spot\r\n\t\t$isSaturated = false;\r\n\t\twhile(!$isSaturated) {\r\n\t\t\t$nonLandCount = $this->countNonLands($p);\r\n\t\t\tif(($this->model->getSize() == 60 && $nonLandCount >= 38)\r\n\t\t\t|| ($this->model->getSize() == 40 && $nonLandCount >= 22)) {\r\n\t\t\t\t$p = $this->trim($p);\r\n\t\t\t} else {\r\n\t\t\t\t$isSaturated = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$p = $this->addBasics($p);\r\n\t\treturn $p;\r\n\t}", "public function hasColor(){\n return $this->_has(1);\n }", "public function colorProviderNoAlpha()\n {\n return [\n ['#FF00FF', '#FF00FF'],\n ['#ab98ab', '#AB98AB'],\n ['rgb(255,0,255)', '#FF00FF'],\n ['rgb(255, 0, 255)', '#FF00FF'],\n //['rgb(100%,0%,100%)', 'FF00FF'],\n ['FF00FF', '#FF00FF'],\n //['#F0F', 'FF00FF'],\n ['fuchsia', '#FF00FF'],\n ['CornFlowerBlue', '#6495ED'],\n ['Red', '#FF0000'],\n ['RED', '#FF0000'],\n [[255,0,255], '#FF00FF'],\n [['r'=>255, 'g'=>0, 'b'=>255], '#FF00FF'],\n [['r'=>255, 'g'=>0, 'b'=>255, 'a'=>0], '#FF00FF'],\n ['ABC', '#AABBCC']\n ];\n }", "public function vertex_coloring(){\n //Color store\n $c = array();\n $highest_deg = array_values($this->get_nodes())[0]->get_degree();\n for($i = 0; $i < $highest_deg; $i++){\n $c[$i] = $i;\n }\n\n //Store showing available colors. At first all are available\n $c_available = array_fill(0,count($c),true);\n \n\n //Color matrix [i] = color assigned to the node\n $c_matrix = array();\n \n $node_names = array_keys($this->get_nodes());\n \n //Init the matrix with -1 for unassigned\n foreach ($node_names as $name) {\n $c_matrix[$name] = -1;\n }\n\n //Color the first node\n $c_matrix[$node_names[0]] = $c[0];\n\n //Color the remaining non-adjacent colors with the same color\n foreach ($node_names as $current_node) {\n //Set adjacent nodes available to false\n $adj_list = $this->get_nodes()[$current_node]->get_adj_list();\n foreach($adj_list as $adj_node){\n if($c_matrix[$adj_node->get_name()] != -1){\n $c_available[$c_matrix[$adj_node->get_name()]] = false;\n }\n }\n\n //Find lowest available color\n $c_av;\n for($c_av = 0; $c_av<count($c); ++$c_av){\n if($c_available[$c_av]){\n break;\n }\n }\n //Set the color\n $c_matrix[$current_node] = $c_av;\n\n //Reset for the next iteration\n $c_available = array_fill(0,count($c),true); \n }\n return $c_matrix; \n }", "function overlap_get_color(){\r\n return overlap_get_color_scheme();\r\n}", "public function hasColors(){\n return $this->_has(1);\n }", "public function analyzePixels($nw = array('x' => 0, 'y' => 0), $size = null){\r\n\t\t$img = $this->saveImage($this->rawImg);\r\n\t\t\r\n\t\t//If an arbitrary section is specified for analysis (as in the case of a composite)\r\n\t\tif($size){\r\n\t\t\t$width = $height = $size;\r\n\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$width = $this->width;\r\n\t\t\t$height = $this->height;\r\n\t\t}\r\n\r\n\t\t//X-axis markers\r\n\t\t$x = $nw['x'];\r\n\t\t$xEnd = $x + $width;\r\n\r\n\t\t$swatchArray = array();\r\n\t\t\r\n\t\twhile($x < $xEnd){\r\n\t\t\t//Y-axis markers\r\n\t\t\t$y = $nw['y'];\r\n\t\t\t$yEnd = $y + $height;\r\n\r\n\t\t\t//Determine the dominant color[s] of the section\r\n\t\t\twhile($y < $yEnd){\r\n\t\t\t\t$pixel = ImageColorAt($img, $x, $y);\r\n\t\t\t\t$rgb = imagecolorsforindex($img, $pixel);\r\n\t\t\t\t//Generate rgb\r\n\t\t\t\t//Add to swatch array (an unindexed group of color values) \r\n\t\t\t\tarray_push($swatchArray, $this->rgbToCss($rgb));\r\n\t\t\t\t//}\r\n\t\t\t\t//Increment the y coordinate\r\n\t\t\t\t$y = $y + $this->accuracy;\r\n\t\t\t}\r\n\t\t\t$x = $x + $this->accuracy; \r\n\t\t}\r\n\t\t//Tally each of the colors to determine the top colors for the section\r\n\t\t$swatchTally = array_count_values($swatchArray);\r\n\r\n\t\t//Sort the array, so the most dominant colors are at the top\r\n\t\tarsort($swatchTally);\r\n\t\treturn $swatchTally;\r\n\t}", "public static function getColors();", "public function colorMatrix() {}", "public function testKeywordColorFilter()\n {\n //Creates a random user\n $user = factory(User::class)->create();\n //Creates ramdom product\n $product = factory(Products::class)->create(['name' => 'Tecpix', 'color' => 'grey']);\n //acting as user created\n $this->actingAs($user);\n //make request\n $response = $this->json('GET', '/api/products?color=Grey');\n\n //checks if found product\n $response->assertJsonFragment([\n 'name' => 'Tecpix',\n 'color' => 'grey'\n ]);\n\n $response->assertStatus(200);\n }", "public function color();", "public function getColorsList(){\n return $this->_get(1);\n }", "public function getImageColormapColor ($index) {}", "public function getActiveColorForDigitalPrint(){\n\n\t\t\t$sql = \"SELECT * FROM `\" . DB_PREFIX . \"pouch_color` WHERE status='1' AND pouch_color_id IN(67,68,69,66,74,75) AND is_delete = '0' ORDER BY color_value ASC\";\n\n\t\t\t$data = $this->query($sql);\n\n\t\t\tif($data->num_rows){\n\n\t\t\t\treturn $data->rows;\n\n\t\t\t}else{\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}", "public function selectiveBlurImage ($radius, $sigma, $threshold, $CHANNEL = Imagick::CHANNEL_DEFAULT) { }", "function get_color($prd_id){\n\t\treturn $this -> get_records('prd_id = '.$prd_id,'fs_products_color');\n\t}", "function imagecolorresolvealpha($image, $red, $green, $blue, $alpha)\n{\n return 0;\n}", "public function getColorCount () {}", "protected function _clear($color) {\n $this->grid = array();\n for ($i=1; $i <= $this->columns; $i++) {\n for ($j=1; $j <= $this->rows; $j++) {\n $this->grid[$j][$i] = $color;\n } \n }\n }", "function imagecolorexactalpha($image, $red, $green, $blue, $alpha)\n{\n return 0;\n}", "public function generateComposite($size){\r\n\t\t//Break down image into sections\r\n\t\t$xSections = floor($this->width / $size);\r\n\t\t$ySections = floor($this->height / $size);\r\n\t\t//Create an array of sections\r\n\t\t$sections = array();\r\n\r\n\t\t$x = $xCoord = 0;\r\n\t\t\r\n\t\twhile($x < $xSections){\r\n\t\t\t\r\n\t\t\t$y = $yCoord = 0;\r\n\t\t\t$xCoord = $x * $size;\r\n\t\t\t\r\n\t\t\twhile($y < $ySections){\r\n\t\t\t\t$yCoord = $y * $size ;\r\n\r\n\t\t\t\t//For each section, determine the average color\r\n\t\t\t\t$swatchColor = $this->analyzePixels(1, array('x'=>$xCoord, 'y'=>$yCoord), $size);\r\n\r\n\t\t\t\t//Save section information to greater array\r\n\t\t\t\tarray_push($sections, array('nw' => array( 'x'=> $xCoord , 'y' => $yCoord), 'se' => array( 'x' => ($xCoord + $size), 'y' => ($yCoord + $size)), 'color' => $swatchColor));\r\n\t\t\t\t\r\n\t\t\t\t$yCoord += $size; \t\r\n\t\t\t\t$y++; \r\n\t\t\t}\r\n\t\t\t$xCoord += $size;\r\n\t\t\t$x++;\r\n\t\t}\r\n\t\treturn $sections;\r\n\t}", "protected function color($slug) //$name = request()->color\n {\n $color = Color::whereSlug($slug)->first();\n\n if($color)\n {\n $this->builder->whereHas('inventories.color', function($query) use($slug) {\n $query->whereSlug($slug);\n });\n }\n }", "public function filterVdPoolProfiles()\n {\n mail($this->emailId,\"setp1(filterOtherCondition) Start\", date(\"Y-m-d H:i:s\"));\n $this->filterOtherCondition();\n\n mail($this->emailId,\"setp2(filterDuplicateClusterProfiles) Start\", date(\"Y-m-d H:i:s\"));\n $poolProfilesArr =$this->fetchVdPoolProfiles();\n if(count($poolProfilesArr)>0){\n foreach($poolProfilesArr as $keyPid=>$profileid)\n \t $this->filterDuplicateClusterProfiles($profileid);\n }\n unset($poolProfilesArr);\n\n mail($this->emailId,\"setp3(filterJprofileCondition) Start\", date(\"Y-m-d H:i:s\"));\n $poolProfilesArr =$this->fetchVdPoolProfiles();\n if(count($poolProfilesArr)>0){\n foreach($poolProfilesArr as $keyPid=>$profileid)\n $this->filterJprofileCondition($profileid);\n }\n unset($poolProfilesArr);\n }", "function imagecolorresolvealpha($image,$red,$green,$blue,$alpha)\n{\n\treturn 0;\n}", "private function _color_ids()\n\t{\n\t\tglobal $color_profile;\n\n\t\t$color_ids = array();\n\t\tforeach ($this->data['items'] as $item)\n\t\t{\n\t\t\t$color_ids[] = $item['member']['id'];\n\t\t}\n\n\t\tif (sp_loadColors($color_ids) !== false)\n\t\t{\n\t\t\tforeach ($this->data['items'] as $k => $p)\n\t\t\t{\n\t\t\t\tif (!empty($color_profile[$p['member']['id']]['link']))\n\t\t\t\t{\n\t\t\t\t\t$this->data['items'][$k]['member']['link'] = $color_profile[$p['member']['id']]['link'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract public function filters(): array;", "public function getColorspace () {}", "public function getDisplayColorMin();", "public static function get_css_filter_styles_for_gemini_clone(){\n $filters = 'grayscale(100%) sepia(1) hue-rotate(145deg)';\n $styles = '-moz-filter: '.$filters.'; -webkit-filter: '.$filters.'; filter: '.$filters.'; ';\n return $styles;\n }", "public function getCategoryColors($id = null);", "protected function color_id($value)\n {\n return $this->collection = $this->collection->where('color_id', $value);\n }", "function imagecolorexactalpha($image,$red,$green,$blue,$alpha)\n{\n\treturn 0;\n}", "function imagecolorclosesthwb($image,$red,$green,$blue)\n{\n\treturn 0;\n}", "function displayColorResult()\n {\n $this->dBug('------------ Coloring Result ---------------------');\n $this->dBug('No. of Colors : '.count($this->colors));\n foreach($this->colors as $i=>$v)\n {\n $this->dBug(\"Color : $i\");\n $this->dBug('Vertices : '.implode(\",\", $v));\n }\n\n $this->dBug('--------------------------------------------------');\n\n }", "private function filterAllCategoryLots(){\n foreach ($this->allCategoryLots as $lot){\n $staticFlagArray = array_diff_assoc($lot->staticUrls, $this->searchStaticValueUrl);\n \n if(count($staticFlagArray)){\n unset($lot);\n continue;\n }\n $dynamicFlagArray = array_diff_key($lot->dynamicUrls, $this->searchDynamicValue);\n \n if(count($dynamicFlagArray)){ \n unset($lot);\n continue;\n }else{\n foreach ($dynamicFlagArray as $key=>$value){\n if(!$this->arraysEquals()){\n unset($lot);\n continue;\n }\n }\n }\n }\n }", "public function get_all_color() {\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_color');\n\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function get_available_colors(){\n\t \t$query = $this->db->from('PLUGIN_COLORS')->get();\n\t\t\n\t\treturn $query->result();\n\t }", "public function color(){\n return Color::findOrFail($this->colores_id)->color;\n }", "public function getColor ($normalized = false) {}", "public function isPixelSimilarQuantum($color, $fuzz) { }", "public function getColorWithPaginate()\n {\n return Color::orderBy('id', 'desc')->paginate(config('define.paginate.limit_rows'));\n }", "public function filter($data);", "public function addFilterBw()\n {\n $this->getGd()->addFilter(new GrayScale());\n }", "public function opaquePaintImage ($target, $fill, $fuzz, $invert, $channel = Imagick::CHANNEL_DEFAULT) {}", "public function colorize($r, $g, $b, $a = null) \r\n {\r\n imagefilter($this->src, IMG_FILTER_COLORIZE, $r, $g, $b, $a);\r\n }", "private function getColorSwatch() {\r\n\r\n\t\treturn array(\r\n\t\t\t\"black\"=>array( \"red\"=>0x00, \"green\"=>0x00, \"blue\"=>0x00),\r\n\t\t\t\"maroon\"=>array( \"red\"=>0x80, \"green\"=>0x00, \"blue\"=>0x00),\r\n\t\t\t\"green\"=>array( \"red\"=>0x00, \"green\"=>0x80, \"blue\"=>0x00),\r\n\t\t\t\"olive\"=>array( \"red\"=>0x80, \"green\"=>0x80, \"blue\"=>0x00),\r\n\t\t\t\"navy\"=>array( \"red\"=>0x00, \"green\"=>0x00, \"blue\"=>0x80),\r\n\t\t\t\"purple\"=>array( \"red\"=>0x80, \"green\"=>0x00, \"blue\"=>0x80),\r\n\t\t\t\"teal\"=>array( \"red\"=>0x00, \"green\"=>0x80, \"blue\"=>0x80),\r\n\t\t\t\"gray\"=>array( \"red\"=>0x80, \"green\"=>0x80, \"blue\"=>0x80),\r\n\t\t\t\"silver\"=>array( \"red\"=>0xC0, \"green\"=>0xC0, \"blue\"=>0xC0),\r\n\t\t\t\"red\"=>array( \"red\"=>0xFF, \"green\"=>0x00, \"blue\"=>0x00),\r\n\t\t\t\"darkgoldenrod\"=>array( \"red\"=>0xB8, \"green\"=>0x86, \"blue\"=>0x0B),\r\n\t\t\t\"yellow\"=>array( \"red\"=>0xFF, \"green\"=>0xFF, \"blue\"=>0x00),\r\n\t\t\t\"blue\"=>array( \"red\"=>0x00, \"green\"=>0x00, \"blue\"=>0xFF),\r\n\t\t\t\"fuchsia\"=>array( \"red\"=>0xFF, \"green\"=>0x00, \"blue\"=>0xFF),\r\n\t\t\t\"aqua\"=>array( \"red\"=>0x00, \"green\"=>0xFF, \"blue\"=>0xFF),\r\n\t\t\t\"white\"=>array( \"red\"=>0xFF, \"green\"=>0xFF, \"blue\"=>0xFF),\r\n\t\t\t\"tomato\"=>array( \"red\"=>0xFF, \"green\"=>0x63, \"blue\"=>0x47),\r\n\t\t\t\"antiquewhite\"=>array( \"red\"=>0xFA, \"green\"=>0xEB, \"blue\"=>0xD7),\r\n\t\t\t\"aquamarine\"=>array( \"red\"=>0x7F, \"green\"=>0xFF, \"blue\"=>0xD4),\r\n\t\t\t\"brown\"=>array( \"red\"=>0xA5, \"green\"=>0x2A, \"blue\"=>0x2A),\r\n\t\t\t\"beige\"=>array( \"red\"=>0xF5, \"green\"=>0xF5, \"blue\"=>0xDC),\r\n\t\t\t\"blueviolet\"=>array( \"red\"=>0x8A, \"green\"=>0x2B, \"blue\"=>0xE2),\r\n\t\t\t\"azure\"=>array( \"red\"=>0xF0, \"green\"=>0xFF, \"blue\"=>0xFF),\r\n\t\t\t\"burlywood\"=>array( \"red\"=>0xDE, \"green\"=>0xB8, \"blue\"=>0x87),\r\n\t\t\t\"cadetblue\"=>array( \"red\"=>0x5F, \"green\"=>0x9E, \"blue\"=>0xA0),\r\n\t\t\t\"chartreuse\"=>array( \"red\"=>0x7F, \"green\"=>0xFF, \"blue\"=>0x00),\r\n\t\t\t\"chocolate\"=>array( \"red\"=>0xD2, \"green\"=>0x69, \"blue\"=>0x1E),\r\n\t\t\t\"coral\"=>array( \"red\"=>0xFF, \"green\"=>0x7F, \"blue\"=>0x50),\r\n\t\t\t\"cornflowerblue\"=>array( \"red\"=>0x64, \"green\"=>0x95, \"blue\"=>0xED),\r\n\t\t\t\"cornsilk\"=>array( \"red\"=>0xFF, \"green\"=>0xF8, \"blue\"=>0xDC),\r\n\t\t\t\"crimson\"=>array( \"red\"=>0xDC, \"green\"=>0x14, \"blue\"=>0x3C),\r\n\t\t\t\"darkblue\"=>array( \"red\"=>0x00, \"green\"=>0x00, \"blue\"=>0x8B),\r\n\t\t\t\"darkcyan\"=>array( \"red\"=>0x00, \"green\"=>0x8B, \"blue\"=>0x8B),\r\n\t\t\t\"lightgrey\"=>array( \"red\"=>0xD3, \"green\"=>0xD3, \"blue\"=>0xD3),\r\n\t\t\t\"darkgray\"=>array( \"red\"=>0xA9, \"green\"=>0xA9, \"blue\"=>0xA9),\r\n\t\t\t\"darkgreen\"=>array( \"red\"=>0x00, \"green\"=>0x64, \"blue\"=>0x00),\r\n\t\t\t\"darkkhaki\"=>array( \"red\"=>0xBD, \"green\"=>0xB7, \"blue\"=>0x6B),\r\n\t\t\t\"darkmagenta\"=>array( \"red\"=>0x8B, \"green\"=>0x00, \"blue\"=>0x8B),\r\n\t\t\t\"darkolivegreen\"=>array( \"red\"=>0x55, \"green\"=>0x6B, \"blue\"=>0x2F),\r\n\t\t\t\"darkorange\"=>array( \"red\"=>0xFF, \"green\"=>0x8C, \"blue\"=>0x00),\r\n\t\t\t\"darkorchid\"=>array( \"red\"=>0x99, \"green\"=>0x32, \"blue\"=>0xCC),\r\n\t\t\t\"darkred\"=>array( \"red\"=>0x8B, \"green\"=>0x00, \"blue\"=>0x00),\r\n\t\t\t\"darksalmon\"=>array( \"red\"=>0xE9, \"green\"=>0x96, \"blue\"=>0x7A),\r\n\t\t\t\"darkseagreen\"=>array( \"red\"=>0x8F, \"green\"=>0xBC, \"blue\"=>0x8F),\r\n\t\t\t\"darkslateblue\"=>array( \"red\"=>0x48, \"green\"=>0x3D, \"blue\"=>0x8B),\r\n\t\t\t\"darkslategray\"=>array( \"red\"=>0x2F, \"green\"=>0x4F, \"blue\"=>0x4F),\r\n\t\t\t\"darkturquoise\"=>array( \"red\"=>0x00, \"green\"=>0xCE, \"blue\"=>0xD1),\r\n\t\t\t\"darkviolet\"=>array( \"red\"=>0x94, \"green\"=>0x00, \"blue\"=>0xD3),\r\n\t\t\t\"deeppink\"=>array( \"red\"=>0xFF, \"green\"=>0x14, \"blue\"=>0x93),\r\n\t\t\t\"deepskyblue\"=>array( \"red\"=>0x00, \"green\"=>0xBF, \"blue\"=>0xFF),\r\n\t\t\t\"dimgray\"=>array( \"red\"=>0x69, \"green\"=>0x69, \"blue\"=>0x69),\r\n\t\t\t\"dodgerblue\"=>array( \"red\"=>0x1E, \"green\"=>0x90, \"blue\"=>0xFF),\r\n\t\t\t\"firebrick\"=>array( \"red\"=>0xB2, \"green\"=>0x22, \"blue\"=>0x22),\r\n\t\t\t\"floralwhite\"=>array( \"red\"=>0xFF, \"green\"=>0xFA, \"blue\"=>0xF0),\r\n\t\t\t\"forestgreen\"=>array( \"red\"=>0x22, \"green\"=>0x8B, \"blue\"=>0x22),\r\n\t\t\t\"gainsboro\"=>array( \"red\"=>0xDC, \"green\"=>0xDC, \"blue\"=>0xDC),\r\n\t\t\t\"ghostwhite\"=>array( \"red\"=>0xF8, \"green\"=>0xF8, \"blue\"=>0xFF),\r\n\t\t\t\"gold\"=>array( \"red\"=>0xFF, \"green\"=>0xD7, \"blue\"=>0x00),\r\n\t\t\t\"goldenrod\"=>array( \"red\"=>0xDA, \"green\"=>0xA5, \"blue\"=>0x20),\r\n\t\t\t\"greenyellow\"=>array( \"red\"=>0xAD, \"green\"=>0xFF, \"blue\"=>0x2F),\r\n\t\t\t\"honeydew\"=>array( \"red\"=>0xF0, \"green\"=>0xFF, \"blue\"=>0xF0),\r\n\t\t\t\"hotpink\"=>array( \"red\"=>0xFF, \"green\"=>0x69, \"blue\"=>0xB4),\r\n\t\t\t\"indianred\"=>array( \"red\"=>0xCD, \"green\"=>0x5C, \"blue\"=>0x5C),\r\n\t\t\t\"indigo\"=>array( \"red\"=>0x4B, \"green\"=>0x00, \"blue\"=>0x82),\r\n\t\t\t\"ivory\"=>array( \"red\"=>0xFF, \"green\"=>0xFF, \"blue\"=>0xF0),\r\n\t\t\t\"khaki\"=>array( \"red\"=>0xF0, \"green\"=>0xE6, \"blue\"=>0x8C),\r\n\t\t\t\"lavender\"=>array( \"red\"=>0xE6, \"green\"=>0xE6, \"blue\"=>0xFA),\r\n\t\t\t\"lavenderblush\"=>array( \"red\"=>0xFF, \"green\"=>0xF0, \"blue\"=>0xF5),\r\n\t\t\t\"lawngreen\"=>array( \"red\"=>0x7C, \"green\"=>0xFC, \"blue\"=>0x00),\r\n\t\t\t\"lemonchiffon\"=>array( \"red\"=>0xFF, \"green\"=>0xFA, \"blue\"=>0xCD),\r\n\t\t\t\"lightblue\"=>array( \"red\"=>0xAD, \"green\"=>0xD8, \"blue\"=>0xE6),\r\n\t\t\t\"lightcoral\"=>array( \"red\"=>0xF0, \"green\"=>0x80, \"blue\"=>0x80),\r\n\t\t\t\"tan\"=>array( \"red\"=>0xD2, \"green\"=>0xB4, \"blue\"=>0x8C),\r\n\t\t\t\"lightgoldenrodyellow\"=>array( \"red\"=>0xFA, \"green\"=>0xFA, \"blue\"=>0xD2),\r\n\t\t\t\"lightgreen\"=>array( \"red\"=>0x90, \"green\"=>0xEE, \"blue\"=>0x90),\r\n\t\t\t\"lime\"=>array( \"red\"=>0x00, \"green\"=>0xFF, \"blue\"=>0x00),\r\n\t\t\t\"lightpink\"=>array( \"red\"=>0xFF, \"green\"=>0xB6, \"blue\"=>0xC1),\r\n\t\t\t\"lightsalmon\"=>array( \"red\"=>0xFF, \"green\"=>0xA0, \"blue\"=>0x7A),\r\n\t\t\t\"lightseagreen\"=>array( \"red\"=>0x20, \"green\"=>0xB2, \"blue\"=>0xAA),\r\n\t\t\t\"lightskyblue\"=>array( \"red\"=>0x87, \"green\"=>0xCE, \"blue\"=>0xFA),\r\n\t\t\t\"lightslategray\"=>array( \"red\"=>0x77, \"green\"=>0x88, \"blue\"=>0x99),\r\n\t\t\t\"lightsteelblue\"=>array( \"red\"=>0xB0, \"green\"=>0xC4, \"blue\"=>0xDE),\r\n\t\t\t\"lightyellow\"=>array( \"red\"=>0xFF, \"green\"=>0xFF, \"blue\"=>0xE0),\r\n\t\t\t\"limegreen\"=>array( \"red\"=>0x32, \"green\"=>0xCD, \"blue\"=>0x32),\r\n\t\t\t\"linen\"=>array( \"red\"=>0xFA, \"green\"=>0xF0, \"blue\"=>0xE6),\r\n\t\t\t\"mediumaquamarine\"=>array( \"red\"=>0x66, \"green\"=>0xCD, \"blue\"=>0xAA),\r\n\t\t\t\"mediumblue\"=>array( \"red\"=>0x00, \"green\"=>0x00, \"blue\"=>0xCD),\r\n\t\t\t\"mediumorchid\"=>array( \"red\"=>0xBA, \"green\"=>0x55, \"blue\"=>0xD3),\r\n\t\t\t\"mediumpurple\"=>array( \"red\"=>0x93, \"green\"=>0x70, \"blue\"=>0xD0),\r\n\t\t\t\"mediumseagreen\"=>array( \"red\"=>0x3C, \"green\"=>0xB3, \"blue\"=>0x71),\r\n\t\t\t\"mediumslateblue\"=>array( \"red\"=>0x7B, \"green\"=>0x68, \"blue\"=>0xEE),\r\n\t\t\t\"mediumspringgreen\"=>array( \"red\"=>0x00, \"green\"=>0xFA, \"blue\"=>0x9A),\r\n\t\t\t\"mediumturquoise\"=>array( \"red\"=>0x48, \"green\"=>0xD1, \"blue\"=>0xCC),\r\n\t\t\t\"mediumvioletred\"=>array( \"red\"=>0xC7, \"green\"=>0x15, \"blue\"=>0x85),\r\n\t\t\t\"midnightblue\"=>array( \"red\"=>0x19, \"green\"=>0x19, \"blue\"=>0x70),\r\n\t\t\t\"mintcream\"=>array( \"red\"=>0xF5, \"green\"=>0xFF, \"blue\"=>0xFA),\r\n\t\t\t\"mistyrose\"=>array( \"red\"=>0xFF, \"green\"=>0xE4, \"blue\"=>0xE1),\r\n\t\t\t\"moccasin\"=>array( \"red\"=>0xFF, \"green\"=>0xE4, \"blue\"=>0xB5),\r\n\t\t\t\"navajowhite\"=>array( \"red\"=>0xFF, \"green\"=>0xDE, \"blue\"=>0xAD),\r\n\t\t\t\"oldlace\"=>array( \"red\"=>0xFD, \"green\"=>0xF5, \"blue\"=>0xE6),\r\n\t\t\t\"olivedrab\"=>array( \"red\"=>0x6B, \"green\"=>0x8E, \"blue\"=>0x23),\r\n\t\t\t\"orange\"=>array( \"red\"=>0xFF, \"green\"=>0xA5, \"blue\"=>0x00),\r\n\t\t\t\"orangered\"=>array( \"red\"=>0xFF, \"green\"=>0x45, \"blue\"=>0x00),\r\n\t\t\t\"orchid\"=>array( \"red\"=>0xDA, \"green\"=>0x70, \"blue\"=>0xD6),\r\n\t\t\t\"palegoldenrod\"=>array( \"red\"=>0xEE, \"green\"=>0xE8, \"blue\"=>0xAA),\r\n\t\t\t\"palegreen\"=>array( \"red\"=>0x98, \"green\"=>0xFB, \"blue\"=>0x98),\r\n\t\t\t\"paleturquoise\"=>array( \"red\"=>0xAF, \"green\"=>0xEE, \"blue\"=>0xEE),\r\n\t\t\t\"palevioletred\"=>array( \"red\"=>0xDB, \"green\"=>0x70, \"blue\"=>0x93),\r\n\t\t\t\"papayawhip\"=>array( \"red\"=>0xFF, \"green\"=>0xEF, \"blue\"=>0xD5),\r\n\t\t\t\"peachpuff\"=>array( \"red\"=>0xFF, \"green\"=>0xDA, \"blue\"=>0xB9),\r\n\t\t\t\"peru\"=>array( \"red\"=>0xCD, \"green\"=>0x85, \"blue\"=>0x3F),\r\n\t\t\t\"pink\"=>array( \"red\"=>0xFF, \"green\"=>0xC0, \"blue\"=>0xCB),\r\n\t\t\t\"plum\"=>array( \"red\"=>0xDD, \"green\"=>0xA0, \"blue\"=>0xDD),\r\n\t\t\t\"powderblue\"=>array( \"red\"=>0xB0, \"green\"=>0xE0, \"blue\"=>0xE6),\r\n\t\t\t\"rosybrown\"=>array( \"red\"=>0xBC, \"green\"=>0x8F, \"blue\"=>0x8F),\r\n\t\t\t\"royalblue\"=>array( \"red\"=>0x41, \"green\"=>0x69, \"blue\"=>0xE1),\r\n\t\t\t\"saddlebrown\"=>array( \"red\"=>0x8B, \"green\"=>0x45, \"blue\"=>0x13),\r\n\t\t\t\"salmon\"=>array( \"red\"=>0xFA, \"green\"=>0x80, \"blue\"=>0x72),\r\n\t\t\t\"sandybrown\"=>array( \"red\"=>0xF4, \"green\"=>0xA4, \"blue\"=>0x60),\r\n\t\t\t\"seagreen\"=>array( \"red\"=>0x2E, \"green\"=>0x8B, \"blue\"=>0x57),\r\n\t\t\t\"seashell\"=>array( \"red\"=>0xFF, \"green\"=>0xF5, \"blue\"=>0xEE),\r\n\t\t\t\"sienna\"=>array( \"red\"=>0xA0, \"green\"=>0x52, \"blue\"=>0x2D),\r\n\t\t\t\"skyblue\"=>array( \"red\"=>0x87, \"green\"=>0xCE, \"blue\"=>0xEB),\r\n\t\t\t\"slateblue\"=>array( \"red\"=>0x6A, \"green\"=>0x5A, \"blue\"=>0xCD),\r\n\t\t\t\"slategray\"=>array( \"red\"=>0x70, \"green\"=>0x80, \"blue\"=>0x90),\r\n\t\t\t\"snow\"=>array( \"red\"=>0xFF, \"green\"=>0xFA, \"blue\"=>0xFA),\r\n\t\t\t\"springgreen\"=>array( \"red\"=>0x00, \"green\"=>0xFF, \"blue\"=>0x7F),\r\n\t\t\t\"steelblue\"=>array( \"red\"=>0x46, \"green\"=>0x82, \"blue\"=>0xB4),\r\n\t\t\t\"lightcyan\"=>array( \"red\"=>0xE0, \"green\"=>0xFF, \"blue\"=>0xFF),\r\n\t\t\t\"thistle\"=>array( \"red\"=>0xD8, \"green\"=>0xBF, \"blue\"=>0xD8),\r\n\t\t\t\"aliceblue\"=>array( \"red\"=>0xF0, \"green\"=>0xF8, \"blue\"=>0xFF),\r\n\t\t\t\"turquoise\"=>array( \"red\"=>0x40, \"green\"=>0xE0, \"blue\"=>0xD0),\r\n\t\t\t\"violet\"=>array( \"red\"=>0xEE, \"green\"=>0x82, \"blue\"=>0xEE),\r\n\t\t\t\"wheat\"=>array( \"red\"=>0xF5, \"green\"=>0xDE, \"blue\"=>0xB3),\r\n\t\t\t\"whitesmoke\"=>array( \"red\"=>0xF5, \"green\"=>0xF5, \"blue\"=>0xF5),\r\n\t\t\t\"yellowgreen\"=>array( \"red\"=>0x9A, \"green\"=>0xCD, \"blue\"=>0x32)\r\n\t\t);\r\n\r\n\t}", "public function paintOpaqueImage ($target, $fill, $fuzz, $channel = Imagick::CHANNEL_ALL) {}", "public function filter(): array;", "function imagecolorset($image,$red,$green,$blue)\n{\n}", "function reduce_colors($colors=255) {\n\t\t//convert o,age to 256 colours\n\t\tif(!function_exists(\"ImageTrueColorToPalette\")) return false;\n\t\tImageTrueColorToPalette($this->im,1,$colors);\n\t\treturn true;\n\t}", "function Extract($srcImage, $count = 10, $reduceBrightness = true, $reduceGradients = true, $delta = 16, $niceNumbers = false) {\n // Make sure the image can be opened, then scale it down as we only want the colors that are more prevalaent.\n if (is_readable($srcImage)) {\n if ($delta > 2) {\n $halfOfDelta = $delta / 2 - 1;\n } else {\n $halfOfDelta = 0;\n }\n $size = GetImageSize($srcImage);\n $scale = 1;\n if ($size[0] > 0)\n $scale = min($this->SampleWidth / $size[0], $this->SampleHeight / $size[1]);\n if ($scale < 1) {\n $width = floor($scale * $size[0]);\n $height = floor($scale * $size[1]);\n } else {\n $width = $size[0];\n $height = $size[1];\n }\n $image_resized = imagecreatetruecolor($width, $height);\n if ($size[2] == 1)\n $image_orig = imagecreatefromgif($srcImage);\n if ($size[2] == 2)\n $image_orig = imagecreatefromjpeg($srcImage);\n if ($size[2] == 3)\n $image_orig = imagecreatefrompng($srcImage);\n imagecopyresampled($image_resized, $image_orig, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n $im = $image_resized;\n $imgWidth = imagesx($im);\n $imgHeight = imagesy($im);\n $total_pixel_count = 0;\n for ($y = 0; $y < $imgHeight; $y++) {\n for ($x = 0; $x < $imgWidth; $x++) {\n $total_pixel_count++;\n $index = imagecolorat($im, $x, $y);\n $colors = imagecolorsforindex($im, $index);\n // Now we check for neighboring colors to cut out duplicate colors\n if ($delta > 1) {\n $colors['red'] = intval((($colors['red']) + $halfOfDelta) / $delta) * $delta;\n $colors['green'] = intval((($colors['green']) + $halfOfDelta) / $delta) * $delta;\n $colors['blue'] = intval((($colors['blue']) + $halfOfDelta) / $delta) * $delta;\n if ($colors['red'] >= 256) {\n $colors['red'] = 255;\n }\n if ($colors['green'] >= 256) {\n $colors['green'] = 255;\n }\n if ($colors['blue'] >= 256) {\n $colors['blue'] = 255;\n }\n }\n $hex = substr(\"0\" . dechex($colors['red']), -2) . substr(\"0\" . dechex($colors['green']), -2) . substr(\"0\" . dechex($colors['blue']), -2);\n if (!isset($hexarray[$hex])) {\n $hexarray[$hex] = 1;\n } else {\n $hexarray[$hex]++;\n }\n }\n }\n // Reduce color gradients if requested\n if ($reduce_gradients) {\n arsort($hexarray, SORT_NUMERIC);\n $gradients = array();\n foreach ($hexarray as $hex => $num) {\n if (!isset($gradients[$hex])) {\n // This is where we check neighbors for a color match based on the delta value, this will cut down on the amount of repeat colors.\n $new_hex = $this->_near_color($hex, $gradients, $delta);\n $gradients[$hex] = $new_hex;\n } else {\n $new_hex = $gradients[$hex];\n }\n if ($hex != $new_hex) {\n $hexarray[$hex] = 0;\n $hexarray[$new_hex] += $num;\n }\n }\n }\n // Remove brightness color variation\n if ($reduce_brightness) {\n arsort($hexarray, SORT_NUMERIC);\n $brightness = array();\n foreach ($hexarray as $hex => $num) {\n if (!isset($brightness[$hex])) {\n // This is where we check neighbors for a color match based on the delta value, this will cut down on the amount of repeat colors.\n $new_hex = $this->_convertN($hex, $brightness, $delta);\n $brightness[$hex] = $new_hex;\n } else {\n $new_hex = $brightness[$hex];\n }\n if ($hex != $new_hex) {\n $hexarray[$hex] = 0;\n $hexarray[$new_hex] += $num;\n }\n }\n }\n arsort($hexarray, SORT_NUMERIC);\n // Convert the count of the color pixels into a percentage\n foreach ($hexarray as $key => $value) {\n // Check if number formatting is set to TRUE and return a round percentage if so\n if ($niceNumbers == true) {\n $hexarray[$key] = round(((float) $value / $total_pixel_count), 2);\n } else {\n $hexarray[$key] = (float) $value / $total_pixel_count;\n }\n }\n if ($count > 0) {\n $arr = array();\n foreach ($hexarray as $key => $value) {\n if ($count == 0) {\n break;\n }\n $count--;\n $arr[$key] = $value;\n }\n return $arr;\n } else {\n return $hexarray;\n }\n } else {\n $this->error = \"Image \" . $srcImage .\n \" could not be found or read, please make sure the image is present!\";\n return false;\n }\n }" ]
[ "0.7313038", "0.6657954", "0.57540107", "0.5739942", "0.56290954", "0.5584958", "0.55633414", "0.54415953", "0.54383373", "0.53501725", "0.5344552", "0.5255502", "0.52486145", "0.5222684", "0.5222684", "0.5215116", "0.5161172", "0.5155657", "0.51103", "0.5109849", "0.5093301", "0.50700116", "0.5040878", "0.5019662", "0.50191045", "0.50148827", "0.50019777", "0.49847975", "0.4977507", "0.49764687", "0.4974468", "0.4970711", "0.49653345", "0.49641806", "0.49594006", "0.4958385", "0.4953363", "0.49514243", "0.4922107", "0.49144867", "0.4909681", "0.49077716", "0.48874006", "0.4881043", "0.48687205", "0.48573807", "0.48568246", "0.48550954", "0.48516968", "0.48509422", "0.483315", "0.48316965", "0.48202673", "0.48196512", "0.48154876", "0.48107362", "0.48049238", "0.48008156", "0.47937363", "0.4791135", "0.47776267", "0.47755238", "0.4745428", "0.47334218", "0.4728998", "0.4704892", "0.4694837", "0.46847427", "0.46817374", "0.46812564", "0.46766415", "0.46737057", "0.4673608", "0.46712166", "0.46552518", "0.4643725", "0.46358982", "0.4634053", "0.46301275", "0.46266612", "0.46214786", "0.46161607", "0.4614568", "0.46139807", "0.4607316", "0.4600128", "0.45918715", "0.45850924", "0.45828542", "0.45788434", "0.4578255", "0.4576267", "0.45751652", "0.4573897", "0.45693424", "0.45646906", "0.45517054", "0.45512497", "0.45446017", "0.4539899" ]
0.7323087
0
Get the HTTP Client object used to fetch RDF data If no HTTP Client has previously been set, then a new default (EasyRdf_Http_Client) client will be created.
Получите объект HTTP-клиента, используемого для получения данных RDF. Если ранее не было задано HTTP-клиента, то будет создан новый клиент по умолчанию (EasyRdf_Http_Client).
public static function getHttpClient() { if (!self::$_httpClient) { self::$_httpClient = new EasyRdf_Http_Client(); } return self::$_httpClient; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHttpClient(): Client\n {\n return $this->http ?: new Client;\n }", "protected function getHttpClient()\n {\n if ($this->httpClient == null) {\n return $this->httpClient = new Client;\n }\n return $this->httpClient;\n }", "public function getHttpClient()\n\t{\n\t\tif ($this->http !== null) return $this->http;\n\n\t\t$this->http = new \\Zend\\Http\\Client();\n\n\t\treturn $this->http;\n\t}", "protected function getHttpClient()\r\n {\r\n if (! isset($this->httpClient)) {\r\n $this->httpClient = new Client();\r\n }\r\n return $this->httpClient;\r\n }", "public function getHttpClient()\n {\n if($this->_client == null) {\n $this->lazyLoadHttpClient();\n }\n return $this->_client;\n }", "public function getHttpClient()\n {\n if (empty($this->httpClient)) {\n $this->httpClient = new Client();\n }\n\n return $this->httpClient;\n }", "public function getHttpClient() \n {\n if( (! $this->_httpClient) || (! $this->_httpClient instanceof HttpClient) ) {\n $this->_httpClient = new HttpClient();\n }\n return $this->_httpClient;\n }", "public function getHttpClient()\n {\n if ($this->httpClient === null) {\n $this->httpClient = new Client(['base_uri' => $this->baseUrl()]);\n }\n\n return $this->httpClient;\n }", "public function getClient(): Client\n {\n return $this->http_client;\n }", "public function getHttpClient()\n {\n if (is_null($this->httpClient)) {\n $this->setHttpClient(new Client);\n }\n\n return $this->httpClient;\n }", "private static function getClient() {\n if (self::$client == null || self::$defaultsChanged) {\n $options = [];\n if (isset(self::$defaultHeaders)) {\n $options['headers'] = self::$defaultHeaders;\n }\n self::$client = new Client($options);\n self::$defaultsChanged = false;\n }\n return self::$client;\n }", "private function defaultClient()\n {\n return new HttpClient();\n }", "private function getHttpClient()\n {\n return new Client();\n }", "public function http()\n {\n if ($this->http === null) {\n $this->http = new \\GuzzleHttp\\Client();\n }\n\n return $this->http;\n }", "public function getHttpClient(): Client\n {\n return $this->httpClient;\n }", "public function httpClient()\n {\n if (is_null($this->httpClient)) {\n $this->httpClient = new HttpClient();\n }\n\n return $this->httpClient;\n }", "public function getHttpClient()\n\t\t{\n\t\t\t\treturn $this->httpClient;\n\t\t}", "public function getHttpClient()\n\t{\n\t\treturn $this->httpClient;\n\t}", "public function getHttpClient()\n\t{\n\t\treturn $this->_httpClient;\n\t}", "private function getHttpClient(): ClientInterface\n {\n if( empty($this->httpClient) ){\n $this->httpClient = new Shuttle;\n }\n\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n return $this->client;\n }", "protected function getHttpClient()\n {\n return new Client();\n }", "protected function getHttpClient()\n {\n return $this->client;\n }", "protected function httpClient()\n {\n if($this->client) return $this->client;\n\n return $this->client = new HttpClient([\n 'base_url' => $this->url,\n 'headers' => [\n 'User-Agent' => 'infonox',\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json'\n ]\n ]);\n }", "public function getHttpClient()\n {\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n return $this->_httpClient;\n }", "public static function getHttpClient(): Client\n {\n// if (static::$httpClient && static::$httpClient->getConfig('verify') === static::$verify_ssl) {\n// return static::$httpClient;\n// }\n\n return new Client(['http_errors' => false, 'verify' => static::$verify_ssl]);\n }", "private function getClient(): Client\n {\n if ($this->client) {\n return $this->client;\n }\n\n $this->client = new Client(['base_uri' => $this->baseUrl]);\n\n return $this->client;\n }", "public function getHttpClient()\n {\n if (null === $this->httpClient) {\n $this->httpClient = new Zend_Http_Client;\n }\n $this->httpClient->setConfig(array('timeout' => 100));\n return $this->httpClient;\n }", "public function getHttpClient() {\n return $this->httpClient;\n }", "protected function getHttpClient(): ClientInterface\n {\n return $this->httpClient;\n }", "private function getHttpClient()\n {\n if (is_null($this->httpClient)) {\n $this->httpClient = new LaravelHttpClient;\n }\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n if(!($this->httpClient instanceof \\Zend\\Http\\Client)) {\n $client = new \\Zend\\Http\\Client();\n \n $client->setConfig(array('maxredirects' => 2,\n 'timeout' => 5));\n\n $this->setHttpClient($client);\n }\n\n $this->httpClient->resetParameters();\n return $this->httpClient;\n }", "public function getHttpClient() {\n if (!($this->httpClient instanceof \\Zend\\Http\\Client)) {\n $client = new \\Zend\\Http\\Client();\n\n //$client->setOptions(array('maxredirects' => 2,\n // 'timeout' => 5));\n\n $this->setHttpClient($client);\n }\n\n $this->httpClient->resetParameters();\n\n return $this->httpClient;\n }", "public function getHttp(): HttpClient\n {\n return $this->http;\n }", "public function get_client()\n {\n if ( is_array( $this->headers ) ){\n foreach( $this->headers AS $option => $value ){\n $this->client->set_header( $option, $value );\n }\n } else {\n $this->client->set_header( $this->headers );\n }\n\n return $this->client;\n }", "protected function getClient()\n {\n return $this->client ?? ($this->client = new Client());\n }", "public function getClient() {\n if (!$this->client) {\n $this->setClient();\n }\n return $this->client;\n }", "private function getHttpClient() {\n\t\treturn new \\GuzzleHttp\\Client();\n\t}", "protected function getHttpClient(): HttpClient {\n if ( $this->httpClient instanceof HttpClient ) {\n return $this->httpClient;\n }\n\n $verify = $this->settings->caBundle;\n if ( $verify === null ) {\n $verify = $this->settings->tlsVerifyPeers;\n if ( $verify && $this->settings->caBundlePath !== null ) {\n $verify = $this->settings->caBundlePath;\n }\n }\n\n $this->httpClient = new HttpClient( [\n 'verify' => $verify,\n ] );\n\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n return $this->getHttpClientBuilder()->getHttpClient();\n }", "protected function getClient(): ClientInterface\n {\n return $this->httpClient;\n }", "public function getClient(): Client\n {\n if (!isset($this->client)) {\n\n $headers = [\n 'Authorization' => $this->getAuthorizationHeader(),\n ];\n\n $options = [\n 'base_uri' => $this->getBaseUri(),\n RequestOptions::TIMEOUT => $this->getTimeout(),\n RequestOptions::DEBUG => $this->getDebug(),\n RequestOptions::HEADERS => $headers,\n ];\n\n $client = new Client($options);\n\n $this->setClient($client);\n }\n\n return $this->client;\n }", "public function getClient()\n {\n if (empty($this->client)) {\n $this->setClient();\n }\n \n return $this->client;\n }", "protected function _getHttpClient()\n {\n return new Zend_Http_Client(null, array('timeout'=> 30));\n }", "public function getClient()\n {\n if (empty($this->client)) {\n $this->client = $this->makeClient();\n }\n\n return $this->client;\n }", "public function getClient() {\n $client = new HttpClient();\n $client->setDefaultHeader('Content-Type', 'application/json');\n\n $userAgent = val('useragent', $this->config, 'kaecyra/alice-server');\n if ($userAgent) {\n $userAgent .= '/'.APP_VERSION;\n $client->setDefaultHeader('User-Agent', $userAgent);\n }\n\n return $client;\n }", "public function getHttpClient()\n {\n if (!$this->httpClient) {\n $this->httpClient = new HttpClient([\n 'base_uri' => self::BASE_URI,\n 'headers' => [\n 'Authorization' => 'Token '.$this->token,\n 'content-type' => 'application/json'\n ]\n ]);\n }\n\n return $this->httpClient;\n }", "public function getResource(): object\n {\n return new Client(\n $this->options['uri'],\n $this->options['uriOptions'],\n $this->options['driverOptions']\n );\n }", "public function http()\n {\n if (isset($this->http)) {\n return $this->http;\n }\n\n return HttpClientDiscovery::find();\n }", "public function getClient()\n {\n if (!$this->client) {\n $this->client = new Client();\n }\n\n return $this->client;\n }", "protected function getClient()\n {\n if ($this->client === null) {\n $this->client = self::createClient();\n }\n\n return $this->client;\n }", "public function getHttpClient()\n {\n if (null === $this->httpClient) {\n $this->httpClient = new Client(\n $this->getMockClient()\n );\n }\n\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n if (!$this->httpClient) {\n $this->httpClient = new Konstati_Http_Client(\n $this->username, $this->apiKey, $this->endpoint\n );\n }\n\n return $this->httpClient;\n }", "public static function getStaticHttpClient()\n {\n if (!self::$_staticHttpClient instanceof Zend_Http_Client) {\n $client = new Zend_Http_Client();\n $userAgent = 'Zend_Framework_Gdata/' . Zend_Version::VERSION;\n $client->setHeaders('User-Agent', $userAgent);\n $client->setConfig([\n 'strictredirects' => true\n ]\n );\n self::$_staticHttpClient = $client;\n }\n return self::$_staticHttpClient;\n }", "public function getClient()\n {\n if (empty($this->httpClient)) {\n $this->httpClient = new GuzzleClient([\n 'base_uri' => self::API_ENDPOINT,\n // 'auth' => [$this->clientId, $this->secret]\n ]);\n }\n\n return $this->httpClient;\n }", "protected function http()\n {\n return new \\GuzzleHttp\\Client;\n }", "public function http()\n {\n if ($this->http) {\n return $this->http;\n } else {\n $this->http = new GuzzleHttp\\Client(\n [\n 'auth' => [$this->options['account'], $this->options['secret']],\n 'base_uri' => self::BASE_URL.\"building/{$this->options['version']}/\",\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ],\n ]\n );\n }\n\n return $this->http;\n }", "public function getHttpClient()\n {\n if ($this->client == null) {\n $handler = HandlerStack::create();\n\n if ($this->mode == 'record') {\n $history = Middleware::history($this->callList);\n $handler->push($history);\n } elseif ($this->mode == 'playback') {\n $recordings = $this->getRecordings();\n\n $playList = $recordings;\n $mockedResponses = [];\n foreach ($playList as $item) {\n $mockedResponses[] = new Response($item['statusCode'], $item['headers'], $item['body']);\n }\n\n $mockHandler = new MockHandler($mockedResponses);\n $handler = HandlerStack::create($mockHandler);\n }\n\n $this->client = new Client(['handler' => $handler]);\n\n if (!$this->shutdownRegistered) {\n register_shutdown_function(array($this, 'endRecord'));\n $this->shutdownRegistered = true;\n }\n }\n\n return $this->client;\n }", "protected function createHttpClient()\n {\n $client = new HttpClient();\n\n return $this->setHttpClient($client);\n }", "protected static function instanceHttpClient()\n\t{\n\t\tif (!(self::$httpClient instanceof ImBot\\Http))\n\t\t{\n\t\t\t$botCode = self::BOT_CODE;\n\t\t\tif (self::BOT_CODE != static::BOT_CODE)\n\t\t\t{\n\t\t\t\t$botCode .= '.'. static::BOT_CODE; //network.support\n\t\t\t}\n\n\t\t\tself::$httpClient = new ImBot\\Http($botCode);\n\t\t}\n\n\t\treturn self::$httpClient;\n\t}", "public function getClient()\n {\n if ($this->client === null) {\n $this->client = $this->getStaticClient();\n }\n \n return $this->client;\n }", "public function getClient() {\n if(is_null($this->client)) {\n $this->client = $this->connect(); \n }\n return $this->client;\n }", "protected function getDefaultHttpClient()\n {\n return new Client();\n// 'curl.options' => array(\n// CURLOPT_CONNECTTIMEOUT => 60,\n// CURLOPT_SSL_VERIFYPEER => false,\n// CURLOPT_SSL_VERIFYHOST => false,\n// ),\n }", "public function getLocalHttpClient()\n {\n \tif (null === $this->_localHttpClient)\n \t{\n \t\trequire_once 'Zend/Http/Client.php';\n \t\t$client = new Zend_Http_Client();\n \t\t$this->setLocalHttpClient($client);\n \t}\n\n \t$this->_localHttpClient->resetParameters(true);\n\n return $this->_localHttpClient;\n }", "protected function _getClient()\n {\n $httpClient = new Zend_Http_Client;\n $httpClient->setConfig(array('timeout' => 30));\n $httpClient->setAuth($this->bobUser, $this->bobPassword);\n return $httpClient;\n }", "public static function getDefaultHttpClient()\n {\n $class = self::$defaultHttpClientClassName;\n\n return new $class();\n }", "public function getHttpClient(array $config = [])\n {\n if (null === $this->httpClient) {\n $this->httpClient = new Client($config);\n }\n\n return $this->httpClient;\n }", "private function getClient(): Client\n {\n if (!$this->client instanceof Client)\n $this->client = new Client();\n\n return $this->client;\n }", "protected function getClient()\n {\n return $this->connection ? $this->client->connection($this->connection) : $this->client;\n }", "protected function getClient()\n {\n return new Client([\n 'base_uri' => $this->baseUrl(), 'handler' => $this->createHandler()\n ]);\n }", "public function getHttpClient(): ClientInterface\n {\n return $this->api->getClient();\n }", "public function client()\n {\n if(null === $this->_client) {\n $this->_client = new Client();\n }\n return $this->_client;\n }", "public function getHttpClient(): HttpMethodsClientInterface {\n\t\treturn $this->getHttpClientBuilder()->getHttpClient();\n\t}", "protected function getHttp()\n {\n if (is_null($this->http)) {\n $this->http = new Http($this->guzzle);\n }\n\n return $this->http;\n }", "private function getClient()\n {\n if ($this->client) {\n return $this->client;\n }\n\n // use bearer with guzzle: https://stackoverflow.com/a/38370987/4873825\n\n $this->client = new \\GuzzleHttp\\Client(['base_uri' => $this->baseUrl]);\n return $this->client;\n }", "protected function getHttpClient()\n {\n return new \\GuzzleHttp\\Client();\n }", "protected function getHttpClient()\n {\n return new \\GuzzleHttp\\Client();\n }", "public static function getHttpClient(){\n return new Client(['verify' => false,'http_errors' => false]);\n }", "public function getClient()\n {\n if ($this->options['client'] instanceof Client\\ClientInterface) {\n $client = $this->options['client'];\n } else {\n // the client object itself (php < 5.4)\n $className = __NAMESPACE__ . '\\\\Client\\\\' .\n ucfirst(strtolower($this->options['api']['client']));\n $client = new $className($this->options['client']);\n }\n return $client;\n }", "protected function getClient()\n\t{\n\t\t$this->client->timeout = $this->timeout;\n\t\t$this->client->sslVerifyPeer = $this->sslVerifyPeer;\n\n\t\treturn $this->client;\n\t}", "protected function _getClient()\n {\n if($this->_client === null)\n {\n $this->_client = new Client($this->_guzzleConfig);\n }\n\n return $this->_client;\n }", "private function getStaticClient()\n {\n if (static::$defaultClient === null) {\n static::$defaultClient = new Client();\n }\n \n return static::$defaultClient;\n }", "protected static function getClient(): Client {\n return new Client( [\n 'verify' => FALSE,\n 'base_uri' => IEXTrading::URL,\n ] );\n }", "public function getClient(): Client\n {\n if ($this->client === null) {\n $this->client = new Client();\n }\n\n return $this->client;\n }", "public function getHttp()\n {\n return $this->http ?: $this->http = new Http();\n }", "public function getHttpClient(): HttpMethodsClientInterface\n {\n return $this->getHttpClientBuilder()->getHttpClient();\n }", "public function getHttpClient(): HttpMethodsClientInterface\n {\n return $this->getHttpClientBuilder()->getHttpClient();\n }", "public function getHttpClient(): HttpMethodsClientInterface\n {\n return $this->getHttpClientBuilder()->getHttpClient();\n }", "public static function get_client()\n {\n $client = new Google_Client();\n\n // If we are going through a proxy, set that up\n $proxy = self::get_config('external_proxy');\n if ($proxy) {\n $io = $client->getIo();\n\n $parts = self::decode_address($proxy, 'http', '80');\n\n $io->setOptions(array(\n CURLOPT_PROXY => $parts['Address'],\n CURLOPT_PROXYPORT => $parts['Port']\n ));\n }\n\n $client->setClientId(self::get_config('client_id'));\n $client->setApplicationName(self::get_config('application_name'));\n\n // absolute if starts with '/' otherwise relative to site root\n $keyPathName = self::get_config('private_key_file');\n if (substr($keyPathName, 0, 1) !== '/') {\n $keyPathName = Director::baseFolder() . \"/\" . $keyPathName;\n }\n\n $client->setAssertionCredentials(new Google_Auth_AssertionCredentials(\n self::get_config('service_account'),\n explode(',', self::get_config('scopes')),\n file_get_contents($keyPathName)\n ));\n\n $client->setAccessType('offline_access');\n\n // Set up custom database cache handler.\n $client->setCache(new GoogleAPICacheHandler($client));\n\n return $client;\n }", "protected function getHttpClient()\n {\n if ($this->http) {\n return $this->http;\n }\n\n return $this->http = m::mock(stdClass::class);\n }", "public function getHttpClient();", "public function getHttpClient();", "public function getHttpClient();", "public function getHttpClient();", "public function getClient()\n {\n return new Client($this->app, []);\n }", "public function getGuzzleClient()\n {\n return $this->client->http;\n }", "private function getClient()\n {\n if (!is_null($this->client))\n return $this->client;\n\n $client = new GuzzleClient(['base_url' => $this->apiUrl]);\n $oauth = new Oauth1(array(\n 'consumer_key' => $this->consumerKey,\n 'consumer_secret' => $this->consumerSecret,\n 'token' => $this->token,\n 'token_secret' => $this->tokenSecret\n ));\n $client->getEmitter()->attach($oauth);\n return $this->client = $client;\n }", "public function getHttpClient()\n {\n }" ]
[ "0.7742804", "0.74915904", "0.7457626", "0.7411185", "0.74005425", "0.7347549", "0.7340072", "0.7337609", "0.7308174", "0.7283034", "0.7282715", "0.7228113", "0.7221019", "0.71899676", "0.7172252", "0.71627694", "0.713029", "0.7123965", "0.70993805", "0.7093331", "0.707614", "0.70668536", "0.70542", "0.7021324", "0.7008095", "0.7008095", "0.70058197", "0.700105", "0.6990664", "0.69863427", "0.69632995", "0.6950045", "0.6940323", "0.6907945", "0.69051486", "0.69023323", "0.6896029", "0.6885301", "0.68599516", "0.6846768", "0.6840548", "0.6840358", "0.6835349", "0.68347746", "0.68226516", "0.68205917", "0.68096536", "0.6800366", "0.678187", "0.6779863", "0.67632383", "0.6762265", "0.67499137", "0.6748384", "0.6747415", "0.6746928", "0.67411333", "0.6735775", "0.67292786", "0.67254966", "0.67214745", "0.6709525", "0.6706446", "0.6691867", "0.6691685", "0.6683393", "0.6674602", "0.66736865", "0.66728866", "0.6657286", "0.6654116", "0.6649911", "0.66418755", "0.664089", "0.6636327", "0.6614952", "0.6579991", "0.6568373", "0.6568373", "0.65565246", "0.65528935", "0.6513127", "0.649414", "0.64882827", "0.6476244", "0.6470031", "0.6460431", "0.64509714", "0.64509714", "0.64509714", "0.6448451", "0.64351803", "0.6428795", "0.6428795", "0.6428795", "0.6428795", "0.64243627", "0.6417355", "0.6406737", "0.6404179" ]
0.7972284
0
Get an arry of resources matching a certain property and value. For example this routine could be used as a way of getting everyone who is male: $people = $graph>resourcesMatching('foaf:gender', 'male');
Получить массив ресурсов, соответствующих определенному свойству и значению. Например, эта процедура может быть использована как способ получения всех мужчин: $people = $graph>resourcesMatching('foaf:gender', 'male');
public function resourcesMatching($property, $value) { $matched = array(); foreach ($this->_resources as $resource) { if ($resource->matches($property, $value)) { array_push($matched, $resource); } } return $matched; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function matches($property, $value)\n {\n foreach ($this->all($property) as $v) {\n if ($v instanceof EasyRdf_Resource and $v === $value) {\n return true;\n } else if ($v == $value) {\n return true;\n }\n }\n return false;\n }", "public function findInResource(string $resource) : array;", "public function getMatches()\n {\n /** @var User $user */\n $user = auth('api')->user();\n return MatchResource::collection($user->matches());\n }", "public function getByAdditionalInformation($property = '', $value = '')\n {\n\n foreach ($this->_routes as $url => $http_method_group)\n {\n\n foreach ($http_method_group as $http_method => $route)\n {\n\n $additional = $route->getAdditionalInformation();\n\n if (isset($additional[$property]) AND\n $additional[$property] == $value)\n {\n return $route;\n }\n\n }\n\n }\n\n throw new MatchingRouteNotFoundException('Matching route not found');\n\n }", "public function getAllResourcesBy(array $params);", "public function getResources($resource = array()) {\n $cache = array();\n foreach ($resource as $name => $type) {\n if (is_numeric($name)) {\n $res = $this->getResource('name', $type);\n } else {\n $res = $this->getResource($type, $name);\n }\n array_push($cache, $res);\n }\n return $this->wrap($cache);\n }", "public function referenceResources(){\n\n\t\t$select = $this->select()\n\t\t\t\t\t ->from( array( $this->info( 'name' ) ), array( 'resource' ) )\n\t\t\t\t\t ->distinct();\n\n\t\t$res = array();\n\t\tif( true == ( $rows = $this->fetchAll( $select ) ) ){\n\t\t\tforeach( $rows as $row ){\n\t\t\t\t$res[] = $row[ 'resource' ];\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "abstract public function get_resources();", "public function getAllResourcesBy(array $params)\n {\n return $this ->collectionQuery($this ->getModel() ->where($params));\n }", "function findBy($property, $value);", "function resourcesByPermission($permission){\n\n try{\n $permissionObj = Permission::where('name','=', $permission)->firstOrFail();\n }catch (ModelNotFoundException $e){\n return false;\n }\n $roleResourcePermissions = $this->resourcePermissions()->where('permission_id', $permissionObj->id)->get();\n $resources = array();\n foreach($roleResourcePermissions as $p ){\n $resources[] = $p->resource;\n }\n return $resources;\n\n }", "public function getMatch($uri, array $matchCollection);", "public function getResources(): array\n {\n $reflectionClass = new ReflectionClass(static::$factory);\n\n if($reflectionClass->hasProperty('resource')){\n return $reflectionClass->getProperty('resource')->getDefaultValue();\n }\n\n return [];\n }", "function retrieveRelations(string $resourceId);", "public function findByValueWith($key, $value, $resource)\n {\n return $this->model->with([\n $resource => function ($q) use ($key, $value) {\n $q->where($key, $value);\n }\n ])->firstOrFail();\n }", "public function get_resources_for_permissions()\n\t{\n\t\t$query = $this->ci->db->get($this->resource_table);\n\n\t\treturn $query;\n\t}", "function _arfs_get_file_by_property($filters) {\n //@todo everything\n}", "function getPropertyRelationshipByRenterIdByPropertyID($renter_id, $property_id) {\n global $db;\n $statement = $db->prepare('select renterproperty_id, renter_id, property_id, renter_match_score '\n . ' from renter_property '\n . 'where renter_property.renter_id=:id '\n . 'and renter_property.property_id=:property_id'\n );\n $statement->bindValue(':id', $renter_id);\n $statement->bindValue(':property_id', $property_id);\n $statement->execute();\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n $statement->closeCursor();\n if (empty($result)){\n $result = false;\n } \n return $result;\n}", "public function getRegisteredResources();", "public function getRelevantRules($resource)\n {\n return $this->filter(function($rule) use ($resource) {\n return $rule->isRelevant($resource);\n });\n }", "public function searchable()\n {\n return $this->filter(function ($resource) {\n return $resource::$globallySearchable;\n });\n }", "public function selectResource($value)\r\n\t\t{\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\t$select_sql = \"select r.*, t.Type from cle_resource r left join cle_type t on r.Type_sid = t.sid \";\r\n\t\t\t\t$resourceFilter = new ResourceFilter();\r\n\t\t\t\t\r\n\t\t\t\tif (!is_null($value))\r\n\t\t\t\t{\r\n\t\t\t\t\t$resourceFilter = $value;\t\r\n\t\t\t\t\t$select_sql = $select_sql . $resourceFilter->getWhereClause('r');\r\n\t\t\t\t\t$select_sql .= $resourceFilter->getOrderByClause('r');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// echo 'select statement: ' . $select_sql . '<br/>';\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$conn = Connection::getMysqliConnectionInstance();\r\n\t\t\t\t$bindParam = new BindParam();\r\n\t\t\t\t\r\n\t\t\t\t$bindTypes = '';\r\n\t\t\t\t$bindParamList = new ArrayList();\r\n\t\t\t\t\r\n\t\t\t\t$statement = $bindParam->preparedStatement($bindTypes, $bindParamList, $select_sql);\r\n\t\t\t\t\r\n\t\t\t\t$sql = mysqli_query($conn, $statement);\r\n\t\r\n\t\t\t\t$resourceList = new ArrayList();\r\n\t\t\t\t\r\n\t\t\t\twhile ($result = mysqli_fetch_array($sql))\r\n\t\t\t\t{\r\n\t\t\t\t\t$resource = new Resource();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$resource->setSid($result['sid']);\r\n\t\t\t\t\t$resource->setUrl($result['URL']);\r\n\t\t\t\t\t$resource->setResourceName($result['ResourceName']);\r\n\t\t\t\t\t$resource->setAuthor($result['Author']);\r\n\t\t\t\t\t$resource->setTeachingAims($result['TeachingAims']);\r\n\t\t\t\t\t$resource->setTypeMenuSid($result['TypeMenu_sid']);\r\n\t\t\t\t\t$resource->setTypeSid($result['Type_sid']);\r\n\t\t\t\t\t$resource->setType($result['Type']);\r\n\t\t\t\t\t$resource->setRemarks($result['Remarks']);\r\n\t\t\t\t\t$resource->setPic($result['Pic']);\r\n\t\t\t\t\t$resource->setImageUrl($result['Image_URL']);\r\n\t\t\t\t\t$resource->setLastUpdate($result['LastUpdate']);\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*\r\n\t\t\t\t\techo \"From Dao: <br/>\" .\r\n\t\t\t\t\t\t\t\"Sid: \" . $resource->getSid() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"Url: \" . $resource->getUrl() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"ResourceName: \" . $resource->getResourceName() . \"<br/>\" . \r\n\t\t\t\t\t\t\t\"Author: \" . $resource->getAuthor(). \"<br/>\" . \r\n\t\t\t\t\t\t\t\"TeachingAims: \" . $resource->getTeachingAims() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"Type Sid : \" . $resource->getTypeSid() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"Remarks : \" . $resource->getRemarks() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"LastUpdate : \" . $resource->getLastUpdate() . \"<br/>\"; \r\n\t\t\t\t\t*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$resourceList->add($resource);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $resourceList;\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e)\r\n\t\t\t{\r\n\t\t\t\techo (\"Exception: \" . $e . \"\\n\" );\r\n\t\t\t}\r\n\t\t}", "public function getMatched()\n\t{\n\t\t$result = array();\n\t\tforeach ($this->items as $item) {\n\t\t\t$result[] = $item->getMatched();\n\t\t}\n\t\treturn $result;\n\t}", "public function filterByResourceType($value = null, $comparison = null)\n {\n return $this->useResourceQuery()->filterByResourceType($value, $comparison)->endUse();\n }", "public function filterByResourceType($value = null, $comparison = null)\n {\n return $this->useResourceQuery()->filterByResourceType($value, $comparison)->endUse();\n }", "private function findResources($type, $name) {\n $cache = array();\n foreach ($this->children as $data) {\n if ($data->getProperty($type) === $name) {\n array_push($cache, $data);\n }\n }\n return $this->wrap($cache);\n }", "public function get_resources()\n {\n $obj_query = $this->obj_db->prepare(\"SELECT * FROM resources as a INNER JOIN resource_details as b ON a.id = b.resource_id ORDER BY name ASC\");\n\n try {\n $obj_query->execute();\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n\n return $obj_query->fetchAll();\n }", "public function rules($resource=null);", "public function getByValueWith($key, $value, $resource)\n {\n return $this->model->with([\n $resource => function ($q) use ($key, $value) {\n $q->where($key, $value);\n }\n ])->get();\n }", "public final function getListOfResources($sPattern)\n\t{\n\t\t$sCurrentDirectory = getcwd();\n\n\t\tchdir(ROOT.\"/Resources/{$this->spScript}/\");\n\t\t$aMatches = glob($sPattern);\n\n\t\tchdir($sCurrentDirectory);\n\t\treturn $aMatches;\n\t}", "public function getPeople($attr, $value)\n {\n return array_filter(\n $this->model->getPeople(),\n function($person) use ($attr, $value) {\n return isset($person[$attr]) && $person[$attr] == $value;\n }\n );\n }", "public static function where($attributes = array()) {\n $response = self::connection()->get( self::wherePath(static::$site, $attributes) );\n $remote_resource_collection = new Collection(get_called_class(), $response);\n return $remote_resource_collection;\n }", "protected function requestMatches()\n {\n $uri = str_replace(API_NAME, '', $this->getRequesturi());\n $uri = $this->getGetVariablesIfHas($uri);\n $requestedRoute = ArrayHelpers::removeEmptys(explode('/', $uri));\n $this->uriParams = $requestedRoute;\n array_shift($this->uriParams);\n return ArrayHelpers::searchMeInRoutesArray($this->routeCollection,\n $requestedRoute);\n }", "public function getMatches() {\n return Match::all();\n }", "public function getResources()\n {\n return $this->_data['resource'];\n }", "public function autocomplete(request $request, string $prop1, string $fieldName): JsonResponse {\n \n $matches = array();\n $string = $request->query->get('q');\n \n //check the user entered char's\n if(strlen($string) < 3) { return new JsonResponse(array()); }\n \n //f.e.: depositor\n $propUri = base64_decode(strtr($prop1, '-_,', '+/='));\n\n if(empty($propUri)){ return new JsonResponse(array()); }\n \n $fedora = new Fedora(); \n //get the property resources\n $rangeRes = null;\n \n try {\n $prop = $fedora->getResourceById($propUri);\n //get the property metadata\n $propMeta = $prop->getMetadata();\n // check the range property in the res metadata\n $rangeRes = $propMeta->getResource('http://www.w3.org/2000/01/rdf-schema#range');\n } catch (\\RuntimeException $e){\n return new JsonResponse(array());\n }\n\n if($rangeRes === null){\n return new JsonResponse(array()); // range property is missing - no autocompletion\n }\n\n $matchClass = $fedora->getResourcesByProperty('http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $rangeRes->getUri());\n\n // if we want additional properties to be searched, we should add them here:\n $match = array(\n 'title' => $fedora->getResourcesByPropertyRegEx('http://purl.org/dc/elements/1.1/title', $string),\n 'name' => $fedora->getResourcesByPropertyRegEx('http://xmlns.com/foaf/0.1/name', $string),\n 'acdhId' => $fedora->getResourcesByPropertyRegEx(RC::get('fedoraIdProp'), $string),\n );\n\n $matchResource = $matchValue = array();\n foreach ($matchClass as $i) {\n $matchResource[] = $i->getUri();\n if (stripos($i->getUri(), $string) !== false) {\n $matchValue[] = $i->getUri();\n }\n }\n foreach ($match as $i) {\n foreach ($i as $j) {\n $matchValue[] = $j->getUri();\n }\n }\n $matchValue = array_unique($matchValue);\n $matchBoth = array_intersect($matchResource, $matchValue);\n\n foreach ($matchClass as $i) {\n \n if (!in_array($i->getUri(), $matchBoth)) {\n continue;\n }\n\n $meta = $i->getMetadata();\n \n //$acdhId = $meta->getResource(EasyRdfUtil::fixPropName($config->get('fedoraIdProp')));\n $acdhId = $fedora->getResourceByUri($i->getUri());\n $acdhId = $acdhId->getId();\n \n $label = empty($meta->label()) ? $acdhId : $meta->label();\n //because of the special characters we need to convert it\n $label = htmlentities($label, ENT_QUOTES, \"UTF-8\");\n \n $matches[] = ['value' => $acdhId , 'label' => $label];\n\n if(count($matches) >= 10){\n break;\n }\n }\n \n $response = new JsonResponse($matches);\n $response->setCharset('utf-8');\n $response->headers->set('charset', 'utf-8');\n $response->headers->set('Content-Type', 'application/json');\n \n return $response;\n }", "public function get_all()\n {\n $this->initialize();\n $queryString = \"MATCH (n) RETURN n LIMIT 100\";\n $query = new Query($this->client, $queryString, array());\n $result = $query->getResultSet();\n\n foreach ($result as $row) {\n $arrAll[] = $row[0]->getProperties();\n }\n\n $result = (empty($arrAll) ? $this->errorRes : $arrAll);\n return $result;\n\n }", "public function get($properties = ['*'])\n {\n $properties = Arr::wrap($properties);\n\n // Call API to get the response\n $response = $this->getClient()\n ->request($this->getPath());\n\n // Peel off the key if exist\n $response = $this->peelWrapperPropertyIfNeeded(Arr::wrap($response));\n\n // Convert to a collection of filtered objects casted to the class\n return (new Collection((array_values($response) === $response) ? $response : [$response]))->map(\n function ($items) use ($properties) {\n // Cast to class with only the requested, properties\n return $this->getModel()\n ->newFromBuilder(\n $properties === ['*']\n ? (array)$items\n : collect($items)\n ->only($properties)\n ->toArray()\n )\n ->setClient($this->getClient());\n }\n );\n }", "public\n\n\tfunction getResource()\n\t{\n\t\treturn $this->data->json['resource']->get(func_get_args());\n\t}", "public function oeaw_resources():array {\n\n drupal_get_messages('error', TRUE);\n \n $url = Url::fromRoute('<current>');\n $internalPath = $url->getInternalPath();\n $interPathArray = explode(\"/\", $internalPath);\n $errorMSG = array();\n \n if($interPathArray[0] == \"oeaw_resources\"){ \n $metaKey = urldecode($interPathArray[1]);\n $metaValue = urldecode($interPathArray[2]); \n }else{\n return drupal_set_message(t('There is no data -> Search'), 'error'); \n }\n $uid = \\Drupal::currentUser()->id();\n //normal string seacrh\n\n $metaKey = $this->OeawFunctions->createUriFromPrefix($metaKey);\n if($metaKey === false){\n return drupal_set_message(t('Error in function: createUriFromPrefix '), 'error'); \n }\n \n $stringSearch = $this->OeawStorage->searchForData($metaValue, $metaKey); \n $fedora = new Fedora();\n \n //we will search in the title, name, fedoraid\n $idSearch = array(\n 'title' => $fedora->getResourcesByPropertyRegEx('http://purl.org/dc/elements/1.1/title', $metaValue),\n 'name' => $fedora->getResourcesByPropertyRegEx(\\Drupal\\oeaw\\ConnData::$foafName, $metaValue),\n 'acdhId' => $fedora->getResourcesByPropertyRegEx(RC::get('fedoraIdProp'), $metaValue),\n );\n\n $x = 0;\n $data = array();\n $datatable = array();\n \n foreach ($idSearch as $i) {\n \n foreach ($i as $j) {\n //if there is any property which contains the searched value then\n // we get the uri and \n if(!empty($j->getUri())){\n //get the resource identifier f.e.: id.acdh.oeaw.ac.at..... \n $identifier = $fedora->getResourceByUri($j->getUri())->getMetadata()->getResource('http://purl.org/dc/terms/identifier');\n \n if(!empty($identifier)){\n //get the resources which is part of this identifier\n $identifier = $identifier->getUri(); \n\n $ids = $this->OeawStorage->searchForData($identifier, $metaKey);\n \n //generate the result array\n foreach($ids as $v){\n if(!$v[\"uri\"]){\n break;\n }\n $data[$x][\"uri\"] = $v[\"uri\"];\n \n if(empty($v[\"title\"])){\n $v[\"title\"] = \"\";\n }\n $data[$x][\"title\"] = $v[\"title\"];\n $x++;\n }\n }else {\n $data[$x][\"uri\"] = $j->getUri();\n $data[$x][\"value\"] = $metaValue;\n $data[$x][\"title\"] = $j->getMetadata()->label()->__toString();\n $x++;\n }\n }\n }\n }\n\n if(!empty($data) && !empty($stringSearch)){\n $data = array_merge($data, $stringSearch);\n }elseif (empty($data)) {\n $data = $stringSearch;\n }\n \n if(count($data) > 0){\n $i = 0; \n \n foreach($data as $value){\n // check that the value is an Url or not\n \n if($value[\"res\"]){\n $decodeUrl = $this->OeawFunctions->isURL($value[\"res\"], \"decode\");\n \n //create details and editing urls\n if($decodeUrl){\n $res[$i]['detail'] = \"/oeaw_detail/\".$decodeUrl;\n if($uid !== 0){\n $res[$i]['edit'] = \"/oeaw_edit/\".$decodeUrl;\n $res[$i]['delete'] = \"/oeaw_delete/\".$decodeUrl;\n }\n } \n $res[$i][\"uri\"] = $value[\"res\"];\n }\n \n $res[$i][\"title\"] = $value[\"title\"];\n $i++;\n }\n $searchArray = array(\n \"metaKey\" => $metaKey,\n \"metaValue\" => $metaValue\n );\n $decodeUrl = \"\";\n \n }else {\n $errorMSG = drupal_set_message(t('There is no data -> Search'), 'error'); \n }\n\n\n $searchArray = array(\n \"metaKey\" => $metaKey,\n \"metaValue\" => $metaValue \n );\n \n $datatable = array(\n '#userid' => $uid,\n '#errorMSG' => $errorMSG, \n '#attached' => [\n 'library' => [\n 'oeaw/oeaw-styles', \n ]\n ]\n );\n \n if(isset($res) && $res !== null && !empty($res)){\n $datatable['#theme'] = 'oeaw_search_res_dt';\n $datatable['#result'] = $res;\n $datatable['#searchedValues'] = $searchArray;\n }\n \n return $datatable;\n \n }", "function resourcesByPermission($permission){\n\n if ($user = $this->user()) {\n return $user->resourcesByPermission($permission);\n }\n return false;\n }", "public function findBookableResources()\n {\n $q = new ullQuery('UllBookingResource');\n $q\n ->addWhere('x.is_bookable = ?', true)\n ->addOrderBy('Translation->name')\n ;\n return $q->execute();\n }", "public function getAllMatches(){\n \treturn Match::with('battingTeams','bowlingTeams')->get();\n }", "public static function getResources()\n\t{\n\t\treturn array(\n\t\t\t\\Foomo\\Modules\\Resource\\Module::getResource('Foomo.Services', self::VERSION),\n\t\t\t// get a run mode independent folder var/<runMode>/test\n\t\t\t// \\Foomo\\Modules\\Resource\\Fs::getVarResource(\\Foomo\\Modules\\Resource\\Fs::TYPE_FOLDER, 'test'),\n\t\t\t// and a file in it\n\t\t\t// \\Foomo\\Modules\\Resource\\Fs::getVarResource(\\Foomo\\Modules\\Resource\\Fs::TYPE_File, 'test' . DIRECTORY_SEPARATOR . 'someFile'),\n\t\t\t// request a cache resource\n\t\t\t// \\Foomo\\Modules\\Resource\\Fs::getCacheResource(\\Foomo\\Modules\\Resource\\Fs::TYPE_FOLDER, 'navigationLeaves'),\n\t\t\t// a database configuration\n\t\t\t\\Foomo\\Modules\\Resource\\Config::getResource(self::NAME, 'Foomo.Services.broadcast'),\n\t\t\t\\Foomo\\Modules\\Resource\\Config::getResource(self::NAME, 'Foomo.Flash.vendorConfig')\n\t\t);\n\t}", "function getResourceSelector()\n{\n return new Selector_ResourceSelector('resource');\n}", "public function getResources()\n {\n\n\n //build URI\n $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/resources/';\n\n //sign URI\n $signedURI = Utils::sign($strURI);\n\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n\n $json = json_decode($responseStream);\n\n if ($json->Code == 200)\n return $json->Resources->ResourceItem;\n else\n return false;\n }", "function get_resources($lo, $la, $r) {\n\n \t$datas = $this->database->select(\"resource\", [\n\t\t\t\"[>]audio_detail\" => [\"id\" => \"audio_id\"],\n\t\t\t\"[>]user\" => [\"user_id\" => \"id\"]\n\t\t], [\n\t\t\t\"resource.id(id)\",\n\t\t\t\"location_lat\",\n\t\t\t\"location_long\",\n\t\t\t\"note\",\n\t\t\t\"type\",\n\t\t\t\"link\",\n\t\t\t\"title\",\n\t\t\t\"artist\",\n\t\t\t\"date_creation\",\n\t\t\t\"full_name\",\n\t\t]);\n\t\t//var_dump($datas);\n\t\t\n \treturn $datas;\n }", "public function getBy($property, $value) {\n\t\t$found = null;\n\t\tforeach($this as $notification) {\n\t\t\tif($notification->get($property) == $value) {\n\t\t\t\t$found = $notification;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $found;\n\t}", "public function matches();", "public function getMatch();", "public function matchAction()\n {\n $params = $this->params();\n $query = $params->fromQuery('query');\n\n $options = [\n 'offset' => $params->fromQuery('offset', 0),\n 'limit' => $params->fromQuery('limit', 10)\n ];\n\n $users = $this->service->matchUsers($query, $options);\n\n return new JsonModel($users);\n }", "public function getUsersForResource(string $publicKey, string $resource): array;", "public function searchByAttribute( $attribute, $value ) {\n\t\t$result = array();\n\t\tforeach ( $this->citations as $id => $citation ) {\n\t\t\tif ( isset( $citation->attributes[$attribute] ) && $citation->attributes[$attribute] == $value ) {\n\t\t\t\t$result[$id] = $citation;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getResources(): array;", "public function getResources();", "public function getResources();", "public function getResources();", "public function getResources();", "function getitemresources($id)\n\t{\n\t\t$sql=\"select type,id from king_resources where itemid=?\";\n\t\t$q=$this->db->query($sql,array($id));\n\t\tif($q->num_rows()>0)\n\t\t\treturn $q->result_array();\n\t\treturn false;\n\t}", "public function providerFetchResource() {\n return [\n 'JSON resource' => [\n 'video_vimeo.json',\n 'Vimeo',\n 'Drupal Rap Video - Schipulcon09',\n ],\n 'XML resource' => [\n 'video_collegehumor.xml',\n 'CollegeHumor',\n \"Let's Not Get a Drink Sometime\",\n ],\n ];\n }", "public function rest_get_matches() {\n\t\t// PARAMETERS: number_of_items\n\t\t// RETURN: array of push items\n\t\tif(strlen($this->arg) == 0) $this->status = 'ERROR_GET_NOT_SET';\n\t\tif(substr($this->status,0,5) == 'ERROR') return;\n\t\t\n\t\t$queue = rQueue::get_matches($this->arg);\n\t\t$this->set_response(\n\t\t\t$queue\n\t\t);\n\t}", "protected function getSearchResults()\n {\n foreach ($this->resources as $resourceClass) {\n $query = (new Builder($resourceClass))->search(\n $this->request, $resourceClass::newModel()->newQuery(),\n $this->request->search\n );\n\n yield from $query->limit($resourceClass::$globalSearchResults)\n ->cursor()\n ->mapInto($resourceClass)\n ->map(function ($resource) use ($resourceClass) {\n return $this->transformResult($resourceClass, $resource);\n });\n }\n }", "function getRentersByPropertyId($prop_id) {\n global $db;\n $statement = $db->prepare('select * '\n . ' from renter_property,people ' \n . 'where renter_property.renter_id=people.people_id '\n . 'and renter_property.property_id=:id');\n $statement->bindValue(':id', $prop_id);\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\n $statement->closeCursor();\n if (empty($result)){\n $result = false;\n } \n return $result;\n}", "public static function getResources()\n {\n /** @var Router $api */\n $api = app('Dingo\\Api\\Routing\\Router');\n\n $resources = [];\n foreach ($api->getRoutes()[getenv('API_VERSION')]->getRoutes() as $route) {\n if (in_array($route->getPath(), ['resources', false, null, '', 'authenticate'])) {\n continue;\n }\n\n $resources[] = $route->getPath();\n }\n\n return $resources;\n }", "function getAllResources($problem) { \n $query = sprintf(\"SELECT * FROM data WHERE problem=%d AND user=0 AND k='resources'\", $problem);\n $result = mysql_query($query);\n $resources = mysql_fetch_array($result);\n if (!$resources || $resources == \"\") { return array(); }\n else {\n $resources = preg_split('[\\r\\n|\\n|\\r]', $resources['v']);\n $rows = array();\n foreach ($resources as $resource) {\n if ($resource == \"\") { continue; }\n $resource = preg_split('[::]', $resource);\n $rows[] = array('id' => $resource[0], 'name' => $resource[1]); \n }\n return $rows;\n }\n}", "public function getPropertyResourceId($property);", "public function getRelatedByResourceIdentifier(string $resource_identifier): array;", "public function findUsersWithQualityDimensions() \n {\n $query = \n \"SELECT * WHERE \n { \n ?element a <w2share:QualityDimension>;\n <dc:creator> ?creator.\n ?creator <foaf:name> ?name.\n \n }\";\n \n $user_array = array();\n $user_quality_dimensions = $this->driver->getResults($query); \n \n for ($i = 0; $i < count($user_quality_dimensions); $i++)\n {\n $person = new \\AppBundle\\Entity\\Person();\n $person->setUri($user_quality_dimensions[$i]['creator']['value']);\n $person->setName($user_quality_dimensions[$i]['name']['value']);\n $user_array[$person->getUri()] = $person;\n }\n \n return $user_array;\n \n }", "public function getAllResources()\n {\n $finder = new Finder();\n\n return $finder->files()->followLinks()->in($this->getLocations());\n }", "public function selectResourceMysqli($value)\r\n\t\t{\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\t$select_sql = \"select r.*, t.type from cle_resource r left join cle_type t on r.Type_sid = t.sid \";\r\n\t\t\t\t$resourceFilter = new ResourceFilter();\r\n\t\t\t\t\r\n\t\t\t\tif (!is_null($value))\r\n\t\t\t\t{\r\n\t\t\t\t\t$resourceFilter = $value;\t\r\n\t\t\t\t\t$select_sql = $select_sql . $resourceFilter->getWhereClause('r');\r\n\t\t\t\t\t$select_sql .= $resourceFilter->getOrderByClause('r');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// echo 'select statement: ' . $select_sql . '<br/>';\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$conn = Connection::getConnectionInstance();\r\n\t\t\t\t$statement = $conn->prepare($select_sql);\r\n\t\t\t\t//$statement->bind_param(\"i\", $webRef->getSid());\r\n\t\t\t\t$statement->execute();\r\n\t\r\n\t\t\t\t$resourceList = new ArrayList();\r\n\t\t\t\t\r\n\t\t\t\t/* Bind results */\r\n\t\t\t\t$statement -> bind_result($sid, $url, $resourceName, $author, $teachingAims, $typeMenuSid, $typeSid, $remarks, $pic, $lastUpdate, $type );\r\n\t\t\t\t\r\n\t\t\t\twhile ($statement->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$resource = new Resource();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$resource->setSid($sid);\r\n\t\t\t\t\t$resource->setUrl($url);\r\n\t\t\t\t\t$resource->setResourceName($resourceName);\r\n\t\t\t\t\t$resource->setAuthor($author);\r\n\t\t\t\t\t$resource->setTeachingAims($teachingAims);\r\n\t\t\t\t\t$resource->setTypeMenuSid($typeMenuSid);\r\n\t\t\t\t\t$resource->setTypeSid($typeSid);\r\n\t\t\t\t\t$resource->setRemarks($remarks);\r\n\t\t\t\t\t$resource->setPic($pic);\r\n\t\t\t\t\t$resource->setLastUpdate($lastUpdate);\r\n\t\t\t\t\t$resource->setType($type);\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*\r\n\t\t\t\t\techo \"From Dao: <br/>\" .\r\n\t\t\t\t\t\t\t\"Sid: \" . $resource->getSid() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"Url: \" . $resource->getUrl() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"ResourceName: \" . $resource->getResourceName() . \"<br/>\" . \r\n\t\t\t\t\t\t\t\"Author: \" . $resource->getAuthor(). \"<br/>\" . \r\n\t\t\t\t\t\t\t\"TeachingAims: \" . $resource->getTeachingAims() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"Type Sid : \" . $resource->getTypeSid() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"Remarks : \" . $resource->getRemarks() . \"<br/>\" .\r\n\t\t\t\t\t\t\t\"LastUpdate : \" . $resource->getLastUpdate() . \"<br/>\"; \r\n\t\t\t\t\t*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$resourceList->add($resource);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $resourceList;\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e)\r\n\t\t\t{\r\n\t\t\t\techo (\"Exception: \" . $e . \"\\n\" );\r\n\t\t\t}\r\n\t\t}", "public function searchByAttribute(string $attributeName, string $attributeValue): array;", "function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof');", "public function getMatchingCriterias() {\n $aMatchingCriterias = [];\n\n # Init Criterias Table\n if(!array_key_exists('book-request-criteria',CoreController::$aCoreTables)) {\n CoreController::$aCoreTables['book-request-criteria'] = new TableGateway('bookrequest_criteria',CoreController::$oDbAdapter);\n }\n\n $oCriteriasFromDB = CoreController::$aCoreTables['book-request-criteria']->select();\n foreach($oCriteriasFromDB as $oCrit) {\n $aMatchingCriterias[$oCrit->criteria_entity_key] = (array)$oCrit;\n }\n\n return $aMatchingCriterias;\n }", "public function getResources()\n {\n return $this->hasMany(Resource::className(), ['resourceTypeId' => 'resourceTypeId']);\n }", "public function findBy($property, $pattern, $chapters = NULL) {\n if (!$chapters) {\n $chapters = $this->chapters;\n }\n\n /** @var \\ePub\\Definition\\Chapter; $chapter */\n foreach ($chapters as $chapter) {\n if (isset($chapter->{$property}) && preg_match('~' . $pattern . '~', $chapter->{$property})) {\n return $chapter;\n }\n else if ($chapter->children) {\n if ($result = $this->findBy($property, $pattern, $chapter->children)) {\n return $result;\n }\n }\n }\n return false;\n }", "function read_resource_all($resource_name, $level = 0) {\n $resources = [];\n // SimpleXML with the resources list that contains only the single resources id\n $xml_list = null;\n // single resource at the current iteration in the foreach loop\n $current_single_resource = null;\n // single resource id at the current iteration in the foreach loop\n $current_resource_id = 0;\n\n // first : retrieve the resources list from the read_resource($resource_name) method\n $xml_list = $this->read_resource($resource_name);\n \n // second : loop over each resource from the list and make a call to read_resource($resource_name, $id) specifying the id\n // $single_resource_content is a SimpleXML object that contains the single resource data and attributes\n foreach ( $xml_list as $single_resource_name => $single_resource_content ) {\n $current_resource_id = $single_resource_content->attributes()['id'];\n $current_single_resource = $this->read_resource($resource_name, $current_resource_id);\n $resources[] = $current_single_resource;\n }\n \n $this->retrieved_resource = $resources;\n \n return $resources;\n }", "abstract protected function filterProperty(string $property, $value, Builder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null, array $context = []);", "public function getRelationships($resource): iterable\n {\n return [];\n }", "public function getResources()\n\t{\n\t\treturn $this->resources;\n\t}", "function get_resource();", "public function getResource( $resource )\n {\n $function = 'resources/'.$resource;\n return $this->getResult( $function );\n }", "public function getResourcesByClass($className);", "public function getQualifications();", "public function getBy($attribute, $value, $columns = array('*'),$attribute1=null, $value1= null)\n {\n return $this->model->where($attribute, '=', $value)->get($columns);\n }", "public function getResourceList();", "public function getAllWith($resources)\n {\n $resourceList = getDelimitedStringFromArray($resources, ', ');\n\n return $this->model->with($resourceList)->get();\n }", "function getRenterPropertyRelationships(){\n global $db;\n $statement = $db->prepare('select * '\n . ' from renter_property '\n . '');\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\n $statement->closeCursor();\n return $result;\n}", "public static function list_resources($resource_id = FALSE)\n\t{\n\t\tif ( ! isset(AACL::$_resources))\n\t\t{\n\t\t\t// Find all classes in the application and modules\n\t\t\t$classes = AACL::_list_classes();\n\n\t\t\t// Loop through classes and see if they implement AACL_Resource\n\t\t\tforeach ($classes as $class_name)\n\t\t\t{\n\t\t\t\t$class = new ReflectionClass($class_name);\n\n\t\t\t\tif ($class->implementsInterface('AACL_Resource'))\n\t\t\t\t{\n\t\t\t\t\t// Ignore interfaces and abstract classes\n\t\t\t\t\tif ($class->isInterface() || $class->isAbstract())\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create an instance of the class\n\t\t\t\t\t$resource = $class->getMethod('acl_instance')->invoke($class_name, $class_name);\n\n\t\t\t\t\t// Get resource info\n\t\t\t\t\tAACL::$_resources[$resource->acl_id()] = array(\n\t\t\t\t\t\t'actions' => $resource->acl_actions(),\n\t\t\t\t\t\t'conditions' => $resource->acl_conditions(),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tunset($class);\n\t\t\t}\n\t\t}\n\n\t\tif ($resource_id === TRUE)\n\t\t{\n\t\t\treturn array_keys(AACL::$_resources);\n\t\t}\n\t\telseif ($resource_id)\n\t\t{\n\t\t\treturn isset(AACL::$_resources[$resource_id]) ? AACL::$_resources[$resource_id] : NULL;\n\t\t}\n\n\t\treturn AACL::$_resources;\n\t}", "public function searchValues($pattern, $method, array $rules=null);", "public function getImageProfiles ($pattern = \"*\", $include_values = true) {}", "public function exactMatch($propertyName, $value)\n {\n if ($value instanceof NodeInterface) {\n $value = $value->getIdentifier();\n }\n\n return $this->queryFilter('term', [$propertyName => $value]);\n }", "function getResourceById($problem, $resourceID) {\n $resources = getAllResources($problem);\n foreach ($resources as $resource) {\n if ($resource['id'] == $resourceID) { return array('id' => $resourceID, 'name' => $resource['name']); }\n }\n return null;\n}", "public function getResourceLookupSession ();", "public function resourceScan($context, $pattern)\n\t{\n\t\t$root = $this->basepath($context);\n\t\t$length = strlen($root) + 1;\n\t\t\n\t\t$target = $root.DIRECTORY_SEPARATOR.$pattern;\n\t\t\n\t\tif(stristr($target, \"../\"))\n\t\t\treturn [];\n\t\t\n\t\tif(strpos($target, $root) !== 0)\n\t\t\treturn [];\n\t\t\n\t\t$set = glob($target);\n\t\t\n\t\tforeach($set as $key => $item)\n\t\t\t$set[$key] = substr($item, $length);\n\t\t\n\t\treturn $set;\n\t}", "public function getBy($field, $value): Collection\n {\n return collect($this->repository->findBy([camel_case($field) => $value]));\n }", "public function getMatches($fields = null) {\n if ($fields === null) {\n return $this->matches;\n }\n elseif (count($fields) === 1) {\n $field = reset($fields);\n $returns = [];\n foreach ($this->matches as $match) {\n if (property_exists($match, $field)) {\n $returns[] = $match->$field;\n }\n }\n return $returns;\n }\n else {\n if (count($fields) < 2) {\n throw new \\http\\Exception\\InvalidArgumentException('not null, one or countable');\n }\n $i = 0;\n $returns = [];\n foreach ($this->matches as $match) {\n $returns[$i] = [];\n foreach ($fields as $field) {\n if (property_exists($match, $field)) {\n $returns[$i][$field] = $match->$field;\n }\n }\n $i++;\n }\n return $returns;\n }\n }", "public function getResourceByIdQuery($id)\n { \n\t\t$sql = $this->getQueryContent('resourceByIdQuery');\n\t\t$params = $this->getQueryParams('resourceByIdQuery');\n\t\t$sql = $this->bindSqlParams($sql,$params,$id);\n\t\treturn $this->db->fireSqlFetchAll($sql,'resourceByIdQuery');\n\t}", "function get_resource_filtered_to_useful_fom_resource($xml_resource) {\n // extract the useful XML data\n $useful_data = $xml_resource->children()->children();\n\n return $useful_data;\n }", "public function matching( Criteria $criteria );", "function findByAttribute($attribute, $value);" ]
[ "0.6048392", "0.5790193", "0.5692076", "0.55794", "0.5562315", "0.53443307", "0.5283966", "0.5282738", "0.5224637", "0.5158714", "0.5157091", "0.5125264", "0.5026619", "0.50147176", "0.50123554", "0.4987814", "0.49582508", "0.49500787", "0.49418792", "0.49355644", "0.490759", "0.4887912", "0.48867968", "0.48478252", "0.48478252", "0.48378402", "0.48202154", "0.4819899", "0.47871032", "0.47831017", "0.47747174", "0.4769513", "0.47489884", "0.4745715", "0.47092736", "0.4708105", "0.47064823", "0.4705306", "0.46875346", "0.46855053", "0.46731037", "0.46618617", "0.46589127", "0.4650228", "0.46468", "0.46465662", "0.46389917", "0.46375898", "0.46316588", "0.4618556", "0.46163818", "0.46075994", "0.4594645", "0.45884222", "0.45815176", "0.45815176", "0.45815176", "0.45815176", "0.45600855", "0.45534408", "0.4549552", "0.45355642", "0.45336595", "0.45323318", "0.45307285", "0.45264912", "0.4524645", "0.45223522", "0.45103514", "0.45033363", "0.45022312", "0.44988677", "0.44988218", "0.4496016", "0.44881347", "0.4486666", "0.44846362", "0.44810846", "0.44801867", "0.447656", "0.4473076", "0.44726104", "0.4471389", "0.4467305", "0.44646123", "0.4456799", "0.44554788", "0.4453779", "0.4451167", "0.44500557", "0.44491804", "0.44325078", "0.44231033", "0.44217372", "0.44163913", "0.44144318", "0.44129112", "0.44097984", "0.4395536", "0.43931904" ]
0.78066015
0
Add data to the graph The resource can either be a resource or the URI of a resource. The properties can either be a single property name or an associate array of property names and values. The value can either be a single value or an array of values. Examples: $res = $graph>resource(" $graph>add($res, 'prefix:property', 'value'); $graph>add($res, 'prefix:property', array('value1',value2')); $graph>add($res, array('prefix:property' => 'value1')); $graph>add($res, 'foaf:knows', array( 'foaf:name' => 'Name')); $graph>add($res, array('foaf:knows' => array( 'foaf:name' => 'Name'));
Добавить данные в граф. Ресурс может быть либо ресурсом, либо URI ресурса. Свойства могут быть либо одним именем свойства, либо ассоциативным массивом имен свойств и их значений. Значение может быть либо одним значением, либо массивом значений. Примеры: $res = $graph->resource(" $graph->add($res, 'prefix:property', 'value'); $graph->add($res, 'prefix:property', array('value1', value2')); $graph->add($res, array('prefix:property' => 'value1')); $graph->add($res, 'foaf:knows', array( 'foaf:name' => 'Name')); $graph->add($res, array('foaf:knows' => array( 'foaf:name' => 'Name'));
public function add($resource, $properties, $value=null) { if (!is_object($resource)) { $resource = $this->resource($resource); } else if (!$resource instanceof EasyRdf_Resource) { throw new InvalidArgumentException( "\$resource should be an instance of the EasyRdf_Resource class" ); } if (EasyRdf_Utils::is_associative_array($properties)) { foreach ($properties as $property => $value) { $this->add($resource, $property, $value); } return; } else { if (EasyRdf_Utils::is_associative_array($value)) { if (isset($value['rdf:type'])) { $bnode = $this->newBNode($value['rdf:type']); } else { $bnode = $this->newBNode(); } $bnode->add($value); $value = $bnode; } $resource->add($properties, $value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_resource(& $resource)\n {\n $this->resources[$resource->get_type()][$resource->get_id()] = $resource;\n }", "public function add($resource)\n {\n $this->resources[] = $resource;\n }", "public function addResource($resource)\n {\n $this->resources[] = $resource;\n $this->maxTimestamp = 0;\n }", "public function addData($id, $type, $resource, $props, $relations = null)\n {\n $this->data = self::constructData($id, $type, $resource, $props, $relations);\n }", "public static function add($properties)\n\t\t{\n if(!is_array($properties) || sizeof($properties) == 0) return;\n $meta = \"<meta \";\n foreach($properties as $property)\n {\n $meta .= \"{$property[0]}=\\\"{$property[1]}\\\" \";\n }\n $meta .= \"/>\";\n\t\t\tarray_push(static::$items, $meta);\n\t\t}", "public function addResource($resource, $accessList=null);", "public function add($rel, Resource $resource, $multi = true) {}", "public function addResource(\\SimpleXMLElement $resource) {\n\t\t\t$this->resources->addValue($this->import($resource, new Common\\Mutable\\HashSet()));\n\t\t}", "public function addResource(IResource $resource);", "public function add(?string $data = null, ?string $content = null, ?string $uri = null, ?bool $beforeDocumentScripts = null)\n {\n $resource = [];\n\n if (! is_null($data)) $resource['data'] = $data;\n if (! is_null($content)) $resource['content'] = $content;\n if (! is_null($uri)) $resource['uri'] = $uri;\n if (! is_null($beforeDocumentScripts)) $resource['beforeDocumentScripts'] = $beforeDocumentScripts;\n\n // even though everything is optional, we gotta have something.\n if (! count($resource)) {\n throw new Exception(\"Can't add invalid Resource.\");\n }\n\n $this->collection[] = $resource;\n }", "public function add_resource($resource)\n\t{\n\t\tif (!is_array($resource)) {\n\t\t\t$this->acl_perms['user_role'][$resource] = array();\n\t\t} else {\n\t\t\tforeach ($resource as $res) {\n\t\t\t\t$this->acl_perms['user_role'][$res] = array();\n\t\t\t}\n\t\t}\n\t}", "public function add($resource)\n\t{\n\t\tif (!is_object($resource) || $resource instanceof Resource === false)\n\t\t\tthrow new Exception('Resource must be an object');\n\n\t\t$this->_resources[] = $resource;\n\n\t\treturn $this;\n\t}", "public function add( $data );", "public function postResourceAdditonalData(){\n // POST\n $response = $this->client()->request('POST', '/'.$this->resource, [\n 'headers' => $this->headers(),\n 'body' => json_encode([\n \"data\" => array_merge(\n array_merge(\n $this->resource()->data(),\n ['additonalData' => 'not supported']\n )\n )\n ])\n ]);\n // ASSERTIONS\n $this->assertEquals(self::HTTP_UNPROCESSABLE_ENTITY, $response->getStatusCode());\n }", "public function add($resource, $resourcePath = null) {\n\t\t$this->resources[$resource] = (array)$resourcePath;\n\n\t\treturn $this;\n\t}", "public function add($data);", "public function add($data);", "public function add($properties, $values=null)\n {\n if ($properties == null or $properties == '') {\n throw new InvalidArgumentException(\n \"\\$properties cannot be null or empty\"\n );\n }\n\n // Have multiple properties been given?\n if (is_array($properties)) {\n if (EasyRdf_Utils::is_associative_array($properties)) {\n foreach ($properties as $property => $value) {\n $this->add($property, $value);\n }\n return;\n } else {\n foreach ($properties as $property) {\n $this->add($property, $values);\n }\n return;\n }\n } else {\n $property = $properties;\n }\n\n // No value given?\n if ($values == null) {\n return null;\n }\n\n // Create the property if it doesn't already exist\n $property = EasyRdf_Namespace::expand($property);\n if (!isset($this->_properties[$property])) {\n $this->_properties[$property] = array();\n }\n\n if (!is_array($values)) {\n $values = array($values);\n }\n\n // Convert literal values into objects\n $objects = array();\n foreach ($values as $value) {\n if (is_object($value)) {\n $objects[] = $value;\n } else {\n $objects[] = new EasyRdf_Literal($value);\n }\n }\n\n // Add the objects, if they don't already exist\n foreach ($objects as $object) {\n if (!$this->matches($property, $object)) {\n array_push($this->_properties[$property], $object);\n if ($object instanceof EasyRdf_Resource) {\n $object->addInverse($property, $this);\n }\n }\n }\n\n return $this->_properties[$property];\n }", "public function add($other, $properties=null)\n\t{\n\t\t$id = $other->id();\n\t\tif(!isset($this->edges[$id])) {\n\t\t\tif($this->create_unique_edge($other, $id))\n\t\t\t{\n\t\t\t\t$this->edges[$id][\"edge\"]->setProperty('create_time', time());\n\t\t\t\tif($properties != null)\n\t\t\t\t{\n\t\t\t\t\tforeach($properties as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->edges[$id][\"edge\"]->setProperty($key, $value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->edges[$id][\"edge\"]->save();\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new GraphModelException($this->type . ' add failed');\n\t\t}\n\t\telse\n\t\t\tthrow new GraphModelException('A connection of type: ' . $this->type . ' already exists');\n\t\treturn $this;\n\t}", "public function add($data) {\n // any syntax\n }", "public function addProperty($properties, $key, $value)\n {\n if ($value) {\n $property = $properties->addChild('property');\n $this->appendCData($property->addChild('key'), $key);\n $this->appendCData($property->addChild('value'), $value);\n }\n }", "public function graph($resource)\n {\n }", "public function addProperty(PropertyDataInterface $property);", "public function addResource(ResourceInterface $resource, array $parentResources = array());", "public function add( string $resource, Field $field ): Collection;", "public function add(string $resource, string $resourceLang): void\n {\n /** @var array */\n $resourceData = require $resource;\n $this->translator->addResource('array', $resourceData, $resourceLang);\n }", "public function appendResource($resource) {\n if ($resource instanceof \\RASTER\\ResourceElementParent) {\n $resource->setParent($this->parent);\n array_push($this->children, $resource);\n } elseif (is_string($resource)) {\n array_push($this->children, \\RASTER\\ResourceBuilder::get($resource));\n } else {\n //error\n }\n return $this;\n }", "public function add_lines_property_object($data,$values) {\n $xml = '';\n if(is_array($values)){\n foreach ($values as $value) {\n $value = absint($value);\n if($value&&get_permalink($value)){\n $link = get_the_permalink($value);\n $xml .= '<'.$this->namespace.''.$data['slug'].' rdf:resource=\"'.htmlspecialchars($link).'\" />';\n // var_dump('<'.$this->namespace.''.$data['slug'].' rdf:about=\"'.get_permalink($value).'\" />');\n }\n }\n }\n return $xml;\n }", "function api_add_resource_nodes($resource,$nodestring)\n {\n if(!checkperm('a'))\n {return false;} \n $nodes = explode(\",\",$nodestring);\n return add_resource_nodes($resource,$nodes);\n }", "public function addProperty($property);", "public function add(ResourceInterface $resource, $files, $recursive = true);", "public function addResource($resourceValue, $accessList) {\n if(is_object($resourceValue)) {\n $this->_resourcesNames[$resourceValue->getName()] = 1;\n $this->_resources[] = $resourceValue;\n $resourceName = $resourceValue->getName();\n } else {\n $this->_resourcesNames[$resourceValue] = 1;\n $this->_resources[] = new Resource($resourceValue);\n $resourceName = $resourceValue;\n }\n $this->addResourceAccess($resourceName, $accessList);\n }", "protected function mergeResource($resource)\n {\n foreach ($resource as $property => $value) {\n $this->{$property} = $value;\n }\n }", "public function setResource($paramResource) {\n array_push($this->dataObjects, $paramResource);\n }", "public static function addResourceAssign($data) {\n\t\tif (!is_array($data)) return false;\n\t\t$temp = array();\n\t\tforeach ($data as $key => $value) {\n\t\t\t$temp[] = array('id' => '',\n\t\t\t 'series_id' => $value['series_id'],\n\t\t\t 'model_id' => $value['model_id'],\n\t\t\t 'resource_id' => intval($value['rid']),\n\t\t\t 'sort' => $value['sort']\n\t\t\t);\n\t\t}\n\t\t$ret = self::_getDao()->mutiInsert($temp);\n\t\tif (!$ret) return $ret;\n\t\treturn self::_getDao()->getLastInsertId();\n\t}", "public function addResource($resource, $accessList = null)\n {\n if (is_object($resource) === true &&\n $resource instanceof ResourceInterface === true) {\n $resourceName = $resource->getName();\n $object = $resource;\n } elseif (is_string($resource) === true) {\n $resourceName = $resource;\n $object = new Resource($resource);\n } else {\n throw new Exception('Invalid parameter type.');\n }\n\n if (isset($this->_resourcesNames[$resourceName]) === false) {\n $this->_resources[] = $object;\n $this->_resourcesNames[$resourceName] = true;\n }\n\n return $this->addResourceAccess($resourceName, $accessList);\n }", "public function addResource($resource)\n {\n /* Type check */\n if (is_object($resource) === false) {\n throw new Exception('Resource must be an object');\n }\n\n if (is_subclass_of($resource, '\\Phalcon\\Assets\\Resource') === false) {\n throw new Exception('Invalid parameter type.');\n }\n\n /* Add resource */\n $this->addResourceByType($resource->getType(), $resource);\n\n /* Return class */\n return $this;\n }", "public function addResource(ResourceInterface $resource): void;", "public function add($property) {\n return $this->addOperation($property, null, null);\n }", "public function register($name, $properties) {\n $this->_prop[$this->_path.$name]= $properties;\n }", "function add($name, $value)\n {\n $this->properties[$name] = $value;\n }", "protected function addNode($properties, $label=null){\n\t\t\t$node = $this->client->makeNode()->setProperties($properties)->save();\n \n if($label != null)\n $this->addLabel($node->getId(), $label);\n \n\t\t\treturn $node;\n\t\t}", "public function work_with_resource() {\n $resources = func_get_args();\n $this->resource = array_shift($resources);\n $this->path = \"\";\n $this->append_path($resources);\n }", "public function add(PropertyMetadata $property): void;", "public function addProperty($name, $value);", "public function add($data) {\n $this->data[$data->getID()] = $data;\n }", "public function add($data)\n {\n $model='Propertytype';\n $this->create();\n $ret=$this->save([$model=>$data]);\n $this->clear();\n return $ret[$model];\n }", "public function add($data=array()){\n\t\t\treturn $this->requestor->put(sprintf( $this->requests['add']['url'] , $this->accountid ),$data);\n\t\t}", "public function append($resource, $key, $value)\n {\n $lastChar = substr(file_get_contents($resource), -1);\n\n $prefix = \"\";\n if ($lastChar != \"\\n\" && $lastChar != \"\\r\" && strlen($lastChar) == 1) {\n $prefix = PHP_EOL;\n }\n\n $str = $prefix;\n if (is_array($value)) {\n if (isset($value['comments'])) {\n foreach ($value['comments'] as $val) {\n $str .= $val . PHP_EOL;\n }\n }\n $str .= $key . '=' . $value['name'];\n } else {\n $str .= $key . '=' . $value;\n }\n\n file_put_contents($resource, $str, FILE_APPEND);\n }", "public function appendProp($stream, $property, $data)\n {\n $value = NULL;\n $arr = $this->get($stream);\n\n if (isset($arr[$property])) {\n $value .= $data;\n } else {\n $value = $data;\n }\n\n return $this;\n }", "public function post($resource, array $data)\n {\n Util::throwIfNotType(array('string' => array($resource)), true);\n try {\n $url = \"{$this->_host}/{$this->_version}/\" . urlencode($resource);\n $json = json_encode($data);\n $headers = array('Content-Type' => 'application/json');\n return $this->_sendRequest($url, 'POST', $json, $headers);\n } catch (Exception $e) {\n throw new TOL_API_Exception('Unable to make request', 0, $e);\n }\n }", "function post($resource, $data) {\n\t\t\t$this->_auth();\n\t\t\treturn $this->_request('POST', $this->_resourcefix($resource), $data);\n\t\t}", "public function add(array $data);", "public function addResource(Resource $resource)\n {\n $this->resources[$resource->getName()] = $resource;\n return $this;\n }", "public function AddImage($resource)\r\n {\r\n if (gettype($resource) == \"object\") {\r\n $input = new ImageInput($resource);\r\n array_push($this->Inputs, $input);\r\n return $input;\r\n } else {\r\n $input = new ImageInput($resource);\r\n array_push($this->Inputs, $input);\r\n return $input;\r\n }\r\n }", "public function addData()\n {\n $this->addTo('data', func_get_args());\n }", "public static function append( $property, $value )\n {\n if ( isset( static::$data[ $property ] ) )\n {\n $value = array_merge( static::$data[$property], $value );\n }\n self::set( $property, $value );\n }", "function addResource($data) {\n\t\tglobal $user;\n\n\t\t$ownerid = getUserlistID($data['owner']);\n\t\t$query = \"INSERT INTO schedule \"\n\t\t . \"(name, \"\n\t\t . \"ownerid) \"\n\t\t . \"VALUES ('{$data['name']}', \"\n\t\t . \"$ownerid)\";\n\t\tdoQuery($query);\n\n\t\t$rscid = dbLastInsertID();\n\t\tif($rscid == 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$query = \"INSERT INTO resource \"\n\t\t\t\t . \"(resourcetypeid, \"\n\t\t\t\t . \"subid) \"\n\t\t\t\t . \"VALUES (15, \"\n\t\t\t\t . \"$rscid)\";\n\t\tdoQuery($query, 223);\n\t\n\t\treturn $rscid;\n\t}", "public function resource($resource)\n {\n // TODO: Implement resource() method.\n }", "public function setResource($resource);", "public function addProperties(\\google\\cloud\\vision\\v1\\Property $value){\n return $this->_add(9, $value);\n }", "static public function addResource(Kronolith_Resource_Base $resource)\n {\n // Create a new calendar id.\n $calendar = uniqid(mt_rand());\n $resource->set('calendar', $calendar);\n $driver = Kronolith::getDriver('Resource');\n\n return $driver->save($resource);\n }", "public function create(array $properties = []);", "public function addProperty($property, $content)\n {\n $this->metas->addOne($property, $content);\n\n return $this;\n }", "public function registerOpenGraph($property, $data)\n {\n if (in_array($property, array('app_id','admins'))) {\n $property = 'fb:' . $property;\n } else {\n $property = 'og:' . $property;\n }\n Yii::app()->clientScript->registerMetaTag($data, null, null, array('property' => $property));\n }", "function api_add_resource_nodes_multi($resources,$nodestring)\n {\n if(!checkperm('a'))\n {return false;} \n $resourcearr = explode(\",\",$resources);\n $nodes = explode(\",\",$nodestring);\n return add_resource_nodes_multi($resourcearr,$nodes);\n }", "public function addParameter($property, $value)\n\t{\n\t\t$this->parameters[$property] = $value;\n\t\treturn $this;\n\t}", "public function createResource(Resource $resource);", "public function addItem( Ui_Crafts_Item &$item, $properties=array() ){\n\t\t\n\t\tif( $this->items == null ) $this->items = array();\n\t\t\n\t\t$varname = str_replace(\"-\",\"_\",$item->id);\n\t\t$this->items[ $varname ] =& $item;\n\t\t\n\t\tforeach( $properties as $key => $value )\n\t\t\t$this->items[ $varname ]->$key = $value;\n\t\t\n\t\t\n\t\t$this->$varname =& $this->items[ $varname ];\n\t}", "public function setResource( $data ){\n\t\t$this->data = $data;\n\t}", "public function addResource(ResourceInterface $resource)\n {\n $this->resources[] = $resource;\n }", "private function addObjectProperty($propertyiri,$objectiri){\n\t\t$propertyEl=$this->xmlDocument->createElement($propertyiri);\n\t\t$this->xmlElement->appendChild($propertyEl);\n\t\t$propertyEl->setAttribute('rdf:resource',$objectiri);\n\t}", "public function add($resources, $options = array())\n {\n $postData = $this->getPostData('add');\n\n list($single, $data, $resultCollection) = $this->prepareNormalizedData($resources, false);\n\n if (count($data) > 0) {\n $postData['parameters'] = $data;\n $postData['options'] = $options;\n $result = $this->client->call($postData);\n if (!$this->multiFieldPrimary) {\n foreach ($result[$this->getUnderscoreString($this->getPkField())] as $no => $id) {\n\n $resultCollection[$no]->{'set' . ucfirst($this->getPkField())}($id);\n $resultCollection[$no]->clearDirty();\n }\n }\n }\n\n return $this->conditionalReturn($single, $resultCollection);\n }", "public function addProperty(Property $property)\n {\n $this->properties[(string)$property->getFqsen()] = $property;\n }", "public function add_lines_property_data($data,$values) {\n $xml = '';\n if(in_array($data['type'], ['numeric','number','auto-increment','int']))\n $datatype = 'http://www.w3.org/2001/XMLSchema#integer';\n elseif(in_array($data['type'], ['date']))\n $datatype = 'http://www.w3.org/2001/XMLSchema#date'; \n elseif(in_array($data['type'], ['text','textarea']))\n $datatype = 'http://www.w3.org/2001/XMLSchema#string'; \n else\n $datatype = 'http://www.w3.org/2001/XMLSchema#'.$data['type']; \n if(is_array($values)){\n foreach ($values as $value) {\n if($value&&trim($value)!==''){\n $xml .= '<'.$this->namespace.''.$data['slug'].' rdf:datatype=\"'.$datatype.'\">'\n . $value\n . '</'.$this->namespace.''.$data['slug'].'>';\n }\n }\n }\n return $xml;\n }", "public function add($data){\n\t\t$session = new Session();\n\t\t$userId = $session->currentId();\n\t\tif($userId != false){\n\t\t\t//insert fq into database\n\t\t\t$uniqueId = uniqid();\n\t\t\t$response = $this->client->batchWriteItem(array(\n\t\t\t\t\"RequestItems\" => array(\n\t\t\t\t\t\"Links\" => array(\n\t\t\t\t\t\t array(\n\t\t\t\t\t\t\t\"PutRequest\" => array(\n\t\t\t\t\t\t\t\t\"Item\" => array(\n\t\t\t\t\t\t\t\t\t\"LinkId\"\t=> array(Type::STRING => $uniqueId),\n\t\t\t\t\t\t\t\t\t\"UserId\"\t=> array(Type::NUMBER => $userId),\n\t\t\t\t\t\t\t\t\t\"Text\"\t\t=> array(Type::STRING => htmlspecialchars($data[\"Text\"])),\n\t\t\t\t\t\t\t\t\t\"Url\"\t\t=> array(Type::STRING => htmlspecialchars($data[\"Url\"]))\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t));\n\t\t\t$this->LinkId = $uniqueId;\n\t\t\t$this->UserId = $userId;\n\t\t\t$this->Text = htmlspecialchars($data[\"Text\"]);\n\t\t\t$this->Url = htmlspecialchars($data[\"Url\"]);\n\n\t\t\treturn $this;\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function addField($name, array $properties) {\n $this->form[$name] = $properties;\n $this->formState['count']++;\n return $this;\n }", "public function addResourceByType($type, $resource)\n {\n /* Type check */\n if (is_string($type) === false) {\n throw new Exception('Invalid parameter type.');\n }\n\n if (is_object($resource) === false ||\n is_subclass_of($resource, '\\Phalcon\\Assets\\Resource') === false) {\n throw new Exception('Invalid parameter type.');\n }\n\n /* Add to collection */\n if (isset($this->_collections[$type]) === false) {\n $this->_collections[$type] = new Collection();\n }\n\n $this->_collections[$type]->add($resource);\n\n /* Return class */\n return $this;\n }", "function put($resource, $data) {\n\t\t\t$this->_auth();\n\t\t\treturn $this->_request('PUT', $this->_resourcefix($resource), $data);\n\t\t}", "public function addProperty(array $args=[])\n {\n if (empty($args['name']) || empty($args['type'])) {\n throw new Exception('You need to specify at least a name and type for each property');\n }\n $this->args['propertyargs'][] = $args;\n }", "public static function collection($resource, array $additional_data = []){\n return parent::collection($resource)->additional($additional_data);\n }", "public function addResource(FedoraResource $res): WebAclRule {\n $uri = $res->getUri(true);\n if (!isset($this->resources[$uri])) {\n $this->resources[$uri] = $res;\n }\n return $this;\n }", "public static function add_parent($resource) {\n $attributes = get_object_vars($resource);\n\n foreach ($attributes as $key => $value) {\n $parent = strstr($key, '_id', true);\n\n if ($parent) {\n $parents = StringHelper::pluralize($parent);\n return \"/$parents/$value\";\n }\n }\n }", "protected function addResource($path, FilesystemResource $resource)\n {\n // Don't modify resources attached to other repositories\n if ($resource->isAttached()) {\n $resource = clone $resource;\n }\n\n $resource->attachTo($this, $path);\n\n $this->store->set($path, $resource->getFilesystemPath());\n }", "public function addPropertyMetadata(PropertyMetadata $metadata): void\n {\n $this->properties[$metadata->name] = $metadata;\n }", "public function __construct($properties = array()){\n\t\t$this->_data = $properties;\n\t}", "public function add($data)\n {\n $node = new Node($data);\n return $this->addNode($node);\n }", "public function addProperties( $properties ) {\n\t\t$properties = (array) $properties;\n\n\t\tforeach ( $properties as $property ) {\n\t\t\t$this->addProperty( $property );\n\t\t}\n\t\treturn $this;\n\t}", "public function AddAdditionalResource(string $resource, AdditionalResourceType $additionalResourceType, string $resourceName = null)\r\n {\r\n if (gettype($resource) == \"string\") {\r\n if ($resourceName == null)\r\n $resourceName = basename($resource);\r\n $additionalResource = new AdditionalResource($resource, $resourceName);\r\n array_push($this->Resources, $additionalResource);\r\n } else {\r\n $type = ResourceType::Pdf;\r\n switch ($additionalResourceType) {\r\n case AdditionalResourceType::Font:\r\n $type = ResourceType::Font;\r\n break;\r\n case AdditionalResourceType::Image:\r\n $type = ResourceType::Image;\r\n break;\r\n case AdditionalResourceType::Pdf:\r\n $type = ResourceType::Pdf;\r\n break;\r\n case AdditionalResourceType::Html:\r\n $type = ResourceType::Html;\r\n break;\r\n }\r\n $additionalResource = new AdditionalResource($resource, $resourceName, $type);\r\n array_push($this->Resources, $additionalResource);\r\n }\r\n }", "public function add($key, $data);", "public function add (array $arr_properties) \n\t{\n\t\t$arr_properties = $this->filter_allowed_fields($arr_properties);\n\t\t$arr_properties = $this->filter_required_fields($arr_properties);\n\t\t$this->array_to_this($arr_properties);\n\n\t\t$this->registration_date = NOW();\n\t\t$this->registration_ip = ip2long($_SERVER['REMOTE_ADDR']);\n\t\t$this->activation_code = \"000000000000\";\n\n\t\tif ($this->is_error()) throw new ValidationException($this);\n\t\treturn $this->__save();\n\t}", "public function setResource($resource) {\n $this->resource = $resource;\n }", "public function created(Resource $resource)\n {\n //\n }", "public function addCDATA(array $properties);", "public function add_meta(&$data, $meta);", "public function addField( $id, $properties ) {\r\n\r\n\t\t$this->form_fields[ $id ] = $this->combine_properties(\r\n\t\t\tarray(\r\n\t\t\t\t'id'\t\t\t=> $id,\r\n\t\t\t\t'type'\t\t\t=> null,\r\n\t\t\t\t'name'\t\t\t=> null,\r\n\t\t\t\t'class'\t\t\t=> null,\r\n\t\t\t\t'value'\t\t\t=> null,\r\n\t\t\t\t'values'\t\t=> array(),\r\n\t\t\t\t'attributes'\t=> array(),\r\n\t\t\t\t'placeholder'\t=> null,\r\n\t\t\t\t'required'\t\t=> false,\r\n\t\t\t\t'before'\t\t=> null,\r\n\t\t\t\t'after'\t\t\t=> null,\r\n\t\t\t),\r\n\t\t\t$properties\r\n\t\t);\r\n\t}", "public function addFilter($name, $properties)\n {\n $this->filters[$name] = $properties;\n }", "public function appendToResourcePath($resources)\n {\n if ( is_array($resources) )\n {\n foreach( $resources as $resource )\n {\n $this->appendToResourcePath($resource);\n }\n }\n else\n {\n $this->resource_path = sprintf(\"%s/%s\", $this->resource_path, $resources);\n }\n\n return $this;\n }", "public function post($resource, $body, $params);", "public function AddProperty(Property $property)\n\t\t{\n\t\t\tCheck::IsNullOrEmpty($property);\n\t\t\t$this->properties[$property->getName()] = $property;\n\t\t}" ]
[ "0.62350816", "0.6176926", "0.5929968", "0.586986", "0.57790095", "0.57280034", "0.571163", "0.56986815", "0.56458133", "0.5614286", "0.5552395", "0.54979485", "0.5479118", "0.54620063", "0.5456615", "0.54411787", "0.54411787", "0.54403836", "0.54199725", "0.5401299", "0.5349751", "0.5337939", "0.52680933", "0.5254501", "0.5249323", "0.5245635", "0.5222373", "0.52047", "0.5187358", "0.5168041", "0.5136135", "0.5134612", "0.51178867", "0.51152366", "0.50982946", "0.5090184", "0.50783855", "0.5071493", "0.5069903", "0.5059692", "0.50506884", "0.5033411", "0.50212926", "0.50034714", "0.498949", "0.49815723", "0.49729002", "0.4971757", "0.49644127", "0.49423662", "0.49355716", "0.49304998", "0.49304008", "0.49258864", "0.49130687", "0.48915225", "0.48910695", "0.48682737", "0.48593834", "0.48555845", "0.4851702", "0.48341405", "0.4817883", "0.48146585", "0.48128435", "0.47993952", "0.47924295", "0.47794846", "0.47670215", "0.4765271", "0.4759279", "0.4751118", "0.47440833", "0.47431284", "0.47202218", "0.4719058", "0.47183317", "0.47135755", "0.47063497", "0.4700203", "0.46976438", "0.4687252", "0.46862322", "0.46835852", "0.46743047", "0.4669217", "0.46647862", "0.4643688", "0.46359962", "0.46146482", "0.46115497", "0.46061113", "0.46053064", "0.46012625", "0.46004137", "0.45966405", "0.45876163", "0.4577636", "0.4564932", "0.45504892" ]
0.760012
0
Get the resource type of the graph The type will be a shortened URI as a string. If the graph has multiple types then the type returned may be arbitrary. This method will return null if the resource has no type.
Получите тип ресурса графа. Тип будет представлен как сокращённый URI в виде строки. Если граф имеет несколько типов, то возвращённый тип может быть произвольным. Этот метод вернёт null, если у ресурса нет типа.
public function type() { if ($this->_uri) { $res = $this->resource($this->_uri); return $res->type(); } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function typeResource()\n {\n return $this->get('rdf:type');\n }", "public function type()\n {\n $uri = $this->get('rdf:type');\n if ($uri) {\n return EasyRdf_Namespace::shorten($uri);\n } else {\n return null;\n }\n }", "public function getResourceType()\n {\n return $this->resource_type;\n }", "public function getResourceType()\n {\n return $this->resource_type;\n }", "public function getResourceType()\n {\n return $this->resource_type;\n }", "public function getResourceType()\n {\n return $this->resource_type;\n }", "protected function getType(): string\n {\n return 'resource';\n }", "public function getResourceType()\n {\n $resourceType = 'items';\n if (in_array($this->getOption('query_resource_type'), ['items', 'item_sets', 'media'])) {\n $resourceType = $this->getOption('query_resource_type');\n }\n return $resourceType;\n }", "public function getType($resourceType);", "protected function getType()\n {\n return 'resources';\n }", "public function getResourceType()\n {\n return $this->getProperty(\"resourceType\");\n }", "public function getResourceType()\n {\n return $this->resourceType;\n }", "public function getTypeAttribute() {\n return $this->resourceable->getTypeAttribute();\n }", "public function getResourceType(): string;", "public function getType()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'type'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'type'];\n\t\t}\n\n\t\treturn null;\n\t}", "public function getType(): ?string\n {\n $data = $this->getFirst();\n return $data['type'] ?? null;\n }", "public function getResourceType(): ?string {\n $val = $this->getBackingStore()->get('resourceType');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'resourceType'\");\n }", "public static function get_type();", "public function getResourceType()\n\t{\n\t\treturn str_replace( '.', '/', rtrim( $this->prefix, '.' ) );\n\t}", "public function getType()\n\t{\n\t\t$arr = self::getTypes();\n\t\treturn isset( $arr[ $this->Type ] ) ? $arr[ $this->Type ] : null;\n\t}", "public function getType()\n {\n $type = $this->get('type');\n return $type;\n }", "public function getType(): ?string\n {\n $this->deprecated('getType() on Connection is deprecated.');\n return $this->stream->getResourceType();\n }", "public function get_resource_type($resource) {\n\t\t// mysql result resource type\n\t\tif (is_object($resource) && $resource instanceof PDOStatement) {\n\t\t\treturn 'mysql result';\n\t\t}\n\n\t\t// Check if it is a mysql instance\n\t\tif (isset($this->connections[$resource]) && !empty($this->connections[$resource])) {\n\t\t\t// Check type\n\t\t\tif ($this->_params[$resource]['clientFlags'] == PDO::ATTR_PERSISTENT){\n\t\t\t\treturn 'mysql link persistent';\n\t\t\t} else {\n\t\t\t\treturn 'mysql link';\n\t\t\t}\n\t\t}\n\n\t\treturn get_resource_type($resource);\n\t}", "protected function _getType()\n {\n if (is_null($this->_type)) {\n $this->_type = $this->_request->getParam('type');\n\n // Default type.\n if (empty($this->_type)) {\n $this->_type = 'original';\n }\n }\n\n return $this->_type;\n }", "protected function getType()\n {\n return $this->typesRegistry->get($this->type());\n }", "public function getType() {\n return $this->_type ?: self::ALSO;\n }", "public function getType()\n {\n if (! isset($this->type)) {\n $this->type = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getTypeQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->type;\n }", "public function get_type();", "public function getType()\n {\n if (array_key_exists(\"type\", $this->_propDict)) {\n if (is_a($this->_propDict[\"type\"], \"\\Microsoft\\Graph\\Model\\RecurrenceRangeType\") || is_null($this->_propDict[\"type\"])) {\n return $this->_propDict[\"type\"];\n } else {\n $this->_propDict[\"type\"] = new RecurrenceRangeType($this->_propDict[\"type\"]);\n return $this->_propDict[\"type\"];\n }\n }\n return null;\n }", "public function getType()\n {\n return $this->get(self::TYPE);\n }", "public function getType()\n {\n return $this->guessType();\n }", "public function getType()\n {\n return isset($this->Type) ? $this->Type : null;\n }", "public function getType()\n {\n return isset($this->Type) ? $this->Type : null;\n }", "public static function getResourceType($item)\n {\n $class = is_string($item) ? $item : get_class($item);\n return !empty(self::getResourceConfig($class)['type']) ? self::getResourceConfig($class)['type'] : null;\n }", "public function getRoutingType()\n {\n if (array_key_exists(\"routingType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"routingType\"], \"\\Beta\\Microsoft\\Graph\\Model\\RoutingType\") || is_null($this->_propDict[\"routingType\"])) {\n return $this->_propDict[\"routingType\"];\n } else {\n $this->_propDict[\"routingType\"] = new RoutingType($this->_propDict[\"routingType\"]);\n return $this->_propDict[\"routingType\"];\n }\n }\n return null;\n }", "public static function getType();", "public static function getType();", "private function getType()\n {\n return Request::has('type') ? (string) Request::get('type') : null;\n }", "public function getType() {\n\t\treturn isset($this->attributes['type'])?$this->attributes['type']:null;\n\t}", "public function getType()\n {\n $this->loadManyToOne('type');\n return $this->type;\n }", "protected function getResourceType($type)\n {\n if (!$resourceType = $this->resolver->getResourceType($type)) {\n throw new RuntimeException(\"No JSON API resource type registered for PHP class {$type}.\");\n }\n\n return $resourceType;\n }", "public function type(): string\n {\n return $this->metadata['type'];\n }", "public function getResource()\n {\n if (is_null($this->resource)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_RESOURCE);\n if (is_null($data)) {\n return null;\n }\n $className = ReferenceModel::resolveDiscriminatorClass($data);\n $this->resource = $className::of($data);\n }\n\n return $this->resource;\n }", "public abstract function getType();", "public abstract function getType();", "public function getType()\n\t{\n\t\tinclude_once(DIR . 'libs/repositories/types.php');\n\n\t\treturn Types::Find($this->getTypeCode());\n\t}", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType(): string\n {\n return $this->type;\n }", "public function getType()\n {\n return Type::findOne($this->type_id);\n }", "function getResourceTypeId()\n {\n return (int) $this->_iResourceTypeId;\n }", "public function getType() : ?string\n {\n return $this->getAttribute('type');\n }", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();" ]
[ "0.77061266", "0.76090807", "0.70331186", "0.70331186", "0.70331186", "0.70331186", "0.7031475", "0.68598145", "0.68367743", "0.67218286", "0.66564316", "0.65218204", "0.65001655", "0.6293105", "0.626882", "0.6234318", "0.6219325", "0.61853695", "0.6174365", "0.6147742", "0.6139458", "0.6120174", "0.6119269", "0.6094398", "0.6076643", "0.60555136", "0.6051225", "0.6039056", "0.6006364", "0.597945", "0.5953037", "0.5952734", "0.5952734", "0.5946457", "0.5936027", "0.591712", "0.591712", "0.59170735", "0.5914396", "0.588625", "0.58844995", "0.5880578", "0.5875973", "0.587041", "0.587041", "0.5867806", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.58636165", "0.5849966", "0.5843293", "0.5841481", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386", "0.5821386" ]
0.7776447
0
Get the primary topic of the graph
Получить основную тему графа
public function primaryTopic() { if ($this->_uri) { return $this->resource($this->_uri)->primaryTopic(); } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function primaryTopic()\n {\n return $this->get(\n array('foaf:primaryTopic', '-foaf:isPrimaryTopicOf')\n );\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getTopic()\r\n {\r\n return $this->topic;\r\n }", "public function getTopic()\n {\n return isset($this->topic) ? $this->topic : null;\n }", "public function getTopic();", "public function getId_topic()\n {\n return $this->id_topic;\n }", "public function getTopic()\n {\n return $this->data['topic']['value'];\n }", "public function getTopic()\n {\n\n return $this->hasOne(Topics::className(), ['topic_id' => 'topic_id']);\n\n }", "public function getTopicId() {\n\t\treturn $this->topicId;\n\t}", "public function getTopic()\n {\n if(!$this->topic) {\n $this->topic = TopicModel::findById($this->getTopicId());\n }\n return $this->topic;\n }", "public function topic(): ?string\n {\n return $this->header('topic');\n }", "public function getTopicId()\n {\n return (int)$this->topic_id;\n }", "public function getTopicName(): string\n {\n return $this->topic->getTopicName();\n }", "function getTopicName();", "public function getTopicName()\n {\n return $this->topicName;\n }", "public function getTopicName();", "public function getTopicAttribute()\n {\n return $this->objective->topic;\n }", "public function getTopic() {\n\t\t$result = '';\n\t\tif ($this->getAccount()) {\n\t\t\t$result = $this->getAccount()->getName() . ' (Account)';\n\t\t} elseif ($this->getContact()) {\n\t\t\t$result = $this->getContact()->getDisplayName() . ' (Contact)';\n\t\t} elseif ($this->getOpportunity()) {\n\t\t\t$result = $this->getOpportunity()->getName() . ' (Opportunity)';\n\t\t} elseif ($this->getLead()) {\n\t\t\t$result = $this->getLead()->getFullName() . ' (Lead)';\n\t\t}\n\t\treturn $result;\n\t}", "public function getSubTopicId()\r\n\r\n\t{\r\n\r\n\t\treturn $this->subTopicId;\r\n\r\n \t}", "public function getVotingTopic()\r\n\r\n\t{\r\n\r\n\t\treturn $this->votingTopic;\r\n\r\n \t}", "public function getVotingTopicId()\r\n\r\n\t{\r\n\r\n\t\treturn $this->votingTopicId;\r\n\r\n \t}", "function denora_get_chan_topic($chan)\n{\n\tglobal $denora_chan_db;\n\t\n\tif (check_channel($chan) < 2)\n\t\treturn 0;\n\t\n\t$query = sql_query(\"SELECT topic,topictime,topicauthor FROM $denora_chan_db WHERE BINARY LOWER(channel)=LOWER('\".sql_escape_string($chan).\"')\");\n\t$data = sql_fetch_array($query);\n\treturn ($data ? $data : NULL);\n}", "public function getTopicClass();", "public function getFirstPostId($topicId);", "public function topic()\n {\n return $this->belongsTo('App\\Topic', 'topic_id');\n }", "public function getTopicByNodeId($treeId,$nodeId)\r\n\r\n\t{\r\n\r\n\t\r\n\r\n\t \r\n\r\n\t\t$topic\t= '';\t\r\n\r\n\t\t$query = $this->db->query(\"SELECT a.contents FROM teeme_leaf a, teeme_node b WHERE b.leafId = a.id AND b.id = \".$nodeId.\" and b.treeIds=\".$treeId);\r\n\r\n\t\tforeach($query->result() as $chatData)\r\n\r\n\t\t{\r\n\r\n\t\t\t$topic = $chatData->contents;\r\n\r\n\t\t}\r\n\r\n\t\treturn $topic;\t\t\r\n\r\n\t}", "public function getLastTopic()\n {\n return $this->lastTopic;\n }", "public function getName()\n {\n return 'publications.topic';\n }", "public function topic()\n {\n return $this->belongsTo( 'App\\Topic' );\n }", "function getPostTopic($post_id){\n\tglobal $conn;\n\t$sql = \"SELECT * FROM topics WHERE id=\n\t\t\t(SELECT topic_id FROM post_topic WHERE post_id=$post_id) LIMIT 1\";\n\t$result = mysqli_query($conn, $sql);\n\t$topic = mysqli_fetch_assoc($result);\n\treturn $topic;\n}", "public function getTopicPath()\n {\n return $this->topic_path;\n }", "public function getIsTopic()\n {\n return $this->isTopic;\n }", "public function getTopicField()\r\n {\r\n return $this->topicField;\r\n }", "public function topic()\n {\n return $this->belongsTo('App\\Topic');\n }", "function get_primary_category_id() {\n\treturn get_primary_term_id( 'category' );\n}", "function get_topic_slug($comment_id)\n\t{\n\t\t//could be used to get the selected tab of ug articles\n\t}", "public static function get_topic($topic_id = 1) {\n global $wpdb;\n $query = \"SELECT\n t_topics.id,\n t_topics.forum_id,\n t_topics.title,\n t_topics.created_at,\n t_users.username AS author,\n t_forums.name AS subforum \n FROM SPF_TOPICS AS t_topics \n INNER JOIN SPF_ACCOUNTS AS t_users \n ON t_topics.author_id = t_users.id \n INNER JOIN SPF_FORUMS AS t_forums \n ON t_topics.forum_id = t_forums.id \n WHERE t_topics.id = '{$topic_id}'\";\n return $wpdb->get_row($query);\n }", "function getPostTopic($post_id) {\r\n global $conn;\r\n $sql = \"SELECT * FROM topics WHERE id=\r\n (SELECT topic_id FROM post_topic WHERE post_id=$post_id) LIMIT 1\";\r\n $result = mysqli_query($conn, $sql);\r\n $topic = mysqli_fetch_assoc($result);\r\n return $topic;\r\n }", "function get_topic_forum($topicid) {\n $res = mysql_query(\"SELECT forumid FROM forum_topics WHERE id=$topicid\");\n if (mysql_num_rows($res) != 1)\n return false;\n $arr = mysql_fetch_row($res);\n return $arr[0];\n}", "public function getTopicValue()\n {\n return $this->topicValue;\n }", "function get_topic_forum($topicid)\n {\n $res = mysql_query(\"SELECT forumid FROM topics WHERE id=$topicid\") or sqlerr(__FILE__, __LINE__);\n\n if (mysql_num_rows($res) != 1)\n return false;\n\n $arr = mysql_fetch_row($res);\n\n return $arr[0];\n }", "function extract_topic_identifier($full_text)\n{\n\t$matches=array();\n\tif (preg_match('#: \\#(.*)$#',$full_text,$matches)!=0)\n\t{\n\t\treturn $matches[1];\n\t}\n\treturn $full_text;\n}", "public function exchangeTopic(): string\n {\n return $this->exchangeName;\n }", "function getPostTopic($post_id){\n global $conn;\n $sql = \"SELECT * FROM topics WHERE id = (SELECT topic_id FROM posts_topics WHERE post_id = $post_id) LIMIT 1\";\n $result = mysqli_query($conn , $sql);\n $topic = mysqli_fetch_assoc($result)['name'];\n return $topic;\n}", "public function getBaseTopicName() {\r\n\t\tif ( preg_match( '/' . PONYDOCS_DOCUMENTATION_PREFIX . '(.*):(.*):(.*):(.*)/i', $this->pTitle->__toString(), $match ) ) {\r\n\t\t\treturn sprintf( PONYDOCS_DOCUMENTATION_PREFIX . '%s:%s:%s', $match[1], $match[2], $match[3] );\r\n\t\t}\r\n\r\n\t\treturn '';\r\n\t}", "function getFilmTopic($film_id){\n\tglobal $con;\n\t$sql = \"SELECT * FROM film WHERE id=\n\t\t\t(SELECT filmtopic_id FROM film_topic WHERE film_id=$film_id) LIMIT 1\";\n\t$result = mysqli_query($con, $sql);\n\t$topic = mysqli_fetch_assoc($result);\n\treturn $topic;\n}", "public function get_topic($context = 'view')\n {\n }", "public function getSubTopicText()\r\n\r\n\t{\r\n\r\n\t\treturn $this->subTopicText;\r\n\r\n \t}", "public function get_cloning_object(): string {\n\t\t\treturn 'topic';\n\t\t}", "public function topic()\n {\n return $this->belongsTo('App\\Topic');\n }", "public function getName()\n {\n return 'agil.topic';\n }", "function get_topic_id(){\n // get :topic_id from URL and assign to $topic_id\n $topic_id = $this->passedArgs[ 'topic_id' ];\n // check topic_id valid ?\n $options['conditions'] = array('ForumTopic.id' => $topic_id);\n // get topic count\n $count = $this->ForumCategory->ForumTopic->find('count', $options);\n \n //debug( $count );\n if( $count == 0 ){\n $this->Session->setFlash('Invalid Topic'); // set error title\n $this->redirect( $this->referer() ); // redirect to previous page\n } // check \n \n return $topic_id;\n }", "public function get_topic(){\n if($this->tab&&$this->tab!=='all'){\n switch($this->tab){\n case 'following-member':\n $this->load->model('follow');\n $this->topics = $this->follow->get_following_user_stream($this->curr_user['user_id'], false, 1, $this->limit);\n break;\n\n case 'following-node':\n $this->load->model('nodes');\n $following_nodes = $this->user->get_user_fav_node($this->curr_user['user_id']);\n $this->topics = $this->nodes->get_user_fav_node_post($this->curr_user['user_id'], 1, $this->limit, false, 'post_last_comment');\n $this->s->assign('links',$following_nodes);\n break;\n\n case 'hot':\n $query_string=\"order_by=post_comment_no&no={$this->limit}&all=0\";\n $this->topics=$this->post->query_post($query_string);\n break;\n }\n }else{\n $query_string=\"order_by=post_last_comment&no={$this->limit}&all=0\";\n $this->topics=$this->post->query_post($query_string);\n }\n return $this->topics;\n }", "public function getTopic($topicID) {\n return $this->db->get_row($this->db->prepare(\"SELECT * FROM {$this->tables->topics} WHERE id = %d;\", $topicID));\n }", "public function getPrimary()\n {\n return $this->primary;\n }", "public function getPrimary()\n {\n return $this->primary;\n }", "public function getPrimary()\n {\n return $this->primary;\n }", "public function getPrimary()\n {\n return $this->primary;\n }", "public function getPrimary()\n {\n return $this->primary;\n }", "public function url_topic($topic_id)\n\t{\n\t\treturn (sid(FSB_PATH . 'index.' . PHPEXT . '?p=topic&amp;t_id=' . $topic_id));\n\t}", "public function getTopic($queue)\r\n {\r\n return $this->producer->newTopic($queue);\r\n }", "public static function getTopicByForumId($catid)\r\n {\r\n return QueryBuilder::table('cms_forum_topics')->setFetchMode(PDO::FETCH_CLASS, get_called_class())->where('id', $catid)->where('is_visible', 1)->first();\r\n }", "public function getTopicPost()\n\t{\n\t\treturn Warecorp_DiscussionServer_Post::findTopicPartByTopicId($this->getId());\n\t}", "public function getKnowledgeGraphId()\n {\n return $this->knowledge_graph_id;\n }", "function getTopicNameById($id)\n{\n\tglobal $conn;\n\t$sql = \"SELECT name FROM topics WHERE id=$id\";\n\t$result = mysqli_query($conn, $sql);\n\t$topic = mysqli_fetch_assoc($result);\n\treturn $topic['name'];\n}", "public function getHelpPageTitle($topic) {\n return ucfirst(str_replace('-', ' ', $topic));\n }", "public function topic()\n {\n $res = JPushTool::getInstance()->sendMessageByAlias('869455045163868','消息','设备配置信息',array('type'=>40,'topic'=>'12312','serialNo'=>'1213'));\n dump($res);\n }", "public function show($id)\n {\n $topic = Topic::findOrFail($id);\n\n return $topic;\n }", "static function get_primary_category_id() {\n if (empty(self::$post->ID)) {\n return get_queried_object_id();\n }\n return self::$primary_category;\n }", "public function getPrimary() {\n \treturn $this->_primary;\n }", "public function getPrimary()\n {\n return $this->get(self::PRIMARY);\n }", "public function getPrimary();", "public function get_primary_term() {\n $primary_term = get_post_meta( $this->getPostId(), PRIMARY_TERM, true );\n $terms = wp_get_object_terms( $this->getPostId(), $this->getTaxonomyName() );\n\n if ( ! is_array( $terms ) ) {\n $terms = [];\n }\n\n if ( ! in_array( $primary_term, wp_list_pluck( $terms, 'term_id' ), true ) ) {\n $primary_term = false;\n }\n\n $primary_term = (int) $primary_term;\n\n return $primary_term ? $primary_term : false;\n }", "function getTopicFullInfo($topic_id)\n {\n $DBC = DBC::getInstance();\n $query = 'SELECT * FROM ' . DB_PREFIX . '_topic WHERE id=? LIMIT 1';\n $stmt = $DBC->query($query, array($topic_id));\n if ($stmt) {\n $ar = $DBC->fetch($stmt);\n return $ar;\n }\n return array();\n }", "public function getName()\n {\n return 'acme.topic';\n }", "public function hasTopic(){\n return $this->_has(1);\n }", "public function hasTopic(){\n return $this->_has(1);\n }", "public function primary(): string\n {\n // If we have it manually defined use it,\n // otherwise default to 'id'.\n return $this->primary ?? 'id';\n }", "function getTopicNameById($id)\n{\n\tglobal $con;\n\t$sql = \"SELECT name FROM filmtopics WHERE id=$id\";\n\t$result = mysqli_query($con, $sql);\n\t$topic = mysqli_fetch_assoc($result);\n\treturn $topic['name'];\n}", "public function getSubject () {\n\t\t$subject = $this->getSubjects();\n\t\tif ($subject) {\n\t\t\t$subject = $subject[0];\n\t\t}\n\n\t\treturn $subject;\n\t}", "function find_topic_id_for_topic_identifier($forum,$topic_identifier)\n\t{\n\t\tif (is_integer($forum)) $forum_id=$forum;\n\t\telse $forum_id=$this->forum_id_from_name($forum);\n\t\treturn $this->connection->query_value_null_ok_full('SELECT t.id_topic FROM '.$this->connection->get_table_prefix().'topics t LEFT JOIN '.$this->connection->get_table_prefix().'messages p ON t.id_first_msg=p.id_msg WHERE t.id_board='.strval((integer)$forum_id).' AND ('.db_string_equal_to('subject',$topic_identifier).' OR subject LIKE \\'%: #'.db_encode_like($topic_identifier).'\\')');\n\t}", "public function getPrimary(): string;", "function getPrimaryProject($client) {\n\t\tglobal $synd_maindb, $synd_user;\n\t\t$sql = \"\n\t\t\tSELECT p.node_id FROM synd_relation r, synd_project p\n\t\t\t\tLEFT JOIN synd_issue i\n\t\t\t\tON (\n\t\t\t\t\ti.parent_node_id = p.node_id AND \n\t\t\t\t\ti.ts_create > \".strtotime('-1 month').\" AND\n\t\t\t\t\t(i.create_node_id = \".$synd_maindb->quote($synd_user->nodeId).\" OR \n\t\t\t\t\t i.client_node_id = \".$synd_maindb->quote($client->nodeId).\"))\n\t\t\tWHERE \n\t\t\t\tr.parent_node_id = p.node_id AND\n\t\t\t\tr.child_node_id = \".$synd_maindb->quote($synd_user->nodeId).\"\n\t\t\tGROUP BY p.node_id\n\t\t\tORDER BY COUNT(i.node_id) DESC\";\n\t\tif (null != ($project = SyndNodeLib::getInstance($synd_maindb->getOne($sql))))\n\t\t\treturn $project;\n\n\t\t$projects = $this->getProjectOptions($client, 'read');\n\t\tif (!empty($projects))\n\t\t\treturn $projects[key($projects)];\n\n\t\treturn SyndNodeLib::getInstance('null.null');\n\t}", "protected function SingularName() {\n\treturn 'vcqrTopicInfo';\n }", "public function topicPage() {\n return $this->menuLandingPage('main', 'sw.topic');\n }", "public function getPrimary()\n {\n $primaries = $this->all(BaseIndexableConstraint::PRIMARY);\n\n if (\\count($primaries)) {\n return $primaries[0];\n }\n\n return null;\n }", "function get_the_primary_category() {\n global $post;\n\n $id = get_the_ID();\n $cat_count = count( get_the_category( $id ) );\n\n if ( class_exists( 'WPSEO_Primary_Term' ) && $cat_count > 1 ) {\n $primary = new WPSEO_Primary_Term('category', $id);\n $primary_cat_id = $primary->get_primary_term();\n $primary_category = get_category( $primary_cat_id );\n } else {\n $categories = get_the_category();\n $primary_category = $categories[0];\n }\n\n return $primary_category;\n\n}", "function fetch_key_ai_screen_phrase_for_topic($topic) {\n\t\t$stmt = $this->_conn->query(\"select screen from ai_screen where topic='$topic' and is_key_phrase=1\");\n\t\t$result = $stmt->fetchAll(PDO::FETCH_COLUMN, 'screen');\n\t\t$stmt = null;\n\t\tif (count($result) === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $result[0];\n\t}", "public function getPrimarySource() {\n return $this->primarySource;\n }", "public function getTopicByMatpel($matpelId) {\n $sql = \"SELECT * FROM topic WHERE matpel_id = '\".$matpelId.\"'\";\n $result = $this->conn->query($sql);\n\n return $result;\n }", "public function model()\n {\n return Topic::class;\n }", "function isNewTopic()\n {\n return $this->_isNewTopic;\n }", "public function get_disciplinename()\n {\n $topic=Discipline::where ( 'id',$this->discipline_id )->first();\n return $topic->discipline_name;\n }", "function topic_url($id,$forum)\n\t{\n\t\tunset($forum);\n\t\treturn get_forum_base_url().'/index.php?topic='.strval($id).'.0';\n\t}", "function find_topic_id_for_topic_identifier($forum,$topic_identifier)\n\t{\n\t\tif (is_integer($forum)) $forum_id=$forum;\n\t\telse $forum_id=$this->forum_id_from_name($forum);\n\t\treturn $this->connection->query_value_null_ok_full('SELECT threadid FROM '.$this->connection->get_table_prefix().'threads WHERE boardid='.strval((integer)$forum_id).' AND ('.db_string_equal_to('topic',$topic_identifier).' OR topic LIKE \\'%: #'.db_encode_like($topic_identifier).'\\')');\n\t}", "function display_topic()\n {\n\t\t//-----------------------------------------\n\t\t// Grab the posts we'll need\n\t\t//-----------------------------------------\n\t\t\n\t\t$query_type = 'topics_get_posts';\n\t\t\n\t\t$first = intval( $this->ipsclass->input['start'] );\n\t\t$last = $this->ipsclass->vars['threaded_per_page'] ? $this->ipsclass->vars['threaded_per_page'] : 250;\n\t\t\n\t\tif ( $this->ipsclass->vars['custom_profile_topic'] == 1 )\n\t\t{\n\t\t\t$query_type = 'topics_get_posts_with_join';\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// GET meh pids\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $first > 0 )\n\t\t{\n\t\t\t// we're on a page, make sure init val is there\n\t\t\t\n\t\t\t$this->pids[0] = $this->topic['topic_firstpost'];\n\t\t\t$this->structured_pids[ 0 ][] = $this->topic['topic_firstpost'];\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->simple_construct( array (\n\t\t\t\t\t\t\t\t\t \t\t\t\t 'select' => 'pid, post_parent',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'posts',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'topic_id='.$this->topic['tid']. ' and queued != 1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'pid',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'limit' => array( $first, $last )\n\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\n\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t\twhile( $p = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->pids[] = $p['pid'];\n\t\t\t\n\t\t\t// Force to be children of 'root' post\n\t\t\t\n\t\t\tif ( ! $p['post_parent'] and $p['pid'] != $this->topic['topic_firstpost'] )\n\t\t\t{\n\t\t\t\t$p['post_parent'] = $this->topic['topic_firstpost'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->structured_pids[ $p['post_parent'] ][] = $p['pid'];\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get post bodah\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( count( $this->pids ) )\n\t\t{\n\t\t\t$this->ipsclass->DB->simple_construct( array (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'select' => 'pid, post, author_id, author_name, post_date, post_title, post_parent, topic_id, icon_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'from' => 'posts',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'where' => 'pid IN('.implode(',',$this->pids).')',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order' => 'pid',\n\t\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t \n\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\t\n\t\t\twhile( $p = $this->ipsclass->DB->fetch_row() )\n\t\t\t{\n\t\t\t\tif ( ! $p['post_parent'] and $p['pid'] != $this->topic['topic_firstpost'] )\n\t\t\t\t{\n\t\t\t\t\t$p['post_parent'] = $this->topic['topic_firstpost'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->post_cache[ $p['pid'] ] = $p;\n\t\t\t\t\n\t\t\t\t$this->last_id = $p['pid'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Force root in cache\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->post_cache[0] = array( 'id' => 1 );\n\t\t\n\t\t$this->post_cache[ $this->topic['topic_firstpost'] ]['post_title'] = $this->topic['title'];\n\t\t\n\t\t//-----------------------------------------\n\t\t// Are we viewing Posts?\n\t\t//-----------------------------------------\n\t\n\t\t$post_id = intval( $this->ipsclass->input['pid'] );\n\t\t\n if ( $post_id && ! in_array( $post_id, $this->pids ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );\n }\n \t\t\n\t\t$postid_array = array( 1 => $post_id );\n\t\t\n\t\tif ( $post_id and $post_id != $this->topic['topic_firstpost'] )\n\t\t{\n\t\t\t$parents = $this->post_get_parents( $post_id );\n\t\t\t\n\t\t\tif ( count($parents) )\n\t\t\t{\n\t\t\t\tforeach( $parents as $pid )\n\t\t\t\t{\n\t\t\t\t\tif ( $pid != $this->topic['topic_firstpost'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$postid_array[] = $pid;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( count($postid_array) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Get root post and children of clicked\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->used_post_ids = ','.implode( \",\", $postid_array ).',';\n\t\t\t\n\t\t\t$postid_array[0] = $this->topic['topic_firstpost'];\n\t\t\t\n\t\t\t$this->ipsclass->DB->cache_add_query( $query_type, array( 'pids' => $postid_array, 'scol' => 'pid', 'sord' => 'asc') );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Just get root\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->ipsclass->DB->cache_add_query( $query_type, array( 'pids' => array( 0 => $this->topic['topic_firstpost'] ) ) );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Attachment PIDS\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->lib->attach_pids = $postid_array;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Render the original post\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_topic']->topic_page_top( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ), 1 );\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t \n\t\t$outer = $this->ipsclass->DB->simple_exec();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Format and print out the topic list\n\t\t//-----------------------------------------\n\t\t\n\t\t$num_rows = $this->ipsclass->DB->get_num_rows($outer);\n\t\t\n\t\twhile ( $row = $this->ipsclass->DB->fetch_row($outer) )\n\t\t{\n\t\t\t$return = $this->lib->parse_row( $row );\n\t\t\t\n\t\t\t$poster = $return['poster'];\n\t\t\t$row = $return['row'];\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Are we giving this bloke a good ignoring?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this->ipsclass->member['ignored_users'] )\n\t\t\t{\n\t\t\t\tif ( strstr( $this->ipsclass->member['ignored_users'], ','.$poster['id'].',' ) and $this->ipsclass->input['p'] != $row['pid'] )\n\t\t\t\t{\n\t\t\t\t\tif ( ! strstr( $this->ipsclass->vars['cannot_ignore_groups'], ','.$poster['mgroup'].',' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= $this->ipsclass->compiled_templates['skin_topic']->render_row_hidden( $row, $poster );\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t\t$this->output .= $this->ipsclass->compiled_templates['skin_topic']->RenderRow( $row, $poster );\n\t\t\t\n\t\t\tif ( ! $this->printed and $num_rows > 1 )\n\t\t\t{\n\t\t\t\t$this->output .= $this->ipsclass->compiled_templates['skin_topic']->topic_end_first_post( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ), 1 );\n\t\t\t\t$this->printed = 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_topic']->topic_end_outline( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Sort out pagination\n\t\t//-----------------------------------------\n\t\t\n\t\t$total_replies = $this->topic['posts'];\n\t\t$show_replies = count( $this->structured_pids) - 1;\n\t\t\n\t\t$this->topic['threaded_pages'] = $this->ipsclass->build_pagelinks( array( 'TOTAL_POSS' => $total_replies,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'PER_PAGE' => $last,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'CUR_ST_VAL' => $this->ipsclass->input['start'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'L_SINGLE' => \"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'BASE_URL' => $this->ipsclass->base_url.\"showtopic=\".$this->topic['tid'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'USE_ST' => 'start'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// START GETTING THE OUTLINE LIST\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_topic']->toutline_start_list();\n\t\t\n\t\t$this->output .= $this->loop_get_children();\n\t\t\n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_topic']->toutline_end_list($this->topic['threaded_pages']);\n\t\t\n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_topic']->TableFooter( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ), 1, $this->ipsclass->return_md5_check() );\n\t\t\n\t}" ]
[ "0.816147", "0.7350958", "0.7350958", "0.7350958", "0.7350958", "0.7350958", "0.7344936", "0.7298734", "0.71609426", "0.7073525", "0.7062767", "0.6950569", "0.68810177", "0.68121606", "0.6648334", "0.66011745", "0.64805806", "0.6470564", "0.6422682", "0.63812315", "0.631676", "0.62476826", "0.6194806", "0.6144215", "0.60879534", "0.60488486", "0.60386264", "0.60358363", "0.603495", "0.5987773", "0.59869033", "0.5947585", "0.5946786", "0.5940005", "0.591991", "0.59168893", "0.58639455", "0.58632857", "0.5831926", "0.58272547", "0.58104795", "0.5797963", "0.5794842", "0.5783595", "0.5753709", "0.5751168", "0.5737382", "0.5713153", "0.570905", "0.5707914", "0.5707378", "0.5677847", "0.5664011", "0.5662835", "0.56355256", "0.5632605", "0.56323963", "0.5609406", "0.5608171", "0.5608171", "0.5608171", "0.5608171", "0.5608171", "0.56070423", "0.56067556", "0.5604326", "0.560409", "0.5575895", "0.55720174", "0.55516934", "0.55453664", "0.5527264", "0.55196255", "0.5502138", "0.54781854", "0.54756296", "0.54706395", "0.544496", "0.5438983", "0.5433114", "0.5433114", "0.54297906", "0.5425364", "0.54239225", "0.5406274", "0.5396394", "0.5376768", "0.5371788", "0.5367563", "0.53673476", "0.5367204", "0.53641284", "0.53583646", "0.53550017", "0.5349051", "0.532757", "0.52972794", "0.52912396", "0.5288103", "0.5276344" ]
0.7866233
1
Does the action have an active cooldown?
Есть ли у действия активная охлаждающаяся задержка?
public function isOnCooldown(): bool { return Cache::has($this->getCooldownCacheKey()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function shouldReleaseCooldown(): bool;", "public function isOnAnyCooldown(): bool\n {\n return $this->isOnCooldown() || $this->bot->isOnCooldown();\n }", "public function notOnCooldown(): bool\n {\n return ! $this->isOnCooldown();\n }", "public function notOnAnyCooldown(): bool\n {\n return ! $this->isOnAnyCooldown();\n }", "public function canInteract()\n {\n return !$this->scheduled_deactivate && !$this->scheduled_delete;\n }", "public function canDo($action){\n //Status all only block and dont stack\n if(isset($this->statusCommands[AMUD_STATUS_ALL])){\n $mod=-999;\n }else{\n $mod=0;\n }\n //When All is set you must a 1000 to allow a command\n //a bug may occour if a status stack over 1000 times, but huge status stacks are not desired yet\n if(!isset($this->statusCommands[$action])){\n $mod+=1;\n }else{\n $mod+=$this->statusCommands[$action];\n }\n return ($mod>0);\n }", "public function check_effective() {\n $cur = round(microtime(true) * 1000) + 8*60*60*1000; // in millisecond\n return $cur >= $this->effectiveTs;\n }", "public function isAboutToAttack();", "function CanAttend()\n\t{\treturn strtotime($this->details['starttime'] . ' 00:00:00') < time();\n\t}", "public function isInstant(){ return $this->periodic == self::USER_REQUESTED; }", "public function isLegalForMelee();", "public function isReady()\n {\n if ($this->lastActionTime === null) {\n return true;\n }\n $t = $this->getWaitingTime();\n return ($t <= 0);\n }", "public function should_run()\n\t{\n\t\treturn $this->config['inactive_users_last_gc'] < time() - $this->config['inactive_users_gc'];\n\t}", "public function isRunning()\n {\n if (!($this->oxactions__oxactive->value\n && $this->oxactions__oxtype->value == 2\n && $this->oxactions__oxactivefrom->value != '0000-00-00 00:00:00'\n )\n ) {\n return false;\n }\n $iNow = oxRegistry::get(\"oxUtilsDate\")->getTime();\n $iFrom = strtotime($this->oxactions__oxactivefrom->value);\n if ($iNow < $iFrom) {\n return false;\n }\n\n if ($this->oxactions__oxactiveto->value != '0000-00-00 00:00:00') {\n $iTo = strtotime($this->oxactions__oxactiveto->value);\n if ($iNow > $iTo) {\n return false;\n }\n }\n\n return true;\n }", "public function isAcquired(): bool;", "public function isAcquired() {}", "public function isAcquired() {}", "public function isAcquired() {}", "public function isAcquired() {}", "public function startCooldown(): void\n {\n if ($this->cooldown > 0) {\n Cache::put($this->getCooldownCacheKey(), true, now()->addSeconds($this->cooldown));\n }\n }", "public function hasRunOverDeadline()\n {\n # Get now datetime\n $now = new DateTime('NOW');\n # Get the deadline\n $deadline = DateTime::createFromFormat('Y-m-d H:i:s', $this->Deadline);\n # Get the time the action point was completed\n $timeCompleted = DateTime::createFromFormat('Y-m-d H:i:s', $this->DatetimeDone);\n\n $isDone = $this->IsDone;\n\n # Check whether it is running over deadline now, or it was already done and run over deadline\n if($now > $deadline && !$isDone || $timeCompleted > $deadline)\n return true;\n else\n return false;\n }", "public function allowActivation() {\n $parentJobCount = count($this->getParentJobs());\n \n //when we cancel job, child job might pull once, so execution_count can be more \n return $parentJobCount <= $this->execution_count;\n }", "public function is_actioned()\n {\n }", "public function isWaiting() {}", "function isAlive() {\n return !($this->iHealth <= 0); \n }", "function isActuallyEnabled ();", "function isAcquired() ;", "public function alarm()\n {\n if(!isset($this->state)) {\n return true;\n }\n\n return $this->state >= $this->threshold;\n }", "public function isHealthy()\n {\n return $this->getStatus() >= 100;\n }", "public function isIdle(): bool;", "public function active()\n {\n return (is_null($this->ends_at) || $this->onGracePeriod()) &&\n $this->paddle_status === Paddle::STATUS_ACTIVE ||\n $this->paddle_status === Paddle::STATUS_TRIALING;\n }", "public function hasDelayTime(){\n return $this->_has(6);\n }", "public function hasGracePeriodPast(): bool;", "public function alarm()\n {\n if(!isset($this->state)) {\n return true;\n }\n\n return $this->state <= $this->threshold;\n }", "function wc_is_running_from_async_action_scheduler()\n {\n }", "protected function _isActionAllowed($action)\n {\n \n return true;\n }", "final public function isMelee(): bool\n {\n return true;\n }", "function if_action($actions)\n {\n return app('active')->checkAction($actions);\n }", "public function isPending(): bool;", "public function is_action() {\n\t\treturn did_action( $this->name ) > 0;\n\t}", "public function isPending();", "public function onGracePeriod(): bool\n {\n return $this->cancelled() && $this->ends_at?->isFuture();\n }", "public function used(): bool\n {\n $use = rand(1,100);\n if ($this->chanceToUse >= $use) {\n return true;\n }\n return false;\n }", "public function hasHealthyThreshold(){\n return $this->_has(3);\n }", "public function isCurrentlyActive() {\n return $this->lastActive->diff(new DateTime(\"now\", $this->app->serverTimeZone))->i < 5;\n\n }", "public function releaseCooldown(): void;", "public function active()\n {\n return (is_null($this->ends_at) || $this->onGracePeriod() || $this->onPausedGracePeriod()) &&\n (! Cashier::$deactivatePastDue || $this->razorpay_status !== self::STATUS_PAST_DUE) &&\n $this->razorpay_status !== self::STATUS_PAUSED &&\n $this->razorpay_status !== self::STATUS_HALTED;\n }", "public function isMeleeWeapon(): bool;", "public static function isClickable($object, $action)\n{\n $action = strtolower($action);\n if($action == 'confirmbug') return $object->status == 'active' and $object->confirmed == 0;\n if($action == 'resolve') return $object->status == 'active';\n if($action == 'close') return $object->status == 'resolved';\n if($action == 'activate') return $object->status != 'active';\n if($action == 'tostory') return $object->status == 'active';\n if($action == 'toissue') return $object->toIssue == 0;\n if($action == 'withhold') return $object->status == 'resolved' and $object->withhold != 1;\n\n return true;\n}", "private static function allowByTime()\n {\n $release = ReleaseNotification::model()->getClosestRelease();\n if (empty($release))\n return true;\n \n $nowTime = strtotime('now');\n $plannedTime = ReleaseNotification::getPlannedDateTimestamp($release->planned);\n $delta = $plannedTime - $nowTime;\n \n return ($delta > self::MIN_TIME_BEFORE_RELEASE);\n }", "public function checkIfOneTurnLeftOnJob() : bool\n {\n if ($this->turnsLeft === 1)\n return true;\n else\n return false;\n }", "public function isNotAboutToAttack();", "private function canAutoRelease()\n {\n $now = new \\DateTime();\n $releaseMoment = $this->readAutoReleaseMoment();\n\n return $now > $releaseMoment;\n }", "public function checkAvailable()\n {\n return $this->is_active == true;\n }", "public function active()\n {\n return is_null($this->ends_at) || $this->onGracePeriod();\n }", "public function active()\n {\n return is_null($this->ends_at) || $this->onGracePeriod();\n }", "public function isResendAllowed()\n {\n return null !== $this->delay;\n }", "public function hasActions()\n\t{\n\t\treturn (count($this->actionsCallbacks) > 0);\n\t}", "public function hasActions()\n {\n return count($this->actions) > 0;\n }", "public function canBeActivated()\n {\n return $this->getIsActive() == false;\n\n }", "public function isGameActive();", "function hasAction($action);", "public function hasAbility(){\n return $this->_has(11);\n }", "function isBusy(){\n\t\treturn ($this->start_time>0) && ($this->start_time+$this->timeout<time());\n\t}", "public function hasWon()\n {\n return $this->totalPoints >= 100;\n }", "public function isActivelyScheduled(): bool\n {\n // first check if any exclusion schedules are active.\n // if they are, then user is not active.\n foreach ($this->exclusionSchedules as $schedule) {\n if ($schedule->isActive()) {\n return false;\n }\n }\n\n // if no schedules exist, user is always active.\n if (\\count($this->schedules) == 0) {\n return true;\n }\n\n // check if any user schedules are active and if so\n // then the user is active.\n foreach ($this->schedules as $schedule) {\n if ($schedule->isActive()) {\n return true;\n }\n }\n\n // user not active\n return false;\n }", "public function checkTimePassed() {\n\t\t$date = strtotime('-' . Configure::read('Cron.run_every'));\n\t\treturn !(bool)$this->Cron->countJobsAfter(date('Y-m-d H:i:s', $date));\n\t}", "public function isSuspended(): bool;", "public function valid()\n {\n return $this->active() || $this->onTrial() || $this->onPausedGracePeriod() || $this->onGracePeriod();\n }", "protected function canExecute(){\r\n\t\treturn true;\r\n\t}", "public function isActive() {\n $currentDay = Carbon::now();\n if($currentDay->greaterThanOrEqualTo($this->starts_at) && $currentDay->lessThan($this->expires_at) || ($this->isUnlimited() && !$this->isCancelled())) {\n return true;\n }\n\n return false;\n }", "function check() \n\t{\n\t return $this->expires > time();\n\t}", "public function valid()\n {\n return $this->active() || $this->onTrial() || $this->onGracePeriod();\n }", "public function valid()\n {\n return $this->active() || $this->onTrial() || $this->onGracePeriod();\n }", "public function valid()\n {\n return $this->active() || $this->onTrial() || $this->onGracePeriod();\n }", "public function valid()\n {\n return $this->active() || $this->onTrial() || $this->onGracePeriod();\n }", "public function isEnabled()\n {\n return ($this->getLockLifeTime() > 0);\n }", "public function canPause(): bool;", "public function canTerminate(): bool\n {\n return isset($_GET['__atk_callback']) && $_GET['__atk_callback'] === $this->urlTrigger;\n }", "private function actionIsAvailable($actionName)\n {\n return isset($this->availableActions[$actionName]);\n }", "public function isActivated() {}", "public function isUnderRate()\n {\n try {\n # Reject requests when no more quota\n if ( !($this->rateCurrent < $this->rateLimit) )\n return false;\n\n return true; \n\n } catch ( CerberoException $e ){\n Log::error($e);\n return false;\n }\n }", "public function doesSkillApply(): bool\n {\n return $this->chanceCalculator->areOddsInFavour($this->chance);\n }", "public function isAlive(){\n if ($this->lifePoints > 0) {\n return true;\n } else{\n return false;\n }\n }", "private function isTriggered()\n\t{\n\t\treturn($this->triggered);\n\t}", "public function allowedToBeRunning() :bool;", "public function isAvailable() {}", "public function isAvailable() {}", "public function canUnschedule()\n {\n return $this->isScheduled();\n }", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}" ]
[ "0.7948302", "0.75319207", "0.7298695", "0.7128995", "0.68063706", "0.649112", "0.6365595", "0.63356954", "0.631649", "0.6294824", "0.62211776", "0.6158183", "0.6130938", "0.6065993", "0.6014666", "0.6012857", "0.6012857", "0.60112315", "0.6010498", "0.5991028", "0.5990835", "0.5981044", "0.59581417", "0.5943722", "0.5941631", "0.5940829", "0.59345084", "0.59283304", "0.59228075", "0.59190863", "0.59133434", "0.58921397", "0.58828247", "0.58688676", "0.5866119", "0.5843998", "0.5804752", "0.57910013", "0.5776672", "0.57745093", "0.5749041", "0.57451653", "0.5726004", "0.57207716", "0.5716448", "0.5714632", "0.5672773", "0.5668418", "0.5667556", "0.56597185", "0.5652423", "0.5650569", "0.56481344", "0.5645822", "0.5639671", "0.5639671", "0.56380665", "0.563623", "0.5635161", "0.5622746", "0.56119645", "0.56110674", "0.5602716", "0.5595476", "0.5580308", "0.55668384", "0.5556809", "0.55554014", "0.5553273", "0.55488116", "0.55454046", "0.55416507", "0.5535377", "0.5535377", "0.5535377", "0.5535377", "0.5535155", "0.5530406", "0.552864", "0.5528168", "0.55255467", "0.5524676", "0.55187356", "0.55176336", "0.5510719", "0.55086946", "0.55070204", "0.55070204", "0.55066377", "0.5506318", "0.5506318", "0.5506064", "0.5506064", "0.5505822", "0.5505822", "0.5505822", "0.5505822", "0.5505822", "0.5505822", "0.5505822" ]
0.7932116
1
Does the action or the action's bot have an active cooldown?
Есть ли активный перерыв у действия или у бота действия?
public function isOnAnyCooldown(): bool { return $this->isOnCooldown() || $this->bot->isOnCooldown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function shouldReleaseCooldown(): bool;", "public function isOnCooldown(): bool\n {\n return Cache::has($this->getCooldownCacheKey());\n }", "public function notOnCooldown(): bool\n {\n return ! $this->isOnCooldown();\n }", "public function notOnAnyCooldown(): bool\n {\n return ! $this->isOnAnyCooldown();\n }", "public function canDo($action){\n //Status all only block and dont stack\n if(isset($this->statusCommands[AMUD_STATUS_ALL])){\n $mod=-999;\n }else{\n $mod=0;\n }\n //When All is set you must a 1000 to allow a command\n //a bug may occour if a status stack over 1000 times, but huge status stacks are not desired yet\n if(!isset($this->statusCommands[$action])){\n $mod+=1;\n }else{\n $mod+=$this->statusCommands[$action];\n }\n return ($mod>0);\n }", "public function canInteract()\n {\n return !$this->scheduled_deactivate && !$this->scheduled_delete;\n }", "public function isLegalForMelee();", "public function isAboutToAttack();", "public function check_effective() {\n $cur = round(microtime(true) * 1000) + 8*60*60*1000; // in millisecond\n return $cur >= $this->effectiveTs;\n }", "function CanAttend()\n\t{\treturn strtotime($this->details['starttime'] . ' 00:00:00') < time();\n\t}", "public function startCooldown(): void\n {\n if ($this->cooldown > 0) {\n Cache::put($this->getCooldownCacheKey(), true, now()->addSeconds($this->cooldown));\n }\n }", "final public function isMelee(): bool\n {\n return true;\n }", "public function isInstant(){ return $this->periodic == self::USER_REQUESTED; }", "public function should_run()\n\t{\n\t\treturn $this->config['inactive_users_last_gc'] < time() - $this->config['inactive_users_gc'];\n\t}", "public function releaseCooldown(): void;", "function if_action($actions)\n {\n return app('active')->checkAction($actions);\n }", "public function isReady()\n {\n if ($this->lastActionTime === null) {\n return true;\n }\n $t = $this->getWaitingTime();\n return ($t <= 0);\n }", "public function isHealthy()\n {\n return $this->getStatus() >= 100;\n }", "public function hasRunOverDeadline()\n {\n # Get now datetime\n $now = new DateTime('NOW');\n # Get the deadline\n $deadline = DateTime::createFromFormat('Y-m-d H:i:s', $this->Deadline);\n # Get the time the action point was completed\n $timeCompleted = DateTime::createFromFormat('Y-m-d H:i:s', $this->DatetimeDone);\n\n $isDone = $this->IsDone;\n\n # Check whether it is running over deadline now, or it was already done and run over deadline\n if($now > $deadline && !$isDone || $timeCompleted > $deadline)\n return true;\n else\n return false;\n }", "protected function _isActionAllowed($action)\n {\n \n return true;\n }", "public function isMeleeWeapon(): bool;", "public function used(): bool\n {\n $use = rand(1,100);\n if ($this->chanceToUse >= $use) {\n return true;\n }\n return false;\n }", "public function check_availability() {\n\n if ( !get_option('app_chatbot_enable') || !plan_feature('app_chatbot') || !team_role_permission('chatbot') ) {\n return false;\n } else {\n return true;\n }\n \n }", "public function doesSkillApply(): bool\n {\n return $this->chanceCalculator->areOddsInFavour($this->chance);\n }", "public function allowActivation() {\n $parentJobCount = count($this->getParentJobs());\n \n //when we cancel job, child job might pull once, so execution_count can be more \n return $parentJobCount <= $this->execution_count;\n }", "public function isNotAboutToAttack();", "public function isRunning()\n {\n if (!($this->oxactions__oxactive->value\n && $this->oxactions__oxtype->value == 2\n && $this->oxactions__oxactivefrom->value != '0000-00-00 00:00:00'\n )\n ) {\n return false;\n }\n $iNow = oxRegistry::get(\"oxUtilsDate\")->getTime();\n $iFrom = strtotime($this->oxactions__oxactivefrom->value);\n if ($iNow < $iFrom) {\n return false;\n }\n\n if ($this->oxactions__oxactiveto->value != '0000-00-00 00:00:00') {\n $iTo = strtotime($this->oxactions__oxactiveto->value);\n if ($iNow > $iTo) {\n return false;\n }\n }\n\n return true;\n }", "function hasRightAccess($action);", "function isActuallyEnabled ();", "public function hasGracePeriodPast(): bool;", "function wc_is_running_from_async_action_scheduler()\n {\n }", "public function isWaiting() {}", "function timeoutKicked()\n {\n $this->performAction(\n dp_text(\"say Oh, ok, I know when I'm not wanted.\"));\n $this->randomWalk();\n }", "public function readyForModerating(): bool;", "public function onGracePeriod(): bool\n {\n return $this->cancelled() && $this->ends_at?->isFuture();\n }", "public function should_update_last_requested() {\r\n\t\treturn (rand( 1, 20 ) === 20);\r\n\t}", "public function active()\n {\n return (is_null($this->ends_at) || $this->onGracePeriod()) &&\n $this->paddle_status === Paddle::STATUS_ACTIVE ||\n $this->paddle_status === Paddle::STATUS_TRIALING;\n }", "function isAlive() {\n return !($this->iHealth <= 0); \n }", "public function checkIfOneTurnLeftOnJob() : bool\n {\n if ($this->turnsLeft === 1)\n return true;\n else\n return false;\n }", "public static function isClickable($object, $action)\n{\n $action = strtolower($action);\n if($action == 'confirmbug') return $object->status == 'active' and $object->confirmed == 0;\n if($action == 'resolve') return $object->status == 'active';\n if($action == 'close') return $object->status == 'resolved';\n if($action == 'activate') return $object->status != 'active';\n if($action == 'tostory') return $object->status == 'active';\n if($action == 'toissue') return $object->toIssue == 0;\n if($action == 'withhold') return $object->status == 'resolved' and $object->withhold != 1;\n\n return true;\n}", "public function is_actioned()\n {\n }", "protected function _shouldSleep(): bool\n {\n $allowedEnvironments = $this->environments ?? [];\n\n if (!empty($this->exceptedEnvironments)) {\n $allowedEnvironments = array_filter($allowedEnvironments, fn($env) => in_array($env, $this->exceptedEnvironments));\n }\n\n if (!empty($allowedEnvironments) && !in_array($this->getEnvironment(), $allowedEnvironments)) {\n return false;\n } else if (!empty($this->exceptedEnvironments) && in_array($this->getEnvironment(), $this->exceptedEnvironments)) {\n return false;\n }\n\n foreach ($this->exceptCallbacks as $callback) {\n if ($callback()) {\n return false;\n }\n }\n\n return true;\n }", "public function isResendAllowed()\n {\n return null !== $this->delay;\n }", "public function hasWon()\n {\n return $this->totalPoints >= 100;\n }", "public function isAllowed(Lock $lock, $action, Target $target = null)\n {\n return ! $this->resolve($lock, $action, $target);\n }", "public function hasDelayTime(){\n return $this->_has(6);\n }", "protected function canExecute(){\r\n\t\treturn true;\r\n\t}", "function check()\n {\n foreach ($this->_actions as $action) {\n $res = $action->check();\n if ($res !== true) {\n return $res;\n }\n }\n\n return true;\n }", "public function can($action)\n\t{\n\t\tswitch ($action)\n\t\t{\n\t\t\tcase 'edit':\n\t\t\tcase 'delete':\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcase 'view':\n\t\t\t{\n\t\t\t\tif ( ! is_null($status = $this->getAttribute('status')))\n\t\t\t\t{\n\t\t\t\t\treturn $status ? true : false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcase 'on':\n\t\t\t{\n\t\t\t\treturn ! $this->getAttribute('status');\n\t\t\t}\n\n\t\t\tcase 'off':\n\t\t\t{\n\t\t\t\treturn $this->getAttribute('status');\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public static function allowAction()\n {\n try {\n if (!self::isSystemInMaintenanceMode())\n return true;\n \n if (Yii::app()->user->isGuest)\n return false;\n \n $user = User::model()->findByPk(Yii::app()->user->getId());\n if (empty($user)) {\n return false;\n }\n \n return self::isUserExclusive($user);\n } catch (Exception $e) {\n \n }\n \n return false;\n }", "final public function isMeleeWeapon(): bool\n {\n return true;\n }", "public function is_action() {\n\t\treturn did_action( $this->name ) > 0;\n\t}", "public function isPending();", "public function hasHealthyThreshold(){\n return $this->_has(3);\n }", "public function hasAbility(){\n return $this->_has(11);\n }", "private function canAutoRelease()\n {\n $now = new \\DateTime();\n $releaseMoment = $this->readAutoReleaseMoment();\n\n return $now > $releaseMoment;\n }", "public function isPending(): bool;", "public function isBannedSince();", "public function doesApply(string $type): bool\n {\n if (!in_array($type, $this->appliesOn)) {\n return false;\n }\n\n if ($this->chance != 0 && rand(0, 100) > $this->chance) {\n return false;\n }\n\n $this->writeLine($this->entity->getName() . ' activated the skill: ' . str_replace('Skill\\\\', '', get_class($this)));\n\n return true;\n }", "public function isAcquired() {}", "public function isAcquired() {}", "public function isAcquired() {}", "public function isAcquired() {}", "protected function _isAllowedAction($action){\n return true;\n }", "function new_transfer_request_ok($team, $now) {\n if ($team->ping_user <= 0) {\n if ($team->ping_time < $now - 60 * 86400) {\n return true;\n }\n return false;\n }\n if ($team->ping_time < $now - 90 * 86400) {\n return true;\n }\n return false;\n}", "public function checkAction() {\n // TODO: add hooks.\n $has_permission = FALSE;\n\n // Check access for a specific action.\n switch ($this->getAction()) {\n // By default an user can \"register\" a new account if he's anonymous / unlogged.\n case \\Quanta\\Common\\User::USER_ACTION_REGISTER:\n $has_permission = !$this->actor->exists;\n break;\n // To see if an user can edit another, use node permissions.\n case \\Quanta\\Common\\User::USER_ACTION_EDIT:\n $has_permission = NodeAccess::check($this->env, \\Quanta\\Common\\Node::NODE_ACTION_EDIT, array('node' => $this->vars['edit_user']));\n break;\n // By default an user can edit his own profile.\n case \\Quanta\\Common\\User::USER_ACTION_EDIT_OWN:\n $has_permission = $this->actor->getName() == $this->vars['user']->getName();\n break;\n }\n return $has_permission;\n }", "public function hasActions()\n {\n if (Auth::user()->usr_papel == \"Administrador\") {\n return true;\n }\n return false;\n }", "public function hasActions()\n {\n return count($this->actions) > 0;\n }", "protected function isAllowed()\n {\n if ($this->options->mode === 'never') {\n return true;\n } elseif ($this->options->mode === 'always') {\n return false;\n } elseif (Auth::check()) {\n return $this->passesAuthRules() && !$this->isLimitExceeded();\n } elseif (Auth::guest() && $this->passesGuestRules() && !$this->isLimitExceeded()) {\n return true;\n }\n\n return $this->passesBotRules();\n }", "function hasAction($action);", "public abstract function can_fly();", "public function can($action)\n {\n return !! $this->permissions()\n ->where('name', $action)\n ->first();\n }", "private function attaqueCritique()\r\n\t{\r\n\t\tif ($this->ninja_current == 0)\r\n\t\t\t$rapidite = $this->_combattant->ninja['stats_carac_rapidite'];\r\n\t\telse\r\n\t\t\t$rapidite = $this->_adversaire->ninja['stats_carac_rapidite'];\r\n\r\n\t\tif ($rapidite < 100)\r\n\t\t\t$max = 10;\r\n\t\tif ($rapidite >= 100 AND $rapidite < 1000)\r\n\t\t\t$max = 20;\r\n\t\tif ($rapidite >= 1000)\r\n\t\t\t$max = 30;\r\n\t\t\r\n\t\t$chance_critique = rand(1, $max);\r\n\t\t\r\n\t\tif ($chance_critique < 5)\r\n\t\t\treturn TRUE;\r\n\t\telse\r\n\t\t\treturn FALSE;\r\n\t}", "public function canAutoUpdate()\n {\n return time() - $this->getUpdateTime() > 60 * 60 * 24; // 1 day\n }", "public function isAcquired(): bool;", "public function isIdle(): bool;", "public static function is_needed() {\n\t\treturn amp_should_use_new_onboarding();\n\t}", "public function hasActions()\n\t{\n\t\treturn (count($this->actionsCallbacks) > 0);\n\t}", "public function isActivelyScheduled(): bool\n {\n // first check if any exclusion schedules are active.\n // if they are, then user is not active.\n foreach ($this->exclusionSchedules as $schedule) {\n if ($schedule->isActive()) {\n return false;\n }\n }\n\n // if no schedules exist, user is always active.\n if (\\count($this->schedules) == 0) {\n return true;\n }\n\n // check if any user schedules are active and if so\n // then the user is active.\n foreach ($this->schedules as $schedule) {\n if ($schedule->isActive()) {\n return true;\n }\n }\n\n // user not active\n return false;\n }", "public function isDamageModifierAdditive(): bool;", "function user_is_administrator()\n{\n // 0.5s\n\n return true;\n}", "private function isAuthorizedCommand() {\r\n\r\n }", "public function checkTimePassed() {\n\t\t$date = strtotime('-' . Configure::read('Cron.run_every'));\n\t\treturn !(bool)$this->Cron->countJobsAfter(date('Y-m-d H:i:s', $date));\n\t}", "public static function isForbiddenActionForUser($action)\n {\n $forbidden = self::getForbiddenActionForUser();\n\n if (in_array($action, $forbidden)) {\n return true;\n }\n\n return false;\n }", "public function onGracePeriod()\n {\n if (! is_null($endsAt = $this->ends_at)) {\n return Carbon::now()->lt(Carbon::instance($endsAt));\n } else {\n return false;\n }\n }", "private function actionIsAvailable($actionName)\n {\n return isset($this->availableActions[$actionName]);\n }", "public function passesBotRules()\n {\n if (method_exists($this, 'botRules')) {\n if (!call_user_func_array([$this, 'botRules'], [])) {\n return false;\n }\n }\n //We fast-track allowed IPs\n if ($this->isWhitelisted()) {\n return true;\n }\n //Lets block fake bots\n if (Redis::sismember($this->options->fake_bot_list_key, $this->client->ip)) {\n return false;\n }\n\n if ($this->isAllowedBot()) {\n // While the bot is on pending_list, it's unchecked, so we allow this bot to pass-thru\n if (!Redis::sismember($this->options->pending_bot_list_key, $this->client->ip)) {\n // If we got here, it is an unknown bot. Let's create a job to test it\n CheckIfBotIsReal::dispatch($this->client, $this->getAllowedBots(), $this->options);\n Redis::sadd($this->options->pending_bot_list_key, $this->client->ip);\n }\n\n return true;\n }\n\n return false;\n }", "public function canTerminate(): bool\n {\n return isset($_GET['__atk_callback']) && $_GET['__atk_callback'] === $this->urlTrigger;\n }", "private static function allowByTime()\n {\n $release = ReleaseNotification::model()->getClosestRelease();\n if (empty($release))\n return true;\n \n $nowTime = strtotime('now');\n $plannedTime = ReleaseNotification::getPlannedDateTimestamp($release->planned);\n $delta = $plannedTime - $nowTime;\n \n return ($delta > self::MIN_TIME_BEFORE_RELEASE);\n }", "public function onGracePeriod()\n {\n if ( ! is_null($endsAt = $this->ends_at)) {\n return Carbon::now()->lt(Carbon::instance($endsAt));\n } else {\n return false;\n }\n }", "final public static function permitted(CommandContext $ctx): bool \n {\n $author = $ctx->message->author;\n $id = null;\n\n //private chat or not\n if (isset($author[\"user\"])) {\n $id = $author->user->id;\n }\n else {\n $id = $author->id;\n }\n\n\n // check for alpha user\n //\n if (DISCORD_MASTER_ID == $id) {\n return true;\n }\n\n // if its not the alpha user, compare all the roles of the user to the roles linked to the command\n // \n $permitted = false;\n $cmdNamespace = $ctx->commandEntry->getFullName(); // WRONG, NEED TO GET CLASS FROM THIS PLACE HERE!!\n foreach ($ctx->message->author->roles as $roleid => $role) {\n $permitted = $ctx->database->commandHasRole($cmdNamespace, strval($roleid));\n if ($permitted) {\n break;\n }\n }\n\n return $permitted;\n }", "public function isGameActive();", "public function active()\n {\n return is_null($this->ends_at) || $this->onGracePeriod();\n }", "public function active()\n {\n return is_null($this->ends_at) || $this->onGracePeriod();\n }", "protected function _isAllowedAction($action)\n {\n return true;\n }", "function canMelee($v, $a, $d)\n\t{\n\t\tif($this->ci->actor->isElevated($a) != $this->ci->actor->isElevated($v)\n\t\t\t&& $d == 'melee')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function check_usage_time() {\r\n $opts = get_option('ww_options');\r\n\r\n // First-time use? (option does not exist)\r\n if (!$opts) {\r\n $opts['date_installed'] = strtotime('now');\r\n update_option('ww_options', $opts);\r\n return;\r\n }\r\n\r\n // User clicked don't show pop-up link, update option.\r\n if (isset($_GET['dontshowpopup']) && $_GET['dontshowpopup'] == 1) {\r\n $opts['dontshowpopup'] = 1;\r\n update_option('ww_options', $opts);\r\n return;\r\n }\r\n\r\n // Over 30 days? Not set to don't show? Show the damn thing.\r\n if (!isset($opts['dontshowpopup']) && $opts['date_installed'] < strtotime('-30 days')) {\r\n // plugin has been installed for over 30 days\r\n $this->actions['show_donate_box'] = true;\r\n wp_enqueue_style('dvk_donate', plugins_url('/backend/css/donate.css', dirname(__FILE__)));\r\n wp_enqueue_script('dvk_donate', plugins_url('/backend/js/donate.js', dirname(__FILE__)));\r\n }\r\n }", "public function alarm()\n {\n if(!isset($this->state)) {\n return true;\n }\n\n return $this->state >= $this->threshold;\n }", "public function isUnderRate()\n {\n try {\n # Reject requests when no more quota\n if ( !($this->rateCurrent < $this->rateLimit) )\n return false;\n\n return true; \n\n } catch ( CerberoException $e ){\n Log::error($e);\n return false;\n }\n }", "function isAcquired() ;" ]
[ "0.75793344", "0.7502174", "0.69448954", "0.68273777", "0.64810956", "0.64305496", "0.6359072", "0.61803246", "0.58714986", "0.5829828", "0.57827485", "0.57596064", "0.57424164", "0.5707808", "0.5656291", "0.56243694", "0.5617224", "0.5613096", "0.5591271", "0.5581666", "0.5579378", "0.5572375", "0.5547615", "0.553815", "0.54705685", "0.546831", "0.5457786", "0.54375803", "0.54200387", "0.5414321", "0.54096055", "0.5406574", "0.5405495", "0.5396895", "0.53922176", "0.5386818", "0.5376854", "0.5367767", "0.5358418", "0.53577185", "0.53450626", "0.53448504", "0.53377706", "0.53339565", "0.5319528", "0.5317444", "0.53024787", "0.5297981", "0.52967614", "0.52916646", "0.5291652", "0.5289811", "0.52699614", "0.526616", "0.52655226", "0.525522", "0.525452", "0.5249338", "0.5248928", "0.524134", "0.524134", "0.523972", "0.5239061", "0.5234237", "0.5233719", "0.52334535", "0.52334374", "0.52299637", "0.52188593", "0.52175653", "0.5215434", "0.52132493", "0.5211529", "0.52097017", "0.5202448", "0.51975596", "0.51950276", "0.51946133", "0.51894885", "0.5183895", "0.51794666", "0.517823", "0.5175862", "0.51739097", "0.51707506", "0.5169159", "0.5167069", "0.51637596", "0.5158974", "0.5158798", "0.51540595", "0.5151304", "0.5150076", "0.5150076", "0.51450485", "0.514266", "0.51405525", "0.5129974", "0.51286656", "0.5126023" ]
0.75512046
1
Release the action cooldown.
Освободить охлаждение действия.
public function releaseCooldown(): void { Cache::forget($this->getCooldownCacheKey()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function releaseCooldown(): void;", "public function shouldReleaseCooldown(): bool;", "public function release_claim( ActionScheduler_ActionClaim $claim ) {\n\t\t/** @var \\wpdb $wpdb */\n\t\tglobal $wpdb;\n\t\t$wpdb->update( $wpdb->actionscheduler_actions, [ 'claim_id' => 0 ], [ 'claim_id' => $claim->get_id() ], [ '%d' ], [ '%d' ] );\n\t\t$wpdb->delete( $wpdb->actionscheduler_claims, [ 'claim_id' => $claim->get_id() ], [ '%d' ] );\n\t}", "public function release($delay = 0)\n\t{\n\t\t//\n\t}", "public function startCooldown(): void\n {\n if ($this->cooldown > 0) {\n Cache::put($this->getCooldownCacheKey(), true, now()->addSeconds($this->cooldown));\n }\n }", "public function release($delay = 0)\n {\n parent::release($delay);\n $this->recreateJob($delay);\n }", "public function release($delay = 0)\r\n {\r\n $this->ack();\r\n\r\n $this->redis->release($this->queueName, $this->queueData, $delay, $this->attempts() + 1);\r\n }", "protected function unlockAction()\n {\n $this->changeStatusAction\n ->setAccess($this, Access::CAN_UNLOCK)\n ->execute($this, UserEntity::class, UserActionEvent::class, NULL, __METHOD__, [], [],\n ['status' => 'active'])\n ->endAfterExecution();\n }", "public function revoke()\r\n {\r\n if ($this->issued)\r\n {\r\n $user = $this->affiliate();\r\n if (empty($user->id)) {\r\n throw new \\Exception('Invalid Affiliate');\r\n }\r\n \r\n $this->balance_before = (float) $user->{'affiliate.commission.balance'};\r\n $this->balance_after = $this->balance_before - (float) $this->amount;\r\n // Add to the history\r\n $this->history[] = array(\r\n 'created' => \\Dsc\\Mongo\\Metastamp::getDate('now'),\r\n 'subject' => \\Dsc\\System::instance()->get('auth')->getIdentity()->fullName(),\r\n 'verb' => 'revoked',\r\n 'object' => (float) $this->amount\r\n );\r\n \r\n $user->{'affiliate.commission.balance'} = (float) $this->balance_after;\r\n $user->save();\r\n \r\n // Undo all the actions,\r\n foreach ($this->actions as $key=>$action)\r\n {\r\n switch ($action['type'])\r\n {\r\n \tcase \"shop.credit\":\r\n \t if (class_exists('\\Shop\\Models\\Orders') && !empty($action['issued']) && !empty($action['credit_id']))\r\n \t {\r\n \t // Revoke the credit\r\n \t try {\r\n \t $credit = (new \\Shop\\Models\\Credits)->setState('filter.id', $action['credit_id'])->getItem();\r\n \t if (!empty($credit->id)) {\r\n \t \t$credit->revoke();\r\n \t }\r\n \t $this->actions[$key]['issued'] = false;\r\n \t }\r\n \t catch (\\Exception $e) {\r\n \t $this->log('Could not revoke credit: ' . (string) $e );\r\n \t }\r\n \t }\r\n \t break;\r\n \tdefault:\r\n \t break;\r\n }\r\n } \r\n\r\n // trigger Listener event so they can handle them\r\n // listeners can loop through the actions themselves and evaluate $action['type'] and $action['issued']\r\n $this->__revoke_event = \\Dsc\\System::instance()->trigger( 'onAffiliatesRevokeCommission', array(\r\n 'commission' => $this\r\n ) );\r\n \r\n \r\n $this->issued = false;\r\n $this->save();\r\n }\r\n \r\n return $this;\r\n }", "public function release() {\n $this->locked = 0;\n $this->save();\n }", "function release_lock() {\r\n $this->that->ac_release_lock();\r\n }", "private function releaseWhenTimeDeltaAllows()\n {\n if ($this->canAutoRelease()) {\n $this->release();\n }\n }", "public function revoke(): void\n {\n }", "public function releaseClaim() {\n // DB_DataObject doesn't let us save nulls right now\n $sql = sprintf(\"UPDATE irc_waiting_message SET claimed=NULL WHERE id=%d\", $this->id);\n $this->query($sql);\n\n $this->claimed = null;\n $this->encache();\n }", "public function releaseLock(){\n $this->editLock()->delete();\n }", "public function forceRelease(): void;", "public function release() {\n\t\treturn delete_option( $this->name );\n\t}", "public function revoke();", "function ReleaseContribution() {\n }", "public function release($delay = 0)\n {\n parent::release($delay);\n\n $attempts = $this->attempts();\n $this->pubsub->republish(\n $this->job,\n $this->queue,\n ['attempts' => (string) $attempts],\n $delay\n );\n }", "public function cancel()\n {\n\n foreach ($this->tickets as $ticket)\n {\n $ticket->release();\n }\n }", "public function unclaim_action( $action_id ) {\n\t\t/** @var \\wpdb $wpdb */\n\t\tglobal $wpdb;\n\t\t$wpdb->update(\n\t\t\t$wpdb->actionscheduler_actions,\n\t\t\t[ 'claim_id' => 0 ],\n\t\t\t[ 'action_id' => $action_id ],\n\t\t\t[ '%s' ],\n\t\t\t[ '%d' ]\n\t\t);\n\t}", "public function decrementAttempts();", "public function unlock() {}", "public function unsetAvailableActions(): void\n {\n $this->availableActions = [];\n }", "abstract protected function releaseLock();", "public function takeOffArmor() {\n $this->speed += $this->armor->getSpeedPenalty();\n $this->armor = new NoArmor();\n }", "public function forceRelease(): void\n {\n $this->lockAdapter->forceRelease();\n }", "public function unlockCommand($requiredAge = 0)\n {\n $this->eventExecutionService->setResponse($this->response);\n $this->eventExecutionService->unlock($requiredAge);\n }", "public function unmute(): OMXPlayer;", "public function release(int $id, int $delay = 0): void\n {\n $redis = $this->getConnection();\n\n $redis->eval(\n LuaScripts::release(),\n 2,\n \"{$this->channelPrefix}{$this->channel}:delayed\",\n \"{$this->channelPrefix}{$this->channel}:reserved\",\n $id,\n time() + $delay\n );\n }", "public function releaseLock( $key )\n {\n apc_delete( $key );\n }", "public function cancelAction()\n {\n \n }", "public function releaseOne()\n {\n $this->release(1);\n }", "public function kill()\n {\n $this->_remainingPoints = 0;\n }", "public static function remove_actions()\n {\n }", "public function release(): void\n {\n $this->forceFill(['reserved_at' => null])->save();\n }", "public function releaseLock( $name );", "public function unlockURL(string $url): void;", "public function purgeDelayed();", "public function deactivate() {\n\t\tdelete_option( self::CONFIG['option_name'] );\n\t\t$timestamp = wp_next_scheduled( self::CONFIG['cron_event'] );\n\t\twp_unschedule_event( $timestamp, self::CONFIG['cron_event'] );\n\t\twp_clear_scheduled_hook( self::CONFIG['cron_event'] );\n\t}", "public function removeLock() {}", "public function removePermission($action)\n {\n if($this->testPermission($this->eval, $action)){\n $this->eval -= $this->getKey($action);\n }\n }", "public function endTurn(): void;", "static function deactivate() {\r\n delete_option( 'cs_jobhunt_plugin_activation' );\r\n delete_option( 'cs_jobhunt', false );\r\n }", "public function deactivate_license() {\n\n // Data to send to the API\n $api_params = array(\n 'edd_action' => 'deactivate_license',\n 'license' => $this->get_license_option( 'key' ),\n 'item_name' => urlencode( $this->item_name ),\n 'url' => home_url()\n );\n\n // Get the license data from the API.\n\t\t$license_data = $this->call_license_api( $api_params );\n \n if ( $license_data ) {\n if ( $license_data->license == 'deactivated' ) {\n delete_option( $this->item_shortname . '_license_data' ); \n \n $this->set_license_notice( $this->item_name . ' license deactivated.', 'updated' );\n } else {\n $message = sprintf (__( 'The %s license failed to deactivate, please try again later or contact support!', 'wpsl' ), $this->item_name );\n $this->set_license_notice( $message, 'error' );\n }\n } \n }", "public function release($key);", "public function deplete(): void {\n\t\t$this->executeQueued(\\true);\n\t}", "public static function release_lock()\n {\n global $wpdb;\n\n // Get lock option entry\n $result = $wpdb->query(\"\n SELECT option_id\n FROM $wpdb->options\n WHERE option_name = 'woochimp_cron_locked'\n OR option_name = 'woochimp_cron_unlocked'\n \");\n\n // No lock entry - add it and skip this scheduler run\n if (!$result) {\n update_option('woochimp_cron_unlocked', 1, false);\n return false;\n }\n\n // Attempt to reset lock time if four minutes passed\n $reset = $wpdb->query($wpdb->prepare(\"\n UPDATE $wpdb->options\n SET option_value = %d\n WHERE option_name = 'woochimp_cron_lock_time'\n AND option_value <= %d\n \", time(), (time() - 240)));\n\n // Return reset result\n return (bool) $reset;\n }", "function deactivation() {\n\t\t$this->cron_job_clear();\n\t}", "public function unlock();", "public static function unassignLicense($id) {\n \tglobal $database;\n $database->delete(\"licenses_assets\", [ \"id\" => $id ]);\n \treturn \"30\";\n }", "function deactivate_license() {\n\n\t\t// listen for our activate button to be clicked\n\t\tif( isset( $_POST[$this->prefix.'license_deactivate'] ) ) {\n\n\t\t\t// run a quick security check \n\t\t \tif( ! wp_verify_nonce( $_POST[$this->prefix . 'license_nonce_field'], $this->prefix . 'submit_license' ) )\n\t\t\t\treturn;\n\n\t\t\t// retrieve the license from the database\n\t\t\t$license = trim( get_option( $this->prefix . 'license_key' ) );\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array( \n\t\t\t\t'edd_action'=> 'deactivate_license', \n\t\t\t\t'license' \t=> $license, \n\t\t\t\t'item_name' => urlencode( $this->addon_name ), // the name of our product in EDD\n\t\t\t\t'url' => home_url()\n\t\t\t);\n\t\t\t\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_get( add_query_arg( $api_params, $this->oxygen_url ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) )\n\t\t\t\treturn false;\n\n\t\t\t// decode the license data\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t\t\n\t\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\t\t\tif( $license_data->license == 'deactivated' )\n\t\t\t\tdelete_option( $this->prefix . 'license_status' );\n\n\t\t}\n\t}", "public function releaseAll()\n {\n $type = Request::get('lockable_type');\n\n if(!empty($type) && class_exists($type)){\n $this->authorize('manageLocks',new $type);\n }else {\n $this->authorize('manageLocks');\n }\n\n if(!empty($type) && class_exists($type)){\n EditLock::where('lockable_type',$type)->delete();\n }else{\n /*\n * Not truncate as we don't want to reset auto increments as old locks attempting to\n * renew could potentially be confused with new\n */\n EditLock::query()->delete();\n }\n }", "public function release() {\n\t\tif (!$this->acquired) return false;\n\t\tglobal $wpdb;\n\t\t$sql = $wpdb->prepare(\"UPDATE {$wpdb->options} SET option_value = '0' WHERE option_name = %s\", $this->option_name);\n\t\t\n\t\t$this->log('Lock option ('.$this->option_name.', '.$wpdb->options.') released', 'info');\n\t\t\n\t\treturn (int) $wpdb->query($sql) === 1;\n\t}", "public function destroy(DelayPolicy $delayPolicy)\n {\n //\n }", "function deactivate() {\n\t\t//global $UUID;\n\t\t//$this->obj->status = 0;\n\t\t//$sql = \"update opportunities set `status`=0, `o_usermod`= $UUID where oid = \".$this->obj->oid;\n\t\t//$result = $this->cdb->query($sql);\n\t\t//if( !$result ) throw new Exception(DEBUG?\"{$this->cdb->error}: $sql\":'Can not deactivate opportunity',__LINE__);\n\t\t$this->cdb->query(\"delete from ratings where r_oid = \".$this->obj->oid);\n\t\t$this->cdb->query(\"delete from ratingop where roid = \".$this->obj->oid);\n\t\t// pending applications: mark all as read\n\t\t$sql = \"update applications set `status`=0 where opid = \".$this->obj->oid;\n\t\t$result = $this->cdb->query($sql);\n\t}", "public function deactivation() {}", "public function deactivation() {}", "public function performAction() {}", "function unlock() ;", "public static function deactivation()\n\t{\n\t\tself::clear_scheduled_hook();\n\t}", "public function deactivate(): void;", "public function deactivate(): void;", "public function release($delay = 0)\n {\n parent::release($delay);\n $this->fileQueue->popOrRelease($this->queue,$this->job,false);\n $this->fileQueue->later($delay,$this,$this->decoded['data'] ?? '',$this->queue);\n }", "public static function revoke_access_to_download()\n {\n }", "public function stop()\n {\n $this->oxactions__oxactiveto = new oxField(date('Y-m-d H:i:s', oxRegistry::get(\"oxUtilsDate\")->getTime()));\n $this->save();\n }", "public function dropAction() {}", "function cancelling_at_period_end( $entry, $action, $result ) {\n\t//write_log('running cancellation callback');\n\tif ( ! $result && rgar( $action, 'type' ) == 'cancel_subscription' && strtolower( $entry['payment_status'] ) == 'cancelled'\t) {\n\t\t//end of subscription has come.\n\t\t$entry_id = rgar( $entry, 'id' );\n\t\t$user_id = gform_get_meta( $entry_id, 'pwm_subscribers_user_id' );\n\t\tpwm_remove_subscription($entry_id, $user_id);\n\t}\n}", "public function destroy(Toll $toll)\n {\n //\n }", "function unlock()\n {\n \t$this->lock = 0;\n }", "abstract protected function releaseLock($name);", "public static function my_deactivation()\r\n\t{\r\n\t\tdelete_option(self::opt);\r\n\t}", "abstract public function unlock(int $expiryTime, string $id);", "public function release(){ }", "public function deactivate() {\n\t\t$timestamp = wp_next_scheduled( 'wepen_cron_hook' );\n\t\twp_unschedule_event( $timestamp, 'wepen_cron_hook' );\n\t}", "public function destroy(Pledge $pledge)\n {\n //\n }", "function easyyoutube_deactivation() {\n\t\t\twp_clear_scheduled_hook('easyyoutube_cron_import');\n\t\t\twp_clear_scheduled_hook('easyyoutube_update_cron_hook');\n\t\t}", "public static function do_action_or_reschedule()\n {\n }", "public function __destruct()\n {\n DB::table('oauth_access_tokens')\n ->where('client_id', app('config')->get('larapush.oauth.client'))\n ->update(['revoked' => true]);\n }", "public function cancel() {}", "public function subtractTurn()\n {\n $this->turnsLeft -= 1;\n $this->save();\n }", "public function destroy(Damage $damage)\n {\n //\n }", "public function release($delay = 0)\n {\n parent::release($delay);\n\n $payload = $this->createStompPayload($delay);\n\n $this->stompQueue->pushRaw($payload, $this->queue, []);\n }", "public function removeSuspensionIfAllowed()\n {\n $suspended = clone $this->suspended_at;\n\n $suspensionTime = static::$suspensionTime;\n $unsuspendAt = $suspended->modify(\"+{$suspensionTime} minutes\");\n $now = new Carbon;\n\n if ($unsuspendAt <= $now) {\n $this->unsuspend();\n }\n\n unset($suspended, $unsuspendAt, $now);\n }", "public function google_account_action() {\n\t\t// Security check.\n\t\t$this->security_check( true, 'settings' );\n\n\t\t// Continue only if action is set.\n\t\t$this->required_check( [ 'account_action' ] );\n\n\t\tswitch ( $_REQUEST['account_action'] ) {\n\t\t\tcase 'logout':\n\t\t\tcase 'switch':\n\t\t\t\t// Logout access code.\n\t\t\t\tGoogle_Auth\\Auth::instance()->logout( $this->is_network() );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Nothing.\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Send success response.\n\t\twp_send_json_success();\n\t}", "protected function gc()\n {\n if (mt_rand(1,100)==25) { // 1% chance\n $sql = 'DELETE FROM person_hammer_lock '.\n 'WHERE expiry<?';\n $this->db->master()->query($sql,array(time()));\n }\n }", "public function actionUnapprove()\n\t{\n\t\treturn $this->executeInlineModAction('unapproveQuotes');\n\t}", "function timeoutKicked()\n {\n $this->performAction(\n dp_text(\"say Oh, ok, I know when I'm not wanted.\"));\n $this->randomWalk();\n }", "function custom_amt_deactivation($newname, $newtheme) {\r\n wp_clear_scheduled_hook('amt_expire_user_role');\r\n}", "public function unExecute()\n {\n }", "public function destroy(Action $action)\n {\n //\n }", "public function destroy(Action $action)\n {\n //\n }", "public function destroy(Action $action)\n {\n //\n }", "public function cancelCbAction()\r\n {\r\n }", "public function blockDestruct() {}", "public function blockDestruct() {}", "public function deactivate($lunch) { ; }", "function cancelMembership($action) {\n\n\t\t// get current user\n\t\t$user_id = session()->value(\"user_id\");\n\n\t\t// does values validate\n\t\tif(count($action) == 2) {\n\t\t\t$member_id = $action[1];\n\n\t\t\t$query = new Query();\n\t\t\t$member = $this->getMembership();\n//\t\t\tprint_r($member);\n\n\t\t\tif($member && $member[\"user_id\"] == $user_id) {\n\n\t\t\t\t// set subscription_id to NULL - maintains member in system\n\t\t\t\t$sql = \"UPDATE \".$this->db_members. \" SET subscription_id = NULL, modified_at = CURRENT_TIMESTAMP WHERE id = \".$member_id;\n\t\t\t\tif($query->sql($sql)) {\n\n\t\t\t\t\t// delete subscription\n\t\t\t\t\t$this->deleteSubscription(array(\"deleteSubscription\", $member[\"subscription_id\"]));\n\n\n\t\t\t\t\tglobal $page;\n\t\t\t\t\t$page->addLog(\"User->cancelMembership: member_id:\".$member[\"id\"]);\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\t}", "public function release();" ]
[ "0.8214991", "0.6276203", "0.59294397", "0.57498634", "0.5710831", "0.54046434", "0.53572065", "0.53452885", "0.5282942", "0.52375495", "0.5225152", "0.5194352", "0.5192131", "0.5191224", "0.51493704", "0.51348466", "0.5128142", "0.5069322", "0.50688523", "0.50474554", "0.50437963", "0.5042488", "0.50264657", "0.5020521", "0.4992555", "0.49842954", "0.49747327", "0.49123982", "0.48308498", "0.481533", "0.4808255", "0.48081306", "0.48027053", "0.47991866", "0.47959864", "0.47448376", "0.47358808", "0.4733712", "0.47191393", "0.47177228", "0.46910012", "0.46738172", "0.4660859", "0.4654528", "0.4651957", "0.4633124", "0.4630582", "0.46303615", "0.4629298", "0.46186107", "0.46156225", "0.4606437", "0.46030176", "0.4602753", "0.46015057", "0.45988095", "0.45971486", "0.4593932", "0.4593932", "0.45874542", "0.45804027", "0.4579025", "0.45777267", "0.45777267", "0.45750675", "0.45649222", "0.4560441", "0.45512334", "0.45466876", "0.45397872", "0.45077422", "0.4497636", "0.44938493", "0.4491762", "0.44830322", "0.44766212", "0.4476469", "0.44696078", "0.44678894", "0.44609222", "0.44590312", "0.44574153", "0.44505882", "0.44468918", "0.44459245", "0.44414878", "0.44356942", "0.44294396", "0.44264984", "0.44257206", "0.4421528", "0.44190887", "0.44190887", "0.44190887", "0.44176447", "0.44128042", "0.44128042", "0.4408143", "0.44079533", "0.44059163" ]
0.7722522
1
Tests modifySearch method, with one and with multiple search fields.
Тесты метода modifySearch, с одним и с несколькими полями поиска.
public function testModifySearch() { $mockFilterState = $this->getMockBuilder('ONGR\FilterManagerBundle\Filter\FilterState')->getMock(); $mockFilterState->expects($this->exactly(2)) ->method('isActive') ->will($this->returnValue(true)); $fuzzySearch = new FuzzySearch(); $mockSearch = $this->getMockBuilder('ONGR\ElasticsearchDSL\Search')->getMock(); $mockSearch->expects($this->once()) ->method('addQuery') ->with($this->isInstanceOf('ONGR\ElasticsearchDSL\Query\FuzzyQuery'), $this->equalTo('must')); $fuzzySearch->setField('name'); $fuzzySearch->modifySearch($mockSearch, $mockFilterState); $mockSearch = $this->getMockBuilder('ONGR\ElasticsearchDSL\Search')->getMock(); $mockSearch->expects($this->exactly(1)) ->method('addQuery') ->with($this->isInstanceOf('ONGR\ElasticsearchDSL\Query\BoolQuery'), $this->equalTo('must')); $fuzzySearch->setField('name,age,address'); $fuzzySearch->modifySearch($mockSearch, $mockFilterState); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSearchFields(): void\n {\n $index = $this->_createIndex();\n\n $doc = new Document('1', ['title' => 'hello world', 'firstname' => 'nicolas', 'lastname' => 'ruflin', 'price' => '102', 'year' => '2012']);\n $index->addDocument($doc);\n $index->refresh();\n\n $query = new QueryString();\n $query = $query->setQuery('ruf*');\n $query = $query->setFields(['title', 'firstname', 'lastname', 'price', 'year']);\n\n $resultSet = $index->search($query);\n $this->assertEquals(1, $resultSet->count());\n }", "public function testPrepareWhereQueryWithMulipleSearchInOneField()\n {\n $aWhere['oxtitle'] = '%testvalue1 testvalue2 testvalue3%';\n $aWhere['oxid'] = 'testid';\n\n $oAdminList = $this->getProxyClass('oxAdminList');\n $sResultSql = $oAdminList->UNITprepareWhereQuery($aWhere, '');\n\n //setting spacing to 1 space\n $sResultSql = strtolower(trim($sResultSql));\n $sResultSql = preg_replace(\"/\\s+/\", \" \", $sResultSql);\n\n $sSql = \"and ( `oxtitle` like '%testvalue1%' and `oxtitle` like '%testvalue2%' and `oxtitle` like '%testvalue3%' ) and ( `oxid` = 'testid' )\";\n\n $this->assertEquals($sSql, $sResultSql);\n }", "public function test_search() {\n\t\t$input1 = '<input type=\"search\" name=\"test_search\">'.PHP_EOL;\n\t\t$this->assertEquals($input1, Form::search('test_search'));\n\n\t\t$input2 = '<input type=\"search\" name=\"test_search\" value=\"Test Value\">'.PHP_EOL;\n\t\t$this->assertEquals($input2, Form::search('test_search', 'Test Value', array()));\n\n\t\t$input3 = '<input class=\"inp_search\" type=\"search\" name=\"test_search\" value=\"Test Value\">'.PHP_EOL;\n\t\t$this->assertEquals($input3, Form::search('test_search', 'Test Value', array('class' => 'inp_search')));\n\t}", "public function edit(Search $search)\n {\n //\n }", "public function testSearch()\n {\n $tests = array(\n array(\n 'label' => __LINE__ .': null fields, null query, null options',\n 'fields' => null,\n 'query' => null,\n 'options' => null,\n 'expected' => array()\n ),\n array(\n 'label' => __LINE__ .': null fields, query, null options',\n 'fields' => null,\n 'query' => 'A',\n 'options' => null,\n 'expected' => array()\n ),\n array(\n 'label' => __LINE__ .': fields, query, null options',\n 'fields' => array('bar'),\n 'query' => 'A',\n 'options' => null,\n 'expected' => array('A', 'a')\n ),\n array(\n 'label' => __LINE__ .': fields, query, null options',\n 'fields' => array('bar'),\n 'query' => 'A',\n 'options' => array(P4_Model_Iterator::FILTER_CONTAINS),\n 'expected' => array('A')\n ),\n array(\n 'label' => __LINE__ .': field mismatch, query, null options',\n 'fields' => array('baz'),\n 'query' => 'A',\n 'options' => null,\n 'expected' => array()\n ),\n array(\n 'label' => __LINE__ .': multiple fields, query, null options',\n 'fields' => array('foo', 'baz'),\n 'query' => '3',\n 'options' => array(P4_Model_Iterator::FILTER_CONTAINS),\n 'expected' => array('C', 'c')\n ),\n );\n\n foreach ($tests as $test) {\n $label = $test['label'];\n\n // test the contents prior to filtering\n $results = $this->_getTestIterator()->search($test['fields'], $test['query'], $test['options']);\n $actual = $results->sortBy('bar')->invoke('getValue', array('bar'));\n $this->assertSame($test['expected'], $actual, \"$label - expected search results\");\n }\n }", "public function testMethodSearch()\n {\n $input = [\n 'index' => 'i',\n 'type' => 'd',\n 'body' => ['query' => ['match_all' => []]],\n ];\n\n $output = [\n 'took' => 1,\n 'hits' => [\n 'total' => 0,\n 'hits' => [],\n ],\n ];\n\n $this->client->expects($this->any())\n ->method('search')\n ->with($input)\n ->will($this->returnValue($output));\n\n $this->assertEquals($output, $this->service->search($input));\n }", "public function testSearchOrList()\n {\n }", "protected function applySearch() {\n\n }", "public function search($key = \"\", $query = \"\", $index = \"\", $type =\"\", $modelField=\"\", $key_one =\"\", $key_two=\"\", $model=\"\");", "function testGoodSearchQuery() {\r\n\t\t$search_id = $this->instance->SearchQuery(\"property\", '4', $this->instance->PrepareQuery(array('176'=>'100000-120000')), array('Limit'=>1, 'Select'=>176));\r\n\t\t$this->assertTrue(is_numeric($search_id));\r\n\t\t$this->assertTrue(is_numeric($this->instance->getTotalRecordsFound()));\r\n\t\t$this->assertTrue(is_numeric($this->instance->getNumRows()));\r\n\t\t$this->assertTrue($this->instance->IsMaxrowsReached());\r\n\t\t$this->assertTrue(is_array($this->instance->SearchGetFields($search_id)));\r\n\t}", "public function testSearch()\n {\n }", "public function testPostSearch()\n {\n $assemblyTestXlsx = \"assemblytest.xlsx\";\n $dataSourceXlsx = \"datasource.xlsx\";\n\n $mapFiles = array ();\n $mapFiles[$assemblyTestXlsx] = CellsApiTestBase::getfullfilename($assemblyTestXlsx);\n $mapFiles[$dataSourceXlsx] = CellsApiTestBase::getfullfilename($dataSourceXlsx);\n \n $request = new PostSearchRequest();\n $request->setFile( $mapFiles);\n $request->setText( \"12\");\n $this->instance->postSearch($request);\n }", "private function setSearch($search)\n\t{\n\t\t$this->search=$search;\n\t}", "private function setSearch($search)\n {\n $this->search = $search;\n }", "function SetUpSearch(\n &$in_search_manager, ///< A reference to an instance of c_comdef_search_manager. The search manager to set up.\n &$in_http_vars\n // The various HTTP GET and POST parameters.\n // The values that are important to the search are:\n // - 'services'\n // This is an array of positive integers.\n // This is interpreted as an array of integers. Each integer represents the ID of a Service Body.\n // A positive integer means that the search will look specifically for meetings that contain that\n // Service Body ID.\n // If the integer is negative (preceded by a minus sign -), then the criteria will be to look\n // for meetings that don't contain that ID.\n // If no 'services' values are given, then the search will not use the Service Body field as a\n // search criteria.\n //\n // - 'recursive'\n // If this is set to '1', then the 'services' key will recursively follow Service bodies.\n //\n // - 'venue_types'\n // This is an array of integers.\n // This is interpreted as an array of integers. Each integer represents a Venue Type.\n // A positive integer means that the search will look specifically for meetings that have that Venue Type.\n // If the integer is negative (preceded by a minus sign -), then the criteria will be to look\n // for meetings that don't have that Venue Type.\n // If no 'venue_type' values are given, then the search will not use the Venue Type field as a\n // search criteria.\n //\n // - 'weekdays'\n // This is an array of negative or positive nonzero integers (-7 - -1, 1 - 7).\n // This is interpreted as an array of integers. Each integer represents a weekday (1 -> Sunday, 7 -> Saturday).\n // A positive integer means that the search will look specifically for meetings that occur on that weekday.\n // If the integer is negative (preceded by a minus sign -), then the criteria will be to look\n // for meetings that don't occur on that weekday.\n // If no 'weekdays' values are given, then the search will not use the weekday field as a\n // search criteria.\n //\n // - 'bmlt_search_type'\n // This is set to 'advanced' if the search is an advanced one (we need to take more criteria into consideration).\n //\n // - 'advanced_search_mode'\n // This is set if the call was made from the advanced search page.\n //\n // - 'advanced_formats'\n // This is the formats array, but is only counted if the bmlt_search_type is set to 'advanced'.\n //\n // - 'advanced_service_bodies'\n // This is the same, but for Service Bodies.\n //\n // - 'advanced_weekdays'\n // ...and weekdays.\n //\n // - 'advanced_radius'\n // ...and radius (in degrees)\n //\n // - advanced_mapmode\n // If this is true (1), then the Advanced form is using its map.\n //\n // - 'advanced_published'\n // This is a switch to indicate whether or not to display published or unpublished meetings.\n // It is only viable for logged-in users, and can have these values:\n // - -1 Search for ONLY unpublished meetings\n // - 0 Search for published and unpublished meetings.\n // - 1 Search for ONLY published meetings.\n //\n // - 'formats'\n // This is an array of positive integers.\n // This is interpreted as an array of integers. Each integer represents a format shared ID.\n // A format ID means that the search will look specifically for meetings that have that format.\n // If the format is negative (preceded by a minus sign -), then the criteria will be to look\n // for meetings that don't have that format.\n // If no 'formats' values are given, then the search will not use the formats field as a\n // search criteria.\n //\n // - 'formats_comparison_operator'\n // This is a string used to set the operator used to compare included (positive integer) formats. Valid values\n // and AND and OR.\n //\n // - 'langs'\n // This is an array of 2-character strings.\n // This is interpreted as an array of strings. Each string represents a language code, and is a 2-character string.\n // A language string means that the search will look specifically for meetings that are in that language.\n // If the language is preceded by a minus sign -, then the criteria will be to look\n // for meetings that are not in that language.\n // If no 'langs' values are given, then the search will not use the lang_enum field as a\n // search criteria.\n //\n // The following values specify a start time \"window.\" The meeting must start on, or after StartsAfterH/M, and\n // can start no later than StartsBeforeH/M\n //\n // - 'StartsAfterH'\n // A positive integer between 0 and 23. The hour of the minimal start time for meetings, in military time.\n // - 'StartsAfterM'\n // A positive integer between 0 and 59. The minute of the minimal start time for meetings, in military time.\n // - 'StartsBeforeH'\n // A positive integer between 0 and 23. The hour of the maximal start time for meetings, in military time.\n // - 'StartsBeforeM'\n // A positive integer between 0 and 59. The minute of the maximal start time for meetings, in military time.\n //\n // The following values specify a time duration \"window.\" The meeting can last no longer than MaxDurationH/M,\n // and no less than MinDurationH/M.\n //\n // - 'MinDurationH'\n // A positive integer. This is the number of hours in the minimal duration.\n // - 'MinDurationM'\n // A positive integer. This is the number of minutes in the minimal duration.\n // - 'MaxDurationH'\n // A positive integer. This is the number of hours in the maximal duration.\n // - 'MaxDurationM'\n // A positive integer. This is the number of minutes in the maximal duration.\n //\n // This is how meetings are located. We don't use address lookups. Instead, we geolocate the meetings via the\n // longitude and latitude fields in each record. If you don't specify a geolocation, then the entire database\n // is searched. If you do specify one, then only the portion within the radius is searched.\n //\n // - 'geo_width'\n // A floating point number. This is the radius (not diameter) of the search, in MILES (not Kilometers).\n // If this is negative, then it should be an integer, and that indicates an auto-radius is requested to\n // find the number of meetings in the integer.\n //\n // - 'geo_width_km'\n // A floating point number. This is the radius (not diameter) of the search, in KILOMETERS (not Miles).\n // If this is negative, then it should be an integer, and that indicates an auto-radius is requested to\n // find the number of meetings in the integer.\n //\n // - 'long_val'\n // If one of the three radius specifiers is zero or undefined, this is ignored.\n // This is a floating point number that specifies the longitude, in degrees, of the center of the search radius.\n //\n // - 'lat_val'\n // If one of the three radius specifiers is zero or undefined, this is ignored.\n // This is a floating point number that specifies the latitude, in degrees, of the center of the search radius.\n //\n // - 'SearchString'\n // A string. If this is specified, then all the string fields of the meetings specified by the above criteria\n // will be searched for the string. By default, if the language supports metaphone (sound like search), then\n // that is used.\n //\n // - 'StringSearchIsAnAddress'\n // A boolean. Nonzero means that the given string should not be checked against any of the fields in the meeting\n // data. Instead, it is to be considered a submission to the Google Maps geocode, and will be used to determine\n // a cernter point in a local search.\n //\n // - 'SearchStringAll'\n // If nonzero, then all of the words in the search string will have to be matched for a meetings to qualify.\n //\n // - 'SearchStringExact'\n // If nonzero, metaphone will not be used, and the spelling must be exact.\n //\n // - 'SearchStringRadius'\n // If specified, the radius of the search around the address (ignored if StringSearchIsAnAddress is false).\n // The units are in whatever the server units are for this language (can be miles or kilometers).\n // Negative numbers must always be integers, and specify a rough target number of meetings for auto-radius.\n //\n // - 'meeting_ids'\n // An array of positive integers. Each integer is an ID of an individual meeting. If this is set, all other\n // search criteria are ignored.\n //\n // - 'meeting_key'\n // A string. This is the exact name of the key to match. If this is null (Default), the following three are ignored.\n // NOTE: As of 1.5, the behavior of this field has changed.\n // If it is an array, then the string search is done via metaphone, unless meeting_key_match_case is true.\n // If it is an array, then the search is done on all the fields in the array, assuming they are all text.\n // Non-string fields are ignored.\n //\n // - 'meeting_key_value'\n // A string. The value to match.\n // NOTE: As of Version 1.5, this is matched with a metaphone match, as well as the RegEx match.\n //\n // - 'meeting_key_match_case'\n // If true, the case must match. Default is false.\n // NOTE: As of Version 1.5, setting this to TRUE also stops the metaphone search.\n //\n // - 'meeting_key_contains'\n // If this is true, then the string can have partial matches. Default is false (literal).\n //\n // - 'sort_results_by_distance'\n // If this is true, then, if possible, the search results will be sorted by distance from the radius center.\n // If this is set, then the 'sort_keys' parameter below will be ignored.\n //\n // - 'sort_keys'\n // This is a comma-separated list of sort keys. The leftmost one will be the top priority, and the rightmost the lowest.\n // The sort depth will be the number of keys.\n // The direction will be assumed 'asc', unless 'desc' is one of the keys (it can be anywhere in the list).\n) {\n $search_string = isset($in_http_vars['SearchString']) ? trim($in_http_vars['SearchString']) : '';\n\n if ($search_string && !(isset($in_http_vars['StringSearchIsAnAddress']) && $in_http_vars['StringSearchIsAnAddress']) && intval($search_string) && (preg_match('|\\d+|', $search_string) || preg_match('(|\\d+|,)+', $search_string))) {\n $temp_ids = explode(',', $search_string);\n\n if (is_array($temp_ids) && count($temp_ids)) {\n $first = true;\n\n foreach ($temp_ids as $id) {\n $id = intval(trim($id));\n\n if ($id) {\n if ($first) {\n $in_http_vars['meeting_ids'] = null;\n $first = false;\n }\n\n $in_http_vars['meeting_ids'][] = $id;\n }\n }\n } else {\n $id = intval($search_string);\n\n if ($id) {\n $in_http_vars['meeting_ids'] = array ( intval($id) );\n }\n }\n }\n\n // If we have a meeting ID array, then that defines the entire search. We ignore everything else\n if (isset($in_http_vars['meeting_ids']) && is_array($in_http_vars['meeting_ids']) && count($in_http_vars['meeting_ids'])) {\n $in_search_manager->SetMeetingIDArray($in_http_vars['meeting_ids']);\n } else {\n if (isset($in_http_vars['sort_results_by_distance'])) {\n $in_search_manager->SetSortByDistance($in_http_vars['sort_results_by_distance']);\n } elseif (isset($in_http_vars['sort_keys']) && $in_http_vars['sort_keys']) {\n $sort_fields = array();\n $keys = explode(',', $in_http_vars['sort_keys']);\n $dir = 'asc';\n foreach ($keys as $key) {\n if (strtolower(trim($key)) == 'desc') {\n $dir = 'desc';\n } else {\n $templates = c_comdef_meeting::GetDataTableTemplate();\n if ($templates && count($templates)) {\n $additional = array ();\n\n foreach ($templates as $template) {\n $value = $template['key'];\n array_push($additional, $value);\n }\n\n $standards = array ( 'weekday_tinyint', 'venue_type', 'id_bigint', 'worldid_mixed', 'service_body_bigint', 'lang_enum', 'duration_time', 'start_time', 'longitude', 'latitude' );\n $templates = array_merge($standards, $additional);\n\n if (in_array($key, $templates)) {\n array_push($sort_fields, $key);\n }\n }\n }\n }\n\n $in_search_manager->SetSort($sort_fields, $dir == 'desc', count($sort_fields));\n }\n\n // The first thing we do is try to resolve any address lookups.\n if ($search_string && isset($in_http_vars['StringSearchIsAnAddress']) && $in_http_vars['StringSearchIsAnAddress']) {\n $geo_search = (isset($in_http_vars['geo_width']) && $in_http_vars['geo_width']) ? true : ((isset($in_http_vars['geo_width_km']) && $in_http_vars['geo_width_km']) ? true : false);\n\n // We do a geocode to find out if this is an address.\n if (!$geo_search) {\n $search_string = preg_replace('|,(\\s*?)|', ', ', $search_string); // This works around a bug caused by too-tight commas.\n $geo = GetGeocodeFromString($search_string, $in_http_vars['advanced_weekdays'] ?? null);\n if (is_array($geo) && count($geo)) {\n $localized_strings = c_comdef_server::GetLocalStrings();\n\n $in_http_vars['long_val'] = $geo['longitude'];\n $in_http_vars['lat_val'] = $geo['latitude'];\n\n if (isset($in_http_vars['SearchStringRadius']) && floatval($in_http_vars['SearchStringRadius']) != 0.0) {\n if (intval($in_http_vars['SearchStringRadius']) < 0) {\n $geo['radius'] = intval($in_http_vars['SearchStringRadius']);\n } else {\n $geo['radius'] = floatval($in_http_vars['SearchStringRadius']);\n }\n }\n\n if ($localized_strings['dist_units'] == 'mi') {\n if (isset($in_http_vars['geo_width_km'])) {\n unset($in_http_vars['geo_width_km']);\n }\n $in_http_vars['geo_width'] = $geo['radius'];\n } else {\n unset($in_http_vars['geo_width']);\n $in_http_vars['geo_width_km'] = $geo['radius'];\n }\n\n /* We need to undef these, because they can step on the long/lat. */\n unset($search_string);\n unset($in_http_vars['StringSearchIsAnAddress']);\n unset($in_http_vars['SearchStringRadius']);\n }\n }\n }\n\n // First, set up the services.\n if (isset($in_http_vars['bmlt_search_type']) && ($in_http_vars['bmlt_search_type'] == 'advanced') && isset($in_http_vars['advanced_service_bodies']) && is_array($in_http_vars['advanced_service_bodies']) && count($in_http_vars['advanced_service_bodies'])) {\n $in_http_vars['services'] = $in_http_vars['advanced_service_bodies'];\n }\n\n if (isset($in_http_vars['services']) && !is_array($in_http_vars['services'])) {\n $in_http_vars['services'] = array ( $in_http_vars['services'] );\n }\n\n // Look for Service bodies.\n if (isset($in_http_vars['services']) && is_array($in_http_vars['services']) && count($in_http_vars['services'])) {\n $services = array();\n\n if (isset($in_http_vars['recursive']) && $in_http_vars['recursive']) {\n foreach ($in_http_vars['services'] as $service) {\n $nested = GetAllContainedServiceBodyIDs(intval($service));\n\n if (isset($nested) && is_array($nested) && count($nested)) {\n foreach ($nested as $sb_i) {\n $sb_i = intval($sb_i);\n $services[$sb_i] = $sb_i;\n }\n }\n }\n } else {\n $services = $in_http_vars['services'];\n }\n\n $sb =& $in_search_manager->GetServiceBodies();\n\n foreach ($services as $service) {\n $sb[intval($service)] = 1;\n }\n } else {\n unset($in_http_vars['services']);\n }\n\n if (!( isset($in_http_vars['geo_width_km']) && $in_http_vars['geo_width_km'] )\n && !( isset($in_http_vars['geo_width']) && $in_http_vars['geo_width'] )\n && isset($in_http_vars['bmlt_search_type'])\n && ($in_http_vars['bmlt_search_type'] == 'advanced')\n && isset($in_http_vars['advanced_radius'])\n && isset($in_http_vars['advanced_mapmode'])\n && $in_http_vars['advanced_mapmode']\n && ( floatval($in_http_vars['advanced_radius'] != 0.0) )\n && isset($in_http_vars['lat_val'])\n && isset($in_http_vars['long_val'])\n && ( (floatval($in_http_vars['lat_val']) != 0.0) || (floatval($in_http_vars['long_val']) != 0.0) )\n ) {\n if ($localized_strings['dist_units'] == 'mi') {\n $in_http_vars['geo_width'] = $in_http_vars['advanced_radius'];\n unset($in_http_vars['geo_width_km']);\n } else {\n $in_http_vars['geo_width_km'] = $in_http_vars['advanced_radius'];\n unset($in_http_vars['geo_width']);\n }\n }\n\n // If we aren't doing any geographic searches, then we won't have a search center.\n if (!( isset($in_http_vars['geo_width']) && $in_http_vars['geo_width'] ) && !( isset($in_http_vars['geo_width_km']) && $in_http_vars['geo_width_km'] )) {\n unset($in_http_vars['lat_val']);\n unset($in_http_vars['long_val']);\n }\n\n // Next, set up the weekdays.\n if (isset($in_http_vars['bmlt_search_type']) && ($in_http_vars['bmlt_search_type'] == 'advanced') && isset($in_http_vars['advanced_weekdays']) && ((is_array($in_http_vars['advanced_weekdays']) && count($in_http_vars['advanced_weekdays'])) || isset($in_http_vars['advanced_weekdays']))) {\n $in_http_vars['weekdays'] = $in_http_vars['advanced_weekdays'];\n }\n\n if (isset($in_http_vars['weekdays']) && !is_array($in_http_vars['weekdays']) && (intval(abs($in_http_vars['weekdays'])) > 0) && (intval(abs($in_http_vars['weekdays'])) < 8)) {\n $in_http_vars['weekdays'] = array ( intval($in_http_vars['weekdays']) );\n }\n\n if (isset($in_http_vars['weekdays']) && is_array($in_http_vars['weekdays']) && count($in_http_vars['weekdays'])) {\n $wd =& $in_search_manager->GetWeekdays();\n foreach ($in_http_vars['weekdays'] as $weekday) {\n $wd[abs(intval($weekday))] = intval($weekday) > 0 ? 1 : -1;\n }\n } elseif (isset($in_http_vars['weekdays'])) {\n $wd =& $in_search_manager->GetWeekdays();\n $wd[abs(intval($in_http_vars['weekdays']))] = intval(intval($in_http_vars['weekdays'])) > 0 ? 1 : -1;\n }\n\n // Venue Types\n if (isset($in_http_vars['venue_types']) && is_array($in_http_vars['venue_types']) && count($in_http_vars['venue_types'])) {\n $vt =& $in_search_manager->GetVenueTypes();\n foreach ($in_http_vars['venue_types'] as $venueType) {\n $vt[abs(intval($venueType))] = intval($venueType) > 0 ? 1 : -1;\n }\n } else if (isset($in_http_vars['venue_types'])) {\n $vt =& $in_search_manager->GetVenueTypes();\n $vt[abs(intval($in_http_vars['venue_types']))] = intval($in_http_vars['venue_types']) > 0 ? 1 : -1;\n }\n\n // Next, set up the formats.\n if (isset($in_http_vars['bmlt_search_type']) && ($in_http_vars['bmlt_search_type'] == 'advanced') && isset($in_http_vars['advanced_formats']) && is_array($in_http_vars['advanced_formats']) && count($in_http_vars['advanced_formats'])) {\n $in_http_vars['formats'] = $in_http_vars['advanced_formats'];\n }\n\n if (isset($in_http_vars['formats'])) {\n if (!is_array($in_http_vars['formats'])) {\n $in_http_vars['formats'] = array ( intval($in_http_vars['formats']) );\n }\n\n $fm =& $in_search_manager->GetFormats();\n foreach ($in_http_vars['formats'] as $format) {\n $key = abs(intval($format));\n $fm[$key] = (intval($format) > 0) ? 1 : -1;\n }\n }\n\n if (isset($in_http_vars['formats_comparison_operator']) && $in_http_vars['formats_comparison_operator'] == \"OR\") {\n $in_search_manager->SetFormatsComparisonOperator(\"OR\");\n }\n\n // Next, set up the languages.\n if (isset($in_http_vars['langs']) && is_array($in_http_vars['langs']) && count($in_http_vars['langs'])) {\n $lan =& $in_search_manager->GetLanguages();\n foreach ($in_http_vars['langs'] as $lng) {\n $lan[$lng] = 1;\n }\n }\n\n // Next, set up the advanced published option.\n if (isset($in_http_vars['advanced_published'])) {\n $in_search_manager->SetPublished(intval($in_http_vars['advanced_published']));\n } else {\n $in_search_manager->SetPublished(1);\n }\n\n // Set the start window.\n $start_time = null;\n $end_time = null;\n\n // Next, the minimum start time..\n if (isset($in_http_vars['StartsAfterH']) || isset($in_http_vars['StartsAfterM'])) {\n $start_hour = min(23, max(0, intval($in_http_vars['StartsAfterH'])));\n $start_minute = min(59, max(0, intval($in_http_vars['StartsAfterM'])));\n $start_time = mktime($start_hour, $start_minute);\n }\n\n // Next, the maximum start time..\n if (isset($in_http_vars['StartsBeforeH']) || isset($in_http_vars['StartsBeforeM'])) {\n $end_hour = min(23, max(0, intval($in_http_vars['StartsBeforeH'])));\n $end_minute = min(59, max(0, intval($in_http_vars['StartsBeforeM'])));\n $end_time = mktime($end_hour, $end_minute);\n }\n\n $in_search_manager->SetStartTime($start_time, $end_time);\n\n $end_time = null;\n\n // Next, the maximum end time..\n if (isset($in_http_vars['EndsBeforeH']) || isset($in_http_vars['EndsBeforeM'])) {\n $end_hour = min(23, max(0, intval($in_http_vars['EndsBeforeH'])));\n $end_minute = min(59, max(0, intval($in_http_vars['EndsBeforeM'])));\n $end_time = ($end_hour * 3600) + ($end_minute * 60);\n }\n\n $in_search_manager->SetEndTime($end_time);\n\n // Set the duration window.\n $max_duration_time = null;\n $min_duration_time = null;\n\n // Next, the minimum start time..\n if (isset($in_http_vars['MaxDurationH']) || isset($in_http_vars['MaxDurationM'])) {\n $max_duration_hour = min(23, max(0, intval($in_http_vars['MaxDurationH'])));\n $max_duration_minute = min(59, max(0, intval($in_http_vars['MaxDurationM'])));\n $max_duration_time = mktime($max_duration_hour, $max_duration_minute);\n }\n\n // Next, the maximum start time..\n if (isset($in_http_vars['MinDurationH']) || isset($in_http_vars['MinDurationM'])) {\n $min_duration_hour = min(23, max(0, intval($in_http_vars['MinDurationH'])));\n $min_duration_minute = min(59, max(0, intval($in_http_vars['MinDurationM'])));\n $min_duration_time = mktime($min_duration_hour, $min_duration_minute);\n }\n\n $in_search_manager->SetDuration($max_duration_time, $min_duration_time);\n\n // Next, we deal with a geolocated search radius.\n\n if ((isset($in_http_vars['geo_width']) && ($in_http_vars['geo_width'] != 0))\n || (isset($in_http_vars['geo_width_km']) && ($in_http_vars['geo_width_km'] != 0) )) {\n $long = isset($in_http_vars['long_val']) ? floatval($in_http_vars['long_val']) : 0;\n $lat = isset($in_http_vars['lat_val']) ? floatval($in_http_vars['lat_val']) : 0;\n $radius_in_miles = 0;\n $radius_in_km = 0;\n $local_strings = c_comdef_server::GetLocalStrings();\n $radius_auto = $local_strings['number_of_meetings_for_auto'];\n\n if (isset($in_http_vars['geo_width']) && ( $in_http_vars['geo_width'] != 0 )) {\n if ($in_http_vars['geo_width'] < 0) {\n $radius_auto = 0 - intval($in_http_vars['geo_width']);\n } else {\n $radius_in_miles = floatval($in_http_vars['geo_width']);\n }\n } elseif (isset($in_http_vars['geo_width_km']) && ( $in_http_vars['geo_width_km'] != 0 )) {\n if ($in_http_vars['geo_width_km'] < 0) {\n $radius_auto = 0 - intval($in_http_vars['geo_width_km']);\n } else {\n $radius_in_km = floatval($in_http_vars['geo_width_km']);\n }\n }\n\n if ($radius_in_miles > 0) {\n $in_search_manager->SetSearchRadiusAndCenterInMiles($radius_in_miles, $long, $lat);\n } elseif ($radius_in_km > 0) {\n $in_search_manager->SetSearchRadiusAndCenterInKm($radius_in_km, $long, $lat);\n } elseif ($radius_auto > 0) {\n $in_search_manager->SetSearchRadiusAndCenterAuto($radius_auto, $long, $lat);\n }\n }\n\n if (isset($search_string) && (!isset($in_http_vars['meeting_key']) || !(is_array($in_http_vars['meeting_key']) && count($in_http_vars['meeting_key'])))) {\n // And last, but not least, a string search:\n $find_all = (isset($in_http_vars['SearchStringAll']) && $in_http_vars['SearchStringAll']) ? true :false;\n $literal = (isset($in_http_vars['SearchStringExact']) && $in_http_vars['SearchStringExact']) ? true :false;\n $in_search_manager->SetSearchString($search_string, $find_all, $literal);\n }\n\n if (isset($in_http_vars['meeting_key']) && $in_http_vars['meeting_key']) {\n // This is true by default.\n if (!isset($in_http_vars['meeting_key_contains'])) {\n $in_http_vars['meeting_key_contains'] = false;\n }\n\n // This is false by default.\n if (!isset($in_http_vars['meeting_key_match_case'])) {\n $in_http_vars['meeting_key_match_case'] = false;\n }\n $in_search_manager->SetKeyValueSearch($in_http_vars['meeting_key'], $in_http_vars['meeting_key_value'], $in_http_vars['meeting_key_match_case'], $in_http_vars['meeting_key_contains']);\n }\n }\n}", "public function testFrontendSearchConsideredFields()\n {\n //art num is not considered in search\n $this->callShopSC(\"oxConfig\", null, null, array(\"aSearchCols\" => array(\"type\" => \"arr\", \"value\" => array (\"oxtitle\", \"oxshortdesc\"))));\n $this->clearCache();\n $this->openShop();\n $this->searchFor(\"100\");\n $this->assertEquals(\"%YOU_ARE_HERE%: / %SEARCH%\", $this->getText(\"breadCrumb\"));\n $this->assertTextPresent(\"0 %HITS_FOR% \\\"100\\\"\");\n\n //art num is considered in search\n $this->callShopSC(\"oxConfig\", null, null, array(\"aSearchCols\" => array(\"type\" => \"arr\", \"value\" => array(\"oxtitle\", \"oxshortdesc\", \"oxsearchkeys\", \"oxartnum\"))));\n $this->clearTemp();\n $this->searchFor(\"100\");\n $this->assertEquals(\"%YOU_ARE_HERE%: / %SEARCH%\", $this->getText(\"breadCrumb\"));\n $this->assertTextPresent(\"4 %HITS_FOR% \\\"100\\\"\");\n $this->assertEquals(\"Test product 0 [EN] šÄßüл\", $this->clearString($this->getText(\"searchList_1\")));\n $this->assertEquals(\"Test product 1 [EN] šÄßüл\", $this->clearString($this->getText(\"searchList_2\")));\n $this->assertEquals(\"Test product 2 [EN] šÄßüл\", $this->clearString($this->getText(\"searchList_3\")));\n $this->assertEquals(\"Test product 3 [EN] šÄßüл\", $this->clearString($this->getText(\"searchList_4\")));\n $this->assertElementNotPresent(\"searchList_5\");\n\n $this->clickAndWait(\"searchList_3\");\n $this->assertEquals(\"%YOU_ARE_HERE%: / Search result for \\\"100\\\"\", $this->getText(\"breadCrumb\"));\n $this->assertEquals(\"Test product 2 [EN] šÄßüл\", $this->getText(\"//h1\"));\n $this->selectVariant(\"variants\", 1, \"var2 [EN] šÄßüл\", \"var2 [EN] šÄßüл\");\n $this->assertEquals(\"%YOU_ARE_HERE%: / Search result for \\\"100\\\"\", $this->getText(\"breadCrumb\"));\n $this->assertEquals(\"Test product 2 [EN] šÄßüл var2 [EN] šÄßüл\", $this->getText(\"//h1\"));\n\n $this->clickAndWait(\"//div[@id='overviewLink']/a\");\n $this->assertEquals(\"%YOU_ARE_HERE%: / %SEARCH%\", $this->getText(\"breadCrumb\"));\n $this->assertTextPresent(\"4 %HITS_FOR% \\\"100\\\"\");\n $this->assertEquals(\"Test product 0 [EN] šÄßüл\", $this->clearString($this->getText(\"searchList_1\")));\n $this->assertEquals(\"Test product 1 [EN] šÄßüл\", $this->clearString($this->getText(\"searchList_2\")));\n $this->assertEquals(\"Test product 2 [EN] šÄßüл\", $this->clearString($this->getText(\"searchList_3\")));\n $this->assertEquals(\"Test product 3 [EN] šÄßüл\", $this->clearString($this->getText(\"searchList_4\")));\n }", "function test_search_by_field() {\n\t\t$form = $this->factory->form->create_and_get();\n\t\t$this->assertNotEmpty( $form );\n\n\t\t$field_id = $this->factory->field->create( array( 'type' => 'email', 'form_id' => $form->id ) );\n\t\t$this->assertNotEmpty( $field_id );\n\t\t$this->assertTrue( is_numeric( $field_id ) );\n\n\t\t$entry_data = $this->factory->field->generate_entry_array( $form );\n\t\t$this->factory->entry->create_many( 10, $entry_data );\n\n\t $s_query = array( 'it.form_id' => $form->id );\n\n if ( is_callable('FrmProEntriesHelper::get_search_str') ) {\n\t\t\t$s = 'admin@example.org';\n\t //$s_query = FrmProEntriesHelper::get_search_str( $s_query, $s, $form->id, $field_id );\n }\n\n $items = FrmEntry::getAll( $s_query, '', '', true, false );\n\t\t$this->assertNotEmpty( $items );\n }", "protected function setFieldsForSearch( $fields ) {\n $this->_fieldsForSearch = $fields;\n }", "public function search($search);", "public function testFrontendSearchOrAnd()\n {\n //AND is used for search keys\n // Checking option ((If serveral Search Terms are entered, all Search Terms have to be found in Search Results (AND). (If this Setting is unchecked, only one Search Term has to be found (OR)) is ON\n $this->callShopSC(\"oxConfig\", null, null, array(\"blSearchUseAND\" => array(\"type\" => \"bool\", \"value\" => 'true')));\n $this->clearCache();\n $this->openShop();\n $this->searchFor(\"1000 1001\");\n $this->assertEquals(\"%YOU_ARE_HERE%: / %SEARCH%\", $this->getText(\"breadCrumb\"));\n $this->assertTextPresent(\"%NO_ITEMS_FOUND%\");\n $this->assertEquals(\"0 %HITS_FOR% \\\"1000 1001\\\"\", $this->getHeadingText(\"//h1\"));\n\n //OR is used for search keys\n //Checking option ((If serveral Search Terms are entered, all Search Terms have to be found in Search Results (AND). (If this Setting is unchecked, only one Search Term has to be found (OR)) is OFF\n $this->callShopSC(\"oxConfig\", null, null, array(\"blSearchUseAND\" => array(\"type\" => \"bool\", \"value\" => \"false\")));\n $this->clearTemp();\n $this->searchFor(\"1000 1001\");\n $this->assertEquals(\"2 %HITS_FOR% \\\"1000 1001\\\"\", $this->getHeadingText(\"//h1\"));\n }", "function fn_seo_additional_fields_in_search($params, &$fields, $sortings, $condition, &$join, $sorting, $group_by, &$tmp, $piece, $having, $lang_code)\n{\n if (isset($params['compact']) && $params['compact'] === YesNo::YES && !empty($params['q']) && $params['area'] === 'A' && !isset($fields['seo_name'])) {\n $tmp .= db_quote(' OR (?:seo_names.name LIKE ?s ?p)', '%' . preg_replace('/-[a-zA-Z]{1,3}$/i', '', str_ireplace(SEO_FILENAME_EXTENSION, '', $piece)) . '%', fn_get_company_condition('products.company_id'));\n\n $lang_condition = db_quote(' AND ?:seo_names.lang_code = ?s', $lang_code);\n $fields['seo_name'] = '?:seo_names.name as seo_name';\n $fields['seo_path'] = '?:seo_names.path as seo_path';\n $join .= db_quote(\n \" LEFT JOIN ?:seo_names ON ?:seo_names.object_id = products.product_id AND ?:seo_names.type = 'p' AND ?:seo_names.dispatch = '' ?p\",\n $lang_condition . fn_get_seo_company_condition('?:seo_names.company_id')\n );\n }\n}", "protected function processExtendedSearchParameters() {}", "public static function searchField($parameters){ }", "function arrange_search_edit($key)\n\t{\n\t\tglobal $fields, $type_info, $f_key, $allLangs, $rlActions;\n\n\t\t$field_info = $fields[$key];\n\t\t$field_values = explode(',', $field_info['Values']);\n\t\t\n\t\tforeach ($field_values as $value)\n\t\t{\n\t\t\t$search_key = $f_key .'_tab'.$value;\n\t\t\t\n\t\t\tforeach ($allLangs as $lang_key => $lang_value)\n\t\t\t{\n\t\t\t\t$phrase = $_POST['arrange_search'][$key][$value][$lang_value['Code']];\n\t\t\t\tif ( $phrase )\n\t\t\t\t{\n\t\t\t\t\t$lang_keys[] = array(\n\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t'Value' => $phrase\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'where' => array(\n\t\t\t\t\t\t\t'Code' => $lang_value['Code'],\n\t\t\t\t\t\t\t'Key' => 'search_forms+name+' . $search_key\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $lang_keys )\n\t\t{\n\t\t\t$rlActions -> update($lang_keys, 'lang_keys');\n\t\t}\n\t}", "public function makeSearchQuery( EarthIT_Storage_Search $search, array $options=array() );", "function search($search,$value,$exact) {\r\n\t\t$this->set_Input(\"search\", $search);\r\n\t\t$this->set_Input(\"value\", $value);\r\n\t\t$this->set_Input(\"exact\", $exact);\r\n\t}", "public function setSearch($keyword = '', array $fields_search = [])\n {\n $search = '';\n foreach ($fields_search as $field_mapping => $field) {\n $value = $this->request->get($field);\n if (is_numeric($field_mapping) && trim($value) != '') {\n $search .= \";$field:\" . $value;\n } elseif (trim($value) != '') {\n $search .= \";$field_mapping:\" . $value;\n }\n }\n $search = trim($search, ';');\n $keyword = $this->request->get($keyword, null);\n $this->search = $search ? ($keyword ? $keyword . ';' . $search : $search) : $keyword;\n return $this;\n }", "public function runSearch()\n {\n $this->modifyDatabaseCriteriaAccordingToValuesFromFilterForm();\n }", "public function testSearch() {\n\t\t$contacto = new Contactos;\n\t\t$contacto->id = '1113304996';\n\t\t$contactoEncontrado = $contacto->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a dos\n\t\t$this->assertNotNull( $contactoEncontrado );\n\t}", "public function testSearchAddressMultiple()\n {\n\n }", "public function searchItems( EarthIT_Storage_Search $search, array $options=array() );", "public function updatingSearch(): void\n {\n $this->resetPage();\n }", "protected function setSearch($search = 0) {\n\n $this->search = $search ? 1 : 0;\n }", "public function updatingSearch(): void\n {\n $this->gotoPage(1);\n }", "public function testSearchWithMultiFieldAssociation()\n {\n $this->loadFixtures();\n\n $table = $this->createTable(PostCommentAuthorType::class);\n\n $table->handle(new Request(array(\n 'search' => 'Foo'\n )));\n\n $data = $table->getData();\n\n $this->assertCount(2, $data);\n }", "public function updatingSearch() {\n $this->resetPage();\n }", "abstract function set_search_set($filter);", "public function test_updateCustomFields() {\n\n }", "public function test_updateCustomFields() {\n\n }", "public function testQueryAlter() {\n $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);\n $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);\n\n // Log in with sufficient privileges.\n $this->drupalLogin($this->drupalCreateUser([\n 'create page content',\n 'search content',\n ]));\n\n // Create a node and an article with the same keyword. The query alter\n // test module will alter the query so only articles should be returned.\n $data = [\n 'type' => 'page',\n 'title' => 'test page',\n 'body' => [['value' => 'pizza']],\n ];\n $this->drupalCreateNode($data);\n\n $data['type'] = 'article';\n $data['title'] = 'test article';\n $this->drupalCreateNode($data);\n\n // Update the search index.\n $this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex();\n\n // Search for the body keyword 'pizza'.\n $this->drupalGet('search/node');\n $this->submitForm(['keys' => 'pizza'], 'Search');\n // The article should be there but not the page.\n $this->assertSession()->pageTextContains('article');\n $this->assertSession()->pageTextNotContains('page');\n }", "abstract protected function _search($query, $params = array());", "private function _update_searchname() {\n $this->searchname = sprintf('%s%s', text::searchable($this->first_name), text::searchable($this->last_name));\n }", "public function update(Request $request, Search $search)\n {\n //\n }", "public function set_search($search)\n\t\t{\n\t\t\t$this->set_config(\"search\", $search);\n\t\t}", "abstract public function getFieldsSearchable();", "public function searchQuery($searchVariables)\n {\n }", "public function updatedSearch()\n {\n $this->resetPage();\n }", "public function test_updateDocumentFields() {\n\n }", "public function test_updateDocumentFields() {\n\n }", "abstract protected function getModelSearch();", "public function processSearch($search_type)\n\t{\n\t\t# Loop through search types.\n\t\tforeach($search_type as $type)\n\t\t{\n\t\t\tswitch($type)\n\t\t\t{\n\t\t\t\tcase \"users\":\n\t\t\t\t\t# Set the fields to the data member.\n\t\t\t\t\t$this->setFields(array('ID', 'display', 'username', 'title', 'fname', 'lname', 'email'));\n\t\t\t\t\t# Set the tables to the data member.\n\t\t\t\t\t$this->setTables('users');\n\t\t\t\t\t# Perform search.\n\t\t\t\t\t$this->searchUsers();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"subcontent\":\n\t\t\t\t\t# Set the fields to the data member.\n\t\t\t\t\t$this->setFields(array('id', 'title', 'link', 'file', 'availability', 'visibility', 'date', 'premium', 'branch', 'institution', 'publisher', 'text_language', 'text', 'trans_language', 'text_trans', 'hide', 'image', 'contributor'));\n\t\t\t\t\t# Set the tables to the data member.\n\t\t\t\t\t$this->setTables('subcontent');\n\t\t\t\t\t# Perform search.\n\t\t\t\t\t$this->searchSubContent();\n\t\t\t\t\tbreak;\n\t\t\t\t/*\n\t\t\t\tcase \"videos\":\n\t\t\t\t\t# Set the fields to the data member.\n\t\t\t\t\t$this->setFields(array('title'));\n\t\t\t\t\t# Set the tables to the data member.\n\t\t\t\t\t$this->setTables('videos');\n\t\t\t\t\t# Perform search.\n\t\t\t\t\t$this->searchVideos();\n\t\t\t\t\tbreak;\n\t\t\t\t*/\n\t\t\t\tcase \"all\":\n\t\t\t\t\t# NOTE! Not finished yet.\n\t\t\t\t\t# Search entire site.\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "function _admin_search_query()\n{\n}", "public function testSearchByContent()\n {\n\n }", "public function testParameters()\n {\n $parameters = $this->app->make(SearchTerms::class);\n\n $parameters->replace($post = [\n 'term' => 'fire publisher:someone author:\"J K Rawlings\"',\n 'formats' => 'paperback',\n 'recent' => true,\n 'categories' => 'Y',\n 'match' => 'author'\n ]);\n\n $parameters->validateResolved();\n\n $this->assertContains([\"term\" => \"fire\"], $parameters->validated(), \"term has not been cleansed of in-term filters.\");\n $this->assertContains([\"contributors\" => \"J K Rawlings\"], $parameters->validated(), \"in-term filters have not been allocated\");\n $this->assertContains([\"publisher\" => \"someone\"], $parameters->validated(), \"in-term filters have not been allocated.\");\n $this->assertContains([\"websiteCategoryCodes\" => \"Y\"], $parameters->validated(), \"Translation of 'categories' to 'websiteCategoryCodes' failed\");\n $this->assertContains([\"match\" => \"author\"], $parameters->validated(), \"match must be in a allowed amount of options\");\n }", "public function set_searchable_fields(array $fields)\n {\n $this->search_fields = $fields;\n }", "public function recordsetSearchValidated()\n {\n // Example:\n //$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n }", "abstract public function searchExecuted();", "function customSearch()\n {\n }", "function setSearchField($arr_field)\r\n\t{\r\n\t\t$this->arr_search_field = $arr_field;\r\n\t}", "public function fieldsUpdated(SearchApiIndex $index) {\n $fields = &$this->options['indexes'][$index->machine_name];\n $new_fields = $index->getFields();\n\n $reindex = FALSE;\n $cleared = FALSE;\n $change = FALSE;\n\n $set = $this->setDb();\n\n foreach ($fields as $name => $field) {\n if (!isset($new_fields[$name])) {\n db_drop_table($field['table']);\n unset($fields[$name]);\n $change = TRUE;\n continue;\n }\n $old_type = $field['type'];\n $new_type = $new_fields[$name]['type'];\n $fields[$name]['type'] = $new_type;\n $fields[$name]['boost'] = $new_fields[$name]['boost'];\n $old_inner_type = search_api_extract_inner_type($old_type);\n $new_inner_type = search_api_extract_inner_type($new_type);\n if ($old_type != $new_type) {\n $change = TRUE;\n if ($old_inner_type == 'text' || $new_inner_type == 'text'\n || search_api_list_nesting_level($old_type) != search_api_list_nesting_level($new_type)) {\n // A change in fulltext or list status necessitates completely\n // clearing the index.\n $reindex = TRUE;\n if (!$cleared) {\n $cleared = TRUE;\n $this->deleteItems('all', $index);\n }\n db_drop_table($field['table']);\n $this->createFieldTable($index, $new_fields[$name], $field['table']);\n }\n elseif ($this->sqlType($old_inner_type) != $this->sqlType($new_inner_type)) {\n // There is a change in SQL type. We don't have to clear the index, since types can be converted.\n db_change_field($field['table'], 'value', 'value', $this->sqlType($new_type) + array('description' => \"The field's value for this item.\"));\n $reindex = TRUE;\n }\n elseif ($old_inner_type == 'date' || $new_inner_type == 'date') {\n // Even though the SQL type stays the same, we have to reindex since conversion rules change.\n $reindex = TRUE;\n }\n }\n elseif ($field['boost'] != $new_fields[$name]['boost']) {\n $change = TRUE;\n if (!$reindex && $new_inner_type == 'text') {\n $multiplier = $new_fields[$name]['boost'] / $field['boost'];\n db_update($field['table'], $this->query_options)\n ->expression('score', 'score * :mult', array(':mult' => $multiplier))\n ->execute();\n }\n }\n // Make sure the set table now exists. (Especially important when we\n // actually add the index for the first time.)\n if (!db_table_exists($field['table'])) {\n $this->createFieldTable($index, $new_fields[$name], $field['table']);\n }\n unset($new_fields[$name]);\n }\n\n $prefix = 'search_api_db_' . $index->machine_name. '_';\n // These are new fields that were previously not indexed.\n foreach ($new_fields as $name => $field) {\n $reindex = TRUE;\n $table = $this->findFreeTable($prefix, $name);\n $this->createFieldTable($index, $field, $table);\n $fields[$name]['table'] = $table;\n $fields[$name]['type'] = $field['type'];\n $fields[$name]['boost'] = $field['boost'];\n $change = TRUE;\n }\n\n if ($set) {\n $this->resetDb();\n }\n\n if ($change) {\n $this->server->save();\n }\n return $reindex;\n }", "function setSearch(Ac_Model_Search $search = null) {\n if ($search !== ($oldSearch = $this->search)) {\n if ($this->isOpen) throw new Ac_E_InvalidUsage(\"Cannot \".__FUNCTION__.\"() while isOpen(). close() first\");\n $this->search = $search;\n if ($this->search) $this->searchPrototype = array();\n }\n }", "function search_and_replace()\n { \n global $DSP, $IN, $DB, $LANG;\n \n if ( ! $DSP->allowed_group('can_admin_utilities'))\n {\n return $DSP->no_access_message();\n }\n \n $search = $IN->GBL('searchterm', 'POST');\n $replace = $IN->GBL('replaceterm', 'POST');\n $field = $IN->GBL('fieldname', 'POST');\n \n\n if ( ! $search || ! $replace || ! $field)\n {\n return Utilities::search_and_replace_form();\n }\n \n if ($field == 'title')\n {\n \t$sql = \"UPDATE `exp_weblog_titles` SET `$field` = REPLACE($field, '$search', '$replace')\";\n }\n elseif ($field == 'template_data')\n {\n \t$sql = \"UPDATE `exp_templates` SET `$field` = REPLACE($field, '$search', '$replace') WHERE\";\n \n\t\t\t$query = $DB->query(\"SELECT group_id FROM exp_template_groups WHERE is_user_blog = 'n'\");\n\t\t\t\n\t\t\tforeach ($query->result as $row)\n\t\t\t{\n\t\t\t\t$sql .= \" group_id = '\".$row['group_id'].\"' OR\";\n\t\t\t}\n\t\t\t\n\t\t\t$sql = substr($sql, 0, -2); \n }\n elseif(eregi('^template_', $field))\n {\n \t$sql = \"UPDATE `exp_templates` SET `template_data` = REPLACE(template_data, '$search', '$replace') \n \t\t\tWHERE group_id = '\".substr($field,9).\"'\";\n }\n else\n {\n \t$sql = \"UPDATE `exp_weblog_data` SET `$field` = REPLACE($field, '$search', '$replace') WHERE\";\n \n\t\t\t$query = $DB->query(\"SELECT weblog_id FROM exp_weblogs WHERE is_user_blog = 'n'\");\n\t\t\t\n\t\t\tforeach ($query->result as $row)\n\t\t\t{\n\t\t\t\t$sql .= \" weblog_id = '\".$row['weblog_id'].\"' OR\";\n\t\t\t}\n\t\t\t\n\t\t\t$sql = substr($sql, 0, -2);\n\t\t}\n \n \n $DB->query($sql);\n \n $DSP->set_return_data(\n $LANG->line('utilities'),\n \n $DSP->heading($LANG->line('search_and_replace')). \n $DSP->qdiv('', BR.$LANG->line('rows_replaced').NBS.NBS.$DB->affected_rows),\n\n $LANG->line('search_and_replace')\n ); \n }", "public function testExactBatch(): void\n {\n $objects = [\n new SearchableStub('search1'),\n new SearchableStub('search2'),\n ];\n\n $expected = [\n [\n new DocumentUpdate(\n 'valid_suffix',\n 'search1',\n ['search' => 'body', '_access_tokens' => ['anonymous']]\n ),\n new DocumentUpdate(\n 'valid_suffix',\n 'search2',\n ['search' => 'body', '_access_tokens' => ['anonymous']]\n ),\n ],\n ];\n\n $handler = new TransformableSearchHandlerStub($objects);\n\n $client = new ClientStub();\n $populator = $this->getPopulator($client);\n\n $populator->populate($handler, '_suffix', 2);\n\n self::assertEquals($expected, $client->getUpdatedIndices());\n }", "public function searchFields($form)\n {\n }", "public function testSearchTermsByGet() {\n $this->markTestIncomplete('This test has not been implemented.');\n }", "function EditSearch($aInput)\n{\n if ($aInput[\"OK\"] == 1)\n {\n list($check, $catnr, $title, $poster, $subcata, $subcatd) = CheckAndFixInput($aInput);\n\n // Update search values in the database.\n $sql = \"UPDATE snuffel \".\n \"SET cat = $catnr, title = $title, poster = $poster, subcata = $subcata, subcatd = $subcatd \".\n \"WHERE id = \".$aInput[\"ID\"];\n \n if ($check) {\n ExecuteQuery($sql);\n \n // Determine page number.\n $sql = \"SELECT row \".\n \"FROM (SELECT @row := @row + 1 AS row, title, id FROM (SELECT @row := 0) r, snuffel ORDER BY cat, title) AS dummy \".\n \"WHERE id = \".$aInput[\"ID\"]; \n list($row) = GetItemsFromDatabase($sql);\n \n $aInput[\"PAGENR\"] = ceil($row/cItems); \n }\n \n // Reset values.\n $aInput[\"CAT\"] = null;\n $aInput[\"TITLE\"] = null;\n $aInput[\"GENRE\"] = null;\n $aInput[\"POSTER\"] = null;\n \n $aInput[\"OK\"] = -1;\n $aInput[\"MODE\"] = \"ADD\";\n $aInput[\"ID\"] = $aInput[\"ID\"]; \n \n }\n \n if ($aInput[\"OK\"] == 0)\n { \n // Reset values.\n $aInput[\"CAT\"] = null;\n $aInput[\"TITLE\"] = null;\n $aInput[\"GENRE\"] = null;\n $aInput[\"POSTER\"] = null;\n \n $aInput[\"MODE\"] = \"ADD\";\n $aInput[\"ID\"] = 0;\n }\n \n return $aInput;\n}", "public function savesearchAction()\n {\n \t$this->_helper->viewRenderer->setNoRender();\n \t\n \t$searchform = $this->getSearchForm();\n \t$formData = $this->getRequest()->getParams();\n\t \t\t\n \tif ($searchform->isValidPartial($formData))\n \t{\n \t\t$values = $searchform->getValues();\n\t \t$searchname = $values[\"savesearchinput\"];\n\t\t\t$jsondata = $values[\"advancedsearchparameters\"];\n\t\t\t$this->saveSearch($searchname, $jsondata);\n \t}\n \telse \n \t{\n \t\t//Assign the override input name\n \t\t$formData['hiddenoverridesearchnameinput'] = $formData['savesearchinput'];\n \t\t$this->displaySearchErrors($formData, 'There is a problem with your search name. Please try again.');\n\t\t}\n }", "public function updateSearchIndex()\n {\n $searchIndex =\n $this->getFullName()\n . ' '\n . $this->getEmail();\n \n $this->setSearchIndex($searchIndex);\n }", "function Recordset_SearchValidated() {\r\n\r\n\t\t// Example:\r\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\r\n\r\n\t}", "function Recordset_SearchValidated() {\r\n\r\n\t\t// Example:\r\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\r\n\r\n\t}", "protected function applySearch() {\n if (!$this->searchQuery) {\n return;\n }\n\n foreach ($this->values as $index => $module) {\n if (strpos($module->getName(), $this->searchQuery) === false) {\n unset($this->values[$index]);\n }\n }\n }", "function setParamsForSearchPanel() \n\t{\n\t\tif(!$this->searchPanelActivated)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tinclude_once(getabspath(\"classes/searchclause.php\"));\n\t\t$this->needSearchClauseObj = true;\t\n\t\t\n\t\t$seachTableName = $this->getBrickTableName(\"searchpanel\");\n\t\tif($seachTableName)\n\t\t{\n\t\t\t//if the brick's table name is set it'll used as the table name for the searchpanel's ProjectSettings object\n\t\t\t$this->pSetSearch = new ProjectSettings($seachTableName, PAGE_SEARCH);\n\t\t\t//set the correct search table's name\n\t\t\t$this->searchTableName = $seachTableName;\n\t\t\t//add some globale settings for the search table\n\t\t\t$this->settingsMap[\"globalSettings\"][\"shortTNames\"][$seachTableName] = $this->pSetSearch->getShortTableName();\n\t\t\t$this->permis[$this->searchTableName] = $this->getPermissions($seachTableName);\n\t\t\t\n\t\t\tif( $this->permis[$this->searchTableName][\"search\"] && (!$this->isPageTableBased() || $this->pageType == PAGE_REGISTER) )\n\t\t\t{\n\t\t\t\t//for edit controls to render correctly\n\t\t\t\t$this->tableBasedSearchPanelAdded = true;\n\t\t\t}\n\t\t}\n\t}", "public function searchIngredient($search)\n {\n }", "public function testSearchByAlias()\n {\n }", "public function testInitializationWithPartialValues() {\n // setting only field name\n $searchField = new SolrSimpleSearchField('content');\n $this->assertEquals(\"content:*\", $searchField->toQuery());\n\n // setting field name and value\n $searchField = new SolrSimpleSearchField('content', 'blog');\n $this->assertEquals(\"content:blog\", $searchField->toQuery());\n \n }", "function testSearch() {\n\t\t$this->get_page(\"post/list/author=bob/1\");\n\t}", "public function setSearchFields($searchFields)\n {\n $this->searchFields = (array) $searchFields;\n \n return $this;\n }", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function setSearchAction()\n {\n $this->m_search_action = func_get_args();\n }", "public function testGetNotesBySearch()\n {\n }", "public abstract function searchQuery();", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "public function setSearchQuery(string $search)\n {\n $this->searchQuery = $search;\n }", "public function setSearchName($name_search)\n {\n $this->name_search = $name_search;\n $this->search = true;\n }", "public function admin_search() {\n $this->search();\n }", "public function testSearch() {\n\t\t$subtemaBusqueda = new Subtema;\n\t\t$subtemaBusqueda->nombre = 'Queja Investigador';\n\t\t$subtemas = $subtemaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $subtemas ), 1 );\n\t}", "public function modifySearchWords(&$searchWordInformation, $pObj) {\n $searchWordInformation['wordsAgainst'] = str_replace( \"+\" , \"\", $searchWordInformation['wordsAgainst'] ) ;\n $searchWordInformation['wordsAgainst'] = \"+\" . str_replace( \" \" , \" +\", $searchWordInformation['wordsAgainst'] ) ;\n\t}", "public function customSearch()\n {\n // no action\n }", "public function testGetFieldsToUpdate()\n {\n $this->assertEquals([\n 'bar' => '2',\n 'baq' => 4,\n ], Helpers::getFieldsToUpdate([\n 'foo' => 1,\n 'bar' => 2,\n 'baz' => '3',\n ], [\n 'foo' => 1,\n 'bar' => '2',\n 'baq' => 4,\n ]));\n\n $this->assertEquals([], Helpers::getFieldsToUpdate([\n 'foo' => 1,\n 'bar' => 2,\n ], [\n 'foo' => 1,\n 'bar' => 2,\n ]));\n }", "public function search($field, $query, $list, $compare, $column_table, $relation_table);", "public function testSearch() {\n $searchCriteria = array(\n \"begin_date\" => new \\DateTime(\"2013-01-01 00:00:00\"),\n \"end_date\" => new \\DateTime(\"2016-02-29 00:00:00\"),\n \"author\" => \"Cyril L'orphelin\");\n\n $modelBd = new ModelBroadcast($this->container);\n\n $this->assertTrue(count($modelBd->search($searchCriteria)) >= 0, \"there must be none or at least one result\");\n\n //test with author and subject\n $searchCriteria = array(\n \"begin_date\" => new \\DateTime(\"2013-01-01 00:00:00\"),\n \"end_date\" => new \\DateTime(\"2016-02-29 00:00:00\"),\n \"author\" => \"Cyril L'orphelin\",\n \"subject\" => \"test confirmation\");\n\n $modelBd = new ModelBroadcast($this->container);\n\n $this->assertTrue(count($modelBd->search($searchCriteria)) >= 0, \"there must be none or at least one result\");\n\n\n //test with author, subject and email\n $searchCriteria = array(\n \"begin_date\" => new \\DateTime(\"2013-01-01 00:00:00\"),\n \"end_date\" => new \\DateTime(\"2016-02-29 00:00:00\"),\n \"author\" => \"Cyril L'orphelin\",\n \"subject\" => \"test confirmation\",\n \"email\" => \"testestest\");\n\n $modelBd = new ModelBroadcast($this->container);\n\n $this->assertTrue(count($modelBd->search($searchCriteria)) >= 0, \"there must be none or at least one result\");\n\n\n //test with author, subject, email, body\n $searchCriteria = array(\n \"begin_date\" => new \\DateTime(\"2013-01-01 00:00:00\"),\n \"end_date\" => new \\DateTime(\"2016-02-29 00:00:00\"),\n \"author\" => \"Cyril L'orphelin\",\n \"subject\" => \"test confirmation\",\n \"email\" => \"testestest\",\n \"body\" => \"testestestestestestestestestestestestestestestestestestestestestestest\");\n\n $modelBd = new ModelBroadcast($this->container);\n\n $this->assertTrue(count($modelBd->search($searchCriteria)) >= 0, \"there must be none or at least one result\");\n }", "public function testSearchBy()\n {\n $parameters = [\n 'q' => 'omelet',\n 'i' => 'onions,garlic',\n 'p' => 1,\n ];\n\n // Gets the container.\n static::bootKernel();\n $this->container = static::$kernel->getContainer();\n\n // Instances the RecipeService class.\n $recipeService = new RecipeService($this->container);\n $result = $recipeService->searchBy($parameters);\n\n // Asserts for the PHPUnit tests.\n $this->assertArrayHasKey('status', $result);\n $this->assertEquals(200, $result['status']);\n $this->assertArrayHasKey('data', $result);\n $this->assertGreaterThan(0, count($result['data']));\n $this->assertArrayHasKey('title', $result['data'][0]);\n $this->assertArrayHasKey('href', $result['data'][0]);\n $this->assertArrayHasKey('ingredients', $result['data'][0]);\n $this->assertArrayHasKey('thumbnail', $result['data'][0]);\n }", "public function update($searchableEntities)\n {\n }", "public function test_classWithParamsSearchAndReplace()\n\t{\n\t\t$str = 'The sheep goes [tester.foo, extra=\"extra this\"]';\n\n\t\t$str = $this->matcher\n\t\t\t\t\t->load($str, $this->collection)\n\t\t\t\t\t->searchAndReplace();\n\n\t\t$this->assertEquals('The sheep goes fooextra this', $str);\n\t}" ]
[ "0.66144115", "0.6232436", "0.622864", "0.62075216", "0.6192739", "0.6185111", "0.61632377", "0.6150599", "0.60134196", "0.5993713", "0.59828156", "0.5968064", "0.5950053", "0.5938622", "0.5925659", "0.591584", "0.58873373", "0.58727956", "0.5861962", "0.58365005", "0.5831719", "0.58219147", "0.58031994", "0.57998323", "0.57593113", "0.57204497", "0.5713232", "0.57121307", "0.5698558", "0.5689187", "0.56868947", "0.5675224", "0.56742543", "0.56659067", "0.56578547", "0.56456816", "0.5640332", "0.5633735", "0.5633735", "0.56315297", "0.56201905", "0.56026787", "0.56020916", "0.55986685", "0.5570783", "0.5547748", "0.5546466", "0.55354065", "0.55354065", "0.5523469", "0.5513572", "0.5511168", "0.5500523", "0.54970855", "0.54662585", "0.54632545", "0.54587245", "0.5458214", "0.5455058", "0.5453186", "0.54508734", "0.5439715", "0.5430305", "0.54286045", "0.5423605", "0.5415675", "0.5411556", "0.541044", "0.540794", "0.540794", "0.5407444", "0.5407084", "0.5403394", "0.5401105", "0.5382991", "0.53763646", "0.5362747", "0.5359353", "0.5359353", "0.5353408", "0.5345782", "0.53439873", "0.53262013", "0.53262013", "0.53262013", "0.53262013", "0.53262013", "0.53262013", "0.5310921", "0.53097385", "0.53020275", "0.52973443", "0.52956873", "0.52691704", "0.52643764", "0.5263807", "0.5260738", "0.52539265", "0.5253524", "0.5249792" ]
0.76962185
0
aggiungo gli status "scaduto" e "annullato" per gestire albo pretorio Register Custom Post Status
Добавляю статусы "просрочен" и "отменен" для управления регистром в альбоме претории Custom Post Status
function dsi_register_custom_post_status(){ register_post_status( 'scaduto', array( 'label' => _x( 'Scaduto', 'design_scuole_italia' ), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop( 'Scaduto <span class="count">(%s)</span>', 'Scaduti <span class="count">(%s)</span>' ), ) ); register_post_status( 'annullato', array( 'label' => _x( 'Annullato', 'design_scuole_italia' ), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop( 'Annullato <span class="count">(%s)</span>', 'Annullati <span class="count">(%s)</span>' ), ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_post_status()\n {\n }", "public static function register_post_status()\n {\n }", "public function update_status_post()\n {\n\n $post_add = $this->post();\n if($post_add)\n {\n $id_conekta = $this->post(\"id_conekta\");\n\n $status = $this->conekta_model->update($id_conekta,array('status'=>1));\n if($status)\n {\n\n $data = array('response' => 'ok');\n } //end if($inscripciones)\n else\n {\n $data = array('response' => 'error','message'=>'No se encuentran inscripciones');\n\n }//end else\n }//end if($post_add)\n else\n {\n $data = array('response' => 'error','message'=>'Sin datos');\n\n }//end else\n $this->response($data);\n }", "public function register_post_status() {\n\t\t/**\n\t\t * Payment post statuses\n\t\t */\n\t\tregister_post_status( 'payment_pending', array(\n\t\t\t'label' => _x( 'Pending', 'Payment status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Pending <span class=\"count\">(%s)</span>', 'Pending <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'payment_processing', array(\n\t\t\t'label' => _x( 'Processing', 'Payment status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Processing <span class=\"count\">(%s)</span>', 'Processing <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'payment_on_hold', array(\n\t\t\t'label' => _x( 'On Hold', 'Payment status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'On Hold <span class=\"count\">(%s)</span>', 'On Hold <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'payment_completed', array(\n\t\t\t'label' => _x( 'Completed', 'Payment status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Completed <span class=\"count\">(%s)</span>', 'Completed <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'payment_cancelled', array(\n\t\t\t'label' => _x( 'Cancelled', 'Payment status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Cancelled <span class=\"count\">(%s)</span>', 'Cancelled <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'payment_refunded', array(\n\t\t\t'label' => _x( 'Refunded', 'Payment status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Refunded <span class=\"count\">(%s)</span>', 'Refunded <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'payment_failed', array(\n\t\t\t'label' => _x( 'Failed', 'Payment status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Failed <span class=\"count\">(%s)</span>', 'Failed <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'payment_expired', array(\n\t\t\t'label' => _x( 'Expired', 'Payment status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Expired <span class=\"count\">(%s)</span>', 'Expired <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\t/**\n\t\t * Subscription post statuses\n\t\t */\n\t\tregister_post_status( 'subscr_pending', array(\n\t\t\t'label' => _x( 'Pending', 'Subscription status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Pending <span class=\"count\">(%s)</span>', 'Pending <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'subscr_cancelled', array(\n\t\t\t'label' => _x( 'Cancelled', 'Subscription status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Cancelled <span class=\"count\">(%s)</span>', 'Cancelled <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'subscr_expired', array(\n\t\t\t'label' => _x( 'Expired', 'Subscription status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Expired <span class=\"count\">(%s)</span>', 'Expired <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'subscr_failed', array(\n\t\t\t'label' => _x( 'Failed', 'Subscription status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Failed <span class=\"count\">(%s)</span>', 'Failed <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'subscr_active', array(\n\t\t\t'label' => _x( 'Active', 'Subscription status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Active <span class=\"count\">(%s)</span>', 'Active <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\n\t\tregister_post_status( 'subscr_completed', array(\n\t\t\t'label' => _x( 'Completed', 'Subscription status', 'pronamic_ideal' ),\n\t\t\t'public' => false,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_in_admin_all_list' => true,\n\t\t\t'show_in_admin_status_list' => true,\n\t\t\t'label_count' => _n_noop( 'Completed <span class=\"count\">(%s)</span>', 'Completed <span class=\"count\">(%s)</span>', 'pronamic_ideal' ),\n\t\t) );\n\t}", "function cpgwwc_register_post_statuses() \n{\n register_post_status( 'wc-pay_au', array(\n 'label' => _x( 'Платеж авторизован', 'WooCommerce Order status', 'text_domain' ),\n 'public' => true,\n 'exclude_from_search' => false,\n 'show_in_admin_all_list' => true,\n 'show_in_admin_status_list' => true,\n 'label_count' => _n_noop( 'Approved (%s)', 'Approved (%s)', 'text_domain' )\n ) );\n register_post_status( 'wc-pay_delivered', array(\n 'label' => _x( 'Доставлен', 'WooCommerce Order status', 'text_domain' ),\n 'public' => true,\n 'exclude_from_search' => false,\n 'show_in_admin_all_list' => true,\n 'show_in_admin_status_list' => true,\n 'label_count' => _n_noop( 'Approved (%s)', 'Approved (%s)', 'text_domain' )\n ) );\n}", "public static function custom_contact_entry_status() {\r\r\n register_post_status(\r\r\n 'super_unread',\r\r\n array(\r\r\n 'label' => __( 'Unread', 'super-forms' ),\r\r\n 'public' => true,\r\r\n 'exclude_from_search' => false,\r\r\n 'show_in_admin_all_list' => true,\r\r\n 'show_in_admin_status_list' => true,\r\r\n 'label_count' => _n_noop( 'Unread <span class=\"count\">(%s)</span>', 'Unread <span class=\"count\">(%s)</span>' ),\r\r\n )\r\r\n );\r\r\n register_post_status(\r\r\n 'super_read', \r\r\n array(\r\r\n 'label' => __('Read', 'super-forms' ),\r\r\n 'public' => true,\r\r\n 'exclude_from_search' => false,\r\r\n 'show_in_admin_all_list' => true,\r\r\n 'show_in_admin_status_list' => true,\r\r\n 'label_count' => _n_noop( 'Read <span class=\"count\">(%s)</span>', 'Read <span class=\"count\">(%s)</span>' ),\r\r\n )\r\r\n );\r\r\n register_post_status(\r\r\n 'backup', \r\r\n array(\r\r\n 'label' => __('Backups', 'super-forms' ),\r\r\n 'public' => false,\r\r\n 'exclude_from_search' => true,\r\r\n 'show_in_admin_all_list' => false,\r\r\n 'show_in_admin_status_list' => false,\r\r\n 'label_count' => _n_noop( 'Backups <span class=\"count\">(%s)</span>', 'Backups <span class=\"count\">(%s)</span>' ),\r\r\n )\r\r\n );\r\r\n\r\r\n }", "function fa_output_post_status( $status ){\n\tswitch ( $status ) {\n\t\tcase 'private':\n\t\t\t_e('Privately Published', 'fapro');\n\t\t\tbreak;\n\t\tcase 'publish':\n\t\t\t_e('Published', 'fapro');\n\t\t\tbreak;\n\t\tcase 'expired':\n\t\t\t_e('Expired', 'fapro');\n\t\t\tbreak;\t\n\t\tcase 'future':\n\t\t\t_e('Scheduled', 'fapro');\n\t\t\tbreak;\n\t\tcase 'pending':\n\t\t\t_e('Pending Review', 'fapro');\n\t\t\tbreak;\n\t\tcase 'draft':\n\t\tcase 'auto-draft':\n\t\t\t_e('Draft', 'fapro');\n\t\t\tbreak;\n\t}\n}", "public static function register_post_status() {\n\t\t// Status of 'rejected' indicates a photo that was rejected from appearing on the site.\n\t\tregister_post_status( self::get_post_status(), array(\n\t\t\t\t'label' => __( 'Rejected', 'wporg-photos' ),\n\t\t\t\t'public' => false,\n\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t'show_in_admin_all_list' => false,\n\t\t\t\t'show_in_admin_status_list' => true,\n\t\t\t\t'label_count' => _n_noop( 'Rejected <span class=\"count\">(%s)</span>', 'Rejected <span class=\"count\">(%s)</span>', 'wporg-photos' ),\n\t\t) );\n\t}", "function _appthemes_register_disputes_statuses() {\n\n\tregister_post_status( APP_DISPUTE_STATUS_PAY, array(\n\t\t'public' => true,\n\t\t'show_in_admin_all_list' => true,\n\t\t'show_in_admin_status_list' => true,\n\t\t'label_count' => _n_noop( 'Paid <span class=\"count\">(%s)</span>', 'Paid <span class=\"count\">(%s)</span>', APP_TD ),\n\t));\n\n\tregister_post_status( APP_DISPUTE_STATUS_REFUND, array(\n\t\t'public' => true,\n\t\t'show_in_admin_all_list' => true,\n\t\t'show_in_admin_status_list' => true,\n\t\t'label_count' => _n_noop( 'Refunded <span class=\"count\">(%s)</span>', 'Refunded <span class=\"count\">(%s)</span>', APP_TD ),\n\t));\n\n}", "function dsi_documento_add_title_status($column_name, $post_ID) {\n if ($column_name == 'new-title') {\n $cont = get_the_title();\n $status = get_post_status();\n echo \"<strong>\";\n ?>\n <a class=\"row-title\" href=\"<?php echo esc_url( home_url( '/' ) ); ?>wp-admin/post.php?post=<?php echo $post_ID; ?>&action=edit\"><?php echo strip_tags($cont); ?></a>\n <?php\n if($status == \"annullato\")\n echo \" - <span class=\\\"post-state\\\" style='color: #ca334a;'>Annullato</span>\";\n else if($status == \"draft\")\n echo \" - <span class=\\\"post-state\\\">Bozza</span>\";\n else if($status == \"scaduto\")\n echo \" - <span class=\\\"post-state\\\">Scaduto</span>\";\n echo \"</strong>\";\n }\n}", "function register_post_type_statuses() {\n \n // Payment Statuses\n register_post_status( 'challenge', array(\n 'label' => _x( 'Challenge', 'challenge, payment status', 'edd' ),\n 'public' => true,\n 'exclude_from_search' => false,\n 'show_in_admin_all_list' => true,\n 'show_in_admin_status_list' => true,\n 'label_count' => _n_noop( 'Challange <span class=\"count\">(%s)</span>', 'Challenge <span class=\"count\">(%s)</span>', 'edd' )\n ) );\n register_post_status( 'cancel', array(\n 'label' => _x( 'Cancel', 'cancel, payment status', 'edd' ),\n 'public' => true,\n 'exclude_from_search' => false,\n 'show_in_admin_all_list' => true,\n 'show_in_admin_status_list' => true,\n 'label_count' => _n_noop( 'Cancel <span class=\"count\">(%s)</span>', 'Cancel <span class=\"count\">(%s)</span>', 'edd' )\n ) );\n register_post_status( 'on_process', array(\n 'label' => _x( 'On Process', 'on_process, payment status', 'edd' ),\n 'public' => true,\n 'exclude_from_search' => false,\n 'show_in_admin_all_list' => true,\n 'show_in_admin_status_list' => true,\n 'label_count' => _n_noop( 'On Process <span class=\"count\">(%s)</span>', 'On Process <span class=\"count\">(%s)</span>', 'edd' )\n ) ); \n}", "public function setStatus() {\n $view = USingleton::getInstance(\"VRegistrazione\");\n $dati = $view->getDatiStato();\n $session = USingleton::getInstance(\"USession\");\n $fuser = new FUtente();\n $user = $fuser->load($session->leggi_valore(\"email\"));\n $user->setStatus($dati[\"status\"]);\n $fuser->update($user);\n $view_ricerca = USingleton::getInstance('VRicerca');\n $view_ricerca->displayProfiloUtente($user);\n }", "public function getStatusPostagem()\n {\n return $this->statusPostagem;\n }", "function change_post_status( $req ) {\n\t$app_key = $req['APIKey'];\n\t$app_secret = $req['APISecret'];\n\n\t$post_status = $req['payload']['inboundFieldValues']['statusColumnValue']['label']['index'];\n\t$post_item_id = $req['payload']['inboundFieldValues']['itemId'];\n\n\t$check = check_auth( $app_key, $app_secret );\n\n\tif ( $check ) {\n\t\t$post_id = get_item_post_id( $post_item_id );\n\n\t\tif ( $post_status == 1 ) {\n\t\t\t$wp_post_status = 'publish';\n\t\t} else {\n\t\t\t$wp_post_status = 'draft';\n\t\t}\n\t\tremove_action( 'save_post_post', 'update_or_create' );\n\n\t\twp_update_post( array(\n\t\t\t'post_type' => 'post',\n\t\t\t'post_status' => $wp_post_status,\n\t\t\t'ID' => $post_id\n\t\t) );\n\n\t\tadd_action( 'save_post_post', 'update_or_create' );\n\n\t\twp_send_json( array( 'success' => true ) );\n\t}\n\n\twp_send_json( array( 'success' => false ) );\n}", "public static function post_statuses() {\n\n return $managx_post_status = apply_filters( 'managx_post_status', array(\n 'publish' => __( 'Publish', 'managx' ),\n 'trash' => __( 'Trash', 'managx' ),\n 'draft' => __( 'Draft', 'managx' ),\n ) );\n }", "public static function set_event_status()\n {\n $user = wp_get_current_user();\n if (!$user->exists()) {\n $response[\"success\"] = false;\n $response[\"result\"] = \"not logged in\";\n wp_send_json( $response );\n wp_die();\n }\n\n\n //validate user input\n if (!isset($_POST['post_id']) || !is_numeric($_POST['post_id'])) {\n $response[\"success\"] = false;\n $response[\"result\"] = \"invalid input\";\n wp_send_json( $response );\n wp_die();\n }\n $new_user_status = intval($_POST['user_status']);\n if ($new_user_status < 0 || $new_user_status > 3) {\n $response[\"success\"] = false;\n $response[\"result\"] = \"invalid input\";\n wp_send_json( $response );\n wp_die();\n }\n\n\n $post_id = $_POST['post_id'];\n $thispost = get_post( $post_id );\n $thispost_custom = get_post_custom($post_id);\n\n //validate object\n if ( !is_object( $thispost ) || !is_array($thispost_custom) ) {\n $response[\"success\"] = false;\n $response[\"result\"] = \"invalid post id\";\n wp_send_json( $response );\n wp_die();\n }\n\n //validate post type and status\n if ($thispost->post_type != \"ccal_event\" ||\n $thispost->post_status != \"publish\")\n {\n $response[\"success\"] = false;\n $response[\"result\"] = \"invalid post id\";\n wp_send_json( $response );\n wp_die();\n }\n\n\n $event_users = json_decode($thispost_custom['event_users'][0], true);\n $event_users[strval($user->ID)] = $new_user_status;\n\n update_post_meta ( $thispost->ID, 'event_users', json_encode($event_users) );\n\n $response[\"success\"] = true;\n $response[\"result\"] = \"success\";\n wp_send_json( $response );\n wp_die();\n }", "public function changestatus_post(){\n $datos=$this->post();\n $datos=json_decode(base64_decode($datos[\"datos\"]));\n \n $this->Model_Usuariosplus->update_status($datos->usuario,$datos->status);\n \n $_data[\"ok\"]=true;\n $this->response($_data);\n }", "public function register_custom_order_status(){\n register_post_status('wc-customizing', array(\n 'label' => 'Customizing',\n 'public' => true,\n 'exclude_from_search' => false,\n 'show_in_admin_all_list' => true,\n 'show_in_admin_status_list' => true,\n 'label_count' => _n_noop(\n 'Customizing <span class=\"count\">(%s)</span>',\n 'Customizing <span class=\"count\">(%s)</span>')\n ));\n\n }", "function on_all_status_transitions( $new_status, $old_status, $post ) \n{\n if ( $new_status != $old_status ) {\n \t\n\t if ($new_status === 'publish')\n\t {\n\t\t\t// This function has to be called so that the metadata is readied\n\t\t\tdo_action( 'save_post', $post->ID, $post, null );\n\n\t \t// create resource in resourcespace\n\t\t $resource = new ResourceSpaceController();\n\t\t $ID \t\t\t= $post->ID;\n\t\t $post_metadata \t= get_post_meta($ID);\n\t\t $title_field \t= $post_metadata[\"mediateka_title\"][0];\n\t\t $date \t\t\t= $post_metadata[\"date\"] [0];\n\n\t\t $url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' )[0];\n\n\t\t\t// HERE CHECK FIRST IF RESOURCE ALREADY EXISTS WITH THIS TODO:(if yes, find resourcein resourcespace, get its id and update metadata fields)\n\t\t\t// This covers the case when this post is a translation. \n\t\t\t// USER WILL HAVE TO SAVE TO DRAFT FIRST, CONDITION BY DESIGN. \n\t\t\t$args = array(\n\t\t\t 'meta_query' => array(\n\t\t\t\t array(\n\t\t\t\t\t 'key' => 'mediateka_title',\n\t\t\t\t\t 'value' => $title_field,\n\t\t\t\t\t 'compare' => '=',\n\t\t\t\t )\n\t\t\t )\n\t\t\t);\n\t\t\t$query_posts = get_posts($args);\n// \t\t\tdd(count($query_posts).\":\".$title_field);\n\t\t\tif( ($post->post_type === 'post') && (count($query_posts)<=1) )\n\t\t\t{\n\t\t\t\t$new_id = $resource->createResourceV90($url, $title_field, $date, $price);\n\t\t\t}\n\t\t // dd($new_id.\" : \".$url); \n\t }\n }\n if ( $new_status != 'publish' ) {\n \t// A function to perform action when new post published.\n \t$do = \"nothing\";\n }\n}", "public function register_post_statuses() {\n\t\tregister_post_status(\n\t\t\tself::ARCHIVED,\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'Archived', 'post', 'wporg-forums' ),\n\t\t\t\t'label_count' => _nx_noop( 'Archived <span class=\"count\">(%s)</span>', 'Archived <span class=\"count\">(%s)</span>', 'post', 'wporg-forums' ),\n\t\t\t\t'protected' => true,\n\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t'show_in_admin_status_list' => true,\n\t\t\t\t'show_in_admin_add_list' => false,\n\t\t\t)\n\t\t);\n\n\t}", "public function status(){\n\t\t\tif($this->ocorrencia->update($this->input->post('id'), array('ocorrencia_status' => $this->input->post('status')))){\n\t\t\t\tif($this->input->post('status') == 'A'){\n\t\t\t\t\t$this->insertAprovacaoOcorrencia($this->input->post('id'));\n\t\t\t\t}\t\t\t\t\n\t\t\t\telseif($this->input->post('status') == 'R'){\n\t\t\t\t\t$this->insertReprovacaoOcorrencia($this->input->post('id'));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function expired_post_status() {\n\n\t$args = array(\n\t\t'label' => _x( 'expired', 'Status General Name', 'jh' ),\n\t\t'label_count' => _n_noop( 'Expired (%s)', 'Expired (%s)', 'jh' ), \n\t\t'public' => false,\n\t\t'show_in_admin_all_list' => true,\n\t\t'show_in_admin_status_list' => true,\n\t\t'exclude_from_search' => true,\n\t);\n\tregister_post_status( 'expired', $args );\n\n}", "function my_give_register_custom_statuses( $stati ) {\n\t$stati['under_review'] = __( 'Under Review', 'give' );\n\t$stati['pending_approval'] = __( 'Pending Approval', 'give' );\n\n\treturn $stati;\n}", "public function status()\t{\n\t\t\t$this->computador->update($this->input->post('id'), array('computador_status' => $this->input->post('status')));\n\t\t}", "function tmsc_register_migrating_status() {\n\tregister_post_status(\n\t\t'migrating', array(\n\t\t\t'label' => 'Migrating',\n\t\t\t'protected' => true,\n\t\t\t'_builtin' => false,\n\t\t\t'label_count' => _n_noop( \"Migrating <span class='count'>(%s)</span>\", \"Migrating <span class='count'>(%s)</span>\" ),\n\t\t)\n\t);\n}", "public function UpdateStatusPesanan()\n {\n }", "function my_give_register_post_statuses() {\n\n\tregister_post_status( 'under_review', array(\n\t\t'label' => __( 'Under Review', 'give' ),\n\t\t'public' => true,\n\t\t'exclude_from_search' => false,\n\t\t'show_in_admin_all_list' => true,\n\t\t'show_in_admin_status_list' => true,\n\t\t'label_count' => _n_noop( 'Under Review <span class=\"count\">(%s)</span>', 'Under Review <span class=\"count\">(%s)</span>', 'give' ),\n\t) );\n\n\tregister_post_status( 'pending_approval', array(\n\t\t'label' => __( 'Pending Approval', 'give' ),\n\t\t'public' => true,\n\t\t'exclude_from_search' => false,\n\t\t'show_in_admin_all_list' => true,\n\t\t'show_in_admin_status_list' => true,\n\t\t'label_count' => _n_noop( 'Pending Approval <span class=\"count\">(%s)</span>', 'Pending Approval <span class=\"count\">(%s)</span>', 'give' ),\n\t) );\n\n}", "function register_delivered_status() {\n register_post_status( 'wc-delivered', array(\n 'label' => 'Delivered',\n 'public' => true,\n 'exclude_from_search' => false,\n 'show_in_admin_all_list' => true,\n 'show_in_admin_status_list' => true,\n 'label_count' => _n_noop( 'Delivered (%s)', 'Delivered (%s)' )\n ) );\n}", "function notificationStatus_post(){\n\t\t//check for auth\n\t\tif(!$this->check_service_auth()){\n $this->response($this->token_error_msg(), SERVER_ERROR); //authetication failed\n }\n $user_id \t= $this->authData->userId;\n $status = $this->post('status');\n \n \t//check for delete\n if($status==0){\n \t$notiStatus = 0;\n\n }else{\n \t$notiStatus = 1; \t\n } \n $where = array('userId'=>$user_id); \t\n //update status\n $result = $this->common_model->updateFields(USERS, array('isNotification'=>$notiStatus),$where);\n \t//check for data delete yes or not\n \tif($result){\n \t\t$response = array('status' => SUCCESS, 'message' => ResponseMessages::getStatusCodeMessage(154));\n \t\t$this->response($response);\n \t}else{\n \t\t$response = array('status' => FAIL, 'message' => ResponseMessages::getStatusCodeMessage(118));\n\t\t\t$this->response($response);\n \t}\t\t \n\t}", "function post_status($conn,$user_id,$status) {\n\t$user_id = (int)$user_id;\n\t$status = substr(sanitize($status),0,200);\n\n\t$timestamp = time();\n\t$date = date('D d.m.y H:i');\n\n\t$conn->exec(\"INSERT INTO `status` (`owner_id`,`content`,`timestamp`,`date`) VALUES ($user_id, '$status',$timestamp,'$date')\");\n}", "public function get_status() {\n return array(\n 1 => __('Pending', 'clipe'), 2 => __('Cancelled', 'clipe'), 3 => __('In progress', 'clipe'), 4 => __('Completed', 'clipe'), 5 => __('New', 'clipe')\n );\n }", "function insert_status($status) {\n if(get_class($status) == 'Status') {\n if($this->connection) {\n ////////////////////////////////////////\n // Insertion Status attributes\n ////////////////////////////////////////\n $sql = \"INSERT INTO statut (id_statut, libelle)\n VALUES ('\".$status->get_id().\"', '\".$status->get_status().\"')\";\n if (($this->connection)->query($sql) === TRUE) {\n return 0;\n } else {\n return 1;\n }\n } else {\n return 1;\n }\n } else {\n return 1;\n }\n }", "public function post_status() {\n\t\treturn $this->post->post_status;\n\t}", "public function actionChangestatus() {\n /* * *** Utils is the class used for all common data processing and response sending functions ******* */\n $utils = new Utils();\n self::$requiredFields = array(\"id\",\"status_yn\");\n $data = $utils->processRequest(self::$requiredFields,self::$permissionName); //It process the Json input to an array format;\n\n /*********** Chnage the status of the specific post people from the postpeople table *********/\n $postpeople = new Postpeople();\n $changed = $postpeople->changeStatus($data);\n $utils->sendResponse($changed); // It sends out the response as a json object to the frontend*/\n }", "function _hellobar_rss_fields() {\n if ( get_post_type() == 'hellobar' && $status = get_post_meta( get_the_ID(), '_hellobar_status', true ) ) {\n if ( is_feed() ) {\n if( !empty($status) ) {\n echo '<status>';\n echo ucfirst($status);\n echo '</status>';\n }\n }\n }\n }", "function p_wc_register_post_statuses() {\r\n register_post_status( 'wc-action-required', array(\r\n 'label' => _x( 'Action Required', 'WooCommerce Order status', 'text_domain' ),\r\n 'public' => true,\r\n 'exclude_from_search' => false,\r\n 'show_in_admin_all_list' => true,\r\n 'show_in_admin_status_list' => true,\r\n 'label_count' => _n_noop( 'Approved (%s)', 'Approved (%s)', 'text_domain' )\r\n ) );\r\n}", "static function transition_post_status($newstatus, $oldstatus, $post)\r\n\t{\r\n\t\tif( IWOptions::has_IssuedKey() == false || IWOptions::get_IsSynching() === true || \r\n\t\t\t( ($oldstatus === \"new\" || $oldstatus === \"inherit\") && ($newstatus === \"auto-draft\" || $newstatus === \"inherit\") )) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\t$api = IWUtility::get_IWApi();\r\n\t\t\r\n\t\t// Ping the server to see if it is up and responding. If it is then proceed with the update.\r\n\t\tif($api->ping() == false) {\r\n\t\t\tIWUtility::log(\"Ping: Server is down\");\r\n\t\t} else {\r\n\t\t\t$insideWordId = IWUtility::get_InsideWordId($post->ID);\r\n\t\t\tIWUtility::log(\"post status change - \" .$oldstatus . \" to \" . $newstatus . \":\\n\". print_r( $post, true ));\r\n\t\t\t\r\n\t\t\t// if a password was added then delete it\r\n\t\t\tif(!empty($post->post_password)) {\r\n\t\t\t\tif(!empty($insideWordId) && IWSyncher::login($api) == InsideWordPressApi::login_success)\r\n\t\t\t\t{\r\n\t\t\t\t\t$api->change_article_state($insideWordId, InsideWordArticle::state_delete());\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tswitch($newstatus)\r\n\t\t\t\t{\r\n\t\t\t\t\tcase 'publish':\r\n\t\t\t\t\t\tif(IWSyncher::login($api) == InsideWordPressApi::login_success)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tIWUtility::publish_post($post, $api);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase 'pending':\r\n\t\t\t\t\tcase 'draft':\r\n\t\t\t\t\tcase 'future':\r\n\t\t\t\t\tcase 'private':\r\n\t\t\t\t\t\tif(!empty($insideWordId) && IWSyncher::login($api) == InsideWordPressApi::login_success)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tIWSyncher::change_post_state($insideWordId, InsideWordArticle::state_draft(), $api);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase 'trash':\r\n\t\t\t\t\t\tif(!empty($insideWordId) && IWSyncher::login($api) == InsideWordPressApi::login_success)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$api->change_article_state($insideWordId, InsideWordArticle::state_delete());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t// leave these blank for now\r\n\t\t\t\t\tcase 'auto-draft':\r\n\t\t\t\t\tcase 'inherit':\r\n\t\t\t\t\tcase 'new':\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function the_status() {\n\t\tif ( ! is_array( $this->result ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$status = $this->result['status'];\n\t\tif ( ! empty( $this->result['is_info'] ) ) {\n\t\t\t$status = 'info';\n\t\t}\n\n\t\t$icons = [\n\t\t\t'ok' => 'dashicons dashicons-yes',\n\t\t\t'fail' => 'dashicons dashicons-no',\n\t\t\t'warning' => 'dashicons dashicons-warning',\n\t\t\t'info' => 'dashicons dashicons-info',\n\t\t];\n\n\t\t$labels = [\n\t\t\t'ok' => esc_html__( 'OK', 'rank-math' ),\n\t\t\t'fail' => esc_html__( 'Failed', 'rank-math' ),\n\t\t\t'warning' => esc_html__( 'Warning', 'rank-math' ),\n\t\t\t'info' => esc_html__( 'Info', 'rank-math' ),\n\t\t];\n\n\t\tprintf(\n\t\t\t'<div class=\"status-icon status-%1$s %3$s\" title=\"%2$s\"></div>',\n\t\t\t$status,\n\t\t\tesc_attr( $labels[ $status ] ),\n\t\t\tesc_attr( $icons[ $status ] )\n\t\t);\n\t}", "function nb_asmt_status_callback( $post ){\n\t\t//global $post; //Called in assignment operator\n\t\t\n\t\t// Add an nonce field so we can check for it later.\n\t\twp_nonce_field( 'nb_asmt_meta_box', 'nb_asmt_meta_box_nonce' );\n\t\t\n\t\t$p_status = $post->post_status;//Post Status for assignemnt\n\t\t\n\t\t$instr_status = get_post_meta( $post->ID, 'instructor_status', true );\n\t\t\n\t\t$p_status_array = array( 'draft', 'submitted', 'incomplete', 'resubmitted', 'completed' );\n\t\t\n\t\t$instr_stat_array = array(\n\t\t\t0 => 'Not seen',\n\t\t\t1 => 'Seen, not graded',\n\t\t\t2 => 'Graded'\n\t\t);\n\t\t\n\t\t_e( 'The assignment is', 'doula' );\n\t\t//echo '<br> ';\n\t\techo '<select id=\"nb_asmt_post_status\" name=\"nb_asmt_post_status\" >';\n\t\t\tforeach($p_status_array as $psa_key){\n\t\t\t\techo '<option value=\"'.$psa_key.'\"';\n\t\t\t\tif( $psa_key == $p_status ) echo ' selected ';\n\t\t\t\techo '>'.ucfirst($psa_key).'</option>';\n\t\t\t\t\n\t\t\t}\t\n\t\techo '</select>';\n\t\t//echo '<br> ';\n\t\t_e( 'and the instructor has', 'doula' );\n\t\t//echo '<br> ';\n\t\t\n\t\t\n\t\techo '<select id=\"nb_asmt_instr_status\" name=\"nb_asmt_instr_status\" >';\n\t\tforeach($instr_stat_array as $isa_key => $isa_val){\n\t\t\techo '<option value=\"'.$isa_key.'\"';\n\t\t\tif( intval( $isa_key ) == intval( $instr_status ) ) echo ' selected ';\n\t\t\techo '>'.$isa_val.'</option>';\n\t\t\t\n\t\t}\t\n\t\techo '</select>';\n\t\techo '<br> ';\n\t\n\t\t//echo 'POST STATUS: '.$post->post_status.'<br>Instructor Status: '.$instr_status;\n\t\t\n\t\t\n\t\techo '<input type=\"submit\" value=\"Save\" accesskey=\"p\" id=\"publish\" class=\"button button-primary button-large\" name=\"save\">';\t\t\n\t\t\n\t}", "function set_google_standout_status( $post_id, $status ) {\n\t$current_standouts = get_last_week_standouts();\n\t//if ( empty( $current_standouts ) || count( $current_standouts ) < 7 ) {\n\t\t//set_post_field( $post_id, 'fusion_distribution', 'seo', 'standout', $status );\n\t\t//Fusion()->content_model->add_post_to_standouts( get_id( $post_id ) );\n\t//}\n}", "public function changeStatusAction()\n\t\t{\n\t\t$statusHtml = '';\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\n\t\tif( isset($_POST['currentStatus']) && $_POST['currentStatus'] == 0 )\n\t\t{\n\t\t\t$status = 1;\n\t\t\t$statusString = '<span class=\"label label-sm label-info\">Active</span>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$status = 0;\n\t\t\t$statusString = '<span class=\"label label-sm label-danger\">Inactive</span>';\n\t\t}\n\t\t\t\n\t\t$id = $_POST['id'];\n\t\t\n\t\tif( isset($_POST['objectType']) && $_POST['objectType'] == 'Company' )\n\t\t{\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\t$confirmedSubscribe = $em->createQueryBuilder() \n\t\t\t->select('Business')\n\t\t\t->update('DRPAdminBundle:Business', 'Business')\n\t\t\t->set('Business.status', ':status')\n\t\t\t->setParameter('status', $status)\n\t\t\t->where('Business.id = :id')\n\t\t\t->setParameter('id', $id)\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\t\t}\n\n\t\tif(isset($_POST['objectType']) && $_POST['objectType'] == 'Plan')\n\t\t{\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\t$confirmedSubscribe = $em->createQueryBuilder() \n\t\t\t->select('plan')\n\t\t\t->update('DRPAdminBundle:Plan', 'plan')\n\t\t\t->set('plan.status', ':plan')\n\t\t\t->setParameter('plan', $status)\n\t\t\t->where('plan.id = :id')\n\t\t\t->setParameter('id', $id)\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\t\t\t\n\t\t\t\n\n\n\t\t}\n\t\tif(isset($_POST['objectType']) && $_POST['objectType'] == 'User')\n\t\t{\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\t$confirmedSubscribe = $em->createQueryBuilder() \n\t\t\t->select('user')\n\t\t\t->update('DRPAdminBundle:User', 'user')\n\t\t\t->set('user.status', ':user')\n\t\t\t->setParameter('user', $status)\n\t\t\t->where('user.id = :id')\n\t\t\t->setParameter('id', $id)\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\n\n\t\t}\n\t\tif(isset($_POST['objectType']) && $_POST['objectType'] == 'Instrument')\n\t\t{\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\t$confirmedSubscribe = $em->createQueryBuilder() \n\t\t\t->select('instrument')\n\t\t\t->update('DRPAdminBundle:GlobalInstrument', 'instrument')\n\t\t\t->set('instrument.status', ':instrument')\n\t\t\t->setParameter('instrument', $status)\n\t\t\t->where('instrument.id = :id')\n\t\t\t->setParameter('id', $id)\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\n\n\t\t}\n\t\tif(isset($_POST['objectType']) && $_POST['objectType'] == 'BusinessType')\n\t\t{\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\t$confirmedSubscribe = $em->createQueryBuilder() \n\t\t\t->select('business')\n\t\t\t->update('DRPAdminBundle:BusinessType', 'business')\n\t\t\t->set('business.status', ':business')\n\t\t\t->setParameter('business', $status)\n\t\t\t->where('business.id = :id')\n\t\t\t->setParameter('id', $id)\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\n\n\t\t}\n\t\tif(isset($_POST['objectType']) && $_POST['objectType'] == 'RType')\n\t\t{\n\t\t\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\t$confirmedSubscribe = $em->createQueryBuilder() \n\t\t\t->select('reg')\n\t\t\t->update('DRPAdminBundle:RegistrationType', 'reg')\n\t\t\t->set('reg.status', ':reg')\n\t\t\t->setParameter('reg', $status)\n\t\t\t->where('reg.id = :id')\n\t\t\t->setParameter('id', $id)\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\n\n\t\t}\n\t\tif(isset($_POST['objectType']) && $_POST['objectType'] == 'Payment')\n\t\t{\n\t\t\tif( isset($_POST['currentStatus']) && $_POST['currentStatus'] == 0 )\n\t\t\t{\n\t\t\t\t$status = 1;\n\t\t\t\t$statusString = '<span class=\"label label-sm label-info\">Received</span>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$status = 0;\n\t\t\t\t$statusString = 'Pending';\n\t\t\t}\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\t$UserPlan = $em->createQueryBuilder()\n\t\t\t->select('UserPlan')\n\t\t\t->from('DRPAdminBundle:UserPlan', 'UserPlan')\n\t\t\t->where('UserPlan.id=:id')\n\t\t\t->setParameter('id', $id)\n\t\t\t->getQuery()\n\t\t\t->getArrayResult();\t\n\t\t\t\n\t\t\t/*======Increase Searches=========*/\n\t\t\t$planDetail = $em->createQueryBuilder()\n\t\t\t->select('plan')\n\t\t\t->from('DRPAdminBundle:Plan', 'plan')\n\t\t\t->where('plan.id=:id')\n\t\t\t->setParameter('id', $UserPlan[0]['plan_id'])\n\t\t\t->getQuery()\n\t\t\t->getArrayResult();\n\t\t\t\n\n\t\t\t$userDetail = $em->createQueryBuilder()\n\t\t\t->select('user')\n\t\t\t->from('DRPAdminBundle:User', 'user')\n\t\t\t->where('user.id=:id')\n\t\t\t->setParameter('id', $UserPlan[0]['user_id'])\n\t\t\t->getQuery()\n\t\t\t->getArrayResult();\n\t\t\n\n\t\t\t$newSearches = $userDetail[0]['search_count_total'] + $planDetail[0]['searches'];\n\n\t\t\t$remainingSearches = $userDetail[0]['search_count_balance'] + $planDetail[0]['searches'];\n\t\t\t\n\n\t\t\n\t\t\t\n\t\t\t/*======Increase Searches=========*/\t\t\t\n\n\n\t\t\t$disablePrevious = $em->createQueryBuilder() \n\t\t\t->select('userPlan')\n\t\t\t->update('DRPAdminBundle:UserPlan', 'userPlan')\n\t\t\t->set('userPlan.status', ':status')\n\t\t\t->where('userPlan.user_id = :id')\n\t\t\t->setParameter('status', 0)\n\t\t\t->setParameter('id', $UserPlan[0]['user_id'])\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\n\t\t\t\n\n\t\t\t$payment = $em->createQueryBuilder() \n\t\t\t->select('UserPlan')\n\t\t\t->update('DRPAdminBundle:UserPlan', 'UserPlan')\n\t\t\t->set('UserPlan.payment_status', ':UserPlan')\n\t\t\t->setParameter('UserPlan', $status)\n\t\t\t->set('UserPlan.status', ':status')\n\t\t\t->setParameter('status', $status)\n\t\t\t->where('UserPlan.id = :id')\n\t\t\t->setParameter('id', $id)\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\n\t\t\t\t\n\t\t\t$renewPlan = $em->createQueryBuilder() \n\t\t\t\t->select('renewPlan')\n\t\t\t\t->update('DRPAdminBundle:User', 'renewPlan')\n\t\t\t\t->set('renewPlan.search_count_total', ':total')\n\t\t\t\t->where('renewPlan.id = :id')\n\t\t\t\t->setParameter('total', $newSearches)\n\t\t\t\t->setParameter('id', $UserPlan[0]['user_id'])\n\t\t\t\t->getQuery()\n\t\t\t\t->getResult();\n\n\t\t\t$updateBalanced = $em->createQueryBuilder() \n\t\t\t\t->select('renewPlan')\n\t\t\t\t->update('DRPAdminBundle:User', 'renewPlan')\n\t\t\t\t->set('renewPlan.search_count_balance', ':total')\n\t\t\t\t->where('renewPlan.id = :id')\n\t\t\t\t->setParameter('total', $remainingSearches)\n\t\t\t\t->setParameter('id', $UserPlan[0]['user_id'])\n\t\t\t\t->getQuery()\n\t\t\t\t->getResult();\n\t\t\n\n\n\n\n\t\t}\n\n\n\n\t\t\n\t\t$statusHtml.='<a id=\"status-'.$id.'\" class=\"\" title=\"Click to Change\" onclick=\"javascript:changeStatus(\\'status-'.$id.'\\','.$status.');\">'.$statusString.'</a>'; \n\t\t\n\t\treturn new response($statusHtml);\t\t\t\t\n\t}", "function register_form_status($args) {\n\n\t$_args = array();\n\tif(isset($args['taxonomy'])) { $_args['taxonomy'] = 'extra_fs_'.remove_accents($args['taxonomy']); } else { return false;}\n\tif(isset($args['name'])) { $_args['name'] = $args['name']; } else { return false;}\n\tif(isset($args['description']) and !empty($args['description'])) { $_args['description'] = $args['description']; } else { $_args['description'] = $_args['name'].' form durumu yönetimi'; }\n\tif(isset($args['in_out'])) { $_args['in_out'] = $args['in_out']; } else { $_args['in_out'] = true; }\n\tif(isset($args['sms_template'])) { $_args['sms_template'] = $args['sms_template']; } else { $_args['sms_template'] = true; }\n\tif(isset($args['email_template'])) { $_args['email_template'] = $args['email_template']; } else { $_args['email_template'] = true; }\n\tif(isset($args['color'])) { $_args['color'] = $args['color']; } else { $_args['color'] = true; }\n\tif(isset($args['bg_color'])) { $_args['bg_color'] = $args['bg_color']; } else { $_args['bg_color'] = true; }\n\n\n\n\textra()->form_status[$_args['taxonomy']] = $_args;\n}", "function dsi_display_custom_post_status_option(){\n global $post;\n $screen = get_current_screen();\n if (($screen->base == \"post\") && ($screen->id == \"documento\")) {\n\n if($post->post_type == 'documento') {\n if ($post->post_status == 'scaduto') {\n $selected_scaduto = 'selected';\n }\n if ($post->post_status == 'annullato') {\n $selected_annullato = 'selected';\n }\n echo '<script>\n jQuery(document).ready(function(){\n jQuery(\"select#post_status\").append(\"<option value=\\\"scaduto\\\" ' . $selected_scaduto . '>Scaduto</option>\");\n //jQuery(\".misc-pub-section label\").append(\"<span id=\\\"post-status-display\\\"> Scaduto</span>\");\n \n jQuery(\"select#post_status\").append(\"<option value=\\\"annullato\\\" ' . $selected_annullato . '>Annullato</option>\");\n //jQuery(\".misc-pub-section label\").append(\"<span id=\\\"post-status-display\\\"> Annullato</span>\");\n});\n</script>\n';\n }\n }\n}", "public function status_func() {\n global $post;\n $post = $this->single;\n setup_postdata($post);\n $item = get_post_status(get_the_ID());\n return $item;\n }", "function taskbook_change_status( $post, $request ) {\n\t$outcome = get_post_meta( $post->ID, 'taskbook_outcome', true );\n\n\t// Update task_status based on whether $outcome has content:\n\tif ( 0 === strlen($outcome) ) {\n\t\tupdate_post_meta( $post->ID, 'task_status', 'In progress' );\n\t} else {\n\t\tupdate_post_meta( $post->ID, 'task_status', 'Completed' );\n\t}\n\n}", "public function getStatus () {\n\t\treturn $this->gu_status_registro;\n\t}", "public function facebookUpdateStatus()\n {\n $facebook = $this->_getFacebookObject();\n if ($results = $facebook->streams->post('me', $this->vars->statusText)) {\n return $this->_buildPost($facebook->streams->getPost($results));\n }\n return _(\"Status unable to be set.\");\n }", "function pati_the_status(){\r\n global $patis;\r\n $status = pati_get_the_status(pati_get_the_ID(),array('output'=>'object'));\r\n if (!empty($status)) {\r\n if($patis->get('status_titles')){\r\n echo '<label>' . $status->name . '</label>';\r\n } else {\r\n echo '<label></label>';\r\n }\r\n }\r\n}", "public function run()\n {\n $name = \"Activo\";\n $status = new App\\Models\\Status;\n $status->name = $name;\n $status->slug = Str::slug($name);\n $status->for = \"CURSOS\";\n $status->save();\n\n $name = \"Inactivo\";\n $status = new App\\Models\\Status;\n $status->name = $name;\n $status->slug = Str::slug($name);\n $status->for = \"CURSOS\";\n $status->save();\n\n $name = \"Destacado\";\n $status = new App\\Models\\Status;\n $status->name = $name;\n $status->slug = Str::slug($name);\n $status->for = \"CURSOS\";\n $status->save();\n\n $status = new App\\Models\\Status([\n 'name' => \"Pago en Proceso\",\n 'slug' => \"payment_in_process\",\n 'for' => \"ORDERS\"\n ]);\n $status->save();\n $status = new App\\Models\\Status([\n 'name' => \"Pendiente de Pago\",\n 'slug' => \"payment_required\",\n 'for' => \"ORDERS\"\n ]);\n $status->save();\n $status = new App\\Models\\Status([\n 'name' => \"Pago\",\n 'slug' => 'paid',\n 'for' => \"ORDERS\"\n ]);\n $status->save();\n\n $status = new App\\Models\\Status([\n 'name' => \"Reintegrado\",\n 'slug' => \"reverted\",\n 'for' => \"ORDERS\"\n ]);\n $status->save();\n $status = new App\\Models\\Status([\n 'name' => \"Reintegrado Parcial\",\n 'slug' => \"partially_reverted\",\n 'for' => \"ORDERS\"\n ]);\n $status->save();\n $status = new App\\Models\\Status([\n 'name' => \"Pago Parcial\",\n 'slug' => \"partially_paid\",\n 'for' => \"ORDERS\"\n ]);\n $status->save();\n $status = new App\\Models\\Status([\n 'name' => \"Indefinido\",\n 'slug' => \"undefined\",\n 'for' => \"ORDERS\"\n ]);\n $status->save();\n \n $status = new App\\Models\\Status([\n 'name' => \"Pago en local\",\n 'slug' => \"pago_en_local\",\n 'for' => \"ORDERS\"\n ]);\n $status->save();\n\n }", "protected function get_post_status($order)\n {\n }", "protected function _updatePostStatus(){\n\t\tglobal $wpdb;\n\t\t$tblRelationShip = $wpdb->prefix . AlterTablePaymentRelationships::$tblName;\n\t\t$tblPaymentHistory = $wpdb->prefix . AlterTablePaymentHistory::$tblName;\n\n\t\t$aResults = $wpdb->get_results(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"SELECT $tblRelationShip.object_ID FROM $tblRelationShip INNER JOIN $tblPaymentHistory ON ($tblRelationShip.payment_ID = $tblPaymentHistory.ID) WHERE $tblPaymentHistory.package_ID=%d AND $tblPaymentHistory.ID=%d\",\n\t\t\t\t$this->_packageID, $this->_paymentID\n\t\t\t)\n\t\t);\n\n\t\tif ( !empty($aResults) ){\n\t\t\tforeach ( $aResults as $oResult ){\n\t\t\t\tif ( get_post_field('post_status', $oResult->object_ID) === 'processing' ){\n\t\t\t\t\twp_update_post(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'ID' => $oResult->object_ID,\n\t\t\t\t\t\t\t'post_status' => 'pending'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function change_status()\n{\n\tob_start();\n\n\n\t\tif (isset($_POST['app_status'])) {\n\t\t\t$status = $_POST['app_status'];\n\t\t}\n\t\tif (isset($_POST['id'])) {\n\t\t\t$app_id = $_POST['id'];\n\t\t}\n\n\twp_update_post(array('ID'=> $app_id,\t'post_status' => $status));\n\tif ($status == 'hired') {\n\t\t$btn = 'hired';\n\t} else {\n\t\t$btn = '';\n\t}\n\techo $btn;\n\twp_die();\n\n}", "public function createStatus() {\n\n //page settings\n $page = $this->pageSettings();\n $page['default_color'] = 'checked';\n\n //reponse payload\n $payload = [\n 'page' => $page,\n ];\n\n //show the form\n return new CreateStatusResponse($payload);\n }", "public function cambioStatus(Request $request)\r\n {\r\n $postulantes = Becario::query()->where('status', '=','entrevistado')->where('acepto_terminos', '=',true)->get();\r\n $i=0;\r\n foreach($postulantes as $postulante)\r\n {\r\n if($request->get('all') == 1 )\r\n {\r\n //para que guarde todos\r\n $i++;\r\n $postulante->status='activo';\r\n $postulante->acepto_terminos=false;\r\n $postulante->save();\r\n $usuario=User::find($postulante->user_id);\r\n $usuario->rol = 'becario';\r\n $usuario->save();\r\n }\r\n else if($request->get($postulante->user_id) == 1 )//cuando está check\r\n {\r\n $i++;\r\n $postulante->status='activo';\r\n $postulante->acepto_terminos=false;\r\n $postulante->save();\r\n $usuario=User::find($postulante->user_id);\r\n $usuario->rol = 'becario';\r\n $usuario->save();\r\n //falta: enviar correo al becario con su fecha de entrevista\r\n }\r\n }\r\n\r\n if($i>0)\r\n {\r\n flash('Se ha agregado becario(s) exitosamente.','success');\r\n }\r\n else\r\n {\r\n flash('Disculpe, debe seleccionar al menos un postulante', 'danger');\r\n }\r\n return redirect()->route('listarPostulantesBecarios',\"3\");\r\n }", "private function getStatus() {\n return [\n 'type' => 'danger', \n 'message' => \"Votre compte n'est été activé. Un lien d'activation vous a été envoyé lors de votre inscription.\"\n ];\n }", "public function setStatus ($gu_status_registro) {\n\t\t$this->gu_status_registro = $gu_status_registro;\n\t}", "public function run()\n {\n $statuses = [\n ['slug' => 'soltero', 'name' => 'Soltero/a'],\n ['slug' => 'casado', 'name' => 'Casado/a'],\n ['slug' => 'divorciado', 'name' => 'Divorciado/a'],\n ['slug' => 'viudo', 'name' => 'Viudo/a'],\n ['slug' => 'union_libre', 'name' => 'Unión libre'],\n ];\n\n CivilStatus::insert($statuses);\n }", "public function setStatus()\n\t{\n\t\tif($this->checkSessionAdmin())\n\t\t{\n\t\t\t$id = $this->input->post('id');\n\t\t\t$post['status'] = $this->input->post('status');\n\t\t\t$this->Comman_model->update_details('announcements', $post, 'id', $id);\n\t\t\techo 1 ;\n\t\t\texit();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect(base_url().'admin');\n\t\t}\n\t}", "function icone_statut_post($statut_post) {\n\t// icone état du post\n\tswitch ($statut_post) {\n\t\tcase\"off\":\n\t\t$aff_statut = \"<div style='float:right;' title='\"._T('spipbb:sujet_rejete').\"'>\n\t\t\t\t\t<img src='\"._DIR_IMG_SPIPBB.\"gaf_p_off.gif'></div>\";\n\t\tbreak;\n\t\tcase\"prop\":\n\t\t$aff_statut = \"<div style='float:right;' title='\"._T('spipbb:sujet_valide').\"'>\n\t\t\t\t\t<img src='\"._DIR_IMG_SPIPBB.\"gaf_p_prop.gif'></div>\";\n\t\tbreak;\n\t\tcase\"publie\":\n\t\t$aff_statut = \"\";\n\t\tbreak;\n\t\tdefault:\n\t\t\treturn;\n\t}\n\treturn $aff_statut;\n}", "function add_form_status($args=array()) {\n\tif(!have_log(@$args['uniquetime'])) {\n\t\t$args = _args_helper(input_check($args), 'insert');\n\t\t$insert = $args['insert'];\n\n\t\t@form_validation($insert['taxonomy'], 'taxonomy', 'Sınıflandırma (taxonomy)', 'required|min_length[3]|max_length[64]', __FUNCTION__);\n\t\tif(!is_alert(__FUNCTION__)) {\n\n\t\t\t$_insert = _set_form_status_args($insert);\n\n\t\t\t$_insert = array('insert'=>$_insert);\n\t\t\t$_insert['add_alert'] \t= false;\n\t\t\t$_insert['add_log'] \t= false;\n\t\t\t$_insert['uniquetime'] = @$args['uniquetime'];\n\n\t\t\tif($extra_id = add_extra($_insert)) {\n\t\t\t\t$fs_cat_name = extra()->form_status[$insert['taxonomy']]['name'];\n\t\t\t\tif($args['add_alert']) { add_alert(_b($fs_cat_name).' için '._b($_insert['insert']['name']).' form durumu eklendi.', \"success\", __FUNCTION__); }\n\t\t\t\tif($args['add_log']) { add_log(array('uniquetime'=>@$args['uniquetime'], 'table_id'=>'extra:'.$extra_id, 'log_key'=>__FUNCTION__, 'log_text'=>_b($fs_cat_name).' için '._b($_insert['insert']['name']).' form durumu eklendi.')); }\n\t\t\t\treturn $extra_id;\n\t\t\t} else { return false;}\n\t\t}\n\t} else { repetitive_operation(__FUNCTION__); }\n}", "private function statusi() {\n\n if ($this->get_request_method() != \"GET\")\n $this->response('', 406);\n\n $StatusDAL = new StatusDAL();\n $statusi = $StatusDAL->PrikaziSveStatuse();\n $this->response($this->json($statusi), 200);\n }", "function register_subscription_paid_order_status() {\r\n register_post_status( 'wc-subscription-paid', array(\r\n 'label' => 'MP Subscription Paid',\r\n 'public' => true,\r\n 'exclude_from_search' => false,\r\n 'show_in_admin_all_list' => true,\r\n 'show_in_admin_status_list' => true,\r\n 'label_count' => _n_noop( 'MP Subscription Paid (%s)', 'MP Subscription Paid (%s)' )\r\n ) );\r\n}", "public function set_status( $status ) {\n\t\tif ( ! isset( Tribe__Events__Aggregator__Records::$status->{ $status } ) ) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\t$status = wp_update_post( array(\n\t\t\t'ID' => $this->id,\n\t\t\t'post_status' => Tribe__Events__Aggregator__Records::$status->{ $status },\n\t\t) );\n\n\t\tif ( ! is_wp_error( $status ) && ! empty( $this->post->post_parent ) ) {\n\t\t\t$status = wp_update_post( array(\n\t\t\t\t'ID' => $this->post->post_parent,\n\t\t\t\t'post_modified' => date( Tribe__Date_Utils::DBDATETIMEFORMAT, current_time( 'timestamp' ) ),\n\t\t\t) );\n\t\t}\n\n\t\treturn $status;\n\t}", "public function get_status(){\r\n\t\treturn \"pending\";\r\n\t}", "function ajax_save_wpengine_notice_status( LaterPay_Core_Event $event ) {\n\n $result = [];\n if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {\n return;\n }\n\n check_ajax_referer('wpengine_cookie_done_nonce', 'security' );\n\n $result ['status'] = false;\n $status = filter_input( INPUT_POST, 'status', FILTER_SANITIZE_STRING );\n\n if ( 'true' === $status ) {\n\n $result['status'] = update_option( 'laterpay_wpengine_notice_status', '1' );\n }\n\n $event->set_result( $result );\n }", "public function changeStatus() {\n if ($this->input->post('post_id') != \"\") {\n #updating the user status.\n $arr_to_update = array(\n \"status\" => $this->input->post('post_status')\n );\n #condition to update record\tfor the user status\n $condition_array = array('id' => intval($this->input->post('post_id')));\n $this->common_model->updateRow(TABLES::$MST_TESTIMONIAL, $arr_to_update, $condition_array);\n echo json_encode(array(\"error\" => \"0\", \"error_message\" => \"Status has changed successflly.\"));\n } else {\n #if something going wrong providing error message. \n echo json_encode(array(\"error\" => \"1\", \"error_message\" => \"Sorry, your request can not be fulfilled this time. Please try again later\"));\n }\n }", "function fa_post_status_message( $post, $before, $after ){\n\t$message = false;\n\tswitch( $post->post_status ){\n\t\tcase 'pending':\n\t\t\t$message = __('<strong>Warning! </strong> Slide not visible until post is published.', 'fapro');\n\t\tbreak;\n\t\tcase 'future':\n\t\t\t$message = sprintf( __('<strong>Warning!</strong> Slide not visible until %s.', 'fapro'), fa_output_post_date( $post->post_date, false ) );\n\t\tbreak;\t\n\t\tcase 'draft':\n\t\t\t$message = __('<strong>Warning!</strong> Slide not visible until post published.', 'fapro');\n\t\tbreak;\n\t\tcase fa_status_expired():\n\t\t\t$message = __('<strong>Warning!</strong> Slide is expired.', 'fapro');\n\t\tbreak;\t\n\t}\n\tif( $message ){\n\t\techo $before . $message . $after;\t\n\t}\t\n}", "public function StatusUpdate()\n {\n $settings = array('oauth_access_token' => $this->conf_array['oauth_access_token'],\n\t\t'oauth_access_token_secret' => $this->conf_array['oauth_access_token_secret'],\n\t\t'consumer_key' => $this->conf_array['consumer_key'],\n\t\t'consumer_secret' => $this->conf_array['consumer_secret']\n\t\t);\n\t\t\n\t$url = $this->conf_array['url_postStatusUpdate'];\n\ttry\n\t{\n\t$twitter = new TwitterAPIExchange($settings);\n\t$requestMethod \t= 'POST';\n\t$postfields = array('status' => $this->text); \n\t$twitter->buildOauth($url, $requestMethod)->setPostfields($postfields)->performRequest();\n return 'sucess';\n\t}\n\tcatch(Exception $e)\n\t{\n return 'error';\n\t}\n\t\t\n\t}", "public function setStatus()\n\t{\n\t\tif($this->checkSessionAdmin())\n\t\t{\n\t\t\t$id = $this->input->post('id');\n\t\t\t$post['active'] = $this->input->post('status');\n\t\t\t$this->Comman_model->update_details('users', $post, 'id', $id);\n\t\t\techo 1 ;\n\t\t\texit();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect(base_url().'admin');\n\t\t}\n\t}", "function theme_status($status) {\n\tif($status->id_str) $status->id = $status->id_str;\n\t\n\t$feed[] = $status;\n\t$tl = twitter_standard_timeline($feed, 'status');\n\t$content = theme('timeline', $tl);\n\treturn $content;\n}", "public function status($status, Post $post)\n {\n $status == \"publish\" ? $post->publish() : $post->unpublish();\n\n return response()->json($post->load('category'), 200);\n }", "function _transition_post_status($new_status, $old_status, $post)\n{\n}", "function on_all_status_transitions( $new_status, $old_status, $post )\n\t{ \n\t\t// if the post not event dont do anything\n\t\tif( $post->post_type != 'events' ){\n\t\t\treturn $post->ID;\n\t\t}\n\n\t\tglobal $wpdb;\n\t\t$table_name = $wpdb->prefix . 'wpeo_events';\n\n\t\t// update if the status changed \n\t\tif ( $new_status != $old_status) {\n\t\t\t\t$status = ( $new_status == 'publish') ? 1 : 0 ;\n\t\t\t\t$wpdb->update( $table_name, ['event_status' => $status], ['post_id' => $post->ID] );\n\t\t\t}\n\t}", "function wpdocs_run_on_transition_only( $new_status, $old_status, $post ) {\n // Kiểm tra xem trạng thái của lớp học\n if ( ( $new_status == 'publish' ) && ( $old_status != 'publish' ) && ( $post->post_type == 'classroom' ) ) {\n $classnoty = ClassroomNotyHelper::getInstance();\n $classnoty->setClassroomID($post->ID);\n $invalid_tutors = $classnoty->getTutors();\n write_log($invalid_tutors);\n \n $noty = Noty_Sender::getInstance();\n $noty->sendMail($post->ID, $invalid_tutors);\n\n } else {\n return;\n }\n}", "public function transition_post_status( $new_status, $old_status, $post ) {\r\r\n\r\r\n\t\tif( 'acadp_listings' !== $post->post_type ) {\r\r\n\t\t\treturn;\r\r\n\t\t}\r\r\n\r\r\n\t\t// Check if we are transitioning from pending to publish\r\r\n \tif( 'pending' == $old_status && 'publish' == $new_status ) {\r\r\n\r\r\n\t\t\tacadp_email_listing_owner_listing_approved( $post->ID );\r\r\n\r\r\n\t\t}\r\r\n\r\r\n\t\t// Check if we are transitioning from private to publish\r\r\n \tif( 'private' == $old_status && 'publish' == $new_status ) {\r\r\n\r\r\n\t\t\t$listing_status = get_post_meta( $post->ID, 'listing_status', true );\r\r\n\r\r\n\t\t\tif( 'expired' == $listing_status ) {\r\r\n\t\t\t\tupdate_post_meta( $post->ID, 'listing_status', 'post_status' );\r\r\n\r\r\n\t\t\t\tunset( $_POST['acadp_aa'] );\r\r\n\t\t\t\tunset( $_POST['listing_status'] );\r\r\n\t\t\t}\r\r\n\r\r\n\t\t}\r\r\n\r\r\n\t}", "function _update_posts_count_on_transition_post_status($new_status, $old_status, $post = \\null)\n{\n}", "function getstatus() {\n return $this->status;\n }", "function clients_set_vendors_status_status() {\n $UriArray = $this->uri->uri_to_assoc(3);\n $post_array = $this->input->post();\n $client_id = $this->common_lib->getParameter($this, $UriArray, $post_array, 'client_id');\n $provides_vendor_id = $this->common_lib->getParameter($this, $UriArray, $post_array, 'provides_vendor_id');\n $new_status = $this->common_lib->getParameter($this, $UriArray, $post_array, 'new_status');\n\n if ( empty($client_id) or empty($provides_vendor_id) or empty($new_status) ) {\n $this->output->set_content_type('application/json')->set_output(json_encode(array('ErrorMessage' => 'Invalid parameters !', 'ErrorCode' => 1, 'ret' => 0 )));\n return;\n }\n $ret = $this->clients_mdl->update_clients_vendors( $client_id, $provides_vendor_id, $new_status );\n $this->output->set_content_type('application/json')->set_output(json_encode(array('ErrorMessage' => '', 'ErrorCode' => 0, 'ret' => $ret )));\n }", "function bbloomer_register_custom_order_status( $order_statuses ){\n $order_statuses['wc-custom-status'] = array( \n 'label' => _x( 'Paid', 'Order status', 'woocommerce' ),\n 'public' => false, \n 'exclude_from_search' => false, \n 'show_in_admin_all_list' => true, \n 'show_in_admin_status_list' => true, \n 'label_count' => _n_noop( 'Paid <span class=\"count\">(%s)</span>', 'Paid <span class=\"count\">(%s)</span>', 'woocommerce' ), \n ); \n return $order_statuses;\n}", "static function register_post_type() {\n\t\tself::$post_type_args['taxonomies'] = self::$taxonomies;\n\n\t\tregister_post_type( self::SLUG, self::$post_type_args );\n\n\t\tregister_post_status('active', array(\n 'label' => __( 'Active', 'mycondo' ),\n 'protected' => true,\n 'label_count' => _n_noop( 'Visitors logged in <span class=\"count\">(%s)</span>', 'Visitors logged in <span class=\"count\">(%s)</span>' ),\n 'show_in_admin_status_list' => true,\n 'show_in_admin_all_list' => true,\n ));\n\n \tregister_post_status('inactive', array(\n 'label' => __( 'Inactive', 'mycondo' ),\n 'protected' => true,\n //'label_count' => _n_noop( 'Visitors logged out <span class=\"count\">(%s)</span>', 'Visitors logged out <span class=\"count\">(%s)</span>' ),\n 'show_in_admin_status_list' => true,\n ));\n\t}", "public function addStatus(int $status, string $description = \"\");", "function pmp_on_post_status_transition($new_status, $old_status, $post) {\n\tif ($old_status == 'draft' && $new_status == 'publish') {\n\t\t$custom_fields = get_post_custom($post->ID);\n\n\t\tif (!empty($custom_fields['pmp_guid'][0]) && !empty($custom_fields['pmp_published'][0])) {\n\t\t\t$post_data = array(\n\t\t\t\t'ID' => $post->ID,\n\t\t\t\t'post_date' => date('Y-m-d H:i:s', strtotime($custom_fields['pmp_published'][0]))\n\t\t\t);\n\n\t\t\t$updated_post = wp_update_post($post_data);\n\t\t}\n\t}\n}", "public function get_post_statuses() {\n $all = 0;\n $_attrs = WPP_F::get_all_attribute_values('post_status');\n $attrs = array();\n if( is_array( $_attrs ) ) {\n foreach( $_attrs as $attr ) {\n $count = WPP_F::get_properties_quantity( array( $attr ) );\n switch( $attr ) {\n case 'publish':\n $label = __( 'Published', $this->get('domain') );\n $all += $count;\n break;\n case 'pending':\n $label = __( 'Pending', $this->get('domain') );\n $all += $count;\n break;\n case 'trash':\n $label = __( 'Trashed', $this->get('domain') );\n break;\n case 'auto-draft':\n $label = __( 'Auto-Draft', $this->get('domain') );\n break;\n default:\n $label = strtoupper( substr( $attr, 0, 1 ) ) . substr( $attr, 1, strlen( $attr ) );\n $all += $count;\n }\n $attrs[ $attr ] = $label . ' (' . WPP_F::format_numeric( $count ) . ')';\n }\n } else {\n return array();\n }\n $attrs[ 'any' ] = __( 'Any', $this->get('domain') ) . ' (' . WPP_F::format_numeric( $all ) . ')';\n ksort( $attrs );\n $attrs = apply_filters('admin_overview_post_statuses', $attrs);\n return $attrs;\n }", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "function get_post_statuses()\n{\n}", "protected static function display_post_status() {\n\t\t$post = get_post();\n\n\t\t// Bail if the current user can't review plugins.\n\t\tif ( ! current_user_can( 'plugin_approve', $post ) && ! current_user_can( 'plugin_review', $post ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$statuses = array( 'new', 'pending' );\n\n\t\tif ( current_user_can( 'plugin_approve', $post ) ) {\n\t\t\t$statuses = Status_Transitions::get_allowed_transitions( $post->post_status );\n\t\t}\n\n\t\t$close_reasons = Template::get_close_reasons();\n\t\t$close_reason = (string) get_post_meta( $post->ID, '_close_reason', true );\n\t\t$active_installs = (int) get_post_meta( $post->ID, 'active_installs', true );\n\n\t\t$reason_label = Template::get_close_reason();\n\t\t$reason_unknown = ( _x( 'Unknown', 'unknown close reason', 'wporg-plugins' ) === $reason_label );\n\t\t?>\n\t\t<div class=\"misc-pub-section misc-pub-plugin-status\">\n\t\t\t<label for=\"post_status\"><?php _e( 'Status:', 'wporg-plugins' ); ?></label>\n\t\t\t<strong id=\"plugin-status-display\"><?php echo esc_html( get_post_status_object( $post->post_status )->label ); ?></strong>\n\n\t\t\t<?php if ( 'closed' === $post->post_status ) : ?>\n\n\t\t\t\t<p><?php printf( __( 'Close Reason: %s', 'wporg-plugins' ), '<strong>' . $reason_label . '</strong>' ); ?></p>\n\n\t\t\t<?php elseif ( 'disabled' === $post->post_status ) : ?>\n\n\t\t\t\t<p><?php printf( __( 'Disable Reason: %s', 'wporg-plugins' ), '<strong>' . $reason_label . '</strong>' ); ?></p>\n\n\t\t\t<?php elseif ( 'publish' === $post->post_status ) : ?>\n\n\t\t\t\t<?php if ( $active_installs >= '20000' ) : ?>\n\t\t\t\t\t<p><strong><?php _e( 'Notice:', 'wporg-plugins' ); ?></strong> <?php _e( 'Due to the large volume of active users, the developers should be warned and their plugin remain open save under extreme circumstances.', 'wporg-plugins' ); ?>.</p>\n\t\t\t\t<?php endif; ?>\n\n\t\t\t<?php endif; ?>\n\n\t\t\t<?php\n\t\t\tif (\n\t\t\t\t\t( in_array( 'closed', $statuses, true ) || in_array( 'disabled', $statuses, true ) )\n\t\t\t\t&&\n\t\t\t\t\t( ! in_array( $post->post_status, array( 'closed', 'disabled' ) ) || $reason_unknown )\n\t\t\t\t) :\n\t\t\t\t?>\n\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"close_reason\"><?php _e( 'Close/Disable Reason:', 'wporg-plugins' ); ?></label>\n\t\t\t\t\t<select name=\"close_reason\" id=\"close_reason\">\n\t\t\t\t\t\t<?php foreach ( $close_reasons as $key => $label ) : ?>\n\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\"<?php selected( $key, $close_reason ); ?>><?php echo esc_html( $label ); ?></option>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</select>\n\t\t\t\t</p>\n\n\t\t\t<?php endif; ?>\n\n\t\t\t<?php foreach ( $statuses as $status ) : ?>\n\n\t\t\t\t<p><button type=\"submit\" name=\"post_status\" value=\"<?php echo esc_attr( $status ); ?>\" class=\"button set-plugin-status\">\n\t\t\t\t\t<?php echo self::get_status_button_label( $status ); ?>\n\t\t\t\t</button></p>\n\n\t\t\t<?php endforeach; ?>\n\t\t</div><!-- .misc-pub-section -->\n\t\t<?php\n\t}", "function column_status( $item ) {\n\t\tswitch ( $item[ 'status' ] ){\n\t\t\tcase 'Publish':\n\t\t\t\treturn '<span class=\"'.strtolower($item[ 'status' ]).'\">'. __( 'Sent', 'edd-pup' ) .'</span>';\n\t\t\tcase 'Pending':\n\t\t\t\tif ( edd_pup_is_processing( $item['ID'] ) ) {\n\t\t\t\treturn '<span class=\"'.strtolower($item[ 'status' ]).'\">'. __( 'Processing', 'edd-pup' ) .'</span>';\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\treturn '<span class=\"'.strtolower($item[ 'status' ]).'\">'. __( 'In Queue', 'edd-pup' ) .'</span>';\n\t\t\t\t}\n\t\t\tcase 'Abandoned':\n\t\t\t\treturn '<span class=\"'.strtolower($item[ 'status' ]).'\">'. __( 'Cancelled', 'edd-pup' ) .'</span>';\n\t\t\tdefault:\n\t\t\t\treturn '<span class=\"'.strtolower($item[ 'status' ]).'\">'. $item[ 'status' ] .'</span>';\n\t\t}\n\t}", "function payment_method_status(int $s)\n {\n $status = trad(\n PaymentMethodStatus::getDescriptionById(\n $s\n )\n );\n switch ($s) {\n case 1:\n echo '<span class=\"badge badge-success\">'.$status.'</span>';\n break;\n case 2:\n echo '<span class=\"badge badge-danger\">'.$status.'</span>';\n break;\n default:\n throw new Exception('invalid payment method status');\n }\n }", "function addStatus(Transaction $transaction,$status,$description = null);", "function change_order_custom_status_on_update( $post_id ){\n\tif ( empty( $_POST['acf'] ) ) {\n\t\treturn;\n\t}\n\n\t$prev_value = get_field('dms_order_status', $post_id);\n\n\t// Check if rest has accepted\n\t$acf = $_POST['acf'];\n\t$current_time = current_time( 'Y-m-d H:i:s' );\n\n\tif( ( $new_driver_id = $acf['field_57d15d29a6b98'] ) !== ( $old_driver_id = get_post_meta( $post_id, \"dms_order_driver\", true ) ) ){\n\n\t\tif( $new_driver_id && $old_driver_id ){\n\t\t\t$title \t\t= \"Te han asignado nuevo pedido\";\n\t\t\t$message \t= \"Nuevo pedido: #\" . $post_id;\n\t\t\tpush_notification_to_single_driver( $new_driver_id, $message, $title );\n\t\t}\n\t}\n\n\tif( $acf['field_5747129addb9f'] == \"problem\" && $prev_value != \"problem\" ){\n\t\t$_POST['acf']['field_576a57d7aa7c9'] = $current_time;\n\t\t$title \t\t= \"Incidencia\";\n\t\t$message \t= \"Incidencia con tu pedido\";\n\t\t$driver_id \t= $acf['field_57d15d29a6b98'];\n\t\tpush_notification_to_single_driver( $driver_id, $message, $title );\n\t\treturn;\n\t}\n\n\tif( ( $acf['field_5747129addb9f'] == \"cancelled_return_money\" && $prev_value != \"cancelled_return_money\" ) || ( $acf['field_5747129addb9f'] == \"order_cancelled\" && $prev_value != \"order_cancelled\" ) ){\n\t\t$_POST['acf']['field_580a0ea69b9cb'] = $current_time;\n\t\treturn;\n\t}\n\n\tif( $acf['field_5747129addb9f'] == \"rest_has_accepted\" ){\n\n\t\tif( $prev_value != \"rest_has_accepted\" ){\n\t\t\t$_POST['acf']['field_576a56edaa7c4'] = $current_time;\n\n\t\t\tdms_send_mail_to_customer_on_rest_accepted( $post_id );\n\t\t}\n\n\t\t$order \t\t\t\t= wc_get_order( $post_id );\n\t\t$shipping_items \t= $order->get_items( 'shipping' );\n\t\t$shipping_id \t\t= $shipping_items[0]['method_id'];\n\n\t\tif( $shipping_id != \"local_pickup\" ){\n\t\t\t$notification_sent = get_post_meta( $post_id, \"dms_order_notification_sent\", true );\n\n\t\t\tif( $notification_sent != 1 ){\n\t\t\t\t$driver_id \t= $acf['field_57d15d29a6b98'];\n\n\t\t\t\tif( $driver_id != \"\" ){\n\t\t\t\t\t$_POST['acf']['field_5747129addb9f'] = \"driver_has_accepted\";\n\t\t\t\t\t$_POST['acf']['field_576a574daa7c5'] = $current_time;\n\t\t\t\t\t$title \t\t= \"Te han asignado nuevo pedido\";\n\t\t\t\t\t$message \t= \"Nuevo pedido: #\" . $post_id;\n\t\t\t\t\tpush_notification_to_single_driver( $driver_id, $message, $title );\n\t\t\t\t}else{\n\t\t\t\t\t$title \t\t= \"Nuevo pedido\";\n\t\t\t\t\t$message \t= \"Nuevo pedido: #\" . $post_id;\n\t\t\t\t\tpush_notification_to_all_drivers( $post_id, $message, $title );\n\t\t\t\t}\n\n\t\t\t\tupdate_post_meta( $post_id, \"dms_order_notification_sent\", 1 );\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif( $acf['field_5747129addb9f'] == \"order_delivered\" && $prev_value != \"order_delivered\" ){\n\t\t$_POST['acf']['field_576a57bcaa7c8'] = $current_time;\n\t\treturn;\n\t}\n}", "public function getContatoStatus()\n {\n return $this->contato_status;\n }", "function taskbook_change_status( $post_id, $post, $update ) {\r\n\tif ( 'task' != get_post_type( $post_id ) ) return;\r\n\r\n\t// Get the current status of the Outcome meta box:\r\n\tif ( isset( $_POST['taskbook_outcome'] ) ) {\r\n\t\t$outcome = $_POST['taskbook_outcome'];\r\n\t}\r\n\r\n\t// If the task has a title (meaning it is not a brand new task),\r\n\t// update task_status based on the status of $outcome:\r\n\tif ( isset( $_POST['post_title'] ) ) {\r\n\t\tif ( empty( $outcome ) ) {\r\n\t\t\tupdate_post_meta( $post_id, 'task_status', false );\r\n\t\t} else {\r\n\t\t\tupdate_post_meta( $post_id, 'task_status', true );\r\n\t\t}\r\n\t}\r\n}", "protected function check_status(){\n \t $non_premium_expire = 5*24*60*60;\n \t $premium_expire = 14*24*60*60;\n \t $data = $this->Banner->find('all');\n \t //pr ($Banners);\n \t //pr ((time() - strtotime($Banners['Banner']['modified'])) > 5*24*60*60);\n \t //pr ((time() - strtotime($Banners['Banner']['modified'])) > 14*24*60*60);\n \t //die();\n \t foreach ($data as $Banners) {\n \t \tif ($Banners['Banner']['is_premium'] == 0) {\n \t \t\tif ((time() - strtotime($Banners['Banner']['modified'])) > $non_premium_expire) {\n \t \t\t\t $id = $Banners['Banner']['id'];\n \t \t\t\t //pr (\"in non premium loop\");\n \t \t\t\t //pr ($id);\n \t \t\t\t //die();\n \t \t\t\t $data_one = array('id' => $id , 'status'=> 0, 'modified' => false);\n \t \t\t\t $this->Banner->save($data_one);\n \t \t\t\t //$this->Banner->clear();\n \t \t\t}\n \t \t}\n \t \tif ($Banners['Banner']['is_premium'] == 1) {\n \t \t\tif ((time() - strtotime($Banners['Banner']['modified'])) > $premium_expire) {\n \t \t\t\t $id = $Banners['Banner']['id'];\n \t \t\t\t //pr (\"in premium loop\");\n \t \t\t\t //pr ($id);\n \t \t\t\t //die();\n \t \t\t\t $data_one = array('id' =>$id , 'status'=> 0, 'modified' => false);\n \t \t\t\t//pr ($data_one);\n \t \t\t\t//die();\n \t \t\t\t $this->Banner->save($data_one);\n \t \t\t\t //$this->Banner->clear();\n \t \t\t}\n \t \t}\n \t }\n }", "public function status_esquema($id, $status)\n {\n //------------------------------------------------------------\n //Migracion MONGO DB\n $id = new MongoDB\\BSON\\ObjectId($id);\n $id_usuario = new MongoDB\\BSON\\ObjectId($this->session->userdata('id_usuario'));\n $fecha = new MongoDB\\BSON\\UTCDateTime();\n switch ($status) {\n case '1':\n $status2 = true;\n break;\n case '2':\n $status2 = false;\n break;\n }\n $datos = array(\n 'status'=>$status2,\n );\n $modificar = $this->mongo_db->where(array('_id'=>$id))->set($datos)->update($this->tabla_esquema);\n //--Auditoria\n if($modificar){\n $data_auditoria = array(\n 'cod_user'=>$id_usuario,\n 'nom_user'=>$this->session->userdata('nombre'),\n 'fecha'=>$fecha,\n 'accion'=>'Modificar status esquemas',\n 'operacion'=>''\n );\n $mod_auditoria = $this->mongo_db->where(array('_id'=>$id))->push('auditoria',$data_auditoria)->update($this->tabla_esquema); \n }\n //------------------------------------------------------------\n }", "function get_post_status_object($post_status)\n{\n}", "function wponios_get_post_status($post_id) {\n\treturn get_post_status($post_id);\n}", "function sr_receitas_submit(){\n\n\t$array = array('status' => 1);\n\n\tif(empty($_POST['content']) || empty($_POST['ingredientes'])){\n\t\twp_send_json($array);\n\t}\n\n\t// Tratar as informações para salvar no banco\n\n\t$title = sanitize_text_field($_POST['title']);\n\t$content = wp_kses_post($_POST['content']);\n\n\t$receita_data = array(\n\t\t'ingredientes' => sanitize_text_field($_POST['ingredientes']),\n\t\t'tempo' => sanitize_text_field($_POST['tempo']),\n\t\t'utensilios' => sanitize_text_field($_POST['utensilios']),\n\t\t'tipo' => sanitize_text_field($_POST['tipo']),\n\t\t'media' => 0,\n\t\t'contagem' => 0\n\t);\n\n\t// Inserir um post no banco\n\n\t$post_id = wp_insert_post(array(\n\t\t'post_title' => $title,\n\t\t'post_name' => $title, // slug\n\t\t'post_content' => $content,\n\t\t'post_status' => 'pending',\n\t\t'post_type' => 'receita'\n\t));\n\n\t// Inserir a imagem do post no banco\n\tif(!empty($_POST['anexo_id'])){\n\n\t\tinclude_once(ABSPATH.'/wp-admin/includes/image.php');\n\t\tset_post_thumbnail($post_id, $_POST['anexo_id']);\n\n\t}\n\n\tupdate_post_meta($post_id, 'receita_data', $receita_data);\n\n\t$array['status'] = 2;\n\n\twp_send_json($array);\n\n}", "public function cron_change_tag_status() {\n $PintuanTagM = ClassRegistry::init('PintuanTag');\n $expire_date = date('Y-m-d H:i:s');\n $expire_pintuans = $PintuanTagM->find('all', array(\n 'conditions' => array(\n 'expire_date <= ' => $expire_date,\n 'status' => PIN_TUAN_TAG_PROGRESS_STATUS\n )\n ));\n if (!empty($expire_pintuans)) {\n $expire_pintuan_ids = Hash::extract($expire_pintuans, '{n}.PintuanTag.id');\n $this->log('expire pintuan ids' . json_encode($expire_pintuan_ids));\n $PintuanTagM->updateAll(array('status' => PIN_TUAN_TAG_EXPIRE_STATUS), array('id' => $expire_pintuan_ids));\n foreach ($expire_pintuans as $pintuan_tag) {\n $share_id = $pintuan_tag['PintuanTag']['share_id'];\n $user_id = $pintuan_tag['PintuanTag']['creator'];\n $tag_id = $pintuan_tag['PintuanTag']['id'];\n $this->send_pintuan_fail_msg($share_id, $tag_id, $user_id);\n }\n }\n }", "public function setStatus() {\n if (!$this->input->is_ajax_request()) {\n exit('No direct script access allowed');\n }\n $id = $this->input->post(\"id\");\n $status = $this->input->post(\"status\");\n if ($id != \"\" && $status != \"\" && $this->user_table != \"\") {\n $result = setstatus($id, $status, $this->user_table);\n if ($result == \"TRUE\") {\n echo json_encode(array('type' => 'success', 'msg' => lang('action_completed_successefully')));\n }\n else {\n echo json_encode(array('type' => 'error', 'msg' => lang(\"common_message_something_wrong_please_try_again\")));\n }\n }\n else {\n echo json_encode(array('type' => 'error', 'msg' => lang(\"common_message_something_wrong_please_try_again\")));\n }\n }" ]
[ "0.71709996", "0.71381205", "0.71347815", "0.6921455", "0.6919705", "0.68587476", "0.6856455", "0.67413205", "0.6631989", "0.6594265", "0.6550361", "0.6549804", "0.6512265", "0.6404038", "0.6389993", "0.6364511", "0.63544077", "0.6340499", "0.6296402", "0.6264655", "0.6262838", "0.62500256", "0.6237616", "0.622596", "0.62188905", "0.6216825", "0.6172152", "0.6142859", "0.6124612", "0.6101944", "0.60895365", "0.60623527", "0.6054283", "0.6041697", "0.60181177", "0.6015972", "0.6014225", "0.6007984", "0.600094", "0.5973423", "0.59434307", "0.5932751", "0.59322923", "0.592204", "0.5918032", "0.5908719", "0.59012383", "0.5887147", "0.5878462", "0.5878314", "0.5865578", "0.585847", "0.58517665", "0.58456093", "0.5844663", "0.58335793", "0.5829243", "0.58197993", "0.5818679", "0.5816134", "0.58158535", "0.5811357", "0.58078116", "0.580113", "0.5798384", "0.5795299", "0.57907176", "0.57907164", "0.5789582", "0.57871085", "0.57869685", "0.57765305", "0.5737938", "0.57377344", "0.57296365", "0.5728053", "0.5706751", "0.5705512", "0.57035494", "0.5701861", "0.5692719", "0.5682427", "0.56786066", "0.56784743", "0.56774175", "0.5674227", "0.56652087", "0.5663062", "0.56620556", "0.56575084", "0.5650894", "0.5647039", "0.5646685", "0.5644234", "0.5635052", "0.56296426", "0.56289446", "0.56286675", "0.5627902", "0.56255114" ]
0.79759675
0
The exact custom question field text (for example, "What kind of vehicle do you have?"). Generated from protobuf field string custom_question_text = 1;
Точный текст пользовательского поля вопроса (например, "Какой тип транспортного средства у вас есть?"). Генерируется из поля protobuf string custom_question_text = 1;
public function getCustomQuestionText() { return $this->custom_question_text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCustomQuestionText($var)\n {\n GPBUtil::checkString($var, True);\n $this->custom_question_text = $var;\n\n return $this;\n }", "public function get_question_text(){\n return $this->text;\n }", "function getQuestionType()\n\t{\n\t\treturn \"SurveyTextQuestion\";\n\t}", "public function getTxtQuestion(): ?string {\n return $this->txtQuestion;\n }", "public function getCustomQuestions()\n {\n if (array_key_exists(\"customQuestions\", $this->_propDict)) {\n return $this->_propDict[\"customQuestions\"];\n } else {\n return null;\n }\n }", "public function getCustomText()\n {\n $text = $this->getOption('text');\n\n if ($this->provider->supportsCustomText()) {\n return $text;\n }\n\n return null;\n }", "function SurveyTextQuestion(\n\t\t$title = \"\",\n\t\t$description = \"\",\n\t\t$author = \"\",\n\t\t$questiontext = \"\",\n\t\t$owner = -1\n\t)\n\t{\n\t\t$this->SurveyQuestion($title, $description, $author, $questiontext, $owner);\n\t\t$this->maxchars = 0;\n\t\t$this->textwidth = 50;\n\t\t$this->textheight = 5;\n\t}", "protected function asQuestion($text)\n {\n return $this->concat($text, 'question');\n }", "public function getText()\n {\n return $this->readOneof(5);\n }", "public function setText($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(5, $var);\n }", "public function supportsCustomText();", "public function getText()\n {\n return $this->readOneof(1);\n }", "public function getText()\n {\n return $this->readOneof(1);\n }", "public function getText()\n {\n return $this->readOneof(1);\n }", "public function getTextSnippet()\n {\n return $this->readOneof(2);\n }", "public function getTextInput()\n {\n return $this->readOneof(6);\n }", "protected function get_my_answer_string() {\n $answer = $this->get_my_answer();\n\n return !empty($answer->answer_data->answer) ? $answer->answer_data->answer : '';\n }", "private function get_custom_text( $key, $value, $data ) {\n\t\t$key = $data['snippet_key'] . '-custom-text';\n\t\treturn isset( $data['details'][ $key ] ) ? $data['details'][ $key ] : '';\n\t}", "public static function label()\n {\n return __('Questions');\n }", "public function getText()\n {\n return $this->readOneof(10);\n }", "function kia_custom_option(){\n\t $value = isset( $_POST['_custom_option'] ) ? sanitize_text_field( $_POST['_custom_option'] ) : '';\n\t printf( '<label>%s</label><input name=\"_custom_option\" value=\"%s\" />', __( 'Enter your custom text', 'kia-plugin-textdomain' ), esc_attr( $value ) );\n\t}", "function kia_email_order_meta_fields( $fields ) { \n\t $fields['custom_field'] = __( 'Your custom text', 'kia-plugin-textdomain' ); \n\t return $fields; \n\t}", "public function setText($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(1, $var);\n\n return $this;\n }", "function text($question)\n{\n global $savedData; //so that we can see if this already had an value.\n $id = $question->id;\n \n $existingValueAttribute = '';\n if(isset($savedData->$id)) $existingValueAttribute = ' value=\"' . $savedData->$id . '\"';\n \n $html = $question->question . ' <input type=\"text\" name=\"' . $id . '\"' . $existingValueAttribute . '><br>';\n return $html;\n}", "public function __toString() {\n if(!$this->visible) {\n return '';\n }\n \n return $this->question.'? '.(is_null($this->hint)?'':'['.$this->hint.'] ');\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function addFieldCaptchaText($question = '', $answer = '', $cols = 30, $max = 3, $help = ''){\n $this->_addField('captchaText', mteConst::MTE_FIELD_TEXT, mteConst::MTE_COLUMN_TEXT,array('title'=>$question, 'cols'=>$cols, 'rows'=>$rows, 'validate'=>true, 'help'=>$help, 'value'=>$answer));\n }", "public function setText($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(10, $var);\n\n return $this;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function testTextQueston()\n {\n $this->loadFixtures();\n\n $this\n ->visit(action('SurveyController@getSurvey', ['id' => $this->survey->id]))\n ->see($this->question->label)\n ->type($this->faker->word, $this->question->field)\n ;\n }", "static public function html_FieldTextLabels() {\n $schema = new SchemaCollection(\n Schema::fromFile(__DIR__ . '/../../test-data/test-schema.json')\n );\n\n $config = json_decode('{\"type\": \"field\",\"object\": \"test.text\"}');\n $element = new FieldElement();\n $element->configure($config);\n $binding = Binding::fromElement($element);\n $binding->bindSchema($schema);\n $binding->setValue('the value');\n $cases = self::addLabels($binding, '', 'Text ');\n\n $cases['valid'] = [$binding->copy()->setValid(true)];\n\n $cases['invalid'] = [$binding->copy()->setValid(false)];\n\n return self::normalizeCases($cases);\n }", "public function setCustomQuestions($val)\n {\n $this->_propDict[\"customQuestions\"] = $val;\n return $this;\n }", "private function _addText($question)\r\n {\r\n $elemName = $question['FQT_TypeName']\r\n . self::UNDERSCORE\r\n . $question['FQ_ElementID'];\r\n $element = new Zend_Form_Element_Text($elemName);\r\n $element->removeDecorator('DtDdWrapper');\r\n $element->addDecorators(\r\n array(\r\n 'ViewHelper',\r\n array('HtmlTag',\r\n array(\r\n 'tag' => 'div',\r\n 'class' => 'answer-zone')\r\n )\r\n ));\r\n $element->setAttrib('class', 'stdTextInput');\r\n\r\n $this->_addExtras($element, $question);\r\n\r\n $this->addElement($element);\r\n\r\n $this->_displayGroupElements[] = $elemName;\r\n }", "function restruxure_custom_ask_fields($args){\n\t$args['fields'][] =\n\t\tarray(\n\t\t\t'name' => 'restruxure_title_field_info',\n\t\t\t'type' => 'custom', // this can be, text, textarea, checkbox, hidden or custom\n\t\t\t'html' => '<p class=\"form-help\">The title is displayed in a prominent way and allows people to easily scan questions on any question list view.</p>', // If type is custom then html can be passed.\n\t\t\t'order' => 3, // Order of field\n\t\t);\n\t$args['fields'][] =\n\t\tarray(\n\t\t\t'name' => 'restruxure_description_field_info',\n\t\t\t'type' => 'custom', // this can be, text, textarea, checkbox, hidden or custom\n\t\t\t'html' => '<p class=\"form-help\">The description is optional and can be used to add additional information, images, links and videos.</p>', // If type is custom then html can be passed.\n\t\t\t'order' => 6, // Order of field\n\t\t);\n\t$args['fields'][] =\n\t\tarray(\n\t\t\t'name' => 'restruxure_category_field_info',\n\t\t\t'type' => 'custom', // this can be, text, textarea, checkbox, hidden or custom\n\t\t\t'html' => '<p class=\"form-help\">If your question does not fit well into our pre-defined categories, then choose \"Other\". A category is required.</p>', // If type is custom then html can be passed.\n\t\t\t'order' => 5, // Order of field\n\t\t);\n\t$args['fields'][] =\n\t\tarray(\n\t\t\t'name' => 'restruxure_tags_field_info',\n\t\t\t'type' => 'custom', // this can be, text, textarea, checkbox, hidden or custom\n\t\t\t'html' => '<p class=\"form-help\">Tags help find related content. When a question is tagged, people can select the tag name displayed on the question page in order to find similar questions. A tag can be the name of a yoga pose, or anything else relevant to your question. Tags are optional.</p>', // If type is custom then html can be passed.\n\t\t\t'order' => 10, // Order of field\n\t\t);\n\treturn $args;\n}", "public function get_feedback_text() {\n return $this->feedbacktext;\n }", "function hook_quiz_feedback_labels_alter(&$feedback_labels) {\n $feedback_labels['solution'] = t('The answer you should have chosen.');\n}", "function hook_quiz_question_info() {\n return array(\n 'long_answer' => array(\n 'name' => t('Example question type'),\n 'description' => t('An example question type that does something.'),\n 'question provider' => 'ExampleAnswerQuestion',\n 'response provider' => 'ExampleAnswerResponse',\n 'module' => 'quiz_question',\n ),\n );\n}", "public function getCustomPrivacyMessage()\n {\n if (array_key_exists(\"customPrivacyMessage\", $this->_propDict)) {\n return $this->_propDict[\"customPrivacyMessage\"];\n } else {\n return null;\n }\n }", "public function getTextanswerrequired()\n {\n return $this->textanswerrequired;\n }", "public function getCustomComment()\n {\n if ($this->getComment() != null) {\n return $this->getComment()->getText();\n } else {\n return \"\";\n }\n }", "public function getDataText()\n {\n return $this->readOneof(9);\n }", "public function getQq(){\n return $this->qq;\n }", "protected function getCustomLabel(){\r\n\t\treturn $this->custom_label;\r\n\t}", "public function getCustomLinkText()\n {\n if (array_key_exists(\"customLinkText\", $this->_propDict)) {\n return $this->_propDict[\"customLinkText\"];\n } else {\n return null;\n }\n }", "protected function textConstraint()\n {\n return sprintf('body %s', $this->_expectedValue->toString());\n }", "public function getCustomText(string $fallbackText = ''): ?string {\n if ($this->getAllowCustomText() && !empty($this->customText)) {\n return $this->customText;\n }\n\n $defaultText = $this->getDefaultText();\n return empty($defaultText)\n ? $fallbackText\n : Craft::t('site', $defaultText);\n }", "public function getQq()\n {\n return $this->qq;\n }", "function buildTextField($question)\n\t\t{//_9_5_1_5e60209_1159774535328_880334_110\n\t\t\tif($this->owner !== false) {\n\t\t\t\tQuestionaire::dump(\"+ Searching value for owner\");\n\t\t\t\t$q = new DBQuery(\"SELECT \".$question['destination_field'].\" FROM \".$question['destination_table'].\" WHERE \".$question['destination_idfield'].\"='\".$this->owner.\"'\");\n\t\t\t\t$r = $q->fetchIndex();\n\t\t\t\t$val = $r[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$val = \"\";\n\t\t\t}\n\n\t\t\tif($val == '') {\n\t\t\t\t$rowstyle = \"background-color: #FCE2E3\";\n\t\t\t}\n\n\t\t\tif(!$this->enabled) {\n\t\t\t\t$enabled = \"disabled=\\\"disabled\\\"\";\n\t\t\t}\n\n\t\t\techo \"<tr style=\\\"$rowstyle\\\"><td class=\\\"label\\\">\".htmlspecialchars($question['question']).\"</td><td><input $enabled style=\\\"\".$question['style'].\"\\\" class=\\\"string\\\" type=\\\"text\\\" name=\\\"\".$question['name'].\"\\\" id=\\\"\".$question['name'].\"\\\" value=\\\"$val\\\" /><small>\".htmlspecialchars($question['extra']).\"</small></td></tr>\\n\";\n\t\t}", "private function createFormText ($answer)\n {\n \t$form_string = \"<input type=\\\"hidden\\\" name=\\\"type\\\" value=\\\"text\\\">\\n\";\n \t$labels = explode (',', $this->input);\n \t// use autocomplete option instead of random string used in earlier version\n \t// this is html 5 only (but works in earlier versions even though incorrect)\n \t// pre-text\n \t$form_string .= \"<label>\";\n \t$form_string .= $labels[0];\n \t$form_string .= \"<input type=\\\"text\\\" name=\\\"answer\\\" autocomplete=\\\"off\\\" value=\\\"\";\n \t// if not answered show default, otherwise show current\n \tif ($answer != -1) {$form_string.= $answer;}\n \telse {$form_string .= $labels[1];}\n \t$form_string .= \"\\\" /></label>\";\n \t// post-text\n \t$form_string .= $labels[2];\n \treturn ($form_string);\n }", "public function get_question_type_string() {\n return $this->type;\n }", "function disp__custom_question($protect, $form_id, $bFilledInSpecial = false, $sFormHTML = false ) {\n\n \tif( $sQuestions = $this->func__get_plugin_option('questions') ) {\n global $FV_Antispam_iFilledInCount;\n \n \t\t$aQuestions = explode( \"\\n\", $sQuestions);\n\n \t\tif( !$aQuestions ) {\n \t\t\treturn false;\n \t\t}\n \t\t\n \t\t$iRandom = rand(0,count($aQuestions)-1);\n \t\t$sQuestion = $aQuestions[$iRandom];\n \t\tlist( $sAnswer, $sQuestion ) = explode( \",\", strrev($sQuestion), 2 );\n $sQuestion = strrev( $sQuestion );\n\n if( $sFormHTML && !$bFilledInSpecial ) {\n $html = str_replace( '[fvquestion]', \"<label class='fvacl' for='c_\".$protect.$FV_Antispam_iFilledInCount.\"'>\".__($sQuestion).\"</label>\", $sFormHTML );\n $html = str_replace( '[fvanswer]', \"<input class='fvacq' type='text' id='c_\".$protect.$FV_Antispam_iFilledInCount.\"' name='c_\".$protect.\"' size='5' /><input class='fvaca' type='hidden' name='ca_\".$protect.\"' value='\".$iRandom.\"' />\", $html );\n } else {\n $br = false;\n if( $bFilledInSpecial ) {\n $br = '<br />';\n } \n $html = \"\\n<span><label class='fvacl' for='c_\".$protect.$FV_Antispam_iFilledInCount.\"'>\".$br.__($sQuestion).\"</label></span> <input class='fvacq' type='text' id='c_\".$protect.$FV_Antispam_iFilledInCount.\"' name='c_\".$protect.\"' size='5' /><input class='fvaca' type='hidden' name='ca_\".$protect.\"' value='\".$iRandom.\"' />\\n\"; \t\n \n if( $bFilledInSpecial ) {\n $html = \"<div id='fvacq$form_id' class='fvacq_wrap' style='display: none'>$html</div>\\n\";\t//\ttodo: inline style - not so good!\n }\n }\n \t}\t\t\n\n \treturn $html;\n }", "public function getQuestion($locale = null)\n {\n if ($locale === null) {\n $locale = $this->_Locale;\n }\n\n return Zend_Locale_Data::getContent($locale, 'questionstrings');\n $yes = explode(':', $quest['yes']);\n $no = explode(':', $quest['no']);\n $quest['yes'] = $yes[0];\n $quest['yesabbr'] = $yes[1];\n $quest['no'] = $no[0];\n $quest['noabbr'] = $no[1];\n \n return $quest;\n }", "public function getCodeCollModifQuestion(): ?string {\n return $this->codeCollModifQuestion;\n }", "private function fixQtxt ( $questionText ) {\n\t\t$questionText = str_replace([\"\\r\\n\", \"\\n\", \"\\r\"], ' ',$questionText);\n\t\t$questionText = str_replace(\"'\", \"\\'\", $questionText);\n\t\t$questionText = str_replace('\"', '&quot;', $questionText);\n\t\treturn $questionText;\n\t}", "public function getQnaQuestion() {\n\t\treturn ($this->qnaQuestion);\n\t}", "public function getCodeCollQuestion(): ?string {\n return $this->codeCollQuestion;\n }", "public static function get_math_question()\n {\n if (!Session::get(\"mathQuestionV1\") && !Session::get(\"mathQuestionV2\")) {\n $v1 = rand(1, 9);\n $v2 = rand(1, 9);\n\n Session::set(\"mathQuestionV1\", $v1);\n Session::set(\"mathQuestionV2\", $v2);\n } else {\n $v1 = Session::get(\"mathQuestionV1\");\n $v2 = Session::get(\"mathQuestionV2\");\n }\n\n return sprintf(\n _t('MathSpamProtection.WHATIS', \"What is %s plus %s?\"),\n MathSpamProtectorField::digit_to_word($v1),\n MathSpamProtectorField::digit_to_word($v2)\n );\n }", "abstract public function include_field_desc( $custom_desc = false );", "public function question($string)\n {\n $this->line($string, 'question');\n }", "public function Text()\n {\n $type = $this->getUpdateType();\n if ($type == self::CALLBACK_QUERY) {\n return @$this->data['callback_query']['data'];\n }\n if ($type == self::CHANNEL_POST) {\n return @$this->data['channel_post']['text'];\n }\n if ($type == self::EDITED_MESSAGE) {\n return @$this->data['edited_message']['text'];\n }\n\n return @$this->data['message']['text'];\n }", "private function customMessage()\n {\n return [\n 'usernameORemail.required' => 'Username atau Email tidak boleh kosong',\n 'password.required' => 'Password tidak boleh kosong',\n ];\n }", "public static function get_linkerdesc_question_form_data_info() {\n $form = new stdClass();\n\n $form->name = 'Description';\n $form->questiontext = array('text' => 'Here is some information about the questions you are about to attempt.',\n 'format' => FORMAT_HTML);\n $form->generalfeedback = array('text' => 'And here is some more text shown only on the review page.',\n 'format' => FORMAT_HTML);\n\n return $form;\n }", "public function getText () :?string\n {\n if ($this->getUpdateType () == 'edited_message'){\n $text = $this->content ['edited_message']['text'];\n }\n if ($this->getUpdateType () == 'channel_post'){\n $text = $this->content ['channel_post']['text'];\n }\n if ($this->getUpdateType () == 'edited_channel_post'){\n $text = $this->content ['edited_channel_post']['text'];\n }\n if ($this->getUpdateType () == 'inline_query'){\n $text = $this->content ['inline_query']['query'];\n }\n if ($this->getUpdateType () == 'chosen_inline_result'){\n $text = $this->content ['chosen_inline_result']['query'];\n }\n if ($this->getUpdateType () == 'callback_query'){\n $text = $this->content ['callback_query']['data'];\n }\n return $text ?? $this->content ['message']['text'] ?? '';\n }", "public function saveNewQuestion($text){\n $data = [\n \"question\" => $text\n ];\n\n return AiResponseManager::create($data);\n }", "public function set_custom_data_as_string($customdata) {\n $this->customdata = $customdata;\n }", "function virement_custom_message($text) {\r\r\n\t\t\t$options = get_option('wpcb_options');\r\r\n\t\t\tif ($_SESSION['wpsc_previous_selected_gateway']=='virement')\t{\r\r\n\t\t\t\t$text = $text.'\r\r\n\t\t\t\t'.$options['textarea_virement'].'\r\r\n\t\t\t\t';\r\r\n\t\t\t}\r\r\n\t\t\treturn $text;\r\r\n}", "function ipal_question_tostring($question, $showicon = false,\n $showquestiontext = true, $return = true) {\n global $COURSE;\n $result = '';\n $result .= '<span class=\"questionname\">';\n if ($showicon) {\n $result .= print_question_icon($question, true);\n echo ' ';\n }\n $result .= shorten_text(format_string($question->name), 200) . '</span>';\n if ($showquestiontext) {\n $formatoptions = new stdClass();\n $formatoptions->noclean = true;\n $formatoptions->para = false;\n $questiontext = strip_tags(format_text($question->questiontext,\n $question->questiontextformat,\n $formatoptions, $COURSE->id));\n $questiontext = shorten_text($questiontext, 200);\n $result .= '<span class=\"questiontext\">';\n if (!empty($questiontext)) {\n $result .= $questiontext;\n } else {\n $result .= '<span class=\"error\">';\n $result .= get_string('questiontextisempty', 'quiz');\n $result .= '</span>';\n }\n $result .= '</span>';\n }\n if ($return) {\n return $result;\n } else {\n echo $result;\n }\n}", "function message_custom($text)\r\n {\r\n $this->custom_error_text = $text;\r\n $error_contents = $this->load('custom-error', false);\r\n\r\n if ($this->messages_delivered == false)\r\n {\r\n $_SESSION['pitchfork-messages'][] = $error_contents;\r\n }\r\n\r\n else\r\n {\r\n $this->append($error_contents);\r\n }\r\n }", "public function getFormText(){\n return $this->formText;\n }", "public function askQuestion(string $text, string $default = null): string\n {\n $question = new Question(\"\\r\\n\" . $text . ' ', $default);\n return $this->questionHelper->ask($this->input, $this->output, $question);\n }", "function _civicrm_api3_s_m_s_survey_translator_translate_spec(&$spec) {\n //$spec['magicword']['api.required'] = 1;\n}", "function vicode_create_field() {\n $args = array(\n 'id' => 'custom_file_field_title',\n 'label' => __( 'Additional Field Title', 'vicode' ),\n 'class' => 'vicode-custom-field',\n 'desc_tip' => true,\n 'description' => __( 'Enter the title of your additional custom text field.', 'ctwc' ),\n );\n woocommerce_wp_text_input( $args );\n}", "public function getName()\n {\n return 'generalText';\n }", "public function setDataText($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(9, $var);\n\n return $this;\n }", "public function setRawText($var)\n {\n GPBUtil::checkString($var, True);\n $this->raw_text = $var;\n\n return $this;\n }", "public function transform($question): string\n {\n return \"\";\n }", "public function createQuestion($type = self::TEXT_QUESTION);", "public function test_piwik_custom_variable_string_generation_produces_expected_output() {\n $piwik = new api\\piwik();\n $actual = $piwik::local_get_custom_var_string(987, 'name', 'value', 'context');\n\n $expected = '_paq.push([\"setCustomVariable\", 987, \"name\", \"value\", \"page\"]);'.\"\\n\";\n\n $this->assertEquals($expected, $actual);\n }", "public function getHelpText() {\n return @$this->attributes['help_text'];\n }", "function acf_qtranslate_strings() {\n\t\t$translations = get_fields('translate');\n\t\techo $translations ? '<script>window.acftranslate = ' . json_encode($translations, true) . ';</script>' : '';\n\t}", "protected function getQuestionHelper() {}", "public static function get_linkerdesc_question_data_info() {\n global $USER;\n\n $qdata = new stdClass();\n $qdata->id = 0;\n $qdata->contextid = 0;\n $qdata->category = 0;\n $qdata->parent = 0;\n $qdata->stamp = make_unique_id_code();\n $qdata->version = make_unique_id_code();\n $qdata->timecreated = time();\n $qdata->timemodified = time();\n $qdata->createdby = $USER->id;\n $qdata->modifiedby = $USER->id;\n $qdata->qtype = 'linkerdesc';\n $qdata->name = 'Description';\n $qdata->questiontext = 'Here is some information about the questions you are about to attempt.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'And here is some more text shown only on the review page.';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 0;\n $qdata->length = 0;\n $qdata->penalty = 0;\n $qdata->hidden = 0;\n $qdata->hints = array();\n $qdata->options = new stdClass();\n $qdata->options->answers = array();\n\n return $qdata;\n }", "public function message()\n {\n return __('validation.contains_field');\n }", "public function testAsStringCustomDelimeter()\n {\n $this->assertTrue(\n\t\t\t\t$this->Contact[3]\n\t\t\t\t->asString(': post to ') \n\t\t\t\t=== 'curl-addr: post to dev.amp-fg.com/JSONStatusRequest');\n }", "public function getPromoText()\n {\n return isset($this->promo_text) ? $this->promo_text : null;\n }", "private function register_email_pretext_field() {\n $post_types = array_merge(\n [ 'pedestal_newsletter' ],\n Types::get_post_types_by_supported_feature( 'breaking' )\n );\n\n $description = 'Aim for 140 characters and test it!';\n $field = new \\Fieldmanager_Textarea( false, [\n 'name' => 'email_preview_text',\n 'description' => $description,\n 'attributes' => [\n 'placeholder' => '(Optional)',\n 'width' => '100%',\n ],\n ] );\n $field->add_meta_box(\n 'Email Preview Text',\n $post_types,\n 'side',\n 'low'\n );\n }", "public static function text($resourceCode,$defaultText=null) {\n try {\n return self::getInstance()->getText($resourceCode, $defaultText);\n }\n catch (\\Exception $ex) {\n return $defaultText === null ? $resourceCode : $defaultText;\n }\n }", "public function form_default_text() {\n $form = array();\n $form['heading'] = __( 'Sorry to see you go', 'singularity' );\n $form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'singularity' );\n $form['options'] = array(\n __( 'Set up is too difficult', 'singularity' ),\n __( 'Lack of documentation', 'singularity' ),\n __( 'Not the features I wanted', 'singularity' ),\n __( 'Found a better plugin', 'singularity' ),\n __( 'Installed by mistake', 'singularity' ),\n __( 'Only required temporarily', 'singularity' ),\n __( 'Didn\\'t work', 'singularity' )\n );\n $form['details'] = __( 'Details (optional)', 'singularity' );\n return $form;\n }", "public function wsrc_create_custom_field() {\n\t\t$args = array(\n\t\t\t'id' => 'custom_atts_field_content',\n\t\t\t'label' => __( 'Custom attributes', 'wsrc' ),\n\t\t\t'class' => 'wsrc-custom-field',\n\t\t\t'desc_tip' => false,\n\t\t\t'placeholder' => '50g Heinz ketchup-ketchup-500',\n\t\t\t'description' => __( 'Format: [Label-id-price] - 50g Heinz ketchup-ketchup-500', 'ctwc' ),\n\t\t);\n\t\t\n\t\twoocommerce_wp_textarea_input( $args );\n\t}", "public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['trackingcode'] = array(\n\t\t\t\t\"name\" => \"Tracking Code\",\n\t\t\t\t\"type\" => \"textarea\",\n\t\t\t\t\"help\" => GetLang('VisualWebsiteOptimizerTrackingCodeHelp'),\n\t\t\t\t\"default\" => \"\",\n\t\t\t\t\"required\" => true,\n\t\t\t\t\"rows\" => 7\n\t\t\t);\n\t\t}", "function getQuestionForJS(){\r\n\t\treturn $this->question;\r\n\t}", "public function getQuestion();", "public function __toString()\n {\n return 'Question ' . $this->getKey() . ': ' . $this->getQuestion();\n }", "public function make_essayhelper_question_plain() {\n $q = $this->initialise_essayhelper_question();\n return $q;\n }", "public function textSetupDefined()\n {\n return sprintf('contains resource definition for %s module with %s name',\n $this->_moduleName, $this->_expectedValue);\n }", "public function getQuestion() {\n }" ]
[ "0.78725606", "0.65406024", "0.63529944", "0.6084843", "0.5951596", "0.57613397", "0.5697878", "0.5653886", "0.5637444", "0.55785465", "0.5556714", "0.55376846", "0.55376846", "0.55376846", "0.55176157", "0.54350007", "0.54294807", "0.5427387", "0.54173964", "0.5417033", "0.5406188", "0.5401353", "0.5337748", "0.5318546", "0.5309944", "0.5308134", "0.5302923", "0.5297279", "0.5275932", "0.5275932", "0.5275932", "0.5275932", "0.5275932", "0.5257356", "0.5252874", "0.5242479", "0.5222317", "0.52082527", "0.52050066", "0.5191841", "0.51836693", "0.5160688", "0.5137936", "0.5110798", "0.5110414", "0.5071477", "0.50574845", "0.50502235", "0.5050112", "0.50468284", "0.5038233", "0.5032467", "0.50258046", "0.5025265", "0.4999877", "0.49980775", "0.49903375", "0.4979521", "0.49759844", "0.4971668", "0.49676558", "0.49614564", "0.49573457", "0.49550363", "0.4953226", "0.49482045", "0.49224183", "0.49203882", "0.49182582", "0.4908843", "0.4897221", "0.4897003", "0.48958275", "0.488853", "0.48851952", "0.48800647", "0.4873929", "0.48682538", "0.48521832", "0.48404247", "0.48366228", "0.4830614", "0.48237103", "0.48236936", "0.48234442", "0.4822451", "0.48148334", "0.48123327", "0.4808921", "0.48073113", "0.4807135", "0.48046815", "0.48039496", "0.4790698", "0.47895476", "0.47788608", "0.47735727", "0.47732708", "0.47732463", "0.47723806" ]
0.8031796
0
The exact custom question field text (for example, "What kind of vehicle do you have?"). Generated from protobuf field string custom_question_text = 1;
Точный текст пользовательского поля вопроса (например, "Какой тип транспортного средства у вас есть?"). Генерируется из поля protobuf string custom_question_text = 1;
public function setCustomQuestionText($var) { GPBUtil::checkString($var, True); $this->custom_question_text = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCustomQuestionText()\n {\n return $this->custom_question_text;\n }", "public function get_question_text(){\n return $this->text;\n }", "function getQuestionType()\n\t{\n\t\treturn \"SurveyTextQuestion\";\n\t}", "public function getTxtQuestion(): ?string {\n return $this->txtQuestion;\n }", "public function getCustomQuestions()\n {\n if (array_key_exists(\"customQuestions\", $this->_propDict)) {\n return $this->_propDict[\"customQuestions\"];\n } else {\n return null;\n }\n }", "public function getCustomText()\n {\n $text = $this->getOption('text');\n\n if ($this->provider->supportsCustomText()) {\n return $text;\n }\n\n return null;\n }", "function SurveyTextQuestion(\n\t\t$title = \"\",\n\t\t$description = \"\",\n\t\t$author = \"\",\n\t\t$questiontext = \"\",\n\t\t$owner = -1\n\t)\n\t{\n\t\t$this->SurveyQuestion($title, $description, $author, $questiontext, $owner);\n\t\t$this->maxchars = 0;\n\t\t$this->textwidth = 50;\n\t\t$this->textheight = 5;\n\t}", "protected function asQuestion($text)\n {\n return $this->concat($text, 'question');\n }", "public function getText()\n {\n return $this->readOneof(5);\n }", "public function setText($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(5, $var);\n }", "public function supportsCustomText();", "public function getText()\n {\n return $this->readOneof(1);\n }", "public function getText()\n {\n return $this->readOneof(1);\n }", "public function getText()\n {\n return $this->readOneof(1);\n }", "public function getTextSnippet()\n {\n return $this->readOneof(2);\n }", "public function getTextInput()\n {\n return $this->readOneof(6);\n }", "protected function get_my_answer_string() {\n $answer = $this->get_my_answer();\n\n return !empty($answer->answer_data->answer) ? $answer->answer_data->answer : '';\n }", "private function get_custom_text( $key, $value, $data ) {\n\t\t$key = $data['snippet_key'] . '-custom-text';\n\t\treturn isset( $data['details'][ $key ] ) ? $data['details'][ $key ] : '';\n\t}", "public static function label()\n {\n return __('Questions');\n }", "public function getText()\n {\n return $this->readOneof(10);\n }", "function kia_custom_option(){\n\t $value = isset( $_POST['_custom_option'] ) ? sanitize_text_field( $_POST['_custom_option'] ) : '';\n\t printf( '<label>%s</label><input name=\"_custom_option\" value=\"%s\" />', __( 'Enter your custom text', 'kia-plugin-textdomain' ), esc_attr( $value ) );\n\t}", "function kia_email_order_meta_fields( $fields ) { \n\t $fields['custom_field'] = __( 'Your custom text', 'kia-plugin-textdomain' ); \n\t return $fields; \n\t}", "public function setText($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(1, $var);\n\n return $this;\n }", "function text($question)\n{\n global $savedData; //so that we can see if this already had an value.\n $id = $question->id;\n \n $existingValueAttribute = '';\n if(isset($savedData->$id)) $existingValueAttribute = ' value=\"' . $savedData->$id . '\"';\n \n $html = $question->question . ' <input type=\"text\" name=\"' . $id . '\"' . $existingValueAttribute . '><br>';\n return $html;\n}", "public function __toString() {\n if(!$this->visible) {\n return '';\n }\n \n return $this->question.'? '.(is_null($this->hint)?'':'['.$this->hint.'] ');\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function addFieldCaptchaText($question = '', $answer = '', $cols = 30, $max = 3, $help = ''){\n $this->_addField('captchaText', mteConst::MTE_FIELD_TEXT, mteConst::MTE_COLUMN_TEXT,array('title'=>$question, 'cols'=>$cols, 'rows'=>$rows, 'validate'=>true, 'help'=>$help, 'value'=>$answer));\n }", "public function setText($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(10, $var);\n\n return $this;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function getQuestion()\n {\n return $this->question;\n }", "public function testTextQueston()\n {\n $this->loadFixtures();\n\n $this\n ->visit(action('SurveyController@getSurvey', ['id' => $this->survey->id]))\n ->see($this->question->label)\n ->type($this->faker->word, $this->question->field)\n ;\n }", "static public function html_FieldTextLabels() {\n $schema = new SchemaCollection(\n Schema::fromFile(__DIR__ . '/../../test-data/test-schema.json')\n );\n\n $config = json_decode('{\"type\": \"field\",\"object\": \"test.text\"}');\n $element = new FieldElement();\n $element->configure($config);\n $binding = Binding::fromElement($element);\n $binding->bindSchema($schema);\n $binding->setValue('the value');\n $cases = self::addLabels($binding, '', 'Text ');\n\n $cases['valid'] = [$binding->copy()->setValid(true)];\n\n $cases['invalid'] = [$binding->copy()->setValid(false)];\n\n return self::normalizeCases($cases);\n }", "public function setCustomQuestions($val)\n {\n $this->_propDict[\"customQuestions\"] = $val;\n return $this;\n }", "private function _addText($question)\r\n {\r\n $elemName = $question['FQT_TypeName']\r\n . self::UNDERSCORE\r\n . $question['FQ_ElementID'];\r\n $element = new Zend_Form_Element_Text($elemName);\r\n $element->removeDecorator('DtDdWrapper');\r\n $element->addDecorators(\r\n array(\r\n 'ViewHelper',\r\n array('HtmlTag',\r\n array(\r\n 'tag' => 'div',\r\n 'class' => 'answer-zone')\r\n )\r\n ));\r\n $element->setAttrib('class', 'stdTextInput');\r\n\r\n $this->_addExtras($element, $question);\r\n\r\n $this->addElement($element);\r\n\r\n $this->_displayGroupElements[] = $elemName;\r\n }", "function restruxure_custom_ask_fields($args){\n\t$args['fields'][] =\n\t\tarray(\n\t\t\t'name' => 'restruxure_title_field_info',\n\t\t\t'type' => 'custom', // this can be, text, textarea, checkbox, hidden or custom\n\t\t\t'html' => '<p class=\"form-help\">The title is displayed in a prominent way and allows people to easily scan questions on any question list view.</p>', // If type is custom then html can be passed.\n\t\t\t'order' => 3, // Order of field\n\t\t);\n\t$args['fields'][] =\n\t\tarray(\n\t\t\t'name' => 'restruxure_description_field_info',\n\t\t\t'type' => 'custom', // this can be, text, textarea, checkbox, hidden or custom\n\t\t\t'html' => '<p class=\"form-help\">The description is optional and can be used to add additional information, images, links and videos.</p>', // If type is custom then html can be passed.\n\t\t\t'order' => 6, // Order of field\n\t\t);\n\t$args['fields'][] =\n\t\tarray(\n\t\t\t'name' => 'restruxure_category_field_info',\n\t\t\t'type' => 'custom', // this can be, text, textarea, checkbox, hidden or custom\n\t\t\t'html' => '<p class=\"form-help\">If your question does not fit well into our pre-defined categories, then choose \"Other\". A category is required.</p>', // If type is custom then html can be passed.\n\t\t\t'order' => 5, // Order of field\n\t\t);\n\t$args['fields'][] =\n\t\tarray(\n\t\t\t'name' => 'restruxure_tags_field_info',\n\t\t\t'type' => 'custom', // this can be, text, textarea, checkbox, hidden or custom\n\t\t\t'html' => '<p class=\"form-help\">Tags help find related content. When a question is tagged, people can select the tag name displayed on the question page in order to find similar questions. A tag can be the name of a yoga pose, or anything else relevant to your question. Tags are optional.</p>', // If type is custom then html can be passed.\n\t\t\t'order' => 10, // Order of field\n\t\t);\n\treturn $args;\n}", "public function get_feedback_text() {\n return $this->feedbacktext;\n }", "function hook_quiz_feedback_labels_alter(&$feedback_labels) {\n $feedback_labels['solution'] = t('The answer you should have chosen.');\n}", "function hook_quiz_question_info() {\n return array(\n 'long_answer' => array(\n 'name' => t('Example question type'),\n 'description' => t('An example question type that does something.'),\n 'question provider' => 'ExampleAnswerQuestion',\n 'response provider' => 'ExampleAnswerResponse',\n 'module' => 'quiz_question',\n ),\n );\n}", "public function getCustomPrivacyMessage()\n {\n if (array_key_exists(\"customPrivacyMessage\", $this->_propDict)) {\n return $this->_propDict[\"customPrivacyMessage\"];\n } else {\n return null;\n }\n }", "public function getTextanswerrequired()\n {\n return $this->textanswerrequired;\n }", "public function getCustomComment()\n {\n if ($this->getComment() != null) {\n return $this->getComment()->getText();\n } else {\n return \"\";\n }\n }", "public function getDataText()\n {\n return $this->readOneof(9);\n }", "public function getQq(){\n return $this->qq;\n }", "protected function getCustomLabel(){\r\n\t\treturn $this->custom_label;\r\n\t}", "public function getCustomLinkText()\n {\n if (array_key_exists(\"customLinkText\", $this->_propDict)) {\n return $this->_propDict[\"customLinkText\"];\n } else {\n return null;\n }\n }", "protected function textConstraint()\n {\n return sprintf('body %s', $this->_expectedValue->toString());\n }", "public function getCustomText(string $fallbackText = ''): ?string {\n if ($this->getAllowCustomText() && !empty($this->customText)) {\n return $this->customText;\n }\n\n $defaultText = $this->getDefaultText();\n return empty($defaultText)\n ? $fallbackText\n : Craft::t('site', $defaultText);\n }", "public function getQq()\n {\n return $this->qq;\n }", "function buildTextField($question)\n\t\t{//_9_5_1_5e60209_1159774535328_880334_110\n\t\t\tif($this->owner !== false) {\n\t\t\t\tQuestionaire::dump(\"+ Searching value for owner\");\n\t\t\t\t$q = new DBQuery(\"SELECT \".$question['destination_field'].\" FROM \".$question['destination_table'].\" WHERE \".$question['destination_idfield'].\"='\".$this->owner.\"'\");\n\t\t\t\t$r = $q->fetchIndex();\n\t\t\t\t$val = $r[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$val = \"\";\n\t\t\t}\n\n\t\t\tif($val == '') {\n\t\t\t\t$rowstyle = \"background-color: #FCE2E3\";\n\t\t\t}\n\n\t\t\tif(!$this->enabled) {\n\t\t\t\t$enabled = \"disabled=\\\"disabled\\\"\";\n\t\t\t}\n\n\t\t\techo \"<tr style=\\\"$rowstyle\\\"><td class=\\\"label\\\">\".htmlspecialchars($question['question']).\"</td><td><input $enabled style=\\\"\".$question['style'].\"\\\" class=\\\"string\\\" type=\\\"text\\\" name=\\\"\".$question['name'].\"\\\" id=\\\"\".$question['name'].\"\\\" value=\\\"$val\\\" /><small>\".htmlspecialchars($question['extra']).\"</small></td></tr>\\n\";\n\t\t}", "private function createFormText ($answer)\n {\n \t$form_string = \"<input type=\\\"hidden\\\" name=\\\"type\\\" value=\\\"text\\\">\\n\";\n \t$labels = explode (',', $this->input);\n \t// use autocomplete option instead of random string used in earlier version\n \t// this is html 5 only (but works in earlier versions even though incorrect)\n \t// pre-text\n \t$form_string .= \"<label>\";\n \t$form_string .= $labels[0];\n \t$form_string .= \"<input type=\\\"text\\\" name=\\\"answer\\\" autocomplete=\\\"off\\\" value=\\\"\";\n \t// if not answered show default, otherwise show current\n \tif ($answer != -1) {$form_string.= $answer;}\n \telse {$form_string .= $labels[1];}\n \t$form_string .= \"\\\" /></label>\";\n \t// post-text\n \t$form_string .= $labels[2];\n \treturn ($form_string);\n }", "public function get_question_type_string() {\n return $this->type;\n }", "function disp__custom_question($protect, $form_id, $bFilledInSpecial = false, $sFormHTML = false ) {\n\n \tif( $sQuestions = $this->func__get_plugin_option('questions') ) {\n global $FV_Antispam_iFilledInCount;\n \n \t\t$aQuestions = explode( \"\\n\", $sQuestions);\n\n \t\tif( !$aQuestions ) {\n \t\t\treturn false;\n \t\t}\n \t\t\n \t\t$iRandom = rand(0,count($aQuestions)-1);\n \t\t$sQuestion = $aQuestions[$iRandom];\n \t\tlist( $sAnswer, $sQuestion ) = explode( \",\", strrev($sQuestion), 2 );\n $sQuestion = strrev( $sQuestion );\n\n if( $sFormHTML && !$bFilledInSpecial ) {\n $html = str_replace( '[fvquestion]', \"<label class='fvacl' for='c_\".$protect.$FV_Antispam_iFilledInCount.\"'>\".__($sQuestion).\"</label>\", $sFormHTML );\n $html = str_replace( '[fvanswer]', \"<input class='fvacq' type='text' id='c_\".$protect.$FV_Antispam_iFilledInCount.\"' name='c_\".$protect.\"' size='5' /><input class='fvaca' type='hidden' name='ca_\".$protect.\"' value='\".$iRandom.\"' />\", $html );\n } else {\n $br = false;\n if( $bFilledInSpecial ) {\n $br = '<br />';\n } \n $html = \"\\n<span><label class='fvacl' for='c_\".$protect.$FV_Antispam_iFilledInCount.\"'>\".$br.__($sQuestion).\"</label></span> <input class='fvacq' type='text' id='c_\".$protect.$FV_Antispam_iFilledInCount.\"' name='c_\".$protect.\"' size='5' /><input class='fvaca' type='hidden' name='ca_\".$protect.\"' value='\".$iRandom.\"' />\\n\"; \t\n \n if( $bFilledInSpecial ) {\n $html = \"<div id='fvacq$form_id' class='fvacq_wrap' style='display: none'>$html</div>\\n\";\t//\ttodo: inline style - not so good!\n }\n }\n \t}\t\t\n\n \treturn $html;\n }", "public function getQuestion($locale = null)\n {\n if ($locale === null) {\n $locale = $this->_Locale;\n }\n\n return Zend_Locale_Data::getContent($locale, 'questionstrings');\n $yes = explode(':', $quest['yes']);\n $no = explode(':', $quest['no']);\n $quest['yes'] = $yes[0];\n $quest['yesabbr'] = $yes[1];\n $quest['no'] = $no[0];\n $quest['noabbr'] = $no[1];\n \n return $quest;\n }", "public function getCodeCollModifQuestion(): ?string {\n return $this->codeCollModifQuestion;\n }", "private function fixQtxt ( $questionText ) {\n\t\t$questionText = str_replace([\"\\r\\n\", \"\\n\", \"\\r\"], ' ',$questionText);\n\t\t$questionText = str_replace(\"'\", \"\\'\", $questionText);\n\t\t$questionText = str_replace('\"', '&quot;', $questionText);\n\t\treturn $questionText;\n\t}", "public function getQnaQuestion() {\n\t\treturn ($this->qnaQuestion);\n\t}", "public function getCodeCollQuestion(): ?string {\n return $this->codeCollQuestion;\n }", "public static function get_math_question()\n {\n if (!Session::get(\"mathQuestionV1\") && !Session::get(\"mathQuestionV2\")) {\n $v1 = rand(1, 9);\n $v2 = rand(1, 9);\n\n Session::set(\"mathQuestionV1\", $v1);\n Session::set(\"mathQuestionV2\", $v2);\n } else {\n $v1 = Session::get(\"mathQuestionV1\");\n $v2 = Session::get(\"mathQuestionV2\");\n }\n\n return sprintf(\n _t('MathSpamProtection.WHATIS', \"What is %s plus %s?\"),\n MathSpamProtectorField::digit_to_word($v1),\n MathSpamProtectorField::digit_to_word($v2)\n );\n }", "abstract public function include_field_desc( $custom_desc = false );", "public function question($string)\n {\n $this->line($string, 'question');\n }", "public function Text()\n {\n $type = $this->getUpdateType();\n if ($type == self::CALLBACK_QUERY) {\n return @$this->data['callback_query']['data'];\n }\n if ($type == self::CHANNEL_POST) {\n return @$this->data['channel_post']['text'];\n }\n if ($type == self::EDITED_MESSAGE) {\n return @$this->data['edited_message']['text'];\n }\n\n return @$this->data['message']['text'];\n }", "private function customMessage()\n {\n return [\n 'usernameORemail.required' => 'Username atau Email tidak boleh kosong',\n 'password.required' => 'Password tidak boleh kosong',\n ];\n }", "public static function get_linkerdesc_question_form_data_info() {\n $form = new stdClass();\n\n $form->name = 'Description';\n $form->questiontext = array('text' => 'Here is some information about the questions you are about to attempt.',\n 'format' => FORMAT_HTML);\n $form->generalfeedback = array('text' => 'And here is some more text shown only on the review page.',\n 'format' => FORMAT_HTML);\n\n return $form;\n }", "public function getText () :?string\n {\n if ($this->getUpdateType () == 'edited_message'){\n $text = $this->content ['edited_message']['text'];\n }\n if ($this->getUpdateType () == 'channel_post'){\n $text = $this->content ['channel_post']['text'];\n }\n if ($this->getUpdateType () == 'edited_channel_post'){\n $text = $this->content ['edited_channel_post']['text'];\n }\n if ($this->getUpdateType () == 'inline_query'){\n $text = $this->content ['inline_query']['query'];\n }\n if ($this->getUpdateType () == 'chosen_inline_result'){\n $text = $this->content ['chosen_inline_result']['query'];\n }\n if ($this->getUpdateType () == 'callback_query'){\n $text = $this->content ['callback_query']['data'];\n }\n return $text ?? $this->content ['message']['text'] ?? '';\n }", "public function saveNewQuestion($text){\n $data = [\n \"question\" => $text\n ];\n\n return AiResponseManager::create($data);\n }", "public function set_custom_data_as_string($customdata) {\n $this->customdata = $customdata;\n }", "function virement_custom_message($text) {\r\r\n\t\t\t$options = get_option('wpcb_options');\r\r\n\t\t\tif ($_SESSION['wpsc_previous_selected_gateway']=='virement')\t{\r\r\n\t\t\t\t$text = $text.'\r\r\n\t\t\t\t'.$options['textarea_virement'].'\r\r\n\t\t\t\t';\r\r\n\t\t\t}\r\r\n\t\t\treturn $text;\r\r\n}", "function ipal_question_tostring($question, $showicon = false,\n $showquestiontext = true, $return = true) {\n global $COURSE;\n $result = '';\n $result .= '<span class=\"questionname\">';\n if ($showicon) {\n $result .= print_question_icon($question, true);\n echo ' ';\n }\n $result .= shorten_text(format_string($question->name), 200) . '</span>';\n if ($showquestiontext) {\n $formatoptions = new stdClass();\n $formatoptions->noclean = true;\n $formatoptions->para = false;\n $questiontext = strip_tags(format_text($question->questiontext,\n $question->questiontextformat,\n $formatoptions, $COURSE->id));\n $questiontext = shorten_text($questiontext, 200);\n $result .= '<span class=\"questiontext\">';\n if (!empty($questiontext)) {\n $result .= $questiontext;\n } else {\n $result .= '<span class=\"error\">';\n $result .= get_string('questiontextisempty', 'quiz');\n $result .= '</span>';\n }\n $result .= '</span>';\n }\n if ($return) {\n return $result;\n } else {\n echo $result;\n }\n}", "function message_custom($text)\r\n {\r\n $this->custom_error_text = $text;\r\n $error_contents = $this->load('custom-error', false);\r\n\r\n if ($this->messages_delivered == false)\r\n {\r\n $_SESSION['pitchfork-messages'][] = $error_contents;\r\n }\r\n\r\n else\r\n {\r\n $this->append($error_contents);\r\n }\r\n }", "public function getFormText(){\n return $this->formText;\n }", "public function askQuestion(string $text, string $default = null): string\n {\n $question = new Question(\"\\r\\n\" . $text . ' ', $default);\n return $this->questionHelper->ask($this->input, $this->output, $question);\n }", "function _civicrm_api3_s_m_s_survey_translator_translate_spec(&$spec) {\n //$spec['magicword']['api.required'] = 1;\n}", "function vicode_create_field() {\n $args = array(\n 'id' => 'custom_file_field_title',\n 'label' => __( 'Additional Field Title', 'vicode' ),\n 'class' => 'vicode-custom-field',\n 'desc_tip' => true,\n 'description' => __( 'Enter the title of your additional custom text field.', 'ctwc' ),\n );\n woocommerce_wp_text_input( $args );\n}", "public function getName()\n {\n return 'generalText';\n }", "public function setDataText($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(9, $var);\n\n return $this;\n }", "public function setRawText($var)\n {\n GPBUtil::checkString($var, True);\n $this->raw_text = $var;\n\n return $this;\n }", "public function transform($question): string\n {\n return \"\";\n }", "public function createQuestion($type = self::TEXT_QUESTION);", "public function test_piwik_custom_variable_string_generation_produces_expected_output() {\n $piwik = new api\\piwik();\n $actual = $piwik::local_get_custom_var_string(987, 'name', 'value', 'context');\n\n $expected = '_paq.push([\"setCustomVariable\", 987, \"name\", \"value\", \"page\"]);'.\"\\n\";\n\n $this->assertEquals($expected, $actual);\n }", "public function getHelpText() {\n return @$this->attributes['help_text'];\n }", "function acf_qtranslate_strings() {\n\t\t$translations = get_fields('translate');\n\t\techo $translations ? '<script>window.acftranslate = ' . json_encode($translations, true) . ';</script>' : '';\n\t}", "protected function getQuestionHelper() {}", "public static function get_linkerdesc_question_data_info() {\n global $USER;\n\n $qdata = new stdClass();\n $qdata->id = 0;\n $qdata->contextid = 0;\n $qdata->category = 0;\n $qdata->parent = 0;\n $qdata->stamp = make_unique_id_code();\n $qdata->version = make_unique_id_code();\n $qdata->timecreated = time();\n $qdata->timemodified = time();\n $qdata->createdby = $USER->id;\n $qdata->modifiedby = $USER->id;\n $qdata->qtype = 'linkerdesc';\n $qdata->name = 'Description';\n $qdata->questiontext = 'Here is some information about the questions you are about to attempt.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'And here is some more text shown only on the review page.';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 0;\n $qdata->length = 0;\n $qdata->penalty = 0;\n $qdata->hidden = 0;\n $qdata->hints = array();\n $qdata->options = new stdClass();\n $qdata->options->answers = array();\n\n return $qdata;\n }", "public function message()\n {\n return __('validation.contains_field');\n }", "public function testAsStringCustomDelimeter()\n {\n $this->assertTrue(\n\t\t\t\t$this->Contact[3]\n\t\t\t\t->asString(': post to ') \n\t\t\t\t=== 'curl-addr: post to dev.amp-fg.com/JSONStatusRequest');\n }", "public function getPromoText()\n {\n return isset($this->promo_text) ? $this->promo_text : null;\n }", "private function register_email_pretext_field() {\n $post_types = array_merge(\n [ 'pedestal_newsletter' ],\n Types::get_post_types_by_supported_feature( 'breaking' )\n );\n\n $description = 'Aim for 140 characters and test it!';\n $field = new \\Fieldmanager_Textarea( false, [\n 'name' => 'email_preview_text',\n 'description' => $description,\n 'attributes' => [\n 'placeholder' => '(Optional)',\n 'width' => '100%',\n ],\n ] );\n $field->add_meta_box(\n 'Email Preview Text',\n $post_types,\n 'side',\n 'low'\n );\n }", "public static function text($resourceCode,$defaultText=null) {\n try {\n return self::getInstance()->getText($resourceCode, $defaultText);\n }\n catch (\\Exception $ex) {\n return $defaultText === null ? $resourceCode : $defaultText;\n }\n }", "public function form_default_text() {\n $form = array();\n $form['heading'] = __( 'Sorry to see you go', 'singularity' );\n $form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'singularity' );\n $form['options'] = array(\n __( 'Set up is too difficult', 'singularity' ),\n __( 'Lack of documentation', 'singularity' ),\n __( 'Not the features I wanted', 'singularity' ),\n __( 'Found a better plugin', 'singularity' ),\n __( 'Installed by mistake', 'singularity' ),\n __( 'Only required temporarily', 'singularity' ),\n __( 'Didn\\'t work', 'singularity' )\n );\n $form['details'] = __( 'Details (optional)', 'singularity' );\n return $form;\n }", "public function wsrc_create_custom_field() {\n\t\t$args = array(\n\t\t\t'id' => 'custom_atts_field_content',\n\t\t\t'label' => __( 'Custom attributes', 'wsrc' ),\n\t\t\t'class' => 'wsrc-custom-field',\n\t\t\t'desc_tip' => false,\n\t\t\t'placeholder' => '50g Heinz ketchup-ketchup-500',\n\t\t\t'description' => __( 'Format: [Label-id-price] - 50g Heinz ketchup-ketchup-500', 'ctwc' ),\n\t\t);\n\t\t\n\t\twoocommerce_wp_textarea_input( $args );\n\t}", "public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['trackingcode'] = array(\n\t\t\t\t\"name\" => \"Tracking Code\",\n\t\t\t\t\"type\" => \"textarea\",\n\t\t\t\t\"help\" => GetLang('VisualWebsiteOptimizerTrackingCodeHelp'),\n\t\t\t\t\"default\" => \"\",\n\t\t\t\t\"required\" => true,\n\t\t\t\t\"rows\" => 7\n\t\t\t);\n\t\t}", "function getQuestionForJS(){\r\n\t\treturn $this->question;\r\n\t}", "public function getQuestion();", "public function __toString()\n {\n return 'Question ' . $this->getKey() . ': ' . $this->getQuestion();\n }", "public function make_essayhelper_question_plain() {\n $q = $this->initialise_essayhelper_question();\n return $q;\n }", "public function textSetupDefined()\n {\n return sprintf('contains resource definition for %s module with %s name',\n $this->_moduleName, $this->_expectedValue);\n }", "public function getQuestion() {\n }" ]
[ "0.8031796", "0.65406024", "0.63529944", "0.6084843", "0.5951596", "0.57613397", "0.5697878", "0.5653886", "0.5637444", "0.55785465", "0.5556714", "0.55376846", "0.55376846", "0.55376846", "0.55176157", "0.54350007", "0.54294807", "0.5427387", "0.54173964", "0.5417033", "0.5406188", "0.5401353", "0.5337748", "0.5318546", "0.5309944", "0.5308134", "0.5302923", "0.5297279", "0.5275932", "0.5275932", "0.5275932", "0.5275932", "0.5275932", "0.5257356", "0.5252874", "0.5242479", "0.5222317", "0.52082527", "0.52050066", "0.5191841", "0.51836693", "0.5160688", "0.5137936", "0.5110798", "0.5110414", "0.5071477", "0.50574845", "0.50502235", "0.5050112", "0.50468284", "0.5038233", "0.5032467", "0.50258046", "0.5025265", "0.4999877", "0.49980775", "0.49903375", "0.4979521", "0.49759844", "0.4971668", "0.49676558", "0.49614564", "0.49573457", "0.49550363", "0.4953226", "0.49482045", "0.49224183", "0.49203882", "0.49182582", "0.4908843", "0.4897221", "0.4897003", "0.48958275", "0.488853", "0.48851952", "0.48800647", "0.4873929", "0.48682538", "0.48521832", "0.48404247", "0.48366228", "0.4830614", "0.48237103", "0.48236936", "0.48234442", "0.4822451", "0.48148334", "0.48123327", "0.4808921", "0.48073113", "0.4807135", "0.48046815", "0.48039496", "0.4790698", "0.47895476", "0.47788608", "0.47735727", "0.47732708", "0.47732463", "0.47723806" ]
0.78725606
1
Answer configuration for a single choice question. Minimum of 2 answers and maximum of 12 allowed. Generated from protobuf field .google.ads.googleads.v14.common.LeadFormSingleChoiceAnswers single_choice_answers = 2;
Конфигурация ответа для вопроса с одним выбором. Минимум 2 ответа и максимум 12. Генерируется из поля protobuf .google.ads.googleads.v14.common.LeadFormSingleChoiceAnswers single_choice_answers = 2;
public function getSingleChoiceAnswers() { return $this->readOneof(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSingleChoiceAnswers($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V14\\Common\\LeadFormSingleChoiceAnswers::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }", "public function setActualAnswer(SingleChoiceAnswerInterface $answer);", "private function changeAnswersSingleChoice($model) {\n\t\t$i = 1;\n\t\twhile(isset($_POST['choice_single_text'][$i])) {\n\t\t\t// add choice\n\t\t\tif($_POST['choice_single_id'][$i] == \"\") {\n\t\t\t\t// now check whether the answer was deleted\n\t\t\t\tif($_POST['choice_single_deleted'][$i] != true\n\t\t\t\t&& !empty($_POST['choice_single_text'][$i])) {\n\t\t\t\t\t// create choice\n\t\t\t\t\t$model->createChoice($_POST['question_id'],$_POST['choice_single_type'][$i],\n\t\t\t\t\t$_POST['choice_single_text'][$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// delete choice\n\t\t\telse if($_POST['choice_single_deleted'][$i] == true) {\n\t\t\t\t$model->deleteChoice($_POST['choice_single_id'][$i]);\n\t\t\t}\n\t\t\t// change choice\n\t\t\telse {\n\t\t\t\t$model->updateChoice($_POST['choice_single_id'][$i],\n\t\t\t\t$_POST['choice_single_type'][$i],\n\t\t\t\t$_POST['choice_single_text'][$i],\n\t\t\t\t$_POST['rowID'][$i]);\n\t\t\t}\n\t\t\t// increment counter\n\t\t\t$i++;\n\t\t}\n\t}", "private function createAnswersSingleChoice($model, $question_id) {\n\t\t$i = \"1\";\n\t\t// now iterate though all answers\n\t\twhile(isset($_POST['choice_single_text'][$i])) {\n\t\t// now check whether the answer was deleted\n\t\t\tif($_POST['choice_single_deleted'][$i] != true && !empty($_POST['choice_single_text'][$i])) {\n\t\t\t$model->createChoice($question_id,$_POST['choice_single_type'][$i],$_POST['choice_single_text'][$i]);\n\t\t\t\t\t}\n\t\t$i++;\n\t\t}\n\t}", "public function test_answer_create_multiple_answers_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question1_id = '1';\n $question2_id = '3';\n\n $data = [\n [\n 'question_id' => $question1_id,\n 'questionnaire_id' => '1',\n 'response' => 'other',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ],\n [\n 'question_id' => $question2_id,\n 'questionnaire_id' => '1',\n 'response' => '1,Y',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]\n ];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question1_id => [\n 'The response must be one of the following types: yes, no'\n ],\n $question2_id => [\n 'The response must be one of the following types: 1, 2, 3, 4, 5'\n ]\n ]\n ]);\n }", "public function loadAnswerSingleChoice($question_id, $tpl, $model) {\n\t\t$choices = $model->getChoices($question_id);\n\t\t$result = array();\n\t\t$i = \"1\";\n\t\n\t\t$tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n\t\t$tpl->setVariable(\"HIDE_MULTIPLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\t\t$tpl->setVariable(\"SELECTED_SINGLE\", 'selected=\"selected\"');\n\t\t\n\t\tif(!count($choices) == 0) {\n\t\t\tforeach($choices as $choice){\n $tpl->setCurrentBlock(\"single_choice_block\");\n \n // escape curvy brackets, so that ILIAS cannot use them as \n // placeholder\n $choice['text'] = ilObjMobileQuizHelper::escapeCurvyBrackets($choice['text']);\n \n $tpl->setVariable(\"MUL_SHOW\", \"\");\n $tpl->setVariable(\"MUL_TEXT\", $choice['text']);\n $tpl->setVariable(\"MUL_ID\", $choice['choice_id']);\n $tpl->setVariable(\"MUL_COU\", $i);\n $tpl->setVariable(\"MUL_DEL\", false);\n $tpl->setVariable(\"MUL_TYPE_C\", ($choice['correct_value'] == 1) ? \"checked\" : \"\");\n $tpl->setVariable(\"MUL_TYPE_N\", ($choice['correct_value'] == 2) ? \"checked\" : \"\");\n $tpl->setVariable(\"MUL_TYPE_I\", ($choice['correct_value'] == 0) ? \"checked\" : \"\");\n $tpl->setVariable(\"ROW_ID\", $choice['choice_order']); \n \n $tpl->parseCurrentBlock();\n\t\n $i++;\n\t\t\t}\n\t\t}\n\t}", "public function setOneAnswer($answer){\r\n \t\t$answer_id = $answer['id'];\r\n \t\t// find all answers in this question\r\n \t\t$list_answers = $this->dom_Answers->getElementsByTagName(\"ans\");\r\n \t\t// check id\r\n \t\t$is_update = false;\r\n \t\tif($list_answers)\r\n\t \t\tforeach($list_answers as $ans){\r\n\t \t\t\t// check exists id \t\t\t\r\n\t \t\t\tforeach($ans->attributes as $attName=>$attrNode)\r\n\t\t \t\t\t\tif($attName==\"id\" && $attrNode->nodeValue==$answer_id){\r\n\t\t \t\t\t\t\t$is_update = true;\r\n\t\t \t\t\t\t\tbreak;\r\n\t\t \t\t\t\t}\r\n\t\t \t\t// if check id is ok\r\n\t\t \t\tif($is_update){\r\n\t\t \t\t\t$dom_ans = $ans;\r\n\t\t \t\t\tforeach ($answer as $key=>$value){\r\n\t\t \t\t\t\t$this->setAttributeOfElementXml($dom_ans,$key,$value);\r\n\t\t \t\t\t}\r\n\t\t \t\t\tbreak;\r\n\t\t \t\t}\r\n\t \t\t}\r\n\r\n \t\tif($is_update==false){// insert new answer \r\n \t\t\t$dom_ans = $this->domXml->createElement(\"ans\");\r\n \t\t\tforeach($answer as $key=>$value)\r\n \t\t\t\t$this->setAttributeOfElementXml($dom_ans,$key,$value); \t\t\t\t\r\n \t\t\t$this->dom_Answers->appendChild($dom_ans);\r\n \t\t\t\r\n\t\t}\r\n \t}", "function setAnswer()\n {\n switch($this->type)\n {\n case MCUA :\n $answer = new AikenAnswerMultipleChoice($this->id);\n \treturn $answer;\n default :\n $answer = null;\n break;\n }\n return $answer;\n }", "public function test_answer_create_numeric_multi()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '3';\n\n $data = [[\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => '1,3',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]];\n\n $response = $this->postJsonTest($url, $data);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'status' => 'success',\n 'data' => [\n 'multianswer' => $data\n ]\n ]);\n }", "public function testCreateAnswerOnSingleQuestion(): void\n {\n $serializer = $this->symfony->grabService('serializer');\n $validator = $this->symfony->grabService(ValidatorService::class);\n $eventDispatcher = $this->symfony->grabService(EventDispatcherInterface::class);\n $questionRepository = $this->symfony->grabService(QuestionRepository::class);\n $answerRepository = $this->symfony->grabService(AnswerRepository::class);\n\n $factory = new EntityFactory($serializer, $validator);\n $question = $questionRepository->findOneById(self::QUESTION_ID);\n\n $data = [\n 'text' => 'Excellent',\n 'answer_placeholder' => [\n 'id' => self::ANSWER_PLACEHOLDER_ID\n ],\n 'uuid' => '1234-5678-9101'\n ];\n\n /** @var AnswerController $answerController */\n $answerController = new AnswerController($serializer);\n\n /** @var Request $request */\n $request = new Request([], $data, [], [], [], [], json_encode($data));\n\n /** @var JsonResponse $response */\n $response = $answerController->create($request, $question, $factory, $answerRepository, $eventDispatcher);\n\n /** @var \\stdClass $answerObject */\n $answerObject = json_decode($response->getContent(), false);\n\n /** @var Answer $answer */\n $answer = $this->tester->grabEntityFromRepository(Answer::class, ['id' => $answerObject->id]);\n\n /** @var AnswerLog $answerLog */\n $answerLog = $this->tester->grabEntityFromRepository(AnswerLog::class, ['answer' => $answer]);\n\n $this->tester->assertNotNull($answer);\n $this->tester->assertNotNull($answerLog);\n $this->tester->assertSame($answer->getAnswerPlaceholder()->getId(), self::ANSWER_PLACEHOLDER_ID);\n $this->tester->assertSame($answer->getQuestion()->getId(), self::QUESTION_ID);\n }", "public function test_answer_create_numeric_multi_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '3';\n\n $data = [\n [\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => '1,Y',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]\n ];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question_id => [\n 'The response must be one of the following types: 1, 2, 3, 4, 5'\n ]\n ]\n ]);\n }", "function _dquarks_edit_submit_multichoice_add_questions($form, &$form_state) {\n $items = array('choices', 'labels', 'notes');\n foreach ($items as $keys) {\n $add[$keys] = $form_state['input']['extra']['items'][$keys]['add'];\n unset($form_state['input']['extra']['items'][$keys]['add']);\n }\n if (count($form_state['values']['extra']['items']['choices']) > 1) {\n $max = 1 + max(array_keys($form_state['values']['extra']['items']['choices']));\n }\n else {\n $max = 1 + array_pop(array_keys($form_state['values']['extra']['items']['choices']));\n }\n if (!empty($add['labels'])) {\n foreach ($items as $keys) {\n $form_state['values']['extra']['items'][$keys][$max] = $add[$keys];\n unset($form_state['values']['extra']['items'][$keys]['add']);\n }\n }\n $form_state['rebuild'] = TRUE;\n}", "public function validateAnswer(Item $itemEntity, array $answer)\n {\n /** @var Question $question */\n $question = ItemResourceFactory::create($itemEntity)->getContent();\n\n $nbProp = count($question->getPropositions());\n\n if (count($answer) !== $nbProp) {\n throw new InvalidAnswerException('Invalid number of objects in the answer');\n }\n\n foreach ($answer as $ans) {\n if ($ans !== 1 && $ans !== 0) {\n throw new InvalidAnswerException('Invalid format for response : 0 or 1 expected.');\n }\n }\n }", "protected function define_answers_section()\n {\n // defines the list of params to represents the answer\n $this->add_per_answer_fields($this->_form, \"\", question_bank::fraction_options_full(), 0);\n }", "public function loadAnswerMultipleChoice($question_id, $tpl, $model) {\n\t\t$choices = $model->getChoices($question_id);\n\t\t$result = array();\n\t\t$i = \"1\";\n\t\t\n\t\t$tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n\t\t$tpl->setVariable(\"HIDE_SINGLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\t\t$tpl->setVariable(\"SELECTED_MULTIPLE\",'selected=\"selected\"');\n\t\t\n\t\tif(!count($choices) == 0) {\n\t\t\tforeach($choices as $choice){\n\t\t\t\t$tpl->setCurrentBlock(\"multiple_choice_block\");\n \n // escape curvy brackets, so that ILIAS cannot use them as \n // placeholder\n $choice['text'] = ilObjMobileQuizHelper::escapeCurvyBrackets($choice['text']);\n \n\t\t\t\t$tpl->setVariable(\"MUL_SHOW\", \"\");\n\t\t\t\t$tpl->setVariable(\"MUL_TEXT\", $choice['text']);\n\t\t\t\t$tpl->setVariable(\"MUL_ID\", $choice['choice_id']);\n\t\t\t\t$tpl->setVariable(\"MUL_COU\", $i);\n\t\t\t\t$tpl->setVariable(\"MUL_DEL\", false);\n\t\t\t\t$tpl->setVariable(\"MUL_TYPE_C\", ($choice['correct_value'] == 1) ? \"checked\" : \"\");\n\t\t\t\t$tpl->setVariable(\"MUL_TYPE_N\", ($choice['correct_value'] == 2) ? \"checked\" : \"\");\n\t\t\t\t$tpl->setVariable(\"MUL_TYPE_I\", ($choice['correct_value'] == 0) ? \"checked\" : \"\");\t\t\t\n\t\t\t\t$tpl->setVariable(\"ROW_ID\", $choice['choice_order']);\n\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}", "public function getIsSingleLineQuestion()\n {\n if (array_key_exists(\"isSingleLineQuestion\", $this->_propDict)) {\n return $this->_propDict[\"isSingleLineQuestion\"];\n } else {\n return null;\n }\n }", "protected function choice(string $question, array $choices, ?string $default = NULL, bool $multiselect = FALSE) {\n $question = Utils::stripSlashes(Utils::replaceTokens($question, $this->vars));\n\n // The choices can be an associative array.\n $choice_labels = \\array_values($choices);\n // Start choices list form '1'.\n \\array_unshift($choice_labels, NULL);\n unset($choice_labels[0]);\n\n $question = new ChoiceQuestion($question, $choice_labels, $default);\n $question->setMultiselect($multiselect);\n\n // Do not use IO choice here as it prints choice key as default value.\n // @see \\Symfony\\Component\\Console\\Style\\SymfonyStyle::choice().\n $answer = $this->io->askQuestion($question);\n\n // @todo Create a test for this.\n $get_key = static fn (string $answer): string => \\array_search($answer, $choices);\n return \\is_array($answer) ? \\array_map($get_key, $answer) : $get_key($answer);\n }", "public function test_answer_create_ask_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '1';\n\n $data = [[\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => 'yes',\n 'nurse_comment' => 'nurse comment',\n 'ask' => '4'\n ]];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question_id => [\n 'The selected ask is invalid.'\n ]\n ]\n ]);\n }", "private function _addSingleChoice($question)\r\n {\r\n $elemName = $question['FQT_TypeName']\r\n . self::UNDERSCORE\r\n . $question['FQ_ElementID'];\r\n $element = new Zend_Form_Element_Radio($elemName);\r\n $element->removeDecorator('DtDdWrapper');\r\n $element->addDecorators(\r\n array(\r\n 'ViewHelper',\r\n array('HtmlTag',\r\n array(\r\n 'tag' => 'div',\r\n 'class' => 'answer-zone')\r\n )\r\n ));\r\n\r\n $this->_addExtras($element, $question);\r\n $this->addElement($element);\r\n\r\n $this->_displayGroupElements[] = $elemName;\r\n }", "public function editQuestion($checkonly = FALSE)\n\t{\n\t\t$save = $this->isSaveCommand();\n\t\t$this->getQuestionTemplate();\n\n\t\tinclude_once(\"./Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t$form->setFormAction($this->ctrl->getFormAction($this));\n\t\t$form->setTitle($this->outQuestionType());\n\t\t$isSingleline = ($this->object->lastChange == 0 && !array_key_exists('types', $_POST)) ? (($this->object->getMultilineAnswerSetting()) ? false : true) : $this->object->isSingleline;\n\t\tif ($checkonly) $isSingleline = ($_POST['types'] == 0) ? true : false;\n\t\tif ($isSingleline)\n\t\t{\n\t\t\t$form->setMultipart(TRUE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setMultipart(FALSE);\n\t\t}\n\t\t$form->setTableWidth(\"100%\");\n\t\t$form->setId(\"assmultiplechoice\");\n\n\t\t// title, author, description, question, working time (assessment mode)\n\t\t$this->addBasicQuestionFormProperties( $form );\n\t\t$this->populateQuestionSpecificFormPart( $form );\n\t\t$this->populateAnswerSpecificFormPart( $form );\n\t\t$this->populateTaxonomyFormSection($form);\n\t\t$this->addQuestionFormCommandButtons($form);\n\n\t\t$errors = false;\n\n\t\tif ($save)\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$errors = !$form->checkInput();\n\t\t\t$form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes\n\t\t\tif ($errors) $checkonly = false;\n\t\t}\n\n\t\tif (!$checkonly) $this->tpl->setVariable(\"QUESTION_DATA\", $form->getHTML());\n\t\treturn $errors;\n\t}", "private function createAnswersMultipleChoice($model, $question_id) {\n\t\t$i = \"1\";\n\t\t// now iterate though all answers\n\t\twhile(isset($_POST['choice_multiple_text'][$i])) {\n\t\t// now check whether the answer was deleted\n\t\t\tif($_POST['choice_multiple_deleted'][$i] != true && !empty($_POST['choice_multiple_text'][$i])) {\n\t\t\t$model->createChoice($question_id,$_POST['choice_multiple_type'][$i],$_POST['choice_multiple_text'][$i]);\n\t\t\t\t\t}\n\t\t$i++;\n\t\t}\n\t}", "public function hasAnswer(ChoiceAnswer $answer);", "public function choice($question, array $choices, $default = null, $attempts = null, $multiple = false)\n {\n $question = new ChoiceQuestion($question, $choices, $default);\n\n $question->setMaxAttempts($attempts)->setMultiselect($multiple);\n\n return $this->output->askQuestion($question);\n }", "function getAnswers() {\n return $this->answers;\n }", "function _dquarks_submit_multichoice(&$data, $component) {\n $corrects = $childs = $return = array();\n $options = $component['extra']['items'][\"labels\"];\n $wrong = FALSE;\n $score = 0;\n $max_score = 0;\n $corrects = array_intersect_key($component['extra']['items'][\"labels\"], array_filter($component['extra']['items'][\"choices\"]));\n if (is_array($data)) {\n foreach ($data as $key => $value) {\n if ($value != '') {\n if ($component['extra']['items'][\"choices\"][$key]) {\n $childs[] = t(\"Correct answer :\") . ' ' . $options[$key];\n $score = $score + $component['extra']['items'][\"notes\"][$key];\n }\n else {\n $childs[] = t(\"Wrong answer :\") . ' ' . $options[$key];\n $wrong = TRUE;\n }\n $data[$key] = $options[$key];\n $max_score = +array_sum(array_values($component['extra']['items'][\"notes\"]));\n }\n else {\n unset($data[$key]);\n }\n }\n }\n else {\n if (!empty($data) && isset($component['extra']['items'][\"choices\"][$data]) && $component['extra']['items'][\"choices\"][$data]) {\n $childs[] = t(\"Correct answer :\") . ' ' . $options[$data];\n $score = $score + $component['extra']['items'][\"notes\"][$data];\n }\n else {\n $text = (!empty($data)) ? $options[$data] : \"You have not select any option\";\n $childs[] = t(\"Wrong answer :\") . ' ' . $text;\n $wrong = TRUE;\n }\n $max_score = +array_sum(array_values($component['extra']['items'][\"notes\"]));\n $data = array($data => $options[$data]);\n }\n if ($wrong) {\n if (count($corrects)) {\n $childs[] = array(\"data\" => t(\"Correct answers are :\"), \"children\" => $corrects);\n }\n else {\n $childs[] = array(\"data\" => t(\"The Correct answer is :\"), \"children\" => $corrects);\n }\n }\n if (!empty($component['extra']['justificatif'])) {\n $childs[] = $component['extra']['justificatif'];\n }\n $return[] = array(\"data\" => $component['name'], \"children\" => $childs);\n\n return array(\n \"message\" => $return,\n \"note\" => $score,\n \"max_score\" => $max_score,\n );\n}", "public function getCheckedAnswers()\n {\n return $this->checkedAnswers;\n }", "public function getAllAnswers()\n {\n return $this->answers;\n }", "public function get_correct_answer() {\n if (!isset($this->answer)) {\n return null;\n } else {\n $answer = array('answer' => $this->answer);\n // For multilanguage questions we also need to specify the language.\n // Use the answer_language template parameter value if given, otherwise\n // run with the default.\n $params = json_decode($this->templateparams);\n if (!empty($params->answer_language)) {\n $answer['language'] = $params->answer_language;\n } else if (!empty($this->acelang) && strpos($this->acelang, ',') !== false) {\n list($langs, $defaultlang) = qtype_coderunner_util::extract_languages($this->acelang);\n $default = empty($defaultlang) ? $langs[0] : $defaultlang;\n $answer['language'] = $default;\n }\n return $answer;\n }\n }", "public function test_answer_create_numeric_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '2';\n\n $data = [[\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => '1,3',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question_id => [\n 'The response must be one of the following types: 1, 2, 3, 4'\n ]\n ]\n ]);\n }", "public function addIncorrectAnswer(SingleChoiceAnswerInterface $answer);", "public function choice($question, array $choices, $default = null, $attempts = null, $multiple = null)\n {\n $question = new ChoiceQuestion($question, $choices, $default);\n $question->setMaxAttempts($attempts)->setMultiselect($multiple);\n return $this->output->askQuestion($question);\n }", "public function get_answers(){\n return $this->answers;\n }", "protected function define_answer_options_properties_section()\n {\n global $PAGE, $OUTPUT;\n $mform = $this->_form;\n\n // header\n $mform->addElement('header', 'answeroptionspropertiesheader',\n get_string(\"answer_options_properties\", 'qtype_omerocommon'));\n\n // selector to allow single or multi answers\n $menu = array(\n get_string('answersingleno', 'qtype_omerocommon'),\n get_string('answersingleyes', 'qtype_omerocommon'),\n );\n $mform->addElement('select', 'single',\n get_string('answerhowmany', 'qtype_omerocommon'), $menu);\n $mform->setDefault('single', 1);\n\n // how to number answer options\n $mform->addElement('select', 'answernumbering',\n get_string('answernumbering', 'qtype_multichoice'),\n qtype_multichoice::get_numbering_styles());\n $mform->setDefault('answernumbering', 'abc');\n\n // default mark\n $mform->addElement('text', 'defaultmark', get_string('defaultmark', 'question'),\n array('size' => 7));\n $mform->setType('defaultmark', PARAM_FLOAT);\n $mform->setDefault('defaultmark', 1);\n $mform->addRule('defaultmark', null, 'required', null, 'client');\n\n // flag to set the shuffling of answer options\n $mform->addElement('advcheckbox', 'shuffleanswers',\n get_string('shuffleanswers', 'qtype_multichoice'), null, null, array(0, 1));\n $mform->addHelpButton('shuffleanswers', 'shuffleanswers', 'qtype_multichoice');\n $mform->setDefault('shuffleanswers', 1);\n\n // set as expanded by default\n $mform->setExpanded('answeroptionspropertiesheader');\n }", "function _dquarks_submission_display_multichoice($data, $component, $enabled = FALSE) {\n $form_item = _dquarks_render_multichoice($component);\n $options = $form_item['#options'];\n foreach ($options as $key => $value) {\n $options2[$value] = trim($value);\n }\n $form_item['#options'] = $options2;\n if ($component['extra']['multiple'] === 'Y') {\n // Set the value as an array.\n $form_item['#default_value'] = array();\n foreach ((array) $data['value'] as $key => $value) {\n $form_item['#default_value'][] = $value;\n }\n }\n else {\n // Set the value as a single string.\n $form_item['#default_value'] = '';\n foreach ((array) $data['value'] as $key => $value) {\n $form_item['#default_value'] = $value;\n }\n }\n $form_item['#disabled'] = !$enabled;\n return $form_item;\n}", "public function getDefaultansweroption()\n {\n return $this->defaultansweroption;\n }", "private function validateChecklist($aAnswers)\r\n {\r\n $bGood = TRUE;\r\n $aBad = array();\r\n if(is_array($aAnswers))\r\n {\r\n foreach($aAnswers as $aQuestion)\r\n {\r\n $shortname = $aQuestion['shortname'];\r\n $response = $aQuestion['response'];\r\n if(trim($response) == '')\r\n {\r\n $aBad[] = $shortname;\r\n $bGood = FALSE;\r\n }\r\n }\r\n }\r\n if(!$bGood)\r\n {\r\n if(count($aBad) > 1)\r\n {\r\n form_set_error('page_checklist_area1','Must complete all Safety Checklist questions ('.count($aBad).' are blank)');\r\n } else {\r\n form_set_error('page_checklist_area1','Must complete all Safety Checklist questions (1 is blank)');\r\n }\r\n }\r\n return $bGood;\r\n }", "protected function get_per_answer_fields($mform, $label, $gradeoptions,\n &$repeatedoptions, &$answersoption) {\n $config = get_config('qtype_formulas');\n $repeated = array();\n $repeated[] = $mform->createElement('header', 'answerhdr', $label);\n // Part's mark.\n $repeated[] = $mform->createElement('text', 'answermark', get_string('answermark', 'qtype_formulas'),\n array('size' => 3));\n $repeatedoptions['answermark']['helpbutton'] = array('answermark', 'qtype_formulas');\n $repeatedoptions['answermark']['default'] = $config->defaultanswermark;\n $repeatedoptions['answermark']['type'] = PARAM_FLOAT;\n // Part's number of coordinates.\n $repeated[] = $mform->createElement('hidden', 'numbox', '', ''); // Exact value will be computed during validation.\n $repeatedoptions['numbox']['type'] = PARAM_INT;\n // Part's local variables.\n $repeated[] = $mform->createElement('textarea', 'vars1', get_string('vars1', 'qtype_formulas'),\n array('cols' => 80, 'rows' => 1));\n $repeatedoptions['vars1']['helpbutton'] = array('vars1', 'qtype_formulas');\n $repeatedoptions['vars1']['advanced'] = true;\n // Part's answer type (0, 10, 100, 1000).\n $repeated[] = $mform->createElement('select', 'answertype', get_string('answertype', 'qtype_formulas'),\n array(0 => get_string('number', 'qtype_formulas'), 10 => get_string('numeric', 'qtype_formulas'),\n 100 => get_string('numerical_formula', 'qtype_formulas'),\n 1000 => get_string('algebraic_formula', 'qtype_formulas')));;\n $repeatedoptions['answertype']['default'] = $config->defaultanswertype;\n $repeatedoptions['answertype']['type'] = PARAM_INT;\n $repeatedoptions['answertype']['helpbutton'] = array('answertype', 'qtype_formulas');\n // Part's answer.\n $repeated[] = $mform->createElement('text', 'answer', get_string('answer', 'qtype_formulas'),\n array('size' => 80));\n $repeatedoptions['answer']['helpbutton'] = array('answer', 'qtype_formulas');\n $repeatedoptions['answer']['type'] = PARAM_RAW;\n // Part's grading variables.\n $repeated[] = $mform->createElement('textarea', 'vars2', get_string('vars2', 'qtype_formulas'),\n array('cols' => 80, 'rows' => 1));\n $repeatedoptions['vars2']['helpbutton'] = array('vars2', 'qtype_formulas');\n $repeatedoptions['vars2']['advanced'] = true;\n // Part's grading criteria.\n $repeated[] = $mform->createElement('text', 'correctness', get_string('correctness', 'qtype_formulas'),\n array('size' => 60));\n $repeatedoptions['correctness']['default'] = $config->defaultcorrectness;\n $repeatedoptions['correctness']['helpbutton'] = array('correctness', 'qtype_formulas');\n $repeatedoptions['correctness']['type'] = PARAM_RAW;\n // Part's unit penalty.\n $repeated[] = $mform->createElement('text', 'unitpenalty', get_string('unitpenalty', 'qtype_formulas'),\n array('size' => 3));\n $repeatedoptions['unitpenalty']['default'] = $config->defaultunitpenalty;\n $repeatedoptions['unitpenalty']['helpbutton'] = array('unitpenalty', 'qtype_formulas');\n $repeatedoptions['unitpenalty']['type'] = PARAM_FLOAT;\n // Part's unit.\n $repeated[] = $mform->createElement('text', 'postunit', get_string('postunit', 'qtype_formulas'),\n array('size' => 60, 'class' => 'formulas_editing_unit'));\n $repeatedoptions['postunit']['helpbutton'] = array('postunit', 'qtype_formulas');\n $repeatedoptions['postunit']['type'] = PARAM_RAW;\n // Part's basic conversion rules.\n $conversionrules = new unit_conversion_rules;\n $allrules = $conversionrules->allrules();\n foreach ($allrules as $id => $entry) {\n $defaultrulechoice[$id] = $entry[0];\n }\n $repeated[] = $mform->createElement('select', 'ruleid', get_string('ruleid', 'qtype_formulas'),\n $defaultrulechoice);\n $repeatedoptions['ruleid']['default'] = 1;\n // Part's other rules.\n $repeated[] = $mform->createElement('textarea', 'otherrule', get_string('otherrule', 'qtype_formulas'),\n array('cols' => 80, 'rows' => 1));\n $repeatedoptions['otherrule']['helpbutton'] = array('otherrule', 'qtype_formulas');\n $repeatedoptions['otherrule']['advanced'] = true;\n // Part's placeholder.\n $repeated[] = $mform->createElement('text', 'placeholder', get_string('placeholder', 'qtype_formulas'),\n array('size' => 20));\n $repeatedoptions['placeholder']['helpbutton'] = array('placeholder', 'qtype_formulas');\n $repeatedoptions['placeholder']['type'] = PARAM_RAW;\n // Part's text.\n $repeated[] = $mform->createElement('editor', 'subqtext', get_string('subqtext', 'qtype_formulas'),\n array('rows' => 3), $this->editoroptions);\n $repeatedoptions['subqtext']['helpbutton'] = array('subqtext', 'qtype_formulas');\n // Part's feedback.\n $repeated[] = $mform->createElement('editor', 'feedback', get_string('feedback', 'qtype_formulas'),\n array('rows' => 3), $this->editoroptions);\n $repeatedoptions['feedback']['helpbutton'] = array('feedback', 'qtype_formulas');\n $repeatedoptions['feedback']['advanced'] = true;\n // Part's combined feedback.\n $repeated[] = $mform->createElement('editor', 'partcorrectfb', get_string('correctfeedback', 'qtype_formulas'),\n array('rows' => 3), $this->editoroptions);\n $repeatedoptions['partcorrectfb']['helpbutton'] = array('correctfeedback', 'qtype_formulas');\n $repeatedoptions['partcorrectfb']['advanced'] = true;\n $repeated[] = $mform->createElement(\n 'editor',\n 'partpartiallycorrectfb',\n get_string('partiallycorrectfeedback', 'qtype_formulas'),\n array('rows' => 3),\n $this->editoroptions\n );\n $repeatedoptions['partpartiallycorrectfb']['helpbutton'] = array('partiallycorrectfeedback', 'qtype_formulas');\n $repeatedoptions['partpartiallycorrectfb']['advanced'] = true;\n $repeated[] = $mform->createElement('editor', 'partincorrectfb', get_string('incorrectfeedback', 'qtype_formulas'),\n array('rows' => 3), $this->editoroptions);\n $repeatedoptions['partincorrectfb']['helpbutton'] = array('incorrectfeedback', 'qtype_formulas');\n $repeatedoptions['partincorrectfb']['advanced'] = true;\n $answersoption = 'answers';\n return $repeated;\n }", "public function addAnswer(ChoiceAnswer $answer);", "public function showSingle()\n {\n if ($this->_showSingle === null) {\n $option = $this->getOption();\n $selections = $option->getSelections();\n\n $this->_showSingle = count($selections) == 1 && $option->getRequired();\n }\n\n return $this->_showSingle;\n }", "private function addMultChoiceCorrectness($doc, $item, $mcAnswers)\n {\n $resprocessing = $item->getElementsByTagName('resprocessing')->item(0);\n $correctAnswer = null;\n foreach ($mcAnswers as $mcAnswer) {\n if ($mcAnswer->correct == 'true') {\n $correctAnswer = $mcAnswer;\n }\n }\n $respcondition = $resprocessing->appendChild($doc->createElement('respcondition'));\n $this->addAttribute($doc, 'continue', 'No', $respcondition);\n $conditionvar = $respcondition->appendChild($doc->createElement('conditionvar'));\n $varequal = $conditionvar->appendChild($doc->createElement('varequal', $correctAnswer->id));\n $this->addAttribute($doc, 'respident', 'response1', $varequal);\n $setvar = $respcondition->appendChild($doc->createElement('setvar', '100'));\n $this->addAttribute($doc, 'action', 'Set', $setvar);\n $this->addAttribute($doc, 'varname', 'SCORE', $setvar);\n }", "public function isAnswered()\n {\n return $this->answered;\n }", "public static function ExtractForm(\n $data,\n $singleResult = false,\n $FormsExtension = '',\n $ChoiceExtension = '',\n $isResult = true\n )\n {\n // list of its attributes\n $forms = DBJson::getObjectsByAttributes(\n $data,\n Form::getDBPrimaryKey( ),\n Form::getDBConvert( ),\n $FormsExtension\n );\n\n\n // generates an assoc array of choices by using a defined\n // list of its attributes\n $choices = DBJson::getObjectsByAttributes(\n $data,\n Choice::getDBPrimaryKey( ),\n Choice::getDBConvert( ),\n $ChoiceExtension\n );\n\n // concatenates the forms and the associated choices\n $res = DBJson::concatObjectListResult(\n $data,\n $forms,\n Form::getDBPrimaryKey( ),\n Form::getDBConvert( )['FO_choices'],\n $choices,\n Choice::getDBPrimaryKey( ),\n $ChoiceExtension,\n $FormsExtension\n );\n if ($isResult){\n // to reindex\n $res = array_values( $res );\n $res = Form::decodeForm($res,false);\n\n if ( $singleResult ){\n\n // only one object as result\n if ( count( $res ) > 0 )\n $res = $res[0];\n }\n }\n\n return $res;\n }", "private function changeAnswersMultipleChoice($model) {\n\t\t$i = 1;\n\t\twhile(isset($_POST['choice_multiple_text'][$i])) {\n\t\t\t// add choice\n\t\t\tif($_POST['choice_multiple_id'][$i] == \"\") {\n\t\t\t\t// now check whether the answer was deleted\n\t\t\t\tif($_POST['choice_multiple_deleted'][$i] != true \n\t\t\t\t\t\t&& !empty($_POST['choice_multiple_text'][$i])) {\n\t\t\t\t\t// create choice\n\t\t\t\t\t$model->createChoice($_POST['question_id'],$_POST['choice_multiple_type'][$i],\n\t\t\t\t\t\t\t\t\t\t\t$_POST['choice_multiple_text'][$i]);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t// delete choice\n\t\t\telse if($_POST['choice_multiple_deleted'][$i] == true) {\n\t\t\t\t$model->deleteChoice($_POST['choice_multiple_id'][$i]);\n\t\t\t}\n\t\t\t// change choice\n\t\t\telse {\n\t\t\t\t$model->updateChoice($_POST['choice_multiple_id'][$i], \n\t\t\t\t\t\t\t\t\t\t$_POST['choice_multiple_type'][$i],\n\t\t\t\t\t\t\t\t\t\t$_POST['choice_multiple_text'][$i],\n\t\t\t\t\t\t\t\t\t\t$_POST['rowID'][$i]);\n\t\t\t}\n\t\t\t// increment counter\n\t\t\t$i++;\n\t\t}\n\t}", "public function getAnswer() {\n return $this->getAnswerAt(0);\n }", "function ASS_AnswerMultipleResponse (\n $answertext = \"\",\n $points_checked = 0.0,\n $order = 0,\n $points_unchecked = 0,\n\t\t$id = -1\n )\n {\n\tparent::__construct($answertext, $points_checked, $order, $id);\n $this->setPointsUnchecked($points_unchecked);\n }", "public function setAnswer($answer)\n\t\t{\n\t\t\treturn $this->answer = (strlen($answer) > 0) ? $answer : $this->getDefault();\n\t\t}", "public function isSingle()\n {\n $confRule = Mage::getStoreConfig('sms/main_conf/allow_long_sms');\n\n return ($confRule == 1) ? 'single' : 1;\n\n }", "public function testJsonMixedAnswers()\n {\n $data = $this->generateInterviewSessionData();\n\n $jsonAnswers = [];\n\n $normalAnswers = $this->generateAnswers('normal', mt_rand(3,5));\n\n $this->assertTrue(count($normalAnswers) > 1);\n\n foreach ($normalAnswers as $answer) {\n $data->addAnswer($answer);\n $jsonAnswers[] = json_decode($this->convertMockAnswerToJsonAnswer($answer));\n }\n\n $repeatableAnswers = $this->generateAnswers('repeatable', mt_rand(3,5));\n\n $this->assertTrue(count($repeatableAnswers) > 1);\n\n foreach ($repeatableAnswers as $answer) {\n $data->addAnswer($answer);\n $jsonAnswers[] = json_decode($this->convertMockAnswerToJsonAnswer($answer));\n }\n\n $jsonObj = $this->generateJsonObjInterviewSessionData($data->getInterview(), $data->getNote(), $data->getInterviewSession());\n\n $jsonObj->Answers = $jsonAnswers;\n\n $this->assertEquals(json_encode($jsonObj), $data->json());\n }", "function answerOnNextPrompt($answer) {\r\n\t\t\techo $this->__getRow('answerOnNextPrompt', $answer);\r\n\t\t}", "private function createFormRadio ($answer)\n {\n \t$form_string = \"<input type=\\\"hidden\\\" name=\\\"type\\\" value=\\\"radio\\\">\\n\";\n \t// if we have , followed by a new line / space etc. remove the space character\n \t$options = preg_replace ('/,\\s/', ',', $this->input);\n \t$options = explode (\",\", $options);\n \tfor ($i=0; $i<count($options); $i++)\n \t{\n \t\t$form_string .= \"<label><input type=\\\"radio\\\" name=\\\"answer\\\" value=\\\"$i\\\" \";\n \t\tif ($i == $answer) {$form_string.= \"checked=\\\"checked\\\" \";}\n \t\t$form_string .= \"/> \".$options[$i].\"</label><br />\\n\";\n \t}\n \treturn $form_string;\n }", "public function getAnswerAt($index) {\n return $this->_answers->offsetGet((int)$index);\n }", "public function testBuildingCommandWithMultiplePromptAnswers()\n {\n $this->integrationTest->expects($this->once())\n ->method('execute')\n ->with('foo', [], [], ['bar'], true);\n $this->assertSame(\n $this->integrationTest,\n $this->commandBuilder->withAnswers(['bar'])\n ->execute()\n );\n }", "public function testBuildingCommandWithSinglePromptAnswer()\n {\n $this->integrationTest->expects($this->once())\n ->method('execute')\n ->with('foo', [], [], ['bar'], true);\n $this->assertSame(\n $this->integrationTest,\n $this->commandBuilder->withAnswers('bar')\n ->execute()\n );\n }", "public function testRadioQuestion()\n {\n $options = $this->faker->words(3);\n\n $this->loadFixtures([], [\n 'type' => 'radio',\n 'options' => $options,\n ]);\n\n $this\n ->visit(action('SurveyController@getSurvey', ['id' => $this->survey->id]))\n ->see('radio')\n ->see($options[0])\n ->see($options[1])\n ->see($options[2])\n ->select(\"\", $this->question->field)\n ;\n }", "function getQuestionType() {\n\t\treturn 'choice';\n\t}", "public function createMultiple($attemptId, array $answers)\n {\n $final = [];\n\n foreach ($answers as $choice) {\n array_push($final, $this->create($attemptId, $choice));\n }\n\n return $final;\n }", "function theme_dquarks_edit_multichoice_items($variables) {\n\n $items = $variables['form'];\n $header = array(t(\"Correct\"), t(\"Answer\"), t(\"Note\"), t(\"Operations\"));\n foreach (element_children($items[\"choices\"]) as $name) {\n $rows[] = array(\n drupal_render($items[\"choices\"][$name]),\n drupal_render($items[\"labels\"][$name]),\n drupal_render($items[\"notes\"][$name]),\n drupal_render($items[\"operations\"][$name]),\n );\n }\n return theme('table', array('header' => $header, 'rows' => $rows));\n}", "public function validateAnswer ($answer)\n {\n \t//print (\"Answer is $answer \\nType is \".$this->type.\" \\n\");\n \tif ($this->type == 'number' && is_numeric($answer))\n \t{\n \t\treturn true;\n \t}\n \telse if ($this->type == 'radio' && is_numeric($answer)) \n \t{\n \t\t$options = explode (\",\", $this->input);\n \t\tif ($answer >=0 && $answer < count($options)) {return true;}\n \t\telse {return false;}\n \t}\n \telse if ($this->type == 'text' || $this->type == 'TEXT')\n \t{\n \t\t// we don't do any further checking - we use mysql escape to save and use regexp to check valid answer\n \t\treturn true;\n \t}\n \telse\n \t{\n \t\treturn false;\n \t}\n \t\n }", "public function setSimpleResponses($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dialogflow\\V2\\Intent\\Message\\SimpleResponses::class);\n $this->writeOneof(7, $var);\n\n return $this;\n }", "function _dquarks_render_multichoice($component) {\n $form_item = array(\n '#title' => $component['name'],\n '#required' => $component['mandatory'],\n '#weight' => $component['weight'],\n '#description' => _dquarks_filter_descriptions($component['extra']['description']),\n '#prefix' => '<div class=\"dquarks-component-' . $component['type'] . '\" id=\"dquarks-component-' . $component['form_key'] . '\">',\n '#suffix' => '</div>',\n );\n\n // Convert the user-entered options list into an array.\n $default_value = _dquarks_filter_values($component['value'], NULL, NULL, FALSE);\n $options = _dquarks_multichoice_options($component['extra']['items']);\n\n // Set the component options.\n $form_item['#options'] = $options;\n\n if ($component['extra']['multiple'] === 'Y') {\n // Set display as a checkbox set.\n $form_item['#type'] = 'checkboxes';\n // Drupal 7 hack to properly render on multipage forms.\n $form_item['#process'] = array('dquarks_expand_multichoice_checkboxes');\n }\n else {\n // Set display as a radio set.\n $form_item['#type'] = 'radios';\n }\n return $form_item;\n}", "public function getQuestionWithAnswers()\n {\n $question = Question::whereUserId(auth()->id())->randomUnasked()->first();\n $answers = $this->getAnswers($question->answer);\n \n $question->markAsked();\n\n return [\n 'id' => $question->id,\n 'question' => $question->question,\n 'answers' => $answers,\n ];\n }", "function getNbAnswers() {\n return $this->nbAnswers;\n }", "public function setAnswered($boolean)\n {\n $this->answered = (bool) $boolean;\n\n return $this;\n }", "public function test_answer_create_yn_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '1';\n\n $data = [[\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => 'other',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question_id => [\n 'The response must be one of the following types: yes, no'\n ]\n ]\n ]);\n }", "public function isUserAnswerIsCorrect();", "public function choiceMultiple(\n string $question,\n array $choices,\n $default = null,\n ?int $attempts = null\n ): array {\n $question = new ChoiceQuestion($question, $choices, $default);\n\n $question->setMaxAttempts($attempts)->setMultiselect(true);\n\n return $this->output->askQuestion($question);\n }", "public function setFieldTypeChoiceType($multiple)\n {\n if ($this->getFieldType() == FormChoiceType::class) {\n $options = $this->getFieldOptions();\n $options['multiple'] = (bool)$multiple;\n $this->setFieldOptions($options);\n }\n\n return $this;\n }", "function poll_answer_option($answer)\n{\n return form_radio('answer',$answer['id'],FALSE,\"id='answer_{$answer['id']}'\").' <label for=\"answer_'.$answer['id'].'\">'.htmlspecialchars($answer['answer']).'</label>';\n}", "public function isAnswered() {\n return (bool)$this->_answers->count();\n }", "public function formulation_and_controls(question_attempt $qa, question_display_options $options) {\n $question = $qa->get_question();\n $response = $question->get_response($qa);\n\n $inputname = $qa->get_qt_field_name('answer');\n $inputattributes = array(\n 'type' => $this->get_input_type(),\n 'name' => $inputname,\n );\n\n if ($options->readonly) {\n $inputattributes['disabled'] = 'disabled';\n }\n\n $radiobuttons = array();\n $feedbackimg = array();\n $feedback = array();\n $classes = array();\n foreach ($question->get_order($qa) as $value => $ansid) {\n $ans = $question->answers[$ansid];\n $inputattributes['name'] = $this->get_input_name($qa, $value);\n $inputattributes['value'] = $this->get_input_value($value);\n $inputattributes['id'] = $this->get_input_id($qa, $value);\n // Modification starts.\n /* Comment out core code.\n $isselected = $question->is_choice_selected($response, $value);\n if ($isselected) {\n $inputattributes['checked'] = 'checked';\n } else {\n unset($inputattributes['checked']);\n }\n */\n $inputattributes['checked'] = 'checked';\n // Modification ends.\n $hidden = '';\n if (!$options->readonly && $this->get_input_type() == 'checkbox') {\n $hidden = html_writer::empty_tag('input', array(\n 'type' => 'hidden',\n 'name' => $inputattributes['name'],\n 'value' => 0,\n ));\n }\n $radiobuttons[] = $hidden . html_writer::empty_tag('input', $inputattributes) .\n html_writer::tag('label',\n html_writer::span($this->number_in_style($value, $question->answernumbering), 'answernumber') .\n $question->make_html_inline($question->format_text(\n $ans->answer, $ans->answerformat,\n $qa, 'question', 'answer', $ansid)),\n array('for' => $inputattributes['id'], 'class' => 'ml-1'));\n\n // Param $options->suppresschoicefeedback is a hack specific to the\n // oumultiresponse question type. It would be good to refactor to\n // avoid refering to it here.\n // Modification starts.\n /* Comment out core code.\n if ($options->feedback && empty($options->suppresschoicefeedback) &&\n $isselected && trim($ans->feedback)) {\n */\n if ($options->feedback && empty($options->suppresschoicefeedback) &&\n trim($ans->feedback)) {\n // Modification ends.\n $feedback[] = html_writer::tag('div',\n $question->make_html_inline($question->format_text(\n $ans->feedback, $ans->feedbackformat,\n $qa, 'question', 'answerfeedback', $ansid)),\n array('class' => 'specificfeedback'));\n } else {\n $feedback[] = '';\n }\n $class = 'r' . ($value % 2);\n // Modification starts.\n /* Comment out core code.\n if ($options->correctness && $isselected) {\n */\n if ($options->correctness) {\n // Modification ends.\n $feedbackimg[] = $this->feedback_image($this->is_right($ans));\n $class .= ' ' . $this->feedback_class($this->is_right($ans));\n } else {\n $feedbackimg[] = '';\n }\n $classes[] = $class;\n }\n\n $result = '';\n $result .= html_writer::tag('div', $question->format_questiontext($qa),\n array('class' => 'qtext'));\n\n $result .= html_writer::start_tag('div', array('class' => 'ablock'));\n $result .= html_writer::tag('div', $this->prompt(), array('class' => 'prompt'));\n\n $result .= html_writer::start_tag('div', array('class' => 'answer'));\n foreach ($radiobuttons as $key => $radio) {\n $result .= html_writer::tag('div', $radio . ' ' . $feedbackimg[$key] . $feedback[$key],\n array('class' => $classes[$key])) . \"\\n\";\n }\n $result .= html_writer::end_tag('div'); // Answer.\n\n $result .= $this->after_choices($qa, $options);\n\n $result .= html_writer::end_tag('div'); // Ablock.\n\n if ($qa->get_state() == question_state::$invalid) {\n $result .= html_writer::nonempty_tag('div',\n $question->get_validation_error($qa->get_last_qt_data()),\n array('class' => 'validationerror'));\n }\n\n return $result;\n }", "function process_ma($xml, &$questions) {\n\n if (isset($xml[\"POOL\"][\"#\"][\"QUESTION_MULTIPLEANSWER\"])) {\n $maquestions = $xml[\"POOL\"][\"#\"][\"QUESTION_MULTIPLEANSWER\"];\n }\n else {\n return;\n }\n\n for ($i = 0; $i < sizeof ($maquestions); $i++) {\n\n $question = $this->defaultquestion();\n\n $question->qtype = MULTICHOICE;\n $question->defaultgrade = 1;\n $question->single = 0; // More than one answers allowed\n $question->image = \"\"; // No images with this format\n\n $thisquestion = $maquestions[$i];\n\n // determine if the question is already escaped html\n $ishtml = $thisquestion[\"#\"][\"BODY\"][0][\"#\"][\"FLAGS\"][0][\"#\"][\"ISHTML\"][0][\"@\"][\"value\"];\n\n // put questiontext in question object\n if ($ishtml) {\n $question->questiontext = html_entity_decode_php4(trim($thisquestion[\"#\"][\"BODY\"][0][\"#\"][\"TEXT\"][0][\"#\"]));\n }\n $question->questiontext = addslashes($question->questiontext);\n // put name of question in question object\n $question->name = substr($question->questiontext, 0, 254);\n\n $choices = $thisquestion[\"#\"][\"ANSWER\"];\n $correctanswers = $thisquestion[\"#\"][\"GRADABLE\"][0][\"#\"][\"CORRECTANSWER\"];\n\n for ($j = 0; $j < sizeof ($choices); $j++) {\n\n $choice = trim($choices[$j][\"#\"][\"TEXT\"][0][\"#\"]);\n // put this choice in the question object.\n $question->answer[$j] = addslashes($choice);\n\n $correctanswercount = sizeof($correctanswers);\n $id = $choices[$j][\"@\"][\"id\"];\n $iscorrect = 0;\n for ($k = 0; $k < $correctanswercount; $k++) {\n\n $correct_answer_id = trim($correctanswers[$k][\"@\"][\"answer_id\"]);\n if (strcmp ($id, $correct_answer_id) == 0) {\n $iscorrect = 1;\n }\n\n }\n if ($iscorrect) { \n $question->fraction[$j] = floor(100000/$correctanswercount)/100000; // strange behavior if we have more than 5 decimal places\n $question->feedback[$j] = addslashes(trim($thisquestion[\"#\"][\"GRADABLE\"][$j][\"#\"][\"FEEDBACK_WHEN_CORRECT\"][0][\"#\"]));\n } else {\n $question->fraction[$j] = 0;\n $question->feedback[$j] = addslashes(trim($thisquestion[\"#\"][\"GRADABLE\"][$j][\"#\"][\"FEEDBACK_WHEN_INCORRECT\"][0][\"#\"]));\n }\n }\n\n $questions[] = $question;\n }\n}", "public function setCorrectAnswer(AnswerInterface $answer);", "static function validateYesNo($answer) \n\t\t{\n\t\t\t$result = (bool)($answer == \"yes\" || $answer == \"no\");\n\t\t\treturn $result;\n\t\t}", "public function getAnswer()\n {\n return $this->answer;\n }", "public function setCheckedAnswers($checkedAnswers)\n {\n $this->checkedAnswers = $checkedAnswers;\n\n return $this;\n }", "public function rules()\n {\n return [\n 'answers' => 'required|array',\n 'answers.*' => 'int|exists:choices,id',\n ];\n }", "public function is_allow_multi_on_form() {\n\t\treturn true;\n\t}", "public function getAnswer()\n\t\t{\n\t\t\treturn $this->answer;\n\t\t}", "public function getAnswers();", "public function getAnswer()\n {\n return $this->answer;\n }", "function getNextQuestion()\n{\n global $questions;\n\n // get a random question index\n $randomIndex = rand(0, sizeof($questions) - 1);\n\n // get the question specified by the index\n $question = $questions[$randomIndex];\n\n // get all possible answers as an array\n $answers = explode(\"@\", $question[\"Answers\"]);\n\n // create an HTML submission form\n $form = \"<span style=\\\"color:blue\\\">\" . $question[\"Question\"] . \"</span><br /><br />\";\n $form .= \"<form>\";\n $form .= \"<div style=\\\"text-align:left\\\">\";\n \n // shuffle the array to make sure the answers appear in a random order\n shuffle($answers);\n\n // iterate through the question and get all possible answers\n for($i = 0; $i < sizeof($answers); $i++)\n {\n $form .= \"<input type=\\\"radio\\\" name=\\\"answer\\\" id=\\\"answer\" . $i . \"\\\" value=\\\"\" . $answers[$i] . \"\\\" />\" . $answers[$i] . \"<br />\";\n }\n\n $form .= \"</div>\";\n\n // add the question number\n $form .= \"<input type=\\\"hidden\\\" id=\\\"questionNum\\\" value=\\\"\" . $randomIndex . \"\\\" />\";\n\n // add the submission button\n $form .= \"<br /><input type=\\\"button\\\" id=\\\"submitAnswer\\\" value=\\\"Submit\\\" onClick=\\\"checkAnswer($('#questionNum').attr('value'), $('input:checked').attr('value'));\\\" />\";\n\n $form .= \"</form>\";\n\n // spit out the generated form\n echo $form;\n}", "public static function optionsAddAnswers(\\Elgg\\Event $event) {\n\t\t$search_params = $event->getValue();\n\t\t\n\t\t$type_subtype_pairs = false;\n\t\t$subtypes = (array) elgg_extract('subtypes', $search_params, elgg_extract('subtype', $search_params));\n\t\tif (empty($subtypes)) {\n\t\t\t$type_subtype_pairs = (array) elgg_extract('type_subtype_pairs', $search_params);\n\t\t\t$subtypes = (array) elgg_extract('object', $type_subtype_pairs);\n\t\t}\n\t\t\n\t\tif (empty($subtypes) || !in_array(\\ElggQuestion::SUBTYPE, $subtypes) || in_array(\\ElggAnswer::SUBTYPE, $subtypes)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$subtypes[] = \\ElggAnswer::SUBTYPE;\n\t\t\n\t\tif ($type_subtype_pairs !== false) {\n\t\t\t$type_subtype_pairs['object'] = $subtypes;\n\t\t\t\n\t\t\t$search_params['type_subtype_pairs'] = $type_subtype_pairs;\n\t\t} else {\n\t\t\t$search_params['subtypes'] = $subtypes;\n\t\t\tunset($search_params['subtype']);\n\t\t}\n\t\t\n\t\treturn $search_params;\n\t}", "public static function grade_question_auto( $question_id = 0, $question_type = '', $answer = '', $user_id = 0 ) {\n\n if( intval( $user_id ) == 0 ) {\n\n $user_id = get_current_user_id();\n\n }\n\n if( ! ( intval( $question_id ) > 0 ) ) {\n\n return false;\n\n }\n\n\n Sensei()->question->get_question_type( $question_id );\n\n /**\n * Applying a grade before the auto grading takes place.\n *\n * This filter is applied just before the question is auto graded. It fires in the context of a single question\n * in the sensei_grade_question_auto function. It fires irrespective of the question type. If you return a value\n * other than false the auto grade functionality will be ignored and your supplied grade will be user for this question.\n *\n * @param int $question_grade default false\n * @param int $question_id\n * @param string $question_type one of the Sensei question type.\n * @param string $answer user supplied question answer\n */\n $question_grade = apply_filters( 'sensei_pre_grade_question_auto', false, $question_id, $question_type, $answer );\n\n if ( false !== $question_grade ) {\n\n return $question_grade;\n\n }\n\n // auto grading core\n if( in_array( $question_type , array( 'multiple-choice' , 'boolean' ) ) ){\n\n $right_answer = (array) get_post_meta( $question_id, '_question_right_answer', true );\n\n if( 0 == get_magic_quotes_gpc() ) {\n $answer = wp_unslash( $answer );\n }\n $answer = (array) $answer;\n if ( is_array( $right_answer ) && count( $right_answer ) == count( $answer ) ) {\n // Loop through all answers ensure none are 'missing'\n $all_correct = true;\n foreach ( $answer as $check_answer ) {\n if ( !in_array( $check_answer, $right_answer ) ) {\n $all_correct = false;\n }\n }\n // If all correct then grade\n if ( $all_correct ) {\n $question_grade = Sensei()->question->get_question_grade( $question_id );\n }\n }\n\n } elseif( 'gap-fill' == $question_type ){\n\n $question_grade = self::grade_gap_fill_question( $question_id ,$answer );\n\n } else{\n\n /**\n * Grading questions that are not auto gradable.\n *\n * This filter is applied the context of ta single question within the sensei_grade_question_auto function.\n * It fires for all other questions types. It does not apply to 'multiple-choice' , 'boolean' and gap-fill.\n *\n * @param int $question_grade default zero\n * @param int $question_id\n * @param string $question_type one of the Sensei question type.\n * @param string $answer user supplied question answer\n */\n $question_grade = ( int ) apply_filters( 'sensei_grade_question_auto', $question_grade, $question_id, $question_type, $answer );\n\n } // end if $question_type\n\n return $question_grade;\n }", "private function createAnswerChoices() {\n // -- Looping through quiz question set and adding in three incorrect answers\n // -- to be included in the quiz along with the right answer\n shuffle($this->wrongAnswers);\n $wrongAnswerChunks = array_chunk($this->wrongAnswers, 3);\n\n for ($i=0; $i < $this->length; $i++) {\n $oneChunk = array_shift($wrongAnswerChunks);\n array_push($oneChunk, $this->questionSetFull[$i]['capital']);\n shuffle($oneChunk);\n array_push($this->answerChoices, $oneChunk);\n }\n return $this->answerChoices;\n }", "public function setAnswer($answer) {\r\n\r\n\t\t$this->answer[] = !empty($answer) ? trim($answer) : NULL;\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function createAnswer($type = self::TEXT_ANSWER);", "function _dquarks_help_multichoice($section) {\n switch ($section) {\n case 'admin/settings/dquarks#multichoice_description':\n return t('Allows creation of checkboxes, radio buttons, or select menus.');\n }\n}", "protected function add_sample_answer_field($mform) {\n $mform->addElement('header', 'answerhdr',\n get_string('answer', 'qtype_coderunner'), '');\n $mform->setExpanded('answerhdr', 1);\n $mform->addElement('textarea', 'answer',\n get_string('answer', 'qtype_coderunner'),\n array('rows' => 9, 'class' => 'answer edit_code'));\n $mform->addElement('advcheckbox', 'validateonsave', null,\n get_string('validateonsave', 'qtype_coderunner'));\n $mform->setDefault('validateonsave', false);\n $mform->addHelpButton('answer', 'answer', 'qtype_coderunner');\n }", "function _dquarks_theme_multichoice() {\n return array(\n 'dquarks_edit_multichoice' => array(\n 'variables' => array('form' => NULL, 'component' => NULL),\n 'file' => 'components/multichoice.inc',\n ),\n 'dquarks_mail_multichoice' => array(\n 'variables' => array(\n 'data' => NULL,\n 'component' => NULL,\n ),\n 'file' => 'components/multichoice.inc',\n ),\n );\n}", "public function askChoices($question, array $choices)\n\t{\n\t\t$choiceNumbers = array();\n\n\t\t$this->sayNice($question);\n\n\n\t\t$num = 1;\n\t\t$answers = array();\n\n\t\tforeach($choices as $no => $choice)\n\t\t{\n\t\t\t$answers[$num] = $no;\n\t\t\t$choiceNumbers[] = $num;\n\t\t\t$choices[$no] = $num++.'. '.$choice;\n\t\t}\n\n\t\t$this->say();\n\n\t\treturn $answers[$this->ask(array_merge($choices, array('', 'Option : ')), $choiceNumbers)];\n\t}", "public static function UpdateSaveAnswers(){\n\n\t\t\tglobal $config;\n\t\t\t\n\t\t\t$dbconn = db::singleton();\n\t\t\t\textract($_REQUEST); \n\t\t//print_r($_REQUEST); die;\n\t\t\t$qids = explode(',',$hiddenqid);\n\t\t\t//print_r($qids); die;\n\t\t\t\n\n\t\t\t\n\t\t\tfor($i=0;$i<count($qids);$i++){\n\t\t\t\t$longarraykey = \"longanswer\".$qids[$i];\n\t\t\t\t//print_r($longarraykey); \n\t\t\t\t\n\t\t\t\t$answervallong = array_key_exists($longarraykey,$_REQUEST)?$_REQUEST[$longarraykey]:\"\";\n\t\t\t\n\t\t\t\t//print($answervallong); \n\t\t\t\t\n\t\t\t\tif($answervallong!=\"\"){\n\t\t\t\t\t//echo \"hello\". $answervallong[0]; die;\n\t\t\t\t\tif(isset($incorrect))\n\t\t\t\t\t{$correctans=0;}\n\t\t\t\t\telse if(isset($correct))\n\t\t\t\t\t{$correctans=1;}\n\t\t\t\t\t$sql = \" update answers set score_u=\".$correctans.\" \n\t\t\t\t\twhere quiz_session_id=\".$qsid.\" and qid=\".$qids[$i].\" and rid=\".$rid.\"\";\n\t\t\t\t\t$dbconn->SetQuery($sql);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\tQuiz::UpdateResult($qsid,$rid); \n\t}", "public function addshortanswerAction(){\r\n\t\t$this->view->action = \"editshortanswer\";\r\n $this->view->nameTypeQuestion = \"Câu hỏi trả lời ngắn\";\r\n\t\t$ObjQuestion = Array();\r\n\t\t$ObjQuestion['type'] = 6;\r\n\t\t$ObjQuestion['score'] = 1;\r\n\t\t$ObjQuestion['level'] = 0.5;\r\n\t\t$ObjQuestion['classification'] = 0.2;\r\n\t\t$ObjQuestion['isupdate'] = 0; // insert new question\r\n\t\t$ObjQuestion['subject_id'] = \"\";\r\n\t\t$ObjQuestion['chapter_id'] = \"\";\r\n\t\t$ObjQuestion['question_title'] = \"\";\r\n\t\t$ObjQuestion['id'] = '';\r\n\t\t$ObjQuestion['content'] = \"\";\r\n\t\t$ObjQuestion['generalfeedback'] = \"\";\r\n\t\t$ObjQuestion['hidden'] = '';\r\n\t\t$ObjQuestion['classification'] = '';\r\n $ObjQuestion['created_user'] = $this->getUserId();\r\n \r\n\t\t$this->view->ObjQuestion = $ObjQuestion;\r\n\t\t$this->renderquestion(6);\r\n\t}", "public function add_multiple_answer()\n\t{\n\t\tif (isset($_POST['save'])){\n\t\t\t$this->form_validation->set_rules('name', $this->lang->line('question_text'), 'required');\n\t\t\t$this->form_validation->set_rules('points', $this->lang->line('points'), 'required|numeric|is_natural');\n\t\t\t$this->form_validation->set_rules('nb_desired_answers', $this->lang->line('nb_desired_answers'), 'required|integer|is_natural_no_zero');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t\t'id', 'Id', 'callback_cb_question_exists',\n\t\t\t\t['callback_cb_question_exists' => 'lang:question_error_404_heading']\n\t\t\t);\n\t\t\tfor($i=0; $i < $_POST['nbAnswer']; $i++){\n\t\t\t\t$this->form_validation->set_rules('reponses['.$i.'][answer]', $this->lang->line('answers_list'), 'required');\n\t\t\t}\n\n\t\t\tif ($this->form_validation->run()){\n\t\t\t\tif(!isset($_POST['id'])){\n\t\t\t\t\t$inputQuestion = array(\n\t\t\t\t\t\t\"FK_Topic\" => $_POST['focus_topic'],\n\t\t\t\t\t\t\"FK_Question_Type\" => $_POST['question_type'],\n\t\t\t\t\t\t\"Question\" => $_POST['name'],\n\t\t\t\t\t\t\"nb_desired_answers\" => $_POST['nb_desired_answers'],\n\t\t\t\t\t\t\"Points\" => $_POST['points']\n\t\t\t\t\t);\n\t\t\t\t\t$idQuestion = $this->question_model->insert($inputQuestion);\n\n\t\t\t\t\tfor($i=0; $i < $_POST['nbAnswer']; $i++){\n\t\t\t\t\t\t$inputAnswer = array(\n\t\t\t\t\t\t\t\"FK_Question\" => $idQuestion,\n\t\t\t\t\t\t\t\"Answer\" => $_POST['reponses'][$i]['answer']\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->multiple_answer_model->insert($inputAnswer);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$inputQuestion = array(\n\t\t\t\t\t\t\"FK_Topic\" => $_POST['focus_topic'],\n\t\t\t\t\t\t\"FK_Question_Type\" => $_POST['question_type'],\n\t\t\t\t\t\t'Nb_Desired_Answers' => $_POST['nb_desired_answers'],\n\t\t\t\t\t\t\"Question\" => $_POST['name'],\n\t\t\t\t\t\t\"Points\" => $_POST['points']\n\t\t\t\t\t);\n\t\t\t\t\t$this->question_model->update($_POST['id'], $inputQuestion);\n\n\t\t\t\t\tfor($i=0; $i < $_POST['nbAnswer']; $i++){\n\t\t\t\t\t\t$answers[$i]['id'] = $_POST['reponses'][$i]['id'];\n\t\t\t\t\t\t$answers[$i]['answer'] = $_POST['reponses'][$i]['answer'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$reponses = $this->multiple_answer_model->get_many_by('FK_Question = ' . $_POST['id']);\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ($reponses as $reponse) {\n\t\t\t\t\t\t$answersDb[$i] = $reponse->ID;\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor($i=0; $i < $_POST['nbAnswer']; $i++){\n\t\t\t\t\t\tif($answers[$i]['id'] == 0){\n\t\t\t\t\t\t\t$inputQuestion = array(\n\t\t\t\t\t\t\t\t\"FK_Question\" => $_POST['id'],\n\t\t\t\t\t\t\t\t\"Answer\" => $answers[$i]['answer']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$idQuestion = $this->multiple_answer_model->insert($inputQuestion);\n\n\t\t\t\t\t\t\tunset($answersDb[array_search($idQuestion, $answersDb)]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$inputAnswer = array(\n\t\t\t\t\t\t\t\t\"FK_Question\" => $_POST['id'],\n\t\t\t\t\t\t\t\t\"Answer\" => $answers[$i]['answer']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->multiple_answer_model->update($answers[$i]['id'], $inputAnswer);\n\n\t\t\t\t\t\t\tunset($answersDb[array_search($answers[$i]['id'], $answersDb)]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($answersDb as $answerDb) {\n\t\t\t\t\t\t$this->multiple_answer_model->delete($answerDb);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tredirect('question');\n\t\t\t} else {\n\t\t\t\t$output['focus_topic'] = $this->topic_model->get($_POST['focus_topic']);\n\t\t\t\t$output['question_type'] = $this->question_type_model->get($_POST['question_type']);\n\n\t\t\t\tif(isset($_POST['id'])){\n\t\t\t\t\t$output['id'] = $_POST['id'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['name'])){\n\t\t\t\t\t$output['name'] = $_POST['name'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['points'])){\n\t\t\t\t\t$output['points'] = $_POST['points'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['nb_desired_answers'])){\n\t\t\t\t\t$output['nb_desired_answers'] = $_POST['nb_desired_answers'];\n\t\t\t\t}\n\t\t\t\t$output['nbAnswer'] = $_POST['nbAnswer'];\n\n\t\t\t\tfor($i=0; $i < $output['nbAnswer']; $i++){\n\t\t\t\t\tif(!empty($_POST['reponses'][$i]['id'])){\n\t\t\t\t\t\t$answers[$i]['id'] = $_POST['reponses'][$i]['id'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$answers[$i]['id'] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($_POST['reponses'][$i]['question'])){\n\t\t\t\t\t\t$answers[$i]['question'] = $_POST['reponses'][$i]['question'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$answers[$i]['question'] = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($_POST['reponses'][$i]['answer'])){\n\t\t\t\t\t\t$answers[$i]['answer'] = $_POST['reponses'][$i]['answer'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$answers[$i]['answer'] = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$output['answers'] = $answers;\n\t\t\t\t$output['topics'] = $this->topic_model->get_tree();\n\n\t\t\t\t$output['title'] = $this->lang->line('title_question_add');\n\t\t\t\t$this->display_view('multiple_answer/add', $output);\n\t\t\t}\n\t\t} else {\n\t\t\t$output['focus_topic'] = $this->topic_model->get($_POST['focus_topic']);\n\t\t\t$output['question_type'] = $this->question_type_model->get($_POST['question_type']);\n\n\t\t\tif(isset($_POST['id'])){\n\t\t\t\t$output['id'] = $_POST['id'];\n\t\t\t}\n\t\t\tif(isset($_POST['name'])){\n\t\t\t\t$output['name'] = $_POST['name'];\n\t\t\t}\n\t\t\tif(isset($_POST['points'])){\n\t\t\t\t$output['points'] = $_POST['points'];\n\t\t\t}\n\t\t\tif(isset($_POST['nb_desired_answers'])){\n\t\t\t\t$output['nb_desired_answers'] = $_POST['nb_desired_answers'];\n\t\t\t}\n\n\t\t\t$output['nbAnswer'] = $_POST['nbAnswer'];\n\n\t\t\t$i = 0;\n\t\t\tforeach($_POST['reponses'] as $reponse){\n\t\t\t\tif(!empty($reponse['id'])){\n\t\t\t\t\t$answers[$i]['id'] = $reponse['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$answers[$i]['id'] = 0;\n\t\t\t\t}\n\t\t\t\tif(!empty($reponse['answer'])){\n\t\t\t\t\t$answers[$i]['answer'] = $reponse['answer'];\n\t\t\t\t} else {\n\t\t\t\t\t$answers[$i]['answer'] = \"\";\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\tif (isset($_POST['add_answer'])){\n\t\t\t\t$answers[$i]['id'] = 0;\n\t\t\t\t$answers[$i]['answer'] = \"\";\n\t\t\t\t$output['nbAnswer'] = $output['nbAnswer']+1;\n\t\t\t}\n\n\t\t\tfor($i=0; $i < $output['nbAnswer']; $i++){\n\t\t\t\tif (isset($_POST['del_answer'.$i])){\n\t\t\t\t\tif($output['nbAnswer']>1){\n\t\t\t\t\t\t$output['nbAnswer'] = $_POST['nbAnswer']-1;\n\t\t\t\t\t\tfor($j=$i; $j < $output['nbAnswer']; $j++){\n\t\t\t\t\t\t\t$answers[$j] = $answers[$j+1];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output['nbAnswer'] = $_POST['nbAnswer'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$output['answers'] = $answers;\n\t\t\t$output['topics'] = $this->topic_model->get_tree();\n\n\t\t\t$output['title'] = $this->lang->line('title_question_add');\n\t\t\t$this->display_view('multiple_answer/add', $output);\n\t\t}\n\t}", "public function multi_contact_form_as_one(){\n\t /**\n\t * to keep it looking like one form we set form tags false as we'll do that on the front end\n\t * and submit false on the first form in order to make sure the validation triggers properly for\n\t * the first model and so only one submit tag is shown \n\t */\n\t $this->form = new ContactForm(false, false, array('form_tags'=>false, 'submit'=>false));\n\t $this->form2 = new ContactForm(false, false, array('form_prefix'=>'test_form', 'form_tags'=>false));\n if($this->form->save() & $this->form2->save()){ //note the single & as we want to validate both forms\n $data = $this->form->results();\n $this->redirect_to(\"/thanks/\".$data['name']);\n\t } \n\t }", "public function setSingle($single = true)\n\t{\n\t\t$this->single = (bool) $single;\n\t}", "private function configureSingleMode(): void\n {\n $this->mode = $this->mode === Mode::NONE ? Mode::SINGLE : $this->mode;\n }", "function process_mc($xml, &$questions) {\n\n if (isset($xml[\"POOL\"][\"#\"][\"QUESTION_MULTIPLECHOICE\"])) {\n $mcquestions = $xml[\"POOL\"][\"#\"][\"QUESTION_MULTIPLECHOICE\"];\n }\n else {\n return;\n }\n\n for ($i = 0; $i < sizeof ($mcquestions); $i++) {\n\n $question = $this->defaultquestion();\n\n $question->qtype = MULTICHOICE;\n $question->single = 1; // Only one answer is allowed\n\n $thisquestion = $mcquestions[$i];\n\n // determine if the question is already escaped html\n $ishtml = $thisquestion[\"#\"][\"BODY\"][0][\"#\"][\"FLAGS\"][0][\"#\"][\"ISHTML\"][0][\"@\"][\"value\"];\n\n // put questiontext in question object\n if ($ishtml) {\n $question->questiontext = html_entity_decode_php4(trim($thisquestion[\"#\"][\"BODY\"][0][\"#\"][\"TEXT\"][0][\"#\"]));\n }\n $question->questiontext = addslashes($question->questiontext);\n\n // put name of question in question object, careful of length\n $question->name = substr($question->questiontext, 0, 254);\n\n $choices = $thisquestion[\"#\"][\"ANSWER\"];\n for ($j = 0; $j < sizeof ($choices); $j++) {\n\n $choice = trim($choices[$j][\"#\"][\"TEXT\"][0][\"#\"]);\n // put this choice in the question object.\n if ($ishtml) {\n $question->answer[$j] = html_entity_decode_php4($choice);\n }\n $question->answer[$j] = addslashes($question->answer[$j]);\n\n $id = $choices[$j][\"@\"][\"id\"];\n $correct_answer_id = $thisquestion[\"#\"][\"GRADABLE\"][0][\"#\"][\"CORRECTANSWER\"][0][\"@\"][\"answer_id\"];\n // if choice is the answer, give 100%, otherwise give 0%\n if (strcmp ($id, $correct_answer_id) == 0) {\n $question->fraction[$j] = 1;\n if ($ishtml) {\n $question->feedback[$j] = html_entity_decode_php4(trim(@$thisquestion[\"#\"][\"GRADABLE\"][0][\"#\"][\"FEEDBACK_WHEN_CORRECT\"][0][\"#\"]));\n }\n $question->feedback[$j] = addslashes($question->feedback[$j]);\n } else {\n $question->fraction[$j] = 0;\n if ($ishtml) {\n $question->feedback[$j] = html_entity_decode_php4(trim(@$thisquestion[\"#\"][\"GRADABLE\"][0][\"#\"][\"FEEDBACK_WHEN_INCORRECT\"][0][\"#\"]));\n }\n $question->feedback[$j] = addslashes($question->feedback[$j]);\n }\n }\n $questions[] = $question;\n }\n}", "public function setIsSingleLineQuestion($val)\n {\n $this->_propDict[\"isSingleLineQuestion\"] = boolval($val);\n return $this;\n }", "function _patient_session_answers(&$questions, &$session, $sessionLabel) {\n $answers = array();\n\n if ($session['type'] != null){\n $answers[] = $session['type'];\n }\n else $answers[] = $sessionLabel;\n\n /**if ($this->options['row_per_session']){\n $answers[] = $session['type'];\n }*/\n\n $answers[] = $session['FirstAnswerTS'];\n $answers[] = $session['LastAnswerTS'];\n\n set_time_limit(2);\n $session_id = $session[\"id\"];\n foreach($questions as $question) {\n $question_id = $question[\"id\"];\n\n # manipulate for no-value, not answered, skipped\n if(!isset($question[\"options\"][0]['OptionType'])) {\n $type = false;\n } else {\n $type = $question[\"options\"][0]['OptionType'];\n }\n $answer = \n $this->controller->Answer->analysisValueForSessionAndQuestion(\n $session_id, $question_id);\n switch($type) {\n case \"checkbox\": \n case \"combo-check\": \n if(isset($answer) && $answer) {\n # answered, print one selected and the rest unselected\n foreach($question[\"options\"] as $option) {\n $optionId = $option[\"id\"];\n if(array_key_exists($optionId, $answer)) {\n if ($answer[$optionId] != null){\n // combo-check\n $answers[] = $answer[$optionId]; \n }\n else {\n $answers[] = self::SELECTED_CHECK;\n }\n } else {\n $answers[] = self::UNSELECTED_CHECK;\n }\n }\n\n } else {\n # not answered, print all as skipped\n $options = count($question[\"options\"]);\n for($i=0;$i<$options;$i++) {\n $answers[] = self::SKIPPED;\n }\n }\n break;\n case \"textbox\":\n if(isset($answer) && $answer || $answer === 0) {\n $answer = $this->cleanTextForCSV($answer);\n $answers[] = $answer;\n } else {\n $answers[] = self::SKIPPED;\n }\n break;\n default:\n if(isset($answer) && \n ($answer || (intval($answer) === 0))) {\n $answers[] = $answer;\n } else {\n $answers[] = self::SKIPPED;\n }\n break;\n }\n }\n return $answers;\n }", "public function removeIncorrectAnswer(SingleChoiceAnswerInterface $answer);" ]
[ "0.7881806", "0.63957316", "0.54514843", "0.5409231", "0.52133197", "0.5141202", "0.50167453", "0.501558", "0.49402276", "0.49332064", "0.47311962", "0.4685244", "0.4664043", "0.46190104", "0.45769575", "0.45720473", "0.4558297", "0.4542428", "0.45111763", "0.44895977", "0.44799984", "0.44490084", "0.44458842", "0.44444278", "0.4431525", "0.44124335", "0.4407307", "0.44054258", "0.44032708", "0.4393814", "0.4386091", "0.43733552", "0.435803", "0.4354652", "0.43411425", "0.43294436", "0.431557", "0.43079126", "0.4307905", "0.42957208", "0.42818213", "0.4281663", "0.42790267", "0.42707866", "0.4260133", "0.4255531", "0.42530954", "0.42489156", "0.42438397", "0.4242184", "0.42365214", "0.42362377", "0.42237058", "0.42172542", "0.42135975", "0.42047128", "0.41976854", "0.4185192", "0.41848695", "0.4179955", "0.41674712", "0.41634926", "0.41602984", "0.41601956", "0.4158645", "0.41575542", "0.41525605", "0.4152437", "0.41394785", "0.41297534", "0.41293508", "0.412162", "0.41183558", "0.41157922", "0.41082552", "0.40948012", "0.40911874", "0.408919", "0.40855578", "0.40810373", "0.4077181", "0.4076876", "0.4076468", "0.40641338", "0.40631577", "0.4060979", "0.40520704", "0.40460742", "0.40315157", "0.4031449", "0.40307826", "0.4016361", "0.40149194", "0.40142375", "0.40141666", "0.40137818", "0.4009615", "0.40071478", "0.4007109", "0.4006754" ]
0.7180874
1
Answer configuration for a single choice question. Minimum of 2 answers and maximum of 12 allowed. Generated from protobuf field .google.ads.googleads.v14.common.LeadFormSingleChoiceAnswers single_choice_answers = 2;
Конфигурация ответа для вопроса с одним выбором. Минимум 2 ответа и максимум 12 разрешено. Генерируется из поля protobuf .google.ads.googleads.v14.common.LeadFormSingleChoiceAnswers single_choice_answers = 2;
public function setSingleChoiceAnswers($var) { GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V14\Common\LeadFormSingleChoiceAnswers::class); $this->writeOneof(2, $var); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSingleChoiceAnswers()\n {\n return $this->readOneof(2);\n }", "public function setActualAnswer(SingleChoiceAnswerInterface $answer);", "private function changeAnswersSingleChoice($model) {\n\t\t$i = 1;\n\t\twhile(isset($_POST['choice_single_text'][$i])) {\n\t\t\t// add choice\n\t\t\tif($_POST['choice_single_id'][$i] == \"\") {\n\t\t\t\t// now check whether the answer was deleted\n\t\t\t\tif($_POST['choice_single_deleted'][$i] != true\n\t\t\t\t&& !empty($_POST['choice_single_text'][$i])) {\n\t\t\t\t\t// create choice\n\t\t\t\t\t$model->createChoice($_POST['question_id'],$_POST['choice_single_type'][$i],\n\t\t\t\t\t$_POST['choice_single_text'][$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// delete choice\n\t\t\telse if($_POST['choice_single_deleted'][$i] == true) {\n\t\t\t\t$model->deleteChoice($_POST['choice_single_id'][$i]);\n\t\t\t}\n\t\t\t// change choice\n\t\t\telse {\n\t\t\t\t$model->updateChoice($_POST['choice_single_id'][$i],\n\t\t\t\t$_POST['choice_single_type'][$i],\n\t\t\t\t$_POST['choice_single_text'][$i],\n\t\t\t\t$_POST['rowID'][$i]);\n\t\t\t}\n\t\t\t// increment counter\n\t\t\t$i++;\n\t\t}\n\t}", "private function createAnswersSingleChoice($model, $question_id) {\n\t\t$i = \"1\";\n\t\t// now iterate though all answers\n\t\twhile(isset($_POST['choice_single_text'][$i])) {\n\t\t// now check whether the answer was deleted\n\t\t\tif($_POST['choice_single_deleted'][$i] != true && !empty($_POST['choice_single_text'][$i])) {\n\t\t\t$model->createChoice($question_id,$_POST['choice_single_type'][$i],$_POST['choice_single_text'][$i]);\n\t\t\t\t\t}\n\t\t$i++;\n\t\t}\n\t}", "public function test_answer_create_multiple_answers_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question1_id = '1';\n $question2_id = '3';\n\n $data = [\n [\n 'question_id' => $question1_id,\n 'questionnaire_id' => '1',\n 'response' => 'other',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ],\n [\n 'question_id' => $question2_id,\n 'questionnaire_id' => '1',\n 'response' => '1,Y',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]\n ];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question1_id => [\n 'The response must be one of the following types: yes, no'\n ],\n $question2_id => [\n 'The response must be one of the following types: 1, 2, 3, 4, 5'\n ]\n ]\n ]);\n }", "public function loadAnswerSingleChoice($question_id, $tpl, $model) {\n\t\t$choices = $model->getChoices($question_id);\n\t\t$result = array();\n\t\t$i = \"1\";\n\t\n\t\t$tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n\t\t$tpl->setVariable(\"HIDE_MULTIPLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\t\t$tpl->setVariable(\"SELECTED_SINGLE\", 'selected=\"selected\"');\n\t\t\n\t\tif(!count($choices) == 0) {\n\t\t\tforeach($choices as $choice){\n $tpl->setCurrentBlock(\"single_choice_block\");\n \n // escape curvy brackets, so that ILIAS cannot use them as \n // placeholder\n $choice['text'] = ilObjMobileQuizHelper::escapeCurvyBrackets($choice['text']);\n \n $tpl->setVariable(\"MUL_SHOW\", \"\");\n $tpl->setVariable(\"MUL_TEXT\", $choice['text']);\n $tpl->setVariable(\"MUL_ID\", $choice['choice_id']);\n $tpl->setVariable(\"MUL_COU\", $i);\n $tpl->setVariable(\"MUL_DEL\", false);\n $tpl->setVariable(\"MUL_TYPE_C\", ($choice['correct_value'] == 1) ? \"checked\" : \"\");\n $tpl->setVariable(\"MUL_TYPE_N\", ($choice['correct_value'] == 2) ? \"checked\" : \"\");\n $tpl->setVariable(\"MUL_TYPE_I\", ($choice['correct_value'] == 0) ? \"checked\" : \"\");\n $tpl->setVariable(\"ROW_ID\", $choice['choice_order']); \n \n $tpl->parseCurrentBlock();\n\t\n $i++;\n\t\t\t}\n\t\t}\n\t}", "function setAnswer()\n {\n switch($this->type)\n {\n case MCUA :\n $answer = new AikenAnswerMultipleChoice($this->id);\n \treturn $answer;\n default :\n $answer = null;\n break;\n }\n return $answer;\n }", "public function setOneAnswer($answer){\r\n \t\t$answer_id = $answer['id'];\r\n \t\t// find all answers in this question\r\n \t\t$list_answers = $this->dom_Answers->getElementsByTagName(\"ans\");\r\n \t\t// check id\r\n \t\t$is_update = false;\r\n \t\tif($list_answers)\r\n\t \t\tforeach($list_answers as $ans){\r\n\t \t\t\t// check exists id \t\t\t\r\n\t \t\t\tforeach($ans->attributes as $attName=>$attrNode)\r\n\t\t \t\t\t\tif($attName==\"id\" && $attrNode->nodeValue==$answer_id){\r\n\t\t \t\t\t\t\t$is_update = true;\r\n\t\t \t\t\t\t\tbreak;\r\n\t\t \t\t\t\t}\r\n\t\t \t\t// if check id is ok\r\n\t\t \t\tif($is_update){\r\n\t\t \t\t\t$dom_ans = $ans;\r\n\t\t \t\t\tforeach ($answer as $key=>$value){\r\n\t\t \t\t\t\t$this->setAttributeOfElementXml($dom_ans,$key,$value);\r\n\t\t \t\t\t}\r\n\t\t \t\t\tbreak;\r\n\t\t \t\t}\r\n\t \t\t}\r\n\r\n \t\tif($is_update==false){// insert new answer \r\n \t\t\t$dom_ans = $this->domXml->createElement(\"ans\");\r\n \t\t\tforeach($answer as $key=>$value)\r\n \t\t\t\t$this->setAttributeOfElementXml($dom_ans,$key,$value); \t\t\t\t\r\n \t\t\t$this->dom_Answers->appendChild($dom_ans);\r\n \t\t\t\r\n\t\t}\r\n \t}", "public function test_answer_create_numeric_multi()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '3';\n\n $data = [[\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => '1,3',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]];\n\n $response = $this->postJsonTest($url, $data);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'status' => 'success',\n 'data' => [\n 'multianswer' => $data\n ]\n ]);\n }", "public function testCreateAnswerOnSingleQuestion(): void\n {\n $serializer = $this->symfony->grabService('serializer');\n $validator = $this->symfony->grabService(ValidatorService::class);\n $eventDispatcher = $this->symfony->grabService(EventDispatcherInterface::class);\n $questionRepository = $this->symfony->grabService(QuestionRepository::class);\n $answerRepository = $this->symfony->grabService(AnswerRepository::class);\n\n $factory = new EntityFactory($serializer, $validator);\n $question = $questionRepository->findOneById(self::QUESTION_ID);\n\n $data = [\n 'text' => 'Excellent',\n 'answer_placeholder' => [\n 'id' => self::ANSWER_PLACEHOLDER_ID\n ],\n 'uuid' => '1234-5678-9101'\n ];\n\n /** @var AnswerController $answerController */\n $answerController = new AnswerController($serializer);\n\n /** @var Request $request */\n $request = new Request([], $data, [], [], [], [], json_encode($data));\n\n /** @var JsonResponse $response */\n $response = $answerController->create($request, $question, $factory, $answerRepository, $eventDispatcher);\n\n /** @var \\stdClass $answerObject */\n $answerObject = json_decode($response->getContent(), false);\n\n /** @var Answer $answer */\n $answer = $this->tester->grabEntityFromRepository(Answer::class, ['id' => $answerObject->id]);\n\n /** @var AnswerLog $answerLog */\n $answerLog = $this->tester->grabEntityFromRepository(AnswerLog::class, ['answer' => $answer]);\n\n $this->tester->assertNotNull($answer);\n $this->tester->assertNotNull($answerLog);\n $this->tester->assertSame($answer->getAnswerPlaceholder()->getId(), self::ANSWER_PLACEHOLDER_ID);\n $this->tester->assertSame($answer->getQuestion()->getId(), self::QUESTION_ID);\n }", "public function test_answer_create_numeric_multi_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '3';\n\n $data = [\n [\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => '1,Y',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]\n ];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question_id => [\n 'The response must be one of the following types: 1, 2, 3, 4, 5'\n ]\n ]\n ]);\n }", "function _dquarks_edit_submit_multichoice_add_questions($form, &$form_state) {\n $items = array('choices', 'labels', 'notes');\n foreach ($items as $keys) {\n $add[$keys] = $form_state['input']['extra']['items'][$keys]['add'];\n unset($form_state['input']['extra']['items'][$keys]['add']);\n }\n if (count($form_state['values']['extra']['items']['choices']) > 1) {\n $max = 1 + max(array_keys($form_state['values']['extra']['items']['choices']));\n }\n else {\n $max = 1 + array_pop(array_keys($form_state['values']['extra']['items']['choices']));\n }\n if (!empty($add['labels'])) {\n foreach ($items as $keys) {\n $form_state['values']['extra']['items'][$keys][$max] = $add[$keys];\n unset($form_state['values']['extra']['items'][$keys]['add']);\n }\n }\n $form_state['rebuild'] = TRUE;\n}", "public function validateAnswer(Item $itemEntity, array $answer)\n {\n /** @var Question $question */\n $question = ItemResourceFactory::create($itemEntity)->getContent();\n\n $nbProp = count($question->getPropositions());\n\n if (count($answer) !== $nbProp) {\n throw new InvalidAnswerException('Invalid number of objects in the answer');\n }\n\n foreach ($answer as $ans) {\n if ($ans !== 1 && $ans !== 0) {\n throw new InvalidAnswerException('Invalid format for response : 0 or 1 expected.');\n }\n }\n }", "protected function define_answers_section()\n {\n // defines the list of params to represents the answer\n $this->add_per_answer_fields($this->_form, \"\", question_bank::fraction_options_full(), 0);\n }", "public function loadAnswerMultipleChoice($question_id, $tpl, $model) {\n\t\t$choices = $model->getChoices($question_id);\n\t\t$result = array();\n\t\t$i = \"1\";\n\t\t\n\t\t$tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n\t\t$tpl->setVariable(\"HIDE_SINGLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\t\t$tpl->setVariable(\"SELECTED_MULTIPLE\",'selected=\"selected\"');\n\t\t\n\t\tif(!count($choices) == 0) {\n\t\t\tforeach($choices as $choice){\n\t\t\t\t$tpl->setCurrentBlock(\"multiple_choice_block\");\n \n // escape curvy brackets, so that ILIAS cannot use them as \n // placeholder\n $choice['text'] = ilObjMobileQuizHelper::escapeCurvyBrackets($choice['text']);\n \n\t\t\t\t$tpl->setVariable(\"MUL_SHOW\", \"\");\n\t\t\t\t$tpl->setVariable(\"MUL_TEXT\", $choice['text']);\n\t\t\t\t$tpl->setVariable(\"MUL_ID\", $choice['choice_id']);\n\t\t\t\t$tpl->setVariable(\"MUL_COU\", $i);\n\t\t\t\t$tpl->setVariable(\"MUL_DEL\", false);\n\t\t\t\t$tpl->setVariable(\"MUL_TYPE_C\", ($choice['correct_value'] == 1) ? \"checked\" : \"\");\n\t\t\t\t$tpl->setVariable(\"MUL_TYPE_N\", ($choice['correct_value'] == 2) ? \"checked\" : \"\");\n\t\t\t\t$tpl->setVariable(\"MUL_TYPE_I\", ($choice['correct_value'] == 0) ? \"checked\" : \"\");\t\t\t\n\t\t\t\t$tpl->setVariable(\"ROW_ID\", $choice['choice_order']);\n\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}", "public function getIsSingleLineQuestion()\n {\n if (array_key_exists(\"isSingleLineQuestion\", $this->_propDict)) {\n return $this->_propDict[\"isSingleLineQuestion\"];\n } else {\n return null;\n }\n }", "protected function choice(string $question, array $choices, ?string $default = NULL, bool $multiselect = FALSE) {\n $question = Utils::stripSlashes(Utils::replaceTokens($question, $this->vars));\n\n // The choices can be an associative array.\n $choice_labels = \\array_values($choices);\n // Start choices list form '1'.\n \\array_unshift($choice_labels, NULL);\n unset($choice_labels[0]);\n\n $question = new ChoiceQuestion($question, $choice_labels, $default);\n $question->setMultiselect($multiselect);\n\n // Do not use IO choice here as it prints choice key as default value.\n // @see \\Symfony\\Component\\Console\\Style\\SymfonyStyle::choice().\n $answer = $this->io->askQuestion($question);\n\n // @todo Create a test for this.\n $get_key = static fn (string $answer): string => \\array_search($answer, $choices);\n return \\is_array($answer) ? \\array_map($get_key, $answer) : $get_key($answer);\n }", "public function test_answer_create_ask_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '1';\n\n $data = [[\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => 'yes',\n 'nurse_comment' => 'nurse comment',\n 'ask' => '4'\n ]];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question_id => [\n 'The selected ask is invalid.'\n ]\n ]\n ]);\n }", "private function _addSingleChoice($question)\r\n {\r\n $elemName = $question['FQT_TypeName']\r\n . self::UNDERSCORE\r\n . $question['FQ_ElementID'];\r\n $element = new Zend_Form_Element_Radio($elemName);\r\n $element->removeDecorator('DtDdWrapper');\r\n $element->addDecorators(\r\n array(\r\n 'ViewHelper',\r\n array('HtmlTag',\r\n array(\r\n 'tag' => 'div',\r\n 'class' => 'answer-zone')\r\n )\r\n ));\r\n\r\n $this->_addExtras($element, $question);\r\n $this->addElement($element);\r\n\r\n $this->_displayGroupElements[] = $elemName;\r\n }", "public function editQuestion($checkonly = FALSE)\n\t{\n\t\t$save = $this->isSaveCommand();\n\t\t$this->getQuestionTemplate();\n\n\t\tinclude_once(\"./Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t$form->setFormAction($this->ctrl->getFormAction($this));\n\t\t$form->setTitle($this->outQuestionType());\n\t\t$isSingleline = ($this->object->lastChange == 0 && !array_key_exists('types', $_POST)) ? (($this->object->getMultilineAnswerSetting()) ? false : true) : $this->object->isSingleline;\n\t\tif ($checkonly) $isSingleline = ($_POST['types'] == 0) ? true : false;\n\t\tif ($isSingleline)\n\t\t{\n\t\t\t$form->setMultipart(TRUE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setMultipart(FALSE);\n\t\t}\n\t\t$form->setTableWidth(\"100%\");\n\t\t$form->setId(\"assmultiplechoice\");\n\n\t\t// title, author, description, question, working time (assessment mode)\n\t\t$this->addBasicQuestionFormProperties( $form );\n\t\t$this->populateQuestionSpecificFormPart( $form );\n\t\t$this->populateAnswerSpecificFormPart( $form );\n\t\t$this->populateTaxonomyFormSection($form);\n\t\t$this->addQuestionFormCommandButtons($form);\n\n\t\t$errors = false;\n\n\t\tif ($save)\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$errors = !$form->checkInput();\n\t\t\t$form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes\n\t\t\tif ($errors) $checkonly = false;\n\t\t}\n\n\t\tif (!$checkonly) $this->tpl->setVariable(\"QUESTION_DATA\", $form->getHTML());\n\t\treturn $errors;\n\t}", "private function createAnswersMultipleChoice($model, $question_id) {\n\t\t$i = \"1\";\n\t\t// now iterate though all answers\n\t\twhile(isset($_POST['choice_multiple_text'][$i])) {\n\t\t// now check whether the answer was deleted\n\t\t\tif($_POST['choice_multiple_deleted'][$i] != true && !empty($_POST['choice_multiple_text'][$i])) {\n\t\t\t$model->createChoice($question_id,$_POST['choice_multiple_type'][$i],$_POST['choice_multiple_text'][$i]);\n\t\t\t\t\t}\n\t\t$i++;\n\t\t}\n\t}", "public function hasAnswer(ChoiceAnswer $answer);", "public function choice($question, array $choices, $default = null, $attempts = null, $multiple = false)\n {\n $question = new ChoiceQuestion($question, $choices, $default);\n\n $question->setMaxAttempts($attempts)->setMultiselect($multiple);\n\n return $this->output->askQuestion($question);\n }", "function getAnswers() {\n return $this->answers;\n }", "function _dquarks_submit_multichoice(&$data, $component) {\n $corrects = $childs = $return = array();\n $options = $component['extra']['items'][\"labels\"];\n $wrong = FALSE;\n $score = 0;\n $max_score = 0;\n $corrects = array_intersect_key($component['extra']['items'][\"labels\"], array_filter($component['extra']['items'][\"choices\"]));\n if (is_array($data)) {\n foreach ($data as $key => $value) {\n if ($value != '') {\n if ($component['extra']['items'][\"choices\"][$key]) {\n $childs[] = t(\"Correct answer :\") . ' ' . $options[$key];\n $score = $score + $component['extra']['items'][\"notes\"][$key];\n }\n else {\n $childs[] = t(\"Wrong answer :\") . ' ' . $options[$key];\n $wrong = TRUE;\n }\n $data[$key] = $options[$key];\n $max_score = +array_sum(array_values($component['extra']['items'][\"notes\"]));\n }\n else {\n unset($data[$key]);\n }\n }\n }\n else {\n if (!empty($data) && isset($component['extra']['items'][\"choices\"][$data]) && $component['extra']['items'][\"choices\"][$data]) {\n $childs[] = t(\"Correct answer :\") . ' ' . $options[$data];\n $score = $score + $component['extra']['items'][\"notes\"][$data];\n }\n else {\n $text = (!empty($data)) ? $options[$data] : \"You have not select any option\";\n $childs[] = t(\"Wrong answer :\") . ' ' . $text;\n $wrong = TRUE;\n }\n $max_score = +array_sum(array_values($component['extra']['items'][\"notes\"]));\n $data = array($data => $options[$data]);\n }\n if ($wrong) {\n if (count($corrects)) {\n $childs[] = array(\"data\" => t(\"Correct answers are :\"), \"children\" => $corrects);\n }\n else {\n $childs[] = array(\"data\" => t(\"The Correct answer is :\"), \"children\" => $corrects);\n }\n }\n if (!empty($component['extra']['justificatif'])) {\n $childs[] = $component['extra']['justificatif'];\n }\n $return[] = array(\"data\" => $component['name'], \"children\" => $childs);\n\n return array(\n \"message\" => $return,\n \"note\" => $score,\n \"max_score\" => $max_score,\n );\n}", "public function getCheckedAnswers()\n {\n return $this->checkedAnswers;\n }", "public function getAllAnswers()\n {\n return $this->answers;\n }", "public function get_correct_answer() {\n if (!isset($this->answer)) {\n return null;\n } else {\n $answer = array('answer' => $this->answer);\n // For multilanguage questions we also need to specify the language.\n // Use the answer_language template parameter value if given, otherwise\n // run with the default.\n $params = json_decode($this->templateparams);\n if (!empty($params->answer_language)) {\n $answer['language'] = $params->answer_language;\n } else if (!empty($this->acelang) && strpos($this->acelang, ',') !== false) {\n list($langs, $defaultlang) = qtype_coderunner_util::extract_languages($this->acelang);\n $default = empty($defaultlang) ? $langs[0] : $defaultlang;\n $answer['language'] = $default;\n }\n return $answer;\n }\n }", "public function test_answer_create_numeric_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '2';\n\n $data = [[\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => '1,3',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question_id => [\n 'The response must be one of the following types: 1, 2, 3, 4'\n ]\n ]\n ]);\n }", "public function addIncorrectAnswer(SingleChoiceAnswerInterface $answer);", "public function choice($question, array $choices, $default = null, $attempts = null, $multiple = null)\n {\n $question = new ChoiceQuestion($question, $choices, $default);\n $question->setMaxAttempts($attempts)->setMultiselect($multiple);\n return $this->output->askQuestion($question);\n }", "public function get_answers(){\n return $this->answers;\n }", "protected function define_answer_options_properties_section()\n {\n global $PAGE, $OUTPUT;\n $mform = $this->_form;\n\n // header\n $mform->addElement('header', 'answeroptionspropertiesheader',\n get_string(\"answer_options_properties\", 'qtype_omerocommon'));\n\n // selector to allow single or multi answers\n $menu = array(\n get_string('answersingleno', 'qtype_omerocommon'),\n get_string('answersingleyes', 'qtype_omerocommon'),\n );\n $mform->addElement('select', 'single',\n get_string('answerhowmany', 'qtype_omerocommon'), $menu);\n $mform->setDefault('single', 1);\n\n // how to number answer options\n $mform->addElement('select', 'answernumbering',\n get_string('answernumbering', 'qtype_multichoice'),\n qtype_multichoice::get_numbering_styles());\n $mform->setDefault('answernumbering', 'abc');\n\n // default mark\n $mform->addElement('text', 'defaultmark', get_string('defaultmark', 'question'),\n array('size' => 7));\n $mform->setType('defaultmark', PARAM_FLOAT);\n $mform->setDefault('defaultmark', 1);\n $mform->addRule('defaultmark', null, 'required', null, 'client');\n\n // flag to set the shuffling of answer options\n $mform->addElement('advcheckbox', 'shuffleanswers',\n get_string('shuffleanswers', 'qtype_multichoice'), null, null, array(0, 1));\n $mform->addHelpButton('shuffleanswers', 'shuffleanswers', 'qtype_multichoice');\n $mform->setDefault('shuffleanswers', 1);\n\n // set as expanded by default\n $mform->setExpanded('answeroptionspropertiesheader');\n }", "function _dquarks_submission_display_multichoice($data, $component, $enabled = FALSE) {\n $form_item = _dquarks_render_multichoice($component);\n $options = $form_item['#options'];\n foreach ($options as $key => $value) {\n $options2[$value] = trim($value);\n }\n $form_item['#options'] = $options2;\n if ($component['extra']['multiple'] === 'Y') {\n // Set the value as an array.\n $form_item['#default_value'] = array();\n foreach ((array) $data['value'] as $key => $value) {\n $form_item['#default_value'][] = $value;\n }\n }\n else {\n // Set the value as a single string.\n $form_item['#default_value'] = '';\n foreach ((array) $data['value'] as $key => $value) {\n $form_item['#default_value'] = $value;\n }\n }\n $form_item['#disabled'] = !$enabled;\n return $form_item;\n}", "public function getDefaultansweroption()\n {\n return $this->defaultansweroption;\n }", "private function validateChecklist($aAnswers)\r\n {\r\n $bGood = TRUE;\r\n $aBad = array();\r\n if(is_array($aAnswers))\r\n {\r\n foreach($aAnswers as $aQuestion)\r\n {\r\n $shortname = $aQuestion['shortname'];\r\n $response = $aQuestion['response'];\r\n if(trim($response) == '')\r\n {\r\n $aBad[] = $shortname;\r\n $bGood = FALSE;\r\n }\r\n }\r\n }\r\n if(!$bGood)\r\n {\r\n if(count($aBad) > 1)\r\n {\r\n form_set_error('page_checklist_area1','Must complete all Safety Checklist questions ('.count($aBad).' are blank)');\r\n } else {\r\n form_set_error('page_checklist_area1','Must complete all Safety Checklist questions (1 is blank)');\r\n }\r\n }\r\n return $bGood;\r\n }", "protected function get_per_answer_fields($mform, $label, $gradeoptions,\n &$repeatedoptions, &$answersoption) {\n $config = get_config('qtype_formulas');\n $repeated = array();\n $repeated[] = $mform->createElement('header', 'answerhdr', $label);\n // Part's mark.\n $repeated[] = $mform->createElement('text', 'answermark', get_string('answermark', 'qtype_formulas'),\n array('size' => 3));\n $repeatedoptions['answermark']['helpbutton'] = array('answermark', 'qtype_formulas');\n $repeatedoptions['answermark']['default'] = $config->defaultanswermark;\n $repeatedoptions['answermark']['type'] = PARAM_FLOAT;\n // Part's number of coordinates.\n $repeated[] = $mform->createElement('hidden', 'numbox', '', ''); // Exact value will be computed during validation.\n $repeatedoptions['numbox']['type'] = PARAM_INT;\n // Part's local variables.\n $repeated[] = $mform->createElement('textarea', 'vars1', get_string('vars1', 'qtype_formulas'),\n array('cols' => 80, 'rows' => 1));\n $repeatedoptions['vars1']['helpbutton'] = array('vars1', 'qtype_formulas');\n $repeatedoptions['vars1']['advanced'] = true;\n // Part's answer type (0, 10, 100, 1000).\n $repeated[] = $mform->createElement('select', 'answertype', get_string('answertype', 'qtype_formulas'),\n array(0 => get_string('number', 'qtype_formulas'), 10 => get_string('numeric', 'qtype_formulas'),\n 100 => get_string('numerical_formula', 'qtype_formulas'),\n 1000 => get_string('algebraic_formula', 'qtype_formulas')));;\n $repeatedoptions['answertype']['default'] = $config->defaultanswertype;\n $repeatedoptions['answertype']['type'] = PARAM_INT;\n $repeatedoptions['answertype']['helpbutton'] = array('answertype', 'qtype_formulas');\n // Part's answer.\n $repeated[] = $mform->createElement('text', 'answer', get_string('answer', 'qtype_formulas'),\n array('size' => 80));\n $repeatedoptions['answer']['helpbutton'] = array('answer', 'qtype_formulas');\n $repeatedoptions['answer']['type'] = PARAM_RAW;\n // Part's grading variables.\n $repeated[] = $mform->createElement('textarea', 'vars2', get_string('vars2', 'qtype_formulas'),\n array('cols' => 80, 'rows' => 1));\n $repeatedoptions['vars2']['helpbutton'] = array('vars2', 'qtype_formulas');\n $repeatedoptions['vars2']['advanced'] = true;\n // Part's grading criteria.\n $repeated[] = $mform->createElement('text', 'correctness', get_string('correctness', 'qtype_formulas'),\n array('size' => 60));\n $repeatedoptions['correctness']['default'] = $config->defaultcorrectness;\n $repeatedoptions['correctness']['helpbutton'] = array('correctness', 'qtype_formulas');\n $repeatedoptions['correctness']['type'] = PARAM_RAW;\n // Part's unit penalty.\n $repeated[] = $mform->createElement('text', 'unitpenalty', get_string('unitpenalty', 'qtype_formulas'),\n array('size' => 3));\n $repeatedoptions['unitpenalty']['default'] = $config->defaultunitpenalty;\n $repeatedoptions['unitpenalty']['helpbutton'] = array('unitpenalty', 'qtype_formulas');\n $repeatedoptions['unitpenalty']['type'] = PARAM_FLOAT;\n // Part's unit.\n $repeated[] = $mform->createElement('text', 'postunit', get_string('postunit', 'qtype_formulas'),\n array('size' => 60, 'class' => 'formulas_editing_unit'));\n $repeatedoptions['postunit']['helpbutton'] = array('postunit', 'qtype_formulas');\n $repeatedoptions['postunit']['type'] = PARAM_RAW;\n // Part's basic conversion rules.\n $conversionrules = new unit_conversion_rules;\n $allrules = $conversionrules->allrules();\n foreach ($allrules as $id => $entry) {\n $defaultrulechoice[$id] = $entry[0];\n }\n $repeated[] = $mform->createElement('select', 'ruleid', get_string('ruleid', 'qtype_formulas'),\n $defaultrulechoice);\n $repeatedoptions['ruleid']['default'] = 1;\n // Part's other rules.\n $repeated[] = $mform->createElement('textarea', 'otherrule', get_string('otherrule', 'qtype_formulas'),\n array('cols' => 80, 'rows' => 1));\n $repeatedoptions['otherrule']['helpbutton'] = array('otherrule', 'qtype_formulas');\n $repeatedoptions['otherrule']['advanced'] = true;\n // Part's placeholder.\n $repeated[] = $mform->createElement('text', 'placeholder', get_string('placeholder', 'qtype_formulas'),\n array('size' => 20));\n $repeatedoptions['placeholder']['helpbutton'] = array('placeholder', 'qtype_formulas');\n $repeatedoptions['placeholder']['type'] = PARAM_RAW;\n // Part's text.\n $repeated[] = $mform->createElement('editor', 'subqtext', get_string('subqtext', 'qtype_formulas'),\n array('rows' => 3), $this->editoroptions);\n $repeatedoptions['subqtext']['helpbutton'] = array('subqtext', 'qtype_formulas');\n // Part's feedback.\n $repeated[] = $mform->createElement('editor', 'feedback', get_string('feedback', 'qtype_formulas'),\n array('rows' => 3), $this->editoroptions);\n $repeatedoptions['feedback']['helpbutton'] = array('feedback', 'qtype_formulas');\n $repeatedoptions['feedback']['advanced'] = true;\n // Part's combined feedback.\n $repeated[] = $mform->createElement('editor', 'partcorrectfb', get_string('correctfeedback', 'qtype_formulas'),\n array('rows' => 3), $this->editoroptions);\n $repeatedoptions['partcorrectfb']['helpbutton'] = array('correctfeedback', 'qtype_formulas');\n $repeatedoptions['partcorrectfb']['advanced'] = true;\n $repeated[] = $mform->createElement(\n 'editor',\n 'partpartiallycorrectfb',\n get_string('partiallycorrectfeedback', 'qtype_formulas'),\n array('rows' => 3),\n $this->editoroptions\n );\n $repeatedoptions['partpartiallycorrectfb']['helpbutton'] = array('partiallycorrectfeedback', 'qtype_formulas');\n $repeatedoptions['partpartiallycorrectfb']['advanced'] = true;\n $repeated[] = $mform->createElement('editor', 'partincorrectfb', get_string('incorrectfeedback', 'qtype_formulas'),\n array('rows' => 3), $this->editoroptions);\n $repeatedoptions['partincorrectfb']['helpbutton'] = array('incorrectfeedback', 'qtype_formulas');\n $repeatedoptions['partincorrectfb']['advanced'] = true;\n $answersoption = 'answers';\n return $repeated;\n }", "public function addAnswer(ChoiceAnswer $answer);", "public function showSingle()\n {\n if ($this->_showSingle === null) {\n $option = $this->getOption();\n $selections = $option->getSelections();\n\n $this->_showSingle = count($selections) == 1 && $option->getRequired();\n }\n\n return $this->_showSingle;\n }", "private function addMultChoiceCorrectness($doc, $item, $mcAnswers)\n {\n $resprocessing = $item->getElementsByTagName('resprocessing')->item(0);\n $correctAnswer = null;\n foreach ($mcAnswers as $mcAnswer) {\n if ($mcAnswer->correct == 'true') {\n $correctAnswer = $mcAnswer;\n }\n }\n $respcondition = $resprocessing->appendChild($doc->createElement('respcondition'));\n $this->addAttribute($doc, 'continue', 'No', $respcondition);\n $conditionvar = $respcondition->appendChild($doc->createElement('conditionvar'));\n $varequal = $conditionvar->appendChild($doc->createElement('varequal', $correctAnswer->id));\n $this->addAttribute($doc, 'respident', 'response1', $varequal);\n $setvar = $respcondition->appendChild($doc->createElement('setvar', '100'));\n $this->addAttribute($doc, 'action', 'Set', $setvar);\n $this->addAttribute($doc, 'varname', 'SCORE', $setvar);\n }", "public static function ExtractForm(\n $data,\n $singleResult = false,\n $FormsExtension = '',\n $ChoiceExtension = '',\n $isResult = true\n )\n {\n // list of its attributes\n $forms = DBJson::getObjectsByAttributes(\n $data,\n Form::getDBPrimaryKey( ),\n Form::getDBConvert( ),\n $FormsExtension\n );\n\n\n // generates an assoc array of choices by using a defined\n // list of its attributes\n $choices = DBJson::getObjectsByAttributes(\n $data,\n Choice::getDBPrimaryKey( ),\n Choice::getDBConvert( ),\n $ChoiceExtension\n );\n\n // concatenates the forms and the associated choices\n $res = DBJson::concatObjectListResult(\n $data,\n $forms,\n Form::getDBPrimaryKey( ),\n Form::getDBConvert( )['FO_choices'],\n $choices,\n Choice::getDBPrimaryKey( ),\n $ChoiceExtension,\n $FormsExtension\n );\n if ($isResult){\n // to reindex\n $res = array_values( $res );\n $res = Form::decodeForm($res,false);\n\n if ( $singleResult ){\n\n // only one object as result\n if ( count( $res ) > 0 )\n $res = $res[0];\n }\n }\n\n return $res;\n }", "public function isAnswered()\n {\n return $this->answered;\n }", "private function changeAnswersMultipleChoice($model) {\n\t\t$i = 1;\n\t\twhile(isset($_POST['choice_multiple_text'][$i])) {\n\t\t\t// add choice\n\t\t\tif($_POST['choice_multiple_id'][$i] == \"\") {\n\t\t\t\t// now check whether the answer was deleted\n\t\t\t\tif($_POST['choice_multiple_deleted'][$i] != true \n\t\t\t\t\t\t&& !empty($_POST['choice_multiple_text'][$i])) {\n\t\t\t\t\t// create choice\n\t\t\t\t\t$model->createChoice($_POST['question_id'],$_POST['choice_multiple_type'][$i],\n\t\t\t\t\t\t\t\t\t\t\t$_POST['choice_multiple_text'][$i]);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t// delete choice\n\t\t\telse if($_POST['choice_multiple_deleted'][$i] == true) {\n\t\t\t\t$model->deleteChoice($_POST['choice_multiple_id'][$i]);\n\t\t\t}\n\t\t\t// change choice\n\t\t\telse {\n\t\t\t\t$model->updateChoice($_POST['choice_multiple_id'][$i], \n\t\t\t\t\t\t\t\t\t\t$_POST['choice_multiple_type'][$i],\n\t\t\t\t\t\t\t\t\t\t$_POST['choice_multiple_text'][$i],\n\t\t\t\t\t\t\t\t\t\t$_POST['rowID'][$i]);\n\t\t\t}\n\t\t\t// increment counter\n\t\t\t$i++;\n\t\t}\n\t}", "public function getAnswer() {\n return $this->getAnswerAt(0);\n }", "function ASS_AnswerMultipleResponse (\n $answertext = \"\",\n $points_checked = 0.0,\n $order = 0,\n $points_unchecked = 0,\n\t\t$id = -1\n )\n {\n\tparent::__construct($answertext, $points_checked, $order, $id);\n $this->setPointsUnchecked($points_unchecked);\n }", "public function setAnswer($answer)\n\t\t{\n\t\t\treturn $this->answer = (strlen($answer) > 0) ? $answer : $this->getDefault();\n\t\t}", "public function isSingle()\n {\n $confRule = Mage::getStoreConfig('sms/main_conf/allow_long_sms');\n\n return ($confRule == 1) ? 'single' : 1;\n\n }", "public function testJsonMixedAnswers()\n {\n $data = $this->generateInterviewSessionData();\n\n $jsonAnswers = [];\n\n $normalAnswers = $this->generateAnswers('normal', mt_rand(3,5));\n\n $this->assertTrue(count($normalAnswers) > 1);\n\n foreach ($normalAnswers as $answer) {\n $data->addAnswer($answer);\n $jsonAnswers[] = json_decode($this->convertMockAnswerToJsonAnswer($answer));\n }\n\n $repeatableAnswers = $this->generateAnswers('repeatable', mt_rand(3,5));\n\n $this->assertTrue(count($repeatableAnswers) > 1);\n\n foreach ($repeatableAnswers as $answer) {\n $data->addAnswer($answer);\n $jsonAnswers[] = json_decode($this->convertMockAnswerToJsonAnswer($answer));\n }\n\n $jsonObj = $this->generateJsonObjInterviewSessionData($data->getInterview(), $data->getNote(), $data->getInterviewSession());\n\n $jsonObj->Answers = $jsonAnswers;\n\n $this->assertEquals(json_encode($jsonObj), $data->json());\n }", "function answerOnNextPrompt($answer) {\r\n\t\t\techo $this->__getRow('answerOnNextPrompt', $answer);\r\n\t\t}", "private function createFormRadio ($answer)\n {\n \t$form_string = \"<input type=\\\"hidden\\\" name=\\\"type\\\" value=\\\"radio\\\">\\n\";\n \t// if we have , followed by a new line / space etc. remove the space character\n \t$options = preg_replace ('/,\\s/', ',', $this->input);\n \t$options = explode (\",\", $options);\n \tfor ($i=0; $i<count($options); $i++)\n \t{\n \t\t$form_string .= \"<label><input type=\\\"radio\\\" name=\\\"answer\\\" value=\\\"$i\\\" \";\n \t\tif ($i == $answer) {$form_string.= \"checked=\\\"checked\\\" \";}\n \t\t$form_string .= \"/> \".$options[$i].\"</label><br />\\n\";\n \t}\n \treturn $form_string;\n }", "public function getAnswerAt($index) {\n return $this->_answers->offsetGet((int)$index);\n }", "public function testBuildingCommandWithMultiplePromptAnswers()\n {\n $this->integrationTest->expects($this->once())\n ->method('execute')\n ->with('foo', [], [], ['bar'], true);\n $this->assertSame(\n $this->integrationTest,\n $this->commandBuilder->withAnswers(['bar'])\n ->execute()\n );\n }", "public function testBuildingCommandWithSinglePromptAnswer()\n {\n $this->integrationTest->expects($this->once())\n ->method('execute')\n ->with('foo', [], [], ['bar'], true);\n $this->assertSame(\n $this->integrationTest,\n $this->commandBuilder->withAnswers('bar')\n ->execute()\n );\n }", "public function testRadioQuestion()\n {\n $options = $this->faker->words(3);\n\n $this->loadFixtures([], [\n 'type' => 'radio',\n 'options' => $options,\n ]);\n\n $this\n ->visit(action('SurveyController@getSurvey', ['id' => $this->survey->id]))\n ->see('radio')\n ->see($options[0])\n ->see($options[1])\n ->see($options[2])\n ->select(\"\", $this->question->field)\n ;\n }", "function getQuestionType() {\n\t\treturn 'choice';\n\t}", "public function createMultiple($attemptId, array $answers)\n {\n $final = [];\n\n foreach ($answers as $choice) {\n array_push($final, $this->create($attemptId, $choice));\n }\n\n return $final;\n }", "function theme_dquarks_edit_multichoice_items($variables) {\n\n $items = $variables['form'];\n $header = array(t(\"Correct\"), t(\"Answer\"), t(\"Note\"), t(\"Operations\"));\n foreach (element_children($items[\"choices\"]) as $name) {\n $rows[] = array(\n drupal_render($items[\"choices\"][$name]),\n drupal_render($items[\"labels\"][$name]),\n drupal_render($items[\"notes\"][$name]),\n drupal_render($items[\"operations\"][$name]),\n );\n }\n return theme('table', array('header' => $header, 'rows' => $rows));\n}", "public function validateAnswer ($answer)\n {\n \t//print (\"Answer is $answer \\nType is \".$this->type.\" \\n\");\n \tif ($this->type == 'number' && is_numeric($answer))\n \t{\n \t\treturn true;\n \t}\n \telse if ($this->type == 'radio' && is_numeric($answer)) \n \t{\n \t\t$options = explode (\",\", $this->input);\n \t\tif ($answer >=0 && $answer < count($options)) {return true;}\n \t\telse {return false;}\n \t}\n \telse if ($this->type == 'text' || $this->type == 'TEXT')\n \t{\n \t\t// we don't do any further checking - we use mysql escape to save and use regexp to check valid answer\n \t\treturn true;\n \t}\n \telse\n \t{\n \t\treturn false;\n \t}\n \t\n }", "public function setSimpleResponses($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dialogflow\\V2\\Intent\\Message\\SimpleResponses::class);\n $this->writeOneof(7, $var);\n\n return $this;\n }", "function _dquarks_render_multichoice($component) {\n $form_item = array(\n '#title' => $component['name'],\n '#required' => $component['mandatory'],\n '#weight' => $component['weight'],\n '#description' => _dquarks_filter_descriptions($component['extra']['description']),\n '#prefix' => '<div class=\"dquarks-component-' . $component['type'] . '\" id=\"dquarks-component-' . $component['form_key'] . '\">',\n '#suffix' => '</div>',\n );\n\n // Convert the user-entered options list into an array.\n $default_value = _dquarks_filter_values($component['value'], NULL, NULL, FALSE);\n $options = _dquarks_multichoice_options($component['extra']['items']);\n\n // Set the component options.\n $form_item['#options'] = $options;\n\n if ($component['extra']['multiple'] === 'Y') {\n // Set display as a checkbox set.\n $form_item['#type'] = 'checkboxes';\n // Drupal 7 hack to properly render on multipage forms.\n $form_item['#process'] = array('dquarks_expand_multichoice_checkboxes');\n }\n else {\n // Set display as a radio set.\n $form_item['#type'] = 'radios';\n }\n return $form_item;\n}", "public function getQuestionWithAnswers()\n {\n $question = Question::whereUserId(auth()->id())->randomUnasked()->first();\n $answers = $this->getAnswers($question->answer);\n \n $question->markAsked();\n\n return [\n 'id' => $question->id,\n 'question' => $question->question,\n 'answers' => $answers,\n ];\n }", "function getNbAnswers() {\n return $this->nbAnswers;\n }", "public function setAnswered($boolean)\n {\n $this->answered = (bool) $boolean;\n\n return $this;\n }", "public function test_answer_create_yn_fail()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/multianswer');\n\n $question_id = '1';\n\n $data = [[\n 'question_id' => $question_id,\n 'questionnaire_id' => '1',\n 'response' => 'other',\n 'nurse_comment' => 'nurse comment',\n 'ask' => 'T'\n ]];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n $question_id => [\n 'The response must be one of the following types: yes, no'\n ]\n ]\n ]);\n }", "public function isUserAnswerIsCorrect();", "public function choiceMultiple(\n string $question,\n array $choices,\n $default = null,\n ?int $attempts = null\n ): array {\n $question = new ChoiceQuestion($question, $choices, $default);\n\n $question->setMaxAttempts($attempts)->setMultiselect(true);\n\n return $this->output->askQuestion($question);\n }", "function poll_answer_option($answer)\n{\n return form_radio('answer',$answer['id'],FALSE,\"id='answer_{$answer['id']}'\").' <label for=\"answer_'.$answer['id'].'\">'.htmlspecialchars($answer['answer']).'</label>';\n}", "public function setFieldTypeChoiceType($multiple)\n {\n if ($this->getFieldType() == FormChoiceType::class) {\n $options = $this->getFieldOptions();\n $options['multiple'] = (bool)$multiple;\n $this->setFieldOptions($options);\n }\n\n return $this;\n }", "public function isAnswered() {\n return (bool)$this->_answers->count();\n }", "public function formulation_and_controls(question_attempt $qa, question_display_options $options) {\n $question = $qa->get_question();\n $response = $question->get_response($qa);\n\n $inputname = $qa->get_qt_field_name('answer');\n $inputattributes = array(\n 'type' => $this->get_input_type(),\n 'name' => $inputname,\n );\n\n if ($options->readonly) {\n $inputattributes['disabled'] = 'disabled';\n }\n\n $radiobuttons = array();\n $feedbackimg = array();\n $feedback = array();\n $classes = array();\n foreach ($question->get_order($qa) as $value => $ansid) {\n $ans = $question->answers[$ansid];\n $inputattributes['name'] = $this->get_input_name($qa, $value);\n $inputattributes['value'] = $this->get_input_value($value);\n $inputattributes['id'] = $this->get_input_id($qa, $value);\n // Modification starts.\n /* Comment out core code.\n $isselected = $question->is_choice_selected($response, $value);\n if ($isselected) {\n $inputattributes['checked'] = 'checked';\n } else {\n unset($inputattributes['checked']);\n }\n */\n $inputattributes['checked'] = 'checked';\n // Modification ends.\n $hidden = '';\n if (!$options->readonly && $this->get_input_type() == 'checkbox') {\n $hidden = html_writer::empty_tag('input', array(\n 'type' => 'hidden',\n 'name' => $inputattributes['name'],\n 'value' => 0,\n ));\n }\n $radiobuttons[] = $hidden . html_writer::empty_tag('input', $inputattributes) .\n html_writer::tag('label',\n html_writer::span($this->number_in_style($value, $question->answernumbering), 'answernumber') .\n $question->make_html_inline($question->format_text(\n $ans->answer, $ans->answerformat,\n $qa, 'question', 'answer', $ansid)),\n array('for' => $inputattributes['id'], 'class' => 'ml-1'));\n\n // Param $options->suppresschoicefeedback is a hack specific to the\n // oumultiresponse question type. It would be good to refactor to\n // avoid refering to it here.\n // Modification starts.\n /* Comment out core code.\n if ($options->feedback && empty($options->suppresschoicefeedback) &&\n $isselected && trim($ans->feedback)) {\n */\n if ($options->feedback && empty($options->suppresschoicefeedback) &&\n trim($ans->feedback)) {\n // Modification ends.\n $feedback[] = html_writer::tag('div',\n $question->make_html_inline($question->format_text(\n $ans->feedback, $ans->feedbackformat,\n $qa, 'question', 'answerfeedback', $ansid)),\n array('class' => 'specificfeedback'));\n } else {\n $feedback[] = '';\n }\n $class = 'r' . ($value % 2);\n // Modification starts.\n /* Comment out core code.\n if ($options->correctness && $isselected) {\n */\n if ($options->correctness) {\n // Modification ends.\n $feedbackimg[] = $this->feedback_image($this->is_right($ans));\n $class .= ' ' . $this->feedback_class($this->is_right($ans));\n } else {\n $feedbackimg[] = '';\n }\n $classes[] = $class;\n }\n\n $result = '';\n $result .= html_writer::tag('div', $question->format_questiontext($qa),\n array('class' => 'qtext'));\n\n $result .= html_writer::start_tag('div', array('class' => 'ablock'));\n $result .= html_writer::tag('div', $this->prompt(), array('class' => 'prompt'));\n\n $result .= html_writer::start_tag('div', array('class' => 'answer'));\n foreach ($radiobuttons as $key => $radio) {\n $result .= html_writer::tag('div', $radio . ' ' . $feedbackimg[$key] . $feedback[$key],\n array('class' => $classes[$key])) . \"\\n\";\n }\n $result .= html_writer::end_tag('div'); // Answer.\n\n $result .= $this->after_choices($qa, $options);\n\n $result .= html_writer::end_tag('div'); // Ablock.\n\n if ($qa->get_state() == question_state::$invalid) {\n $result .= html_writer::nonempty_tag('div',\n $question->get_validation_error($qa->get_last_qt_data()),\n array('class' => 'validationerror'));\n }\n\n return $result;\n }", "function process_ma($xml, &$questions) {\n\n if (isset($xml[\"POOL\"][\"#\"][\"QUESTION_MULTIPLEANSWER\"])) {\n $maquestions = $xml[\"POOL\"][\"#\"][\"QUESTION_MULTIPLEANSWER\"];\n }\n else {\n return;\n }\n\n for ($i = 0; $i < sizeof ($maquestions); $i++) {\n\n $question = $this->defaultquestion();\n\n $question->qtype = MULTICHOICE;\n $question->defaultgrade = 1;\n $question->single = 0; // More than one answers allowed\n $question->image = \"\"; // No images with this format\n\n $thisquestion = $maquestions[$i];\n\n // determine if the question is already escaped html\n $ishtml = $thisquestion[\"#\"][\"BODY\"][0][\"#\"][\"FLAGS\"][0][\"#\"][\"ISHTML\"][0][\"@\"][\"value\"];\n\n // put questiontext in question object\n if ($ishtml) {\n $question->questiontext = html_entity_decode_php4(trim($thisquestion[\"#\"][\"BODY\"][0][\"#\"][\"TEXT\"][0][\"#\"]));\n }\n $question->questiontext = addslashes($question->questiontext);\n // put name of question in question object\n $question->name = substr($question->questiontext, 0, 254);\n\n $choices = $thisquestion[\"#\"][\"ANSWER\"];\n $correctanswers = $thisquestion[\"#\"][\"GRADABLE\"][0][\"#\"][\"CORRECTANSWER\"];\n\n for ($j = 0; $j < sizeof ($choices); $j++) {\n\n $choice = trim($choices[$j][\"#\"][\"TEXT\"][0][\"#\"]);\n // put this choice in the question object.\n $question->answer[$j] = addslashes($choice);\n\n $correctanswercount = sizeof($correctanswers);\n $id = $choices[$j][\"@\"][\"id\"];\n $iscorrect = 0;\n for ($k = 0; $k < $correctanswercount; $k++) {\n\n $correct_answer_id = trim($correctanswers[$k][\"@\"][\"answer_id\"]);\n if (strcmp ($id, $correct_answer_id) == 0) {\n $iscorrect = 1;\n }\n\n }\n if ($iscorrect) { \n $question->fraction[$j] = floor(100000/$correctanswercount)/100000; // strange behavior if we have more than 5 decimal places\n $question->feedback[$j] = addslashes(trim($thisquestion[\"#\"][\"GRADABLE\"][$j][\"#\"][\"FEEDBACK_WHEN_CORRECT\"][0][\"#\"]));\n } else {\n $question->fraction[$j] = 0;\n $question->feedback[$j] = addslashes(trim($thisquestion[\"#\"][\"GRADABLE\"][$j][\"#\"][\"FEEDBACK_WHEN_INCORRECT\"][0][\"#\"]));\n }\n }\n\n $questions[] = $question;\n }\n}", "public function setCorrectAnswer(AnswerInterface $answer);", "static function validateYesNo($answer) \n\t\t{\n\t\t\t$result = (bool)($answer == \"yes\" || $answer == \"no\");\n\t\t\treturn $result;\n\t\t}", "public function getAnswer()\n {\n return $this->answer;\n }", "public function setCheckedAnswers($checkedAnswers)\n {\n $this->checkedAnswers = $checkedAnswers;\n\n return $this;\n }", "public function rules()\n {\n return [\n 'answers' => 'required|array',\n 'answers.*' => 'int|exists:choices,id',\n ];\n }", "public function getAnswer()\n\t\t{\n\t\t\treturn $this->answer;\n\t\t}", "public function is_allow_multi_on_form() {\n\t\treturn true;\n\t}", "public function getAnswers();", "public function getAnswer()\n {\n return $this->answer;\n }", "public static function grade_question_auto( $question_id = 0, $question_type = '', $answer = '', $user_id = 0 ) {\n\n if( intval( $user_id ) == 0 ) {\n\n $user_id = get_current_user_id();\n\n }\n\n if( ! ( intval( $question_id ) > 0 ) ) {\n\n return false;\n\n }\n\n\n Sensei()->question->get_question_type( $question_id );\n\n /**\n * Applying a grade before the auto grading takes place.\n *\n * This filter is applied just before the question is auto graded. It fires in the context of a single question\n * in the sensei_grade_question_auto function. It fires irrespective of the question type. If you return a value\n * other than false the auto grade functionality will be ignored and your supplied grade will be user for this question.\n *\n * @param int $question_grade default false\n * @param int $question_id\n * @param string $question_type one of the Sensei question type.\n * @param string $answer user supplied question answer\n */\n $question_grade = apply_filters( 'sensei_pre_grade_question_auto', false, $question_id, $question_type, $answer );\n\n if ( false !== $question_grade ) {\n\n return $question_grade;\n\n }\n\n // auto grading core\n if( in_array( $question_type , array( 'multiple-choice' , 'boolean' ) ) ){\n\n $right_answer = (array) get_post_meta( $question_id, '_question_right_answer', true );\n\n if( 0 == get_magic_quotes_gpc() ) {\n $answer = wp_unslash( $answer );\n }\n $answer = (array) $answer;\n if ( is_array( $right_answer ) && count( $right_answer ) == count( $answer ) ) {\n // Loop through all answers ensure none are 'missing'\n $all_correct = true;\n foreach ( $answer as $check_answer ) {\n if ( !in_array( $check_answer, $right_answer ) ) {\n $all_correct = false;\n }\n }\n // If all correct then grade\n if ( $all_correct ) {\n $question_grade = Sensei()->question->get_question_grade( $question_id );\n }\n }\n\n } elseif( 'gap-fill' == $question_type ){\n\n $question_grade = self::grade_gap_fill_question( $question_id ,$answer );\n\n } else{\n\n /**\n * Grading questions that are not auto gradable.\n *\n * This filter is applied the context of ta single question within the sensei_grade_question_auto function.\n * It fires for all other questions types. It does not apply to 'multiple-choice' , 'boolean' and gap-fill.\n *\n * @param int $question_grade default zero\n * @param int $question_id\n * @param string $question_type one of the Sensei question type.\n * @param string $answer user supplied question answer\n */\n $question_grade = ( int ) apply_filters( 'sensei_grade_question_auto', $question_grade, $question_id, $question_type, $answer );\n\n } // end if $question_type\n\n return $question_grade;\n }", "public static function optionsAddAnswers(\\Elgg\\Event $event) {\n\t\t$search_params = $event->getValue();\n\t\t\n\t\t$type_subtype_pairs = false;\n\t\t$subtypes = (array) elgg_extract('subtypes', $search_params, elgg_extract('subtype', $search_params));\n\t\tif (empty($subtypes)) {\n\t\t\t$type_subtype_pairs = (array) elgg_extract('type_subtype_pairs', $search_params);\n\t\t\t$subtypes = (array) elgg_extract('object', $type_subtype_pairs);\n\t\t}\n\t\t\n\t\tif (empty($subtypes) || !in_array(\\ElggQuestion::SUBTYPE, $subtypes) || in_array(\\ElggAnswer::SUBTYPE, $subtypes)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$subtypes[] = \\ElggAnswer::SUBTYPE;\n\t\t\n\t\tif ($type_subtype_pairs !== false) {\n\t\t\t$type_subtype_pairs['object'] = $subtypes;\n\t\t\t\n\t\t\t$search_params['type_subtype_pairs'] = $type_subtype_pairs;\n\t\t} else {\n\t\t\t$search_params['subtypes'] = $subtypes;\n\t\t\tunset($search_params['subtype']);\n\t\t}\n\t\t\n\t\treturn $search_params;\n\t}", "function getNextQuestion()\n{\n global $questions;\n\n // get a random question index\n $randomIndex = rand(0, sizeof($questions) - 1);\n\n // get the question specified by the index\n $question = $questions[$randomIndex];\n\n // get all possible answers as an array\n $answers = explode(\"@\", $question[\"Answers\"]);\n\n // create an HTML submission form\n $form = \"<span style=\\\"color:blue\\\">\" . $question[\"Question\"] . \"</span><br /><br />\";\n $form .= \"<form>\";\n $form .= \"<div style=\\\"text-align:left\\\">\";\n \n // shuffle the array to make sure the answers appear in a random order\n shuffle($answers);\n\n // iterate through the question and get all possible answers\n for($i = 0; $i < sizeof($answers); $i++)\n {\n $form .= \"<input type=\\\"radio\\\" name=\\\"answer\\\" id=\\\"answer\" . $i . \"\\\" value=\\\"\" . $answers[$i] . \"\\\" />\" . $answers[$i] . \"<br />\";\n }\n\n $form .= \"</div>\";\n\n // add the question number\n $form .= \"<input type=\\\"hidden\\\" id=\\\"questionNum\\\" value=\\\"\" . $randomIndex . \"\\\" />\";\n\n // add the submission button\n $form .= \"<br /><input type=\\\"button\\\" id=\\\"submitAnswer\\\" value=\\\"Submit\\\" onClick=\\\"checkAnswer($('#questionNum').attr('value'), $('input:checked').attr('value'));\\\" />\";\n\n $form .= \"</form>\";\n\n // spit out the generated form\n echo $form;\n}", "private function createAnswerChoices() {\n // -- Looping through quiz question set and adding in three incorrect answers\n // -- to be included in the quiz along with the right answer\n shuffle($this->wrongAnswers);\n $wrongAnswerChunks = array_chunk($this->wrongAnswers, 3);\n\n for ($i=0; $i < $this->length; $i++) {\n $oneChunk = array_shift($wrongAnswerChunks);\n array_push($oneChunk, $this->questionSetFull[$i]['capital']);\n shuffle($oneChunk);\n array_push($this->answerChoices, $oneChunk);\n }\n return $this->answerChoices;\n }", "public function createAnswer($type = self::TEXT_ANSWER);", "public function setAnswer($answer) {\r\n\r\n\t\t$this->answer[] = !empty($answer) ? trim($answer) : NULL;\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "function _dquarks_help_multichoice($section) {\n switch ($section) {\n case 'admin/settings/dquarks#multichoice_description':\n return t('Allows creation of checkboxes, radio buttons, or select menus.');\n }\n}", "protected function add_sample_answer_field($mform) {\n $mform->addElement('header', 'answerhdr',\n get_string('answer', 'qtype_coderunner'), '');\n $mform->setExpanded('answerhdr', 1);\n $mform->addElement('textarea', 'answer',\n get_string('answer', 'qtype_coderunner'),\n array('rows' => 9, 'class' => 'answer edit_code'));\n $mform->addElement('advcheckbox', 'validateonsave', null,\n get_string('validateonsave', 'qtype_coderunner'));\n $mform->setDefault('validateonsave', false);\n $mform->addHelpButton('answer', 'answer', 'qtype_coderunner');\n }", "public function askChoices($question, array $choices)\n\t{\n\t\t$choiceNumbers = array();\n\n\t\t$this->sayNice($question);\n\n\n\t\t$num = 1;\n\t\t$answers = array();\n\n\t\tforeach($choices as $no => $choice)\n\t\t{\n\t\t\t$answers[$num] = $no;\n\t\t\t$choiceNumbers[] = $num;\n\t\t\t$choices[$no] = $num++.'. '.$choice;\n\t\t}\n\n\t\t$this->say();\n\n\t\treturn $answers[$this->ask(array_merge($choices, array('', 'Option : ')), $choiceNumbers)];\n\t}", "function _dquarks_theme_multichoice() {\n return array(\n 'dquarks_edit_multichoice' => array(\n 'variables' => array('form' => NULL, 'component' => NULL),\n 'file' => 'components/multichoice.inc',\n ),\n 'dquarks_mail_multichoice' => array(\n 'variables' => array(\n 'data' => NULL,\n 'component' => NULL,\n ),\n 'file' => 'components/multichoice.inc',\n ),\n );\n}", "public static function UpdateSaveAnswers(){\n\n\t\t\tglobal $config;\n\t\t\t\n\t\t\t$dbconn = db::singleton();\n\t\t\t\textract($_REQUEST); \n\t\t//print_r($_REQUEST); die;\n\t\t\t$qids = explode(',',$hiddenqid);\n\t\t\t//print_r($qids); die;\n\t\t\t\n\n\t\t\t\n\t\t\tfor($i=0;$i<count($qids);$i++){\n\t\t\t\t$longarraykey = \"longanswer\".$qids[$i];\n\t\t\t\t//print_r($longarraykey); \n\t\t\t\t\n\t\t\t\t$answervallong = array_key_exists($longarraykey,$_REQUEST)?$_REQUEST[$longarraykey]:\"\";\n\t\t\t\n\t\t\t\t//print($answervallong); \n\t\t\t\t\n\t\t\t\tif($answervallong!=\"\"){\n\t\t\t\t\t//echo \"hello\". $answervallong[0]; die;\n\t\t\t\t\tif(isset($incorrect))\n\t\t\t\t\t{$correctans=0;}\n\t\t\t\t\telse if(isset($correct))\n\t\t\t\t\t{$correctans=1;}\n\t\t\t\t\t$sql = \" update answers set score_u=\".$correctans.\" \n\t\t\t\t\twhere quiz_session_id=\".$qsid.\" and qid=\".$qids[$i].\" and rid=\".$rid.\"\";\n\t\t\t\t\t$dbconn->SetQuery($sql);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\tQuiz::UpdateResult($qsid,$rid); \n\t}", "public function addshortanswerAction(){\r\n\t\t$this->view->action = \"editshortanswer\";\r\n $this->view->nameTypeQuestion = \"Câu hỏi trả lời ngắn\";\r\n\t\t$ObjQuestion = Array();\r\n\t\t$ObjQuestion['type'] = 6;\r\n\t\t$ObjQuestion['score'] = 1;\r\n\t\t$ObjQuestion['level'] = 0.5;\r\n\t\t$ObjQuestion['classification'] = 0.2;\r\n\t\t$ObjQuestion['isupdate'] = 0; // insert new question\r\n\t\t$ObjQuestion['subject_id'] = \"\";\r\n\t\t$ObjQuestion['chapter_id'] = \"\";\r\n\t\t$ObjQuestion['question_title'] = \"\";\r\n\t\t$ObjQuestion['id'] = '';\r\n\t\t$ObjQuestion['content'] = \"\";\r\n\t\t$ObjQuestion['generalfeedback'] = \"\";\r\n\t\t$ObjQuestion['hidden'] = '';\r\n\t\t$ObjQuestion['classification'] = '';\r\n $ObjQuestion['created_user'] = $this->getUserId();\r\n \r\n\t\t$this->view->ObjQuestion = $ObjQuestion;\r\n\t\t$this->renderquestion(6);\r\n\t}", "public function setSingle($single = true)\n\t{\n\t\t$this->single = (bool) $single;\n\t}", "private function configureSingleMode(): void\n {\n $this->mode = $this->mode === Mode::NONE ? Mode::SINGLE : $this->mode;\n }", "public function add_multiple_answer()\n\t{\n\t\tif (isset($_POST['save'])){\n\t\t\t$this->form_validation->set_rules('name', $this->lang->line('question_text'), 'required');\n\t\t\t$this->form_validation->set_rules('points', $this->lang->line('points'), 'required|numeric|is_natural');\n\t\t\t$this->form_validation->set_rules('nb_desired_answers', $this->lang->line('nb_desired_answers'), 'required|integer|is_natural_no_zero');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t\t'id', 'Id', 'callback_cb_question_exists',\n\t\t\t\t['callback_cb_question_exists' => 'lang:question_error_404_heading']\n\t\t\t);\n\t\t\tfor($i=0; $i < $_POST['nbAnswer']; $i++){\n\t\t\t\t$this->form_validation->set_rules('reponses['.$i.'][answer]', $this->lang->line('answers_list'), 'required');\n\t\t\t}\n\n\t\t\tif ($this->form_validation->run()){\n\t\t\t\tif(!isset($_POST['id'])){\n\t\t\t\t\t$inputQuestion = array(\n\t\t\t\t\t\t\"FK_Topic\" => $_POST['focus_topic'],\n\t\t\t\t\t\t\"FK_Question_Type\" => $_POST['question_type'],\n\t\t\t\t\t\t\"Question\" => $_POST['name'],\n\t\t\t\t\t\t\"nb_desired_answers\" => $_POST['nb_desired_answers'],\n\t\t\t\t\t\t\"Points\" => $_POST['points']\n\t\t\t\t\t);\n\t\t\t\t\t$idQuestion = $this->question_model->insert($inputQuestion);\n\n\t\t\t\t\tfor($i=0; $i < $_POST['nbAnswer']; $i++){\n\t\t\t\t\t\t$inputAnswer = array(\n\t\t\t\t\t\t\t\"FK_Question\" => $idQuestion,\n\t\t\t\t\t\t\t\"Answer\" => $_POST['reponses'][$i]['answer']\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->multiple_answer_model->insert($inputAnswer);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$inputQuestion = array(\n\t\t\t\t\t\t\"FK_Topic\" => $_POST['focus_topic'],\n\t\t\t\t\t\t\"FK_Question_Type\" => $_POST['question_type'],\n\t\t\t\t\t\t'Nb_Desired_Answers' => $_POST['nb_desired_answers'],\n\t\t\t\t\t\t\"Question\" => $_POST['name'],\n\t\t\t\t\t\t\"Points\" => $_POST['points']\n\t\t\t\t\t);\n\t\t\t\t\t$this->question_model->update($_POST['id'], $inputQuestion);\n\n\t\t\t\t\tfor($i=0; $i < $_POST['nbAnswer']; $i++){\n\t\t\t\t\t\t$answers[$i]['id'] = $_POST['reponses'][$i]['id'];\n\t\t\t\t\t\t$answers[$i]['answer'] = $_POST['reponses'][$i]['answer'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$reponses = $this->multiple_answer_model->get_many_by('FK_Question = ' . $_POST['id']);\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ($reponses as $reponse) {\n\t\t\t\t\t\t$answersDb[$i] = $reponse->ID;\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor($i=0; $i < $_POST['nbAnswer']; $i++){\n\t\t\t\t\t\tif($answers[$i]['id'] == 0){\n\t\t\t\t\t\t\t$inputQuestion = array(\n\t\t\t\t\t\t\t\t\"FK_Question\" => $_POST['id'],\n\t\t\t\t\t\t\t\t\"Answer\" => $answers[$i]['answer']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$idQuestion = $this->multiple_answer_model->insert($inputQuestion);\n\n\t\t\t\t\t\t\tunset($answersDb[array_search($idQuestion, $answersDb)]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$inputAnswer = array(\n\t\t\t\t\t\t\t\t\"FK_Question\" => $_POST['id'],\n\t\t\t\t\t\t\t\t\"Answer\" => $answers[$i]['answer']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->multiple_answer_model->update($answers[$i]['id'], $inputAnswer);\n\n\t\t\t\t\t\t\tunset($answersDb[array_search($answers[$i]['id'], $answersDb)]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($answersDb as $answerDb) {\n\t\t\t\t\t\t$this->multiple_answer_model->delete($answerDb);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tredirect('question');\n\t\t\t} else {\n\t\t\t\t$output['focus_topic'] = $this->topic_model->get($_POST['focus_topic']);\n\t\t\t\t$output['question_type'] = $this->question_type_model->get($_POST['question_type']);\n\n\t\t\t\tif(isset($_POST['id'])){\n\t\t\t\t\t$output['id'] = $_POST['id'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['name'])){\n\t\t\t\t\t$output['name'] = $_POST['name'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['points'])){\n\t\t\t\t\t$output['points'] = $_POST['points'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['nb_desired_answers'])){\n\t\t\t\t\t$output['nb_desired_answers'] = $_POST['nb_desired_answers'];\n\t\t\t\t}\n\t\t\t\t$output['nbAnswer'] = $_POST['nbAnswer'];\n\n\t\t\t\tfor($i=0; $i < $output['nbAnswer']; $i++){\n\t\t\t\t\tif(!empty($_POST['reponses'][$i]['id'])){\n\t\t\t\t\t\t$answers[$i]['id'] = $_POST['reponses'][$i]['id'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$answers[$i]['id'] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($_POST['reponses'][$i]['question'])){\n\t\t\t\t\t\t$answers[$i]['question'] = $_POST['reponses'][$i]['question'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$answers[$i]['question'] = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($_POST['reponses'][$i]['answer'])){\n\t\t\t\t\t\t$answers[$i]['answer'] = $_POST['reponses'][$i]['answer'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$answers[$i]['answer'] = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$output['answers'] = $answers;\n\t\t\t\t$output['topics'] = $this->topic_model->get_tree();\n\n\t\t\t\t$output['title'] = $this->lang->line('title_question_add');\n\t\t\t\t$this->display_view('multiple_answer/add', $output);\n\t\t\t}\n\t\t} else {\n\t\t\t$output['focus_topic'] = $this->topic_model->get($_POST['focus_topic']);\n\t\t\t$output['question_type'] = $this->question_type_model->get($_POST['question_type']);\n\n\t\t\tif(isset($_POST['id'])){\n\t\t\t\t$output['id'] = $_POST['id'];\n\t\t\t}\n\t\t\tif(isset($_POST['name'])){\n\t\t\t\t$output['name'] = $_POST['name'];\n\t\t\t}\n\t\t\tif(isset($_POST['points'])){\n\t\t\t\t$output['points'] = $_POST['points'];\n\t\t\t}\n\t\t\tif(isset($_POST['nb_desired_answers'])){\n\t\t\t\t$output['nb_desired_answers'] = $_POST['nb_desired_answers'];\n\t\t\t}\n\n\t\t\t$output['nbAnswer'] = $_POST['nbAnswer'];\n\n\t\t\t$i = 0;\n\t\t\tforeach($_POST['reponses'] as $reponse){\n\t\t\t\tif(!empty($reponse['id'])){\n\t\t\t\t\t$answers[$i]['id'] = $reponse['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$answers[$i]['id'] = 0;\n\t\t\t\t}\n\t\t\t\tif(!empty($reponse['answer'])){\n\t\t\t\t\t$answers[$i]['answer'] = $reponse['answer'];\n\t\t\t\t} else {\n\t\t\t\t\t$answers[$i]['answer'] = \"\";\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\tif (isset($_POST['add_answer'])){\n\t\t\t\t$answers[$i]['id'] = 0;\n\t\t\t\t$answers[$i]['answer'] = \"\";\n\t\t\t\t$output['nbAnswer'] = $output['nbAnswer']+1;\n\t\t\t}\n\n\t\t\tfor($i=0; $i < $output['nbAnswer']; $i++){\n\t\t\t\tif (isset($_POST['del_answer'.$i])){\n\t\t\t\t\tif($output['nbAnswer']>1){\n\t\t\t\t\t\t$output['nbAnswer'] = $_POST['nbAnswer']-1;\n\t\t\t\t\t\tfor($j=$i; $j < $output['nbAnswer']; $j++){\n\t\t\t\t\t\t\t$answers[$j] = $answers[$j+1];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output['nbAnswer'] = $_POST['nbAnswer'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$output['answers'] = $answers;\n\t\t\t$output['topics'] = $this->topic_model->get_tree();\n\n\t\t\t$output['title'] = $this->lang->line('title_question_add');\n\t\t\t$this->display_view('multiple_answer/add', $output);\n\t\t}\n\t}", "public function multi_contact_form_as_one(){\n\t /**\n\t * to keep it looking like one form we set form tags false as we'll do that on the front end\n\t * and submit false on the first form in order to make sure the validation triggers properly for\n\t * the first model and so only one submit tag is shown \n\t */\n\t $this->form = new ContactForm(false, false, array('form_tags'=>false, 'submit'=>false));\n\t $this->form2 = new ContactForm(false, false, array('form_prefix'=>'test_form', 'form_tags'=>false));\n if($this->form->save() & $this->form2->save()){ //note the single & as we want to validate both forms\n $data = $this->form->results();\n $this->redirect_to(\"/thanks/\".$data['name']);\n\t } \n\t }", "function process_mc($xml, &$questions) {\n\n if (isset($xml[\"POOL\"][\"#\"][\"QUESTION_MULTIPLECHOICE\"])) {\n $mcquestions = $xml[\"POOL\"][\"#\"][\"QUESTION_MULTIPLECHOICE\"];\n }\n else {\n return;\n }\n\n for ($i = 0; $i < sizeof ($mcquestions); $i++) {\n\n $question = $this->defaultquestion();\n\n $question->qtype = MULTICHOICE;\n $question->single = 1; // Only one answer is allowed\n\n $thisquestion = $mcquestions[$i];\n\n // determine if the question is already escaped html\n $ishtml = $thisquestion[\"#\"][\"BODY\"][0][\"#\"][\"FLAGS\"][0][\"#\"][\"ISHTML\"][0][\"@\"][\"value\"];\n\n // put questiontext in question object\n if ($ishtml) {\n $question->questiontext = html_entity_decode_php4(trim($thisquestion[\"#\"][\"BODY\"][0][\"#\"][\"TEXT\"][0][\"#\"]));\n }\n $question->questiontext = addslashes($question->questiontext);\n\n // put name of question in question object, careful of length\n $question->name = substr($question->questiontext, 0, 254);\n\n $choices = $thisquestion[\"#\"][\"ANSWER\"];\n for ($j = 0; $j < sizeof ($choices); $j++) {\n\n $choice = trim($choices[$j][\"#\"][\"TEXT\"][0][\"#\"]);\n // put this choice in the question object.\n if ($ishtml) {\n $question->answer[$j] = html_entity_decode_php4($choice);\n }\n $question->answer[$j] = addslashes($question->answer[$j]);\n\n $id = $choices[$j][\"@\"][\"id\"];\n $correct_answer_id = $thisquestion[\"#\"][\"GRADABLE\"][0][\"#\"][\"CORRECTANSWER\"][0][\"@\"][\"answer_id\"];\n // if choice is the answer, give 100%, otherwise give 0%\n if (strcmp ($id, $correct_answer_id) == 0) {\n $question->fraction[$j] = 1;\n if ($ishtml) {\n $question->feedback[$j] = html_entity_decode_php4(trim(@$thisquestion[\"#\"][\"GRADABLE\"][0][\"#\"][\"FEEDBACK_WHEN_CORRECT\"][0][\"#\"]));\n }\n $question->feedback[$j] = addslashes($question->feedback[$j]);\n } else {\n $question->fraction[$j] = 0;\n if ($ishtml) {\n $question->feedback[$j] = html_entity_decode_php4(trim(@$thisquestion[\"#\"][\"GRADABLE\"][0][\"#\"][\"FEEDBACK_WHEN_INCORRECT\"][0][\"#\"]));\n }\n $question->feedback[$j] = addslashes($question->feedback[$j]);\n }\n }\n $questions[] = $question;\n }\n}", "public function removeIncorrectAnswer(SingleChoiceAnswerInterface $answer);", "function _patient_session_answers(&$questions, &$session, $sessionLabel) {\n $answers = array();\n\n if ($session['type'] != null){\n $answers[] = $session['type'];\n }\n else $answers[] = $sessionLabel;\n\n /**if ($this->options['row_per_session']){\n $answers[] = $session['type'];\n }*/\n\n $answers[] = $session['FirstAnswerTS'];\n $answers[] = $session['LastAnswerTS'];\n\n set_time_limit(2);\n $session_id = $session[\"id\"];\n foreach($questions as $question) {\n $question_id = $question[\"id\"];\n\n # manipulate for no-value, not answered, skipped\n if(!isset($question[\"options\"][0]['OptionType'])) {\n $type = false;\n } else {\n $type = $question[\"options\"][0]['OptionType'];\n }\n $answer = \n $this->controller->Answer->analysisValueForSessionAndQuestion(\n $session_id, $question_id);\n switch($type) {\n case \"checkbox\": \n case \"combo-check\": \n if(isset($answer) && $answer) {\n # answered, print one selected and the rest unselected\n foreach($question[\"options\"] as $option) {\n $optionId = $option[\"id\"];\n if(array_key_exists($optionId, $answer)) {\n if ($answer[$optionId] != null){\n // combo-check\n $answers[] = $answer[$optionId]; \n }\n else {\n $answers[] = self::SELECTED_CHECK;\n }\n } else {\n $answers[] = self::UNSELECTED_CHECK;\n }\n }\n\n } else {\n # not answered, print all as skipped\n $options = count($question[\"options\"]);\n for($i=0;$i<$options;$i++) {\n $answers[] = self::SKIPPED;\n }\n }\n break;\n case \"textbox\":\n if(isset($answer) && $answer || $answer === 0) {\n $answer = $this->cleanTextForCSV($answer);\n $answers[] = $answer;\n } else {\n $answers[] = self::SKIPPED;\n }\n break;\n default:\n if(isset($answer) && \n ($answer || (intval($answer) === 0))) {\n $answers[] = $answer;\n } else {\n $answers[] = self::SKIPPED;\n }\n break;\n }\n }\n return $answers;\n }", "public function setIsSingleLineQuestion($val)\n {\n $this->_propDict[\"isSingleLineQuestion\"] = boolval($val);\n return $this;\n }" ]
[ "0.71808535", "0.6398456", "0.5454477", "0.5411457", "0.5212171", "0.51451576", "0.5017838", "0.5017454", "0.49396756", "0.4935641", "0.47305688", "0.46862605", "0.4663734", "0.46194687", "0.4579577", "0.45728096", "0.4560448", "0.45419344", "0.45128736", "0.44902837", "0.44810385", "0.44498014", "0.44480115", "0.44444034", "0.44337982", "0.44119996", "0.44075015", "0.44074082", "0.4402771", "0.4396022", "0.438824", "0.43735787", "0.43578923", "0.43566325", "0.43417686", "0.43283904", "0.4316134", "0.43099174", "0.4308436", "0.4294618", "0.42838922", "0.4280908", "0.42805624", "0.4271889", "0.42619583", "0.42562875", "0.4252818", "0.42495194", "0.42444116", "0.4243068", "0.42379525", "0.42363048", "0.4224629", "0.42191246", "0.42154163", "0.42036265", "0.4200171", "0.41848475", "0.41844225", "0.41816226", "0.41686523", "0.41623807", "0.41600963", "0.41596538", "0.41595072", "0.4158304", "0.4154487", "0.4152329", "0.41374317", "0.41315395", "0.41309792", "0.41234788", "0.41173145", "0.4116725", "0.41076475", "0.40952164", "0.4089672", "0.40891355", "0.40867192", "0.40818578", "0.40789983", "0.4077675", "0.40775433", "0.4065742", "0.40644008", "0.40631804", "0.40535015", "0.40465894", "0.4034258", "0.4032591", "0.40297014", "0.4017525", "0.40155193", "0.40151155", "0.40141776", "0.40137547", "0.4010956", "0.400909", "0.40077657", "0.40077567" ]
0.78811735
0
Answer configuration for location question. If true, campaign/account level location data (state, city, business name etc) will be rendered on the Lead Form. Starting V13.1, has_location_answer can only be set for "What is your preferred dealership?" question, for advertisers with Location Assets setup at campaign/account level. Generated from protobuf field bool has_location_answer = 3;
Настройка ответа для вопроса о местоположении. Если значение истинно, данные о местоположении на уровне кампании/счета (штат, город, название бизнеса и т.д.) будут отображаться в форме контакта. Начиная с V13.1, параметр has_location_answer может быть задан только для вопроса "Какой дилер вам предпочтителен?", для рекламодателей, у которых на уровне кампании/счета настроены местные активы. Сгенерировано из поля protobuf bool has_location_answer = 3;
public function getHasLocationAnswer() { return $this->readOneof(3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setHasLocationAnswer($var)\n {\n GPBUtil::checkBool($var);\n $this->writeOneof(3, $var);\n\n return $this;\n }", "public function hasLocation(): bool\n {\n return isset($this->location);\n }", "public function hasLocation(){\n return $this->_has(4);\n }", "public function hasLocation()\n {\n return !is_null($this->location);\n }", "private function _isValidLocation()\n {\n //echo dp_text(\"_isValidLocation: checking location \\\"%s\\\"\\n\",\n // !isset($this->__GET['location']) ? '' : $this->__GET['location']);\n if (isset($this->__GET['location'])\n && !dp_strlen($this->__GET['location'])) {\n return TRUE;\n }\n\n if (!isset($this->__GET['location'])) {\n return isset($this->__GET['getdivs']);\n }\n\n if (FALSE !== dp_strpos($this->__GET['location'], '..')) {\n return FALSE;\n }\n\n if (FALSE !== ($pos = dp_strpos($this->__GET['location'], '?'))) {\n $this->__GET['location'] =\n dp_substr($this->__GET['location'], 0, $pos);\n }\n\n if (FALSE !== ($pos = dp_strpos($this->__GET['location'], '#'))) {\n $this->__GET['location'] =\n dp_substr($this->__GET['location'], 0, $pos);\n }\n\n /* Experimental */\n if (isset($this->__GET['proxy'])\n || 0 === dp_strpos($this->__GET['location'], '/mailman2/')) {\n return TRUE;\n }\n\n if (($len = dp_strlen(DPSERVER_HOST_URL))\n < dp_strlen($this->__GET['location'])\n && DPSERVER_HOST_URL === dp_substr($this->__GET['location'], 0,\n $len)) {\n return TRUE;\n }\n return (file_exists(DPUNIVERSE_PREFIX_PATH . $this->__GET['location'])\n && is_file(DPUNIVERSE_PREFIX_PATH . $this->__GET['location']))\n || (file_exists(DPUNIVERSE_WWW_PATH . $this->__GET['location'])\n && is_file(DPUNIVERSE_WWW_PATH . $this->__GET['location']));\n }", "public function hasMultipleLocations()\n {\n return $this->multiple_locations ?: false;\n }", "public function locationPref()\n {\n return $this->location_pref;\n }", "public static function get_location_details_definition() {\n return [\n 'title' => 'View details of a location',\n 'category' => 'Utilities',\n 'description' => 'A summary view of a location with commenting capability. Pass a parameter in the URL called location_id to define which occurrence to show.',\n 'helpLink' => 'https://indicia-docs.readthedocs.io/en/latest/site-building/iform/prebuilt-forms/location-details.html',\n 'supportsGroups' => TRUE,\n 'recommended' => TRUE,\n ];\n }", "public function supportsLocation()\n {\n }", "function _location_us_enough_fields_for_yahoo($location) {\n // link to yahoo directions. If all of these fields don't have values, then we generate\n // a link to the *form* for Yahoo! driving directions rather than directly to the driving\n // directions themselves.\n if (strlen($location['street']) && strlen($location['city']) && strlen($location['province'])) {\n return TRUE;\n }\n\n if (strlen($location['street']) && strlen($location['postal_code'])) {\n return TRUE;\n }\n\n if (strlen($location['street']) && strlen($location['city']) && strlen($location['province'])) {\n return TRUE;\n }\n\n return FALSE;\n}", "function acf_validate_location_rule($rule = \\false) {}", "public function checkLocation()\n\t{\n\t\tif (false === $this->checkLocationNPCs())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t# Validate lang file\n// \t\t$player = Shadowrun4::getDummyPlayer();\n// \t\t$this->getEnterText($player);\n// \t\t$this->getHelpText($player);\n// \t\t$this->getFoundText($player);\n// \t\t$this->getName();\n\t\t\n\t\treturn true;\n\t}", "public function single_location_settings() {\n\t\t\tWPSEO_Local_Admin_Page::section_before( 'single-location-settings', 'clear: both; ' . ( wpseo_has_multiple_locations() ? 'display: none;' : '' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_name', __( 'Business name', 'yoast-local-seo' ) );\n\n\t\t\tWPSEO_Local_Admin_Wrappers::select( 'business_type', __( 'Business type', 'yoast-local-seo' ), $this->wpseo_local_core->get_local_business_types() );\n\t\t\techo '<p class=\"desc label\" style=\"border:none; margin-bottom: 0;\">' . sprintf( __( 'If your business type is not listed, please read %sthe FAQ entry%s.', 'yoast-local-seo' ), '<a href=\"http://kb.yoast.com/article/49-my-business-is-not-listed-can-you-add-it\" target=\"_blank\">', '</a>' ) . '</p>';\n\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_address', __( 'Business address', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_address_2', __( 'Business address line 2', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_city', __( 'Business city', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_state', __( 'Business state', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_zipcode', __( 'Business zipcode', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::select( 'location_country', __( 'Business country', 'yoast-local-seo' ), WPSEO_Local_Frontend::get_country_array() );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_phone', __( 'Business phone', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_phone_2nd', __( '2nd Business phone', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_fax', __( 'Business fax', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_email', __( 'Business email', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_url', __( 'URL', 'yoast-local-seo' ), '', array( 'placeholder' => wpseo_xml_sitemaps_base_url( '' ) ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_vat_id', __( 'VAT ID', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_tax_id', __( 'Tax ID', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_coc_id', __( 'Chamber of Commerce ID', 'yoast-local-seo' ) );\n\n\t\t\techo '<p>' . __( 'You can enter the lat/long coordinates yourself. If you leave them empty they will be calculated automatically. If you want to re-calculate these fields, please make them blank before saving this location.', 'yoast-local-seo' ) . '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_coords_lat', __( 'Latitude', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_coords_long', __( 'Longitude', 'yoast-local-seo' ) );\n\n\t\t\tWPSEO_Local_Admin_Page::section_after(); // End show-single-locaton section.\n\t\t}", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function it_can_return_a_location_when_a_location_is_searched()\n {\n return;\n $this->setKey(self::API_KEY);\n $this->location(self::LOCATION)->shouldReturnAnInstanceOf(Location::class);\n }", "public function setLocation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dlp\\V2beta1\\Location::class);\n $this->location = $var;\n\n return $this;\n }", "public function hasLocations(){\n return $this->_has(8);\n }", "public static function field_location_avimayeur(){\n $location = esc_attr(get_option('location'));\n ?>\n <input type=\"text\"\n id=\"location\"\n name=\"location\"\n value=\"<?php echo $location ?>\"\n class=\"regular-text\"\n />\n <?php\n }", "public function willFollowLocation() {\n return $this->followLocation;\n }", "public function isSatisfiedBy(Answer $answer): bool;", "public function isSatisfiedBy(Answer $answer): bool;", "public function setCorrectAnswer(AnswerInterface $answer);", "function add_answer($answer_text,$correct,$comment,$ponderation,$position,$hotspot_coordinates,$hotspot_type)\n\t{\n\t\t$answer = array();\n\t\t$answer['answer'] = $answer_text;\n\t\t$answer['correct'] = $correct;\n\t\t$answer['comment'] = $comment;\n\t\t$answer['ponderation'] = $ponderation;\n\t\t$answer['position'] = $position;\n\t\t$answer['hotspot_coordinates'] = $hotspot_coordinates;\n\t\t$answer['hotspot_type'] = $hotspot_type;\n\t\t$this->answers[] = $answer;\n\t}", "public function setPlaquesGeoloc($input = '')\n\t {\n\t \t$this->plaquesGeoloc = $input;\n\t }", "public static function invalidDirectionsRequestProvideRouteAlternatives()\n {\n return new static('The directions request provide route alternatives flag must be a boolean value.');\n }", "public function setResponseLocation($responseLocation)\n {\n $this->responseLocation = $responseLocation;\n return $this;\n }", "protected function add_sample_answer_field($mform) {\n $mform->addElement('header', 'answerhdr',\n get_string('answer', 'qtype_coderunner'), '');\n $mform->setExpanded('answerhdr', 1);\n $mform->addElement('textarea', 'answer',\n get_string('answer', 'qtype_coderunner'),\n array('rows' => 9, 'class' => 'answer edit_code'));\n $mform->addElement('advcheckbox', 'validateonsave', null,\n get_string('validateonsave', 'qtype_coderunner'));\n $mform->setDefault('validateonsave', false);\n $mform->addHelpButton('answer', 'answer', 'qtype_coderunner');\n }", "public function setAnswer($answer)\n\t\t{\n\t\t\treturn $this->answer = (strlen($answer) > 0) ? $answer : $this->getDefault();\n\t\t}", "function mfcs_get_request_field_location($form, &$form_state, &$fields, &$request_state, $ps) {\n $values = array(0 => NULL);\n if (!empty($request_state['location'])) {\n $values = $request_state['location'];\n }\n\n // do not allow certain fields to be editable when a request is completed, even by admins (in this case there is a move operation to change location, building, and room).\n $readonly = FALSE;\n if (isset($form['form']['operation']['#value']) && $form['form']['operation']['#value'] === 'edit' && isset($form['form']['existing']['#value'])) {\n if (isset($form['form']['existing']['#value']['request']['step'][0]) && is_numeric($form['form']['existing']['#value']['request']['step'][0])) {\n if ((int)$form['form']['existing']['#value']['request']['step'][0] === MFCS_REVIEW_STEP_COMPLETED) {\n $readonly = TRUE;\n }\n }\n }\n\n $form['form']['operation'] = array(\n '#type' => 'value',\n '#value' => 'create',\n );\n\n $field_title = 'Please indicate the requested facility or request location?';\n $limits_check = array(\n 'title' => $field_title,\n 'field' => 'location',\n 'group' => 'top',\n 'path' => 'location',\n 'visible' => FALSE,\n 'ps' => $ps,\n );\n\n $form_state['conditionally_required'][3][] = &$limits_check;\n\n if ($form['form']['step']['#value'] == 'location' && array_key_exists('information', $form['form']['sections']['#value'])) {\n $fields['location'] = array(\n '#id' => 'field-request-location',\n '#type' => 'container',\n '#tree' => TRUE,\n '#attributes' => array(\n 'class' => array(\n 'form-item-wrapper',\n 'field-request-item',\n 'field-request-item-location',\n ),\n ),\n );\n\n global $base_path;\n $module_path = drupal_get_path('module', 'mfcs');\n\n drupal_add_js($module_path . '/js/images-locations.js', array('type' => 'file', 'group' => JS_DEFAULT, 'preprocess' => TRUE));\n\n $list_options = mfcs_get_request_location_list_options('radios');\n\n $user = cf_current_user();\n $is_venue_coordinator = mfcs_is_venue_coordinator_or_room_coordinator($user->uid);\n if ($is_venue_coordinator) {\n $list_options[MFCS_BANNER_LOCATION_VENUE_COORDINATOR] = 'Your Rooms as Venue Coordinator';\n }\n\n foreach ($values as $key => $value) {\n $fields['location'][$key] = array(\n '#id' => 'field-request-location-' . $key,\n '#type' => 'radios',\n '#title' => '<span class=\"strong underline\">' . $field_title . '</span>',\n '#options' => $list_options,\n '#default_value' => $value,\n '#required' => TRUE,\n '#attributes' => array(\n 'class' => array(\n 'form-item-delta',\n 'form-item-delta-' . $key,\n ),\n ),\n '#description' => 'If you are unsure of which location to choose, then please contact the administration or your adviser.',\n );\n\n if ($readonly) {\n $fields['location'][$key]['#disabled'] = TRUE;\n $fields['location'][$key]['#attributes']['readonly'] = 'readonly';\n }\n }\n krsort($fields['location']);\n\n $form_state['conditionally_required'][0][] = 'location';\n\n $fields['location'][0]['location-images'] = array(\n '#tree' => TRUE,\n );\n\n $fields['location'][0]['location-images'][0] = array();\n $fields['location'][0]['location-images'][1] = array();\n\n $fields['location'][0]['location-images'][0]['#markup'] = '<a href=\"//www.mcneese.edu/node/5530\" class=\"location-image-link\" title=\"View Campus Map\" target=\"_blank\"><img id=\"field-request-location-0-image-0\" src=\"' . $base_path . $module_path . '/images/example-map.png\" alt=\"Campus Map\" class=\"location-image location-image-visible noscript\"></a>';\n $fields['location'][0]['location-images'][1]['#markup'] = '<a href=\"//www.mcneese.edu/node/5530\" class=\"location-image-link\" title=\"View Campus Map\" target=\"_blank\"><img id=\"field-request-location-0-image-1\" src=\"' . $base_path . $module_path . '/images/example-seed.png\" alt=\"Campus Map, SEED Center\" class=\"location-image location-image-invisible noscript\"></a>';\n\n $limits_check['visible'] = TRUE;\n }\n else {\n foreach ($values as $key => $value) {\n $fields['location'][$key] = array(\n '#id' => 'field-request-location-' . $key,\n '#type' => 'value',\n '#value' => $value,\n );\n }\n }\n\n return $values;\n}", "public function isAnswered()\n {\n return $this->answered;\n }", "private function set_phrase_answered_correctly() {\n\n // set state off response, if it's there\n if(isset($this->response['phrase_answered_correctly'])) {\n $phrase_answered_correctly = $this->response['phrase_answered_correctly'];\n }\n // try to set the state from the cookie\n elseif(isset($_COOKIE['phrase_ac'])) {\n $phrase_answered_correctly = $_COOKIE['phrase_ac'];\n }\n // probably a new assessment\n else {\n $phrase_answered_correctly = 0;\n }\n\n $this->phrase_answered_correctly = $phrase_answered_correctly;\n }", "public function section_location( $event = null ) {\n\n\t\t// Location\n\t\t$location = $event->location;\n\n\t\t// Start an output buffer\n\t\tob_start(); ?>\n\n\t\t<table class=\"form-table rowfat\">\n\t\t\t<tbody>\n\n\t\t\t\t<?php if ( apply_filters( 'sugar_calendar_location', true ) ) : ?>\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<label for=\"location\"><?php esc_html_e( 'Location', 'sugar-calendar' ); ?></label>\n\t\t\t\t\t\t</th>\n\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<textarea name=\"location\" id=\"location\" placeholder=\"<?php esc_html_e( '(Optional)', 'sugar-calendar' ); ?>\"><?php echo esc_textarea( $location ); ?></textarea>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\n\t\t\t\t<?php endif; ?>\n\t\t\t</tbody>\n\t\t</table>\n\n\t\t<?php\n\n\t\t// End & flush the output buffer\n\t\techo ob_get_clean();\n\t}", "public function multiple_locations_settings() {\n\t\t\tWPSEO_Local_Admin_Page::section_before( 'multiple-locations-settings', 'clear: both; ' . ( wpseo_has_multiple_locations() ? '' : 'display: none;' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_slug', __( 'Locations slug', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The slug for your location pages. Default slug is <code>locations</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\tif ( wpseo_has_multiple_locations() ) {\n\t\t\t\techo '<a href=\"' . get_post_type_archive_link( 'wpseo_locations' ) . '\" target=\"_blank\">' . __( 'View them all', 'yoast-local-seo' ) . '</a> ' . __( 'or', 'yoast-local-seo' ) . ' <a href=\"' . admin_url( 'edit.php?post_type=wpseo_locations' ) . '\">' . __( 'edit them', 'yoast-local-seo' ) . '</a>';\n\t\t\t}\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_label_singular', __( 'Locations label singular', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The singular label for your location pages. Default label is <code>Location</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_label_plural', __( 'Locations label plural', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The plural label for your location pages. Default label is <code>Locations</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_taxo_slug', __( 'Locations category slug', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The slug for your location categories. Default slug is <code>locations-category</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\tif ( wpseo_has_multiple_locations() ) {\n\t\t\t\techo '<a href=\"' . admin_url( 'edit-tags.php?taxonomy=wpseo_locations_category&post_type=wpseo_locations' ) . '\">' . __( 'Edit the categories', 'yoast-local-seo' ) . '</a>';\n\t\t\t}\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Page::section_after();\n\t\t}", "public function getIsLocationOnline()\n {\n if (array_key_exists(\"isLocationOnline\", $this->_propDict)) {\n return $this->_propDict[\"isLocationOnline\"];\n } else {\n return null;\n }\n }", "public function followLocation($followLocation)\n {\n $this->followLocation = (bool) $followLocation;\n }", "public function isUserAnswerIsCorrect();", "public function getHasFacilityLocation()\n {\n return $this->hasFacilityLocation;\n }", "function ul_user_is_location( $user = '' ) {\n\tif ( empty($user) ) {\n\t\tif ( current_user_can('edit_location_pages') && ! current_user_can('edit_others_posts') ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\telseif ( user_can( $user, 'edit_location_pages' ) && ! user_can( $user, 'edit_others_posts' ) ) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function setAnswer(Answer $answer) {\n $this->answer = $answer;\n }", "private function checkLocationNPCs()\n\t{\n\t\t# Dummy player\n\t\t$player = Shadowrun4::getDummyPlayer();\n\t\t\n\t\t# Validate talking NPCs\n\t\tforeach ($this->getNPCS($player) as $tt => $classname)\n\t\t{\n\t\t\tif (false === ($npc = Shadowrun4::getNPC($classname)))\n\t\t\t{\n\t\t\t\tdie(sprintf('Location %s is missing talking NPC %s.', $this->getName(), $classname));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function completePopulationAnswer(\\Application\\Model\\Answer $answer = null)\n {\n $isAbsolute = $answer && $answer->getQuestion() instanceof \\Application\\Model\\Question\\NumericQuestion && $answer->getQuestion()->isAbsolute();\n\n if ($isAbsolute) {\n $computing = \"value_percent = value_absolute / p.population\";\n } else {\n $computing = \"value_absolute = p.population * value_percent\";\n }\n\n if ($answer) {\n $whereClause = 'answer.id = ' . $answer->getId();\n } else {\n $whereClause = 'question.is_absolute = FALSE';\n }\n\n $sql = sprintf('UPDATE answer\n JOIN questionnaire q ON (answer.questionnaire_id = q.id)\n JOIN survey s ON (q.survey_id = s.id)\n JOIN geoname g ON (q.geoname_id = g.id)\n JOIN population p ON (p.geoname_id = g.id AND s.year = p.year)\n JOIN question ON (s.id = question.survey_id)\n SET %s\n WHERE %s\n AND answer.part_id = p.part_id\n AND answer.question_id = question.id\n AND question.is_population = TRUE', $computing, $whereClause);\n\n return $this->getEntityManager()->getConnection()->executeUpdate($sql);\n }", "function em_is_location_page(){\r\n\treturn em_get_page_type() == 'location';\r\n}", "public function add_answer(\n $answer_id,\n $answer_text,\n $correct,\n $comment,\n $ponderation,\n $position,\n $hotspot_coordinates,\n $hotspot_type\n ) {\n $answer = array();\n $answer['id'] = $answer_id;\n $answer['answer'] = $answer_text;\n $answer['correct'] = $correct;\n $answer['comment'] = $comment;\n $answer['ponderation'] = $ponderation;\n $answer['position'] = $position;\n $answer['hotspot_coordinates'] = $hotspot_coordinates;\n $answer['hotspot_type'] = $hotspot_type;\n $this->answers[] = $answer;\n }", "public function BMLTPlugin_map_search_location_options(\n $in_options_id, ///< The ID for the options to use for this implementation.\n $in_uid ///< This is the UID of the enclosing div.\n ) {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $ret = '<div class=\"bmlt_map_container_div_location_options_div\" id=\"'.$in_uid.'_location\">';\n $ret .= '<div class=\"bmlt_map_options_loc\">';\n $ret .= '<a class=\"bmlt_map_reveal_options\" id=\"'.$in_uid.'_options_loc_a\" href=\"javascript:var a=document.getElementById(\\''.$in_uid.'_options_loc_a\\');var b=document.getElementById(\\''.$in_uid.'_options_loc\\');if(b &amp;&amp; a){if(b.style.display==\\'none\\'){a.className=\\'bmlt_map_hide_options\\';b.style.display=\\'block\\';c_ms_'.$in_uid.'.openLocationSectionExt(document.getElementById(\\''.$in_uid.'_location_text\\'), document.getElementById(\\''.$in_uid.'_location_submit\\'));}else{a.className=\\'bmlt_map_reveal_options\\';b.style.display=\\'none\\';};};c_ms_'.$in_uid.'.recalculateMapExt()\"><span>'.$this->process_text($this->my_current_language->local_new_map_option_loc_label).'</span></a>';\n $ret .= '<div class=\"bmlt_map_container_div_search_options_div\" id=\"'.$in_uid.'_options_loc\" style=\"display:none\">';\n $ret .= '<form action=\"#\" method=\"get\" onsubmit=\"c_ms_'.$in_uid.'.lookupLocationExt(document.getElementById(\\''.$in_uid.'_location_text\\'), document.getElementById(\\''.$in_uid.'_location_submit\\'));return false\">';\n $ret .= '<fieldset class=\"bmlt_map_container_div_search_options_div_location_fieldset\">';\n $ret .= '<div class=\"location_radius_popup_div\">';\n $ret .= '<label for=\"\">'.$this->process_text($this->my_current_language->local_new_map_option_loc_popup_label_1).'</label>';\n $ret .= '<select class=\"bmlt_map_location_radius_popup\" id=\"'.$in_uid.'_radius_select\" onchange=\"c_ms_'.$in_uid.'.changeRadiusExt(true)\">';\n $ret .= '<option value=\"\" selected=\"selected\">'.$this->process_text($this->my_current_language->local_new_map_option_loc_popup_auto).'</option>';\n $ret .= '<option value=\"\" disabled=\"disabled\"></option>';\n $options = $this->getBMLTOptions_by_id($in_options_id);\n $this->adapt_to_lang($options['lang']);\n foreach ($this->my_current_language->local_new_map_js_diameter_choices as $radius) {\n $ret .= '<option value=\"'.($radius / 2).'\">'.($radius / 2).' '.$this->process_text((strtolower($options['distance_units']) == 'km') ? $this->my_current_language->local_new_map_option_loc_popup_km : $this->my_current_language->local_new_map_option_loc_popup_mi).'</option>';\n }\n $ret .= '</select>';\n $ret .= '<label for=\"\">'.$this->process_text($this->my_current_language->local_new_map_option_loc_popup_label_2).'</label>';\n $ret .= '</div>';\n $ret .= '<fieldset class=\"location_text_entry_fieldset\">';\n $ret .= '<legend>'.$this->process_text($this->my_current_language->local_new_map_text_entry_fieldset_label).'</legend>';\n $def_text = $this->process_text($this->my_current_language->local_new_map_text_entry_default_text);\n $ret .= '<div class=\"location_text_input_div\">';\n $ret .= '<input type=\"text\" class=\"location_text_input_item_blurred\" value=\"'.$def_text.'\" id=\"'.$in_uid.'_location_text\" onfocus=\"c_ms_'.$in_uid.'.focusLocationTextExt(this, document.getElementById(\\''.$in_uid.'_location_submit\\'), false)\" onblur=\"c_ms_'.$in_uid.'.focusLocationTextExt(this, document.getElementById(\\''.$in_uid.'_location_submit\\'), true)\" onkeyup=\"c_ms_'.$in_uid.'.enterTextIntoLocationTextExt(this, document.getElementById(\\''.$in_uid.'_location_submit\\'))\" />';\n $ret .= '</div>';\n $ret .= '<div class=\"location_text_submit_div\">';\n $ret .= '<input type=\"button\" disabled=\"disabled\" class=\"location_text_submit_button\" value=\"'.$this->process_text($this->my_current_language->local_new_map_location_submit_button_text).'\" id=\"'.$in_uid.'_location_submit\" onclick=\"c_ms_'.$in_uid.'.lookupLocationExt(document.getElementById(\\''.$in_uid.'_location_text\\'), this)\" />';\n $ret .= '</div>';\n $ret .= '</fieldset>';\n $ret .= '</fieldset>';\n $ret .= '</form>';\n $ret .= '</div>';\n $ret .= '</div>';\n $ret .= '</div>';\n return $ret;\n }", "function setLocation($location) {\n\t\treturn $this->setData('location', $location);\n\t}", "public function sendLocation($chatId, $latitude, $longitude, $replyToMessageId = null, JsonSerializable $ReplyMarkUp = null);", "public function useGeolocation(): bool\n\t{\n\t\treturn true;\n\t}", "public function location($strLocation = NULL, $iLocationLat = NULL, $iLocationLong = NULL) {\n\t\t\tif (!is_null($strLocation)) $this->strLocation = $strLocation; \n\t\t\tif (!is_null($iLocationLat)) $this->iLocationLat = $iLocationLat;\n\t\t\tif (!is_null($iLocationLong)) $this->iLocationLong = $iLocationLong; \n\t\t\tif (is_null($this->strLocation)) $this->load();\n\t\t\treturn $this->visible4me(\"location\") ? $this->strLocation : \"\"; \n\t\t}", "public function getNeedAnswer(): ?bool {\n return $this->needAnswer;\n }", "private function set_answered_correctly() {\n\n\t\t// set state off response, if it's there\n\t\tif(isset($this->response['answered_correctly'])) {\n\t\t\t$answered_correctly = $this->response['answered_correctly'];\n\t\t}\n\t\t// try to set the state from the cookie\n\t\telseif(isset($_COOKIE['ac'])) {\n\t\t\t$answered_correctly = $_COOKIE['ac'];\n\t\t}\n\t\t// probably a new assessment\n\t\telse {\n\t\t\t$answered_correctly = 0;\n\t\t}\n\n\t\t$this->answered_correctly = $answered_correctly;\n\t}", "protected function locationDisplay() {\n\t\t\tif (isset($this->user[\"user_disLocation\"][0])) {\n\t\t\t\t\n\t\t\t\tif ($this->user[\"user_disLocation\"][0] == 1) {\n\t\t\t\t\t\n\t\t\t\t\t$in[\"city\"] = $this->user[\"user_city\"][0];\n\t\t\t\t\t$in[\"state\"] = $this->user[\"user_state\"][0];\n\t\t\t\t\t$country = ($this->user[\"user_country\"][0] == \"United States\") ? null : $this->user[\"user_country\"][0];\n\t\t\t\t\t\n\t\t\t\t\t// If Country is not Null\n\t\t\t\t\tif ($country != null) {\n\t\t\t\t\t\n\t\t\t\t\t\t$in[\"country\"] = $country;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$location = implode(\", \", $in);\n\t\t\t\t\t\n\t\t\t\t\treturn $location;\n\t\t\t\t\n\t\t\t\t// User Display Name is off\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\treturn null;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t// User image display was not loaded; return null\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn null;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "protected function define_answers_section()\n {\n // defines the list of params to represents the answer\n $this->add_per_answer_fields($this->_form, \"\", question_bank::fraction_options_full(), 0);\n }", "public function hasLongitude()\n {\n return isset($this->longitude);\n }", "public function definition() {\n //defined global parameter\n global $CFG, $DB;\n \n // Form initial\n $mform =& $this->_form;\n \n // Get outside values when the coordinatoredit.php call function to new this form\n $id = $this->_customdata['id'];\n $locid = $this->_customdata['locid'];\n $relocid = $this->_customdata['relocid'];\n $filterlocid = 0;\n \n // When user made one or multiple wrong choosen for this page, show this string to them\n $strrequired = get_string('required');\n\n //var_dump('form = ' . $locid);\n //echo('</br>');\n\n // Create an invisible textbox field\n $mform->addElement('hidden', 'id', $id);\n $mform->setType('id', PARAM_RAW);\n \n // Create an invisible textbox field\n $mform->addElement('hidden', 'locationid', $locid);\n $mform->setType('locationid', PARAM_RAW);\n \n // when we press the edit hyperlink in the coordinatorlist_index.php, we can get the location id from urls(I have been hard code in the hyperlink)\n // but in the edit page, we need the form to pass the right location id to redirect us to right location page after we press the cancel button\n if(!$relocid) {\n $locationsql = \"SELECT lal.id, lal.name\n FROM {local_adsafe_location} lal\n WHERE lal.id = $locid\";\n $locationfields = $DB->get_records_sql($locationsql);\n } else {\n $locationsql = \"SELECT lal.id, lal.name\n FROM {local_adsafe_location} lal\n WHERE lal.id = $relocid\";\n $locationfields = $DB->get_records_sql($locationsql);\n }\n $storefield = new stdClass();\n foreach($locationfields as $field) { //convert sql record to an object\n $storefield->id = $field->id;\n $storefield->name = $field->name;\n }\n // Disable the location field, basically we are editing the user in this location without change it\n $mform->addElement('text', 'locationname', get_string('location', 'local_adsafe'),\n array('size' => 50, 'disabled' => 'disabled'));\n $mform->setType('locationname', PARAM_RAW);\n $mform->setDefault('locationname', $storefield->name);\n \n // get all the user from user table\n $namemenu = array('0' => get_string('selectamember', 'local_adsafe'));\n //$storefield->id\n if(!$relocid) {\n $filterlocid = $locid;\n } else {\n $filterlocid = $relocid;\n }\n $namesql = \"SELECT lam.userid, CONCAT(u.lastname,', ',u.firstname)\n FROM {local_adsafe_member} lam\n JOIN {user} u\n ON lam.userid = u.id\n WHERE lam.locationid = $filterlocid\n AND lam.activated = 1\n ORDER BY 2\";\n /*$namesql = \"SELECT u.id,CONCAT(u.lastname,', ',u.firstname)\n FROM {user} u\n ORDER BY 2\";*/\n if($getnameidfields = $DB->get_records_sql_menu($namesql,null)){\n foreach($getnameidfields as $getid => $getname) {\n $namemenu[\"$getid\"] = $getname; // put the user id and name into an array\n }\n }\n \n // put all user in the Name drop-down box\n $nameselect = $mform->addElement('select', 'userid', get_string('member', 'local_adsafe'), $namemenu);\n $mform->addRule('userid', $strrequired, 'required', null, 'client');\n $mform->setType('userid', PARAM_RAW);\n $nameselect->setSelected(0); // new user will show select an username\n \n $mform->addElement('date_selector', 'starttime', get_string('starttime', 'local_adsafe'));\n $mform->addRule('starttime', $strrequired, 'required', null, 'client');\n \n // tickbox function for endtime of date_selector\n $testarr = array('startyear' => 1970, 'timezone' => 99, 'optional' => true);\n $mform->addElement('date_selector', 'endtime', get_string('endtime', 'local_adsafe'),$testarr);\n //$mform->addRule('endtime', $strrequired, 'required', null, 'client');\n\n // if editing the user of coordinator page $id reutrn true\n // pre-loading the user information\n if ($id) {\n $coosql = \"SELECT lac.*\n FROM mdl_local_adsafe_coordinators lac\n WHERE lac.id = :id\";\n $coordinatordetails = $DB->get_records_sql($coosql, array('id' => $id));\n foreach ($coordinatordetails as $cds) {\n $mform->setDefault('locid', $cds->locationid);\n $nameselect->setSelected($cds->userid);\n $mform->setDefault('starttime', $cds->starttime);\n $mform->setDefault('endtime', $cds->endtime);\n }\n }\n //put save and cancel buttons in same group\n //$mform->addElement('html', \"<div class=memlstgup align=center>\");\n $buttonarray = array();\n $buttonarray[] = &$mform->createElement('submit', 'save', get_string('save', 'local_adsafe'));\n $buttonarray[] = &$mform->createElement('cancel', 'cancel', get_string('cancel', 'local_adsafe'));\n $mform->addGroup($buttonarray, 'buttomem', '&nbsp;', array(''), false);\n //$mform->addElement('html', \"</div>\");\n }", "private function set_application_answered_correctly() {\n\n // set state off response, if it's there\n if(isset($this->response['application_answered_correctly'])) {\n $application_answered_correctly = $this->response['application_answered_correctly'];\n }\n // try to set the state from the cookie\n elseif(isset($_COOKIE['application_ac'])) {\n $application_answered_correctly = $_COOKIE['application_ac'];\n }\n // probably a new assessment\n else {\n $application_answered_correctly = 0;\n }\n\n $this->application_answered_correctly = $application_answered_correctly;\n }", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "private function _getLocation()\n {\n //echo \"_getLocation()... \";\n if (FALSE === $this->_isValidLocation()) {\n //echo \"Not valid location\\n\";\n $tmp = $this->mrUser->getEnvironment();\n if (isset($this->__GET['method']) && FALSE !== $tmp) {\n $this->__GET['location'] = $tmp->location;\n $this->__GET['sublocation'] = $tmp->sublocation;\n } elseif (isset($this->mrUser->_GET['proxy'])\n || (FALSE !== $tmp && (isset($this->mrUser->_GET['ajax'])\n || isset($this->__GET['method']))\n && isset($tmp->isLayered) && FALSE !== $tmp->isLayered)) {\n $this->__GET['location'] = $tmp->location;\n } else {\n $this->__GET['location'] = DPUNIVERSE_PAGE_PATH . 'index.php';\n }\n } else {\n //echo \"Valid location\\n\";\n }\n }", "public function getLocationDisabled()\n {\n if (array_key_exists(\"locationDisabled\", $this->_propDict)) {\n return $this->_propDict[\"locationDisabled\"];\n } else {\n return null;\n }\n }", "public function getLocation()\r\r\n {\r\r\n return $this->location;\r\r\n }", "function markAnswer ($answer)\n {\n\tglobal $debug;\n \t//if ($debug) { print \"This answer $answer \\n\";}\n \t// radio / checkbox - answer must be same as \n \tif ($this->type == 'radio' || $this->type == 'checkbox')\n \t{\n \t\tif ($answer == $this->answer) {return true;}\n \t\telse {return false;}\n \t}\n \telseif ($this->type == 'number')\n \t{\n \t\t// split answer into min max\n \t\t$min_max = explode (',', $this->answer);\n \t\tif ($answer >= $min_max[0] && $answer <= $min_max[1]) {return true;}\n \t\telse {return false;}\n \t}\n \telseif ($this->type == 'text')\n \t{\n \t\t// note that ¬ is used instead of / / in the search - otherwise problems with paths in the question (eg. linux quiz)\n \t\t//$answer_test = stripslashes($this->answer); \n \t\t//$answer_test = addslashes($this->answer);\n \t\t$answer_test = $this->answer;\n \t\tif (isset($debug) && $debug == true) {print \"Test: \".'¬^'.$answer_test.'$¬i'.\"<br />\\n\"; print \"Answer $answer<br />\\n\";}\n \t\tif (preg_match('¬^'.$answer_test.'$¬i', $answer)) {return true;}\n \t\telse {return false;}\n \t}\n \t// as text, but without ignore case\n \telseif ($this->type == 'TEXT')\n \t{\n \t\tif (preg_match('¬^'.$this->answer.'$¬', $answer)) {return true;}\n \t\telse {return false;}\n \t}\n \t// invalid type\n \telse \n \t{\n \t\t// error in question configuration\n \t\t$err = Errors::getInstance();\n \t\t$err->errorEvent(WARNING_QUESTION, \"Warning, unknown question type for $this->questionid\");\n \t\treturn false;\n \t} \n \t\n }", "function has_location() { \n\n global $post;\n $geo = GeoPress::get_geo($post->ID);\n if($geo)\n return true;\n else\n return false;\n}", "function getLocation() {\n if (!$this->location) {\n $this->location = (new LocationBuilder($this));\n }\n\n return $this->location;\n }", "protected function define_answer_options_properties_section()\n {\n global $PAGE, $OUTPUT;\n $mform = $this->_form;\n\n // header\n $mform->addElement('header', 'answeroptionspropertiesheader',\n get_string(\"answer_options_properties\", 'qtype_omerocommon'));\n\n // selector to allow single or multi answers\n $menu = array(\n get_string('answersingleno', 'qtype_omerocommon'),\n get_string('answersingleyes', 'qtype_omerocommon'),\n );\n $mform->addElement('select', 'single',\n get_string('answerhowmany', 'qtype_omerocommon'), $menu);\n $mform->setDefault('single', 1);\n\n // how to number answer options\n $mform->addElement('select', 'answernumbering',\n get_string('answernumbering', 'qtype_multichoice'),\n qtype_multichoice::get_numbering_styles());\n $mform->setDefault('answernumbering', 'abc');\n\n // default mark\n $mform->addElement('text', 'defaultmark', get_string('defaultmark', 'question'),\n array('size' => 7));\n $mform->setType('defaultmark', PARAM_FLOAT);\n $mform->setDefault('defaultmark', 1);\n $mform->addRule('defaultmark', null, 'required', null, 'client');\n\n // flag to set the shuffling of answer options\n $mform->addElement('advcheckbox', 'shuffleanswers',\n get_string('shuffleanswers', 'qtype_multichoice'), null, null, array(0, 1));\n $mform->addHelpButton('shuffleanswers', 'shuffleanswers', 'qtype_multichoice');\n $mform->setDefault('shuffleanswers', 1);\n\n // set as expanded by default\n $mform->setExpanded('answeroptionspropertiesheader');\n }", "public function testLocation() {\n\t\t$response = new CakeResponse();\n\t\t$this->assertNull($response->location(), 'No header should be set.');\n\t\t$this->assertNull($response->location('http://example.org'), 'Setting a location should return null');\n\t\t$this->assertEquals('http://example.org', $response->location(), 'Reading a location should return the value.');\n\t}", "function testNearestOptionedLocation() {\n\t\t// And our location is kyoto.\n\t\t$env = CPEnvironmentStub::getCPEnvironment(array('ExclusiveOR' => array(\n\t\t\t\t'Osaka' => array('Location' => 'nearest(osaka)'),\n\t\t\t\t'Tokyo' => array('Location' => 'nearest(tokyo)')\n\t\t\t\t)));\n\t\t$cond = new Location();\n\t\t$this->assertEquals(true, $cond->doesSatisfy($env, \"nearest(osaka)\"));\n\t\t$this->assertEquals(false, $cond->doesSatisfy($env, \"nearest(tokyo)\"));\n\t}", "public function get_location_data(){\n\t\t\t$event_id = $this->event_id;\n\t\t\t$location_terms = wp_get_post_terms($event_id, 'event_location');\n\n\t\t\tif ( $location_terms && ! is_wp_error( $location_terms ) ){\n\n\t\t\t\t$output = array();\n\n\t\t\t\t$evo_location_tax_id = $location_terms[0]->term_id;\n\t\t\t\t$event_tax_meta_options = get_option( \"evo_tax_meta\");\n\t\t\t\t\n\t\t\t\t// check location term meta values on new and old\n\t\t\t\t$LocTermMeta = evo_get_term_meta( 'event_location', $evo_location_tax_id, $event_tax_meta_options);\n\t\t\t\t\n\t\t\t\t// location name\n\t\t\t\t\t$output['name'] = stripslashes( $location_terms[0]->name );\n\n\t\t\t\t// description\n\t\t\t\t\tif(!empty($location_terms[0]->description))\n\t\t\t\t\t\t$output['description'] = $location_terms[0]->description;\n\n\t\t\t\t// meta values\n\t\t\t\tforeach(array(\n\t\t\t\t\t'location_address','location_lat','location_lon','evo_loc_img'\n\t\t\t\t) as $key){\n\t\t\t\t\tif(empty($LocTermMeta[$key])) continue;\n\t\t\t\t\t$output[$key] = $LocTermMeta[$key];\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\treturn $output;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "abstract public function getLocation();", "abstract public function getLocation();", "public function hasAnswer(ChoiceAnswer $answer);", "public function setLocation($location)\n {\n $this->location = $location;\n }", "public function _validation_locations($str, $isSeller)\r\n\t{\r\n\t\t$locations = json_decode($str);\r\n\t\tif($locations === null || !is_array($locations))\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message(\"_validation_locations\", \"Couldn't decode locations\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($locations) && $isSeller)\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message(\"_validation_locations\", \"At least one location is required\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$valid = true;\r\n\t\tforeach($locations as $location)\r\n\t\t{\r\n\t\t\t$valid = !$valid || empty($location->street1) ? false : true; \r\n\t\t\t$valid = !$valid || empty($location->city) ? false : true; \r\n\t\t\t$valid = !$valid || empty($location->region) ? false : true; \r\n\t\t\t$valid = !$valid || empty($location->postalCode) ? false : true; \r\n\t\t\t$valid = !$valid || empty($location->country) ? false : true; \r\n\r\n\t\t\tif(!$valid)\r\n\t\t\t{\r\n\t\t\t\t$this->form_validation->set_message(\"_validation_locations\", \"The locations are invalid\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function getLocation()\n {\n return $this->location;\n }", "public function setLocationId(){\n\t\t$app = JFactory::getApplication();\n\t\t\n\t\t$this->data = $app->input->get('jbl_form', null, null);\n\t\t$this->choose = $app->input->get('choose');\n\t\t$this->location_id = $app->input->get('location_id');\n\t\t$this->setAttributes();\n\t\tif($this->choose == 1){\n\t\t\t//location_id is gedurende hele traject, de location_id zoals aangegeven in menu params\n\t\t\t$app->setUserState(\"jbl_option.location_id\", null);\n\t\t\t$app->setUserState(\"jbl_option.location_id\", $this->location_id);\n\t\t} elseif($this->choose == 0){\n\t\t\t//location_id wordt bepaald door list op default pagina. userState alleen zetten indien in form location opgegeven wordt\n\t\t\tif(isset($this->data['location'])){\n\t\t\t\t$app->setUserState(\"jbl_option.location_id\", null);\n\t\t\t\t$app->setUserState(\"jbl_option.location_id\", $this->data['location']);\n\t\t\t}\n\t\t}\n\t}", "public function getLocation()\r\n {\r\n return $this->location;\r\n }", "public function hasLocations()\r\n\t{\r\n\t\tif(isset($this->locations))\r\n\t\t\treturn count($this->locations) > 0;\r\n\t\t\r\n\t\t$this->_CI->load->library(\"locationlib\");\r\n\t\treturn $this->_CI->locationlib->countLocationsByUser($this) > 0;\r\n\t}", "public function setLocation ($location)\n\t{\n\t\t$this->location = $location;\n\t}", "public function set_location($location)\n {\n // Change the state location from full name to its initial.\n $abvr = $this -> find_initials($location);\n \n // Check to see if state is null.\n if(isset($abvr))\n {\n // Start session to store session variables.\n session_start();\n\n // Set the long text location into session.\n $_SESSION[\"location\"] = $location;\n \n // Set the state initials into session.\n $_SESSION[\"abvr\"] = $abvr;\n }\n }", "public function getBooleananswerrequired()\n {\n return $this->booleananswerrequired;\n }", "public function getLocation(){\n return $this->location;\n }", "public function get_location_fields() {\n\n\t\t\t// The default location fields we want to map for GravityForms\n\t\t\t$location_fields = array(\n\t\t\t\t'sl_store' => __('Name' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_address' => __('Address' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_address2' => __('Address 2' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_city' => __('City' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_state' => __('State' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_zip' => __('Zip' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_country' => __('Country' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_tags' => __('Tags' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_image' => __('Image' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_description'=> __('Description' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_email' => __('Email' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_url' => $this->slplus->WPML->get_text( 'label_website' ,\n\t\t\t\t\t\t\t\t\t\t$this->slplus->WPOption_Manager->get_wp_option( 'label_website', __('Website','slp-gravity-forms-locations-free') ) ,\n\t\t\t\t\t\t\t\t\t\t'slp-gravity-forms-locations-free'\n\t\t\t\t\t\t\t\t\t ) ,\n\t\t\t\t'sl_hours' => $this->slplus->WPML->get_text( 'label_hours' ,\n\t\t\t\t\t\t\t\t\t\t$this->slplus->WPOption_Manager->get_wp_option( 'label_hours' , __('Hours','slp-gravity-forms-locations-free') ),\n\t\t\t\t\t\t\t\t\t\t'slp-gravity-forms-locations-free'\n\t\t\t\t\t\t\t\t\t) ,\n\t\t\t\t'sl_phone' => $this->slplus->WPML->get_text( 'label_phone' ,\n\t\t\t\t\t\t\t\t\t\t$this->slplus->WPOption_Manager->get_wp_option( 'label_phone' , __('Phone','slp-gravity-forms-locations-free') ),\n\t\t\t\t\t\t\t\t\t\t'slp-gravity-forms-locations-free'\n\t\t\t\t\t\t\t\t\t) ,\n\t\t\t\t'sl_fax' => $this->slplus->WPML->get_text( 'label_fax' ,\n\t\t\t\t\t\t\t\t\t\t$this->slplus->WPOption_Manager->get_wp_option( 'label_fax' , __('Fax','slp-gravity-forms-locations-free') ),\n\t\t\t\t\t\t\t\t\t\t'slp-gravity-forms-locations-free'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t//-------------------------\n\t\t\t// GFI_Pro ACTION: slp_gfl_settings_page\n\t\t\t// params: settings object, section name\n\t\t\t//-------------------------\n\t\t\t$location_fields = apply_filters('slp_gfl_get_location_fields', $location_fields);\n\n\t\t\t$this->debugMP('pr', __FUNCTION__ . ' location_fields:', $location_fields);\n\n\t\t\treturn $location_fields;\n\n\t\t}", "public function is_valid_location_type($type)\n {\n }", "public function testLocationSearchPost()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function accommodation_location(){\n\t\t$type_name = self::get_accommodation_data('type');\n\t\t$type_slug = self::get_accommodation_data('slug');\n\t\t$taxonomy_name = self::get_accommodation_location_data('type');\n\t\t$taxonomy_slug = self::get_accommodation_location_data('slug');\n\t\t$labels\t = array(\n\t\t\t'name'\t\t\t\t\t\t => _x( 'Accommodation Location', 'taxonomy general name', $this->text_domain_name ),\n\t\t\t'singular_name'\t\t\t\t => _x( 'Accommodation Location', 'taxonomy singular name', $this->text_domain_name ),\n\t\t\t'search_items'\t\t\t\t => __( 'Search Accommodation Locations', $this->text_domain_name ),\n\t\t\t'popular_items'\t\t\t\t => __( 'Popular Accommodation Locations', $this->text_domain_name ),\n\t\t\t'all_items'\t\t\t\t\t => __( 'All Accommodation Locations', $this->text_domain_name ),\n\t\t\t'parent_item'\t\t\t\t => null,\n\t\t\t'parent_item_colon'\t\t\t => null,\n\t\t\t'edit_item'\t\t\t\t\t => __( 'Edit Accommodation Location', $this->text_domain_name ),\n\t\t\t'update_item'\t\t\t\t => __( 'Update Accommodation Location', $this->text_domain_name ),\n\t\t\t'add_new_item'\t\t\t\t => __( 'Add New Location', $this->text_domain_name ),\n\t\t\t'new_item_name'\t\t\t\t => __( 'New Location', $this->text_domain_name ),\n\t\t\t'separate_items_with_commas' => __( 'Separate Locations with commas', $this->text_domain_name ),\n\t\t\t'add_or_remove_items'\t\t => __( 'Add or remove Locations', $this->text_domain_name ),\n\t\t\t'choose_from_most_used'\t\t => __( 'Choose from the most used Location', $this->text_domain_name ),\n\t\t\t'not_found'\t\t\t\t\t => __( 'No Location found.', $this->text_domain_name ),\n\t\t\t'menu_name'\t\t\t\t\t => __( 'Locations', $this->text_domain_name ),\n\t\t);\n\t\t$args\t = array(\n\t\t\t\"labels\"\t\t\t => $labels,\n\t\t\t'public'\t\t\t => false,\n\t\t\t'hierarchical'\t\t => false,\n\t\t\t'show_ui'\t\t\t => true,\n\t\t\t'show_in_nav_menus'\t => false,\n\t\t\t'show_admin_column'\t => true,\n\t\t\t'args'\t\t\t\t => array('orderby' => 'term_order'),\n\t\t\t'query_var'\t\t\t => false,\n\t\t\t'rewrite'\t\t\t => false,\n\t\t\t'meta_box_cb'\t\t => false,\n\t\t);\n\t\tregister_taxonomy( $taxonomy_name, $type_name, $args );\n\t}" ]
[ "0.8191639", "0.5591089", "0.5521851", "0.55035543", "0.5404453", "0.53202814", "0.52743375", "0.5268212", "0.52611667", "0.5177908", "0.5165714", "0.5159297", "0.5120322", "0.50832564", "0.50832564", "0.50832564", "0.50832564", "0.50832564", "0.50832564", "0.50322217", "0.50322217", "0.50322217", "0.50322217", "0.50322217", "0.49815625", "0.4958777", "0.4926909", "0.48826256", "0.4827745", "0.4771618", "0.4771618", "0.4759718", "0.47563514", "0.47497916", "0.47146416", "0.4708731", "0.47084737", "0.47083712", "0.46985537", "0.46885976", "0.4672781", "0.46723217", "0.46713507", "0.46664453", "0.465417", "0.46486807", "0.46478432", "0.46473825", "0.46384025", "0.46195218", "0.46183413", "0.4609144", "0.46073923", "0.45684963", "0.4564004", "0.45335338", "0.45235538", "0.45067376", "0.45027226", "0.4497587", "0.4496308", "0.44931656", "0.4481796", "0.44758132", "0.44750175", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44644088", "0.44604632", "0.4458614", "0.44573122", "0.4453695", "0.44525218", "0.44521508", "0.44509107", "0.4450732", "0.4446535", "0.44437507", "0.44437507", "0.44333658", "0.44233373", "0.44218293", "0.44213688", "0.44199255", "0.44195408", "0.44174492", "0.44120622", "0.44085726", "0.4406625", "0.44054675", "0.44042775", "0.43958062", "0.43927142", "0.43916222" ]
0.7899887
1
Answer configuration for location question. If true, campaign/account level location data (state, city, business name etc) will be rendered on the Lead Form. Starting V13.1, has_location_answer can only be set for "What is your preferred dealership?" question, for advertisers with Location Assets setup at campaign/account level. Generated from protobuf field bool has_location_answer = 3;
Настройка ответа для вопроса о местоположении. Если значение истинно, данные о местоположении на уровне кампании/аккаунта (штат, город, название бизнеса и т.д.) будут отображаться в форме потенциального клиента. Начиная с V13.1, параметр has_location_answer можно задавать только для вопроса "Какой автосалон вам предпочтителен?", для рекламодателей, у которых на уровне кампании/аккаунта настроены активы местоположения. Сгенерировано из поля protobuf bool has_location_answer = 3;
public function setHasLocationAnswer($var) { GPBUtil::checkBool($var); $this->writeOneof(3, $var); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHasLocationAnswer()\n {\n return $this->readOneof(3);\n }", "public function hasLocation(): bool\n {\n return isset($this->location);\n }", "public function hasLocation(){\n return $this->_has(4);\n }", "public function hasLocation()\n {\n return !is_null($this->location);\n }", "private function _isValidLocation()\n {\n //echo dp_text(\"_isValidLocation: checking location \\\"%s\\\"\\n\",\n // !isset($this->__GET['location']) ? '' : $this->__GET['location']);\n if (isset($this->__GET['location'])\n && !dp_strlen($this->__GET['location'])) {\n return TRUE;\n }\n\n if (!isset($this->__GET['location'])) {\n return isset($this->__GET['getdivs']);\n }\n\n if (FALSE !== dp_strpos($this->__GET['location'], '..')) {\n return FALSE;\n }\n\n if (FALSE !== ($pos = dp_strpos($this->__GET['location'], '?'))) {\n $this->__GET['location'] =\n dp_substr($this->__GET['location'], 0, $pos);\n }\n\n if (FALSE !== ($pos = dp_strpos($this->__GET['location'], '#'))) {\n $this->__GET['location'] =\n dp_substr($this->__GET['location'], 0, $pos);\n }\n\n /* Experimental */\n if (isset($this->__GET['proxy'])\n || 0 === dp_strpos($this->__GET['location'], '/mailman2/')) {\n return TRUE;\n }\n\n if (($len = dp_strlen(DPSERVER_HOST_URL))\n < dp_strlen($this->__GET['location'])\n && DPSERVER_HOST_URL === dp_substr($this->__GET['location'], 0,\n $len)) {\n return TRUE;\n }\n return (file_exists(DPUNIVERSE_PREFIX_PATH . $this->__GET['location'])\n && is_file(DPUNIVERSE_PREFIX_PATH . $this->__GET['location']))\n || (file_exists(DPUNIVERSE_WWW_PATH . $this->__GET['location'])\n && is_file(DPUNIVERSE_WWW_PATH . $this->__GET['location']));\n }", "public function hasMultipleLocations()\n {\n return $this->multiple_locations ?: false;\n }", "public function locationPref()\n {\n return $this->location_pref;\n }", "public static function get_location_details_definition() {\n return [\n 'title' => 'View details of a location',\n 'category' => 'Utilities',\n 'description' => 'A summary view of a location with commenting capability. Pass a parameter in the URL called location_id to define which occurrence to show.',\n 'helpLink' => 'https://indicia-docs.readthedocs.io/en/latest/site-building/iform/prebuilt-forms/location-details.html',\n 'supportsGroups' => TRUE,\n 'recommended' => TRUE,\n ];\n }", "public function supportsLocation()\n {\n }", "function _location_us_enough_fields_for_yahoo($location) {\n // link to yahoo directions. If all of these fields don't have values, then we generate\n // a link to the *form* for Yahoo! driving directions rather than directly to the driving\n // directions themselves.\n if (strlen($location['street']) && strlen($location['city']) && strlen($location['province'])) {\n return TRUE;\n }\n\n if (strlen($location['street']) && strlen($location['postal_code'])) {\n return TRUE;\n }\n\n if (strlen($location['street']) && strlen($location['city']) && strlen($location['province'])) {\n return TRUE;\n }\n\n return FALSE;\n}", "function acf_validate_location_rule($rule = \\false) {}", "public function checkLocation()\n\t{\n\t\tif (false === $this->checkLocationNPCs())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t# Validate lang file\n// \t\t$player = Shadowrun4::getDummyPlayer();\n// \t\t$this->getEnterText($player);\n// \t\t$this->getHelpText($player);\n// \t\t$this->getFoundText($player);\n// \t\t$this->getName();\n\t\t\n\t\treturn true;\n\t}", "public function single_location_settings() {\n\t\t\tWPSEO_Local_Admin_Page::section_before( 'single-location-settings', 'clear: both; ' . ( wpseo_has_multiple_locations() ? 'display: none;' : '' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_name', __( 'Business name', 'yoast-local-seo' ) );\n\n\t\t\tWPSEO_Local_Admin_Wrappers::select( 'business_type', __( 'Business type', 'yoast-local-seo' ), $this->wpseo_local_core->get_local_business_types() );\n\t\t\techo '<p class=\"desc label\" style=\"border:none; margin-bottom: 0;\">' . sprintf( __( 'If your business type is not listed, please read %sthe FAQ entry%s.', 'yoast-local-seo' ), '<a href=\"http://kb.yoast.com/article/49-my-business-is-not-listed-can-you-add-it\" target=\"_blank\">', '</a>' ) . '</p>';\n\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_address', __( 'Business address', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_address_2', __( 'Business address line 2', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_city', __( 'Business city', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_state', __( 'Business state', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_zipcode', __( 'Business zipcode', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::select( 'location_country', __( 'Business country', 'yoast-local-seo' ), WPSEO_Local_Frontend::get_country_array() );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_phone', __( 'Business phone', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_phone_2nd', __( '2nd Business phone', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_fax', __( 'Business fax', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_email', __( 'Business email', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_url', __( 'URL', 'yoast-local-seo' ), '', array( 'placeholder' => wpseo_xml_sitemaps_base_url( '' ) ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_vat_id', __( 'VAT ID', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_tax_id', __( 'Tax ID', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_coc_id', __( 'Chamber of Commerce ID', 'yoast-local-seo' ) );\n\n\t\t\techo '<p>' . __( 'You can enter the lat/long coordinates yourself. If you leave them empty they will be calculated automatically. If you want to re-calculate these fields, please make them blank before saving this location.', 'yoast-local-seo' ) . '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_coords_lat', __( 'Latitude', 'yoast-local-seo' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'location_coords_long', __( 'Longitude', 'yoast-local-seo' ) );\n\n\t\t\tWPSEO_Local_Admin_Page::section_after(); // End show-single-locaton section.\n\t\t}", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($location);", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function it_can_return_a_location_when_a_location_is_searched()\n {\n return;\n $this->setKey(self::API_KEY);\n $this->location(self::LOCATION)->shouldReturnAnInstanceOf(Location::class);\n }", "public function setLocation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dlp\\V2beta1\\Location::class);\n $this->location = $var;\n\n return $this;\n }", "public function hasLocations(){\n return $this->_has(8);\n }", "public static function field_location_avimayeur(){\n $location = esc_attr(get_option('location'));\n ?>\n <input type=\"text\"\n id=\"location\"\n name=\"location\"\n value=\"<?php echo $location ?>\"\n class=\"regular-text\"\n />\n <?php\n }", "public function willFollowLocation() {\n return $this->followLocation;\n }", "public function isSatisfiedBy(Answer $answer): bool;", "public function isSatisfiedBy(Answer $answer): bool;", "public function setCorrectAnswer(AnswerInterface $answer);", "function add_answer($answer_text,$correct,$comment,$ponderation,$position,$hotspot_coordinates,$hotspot_type)\n\t{\n\t\t$answer = array();\n\t\t$answer['answer'] = $answer_text;\n\t\t$answer['correct'] = $correct;\n\t\t$answer['comment'] = $comment;\n\t\t$answer['ponderation'] = $ponderation;\n\t\t$answer['position'] = $position;\n\t\t$answer['hotspot_coordinates'] = $hotspot_coordinates;\n\t\t$answer['hotspot_type'] = $hotspot_type;\n\t\t$this->answers[] = $answer;\n\t}", "public function setPlaquesGeoloc($input = '')\n\t {\n\t \t$this->plaquesGeoloc = $input;\n\t }", "public static function invalidDirectionsRequestProvideRouteAlternatives()\n {\n return new static('The directions request provide route alternatives flag must be a boolean value.');\n }", "public function setResponseLocation($responseLocation)\n {\n $this->responseLocation = $responseLocation;\n return $this;\n }", "protected function add_sample_answer_field($mform) {\n $mform->addElement('header', 'answerhdr',\n get_string('answer', 'qtype_coderunner'), '');\n $mform->setExpanded('answerhdr', 1);\n $mform->addElement('textarea', 'answer',\n get_string('answer', 'qtype_coderunner'),\n array('rows' => 9, 'class' => 'answer edit_code'));\n $mform->addElement('advcheckbox', 'validateonsave', null,\n get_string('validateonsave', 'qtype_coderunner'));\n $mform->setDefault('validateonsave', false);\n $mform->addHelpButton('answer', 'answer', 'qtype_coderunner');\n }", "public function setAnswer($answer)\n\t\t{\n\t\t\treturn $this->answer = (strlen($answer) > 0) ? $answer : $this->getDefault();\n\t\t}", "function mfcs_get_request_field_location($form, &$form_state, &$fields, &$request_state, $ps) {\n $values = array(0 => NULL);\n if (!empty($request_state['location'])) {\n $values = $request_state['location'];\n }\n\n // do not allow certain fields to be editable when a request is completed, even by admins (in this case there is a move operation to change location, building, and room).\n $readonly = FALSE;\n if (isset($form['form']['operation']['#value']) && $form['form']['operation']['#value'] === 'edit' && isset($form['form']['existing']['#value'])) {\n if (isset($form['form']['existing']['#value']['request']['step'][0]) && is_numeric($form['form']['existing']['#value']['request']['step'][0])) {\n if ((int)$form['form']['existing']['#value']['request']['step'][0] === MFCS_REVIEW_STEP_COMPLETED) {\n $readonly = TRUE;\n }\n }\n }\n\n $form['form']['operation'] = array(\n '#type' => 'value',\n '#value' => 'create',\n );\n\n $field_title = 'Please indicate the requested facility or request location?';\n $limits_check = array(\n 'title' => $field_title,\n 'field' => 'location',\n 'group' => 'top',\n 'path' => 'location',\n 'visible' => FALSE,\n 'ps' => $ps,\n );\n\n $form_state['conditionally_required'][3][] = &$limits_check;\n\n if ($form['form']['step']['#value'] == 'location' && array_key_exists('information', $form['form']['sections']['#value'])) {\n $fields['location'] = array(\n '#id' => 'field-request-location',\n '#type' => 'container',\n '#tree' => TRUE,\n '#attributes' => array(\n 'class' => array(\n 'form-item-wrapper',\n 'field-request-item',\n 'field-request-item-location',\n ),\n ),\n );\n\n global $base_path;\n $module_path = drupal_get_path('module', 'mfcs');\n\n drupal_add_js($module_path . '/js/images-locations.js', array('type' => 'file', 'group' => JS_DEFAULT, 'preprocess' => TRUE));\n\n $list_options = mfcs_get_request_location_list_options('radios');\n\n $user = cf_current_user();\n $is_venue_coordinator = mfcs_is_venue_coordinator_or_room_coordinator($user->uid);\n if ($is_venue_coordinator) {\n $list_options[MFCS_BANNER_LOCATION_VENUE_COORDINATOR] = 'Your Rooms as Venue Coordinator';\n }\n\n foreach ($values as $key => $value) {\n $fields['location'][$key] = array(\n '#id' => 'field-request-location-' . $key,\n '#type' => 'radios',\n '#title' => '<span class=\"strong underline\">' . $field_title . '</span>',\n '#options' => $list_options,\n '#default_value' => $value,\n '#required' => TRUE,\n '#attributes' => array(\n 'class' => array(\n 'form-item-delta',\n 'form-item-delta-' . $key,\n ),\n ),\n '#description' => 'If you are unsure of which location to choose, then please contact the administration or your adviser.',\n );\n\n if ($readonly) {\n $fields['location'][$key]['#disabled'] = TRUE;\n $fields['location'][$key]['#attributes']['readonly'] = 'readonly';\n }\n }\n krsort($fields['location']);\n\n $form_state['conditionally_required'][0][] = 'location';\n\n $fields['location'][0]['location-images'] = array(\n '#tree' => TRUE,\n );\n\n $fields['location'][0]['location-images'][0] = array();\n $fields['location'][0]['location-images'][1] = array();\n\n $fields['location'][0]['location-images'][0]['#markup'] = '<a href=\"//www.mcneese.edu/node/5530\" class=\"location-image-link\" title=\"View Campus Map\" target=\"_blank\"><img id=\"field-request-location-0-image-0\" src=\"' . $base_path . $module_path . '/images/example-map.png\" alt=\"Campus Map\" class=\"location-image location-image-visible noscript\"></a>';\n $fields['location'][0]['location-images'][1]['#markup'] = '<a href=\"//www.mcneese.edu/node/5530\" class=\"location-image-link\" title=\"View Campus Map\" target=\"_blank\"><img id=\"field-request-location-0-image-1\" src=\"' . $base_path . $module_path . '/images/example-seed.png\" alt=\"Campus Map, SEED Center\" class=\"location-image location-image-invisible noscript\"></a>';\n\n $limits_check['visible'] = TRUE;\n }\n else {\n foreach ($values as $key => $value) {\n $fields['location'][$key] = array(\n '#id' => 'field-request-location-' . $key,\n '#type' => 'value',\n '#value' => $value,\n );\n }\n }\n\n return $values;\n}", "public function isAnswered()\n {\n return $this->answered;\n }", "private function set_phrase_answered_correctly() {\n\n // set state off response, if it's there\n if(isset($this->response['phrase_answered_correctly'])) {\n $phrase_answered_correctly = $this->response['phrase_answered_correctly'];\n }\n // try to set the state from the cookie\n elseif(isset($_COOKIE['phrase_ac'])) {\n $phrase_answered_correctly = $_COOKIE['phrase_ac'];\n }\n // probably a new assessment\n else {\n $phrase_answered_correctly = 0;\n }\n\n $this->phrase_answered_correctly = $phrase_answered_correctly;\n }", "public function section_location( $event = null ) {\n\n\t\t// Location\n\t\t$location = $event->location;\n\n\t\t// Start an output buffer\n\t\tob_start(); ?>\n\n\t\t<table class=\"form-table rowfat\">\n\t\t\t<tbody>\n\n\t\t\t\t<?php if ( apply_filters( 'sugar_calendar_location', true ) ) : ?>\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<label for=\"location\"><?php esc_html_e( 'Location', 'sugar-calendar' ); ?></label>\n\t\t\t\t\t\t</th>\n\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<textarea name=\"location\" id=\"location\" placeholder=\"<?php esc_html_e( '(Optional)', 'sugar-calendar' ); ?>\"><?php echo esc_textarea( $location ); ?></textarea>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\n\t\t\t\t<?php endif; ?>\n\t\t\t</tbody>\n\t\t</table>\n\n\t\t<?php\n\n\t\t// End & flush the output buffer\n\t\techo ob_get_clean();\n\t}", "public function multiple_locations_settings() {\n\t\t\tWPSEO_Local_Admin_Page::section_before( 'multiple-locations-settings', 'clear: both; ' . ( wpseo_has_multiple_locations() ? '' : 'display: none;' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_slug', __( 'Locations slug', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The slug for your location pages. Default slug is <code>locations</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\tif ( wpseo_has_multiple_locations() ) {\n\t\t\t\techo '<a href=\"' . get_post_type_archive_link( 'wpseo_locations' ) . '\" target=\"_blank\">' . __( 'View them all', 'yoast-local-seo' ) . '</a> ' . __( 'or', 'yoast-local-seo' ) . ' <a href=\"' . admin_url( 'edit.php?post_type=wpseo_locations' ) . '\">' . __( 'edit them', 'yoast-local-seo' ) . '</a>';\n\t\t\t}\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_label_singular', __( 'Locations label singular', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The singular label for your location pages. Default label is <code>Location</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_label_plural', __( 'Locations label plural', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The plural label for your location pages. Default label is <code>Locations</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_taxo_slug', __( 'Locations category slug', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The slug for your location categories. Default slug is <code>locations-category</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\tif ( wpseo_has_multiple_locations() ) {\n\t\t\t\techo '<a href=\"' . admin_url( 'edit-tags.php?taxonomy=wpseo_locations_category&post_type=wpseo_locations' ) . '\">' . __( 'Edit the categories', 'yoast-local-seo' ) . '</a>';\n\t\t\t}\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Page::section_after();\n\t\t}", "public function getIsLocationOnline()\n {\n if (array_key_exists(\"isLocationOnline\", $this->_propDict)) {\n return $this->_propDict[\"isLocationOnline\"];\n } else {\n return null;\n }\n }", "public function followLocation($followLocation)\n {\n $this->followLocation = (bool) $followLocation;\n }", "public function isUserAnswerIsCorrect();", "public function getHasFacilityLocation()\n {\n return $this->hasFacilityLocation;\n }", "function ul_user_is_location( $user = '' ) {\n\tif ( empty($user) ) {\n\t\tif ( current_user_can('edit_location_pages') && ! current_user_can('edit_others_posts') ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\telseif ( user_can( $user, 'edit_location_pages' ) && ! user_can( $user, 'edit_others_posts' ) ) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function setAnswer(Answer $answer) {\n $this->answer = $answer;\n }", "private function checkLocationNPCs()\n\t{\n\t\t# Dummy player\n\t\t$player = Shadowrun4::getDummyPlayer();\n\t\t\n\t\t# Validate talking NPCs\n\t\tforeach ($this->getNPCS($player) as $tt => $classname)\n\t\t{\n\t\t\tif (false === ($npc = Shadowrun4::getNPC($classname)))\n\t\t\t{\n\t\t\t\tdie(sprintf('Location %s is missing talking NPC %s.', $this->getName(), $classname));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function completePopulationAnswer(\\Application\\Model\\Answer $answer = null)\n {\n $isAbsolute = $answer && $answer->getQuestion() instanceof \\Application\\Model\\Question\\NumericQuestion && $answer->getQuestion()->isAbsolute();\n\n if ($isAbsolute) {\n $computing = \"value_percent = value_absolute / p.population\";\n } else {\n $computing = \"value_absolute = p.population * value_percent\";\n }\n\n if ($answer) {\n $whereClause = 'answer.id = ' . $answer->getId();\n } else {\n $whereClause = 'question.is_absolute = FALSE';\n }\n\n $sql = sprintf('UPDATE answer\n JOIN questionnaire q ON (answer.questionnaire_id = q.id)\n JOIN survey s ON (q.survey_id = s.id)\n JOIN geoname g ON (q.geoname_id = g.id)\n JOIN population p ON (p.geoname_id = g.id AND s.year = p.year)\n JOIN question ON (s.id = question.survey_id)\n SET %s\n WHERE %s\n AND answer.part_id = p.part_id\n AND answer.question_id = question.id\n AND question.is_population = TRUE', $computing, $whereClause);\n\n return $this->getEntityManager()->getConnection()->executeUpdate($sql);\n }", "function em_is_location_page(){\r\n\treturn em_get_page_type() == 'location';\r\n}", "public function add_answer(\n $answer_id,\n $answer_text,\n $correct,\n $comment,\n $ponderation,\n $position,\n $hotspot_coordinates,\n $hotspot_type\n ) {\n $answer = array();\n $answer['id'] = $answer_id;\n $answer['answer'] = $answer_text;\n $answer['correct'] = $correct;\n $answer['comment'] = $comment;\n $answer['ponderation'] = $ponderation;\n $answer['position'] = $position;\n $answer['hotspot_coordinates'] = $hotspot_coordinates;\n $answer['hotspot_type'] = $hotspot_type;\n $this->answers[] = $answer;\n }", "public function BMLTPlugin_map_search_location_options(\n $in_options_id, ///< The ID for the options to use for this implementation.\n $in_uid ///< This is the UID of the enclosing div.\n ) {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $ret = '<div class=\"bmlt_map_container_div_location_options_div\" id=\"'.$in_uid.'_location\">';\n $ret .= '<div class=\"bmlt_map_options_loc\">';\n $ret .= '<a class=\"bmlt_map_reveal_options\" id=\"'.$in_uid.'_options_loc_a\" href=\"javascript:var a=document.getElementById(\\''.$in_uid.'_options_loc_a\\');var b=document.getElementById(\\''.$in_uid.'_options_loc\\');if(b &amp;&amp; a){if(b.style.display==\\'none\\'){a.className=\\'bmlt_map_hide_options\\';b.style.display=\\'block\\';c_ms_'.$in_uid.'.openLocationSectionExt(document.getElementById(\\''.$in_uid.'_location_text\\'), document.getElementById(\\''.$in_uid.'_location_submit\\'));}else{a.className=\\'bmlt_map_reveal_options\\';b.style.display=\\'none\\';};};c_ms_'.$in_uid.'.recalculateMapExt()\"><span>'.$this->process_text($this->my_current_language->local_new_map_option_loc_label).'</span></a>';\n $ret .= '<div class=\"bmlt_map_container_div_search_options_div\" id=\"'.$in_uid.'_options_loc\" style=\"display:none\">';\n $ret .= '<form action=\"#\" method=\"get\" onsubmit=\"c_ms_'.$in_uid.'.lookupLocationExt(document.getElementById(\\''.$in_uid.'_location_text\\'), document.getElementById(\\''.$in_uid.'_location_submit\\'));return false\">';\n $ret .= '<fieldset class=\"bmlt_map_container_div_search_options_div_location_fieldset\">';\n $ret .= '<div class=\"location_radius_popup_div\">';\n $ret .= '<label for=\"\">'.$this->process_text($this->my_current_language->local_new_map_option_loc_popup_label_1).'</label>';\n $ret .= '<select class=\"bmlt_map_location_radius_popup\" id=\"'.$in_uid.'_radius_select\" onchange=\"c_ms_'.$in_uid.'.changeRadiusExt(true)\">';\n $ret .= '<option value=\"\" selected=\"selected\">'.$this->process_text($this->my_current_language->local_new_map_option_loc_popup_auto).'</option>';\n $ret .= '<option value=\"\" disabled=\"disabled\"></option>';\n $options = $this->getBMLTOptions_by_id($in_options_id);\n $this->adapt_to_lang($options['lang']);\n foreach ($this->my_current_language->local_new_map_js_diameter_choices as $radius) {\n $ret .= '<option value=\"'.($radius / 2).'\">'.($radius / 2).' '.$this->process_text((strtolower($options['distance_units']) == 'km') ? $this->my_current_language->local_new_map_option_loc_popup_km : $this->my_current_language->local_new_map_option_loc_popup_mi).'</option>';\n }\n $ret .= '</select>';\n $ret .= '<label for=\"\">'.$this->process_text($this->my_current_language->local_new_map_option_loc_popup_label_2).'</label>';\n $ret .= '</div>';\n $ret .= '<fieldset class=\"location_text_entry_fieldset\">';\n $ret .= '<legend>'.$this->process_text($this->my_current_language->local_new_map_text_entry_fieldset_label).'</legend>';\n $def_text = $this->process_text($this->my_current_language->local_new_map_text_entry_default_text);\n $ret .= '<div class=\"location_text_input_div\">';\n $ret .= '<input type=\"text\" class=\"location_text_input_item_blurred\" value=\"'.$def_text.'\" id=\"'.$in_uid.'_location_text\" onfocus=\"c_ms_'.$in_uid.'.focusLocationTextExt(this, document.getElementById(\\''.$in_uid.'_location_submit\\'), false)\" onblur=\"c_ms_'.$in_uid.'.focusLocationTextExt(this, document.getElementById(\\''.$in_uid.'_location_submit\\'), true)\" onkeyup=\"c_ms_'.$in_uid.'.enterTextIntoLocationTextExt(this, document.getElementById(\\''.$in_uid.'_location_submit\\'))\" />';\n $ret .= '</div>';\n $ret .= '<div class=\"location_text_submit_div\">';\n $ret .= '<input type=\"button\" disabled=\"disabled\" class=\"location_text_submit_button\" value=\"'.$this->process_text($this->my_current_language->local_new_map_location_submit_button_text).'\" id=\"'.$in_uid.'_location_submit\" onclick=\"c_ms_'.$in_uid.'.lookupLocationExt(document.getElementById(\\''.$in_uid.'_location_text\\'), this)\" />';\n $ret .= '</div>';\n $ret .= '</fieldset>';\n $ret .= '</fieldset>';\n $ret .= '</form>';\n $ret .= '</div>';\n $ret .= '</div>';\n $ret .= '</div>';\n return $ret;\n }", "function setLocation($location) {\n\t\treturn $this->setData('location', $location);\n\t}", "public function sendLocation($chatId, $latitude, $longitude, $replyToMessageId = null, JsonSerializable $ReplyMarkUp = null);", "public function useGeolocation(): bool\n\t{\n\t\treturn true;\n\t}", "public function location($strLocation = NULL, $iLocationLat = NULL, $iLocationLong = NULL) {\n\t\t\tif (!is_null($strLocation)) $this->strLocation = $strLocation; \n\t\t\tif (!is_null($iLocationLat)) $this->iLocationLat = $iLocationLat;\n\t\t\tif (!is_null($iLocationLong)) $this->iLocationLong = $iLocationLong; \n\t\t\tif (is_null($this->strLocation)) $this->load();\n\t\t\treturn $this->visible4me(\"location\") ? $this->strLocation : \"\"; \n\t\t}", "public function getNeedAnswer(): ?bool {\n return $this->needAnswer;\n }", "private function set_answered_correctly() {\n\n\t\t// set state off response, if it's there\n\t\tif(isset($this->response['answered_correctly'])) {\n\t\t\t$answered_correctly = $this->response['answered_correctly'];\n\t\t}\n\t\t// try to set the state from the cookie\n\t\telseif(isset($_COOKIE['ac'])) {\n\t\t\t$answered_correctly = $_COOKIE['ac'];\n\t\t}\n\t\t// probably a new assessment\n\t\telse {\n\t\t\t$answered_correctly = 0;\n\t\t}\n\n\t\t$this->answered_correctly = $answered_correctly;\n\t}", "protected function locationDisplay() {\n\t\t\tif (isset($this->user[\"user_disLocation\"][0])) {\n\t\t\t\t\n\t\t\t\tif ($this->user[\"user_disLocation\"][0] == 1) {\n\t\t\t\t\t\n\t\t\t\t\t$in[\"city\"] = $this->user[\"user_city\"][0];\n\t\t\t\t\t$in[\"state\"] = $this->user[\"user_state\"][0];\n\t\t\t\t\t$country = ($this->user[\"user_country\"][0] == \"United States\") ? null : $this->user[\"user_country\"][0];\n\t\t\t\t\t\n\t\t\t\t\t// If Country is not Null\n\t\t\t\t\tif ($country != null) {\n\t\t\t\t\t\n\t\t\t\t\t\t$in[\"country\"] = $country;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$location = implode(\", \", $in);\n\t\t\t\t\t\n\t\t\t\t\treturn $location;\n\t\t\t\t\n\t\t\t\t// User Display Name is off\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\treturn null;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t// User image display was not loaded; return null\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn null;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "protected function define_answers_section()\n {\n // defines the list of params to represents the answer\n $this->add_per_answer_fields($this->_form, \"\", question_bank::fraction_options_full(), 0);\n }", "public function hasLongitude()\n {\n return isset($this->longitude);\n }", "public function definition() {\n //defined global parameter\n global $CFG, $DB;\n \n // Form initial\n $mform =& $this->_form;\n \n // Get outside values when the coordinatoredit.php call function to new this form\n $id = $this->_customdata['id'];\n $locid = $this->_customdata['locid'];\n $relocid = $this->_customdata['relocid'];\n $filterlocid = 0;\n \n // When user made one or multiple wrong choosen for this page, show this string to them\n $strrequired = get_string('required');\n\n //var_dump('form = ' . $locid);\n //echo('</br>');\n\n // Create an invisible textbox field\n $mform->addElement('hidden', 'id', $id);\n $mform->setType('id', PARAM_RAW);\n \n // Create an invisible textbox field\n $mform->addElement('hidden', 'locationid', $locid);\n $mform->setType('locationid', PARAM_RAW);\n \n // when we press the edit hyperlink in the coordinatorlist_index.php, we can get the location id from urls(I have been hard code in the hyperlink)\n // but in the edit page, we need the form to pass the right location id to redirect us to right location page after we press the cancel button\n if(!$relocid) {\n $locationsql = \"SELECT lal.id, lal.name\n FROM {local_adsafe_location} lal\n WHERE lal.id = $locid\";\n $locationfields = $DB->get_records_sql($locationsql);\n } else {\n $locationsql = \"SELECT lal.id, lal.name\n FROM {local_adsafe_location} lal\n WHERE lal.id = $relocid\";\n $locationfields = $DB->get_records_sql($locationsql);\n }\n $storefield = new stdClass();\n foreach($locationfields as $field) { //convert sql record to an object\n $storefield->id = $field->id;\n $storefield->name = $field->name;\n }\n // Disable the location field, basically we are editing the user in this location without change it\n $mform->addElement('text', 'locationname', get_string('location', 'local_adsafe'),\n array('size' => 50, 'disabled' => 'disabled'));\n $mform->setType('locationname', PARAM_RAW);\n $mform->setDefault('locationname', $storefield->name);\n \n // get all the user from user table\n $namemenu = array('0' => get_string('selectamember', 'local_adsafe'));\n //$storefield->id\n if(!$relocid) {\n $filterlocid = $locid;\n } else {\n $filterlocid = $relocid;\n }\n $namesql = \"SELECT lam.userid, CONCAT(u.lastname,', ',u.firstname)\n FROM {local_adsafe_member} lam\n JOIN {user} u\n ON lam.userid = u.id\n WHERE lam.locationid = $filterlocid\n AND lam.activated = 1\n ORDER BY 2\";\n /*$namesql = \"SELECT u.id,CONCAT(u.lastname,', ',u.firstname)\n FROM {user} u\n ORDER BY 2\";*/\n if($getnameidfields = $DB->get_records_sql_menu($namesql,null)){\n foreach($getnameidfields as $getid => $getname) {\n $namemenu[\"$getid\"] = $getname; // put the user id and name into an array\n }\n }\n \n // put all user in the Name drop-down box\n $nameselect = $mform->addElement('select', 'userid', get_string('member', 'local_adsafe'), $namemenu);\n $mform->addRule('userid', $strrequired, 'required', null, 'client');\n $mform->setType('userid', PARAM_RAW);\n $nameselect->setSelected(0); // new user will show select an username\n \n $mform->addElement('date_selector', 'starttime', get_string('starttime', 'local_adsafe'));\n $mform->addRule('starttime', $strrequired, 'required', null, 'client');\n \n // tickbox function for endtime of date_selector\n $testarr = array('startyear' => 1970, 'timezone' => 99, 'optional' => true);\n $mform->addElement('date_selector', 'endtime', get_string('endtime', 'local_adsafe'),$testarr);\n //$mform->addRule('endtime', $strrequired, 'required', null, 'client');\n\n // if editing the user of coordinator page $id reutrn true\n // pre-loading the user information\n if ($id) {\n $coosql = \"SELECT lac.*\n FROM mdl_local_adsafe_coordinators lac\n WHERE lac.id = :id\";\n $coordinatordetails = $DB->get_records_sql($coosql, array('id' => $id));\n foreach ($coordinatordetails as $cds) {\n $mform->setDefault('locid', $cds->locationid);\n $nameselect->setSelected($cds->userid);\n $mform->setDefault('starttime', $cds->starttime);\n $mform->setDefault('endtime', $cds->endtime);\n }\n }\n //put save and cancel buttons in same group\n //$mform->addElement('html', \"<div class=memlstgup align=center>\");\n $buttonarray = array();\n $buttonarray[] = &$mform->createElement('submit', 'save', get_string('save', 'local_adsafe'));\n $buttonarray[] = &$mform->createElement('cancel', 'cancel', get_string('cancel', 'local_adsafe'));\n $mform->addGroup($buttonarray, 'buttomem', '&nbsp;', array(''), false);\n //$mform->addElement('html', \"</div>\");\n }", "private function set_application_answered_correctly() {\n\n // set state off response, if it's there\n if(isset($this->response['application_answered_correctly'])) {\n $application_answered_correctly = $this->response['application_answered_correctly'];\n }\n // try to set the state from the cookie\n elseif(isset($_COOKIE['application_ac'])) {\n $application_answered_correctly = $_COOKIE['application_ac'];\n }\n // probably a new assessment\n else {\n $application_answered_correctly = 0;\n }\n\n $this->application_answered_correctly = $application_answered_correctly;\n }", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "public function getLocation();", "private function _getLocation()\n {\n //echo \"_getLocation()... \";\n if (FALSE === $this->_isValidLocation()) {\n //echo \"Not valid location\\n\";\n $tmp = $this->mrUser->getEnvironment();\n if (isset($this->__GET['method']) && FALSE !== $tmp) {\n $this->__GET['location'] = $tmp->location;\n $this->__GET['sublocation'] = $tmp->sublocation;\n } elseif (isset($this->mrUser->_GET['proxy'])\n || (FALSE !== $tmp && (isset($this->mrUser->_GET['ajax'])\n || isset($this->__GET['method']))\n && isset($tmp->isLayered) && FALSE !== $tmp->isLayered)) {\n $this->__GET['location'] = $tmp->location;\n } else {\n $this->__GET['location'] = DPUNIVERSE_PAGE_PATH . 'index.php';\n }\n } else {\n //echo \"Valid location\\n\";\n }\n }", "public function getLocationDisabled()\n {\n if (array_key_exists(\"locationDisabled\", $this->_propDict)) {\n return $this->_propDict[\"locationDisabled\"];\n } else {\n return null;\n }\n }", "public function getLocation()\r\r\n {\r\r\n return $this->location;\r\r\n }", "function markAnswer ($answer)\n {\n\tglobal $debug;\n \t//if ($debug) { print \"This answer $answer \\n\";}\n \t// radio / checkbox - answer must be same as \n \tif ($this->type == 'radio' || $this->type == 'checkbox')\n \t{\n \t\tif ($answer == $this->answer) {return true;}\n \t\telse {return false;}\n \t}\n \telseif ($this->type == 'number')\n \t{\n \t\t// split answer into min max\n \t\t$min_max = explode (',', $this->answer);\n \t\tif ($answer >= $min_max[0] && $answer <= $min_max[1]) {return true;}\n \t\telse {return false;}\n \t}\n \telseif ($this->type == 'text')\n \t{\n \t\t// note that ¬ is used instead of / / in the search - otherwise problems with paths in the question (eg. linux quiz)\n \t\t//$answer_test = stripslashes($this->answer); \n \t\t//$answer_test = addslashes($this->answer);\n \t\t$answer_test = $this->answer;\n \t\tif (isset($debug) && $debug == true) {print \"Test: \".'¬^'.$answer_test.'$¬i'.\"<br />\\n\"; print \"Answer $answer<br />\\n\";}\n \t\tif (preg_match('¬^'.$answer_test.'$¬i', $answer)) {return true;}\n \t\telse {return false;}\n \t}\n \t// as text, but without ignore case\n \telseif ($this->type == 'TEXT')\n \t{\n \t\tif (preg_match('¬^'.$this->answer.'$¬', $answer)) {return true;}\n \t\telse {return false;}\n \t}\n \t// invalid type\n \telse \n \t{\n \t\t// error in question configuration\n \t\t$err = Errors::getInstance();\n \t\t$err->errorEvent(WARNING_QUESTION, \"Warning, unknown question type for $this->questionid\");\n \t\treturn false;\n \t} \n \t\n }", "function has_location() { \n\n global $post;\n $geo = GeoPress::get_geo($post->ID);\n if($geo)\n return true;\n else\n return false;\n}", "function getLocation() {\n if (!$this->location) {\n $this->location = (new LocationBuilder($this));\n }\n\n return $this->location;\n }", "protected function define_answer_options_properties_section()\n {\n global $PAGE, $OUTPUT;\n $mform = $this->_form;\n\n // header\n $mform->addElement('header', 'answeroptionspropertiesheader',\n get_string(\"answer_options_properties\", 'qtype_omerocommon'));\n\n // selector to allow single or multi answers\n $menu = array(\n get_string('answersingleno', 'qtype_omerocommon'),\n get_string('answersingleyes', 'qtype_omerocommon'),\n );\n $mform->addElement('select', 'single',\n get_string('answerhowmany', 'qtype_omerocommon'), $menu);\n $mform->setDefault('single', 1);\n\n // how to number answer options\n $mform->addElement('select', 'answernumbering',\n get_string('answernumbering', 'qtype_multichoice'),\n qtype_multichoice::get_numbering_styles());\n $mform->setDefault('answernumbering', 'abc');\n\n // default mark\n $mform->addElement('text', 'defaultmark', get_string('defaultmark', 'question'),\n array('size' => 7));\n $mform->setType('defaultmark', PARAM_FLOAT);\n $mform->setDefault('defaultmark', 1);\n $mform->addRule('defaultmark', null, 'required', null, 'client');\n\n // flag to set the shuffling of answer options\n $mform->addElement('advcheckbox', 'shuffleanswers',\n get_string('shuffleanswers', 'qtype_multichoice'), null, null, array(0, 1));\n $mform->addHelpButton('shuffleanswers', 'shuffleanswers', 'qtype_multichoice');\n $mform->setDefault('shuffleanswers', 1);\n\n // set as expanded by default\n $mform->setExpanded('answeroptionspropertiesheader');\n }", "public function testLocation() {\n\t\t$response = new CakeResponse();\n\t\t$this->assertNull($response->location(), 'No header should be set.');\n\t\t$this->assertNull($response->location('http://example.org'), 'Setting a location should return null');\n\t\t$this->assertEquals('http://example.org', $response->location(), 'Reading a location should return the value.');\n\t}", "function testNearestOptionedLocation() {\n\t\t// And our location is kyoto.\n\t\t$env = CPEnvironmentStub::getCPEnvironment(array('ExclusiveOR' => array(\n\t\t\t\t'Osaka' => array('Location' => 'nearest(osaka)'),\n\t\t\t\t'Tokyo' => array('Location' => 'nearest(tokyo)')\n\t\t\t\t)));\n\t\t$cond = new Location();\n\t\t$this->assertEquals(true, $cond->doesSatisfy($env, \"nearest(osaka)\"));\n\t\t$this->assertEquals(false, $cond->doesSatisfy($env, \"nearest(tokyo)\"));\n\t}", "public function get_location_data(){\n\t\t\t$event_id = $this->event_id;\n\t\t\t$location_terms = wp_get_post_terms($event_id, 'event_location');\n\n\t\t\tif ( $location_terms && ! is_wp_error( $location_terms ) ){\n\n\t\t\t\t$output = array();\n\n\t\t\t\t$evo_location_tax_id = $location_terms[0]->term_id;\n\t\t\t\t$event_tax_meta_options = get_option( \"evo_tax_meta\");\n\t\t\t\t\n\t\t\t\t// check location term meta values on new and old\n\t\t\t\t$LocTermMeta = evo_get_term_meta( 'event_location', $evo_location_tax_id, $event_tax_meta_options);\n\t\t\t\t\n\t\t\t\t// location name\n\t\t\t\t\t$output['name'] = stripslashes( $location_terms[0]->name );\n\n\t\t\t\t// description\n\t\t\t\t\tif(!empty($location_terms[0]->description))\n\t\t\t\t\t\t$output['description'] = $location_terms[0]->description;\n\n\t\t\t\t// meta values\n\t\t\t\tforeach(array(\n\t\t\t\t\t'location_address','location_lat','location_lon','evo_loc_img'\n\t\t\t\t) as $key){\n\t\t\t\t\tif(empty($LocTermMeta[$key])) continue;\n\t\t\t\t\t$output[$key] = $LocTermMeta[$key];\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\treturn $output;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "abstract public function getLocation();", "abstract public function getLocation();", "public function hasAnswer(ChoiceAnswer $answer);", "public function setLocation($location)\n {\n $this->location = $location;\n }", "public function _validation_locations($str, $isSeller)\r\n\t{\r\n\t\t$locations = json_decode($str);\r\n\t\tif($locations === null || !is_array($locations))\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message(\"_validation_locations\", \"Couldn't decode locations\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($locations) && $isSeller)\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message(\"_validation_locations\", \"At least one location is required\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$valid = true;\r\n\t\tforeach($locations as $location)\r\n\t\t{\r\n\t\t\t$valid = !$valid || empty($location->street1) ? false : true; \r\n\t\t\t$valid = !$valid || empty($location->city) ? false : true; \r\n\t\t\t$valid = !$valid || empty($location->region) ? false : true; \r\n\t\t\t$valid = !$valid || empty($location->postalCode) ? false : true; \r\n\t\t\t$valid = !$valid || empty($location->country) ? false : true; \r\n\r\n\t\t\tif(!$valid)\r\n\t\t\t{\r\n\t\t\t\t$this->form_validation->set_message(\"_validation_locations\", \"The locations are invalid\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function getLocation()\n {\n return $this->location;\n }", "public function setLocationId(){\n\t\t$app = JFactory::getApplication();\n\t\t\n\t\t$this->data = $app->input->get('jbl_form', null, null);\n\t\t$this->choose = $app->input->get('choose');\n\t\t$this->location_id = $app->input->get('location_id');\n\t\t$this->setAttributes();\n\t\tif($this->choose == 1){\n\t\t\t//location_id is gedurende hele traject, de location_id zoals aangegeven in menu params\n\t\t\t$app->setUserState(\"jbl_option.location_id\", null);\n\t\t\t$app->setUserState(\"jbl_option.location_id\", $this->location_id);\n\t\t} elseif($this->choose == 0){\n\t\t\t//location_id wordt bepaald door list op default pagina. userState alleen zetten indien in form location opgegeven wordt\n\t\t\tif(isset($this->data['location'])){\n\t\t\t\t$app->setUserState(\"jbl_option.location_id\", null);\n\t\t\t\t$app->setUserState(\"jbl_option.location_id\", $this->data['location']);\n\t\t\t}\n\t\t}\n\t}", "public function getLocation()\r\n {\r\n return $this->location;\r\n }", "public function hasLocations()\r\n\t{\r\n\t\tif(isset($this->locations))\r\n\t\t\treturn count($this->locations) > 0;\r\n\t\t\r\n\t\t$this->_CI->load->library(\"locationlib\");\r\n\t\treturn $this->_CI->locationlib->countLocationsByUser($this) > 0;\r\n\t}", "public function setLocation ($location)\n\t{\n\t\t$this->location = $location;\n\t}", "public function set_location($location)\n {\n // Change the state location from full name to its initial.\n $abvr = $this -> find_initials($location);\n \n // Check to see if state is null.\n if(isset($abvr))\n {\n // Start session to store session variables.\n session_start();\n\n // Set the long text location into session.\n $_SESSION[\"location\"] = $location;\n \n // Set the state initials into session.\n $_SESSION[\"abvr\"] = $abvr;\n }\n }", "public function getBooleananswerrequired()\n {\n return $this->booleananswerrequired;\n }", "public function getLocation(){\n return $this->location;\n }", "public function get_location_fields() {\n\n\t\t\t// The default location fields we want to map for GravityForms\n\t\t\t$location_fields = array(\n\t\t\t\t'sl_store' => __('Name' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_address' => __('Address' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_address2' => __('Address 2' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_city' => __('City' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_state' => __('State' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_zip' => __('Zip' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_country' => __('Country' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_tags' => __('Tags' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_image' => __('Image' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_description'=> __('Description' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_email' => __('Email' ,'slp-gravity-forms-locations-free'),\n\t\t\t\t'sl_url' => $this->slplus->WPML->get_text( 'label_website' ,\n\t\t\t\t\t\t\t\t\t\t$this->slplus->WPOption_Manager->get_wp_option( 'label_website', __('Website','slp-gravity-forms-locations-free') ) ,\n\t\t\t\t\t\t\t\t\t\t'slp-gravity-forms-locations-free'\n\t\t\t\t\t\t\t\t\t ) ,\n\t\t\t\t'sl_hours' => $this->slplus->WPML->get_text( 'label_hours' ,\n\t\t\t\t\t\t\t\t\t\t$this->slplus->WPOption_Manager->get_wp_option( 'label_hours' , __('Hours','slp-gravity-forms-locations-free') ),\n\t\t\t\t\t\t\t\t\t\t'slp-gravity-forms-locations-free'\n\t\t\t\t\t\t\t\t\t) ,\n\t\t\t\t'sl_phone' => $this->slplus->WPML->get_text( 'label_phone' ,\n\t\t\t\t\t\t\t\t\t\t$this->slplus->WPOption_Manager->get_wp_option( 'label_phone' , __('Phone','slp-gravity-forms-locations-free') ),\n\t\t\t\t\t\t\t\t\t\t'slp-gravity-forms-locations-free'\n\t\t\t\t\t\t\t\t\t) ,\n\t\t\t\t'sl_fax' => $this->slplus->WPML->get_text( 'label_fax' ,\n\t\t\t\t\t\t\t\t\t\t$this->slplus->WPOption_Manager->get_wp_option( 'label_fax' , __('Fax','slp-gravity-forms-locations-free') ),\n\t\t\t\t\t\t\t\t\t\t'slp-gravity-forms-locations-free'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t//-------------------------\n\t\t\t// GFI_Pro ACTION: slp_gfl_settings_page\n\t\t\t// params: settings object, section name\n\t\t\t//-------------------------\n\t\t\t$location_fields = apply_filters('slp_gfl_get_location_fields', $location_fields);\n\n\t\t\t$this->debugMP('pr', __FUNCTION__ . ' location_fields:', $location_fields);\n\n\t\t\treturn $location_fields;\n\n\t\t}", "public function is_valid_location_type($type)\n {\n }", "public function testLocationSearchPost()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function accommodation_location(){\n\t\t$type_name = self::get_accommodation_data('type');\n\t\t$type_slug = self::get_accommodation_data('slug');\n\t\t$taxonomy_name = self::get_accommodation_location_data('type');\n\t\t$taxonomy_slug = self::get_accommodation_location_data('slug');\n\t\t$labels\t = array(\n\t\t\t'name'\t\t\t\t\t\t => _x( 'Accommodation Location', 'taxonomy general name', $this->text_domain_name ),\n\t\t\t'singular_name'\t\t\t\t => _x( 'Accommodation Location', 'taxonomy singular name', $this->text_domain_name ),\n\t\t\t'search_items'\t\t\t\t => __( 'Search Accommodation Locations', $this->text_domain_name ),\n\t\t\t'popular_items'\t\t\t\t => __( 'Popular Accommodation Locations', $this->text_domain_name ),\n\t\t\t'all_items'\t\t\t\t\t => __( 'All Accommodation Locations', $this->text_domain_name ),\n\t\t\t'parent_item'\t\t\t\t => null,\n\t\t\t'parent_item_colon'\t\t\t => null,\n\t\t\t'edit_item'\t\t\t\t\t => __( 'Edit Accommodation Location', $this->text_domain_name ),\n\t\t\t'update_item'\t\t\t\t => __( 'Update Accommodation Location', $this->text_domain_name ),\n\t\t\t'add_new_item'\t\t\t\t => __( 'Add New Location', $this->text_domain_name ),\n\t\t\t'new_item_name'\t\t\t\t => __( 'New Location', $this->text_domain_name ),\n\t\t\t'separate_items_with_commas' => __( 'Separate Locations with commas', $this->text_domain_name ),\n\t\t\t'add_or_remove_items'\t\t => __( 'Add or remove Locations', $this->text_domain_name ),\n\t\t\t'choose_from_most_used'\t\t => __( 'Choose from the most used Location', $this->text_domain_name ),\n\t\t\t'not_found'\t\t\t\t\t => __( 'No Location found.', $this->text_domain_name ),\n\t\t\t'menu_name'\t\t\t\t\t => __( 'Locations', $this->text_domain_name ),\n\t\t);\n\t\t$args\t = array(\n\t\t\t\"labels\"\t\t\t => $labels,\n\t\t\t'public'\t\t\t => false,\n\t\t\t'hierarchical'\t\t => false,\n\t\t\t'show_ui'\t\t\t => true,\n\t\t\t'show_in_nav_menus'\t => false,\n\t\t\t'show_admin_column'\t => true,\n\t\t\t'args'\t\t\t\t => array('orderby' => 'term_order'),\n\t\t\t'query_var'\t\t\t => false,\n\t\t\t'rewrite'\t\t\t => false,\n\t\t\t'meta_box_cb'\t\t => false,\n\t\t);\n\t\tregister_taxonomy( $taxonomy_name, $type_name, $args );\n\t}" ]
[ "0.7899887", "0.5591089", "0.5521851", "0.55035543", "0.5404453", "0.53202814", "0.52743375", "0.5268212", "0.52611667", "0.5177908", "0.5165714", "0.5159297", "0.5120322", "0.50832564", "0.50832564", "0.50832564", "0.50832564", "0.50832564", "0.50832564", "0.50322217", "0.50322217", "0.50322217", "0.50322217", "0.50322217", "0.49815625", "0.4958777", "0.4926909", "0.48826256", "0.4827745", "0.4771618", "0.4771618", "0.4759718", "0.47563514", "0.47497916", "0.47146416", "0.4708731", "0.47084737", "0.47083712", "0.46985537", "0.46885976", "0.4672781", "0.46723217", "0.46713507", "0.46664453", "0.465417", "0.46486807", "0.46478432", "0.46473825", "0.46384025", "0.46195218", "0.46183413", "0.4609144", "0.46073923", "0.45684963", "0.4564004", "0.45335338", "0.45235538", "0.45067376", "0.45027226", "0.4497587", "0.4496308", "0.44931656", "0.4481796", "0.44758132", "0.44750175", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44740415", "0.44644088", "0.44604632", "0.4458614", "0.44573122", "0.4453695", "0.44525218", "0.44521508", "0.44509107", "0.4450732", "0.4446535", "0.44437507", "0.44437507", "0.44333658", "0.44233373", "0.44218293", "0.44213688", "0.44199255", "0.44195408", "0.44174492", "0.44120622", "0.44085726", "0.4406625", "0.44054675", "0.44042775", "0.43958062", "0.43927142", "0.43916222" ]
0.8191639
0
Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping).
Форматирует сообщение в соответствии с заданными стилями, обрезая по `$width` (0 означает, что обрезка не производится).
public function formatAndWrap(string $message, int $width): string;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function prepareMessage($message, $format, $width = null)\n {\n switch ( $format )\n {\n case \"success\":\n $prefix = \"<fg=green>\";\n $suffix = \"</>\";\n break;\n case \"info\":\n case \"msg\":\n case \"comment\":\n case \"error\":\n $prefix = \"<\".$format.\">\";\n $suffix = \"</\".$format.\">\";\n break;\n default:\n $prefix = \"\";\n $suffix = \"\";\n break;\n }\n\n if ( $width )\n {\n if ( $width > strlen( $message ) )\n {\n $message = str_pad( $message, $width );\n }\n else\n {\n $message = substr( $message, 0, $width - 5 ) . '... ';\n }\n }\n // Let's not format padding\n $trimmed = trim($message);\n // Wrap the message in the tags\n $message = str_replace( $trimmed, $prefix . $trimmed . $suffix, $message );\n\n return $message;\n\n }", "function formatMessage($message, $styles)\n{\n if (empty($styles) || !ansiColorsSupported()) {\n return $message;\n }\n\n return sprintf(\"\\x1b[%sm\", implode(';', array_map('getStyleCode', $styles))) . $message . \"\\x1b[0m\";\n}", "public function format($string, Style $style = null);", "public static function width($width) {\r\n $units = 'px';\r\n if (strpos($width, 'px') !== false) { $units = ''; }\r\n if (strpos($width, 'em') !== false) { $units = ''; }\r\n if (strpos($width, '%') !== false) { $units = ''; }\r\n return ((!empty($width)) ? ' width:'. $width . $units . ';' : '');\r\n }", "public function horizontalLine($style = '') {\n\t\tif (UNICODE) {\n\t\t\t$linePaddingLength = mb_strlen('─') * (TERMINAL_WIDTH);\n\t\t\t$message =\n\t\t\t\tstr_pad('', $linePaddingLength, '─');\n\t\t} else {\n\t\t\t$message =\n\t\t\t\tstr_pad('', TERMINAL_WIDTH, '-');\n\t\t}\n\t\tswitch ($style) {\n\t\t\tcase 'error':\n\t\t\t\t$this->errorMessage($message, FALSE);\n\t\t\t\tbreak;\n\t\t\tcase 'info':\n\t\t\t\t$this->infoMessage($message, FALSE);\n\t\t\t\tbreak;\n\t\t\tcase 'success':\n\t\t\t\t$this->successMessage($message, FALSE);\n\t\t\t\tbreak;\n\t\t\tcase 'warning':\n\t\t\t\t$this->warningMessage($message, FALSE);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->message($message);\n\t\t}\n\t}", "public function formatBlock($messages, $style, $large = false)\n {\n if (!is_array($messages)) {\n $messages = array($messages);\n }\n\n $len = 0;\n $lines = array();\n foreach ($messages as $message) {\n $message = OutputFormatter::escape($message);\n $lines[] = sprintf($large ? ' %s ' : ' %s ', $message);\n $len = max(strlen($message) + ($large ? 4 : 2), $len);\n }\n\n $messages = $large ? array(str_repeat(' ', $len)) : array();\n for ($i = 0; isset($lines[$i]); ++$i) {\n $messages[] = $lines[$i].str_repeat(' ', $len - strlen($lines[$i]));\n }\n if ($large) {\n $messages[] = str_repeat(' ', $len);\n }\n\n for ($i = 0; isset($messages[$i]); ++$i) {\n $messages[$i] = sprintf('<%s>%s</%s>', $style, $messages[$i], $style);\n }\n\n return implode(\"\\n\", $messages);\n }", "public function formatWrap($value, $length)\n\t{\n\t\treturn wordwrap($value, $length, '<br />', true);\n\t}", "private function textWrap($text, $width, $fontSize) {\n\t\t$strWidth = $this->cb->GetStringWidth($text, '', '', $fontSize, false);\n\t\t// if text should be wrapped\n\t\tif ($strWidth >= $width) {\n\t\t\t$newStr = '';\n\t\t\t$newW = 0;\n\t\t\t$i = 0;\n\t\t\t// adds one symbol and checks text width\n\t\t\twhile ($newW < $width - 1) {\n\t\t\t\t$newStr .= $text[$i];\n\t\t\t\t$newW = $this->cb->GetStringWidth($newStr.$text[$i + 1].'...', '', '', $fontSize, false);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $newStr.'...';\n\t\t} else {\n\t\t\treturn $text;\n\t\t}\n\t}", "public function width($width)\n {\n if (is_numeric($width)) {\n $this->width = $width;\n } else {\n $this->style = \"width:$width;padding-left:10px;padding-right:10px\";\n $this->width = ' ';\n }\n\n return $this;\n }", "public function write($message, $format = null, $width = null, $level = OutputInterface::VERBOSITY_NORMAL)\n {\n $message = $this->prepareMessage( $message, $format, $width );\n $this->_Output->write( $message, false, $level );\n\n return $this;\n }", "function splitWithWidth($strs, $strWidths, $totalWidth, $maxWidth, $fontSize, $fontStyle, $EnglishSplitSymbol) {\n\t\t$newStrsArray = array(); //2-D array, each element is one print line\n\t\t$newStrs = array(); //1-D array, element of $newStrsArray\n\t\t$temWidth = 0;\n\t\t\t\t\n\t\t$lineCount = ceil($totalWidth / $maxWidth); //line count\n\t\t$lineWidth = $totalWidth / $lineCount; //minimal line width (for all line, the current line is SHORTER than its previous line)\n\t\t$isChinese = checkChinese($strs); //check whether each string is Chinese or English\n\t\t\n\t\tfor($i=0; $i<count($strs); ++$i) {\n\t\t\t$temWidth = $temWidth + $strWidths[$i];\n\t\t\t\n\t\t\tif($temWidth > $lineWidth) {\n\t\t\t\t$temWidth = $temWidth - $strWidths[$i];\n\t\t\t\t\n\t\t\t\tif($isChinese[$i]) {\n\t\t\t\t\t$splitRegExp = '//u';\n\t\t\t\t\t$concatSymbol = '';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$splitRegExp = '/[' . $EnglishSplitSymbol . ']+/u';\n\t\t\t\t\t$concatSymbol = ( $EnglishSplitSymbol=='\\s' ) ? ' ' : $EnglishSplitSymbol;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$pieces = preg_split($splitRegExp, $strs[$i]);\n\t\t\t\t$pieceWidths = calWidths($pieces, $fontSize, $fontStyle); //calculate widths of each piece (string)\n\t\t\t\t\n\t\t\t\t$currentLine = ''; \n\t\t\t\tfor($j=0; $j<count($pieces); ++$j) {\n\t\t\t\t\t$temWidth = $temWidth + $pieceWidths[$j];\n\t\t\t\t\t\n\t\t\t\t\tif($temWidth >= $lineWidth) {\n\t\t\t\t\t\tif($temWidth <= $maxWidth)\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$currentLine = ($j == count($pieces)-1)? $currentLine.$pieces[$j] : $currentLine.$pieces[$j].$concatSymbol;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tarray_push($newStrs, trim($currentLine, ' '));\n\t\t\t\t\t\t\tarray_push($newStrsArray, $newStrs);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$newStrs = array();\t\n\t\t\t\t\t\t\t$currentLine = '';\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temWidth = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tarray_push($newStrs, trim($currentLine, ' '));\n\t\t\t\t\t\t\tarray_push($newStrsArray, $newStrs);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$newStrs = array();\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$currentLine = ($j == count($pieces)-1)? $pieces[$j] : $pieces[$j].$concatSymbol;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temWidth = $pieceWidths[$j];\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$currentLine = ($j == count($pieces)-1)? $currentLine.$pieces[$j] : $currentLine.$pieces[$j].$concatSymbol;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(trim($currentLine, ' ') != '') {\n\t\t\t\t\tarray_push($newStrs, trim($currentLine, ' '));\n\t\t\t\t\tif($i == count($strs)-1) array_push($newStrsArray, $newStrs);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\telseif($temWidth == $lineWidth) {\n\t\t\t\tarray_push($newStrs, $strs[$i]);\n\t\t\t\tarray_push($newStrsArray, $newStrs);\n\t\t\t\t\n\t\t\t\t$newStrs = array();\n\t\t\t\t$temWidth = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tarray_push($newStrs, $strs[$i]);\n\t\t\t\tif($i == count($strs)-1) array_push($newStrsArray, $newStrs);\n\t\t\t}\t\t\t\t\t\t\n\t\t}\t\n\t\t\n\t\treturn $newStrsArray;\n\t}", "function formatmsg($msg) {\r\n global $CONFIG;\r\n\r\n $msg = stripslashes($msg);\r\n\r\n // Remove html (if not allowed):\r\n if ($CONFIG['allowhtml'] == 'no') {\r\n $msg = htmlspecialchars($msg);\r\n }\r\n \r\n // Do tags (if allowed):\r\n if ($CONFIG['allowtags'] == 'yes') {\r\n $lststyle = 'style=\"margin-top: 0px; margin-bottom: 0px;\"';\r\n\r\n $tags = array('/\\[b\\](.*)\\[\\/b\\]/siU', '/\\[i\\](.*)\\[\\/i\\]/siU', '/\\[u\\](.*)\\[\\/u\\]/siU',\r\n '/\\[url\\](.*)\\[\\/url\\]/siU', '/\\[url=(.*)\\](.*)\\[\\/url\\]/siU', '/\\[quote\\](.*)\\[\\/quote\\](\\r\\n|)/siU',\r\n '/\\[color=(.*)\\](.*)\\[\\/color\\]/siU', '/\\[size=(8|10|14|16)\\](.*)\\[\\/size\\]/siU',\r\n '/\\[align=(.*)\\](.*)\\[\\/align\\]/siU', '/\\[hr\\]/');\r\n\r\n $html = array('<b>\\\\1</b>', '<i>\\\\1</i>', '<u>\\\\1</u>', '<a href=\"\\\\1\" target=\"_blank\">\\\\1</a>',\r\n '<a href=\"\\\\1\" target=\"_blank\">\\\\2</a>', \r\n '<div align=\"center\">\r\n <div align=\"left\" style=\"width: 95%;\">\r\n <span style=\"font-size: 8pt; font-weight: bold;\">quote:</span><hr>\\\\1<hr>\r\n </div>\r\n </div>', '<span style=\"color: \\\\1;\">\\\\2</span>', '<span style=\"font-size: \\\\1pt;\">\\\\2</span>',\r\n '<div align=\"\\\\1\">\\\\2</div>', '<hr>');\r\n\r\n $msg = preg_replace($tags, $html, $msg);\r\n\r\n // If image tags are allowed:\r\n if ($CONFIG['allowimages'] == 'yes') {\r\n $msg = preg_replace(\"/\\[img\\](.*)\\[\\/img\\]/siU\", \"<img src=\\\"\\\\1\\\" alt=\\\"\\\" border=\\\"0\\\">\", $msg);\r\n $msg = preg_replace(\"/\\[img\\ align=(.*)](.*)\\[\\/img\\]/siU\", \r\n \"<img src=\\\"\\\\2\\\" alt=\\\"\\\" style=\\\"float: \\\\1\\\" border=\\\"0\\\">\", $msg);\r\n }\r\n }\r\n\r\n // Remove long lines and change newlines to <br />:\r\n $msg = preg_replace(\"#([^\\n\\r ?&./<>\\\"\\\\-\\[\\]]{80})#i\", \"\\\\1\\n\", $msg);\r\n $msg = nl2br($msg);\r\n\r\n if ($CONFIG['allowtags'] == 'yes') {\r\n require_once 'function.listtag.php';\r\n\r\n $msg = listtag($msg);\r\n }\r\n\r\n // Return the formatted message:\r\n return $msg;\r\n }", "abstract function format($message);", "function af_format_message($msg) {\n $msg = wordwrap($msg, 75, \"\\n\", true);\n $msg = str_replace(\"\\n\", \"\\r\\n\", $msg);\n return $msg;\n}", "public function wrapText($message, $length, $qp_mode = \\false)\n {\n }", "function widths_message() {\n\t\t$recommend = \"<span class='expand'>Your theme recommends the responsive header to have sources of the following sizes <strong>: \".join(', ', $this->widths_strings() ).\"px</strong></span>\";\n\t\t$link = \"<span class='fa fa-plus-circle'></span><input type='checkbox' name='fake'> \".$recommend;\n\t\treturn sprintf( __( \"<div class='sandwich'>Your responsive header now has every <button disabled>recommended %s</button> image source. Add more images to your liking.</div>\",\"%s\"), $link, 'respHeader' );\n\t}", "public function format($style = \"none\") {\n if ($style != \"none\") {\n if (!is_array($style)) {\n $style = func_get_args();\n }\n\n $this->style->set($style);\n }\n\n $output = $this->style->has(DokuwikiCallsStyle::START_WITH_NEW_LINE) ? \"\\n\" : '';\n $count = count($this->calls);\n\n for ($index = 0; $index < $count; $index += $progress) {\n list($call, $progress) = $this->getCall($index);\n\n if (!$this->style->getHideIndex()) {\n $output .= $this->formatIndex($index, $call);\n }\n\n $output .= $this->formatCall($call);\n }\n\n return $output;\n }", "public function width($width)\n {\n return $this->setSimpleValue('width', $width && is_numeric($width) ? \"{$width}px\" : $width);\n }", "function smart_wordwrap($string, $width, $break = \"<br>\") {\n $pattern = sprintf('/([^ ]{%d,})/', $width);\n $output = '';\n $words = preg_split($pattern, $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\n\n foreach ($words as $word) {\n // normal behaviour, rebuild the string\n if (false !== strpos($word, ' ')) {\n $output .= $word;\n } else {\n // work out how many characters would be on the current line\n $wrapped = explode($break, wordwrap($output, $width, $break));\n $count = $width - (strlen(end($wrapped)) % $width);\n\n // fill the current line and add a break\n $output .= substr($word, 0, $count) . $break;\n\n // wrap any remaining characters from the problem word\n $output .= wordwrap(substr($word, $count), $width, $break, true);\n }\n }\n\n // wrap the final output\n return wordwrap($output, $width, $break);\n }", "function codeless_widthToSpan( $width ) {\n preg_match( '/(\\d+)\\/(\\d+)/', $width, $matches );\n\n if ( ! empty( $matches ) ) {\n $part_x = (int) $matches[1];\n $part_y = (int) $matches[2];\n if ( $part_x > 0 && $part_y > 0 ) {\n $value = ceil( $part_x / $part_y * 12 );\n if ( $value > 0 && $value <= 12 ) {\n $width = codeless_cols_prepend() . $value;\n }\n }\n }\n\n return $width;\n}", "public function headerMessage($message, $style = 'info') {\n\t\t// Crop the message\n\t\t$message = substr($message, 0, TERMINAL_WIDTH);\n\t\tif (UNICODE) {\n\t\t\t$linePaddingLength = mb_strlen('─') * (TERMINAL_WIDTH);\n\t\t\t$message =\n\t\t\t\tstr_pad('', $linePaddingLength, '─') . LF .\n\t\t\t\tstr_pad($message, TERMINAL_WIDTH) . LF .\n\t\t\t\tstr_pad('', $linePaddingLength, '─');\n\t\t} else {\n\t\t\t$message =\n\t\t\t\tstr_pad('', TERMINAL_WIDTH, '-') . LF .\n\t\t\t\tstr_pad($message, TERMINAL_WIDTH) . LF .\n\t\t\t\tstr_pad('', TERMINAL_WIDTH, '-');\n\t\t}\n\t\tswitch ($style) {\n\t\t\tcase 'error':\n\t\t\t\t$this->errorMessage($message, FALSE);\n\t\t\t\tbreak;\n\t\t\tcase 'info':\n\t\t\t\t$this->infoMessage($message, FALSE);\n\t\t\t\tbreak;\n\t\t\tcase 'success':\n\t\t\t\t$this->successMessage($message, FALSE);\n\t\t\t\tbreak;\n\t\t\tcase 'warning':\n\t\t\t\t$this->warningMessage($message, FALSE);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->message($message);\n\t\t}\n\t}", "function wordWrap(int $width, string $break = \"\\n\", bool $cut = false): Closure\n{\n /**\n * @param string $string The string to be wrapped\n * @return string\n */\n return function (string $string) use ($width, $break, $cut): string {\n return \\wordwrap($string, $width, $break, $cut);\n };\n}", "function wrap($text,$fontFile,$fontSize,$width,$fontAngle = 0)\r\n{\t\r\n\t$ret = \"\";\r\n\t\r\n\t$arr = explode(' ', $text);\r\n\t\r\n\tforeach ( $arr as $word ){\r\n\t\r\n\t\t$teststring = $ret.' '.$word;\r\n\t\t$testbox = imagettfbbox($fontSize, $fontAngle, $fontFile, $teststring);\r\n\t\tif ( $testbox[2] > $width ){\r\n\t\t\t$ret.=($ret==\"\"?\"\":\"\\n\").$word;\r\n\t\t} else {\r\n\t\t\t$ret.=($ret==\"\"?\"\":' ').$word;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $ret;\r\n}", "public function format($message, $context);", "public static function tokenTruncate($string, $width)\n {\n $parts = preg_split('/([\\s\\n\\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);\n $parts_count = count($parts);\n\n $length = 0;\n $last_part = 0;\n for (; $last_part < $parts_count; ++$last_part) {\n $length += strlen($parts[$last_part]);\n if ($length > $width) { break; }\n }\n\n $rtn = implode(array_slice($parts, 0, $last_part));\n if ($rtn !== $string) {\n $rtn = $rtn . '...';\n }\n\n return $rtn;\n }", "public function wrapLines($message, $width = 72, $cut = false)\n {\n $message = $this->fixEOL($message);\n\n if (PMF_String::strpos(strtolower($this->charset), 'utf') !== false) {\n // PHP wordwrap() is not safe with multibyte UTF chars\n return $message;\n } else {\n $lines = explode($this->eol, $message);\n $wrapped = '';\n foreach ($lines as $value) {\n $wrapped .= (empty($wrapped) ? '' : $this->eol);\n $wrapped .= wordwrap($value, $width, $this->eol, $cut);\n }\n\n return $wrapped;\n }\n }", "protected function wrapFormatString($string, $style)\n {\n if ($style) {\n return \"<{$style}>$string</>\";\n }\n return $string;\n }", "private function format(): void {\r\n\r\n $rules = [];\r\n $fields = [];\r\n\r\n foreach($this -> messages as $key => $message) {\r\n\r\n if(true === is_string($message)) {\r\n $rules[strtolower($key)] = $message;\r\n }\r\n elseif(true === is_array($message)) {\r\n\r\n $field = $key;\r\n $rule = key($message);\r\n $message = reset($message);\r\n\r\n if(false === is_string($rule)) {\r\n throw new OutOfBoundsException(sprintf('Rule must be of the type string, got \"%s\"', gettype($rule)));\r\n }\r\n\r\n if(false === is_string($message)) {\r\n throw new OutOfBoundsException(sprintf('Custom error message with rule \"%s\" must be of the type string, \"%s\" given', $rule, gettype($message)));\r\n }\r\n\r\n $fields[$field] ??= [];\r\n $fields[$field][strtolower($rule)] ??= $message;\r\n }\r\n }\r\n\r\n $this -> rules = $rules;\r\n $this -> fields = $fields;\r\n }", "private function createBlock(\n array $messages,\n string $type = null,\n string $style = null,\n string $prefix = ' ',\n bool $padding = false\n ) {\n $indentLength = 0;\n $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);\n $lineIndentation = '';\n if (null !== $type) {\n $type = sprintf('[%s] ', $type);\n $indentLength = strlen($type);\n $lineIndentation = str_repeat(' ', $indentLength);\n }\n $lines = $this->getBlockLines($messages, $prefixLength, $indentLength);\n $firstLineIndex = 0;\n if ($padding && $this->isDecorated()) {\n $firstLineIndex = 1;\n array_unshift($lines, '');\n $lines[] = '';\n }\n foreach ($lines as $i => &$line) {\n if (null !== $type) {\n $line = $firstLineIndex === $i ? $type . $line : $lineIndentation . $line;\n }\n $line = $prefix . $line;\n $multiplier = $this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line);\n $line .= str_repeat(' ', $multiplier);\n if ($style) {\n $line = sprintf('<%s>%s</>', $style, $line);\n }\n }\n\n return $lines;\n }", "public function output_css( $styles = array() ) {\r\n if ( empty( $styles ) ) {\r\n return false;\r\n }\r\n\r\n $out = '';\r\n foreach ( $styles as $key => $value ) {\r\n\r\n if( ! $value ) {\r\n continue;\r\n }\r\n\r\n if( is_array( $value ) ) {\r\n\r\n switch( $key ) {\r\n\r\n case 'padding':\r\n case 'margin':\r\n $new_value = '';\r\n foreach( $value as $k => $v ) {\r\n\r\n if( '' != $v ) {\r\n $out .= sprintf( '%s: %s;', esc_html( $k ), $this->sanitize_unit($v) );\r\n }\r\n }\r\n break;\r\n\r\n default:\r\n $value = join( ';', $value );\r\n }\r\n }\r\n else {\r\n $out .= sprintf( '%s: %s;', esc_html( $key ), $value );\r\n }\r\n }\r\n\r\n return rtrim( $out, ';' );\r\n }", "public function formatMessage( $message ){\n\t\tif( !empty( $message) ){\t\n\t\t\t$msg = '<div style=\"margin-top: 20px; padding: 0 .7em;\">' ;\n\t\t\t$msg .= '\t<p><span \" style=\"float: left; margin-right: .3em;\"></span>';\n\t\t\t$msg .= $message;\n\t\t\t$msg .= '\t</p>';\n\t\t\t$msg .= '</div>';\n\t\t}else $msg='';\n\t\t\n\t\treturn $msg;\t\t\n\t}", "private function formatMessage($level, $message, $context)\n {\n $level = strtoupper($level);\n return \"[{$this->getTimestamp()}] [{$level}] {$this->interpolate($message)}\".PHP_EOL;\n }", "public function format(?string $message): string\n {\n return preg_replace_callback(self::FORMAT_PATTERN, [$this, 'replaceStyle'], $message);\n }", "function _formatFont($_text, $_color = 'BLACK', $_size = '+0')\n {\n if (empty($_color))\n $_color = 'BLACK';\n\n if (empty($_size))\n $_size = '+0';\n\n return '<FONT COLOR=\"' . $_color . '\"' .\n ' SIZE=\"' . $_size . '\">' .\n $_text . '</FONT>';\n }", "public function build()\n {\n\n $style = '';\n\n if( $this->css )\n {\n $style .= 'border: '.$this->css.';';\n }\n else if( $this->color && !is_null($this->width) && $this->style )\n {\n $style .= 'border: '.$this->width.'px '.$this->style.' '.$this->color.';';\n }\n else\n {\n if($this->color)\n $style .= 'border-color:'.$this->color.';';\n\n if(!is_null($this->width))\n $style .= 'border-width:'.$this->width.';';\n\n if($this->style)\n $style .= 'border-style:'.$this->style.';';\n }\n\n foreach( $this->subStyle as $key => $subStyle )\n {\n $style .= $subStyle->subParser( $key );\n }\n\n return $style;\n\n }", "function __hardwrap($text, $wrapWidth, $ptSize, $font, $xtraParamArr)\n\t{\n\t\t$text .= \" \"; \n\t\t$spaces = array();\n\t\t$widths = array();\n\t\t$i = 0;\n\t\t// measure the widths of all the words\n\t\twhile(true)\n\t\t{\n\t\t\t$nextSpace = strpos(substr($text,$i),\" \");\n\t\t\tif(!($nextSpace === false))\n\t\t\t{\n\t\t\t\t$spaces[] = $nextSpace + $i;\n\t\t\t\t$bbox = imageftbbox($ptSize, 0, $font, substr($text, $i, $nextSpace + 1), $xtraParamArr);\n\t\t\t\t$left = ($bbox[0] > $bbox[6])?$bbox[6]:$bbox[0]; \n\t\t\t\t$right = ($bbox[2] > $bbox[4])?$bbox[2]:$bbox[4]; \n\t\t\t\t$widths[]= $right - $left; \n\t\t\t\t$i = $nextSpace + $i + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t\t$lastspace =- 1;\n\t\t$lineWidth = 0;\n\t\t$result = \"\";\n\t\tfor ($i = 0; $i < count($spaces); $i++)\n\t\t{\n\t\t\tif((($lineWidth > 0) && ($lineWidth + $widths[$i]) > $wrapWidth)) // time for a line break\n\t\t\t{\n\t\t\t\t// wrap\n\t\t\t\t$result .= \"\\r\\n\";\n\t\t\t\t$lineWidth = 0;\n\t\t\t\t$i--;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t// add a word to line\n\t\t\t\t// we'll always get at least one word (even if too wide) thanks to \n\t\t\t\t// ($lineWidth > 0) test above\n\t\t\t\t$result .= substr($text, $lastspace + 1, $spaces[$i] - $lastspace);\n\t\t\t\t$lineWidth += $widths[$i];\n\t\t\t\t$lastspace = $spaces[$i];\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function display_width_styles() {\n\t\tif ( ! $this->get_current_list_screen() instanceof ListScreen\\ShopOrder ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$css_column_width = '';\n\n\t\tforeach ( $this->current_list_screen->get_columns() as $column ) {\n\t\t\t$setting = $column->get_setting( 'width' );\n\n\t\t\tif ( ! $setting instanceof AC\\Settings\\Column\\Width ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$width = $setting->get_column_width();\n\n\t\t\tif ( $width ) {\n\t\t\t\t$css_width = $width->get_value() . $width->get_unit();\n\t\t\t} else {\n\t\t\t\t$css_width = 'auto';\n\t\t\t}\n\n\t\t\t$css_column_width .= sprintf(\n\t\t\t\t'.ac-%s .wrap table th.column-%s { width: %s !important; }',\n\t\t\t\tesc_attr( $this->current_list_screen->get_key() ),\n\t\t\t\tesc_attr( $column->get_name() ),\n\t\t\t\t$css_width\n\t\t\t);\n\t\t\t$css_column_width .= sprintf(\n\t\t\t\t'body.acp-overflow-table.ac-%s .wrap th.column-%s { min-width: %s !important; }',\n\t\t\t\tesc_attr( $this->current_list_screen->get_key() ),\n\t\t\t\tesc_attr( $column->get_name() ),\n\t\t\t\t$css_width\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $css_column_width ) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n\t\t<style>\n\t\t\t@media screen and (min-width: 783px) {\n\t\t\t<?= $css_column_width; ?>\n\t\t\t}\n\t\t</style>\n\n\t\t<?php\n\t}", "public function drawTextWithFixedWidth($text, $x, $y, $width, $charEncoding = 'UTF-8', $align = self::ALIGN_LEFT)\n {\n $text = preg_replace('/ {2,}/i', ' ', $text);\n $text = preg_replace('#<br\\s*/?>\\r?\\n#i', '<br>', $text);\n $text_parts = preg_split(\"#(\\r?\\n|<br\\s*/?>)#\", $text);\n foreach ($text_parts as $text)\n {\n $text = explode(' ', $text);\n $line = '';\n foreach ($text as $word)\n {\n $line .= ' ' . $word;\n if ($this->widthForString($line) > $width)\n {\n $line = substr($line, 0, strlen($line) - (strlen($word) + 1));\n $this->drawText($line, $x, $y, $charEncoding, $align);\n $this->nl($y);\n $line = $word;\n }\n }\n $this->drawText($line, $x, $y, $charEncoding, $align);\n $this->nl($y);\n }\n return $y;\n }", "private function formatMessages()\n {\n //if we have messages to display, and debug is turned on\n $output = '';\n if (count($this->messages) > 0 && count($this->filters) > 0) {\n $time = microtime(true);\n $output .= $this->formatCss();\n $output .= implode(' ', $this->messages);\n if (!$this->data_dumped && in_array('STATS', $this->filters)) {\n //add db stats data...\n $db = true;\n include(GEO_BASE_DIR . 'get_common_vars.php');\n $output .= '<div class=\"error_msg\"><div>DB Query Stats: </div><div>' . $db->getStats() . '</div></div>';\n }\n $output .= '<div class=\"error_msg\"><div>Time took to display all messages: </div><div>' . (microtime(true) - $time) . '</div></div>';\n }\n $this->data_dumped = true;\n $this->messages = array();\n return $output;\n }", "function wrapLines ($lines, $style)\r\n {\r\n // if a line does not fit, attempt to break it into several lines\r\n // if it still fails, leave line as is\r\n\r\n // returns modified $lines array\r\n\r\n // get maximum allowed width for text\r\n $maxTextWidth = $this->getMaxTextWidth( $style );\r\n if (!$maxTextWidth)\r\n {\r\n // failed to get max text width, abort\r\n return $lines;\r\n }\r\n\r\n // set word delimiter\r\n $wordDelimiter = ' ';\r\n if (!empty($style['add-spaces']))\r\n {\r\n // if add-spaces is set, words must be split on multiple spaces instead of one\r\n $addedSpaces = str_repeat($wordDelimiter, $style['add-spaces']);\r\n $wordDelimiter = $addedSpaces . $wordDelimiter . $addedSpaces;\r\n }\r\n\r\n $wrappedLines = array();\r\n foreach ($lines as $line)\r\n {\r\n // check if line fits\r\n $lineWidth = $this->getTextWidth( $line, $style );\r\n if ($lineWidth <= $maxTextWidth)\r\n {\r\n // line ok, leave as is, continue to next line\r\n $wrappedLines[] = $line;\r\n continue;\r\n }\r\n\r\n // line too long, split in parts\r\n $words = mb_split( $wordDelimiter, $line);\r\n\r\n\r\n // set line to an empty string\r\n // start adding words back to the line one by one.\r\n // when the box needed for the line exceeds maxtextwidth,\r\n // store line without the last word and start a new empty line\r\n $newLine = '';\r\n foreach ($words as $word)\r\n {\r\n $word = trim($word);\r\n $testLine = trim($newLine . $wordDelimiter . $word);\r\n\r\n $lineWidth = $this->getTextWidth( $testLine, $style);\r\n\r\n if ($lineWidth > $maxTextWidth)\r\n {\r\n // line will be too long if the current word is added.\r\n if (!empty($newLine)) // if this is not the first word (preventing infinte loop if the first word is already too long)\r\n {\r\n // store current line as finished, start a new line\r\n $wrappedLines[] = $newLine;\r\n $newLine = '';\r\n $testLine = $word;\r\n }\r\n\r\n }\r\n\r\n\r\n // line fits, add current word, continue loop\r\n $newLine = $testLine;\r\n continue;\r\n }\r\n\r\n if (!empty($newLine))\r\n {\r\n $wrappedLines[] = $newLine; // add last line\r\n }\r\n\r\n }\r\n return $wrappedLines;\r\n }", "function smart_wordwrap($string, $width = 75, $break = \"\\n\")\r\n\t{\r\n\t\t$pattern = sprintf('/([^ ]{%d,})/', $width);\r\n\t\t$output = '';\r\n\t\t$words = preg_split($pattern, $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\r\n\t\r\n\t\tforeach ($words as $word) {\r\n\t\t\tif (false !== strpos($word, ' ')) {\r\n\t\t\t\t// normal behaviour, rebuild the string\r\n\t\t\t\t$output .= $word;\r\n\t\t\t} else {\r\n\t\t\t\t// work out how many characters would be on the current line\r\n\t\t\t\t$wrapped = explode($break, wordwrap($output, $width, $break));\r\n\t\t\t\t$count = $width - (strlen(end($wrapped)) % $width);\r\n\t\r\n\t\t\t\t// fill the current line and add a break\r\n\t\t\t\t$output .= substr($word, 0, $count) . $break;\r\n\t\r\n\t\t\t\t// wrap any remaining characters from the problem word\r\n\t\t\t\t$output .= wordwrap(substr($word, $count), $width, $break, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t// wrap the final output\r\n\t\treturn wordwrap($output, $width, $break);\r\n\t}", "function style_string($height=0, $width=0, $bg='', $fg='', $border='') {\n $style_ar = array();\n if($width) $style_ar[] = \"width:\".$width.\"px\";\n if($height) $style_ar[] = \"height:\".$height.\"px\";\n if($border) $style_ar[] = \"border: 1px solid #\".$border;\n if($bg) $style_ar[] = is_color($bg) ? \"background-color:#$bg\" : \"background-image: url($bg); background-repeat: repeat-x; \"; // add background color or image\n if($fg) $style_ar[] = \"color:#$fg\";\n return $style_ar ? \"style='\".implode(';', $style_ar).\"'\" : '';\n}", "function determineWordWrap($strText, $intWidth, $x, $intFont, $strFont, $intRows=0, $strEnd='...') {\n\n\t\t$strFontPath = $this->strFontPath.$strFont;\n\n\t\t$intWidth -= $x;\n\n\t\tif($intRows > 0) {\n\t\t\t$arrBoxEnd = imagettfbbox($intFont, 0, $strFontPath, $strEnd);\n\t\t\t$intEndWidth = abs($arrBoxEnd[4] - $arrBoxEnd[0]);\n\t\t}\n\n\t\t$arrBox = @imagettfbbox($intFont, 0, $strFontPath, $strText);\n\t\t$arrBoxSpace = @imagettfbbox($intFont, 0, $strFontPath, \" \");\n\t\t$intBoxSpace = abs($arrBoxSpace[4] - $arrBoxSpace[0]);\n\n\t\t$intCheck = 0; \n\t\t$intTotal = 0;\n\t\t$iFactor = 2;\n\t\t\n\t\tif($arrBox[2] > $intWidth) {\n\t\t\t$arrWidth = array();\n\t\t\t$strText = preg_replace(\"/\\r\\n|\\n|\\r/\", \"\\n\", $strText);\n\t\t\t$arrLines = explode(\"\\n\",$strText);\n\t\t\tforeach((array)$arrLines as $strLine) {\n\t\t\t\t$arrText = explode(\" \",$strLine);\n\t\t\t\tforeach($arrText as $k=>$v) {\n\t\t\t\t\t$arrBox = @imagettfbbox($intFont*$iFactor, 0, $strFontPath, $v);\n\t\t\t\t\t$arrWidth[] = array($v, round(($arrBox[2]-$arrBox[0])/$iFactor));\n\t\t\t\t\t$intTotal++;\n\t\t\t\t}\n\t\t\t\t$arrWidth[] = array(\"\\n\",0);\n\t\t\t}\n\n\t\t\tarray_pop($arrWidth);\n\n\t\t\t$arrRows = array();\n\n\t\t\t$c=0;\n\t\t\t$intRow=0;\n\t\t\t$bolLastLine = 0;\n\t\t\t$bolNewline = 0;\n\t\t\t$arrLines = array();\n\t\t\twhile(isset($arrWidth[$c])) {\n\n\t\t\t\t// Bei letzter Zeile Platz for $strEnd lassen\n\t\t\t\tif($intRows > 0) {\n\t\t\t\t\tif($intRow == ($intRows - 1)) {\n\t\t\t\t\t\t$intWidth -= $intEndWidth;\n\t\t\t\t\t\t$bolLastLine = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$intRowWidth = 0;\n\t\t\t\tdo {\n\t\t\t\t\tif($arrWidth[$c][0] == \"\\n\") {\n\t\t\t\t\t\t$c++;\n\t\t\t\t\t\t$bolNewline = 1;\n\t\t\t\t\t\t$intRow--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$arrRows[$intRow][] = $arrWidth[$c][0];\n\t\t\t\t\t$intRowWidth += $arrWidth[$c][1]+$intBoxSpace;\n\t\t\t\t\t$c++;\n\t\t\t\t} while(isset($arrWidth[$c]) && $arrWidth[$c][1] > 0 && ($intRowWidth+$arrWidth[$c][1]) <= $intWidth);\n\t\t\t\tif($bolNewline) {\n\t\t\t\t\t$bolNewline = 0;\n\t\t\t\t\t$intRow++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$arrLines[$intRow] = implode(\" \",$arrRows[$intRow]);\n\t\t\t\tif($bolLastLine) {\n\t\t\t\t\t$arrLines[$intRow] .= $strEnd;\n\t\t\t\t\t$aResult['wrap'] = implode(\"\\n\",$arrLines);\n\t\t\t\t\t$bolLastLine = 0;\n\t\t\t\t}\n\t\t\t\t$intRow++;\n\t\t\t}\n\t\t\t$aResult['text'] = implode(\"\\n\",$arrLines);\n\t\t\t$aResult['lines'] = $arrLines;\n\t\t} else {\n\t\t\t$aResult['text'] = $strText;\n\t\t\t$strText = preg_replace(\"/\\r\\n|\\n|\\r/\", \"\\n\", $strText);\n\t\t\t$arrLines = explode(\"\\n\",$strText);\n\t\t\t$aResult['lines'] = $arrLines;\n\t\t}\n\n\t\t$aDimensions = @imagettfbbox($intFont, 0, $strFontPath, $this->strCheckString);\n\t\t$aResult['lineheight'] = abs($aDimensions[5] - $aDimensions[1]);\n\t\t$aDimensions = $this->determineWordLength($aResult['text'],$intFont, $strFont);\n\t\t$aResult['height'] = $aDimensions['height'];\n\t\t$aResult['box'] = $aDimensions['box'];\n\n\t\t$baseFontMetrics = @imagettfbbox($intFont, 0, $strFontPath, \"Hello World\");\n\t\t$baselineFontHeight = (int)(abs($baseFontMetrics[5] - $baseFontMetrics[3]));\n\t\t$diffFontMetrics = @imagettfbbox($intFont, 0, $strFontPath, \"Finer Typography\");\n\t\t$diffBaselineFontHeight = (int)(abs($diffFontMetrics[5] - $diffFontMetrics[3]));\n\t\t$lineSpacing = (int)($diffBaselineFontHeight - $baselineFontHeight);\n\t\t$aResult['lineheight'] -= $lineSpacing;\n\n\t\treturn $aResult;\n\n\t}", "public function align(string $message, int $length = null, int $alignment = self::ALIGN_LEFT): string\n {\n $plainLength = Helper::strlenWithoutDecoration($this->getFormatter(), $message);\n $length = $length + (strlen($message) - $plainLength);\n \n switch ($alignment) {\n case self::ALIGN_CENTER:\n return str_pad($message, $length, ' ', STR_PAD_BOTH);\n \n case self::ALIGN_RIGHT:\n return str_pad($message, $length, ' ', STR_PAD_LEFT);\n \n default:\n case self::ALIGN_LEFT:\n return str_pad($message, $length, ' ', STR_PAD_RIGHT);\n }\n }", "public function format(string|float|int $number, int $style, array $attributes = [], array $textAttributes = [], array $symbols = [], ?string $locale = null): string;", "protected function renderStyle() {\n\t\t$content = $this->conf['parameterName'].': '.$this->value.$this->conf['parameterUnit'].';';\n\t\tif(!empty($this->conf['cssElement'])) {\n\t\t\t$content = $this->conf['cssElement'].' { '.$content.' }';\n\t\t}\n\t\t$content = $this->cObj->wrap($content, $this->conf['styleWrap']);\n\n\t\treturn $content;\n\t}", "function sanitize( $styles ) {\n return sanitize_text_field( preg_replace( '/[^[:print:]]|[\\{\\}].*/', '', $styles ) );\n }", "public function block(\n $messages,\n string $type = null,\n string $style = null,\n string $prefix = ' ',\n bool $padding = false\n ) {\n $messages = is_array($messages) ? array_values($messages) : [$messages];\n $this->autoPrependBlock();\n $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding));\n $this->newLine();\n }", "public function setWidth($width);", "public function setWidth($width);", "function widths_strings() {\n\n\t\t$widths = respHeader_widths();\n\t\tforeach ($widths as &$value) {\n\t\t\t$value = join( 'x', $value);\n\t\t}\n\t\treturn $widths;\n\t}", "function width($var=''){\n return ($var==\"\" ? \"\" : ' width=\"'.$var.'\"');\n}", "public function format($message, $type, $timestamp, $context){ }", "abstract public function addBorder($width, $color = '#000');", "function WrapText($message, $length, $qp_mode = false) {\n\t\t$soft_break = ($qp_mode) ? sprintf(\" =%s\", $this->LE) : $this->LE;\n\n\t\t$message = $this->FixEOL($message);\n\t\tif (substr($message, -1) == $this->LE)\n\t\t\t$message = substr($message, 0, -1);\n\n\t\t$line = explode($this->LE, $message);\n\t\t$message = \"\";\n\t\tfor ($i=0 ;$i < count($line); $i++)\n\t\t{\n\t\t $line_part = explode(\" \", $line[$i]);\n\t\t $buf = \"\";\n\t\t for ($e = 0; $e<count($line_part); $e++)\n\t\t {\n\t\t\t $word = $line_part[$e];\n\t\t\t if ($qp_mode and (strlen($word) > $length))\n\t\t\t {\n\t\t\t\t$space_left = $length - strlen($buf) - 1;\n\t\t\t\tif ($e != 0)\n\t\t\t\t{\n\t\t\t\t\tif ($space_left > 20)\n\t\t\t\t\t{\n\t\t\t\t\t\t$len = $space_left;\n\t\t\t\t\t\tif (substr($word, $len - 1, 1) == \"=\")\n\t\t\t\t\t\t $len--;\n\t\t\t\t\t\telseif (substr($word, $len - 2, 1) == \"=\")\n\t\t\t\t\t\t $len -= 2;\n\t\t\t\t\t\t$part = substr($word, 0, $len);\n\t\t\t\t\t\t$word = substr($word, $len);\n\t\t\t\t\t\t$buf .= \" \" . $part;\n\t\t\t\t\t\t$message .= $buf . sprintf(\"=%s\", $this->LE);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$message .= $buf . $soft_break;\n\t\t\t\t\t}\n\t\t\t\t\t$buf = \"\";\n\t\t\t\t}\n\t\t\t\twhile (strlen($word) > 0)\n\t\t\t\t{\n\t\t\t\t\t$len = $length;\n\t\t\t\t\tif (substr($word, $len - 1, 1) == \"=\")\n\t\t\t\t\t\t$len--;\n\t\t\t\t\telseif (substr($word, $len - 2, 1) == \"=\")\n\t\t\t\t\t\t$len -= 2;\n\t\t\t\t\t$part = substr($word, 0, $len);\n\t\t\t\t\t$word = substr($word, $len);\n\n\t\t\t\t\tif (strlen($word) > 0)\n\t\t\t\t\t\t$message .= $part . sprintf(\"=%s\", $this->LE);\n\t\t\t\t\telse\n\t\t\t\t\t\t$buf = $part;\n\t\t\t\t}\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t$buf_o = $buf;\n\t\t\t\t$buf .= ($e == 0) ? $word : (\" \" . $word);\n\n\t\t\t\tif (strlen($buf) > $length and $buf_o != \"\")\n\t\t\t\t{\n\t\t\t\t\t$message .= $buf_o . $soft_break;\n\t\t\t\t\t$buf = $word;\n\t\t\t\t}\n\t\t\t }\n\t\t }\n\t\t $message .= $buf . $this->LE;\n\t\t}\n\n\t\treturn $message;\n\t}", "public static function format($message)\n {\n // Conversion rules\n static $conversions = array (\n '%y' => array('foreground' => 'yellow'),\n '%g' => array('foreground' => 'green' ),\n '%b' => array('foreground' => 'blue' ),\n '%r' => array('foreground' => 'red' ),\n '%p' => array('foreground' => 'magenta'),\n '%m' => array('foreground' => 'magenta'),\n '%c' => array('foreground' => 'cyan' ),\n '%w' => array('foreground' => 'grey' ),\n '%k' => array('foreground' => 'black' ),\n '%n' => 'reset',\n '%Y' => array('foreground' => 'yellow', 'modifier' => 'bold'),\n '%G' => array('foreground' => 'green', 'modifier' => 'bold'),\n '%B' => array('foreground' => 'blue', 'modifier' => 'bold'),\n '%R' => array('foreground' => 'red', 'modifier' => 'bold'),\n '%P' => array('foreground' => 'magenta', 'modifier' => 'bold'),\n '%M' => array('foreground' => 'magenta', 'modifier' => 'bold'),\n '%C' => array('foreground' => 'cyan', 'modifier' => 'bold'),\n '%W' => array('foreground' => 'grey', 'modifier' => 'bold'),\n '%K' => array('foreground' => 'black', 'modifier' => 'bold'),\n '%N' => 'reset',\n '%0' => array('background' => 'black' ),\n '%1' => array('background' => 'red' ),\n '%2' => array('background' => 'green' ),\n '%3' => array('background' => 'yellow'),\n '%4' => array('background' => 'blue' ),\n '%5' => array('background' => 'magenta'),\n '%6' => array('background' => 'cyan' ),\n '%7' => array('background' => 'grey' ),\n '%F' => array('modifier' => 'blink'),\n '%U' => array('modifier' => 'underline'),\n '%8' => array('modifier' => 'inverse'),\n '%9' => array('modifier' => 'bold'),\n '%_' => array('modifier' => 'bold')\n );\n \n // Add a space to double percent signs, \n // this will be converted to a single percent sign later\n $message = str_replace('%%', '% ', $message);\n \n // Convert all rules in the message to color codes\n foreach ($conversions as $key => $color) {\n $message = str_replace($key, self::get($color), $message);\n }\n \n // Reset single percent signs\n $message = str_replace('% ', '%', $message);\n \n // Return formatted message\n return $message;\n }", "abstract protected function format(MessageInterface $message);", "abstract protected function format(MessageInterface $message);", "function _print_styles()\n{\n}", "protected function _calculate_width($width)\n {\n $frame = $this->_frame;\n $style = $frame->get_style();\n $w = $frame->get_containing_block(\"w\");\n\n if ($style->position === \"fixed\") {\n $w = $frame->get_parent()->get_containing_block(\"w\");\n }\n\n $rm = $style->length_in_pt($style->margin_right, $w);\n $lm = $style->length_in_pt($style->margin_left, $w);\n\n $left = $style->length_in_pt($style->left, $w);\n $right = $style->length_in_pt($style->right, $w);\n\n // Handle 'auto' values\n $dims = array($style->border_left_width,\n $style->border_right_width,\n $style->padding_left,\n $style->padding_right,\n $width !== \"auto\" ? $width : 0,\n $rm !== \"auto\" ? $rm : 0,\n $lm !== \"auto\" ? $lm : 0);\n\n // absolutely positioned boxes take the 'left' and 'right' properties into account\n if ($frame->is_absolute()) {\n $absolute = true;\n $dims[] = $left !== \"auto\" ? $left : 0;\n $dims[] = $right !== \"auto\" ? $right : 0;\n } else {\n $absolute = false;\n }\n\n $sum = (float)$style->length_in_pt($dims, $w);\n\n // Compare to the containing block\n $diff = $w - $sum;\n\n if ($diff > 0) {\n if ($absolute) {\n // resolve auto properties: see\n // http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width\n\n if ($width === \"auto\" && $left === \"auto\" && $right === \"auto\") {\n if ($lm === \"auto\") {\n $lm = 0;\n }\n if ($rm === \"auto\") {\n $rm = 0;\n }\n\n // Technically, the width should be \"shrink-to-fit\" i.e. based on the\n // preferred width of the content... a little too costly here as a\n // special case. Just get the width to take up the slack:\n $left = 0;\n $right = 0;\n $width = $diff;\n } else if ($width === \"auto\") {\n if ($lm === \"auto\") {\n $lm = 0;\n }\n if ($rm === \"auto\") {\n $rm = 0;\n }\n if ($left === \"auto\") {\n $left = 0;\n }\n if ($right === \"auto\") {\n $right = 0;\n }\n\n $width = $diff;\n } else if ($left === \"auto\") {\n if ($lm === \"auto\") {\n $lm = 0;\n }\n if ($rm === \"auto\") {\n $rm = 0;\n }\n if ($right === \"auto\") {\n $right = 0;\n }\n\n $left = $diff;\n } else if ($right === \"auto\") {\n if ($lm === \"auto\") {\n $lm = 0;\n }\n if ($rm === \"auto\") {\n $rm = 0;\n }\n\n $right = $diff;\n }\n\n } else {\n // Find auto properties and get them to take up the slack\n if ($width === \"auto\") {\n $width = $diff;\n } else if ($lm === \"auto\" && $rm === \"auto\") {\n $lm = $rm = round($diff / 2);\n } else if ($lm === \"auto\") {\n $lm = $diff;\n } else if ($rm === \"auto\") {\n $rm = $diff;\n }\n }\n } else if ($diff < 0) {\n // We are over constrained--set margin-right to the difference\n $rm = $diff;\n }\n\n return array(\n \"width\" => $width,\n \"margin_left\" => $lm,\n \"margin_right\" => $rm,\n \"left\" => $left,\n \"right\" => $right,\n );\n }", "function processData($width, $data, $font, $emphasis, $size){\n\t\t\t$this->pdf->setFont($font, $emphasis, $size);\n\t\t\t$processedData = array();\n\t\t\t$dataArray = array();\n\t\t\t$stringLine = '';\n\n\t\t\tfor ($i=0; $i < sizeof($data); $i++) { \n\t\t\t\t$explodedData = explode(' ', $data[$i]);\n\t\t\t\tfor ($j=0; $j < sizeof($explodedData); $j++) {\n\t\t\t\t\tif ($this->pdf->GetStringWidth($explodedData[$j]) > $width[$i]) {\n\t\t\t\t\t\t$splitString = str_split($explodedData[$j]);\n\t\t\t\t\t\t$splitCut = '';\n\t\t\t\t\t\tfor ($n=0; $n < sizeof($splitString); $n++) {\n\t\t\t\t\t\t\t$ss = $splitCut . $splitString[$n]; \n\t\t\t\t\t\t\tif ($this->pdf->GetStringWidth($ss) >= $width[$i]) {\n\t\t\t\t\t\t\t \tarray_push($dataArray, $splitCut);\n\t\t\t\t\t\t\t \t$splitCut = 0;\n\t\t\t\t\t\t\t \t$splitCut = $splitString[$n];\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$splitCut = $ss;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!empty($splitCut)) {\n\t\t\t\t\t\t\tarray_push($dataArray, $splitCut);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$s = $stringLine . $explodedData[$j] . ' '; \n\t\t\t\t\t\tif ($this->pdf->GetStringWidth($s) >= $width[$i]) {\n\t\t\t\t\t\t\tarray_push($dataArray, $stringLine);\n\t\t\t\t\t\t\t$stringLine = '';\n\t\t\t\t\t\t\t$stringLine = $explodedData[$j] . ' ';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$stringLine = $s;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!empty($stringLine)) {\n\t\t\t\t\tarray_push($dataArray, $stringLine);\n\t\t\t\t}\n\t\t\t\tarray_push($processedData, $dataArray);\n\t\t\t\t$dataArray = array();\n\t\t\t\t$stringLine = '';\n\t\t\t}\n\t\t\treturn $processedData;\n\t\t}", "public function formatting($arg1 = \" \");", "protected function _pad($message, $level = 1) {\n\t\t$padding = str_repeat(' ', $level * 4);\n\t\treturn $padding . str_replace(\"\\n\", \"\\n{$padding}\", $message);\n\t}", "public static function WRAP_TEXT($message, $length, $qp_mode = false)\n {\n if ($qp_mode) {\n $soft_break = sprintf(' =%s', static::$LE);\n } else {\n $soft_break = static::$LE;\n }\n //If utf-8 encoding is used, we will need to make sure we don't\n //split multibyte characters when we wrap\n $is_utf8 = static::CHARSET_UTF8 === strtolower(self::$CharSet);\n $lelen = strlen(static::$LE);\n $crlflen = strlen(static::$LE);\n\n $message = static::NOMALIZE_BREAKS($message);\n //Remove a trailing line break\n if (substr($message, -$lelen) === static::$LE) {\n $message = substr($message, 0, -$lelen);\n }\n\n //Split message into lines\n $lines = explode(static::$LE, $message);\n //Message will be rebuilt in here\n $message = '';\n foreach ($lines as $line) {\n $words = explode(' ', $line);\n $buf = '';\n $firstword = true;\n foreach ($words as $word) {\n if ($qp_mode && (strlen($word) > $length)) {\n $space_left = $length - strlen($buf) - $crlflen;\n if (!$firstword) {\n if ($space_left > 20) {\n $len = $space_left;\n if ($is_utf8) {\n $len = hkm_utf8CharBoundary($word, $len);\n } elseif ('=' === substr($word, $len - 1, 1)) {\n --$len;\n } elseif ('=' === substr($word, $len - 2, 1)) {\n $len -= 2;\n }\n $part = substr($word, 0, $len);\n $word = substr($word, $len);\n $buf .= ' ' . $part;\n $message .= $buf . sprintf('=%s', static::$LE);\n } else {\n $message .= $buf . $soft_break;\n }\n $buf = '';\n }\n while ($word !== '') {\n if ($length <= 0) {\n break;\n }\n $len = $length;\n if ($is_utf8) {\n $len = hkm_utf8CharBoundary($word, $len);\n } elseif ('=' === substr($word, $len - 1, 1)) {\n --$len;\n } elseif ('=' === substr($word, $len - 2, 1)) {\n $len -= 2;\n }\n $part = substr($word, 0, $len);\n $word = (string) substr($word, $len);\n\n if ($word !== '') {\n $message .= $part . sprintf('=%s', static::$LE);\n } else {\n $buf = $part;\n }\n }\n } else {\n $buf_o = $buf;\n if (!$firstword) {\n $buf .= ' ';\n }\n $buf .= $word;\n\n if ('' !== $buf_o && strlen($buf) > $length) {\n $message .= $buf_o . $soft_break;\n $buf = $word;\n }\n }\n $firstword = false;\n }\n $message .= $buf . static::$LE;\n }\n\n return $message;\n }", "function bl_get_msg($type = _BL_MESSAGES_TYPES, $styles = false)\n{\n if ($type == 'all') {\n $types = array('error', 'warn', 'user', 'info');\n } else {\n $types = explode(',', trim($type, ','));\n $types = array_map('trim', $types);\n }\n\n // check styles (styles for html in emails (bl_send_mail()))\n $th_style = '';\n $td_style = '';\n $td_colors = array(\n 'error' => '',\n 'warn' => '',\n 'info' => '',\n 'user' => ''\n );\n if ($styles == true) {\n $th_style = 'font-weight:bold; background-color:#eee; border-bottom:1px dashed #ccc; padding:5px;';\n $td_style = 'padding:3px; border-bottom:1px dashed #ccc;';\n $td_colors = array(\n 'error' => 'background-color:#f33;',\n 'warn' => 'background-color:#f90;',\n 'info' => 'background-color:#36f;',\n 'user' => 'background-color:#333;'\n );\n }\n\n $result = '\n <table class=\"bl_msg_table\">\n <thead>\n <tr>\n <th style=\"width:20px;\"></th>\n <th style=\"'.$th_style.'\">Message</th>\n <th style=\"'.$th_style.'\">File</th>\n <th style=\"'.$th_style.'\">Line</th>\n <th style=\"'.$th_style.'\">Time</th>\n </tr>\n </thead>\n <tbody>';\n\n //die('<pre>'.print_r(_bl::$msgs, true).'</pre>');\n $count = 0;\n foreach (_bl::$msgs as $k => $v) {\n\n if (in_array($v['type'], $types)) {\n if ($v['type'] == 'error') {\n _bl::$errors = true;\n }\n\n $result .= '\n <tr id=\"bl_msg_num_' . $count . '\" class=\"bl_normal_tr bl_debug_msg_' .\n $v['type'] .\n ' bl_msg_activo\" onmouseover=\"bl_highlight_row(true, this)\" onmouseout=\"bl_highlight_row(false, this)\">\n <td style=\"'.$td_colors[$v['type']].'\" class=\"bl_msg_' . $v['type'] . '\"></td>\n <td class=\"bl_td\">' . $v['msg'] . '</td>\n <td class=\"bl_td\">' . $v['file'].':'.$v['line'] . '</td>\n <td class=\"bl_td\">' . $v['line'] . '</td>\n <td class=\"bl_td\">' . $v['time'] . '</td>\n </tr>';\n $count++;\n _bl::$count_msg = $count;\n }\n }\n\n $result .= '\n </tbody>\n </table>';\n\n return $result;\n}", "function wordwrap($string, $width = 75, $break = \"\\n\", $cut = false)\n{\n return '';\n}", "public function setWidth(int $width);", "protected function mt_PrintLine($w, $h, $aTxt, $align = 'J')\n {\n\n if ($w == 0)\n $w = $this->w - $this->rMargin - $this->x;\n\n $wmax = $w; //Maximum width\n\n $total_width = 0; //the total width of all strings\n $total_spaces = 0; //the total number of spaces\n\n $nr = count($aTxt);//number of elements\n\n for ($i = 0; $i < $nr; $i++) {\n $total_width += ($aTxt[$i]['width'] / 1000);\n $total_spaces += $aTxt[$i]['spaces'];\n }\n\n //default\n $w_first = $this->cMargin;\n $extra_space = 0;\n\n switch ($align) {\n case 'J':\n if ($total_spaces > 0) {\n $extra_space = ($wmax - 2 * $this->cMargin - $total_width) / $total_spaces;\n }\n break;\n case 'L':\n break;\n case 'C':\n $w_first = ($wmax - $total_width) / 2;\n break;\n case 'R':\n $w_first = $wmax - $total_width - $this->cMargin;;\n break;\n }\n\n // Output the first Cell\n if ($w_first != 0) {\n $this->Cell($w_first, $h, \"\", 0, 0, \"L\", 0);\n }\n\n $last_width = $wmax - $w_first;\n $lastY = 0;\n\n while (list($key, $val) = each($aTxt)) {\n\n $bYPosUsed = false;\n\n //apply current tag style\n $this->mt_ApplyStyle($val['tag']);\n\n //If > 0 then we will move the current X Position\n $extra_X = 0;\n\n if ($val['ypos'] != 0) {\n $lastY = $this->y;\n $this->y = $lastY - $val['ypos'];\n $bYPosUsed = true;\n }\n\n //string width\n $width = $val['width'] / 1000;\n\n if ($width == 0) continue;// No width jump over!!!\n\n if ($align == 'J') {\n if ($val['spaces'] < 1) $temp_X = 0;\n else $temp_X = $extra_space;\n\n $this->ws = $temp_X;\n\n $this->_out(sprintf('%.3f Tw', $temp_X * $this->k));\n\n $extra_X = $extra_space * $val['spaces'];//increase the extra_X Space\n\n } else {\n $this->ws = 0;\n $this->_out('0 Tw');\n }\n\n //Output the Text/Links\n $this->Cell($width, $h, $val['text'], 0, 0, \"C\", 0, $val['href']);\n\n $last_width -= $width;//last column width\n\n if ($extra_X != 0) {\n $this->SetX($this->GetX() + $extra_X);\n $last_width -= $extra_X;\n }\n\n if ($bYPosUsed) $this->y = $lastY;\n\n }//while\n\n // Output the Last Cell\n if ($last_width != 0) {\n $this->Cell($last_width, $h, \"\", 0, 0, \"\", 0);\n }\n }", "public static function width($value = NULL){\n return '.width('.$value.')';\n }", "public function setWidth($width = 0)\n {\n $this->width = $width;\n }", "private function renderCss(array $styles) {\n\n $css = '';\n foreach ($styles as $media => $rules) {\n // Use media query only when specified.\n if ($media !== 'all') {\n $css .= '@media' . ($media[0] !== '(' ? ' ' : '') . $media . '{';\n }\n // Append all CSS rules to existing styles.\n foreach ($rules as $selector => $properties) {\n $css .= $selector . '{' . implode(';', $properties) . '}';\n }\n // Close media query only when used.\n if ($media !== 'all') {\n $css .= '}';\n }\n }\n return $css;\n }", "static public function formatMessage($message, $type)\n {\n return '<p class=\"alert alert-' . $type . '\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\">&times;</a>\n <strong>' . ucfirst($type) . '!</strong> ' . $message . '</p>';\n }", "public function builder_css_output($styles) {\n\n\t\tif ( isset($this->params['builderCSS']) ) { \n\t\t\treturn $styles . \"<style id=\\\"{$this->get_tag()}-styles\\\" type=\\\"text/css\\\">\" . $this->params['builderCSS'] . \"</style>\";\n\t\t}\n\n\t\treturn $styles;\n\t}", "protected function formatMessage($level, $message, $context = []): string\n {\n $line = \"[{$level}] {$message}\";\n \n if (!empty($context)) {\n $line .= PHP_EOL.$this->indent($this->contextToString($context));\n }\n\n return $line;\n }", "public function setWidth($width)\n {\n $this->_width = $width > 0 ? $width : 1;\n return $this;\n }", "function formatStr($str) {\n\t\tif (is_array ( $this->conf ['general_stdWrap.'] )) {\n\t\t\t$str = $this->cObj->stdWrap ( $str, $this->conf ['general_stdWrap.'] );\n\t\t}\n\t\treturn $str;\n\t}", "function line($width, $colour = '', $text = '', $size = -1, $circles = -1) {\n\t\t$type = 'line' . $this->next_line ();\n\t\t\n\t\t$description = '';\n\t\tif ($width > 0) {\n\t\t\t$description .= $width;\n\t\t\t$description .= ',' . $colour;\n\t\t}\n\t\t\n\t\tif (strlen ( $text ) > 0) {\n\t\t\t$description .= ',' . $text;\n\t\t\t$description .= ',' . $size;\n\t\t}\n\t\t\n\t\tif ($circles > 0)\n\t\t\t$description .= ',' . $circles;\n\t\t\n\t\t$this->lines [$type] = $description;\n\t}", "private function applyFormatterStyles()\n {\n $formatter = $this->output->getFormatter();\n foreach ($this->formatterStyles as $name => $style) {\n $formatter->setStyle($name, $style);\n }\n\n $errorFormatter = $this->output->getErrorOutput()->getFormatter();\n foreach (Theme::ERROR_STYLES as $name) {\n if (isset($this->formatterStyles[$name])) {\n $errorFormatter->setStyle($name, $this->formatterStyles[$name]);\n }\n }\n }", "protected function truncate(string $string, int $width): string\n {\n if ($width <= 0) {\n throw new InvalidArgumentException(\"Width [{$width}] must be greater than zero.\");\n }\n\n return mb_strwidth($string) <= $width ? $string : (mb_strimwidth($string, 0, $width - 1).'…');\n }", "public static function formatStringBreakPoints($value, $length)\n\t\t{\n\t\t\t$parts = explode(\" \", $value);\n\t\t\t\n\t\t\t$string = \"\";\n\t\t\t$wordCount = 0;\n\t\t\t\n\t\t\tforeach($parts as $part)\n\t\t\t{\n\t\t\t\tif (strlen($part) > $length && $wordCount > 0)\n\t\t\t\t\t$string .= \"<br>\" .$part .\" \";\n\t\t\t\telse\n\t\t\t\t\t$string .= $part .\" \";\n\t\t\t\t\n\t\t\t\t$wordCount++;\n\t\t\t}\n\t\t\t\n\t\t\treturn (empty($string)) ? $value : $string;\n\t\t}", "function utf8_wordwrap($string, $width = 75, $break = \"\\n\")\n{\n\t$a = explode(\"\\n\", $string);\n\tforeach ($a as $k => $str)\n\t{\n\t\t$str = preg_split('#[\\s\\r]+#', $str);\n\t\t$len = 0;\n\t\t$return = '';\n\t\tforeach ($str as $val)\n\t\t{\n\t\t\t$val .= ' ';\n\t\t\t$tmp = mb_strlen($val);\n\t\t\t$len += $tmp;\n\t\t\tif ($len >= $width)\n\t\t\t{\n\t\t\t\t$return .= $break . $val;\n\t\t\t\t$len = $tmp;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$return .= $val;\n\t\t}\n\t\t$a[$k] = $return;\n\t}\n\treturn implode(\"\\n\", $a);\n}", "public function width($width)\n {\n return $this->setIntOption(__FUNCTION__, $width);\n }", "protected function _formatText($text)\n {\n $text_width = $this->width - $this->current_indent;\n $indent = str_repeat(' ', $this->current_indent);\n return wordwrap($indent . $text, $text_width, \"\\n\" . $indent, true);\n }", "protected function format($html, $depth)\n\t{\n\t\treturn str_repeat(' ', $depth * $this->spaces).$html.PHP_EOL;\n\t}", "public function width($width)\n {\n return $this->setProperty('width', $width);\n }", "public function set_width($width)\n {\n }", "private function formatCss()\n {\n if ($this->css_outputed) {\n //css already outputed.\n return '';\n }\n $output = '';\n $styles = '<style type=\"text/css\">' . \"\\n\";\n $color_msgs = '<div class=\"error_msg\"><div>Error Messages</div></div>';\n foreach ($this->filters as $type) {\n $r = rand(hexdec('a0'), hexdec('ef'));\n $g = rand(hexdec('a0'), hexdec('ef'));\n $b = rand(hexdec('a0'), hexdec('ef'));\n\n $bg = dechex($r) . dechex($g) . dechex($b);\n $color_msgs .= '<div class=\"debug_msg_' . $type . '\"><div>' . $type . ' Filter Color</div></div>';\n $color = dechex(abs(hexdec($bg) - hexdec('ffffff')));\n //echo $color;\n $styles .= '.debug_msg_' . $type . ' {\n\tclear: both;\n\tfloat:left;\n\tborder:thin dotted #' . $bg . ';\n\tmargin: 5px;\n}\n.debug_msg_' . $type . ' div {\n\tfloat:left; \n\tpadding:10px;\n\tborder-left:thin dashed blue;\n\tbackground-color:#' . $bg . ';\n\tcolor:#' . $color . ';\n}\n.error_msg_' . $type . ' {\n\tfloat:left;\n\tborder:thick dotted ' . $bg . ';\n\tmargin:5px;\n}\n.error_msg_' . $type . ' div {\n\tfloat:left; \n\tpadding:10px;\n\tborder-left:thick dashed ' . $bg . ';\n\tbackground-color:#FFBFBF;\n}\n';\n }\n\n $output .= $styles . '.error_msg {\n\t' . (in_array('NOERR', $this->filters) ? 'display:none;' : '') . '\n\tfloat:left;\n\tborder:thin dotted red;\n\tmargin:5px;\n}\n.error_msg div {\n\tfloat:left; \n\tpadding:10px;\n\tborder-left:thin dashed red;\n\tbackground-color:#FF8F8F;\n}</style>';\n $output .= '<h2>Debug Info:</h2>' . \"\\n\" . $color_msgs . '<br style=\"clear:both;\" />';\n $this->css_outputed = true;\n return $output;\n }", "protected function formatMessageByLevel($level, $message, $context)\n {\n $label = $level;\n return $this->formatMessage($label, $message, $context, $this->labelStyles[$level], $this->messageStyles[$level]);\n }", "public function print_styles()\n {\n }", "protected function format($data) {\n\t\t$string = str_replace(array(\"%datetime%\", \"%level_name%\", \"%message%\"), array($data['datetime'], $data['level_name'], $data['message']), static::LINE_FORMAT);\n\n\t\tif(!empty($data['context'])) {\n\t\t\tforeach ($data['context'] as $var => $val) {\n\t\t\t\tif (false !== strpos($string, '%context.'.$var.'%')) {\n\t\t\t\t\t$string = str_replace('%context.'.$var.'%', str_replace([\"\\r\\n\", \"\\r\", \"\\n\"], ' ', $val), $string);\n\t\t\t\t\tunset($data['context'][$var]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tunset($data['context']);\n\t\t\t$string = str_replace('%context%', '', $string);\n\t\t}\n\n\t\t// remove leftover %context.xxx% if any\n\t\tif (false !== strpos($string, '%')) {\n\t\t\t$string = preg_replace('/%(?:context)\\..+?%/', '', $string);\n\t\t}\n\n\t\treturn $string;\n\t}", "function wordwrap($string,$width=75,$break=\"\\n\",$cut=false)\n{\n\treturn '';\n}", "function addTextWrap($XPos, $YPos, $Width, $Height, $Text, $Align = 'J', $border = 0, $fill = 0) {\n\t\t\t//some special characters are html encoded\n\t\t\t//this code serves to make them appear human readable in pdf file\n\t\t\t$Text = html_entity_decode($Text, ENT_QUOTES, 'UTF-8');\n\n\t\t\t$this->x = $XPos;\n\t\t\t$this->y = $this->h - $YPos - $Height;\n\n\t\t\tswitch ($Align) {\n\t\t\t\tcase 'right':\n\t\t\t\t\t$Align = 'R';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'center':\n\t\t\t\t\t$Align = 'C';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$Align = 'L';\n\n\t\t\t}\n\t\t\t$this->SetFontSize($Height);\n\n\t\t\tif ($Width == 0) {\n\t\t\t\t$Width = $this->w - $this->rMargin - $this->x;\n\t\t\t}\n\t\t\t$wmax = ($Width - 2 * $this->cMargin);\n\t\t\t$s = str_replace(\"\\r\", '', $Text);\n\t\t\t$s = str_replace(\"\\n\", ' ', $s);\n\t\t\t$s = trim($s) . ' ';\n\t\t\t$nb = mb_strlen($s);\n\t\t\t$b = 0;\n\t\t\tif ($border) {\n\t\t\t\tif ($border == 1) {\n\t\t\t\t\t$border = 'LTRB';\n\t\t\t\t\t$b = 'LRT';\n\t\t\t\t\t$b2 = 'LR';\n\t\t\t\t} else {\n\t\t\t\t\t$b2 = '';\n\t\t\t\t\tif (is_int(mb_strpos($border, 'L'))) {\n\t\t\t\t\t\t$b2 .= 'L';\n\t\t\t\t\t}\n\t\t\t\t\tif (is_int(mb_strpos($border, 'R'))) {\n\t\t\t\t\t\t$b2 .= 'R';\n\t\t\t\t\t}\n\t\t\t\t\t$b = is_int(mb_strpos($border, 'T')) ? $b2 . 'T' : $b2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sep = -1;\n\t\t\t$i = 0;\n\t\t\t$l = $ls = 0;\n\t\t\t$ns = 0;\n\t\t\t$cw = $this->GetStringWidth($s, '', '', 0, true);\n\t\t\twhile ($i < $nb) {\n\t\t\t\t$c = $s{$i};\n\t\t\t\tif ($c == ' ' and $i > 0) {\n\t\t\t\t\t$sep = $i;\n\t\t\t\t\t$ls = $l;\n\t\t\t\t\t$ns++;\n\t\t\t\t}\n\t\t\t\t$l += $cw[$i];\n\t\t\t\tif ($l > $wmax) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($sep == -1) {\n\t\t\t\tif ($i == 0) {\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\n\t\t\t\tif (isset($this->ws) and $this->ws > 0) {\n\t\t\t\t\t$this->ws = 0;\n\t\t\t\t\t$this->_out('0 Tw');\n\t\t\t\t}\n\t\t\t\t$sep = $i;\n\t\t\t} else {\n\t\t\t\tif ($Align == 'J') {\n\t\t\t\t\t$this->ws = ($ns > 1) ? ($wmax - $ls) / ($ns - 1) : 0;\n\t\t\t\t\t$this->_out(sprintf('%.3f Tw', $this->ws * $this->k));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->Cell($Width, $Height, mb_substr($s, 0, $sep), $b, 2, $Align, $fill);\n\t\t\t$this->x = $this->lMargin;\n\t\t\treturn mb_substr($s, $sep);\n\t\t}", "public function setWidth(string $width)\n {\n $this->width = $width;\n\n return $this;\n }", "function japanese_xtra_strimwidth($ret,$width) {\n if (function_exists('mb_detect_encoding')) {\n $ret = mb_strimwidth($ret, 0, $width, '...');\n }\n return $ret;\n}", "function publisher_limit_words( $string, $width = 100, $append = '&hellip;' ) {\n\n\t\tif ( $width < 1 ) {\n\t\t\treturn $string;\n\t\t}\n\n\t\t// do nothing if length is smaller or equal filter!\n\t\tif ( strlen( $string ) <= $width ) {\n\t\t\treturn $string;\n\t\t}\n\n\t\t$parts = preg_split( '/([\\s\\n\\r]+)/u', $string, null, PREG_SPLIT_DELIM_CAPTURE );\n\t\t$parts_count = count( $parts );\n\n\t\t$length = 0;\n\t\t$last_part = 0;\n\t\tfor ( ; $last_part < $parts_count; ++ $last_part ) {\n\t\t\t$length += mb_strlen( $parts[ $last_part ] );\n\n\t\t\tif ( $length > $width ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( $length > $width ) {\n\t\t\treturn trim( implode( array_slice( $parts, 0, $last_part ) ) ) . $append;\n\t\t} else {\n\t\t\treturn implode( array_slice( $parts, 0, $last_part ) );\n\t\t}\n\t}", "protected function padMessage(string $message, $length = 80): string\n {\n $currentLen = strlen($this->filterOutTags($message));\n if ($currentLen < $length) {\n $message .= str_repeat(' ', $length - $currentLen);\n }\n\n return $message;\n }", "function CalcWidths($width, $align)\n{\n $TableWidth=0;\n foreach($this->aCols as $i=>$col)\n {\n $w=$col['w'];\n if($w==-1)\n $w=$width/count($this->aCols);\n elseif(substr($w,-1)=='%')\n $w=$w/100*$width;\n $this->aCols[$i]['w']=$w;\n $TableWidth+=$w;\n }\n // Compute the abscissa of the table\n if($align=='C')\n $this->TableX=max(($this->w-$TableWidth)/2,0);\n elseif($align=='R')\n $this->TableX=max($this->w-$this->rMargin-$TableWidth,0);\n else\n $this->TableX=$this->lMargin;\n}", "public function width(string $width)\r\n {\r\n return $this->option('width', $width);\r\n }", "public function writeWidth($val='0') {\n$this->writeElement('Width', $val);\n\t}", "private function msg($message = \"\", $cr = true, $style = \"normal\") {\n if(!CLI)\n return;\n $flag = in_array($message, array(\"ok\", \"nok\", \"n/a\"));\n if($style == \"underline\")\n $message = \"\\x1b[4m\" . $message . \"\\x1b[0m\";\n elseif($message == \"ok\" || $style == \"green\")\n $message = \"\\x1b[32;1m\" . $message . \"\\x1b[0m\";\n elseif(in_array($message, array(\"nok\", \"n/a\")) || $style == \"red\")\n $message = \"\\x1b[31;1m\" . $message . \"\\x1b[0m\";\n if($flag)\n $message = \"[ \" . $message . \" ]\";\n $fp = fopen(\"php://stdout\", \"w\");\n fwrite($fp, $message . ($cr ? PHP_EOL : \"\"));\n fclose($fp);\n }" ]
[ "0.6528407", "0.6495236", "0.5904546", "0.5900134", "0.5815876", "0.5764974", "0.5737549", "0.57302123", "0.57124674", "0.55921465", "0.5550755", "0.5370217", "0.53093415", "0.5302304", "0.5301804", "0.5272098", "0.52502316", "0.51392776", "0.5134463", "0.50937545", "0.50760525", "0.50723934", "0.5068898", "0.5057954", "0.5040637", "0.50268227", "0.5021773", "0.49788296", "0.4958998", "0.49504423", "0.4949253", "0.49445152", "0.49344537", "0.49264064", "0.4926353", "0.49210566", "0.4907807", "0.4897076", "0.48851615", "0.4878787", "0.4872094", "0.48715875", "0.48676255", "0.48602778", "0.48543993", "0.48462373", "0.4844494", "0.48427716", "0.4834795", "0.4834795", "0.48340222", "0.4831828", "0.4824671", "0.48160055", "0.48045292", "0.48032922", "0.47932887", "0.47932887", "0.47912043", "0.47893235", "0.4787853", "0.47748983", "0.47742063", "0.47566947", "0.4738814", "0.47382316", "0.47379836", "0.4734031", "0.47302058", "0.47301364", "0.4718831", "0.47116172", "0.47086185", "0.4689278", "0.46859577", "0.46804723", "0.4669289", "0.46678767", "0.46655273", "0.46624795", "0.4660666", "0.4659879", "0.46562958", "0.46491656", "0.4646403", "0.46425736", "0.4637933", "0.46343622", "0.4633354", "0.46304393", "0.4627474", "0.46253872", "0.46194378", "0.4619306", "0.46167985", "0.46140012", "0.45991775", "0.45909834", "0.45865533", "0.45836425" ]
0.8134824
0
Funzione che individua le proiezione della prossima settimana.
Функция, которая определяет проекции на следующую неделю.
public static function proiezioniSettimanaProssima() { $settimana = EData::getSettimanaProssima(); $elenco = FPersistentManager::getInstance()->loadBetween($settimana[0], $settimana[1], "EProiezione"); VGestoreREST::showJSON($elenco); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function proiezioniSettimanali() {\n $settimana = EData::getSettimana();\n $elenco = FPersistentManager::getInstance()->loadBetween($settimana[0], $settimana[1], \"EProiezione\");\n\n VGestoreREST::showJSON($elenco);\n }", "function setProgreso($progreso) {\r\n\t\t$this->progreso = $progreso;\r\n\t}", "public function aprova()\n {\n $this -> estadoAtual -> aprova($this);\n }", "function get_com_pro(){\n \n $this->get_probability(); \n \n $this->com_pro = array();\n $x = 0;\n foreach($this->probability as $key => $val) {\n $x+= $val;\n $this->com_pro[] = $x;\n $this->console.=\"PK[$key] : $x \\r\\n\";\n } \n //reset($this->probability);\n $this->com_pro;\n }", "function get_com_pro(){\r\n \r\n $this->get_probability(); \r\n \r\n $this->com_pro = array();\r\n $x = 0;\r\n foreach($this->probability as $key => $val) {\r\n $x+= $val;\r\n $this->com_pro[] = $x;\r\n $this->console.=\"PK[$key] : $x \\r\\n\";\r\n } \r\n //reset($this->probability);\r\n $this->com_pro;\r\n }", "public function Cambiaestasopro($pro, $num)\n {\n mysqli_query($this->conexion, \"update propuestas set estado='$num' where id=$pro and estado=1\");\n }", "public function anulaConfirmacion() {\n\n $this->setIDEstado(0);\n $this->setIDAlbaran(0);\n $this->FechaAceptacion = 0;\n $this->save();\n\n $lineas = new PstoLineas();\n $lineas->queryUpdate(array(\"IDEstado\" => 0), \"IDPsto='{$this->IDPsto}'\");\n unset($lineas);\n }", "public static function proiezioniSettimanaScorsa() {\n $settimana = EData::getSettimanaScorsa(1);\n $elenco = FPersistentManager::getInstance()->loadBetween($settimana[0], $settimana[1], \"EProiezione\");\n\n VGestoreREST::showJSON($elenco);\n }", "function mengirim_pesan(){ // ini adalah method == function\n $this->jml_pulsa -= 500; // variabel $this dapat mengakses property dan method\n }", "public function Cambiaestasoproo($pro, $num)\n {\n $consulta = mysqli_query($this->conexion, \"select count(*) from usuariosxpropuesta_via where id_propuesta='$pro'\");\n if ($datos = mysqli_fetch_array($consulta)) {\n if($datos[0]==2)\n {\n mysqli_query($this->conexion, \"update propuestas set estado='$num' where id=$pro and estado=4\"); \n }\n }\n \n \n \n }", "public function refrescacampos(){\n $this->hp=$this->nhorasparadainterna; //horas parada por mo interna o break dowwna\n $this->hpp=$this->nhorasparadaprogramada; //hora spdara programada precheck\n $this->hps=$this->nhorasparadaexterna; //horas prada por servicios\n $this->hd=$this->horasdisponibles();\n $this->hmt=$this->horasmotor();\n $this->hpt=$this->horasperfo();\n $this->tbd=$this->gethorasparada();//horas de parada total\n $this->np=$this->nparadasint;\n $this->ns=$this->nparadasext;\n $this->npp=$this->nparadasprog;\n $this->npp=$this->ns+$this->np+$this->npp;///veces parada servicio+veces parada interno, +veces parada programnada\n $this->ntt=$this->nparadastotales();\n $this->htt=$this->horasmotor()+$this->horasperfo();\n $this->dispo=$this->porcdispo();\n $this->util=$this->porcutil();\n }", "public function Cambiaestasopro2($pro, $num)\n {\n mysqli_query($this->conexion, \"update propuestas set estado='$num' where id=$pro and estado=3\");\n }", "function update_progreso(){\n\t\t$progreso = $this -> progreso;\n\t\t\n\t\t// var_dump($progreso);\n\t\t$query = \"UPDATE Alumnos SET progreso = '$progreso' WHERE Alumno_id='$this->alumno'\";\n\t\t$sql = mysql_query($query) or die(mysql_error());\n\t\treturn true;\n\t}", "private function ima_li_pobjednik(){\n\t\t\t$this->uRetku();\n\t\t\t$this->uStupcu();\n\t\t\t$this->naDijagonali();\n\t\t}", "function przygotuj()\n\t{\n\t\t\n\t\t for ($i=0; $i < $this->liczba_zadan_c; $i++)\n\t\t {\n\t\t\t$this->ileWykonac_c[$i] = ($this->NWW_c / $this->okres_zadan_c[$i]);\n\t\t\t$this->postep_c[$i] = 0;\n\t\t\t$this->wykonane_c[$i] = 0;\n\t\t\t$this->blokada_c[$i] = -1;\n\t\t\t$this->czy_dostepne_c[$i]= true;\n\t\t\t$this->przydzial_c[$i] = 0;\n\t\t\n\t\t }\n\t\t \n\t\t\t \n\t\t\t\n\t}", "function setProposition($proposition) {\n $this->proposition = $proposition;\n }", "function update_profissional($profissional) {\n $query = \"UPDATE acsProfissionais SET nome=:nome, email=:email, cpf=:cpf, genero=:genero WHERE id=:id\";\n $pdo = DBpdo::conectar();\n $sth = $pdo->prepare($query);\n $sth->bindParam(':id', $profissional->id);\n $sth->bindParam(':nome', $profissional->nome);\n $sth->bindParam(':email', $profissional->email);\n $sth->bindParam(':cpf', $profissional->cpf);\n $sth->bindParam(':genero', $profissional->genero);\n $sth->execute();\n\n $query = \"UPDATE acsPoms SET formulario=:formulario WHERE id_prof = :id_prof\";\n $pdo = DBpdo::conectar();\n $sth = $pdo->prepare($query);\n $sth->bindParam(':id_prof', $profissional->id);\n $sth->bindParam(':formulario', $profissional->adjetivos);\n $sth->execute();\n\n return $profissional;\n }", "public function Cambiaestasopro3($pro, $num)\n {\n mysqli_query($this->conexion, \"update propuestas set estado='$num' where id=$pro and estado=4\");\n }", "function stornaPerIntegrazione(){\n\t\t$values['STATO']=0;\n\t\t$pk['EQUERY_INT']=$this->eq_int;\n\t\t$pk[$this->pk_field]=$this->pk_value;\n\t\t$sql=new query($this->conn);\n\t\t$sql->update($values, $this->service.\"_EQ\", $pk);\n\t\t\n\t\t//setto IN_EMENDAMENTO_APPROVAZIONE a 0 e rendi modificabile (sia per istruttoria negativa che per parere sospensivo)\n\t\t$values_1['IN_EMENDAMENTO_APPROVAZIONE']=0;\n\t\t//$pk['EQUERY_INT']=$this->eq_int;\n\t\t$pk_1[$this->pk_field]=$this->pk_value;\n\t\t$sql_1=new query($this->conn);\n\t\t$sql_1->update($values_1, $this->service.\"_REGISTRAZIONE\", $pk_1);\n\n\t}", "function insert_profissional($profissional) {\n $query = \"INSERT INTO acsProfissionais (nome, email, cpf, genero) VALUES (:nome, :email, :cpf, :genero)\";\n $pdo = DBpdo::conectar();\n $sth = $pdo->prepare($query);\n $sth->bindParam(':nome', $profissional->nome);\n $sth->bindParam(':email', $profissional->email);\n $sth->bindParam(':cpf', $profissional->cpf);\n $sth->bindParam(':genero', $profissional->genero);\n $sth->execute();\n\n $profissional->id = $pdo->lastInsertId();\n \n $preench = parseDate($profissional->preench);\n if($preench) {\n $profissional->preench = $preench->format('Y-m-d');\n } else {\n $profissional->preench = date(\"Y-m-d H:i:s\");\n }\n\n $query = \"INSERT INTO acsPoms (id_prof, formulario, preenchido_em) VALUES (:id_prof, :formulario, :preenchido_em)\";\n $pdo = DBpdo::conectar();\n $sth = $pdo->prepare($query);\n $sth->bindParam(':id_prof', $profissional->id);\n $sth->bindParam(':formulario', $profissional->adjetivos);\n $sth->bindParam(':preenchido_em', $profissional->preench);\n $sth->execute();\n\n $profissional->poms_id = $pdo->lastInsertId();\n\n return $profissional;\n }", "public function pesquisaProfissionalAction()\r\n\t{\r\n\t\t$this->_helper->viewRenderer->setNoRender(true);\r\n\t\t$this->_helper->layout->disableLayout();\r\n\r\n\t\t// Recupera os parametros enviados por get\r\n\t\t$cd_projeto \t\t\t= $this->_request->getParam('cd_projeto');\r\n\t\t$cd_papel_profissional = $this->_request->getParam('cd_papel_profissional');\r\n\t\t$cd_objeto = $_SESSION[\"oasis_logged\"][0][\"cd_objeto\"];\r\n\r\n\t\t// Caso tenha sido enviada a opcao selecione do combo. Apenas para garantir caso o js falhe nesta verificacao\r\n\t\tif ($cd_projeto == 0) {\r\n\t\t\techo '';\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t// Recordset de profissionais que nao se encontram no projeto selecionado\r\n\t\t\t$foraProjeto = $this->_objProfissionalProjeto->pesquisaProfissionalForaProjeto($cd_objeto, $cd_projeto, $cd_papel_profissional);\r\n\r\n\t\t\t// Recordset de profissionais que se encontram no projeto selecionado\r\n\t\t\t$noProjeto = $this->_objProfissionalProjeto->pesquisaProfissionalNoProjeto($cd_objeto, $cd_projeto, $cd_papel_profissional);\r\n\r\n\t\t\t/*\r\n\t\t\t * Os procedimentos abaixo criam os options dos selects de acordo com o seu respectivo recordset. \r\n\t\t\t * Posteriormente eh criado um json que eh enviado ao client (javascript) que adiciona os options aos selects\r\n\t\t\t */\r\n\t\t\t$arr1 = \"\";\r\n\r\n\t\t\tforeach ($foraProjeto as $fora) {\r\n\t\t\t\t$arr1 .= \"<option value=\\\"{$fora['cd_profissional']}\\\">{$fora['tx_profissional']}</option>\";\r\n\t\t\t}\r\n\r\n\t\t\t$arr2 = \"\";\r\n\t\t\tforeach ($noProjeto as $no) {\r\n\t\t\t\t$arr2 .= \"<option value=\\\"{$no['cd_profissional']}\\\">{$no['tx_profissional']}</option>\";\r\n\t\t\t}\r\n\r\n\t\t\t$retornaOsDois = array($arr1, $arr2);\r\n\r\n\t\t\techo Zend_Json_Encoder::encode($retornaOsDois);\r\n\t\t}\r\n\t}", "public function prikaziPoSastojku(){\n // je to beef ili chicken ili lunch ili whatever\n // vrsi pretragu i ispisuje.. \n // pozivajuci metodu prikazi sa array podatakama.\n }", "public function setPrimario($dato){\n $this->{'_'.$this->_primario} = $dato;\n }", "protected function _procesarPuntos()\n\t{\n\t $this->_puntosAgente += $this->_mano->darPuntosAgente();\n\t $this->_puntosHumano += $this->_mano->darPuntosHumano();\n\t \n\t echo 'Puntos Humano: ' . $this->_puntosHumano . \"\\n\";\n\t echo 'Puntos Agente: ' . $this->_puntosAgente . \"\\n\";\n\t}", "function affichageEnteteProfil(){\n paramEnteteHtml();\n paramOuvertureBody();\n paramIncludeNavbar();\n paramOuvertureDivClassContFluidAndDFlex();\n paramOuvertureDivClassRow();\n paramOuvertureDivClassCols();\n paramOuvertureDivMenuLat();\n }", "public function admin_prodi_modal_mahasiswa() {\n\n \t\t}", "function init_progreso(){\n\t\t// decodifico desde lo almacenado\n\t\t$arrProgreso = json_decode($this -> progreso,true);\n\t\t// $arrProgreso = explode(',', $this -> progreso);\n\t\t// Transformo el string a array\n\t\t$arrExamen = explode(',', $this -> examenes);\n\t\t// Solamente puede haber un modelo de examen para trabajar con json\n\t\t$arrExamen=array_values(array_unique($arrExamen));\n\t\t// ÇSe actualiza la base de datos\n\t\t$this -> examenes = implode(',', $arrExamen);\n\t\t$this -> update_examenes();\n\t\t// Inicializa el progreso si esta vacio\n\t\tif(count($arrProgreso) != count($arrExamen)){\n\t\t\t// Arreglo\n\n\t\t\tif(!is_array($arrProgreso)){\n\t\t\t\t$x = $arrProgreso;\n\t\t\t\tunset($arrProgreso);\n\t\t\t\t$arrProgreso[]=$x;\n\t\t\t\tarray_pop($arrProgreso);\n\t\t\t\tvar_dump($arrProgreso);\n\t\t\t} \n\n\t\t\tif($arrProgreso =='' AND !empty($arrProgreso)) $arrProgreso= array_pop($arrProgreso);\n\t\t\t// Construyo el array del mismo tamaño que el numero de examenes\n\t\t\twhile (count($arrExamen)>count($arrProgreso)) {\n\t\t\t\t$arrProgreso[] = 100;\n\t\t\t}\n\t\t\t// Lo completo con los valores por defecto segun el tipo de examenes\n\t\t\tforeach ($arrExamen as $key => $id_examen) {\n\t\t\t\tif($arrProgreso[$key]==100){\n\t\t\t\t\t$arrProgreso[$key] = $this->get_examenInfo($id_examen);\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// Formo la cadena json\n\t\t\t$progress=array_combine($arrExamen, $arrProgreso);\n\t\t\techo '<br />-';\n\t\t\t$json= json_encode($progress);\n\t\t\t$this -> progreso = $json;\n\t\t\t$this -> update_progreso();\n\t\t} \n\t}", "public function setPrioridade($pri) {\n $this->prioridade = $pri; \n }", "public function paruostiPriemones() {\n \t$priemones = $this->db->qKey(\"id\", \"SELECT * FROM {p}priemones\");\n \t$this->smarty->assign(\"priemones\", $priemones);\n }", "private function propostaSeguradora(stdClass $parametros) {\r\n\r\n $this->validarCamposProposta($parametros);\r\n\r\n // instancia da classe produto com seguro\r\n $produtoComSeguro = new ProdutoComSeguro();\r\n \r\n $produtoComSeguro->setCotacaoNumero($parametros->num_cotacao);\r\n $produtoComSeguro->setContratoNumero($parametros->num_contrato);\r\n $produtoComSeguro->setClienteNome(addslashes($parametros->nome_cliente));\r\n $produtoComSeguro->setClienteSexo($parametros->sexo);\r\n $produtoComSeguro->setClienteEstadoCivil($parametros->estado_civil);\r\n $produtoComSeguro->setClienteProfissao($parametros->profissa);\r\n $produtoComSeguro->setClienteDataNascimento($parametros->dt_nasc);\r\n $produtoComSeguro->setClientePep1(addslashes($parametros->pep1));\r\n $produtoComSeguro->setClientePep2(addslashes($parametros->pep2));\r\n $produtoComSeguro->setClienteResidencialDdd($parametros->ddd_res);\r\n $produtoComSeguro->setClienteResidencialFone($parametros->fone_res);\r\n $produtoComSeguro->setClienteCelularDdd($parametros->ddd_cel);\r\n $produtoComSeguro->setClienteCelularFone($parametros->num_cel);\r\n $produtoComSeguro->setClienteEmail(addslashes($parametros->email));\r\n $produtoComSeguro->setClienteEndereco(addslashes($parametros->endereco));\r\n $produtoComSeguro->setClienteEnderecoNumero($parametros->endereco_num);\r\n $produtoComSeguro->setClienteComplemento(addslashes($parametros->complemento));\r\n $produtoComSeguro->setClienteCidade(addslashes($parametros->cidade));\r\n $produtoComSeguro->setClienteUf($parametros->uf);\r\n $produtoComSeguro->setVeiculoPlaca(addslashes($parametros->placa));\r\n $produtoComSeguro->setVeiculoChassi(addslashes($parametros->chassi));\r\n $produtoComSeguro->setVeiculoUtilizacao($parametros->uti_vei);\r\n $produtoComSeguro->setClienteSeguroTipo($parametros->tipo_seguro);\r\n $produtoComSeguro->setFormaPagamento($parametros->forma_pag);\r\n $produtoComSeguro->setClasseProduto($parametros->classe_produto_prop);\r\n\r\n $produtoComSeguro->setCorretor($parametros->id_corretor_intranet);\r\n\r\n //chamada do método para processar a proposta do seguro\r\n $proposta = $produtoComSeguro->processarProposta();\r\n\r\n if($proposta['status'] == 'Erro') {\r\n\r\n if(is_array($proposta['mensagem'])) {\r\n foreach ($proposta['mensagem'] as $dadosProposta) {\r\n $this->view->mensagemAlerta .= $dadosProposta . '<br />';\r\n }\r\n } else {\r\n $this->view->mensagemAlerta = (string) $proposta['mensagem'];\r\n }\r\n\r\n } else if ($proposta['status'] == 'Sucesso') {\r\n $this->view->mensagemSucesso = (string) $proposta['mensagem'];\r\n\r\n if(isset($proposta['proposta_numero']) && trim($proposta['proposta_numero']) != '') {\r\n // Concatena o numero da proposta na mensagem de sucesso.\r\n $this->view->mensagemSucesso .= '. Número da proposta: '.$proposta['proposta_numero'];\r\n\r\n // Preenche campos do numero do contrato e classe do produto\r\n $this->view->parametros->num_contrato_apo = $parametros->num_contrato;\r\n $this->view->parametros->classe_produto_apo = $parametros->classe_produto_prop;\r\n\r\n // Seta acao p/ cair na aba de apolice\r\n $this->view->parametros->acao = 'apolice';\r\n } \r\n }\r\n\r\n }", "public function gerar_proposta_auto_configuravel()\n\t{\n\t\n\t}", "public function ActualizarProvincias()\n\t{\n\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"id_provincia\"]) or empty($_POST[\"provincia\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\n\t\t\t\t$sql = \" SELECT provincia FROM provincias WHERE id_provincia != ? AND provincia = ?\";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->execute(array($_POST[\"id_provincia\"],$_POST[\"provincia\"]));\n\t\t\t\t$num = $stmt->rowCount();\n\t\t\t\tif($num == 0)\n\t\t\t\t{\n\t\t\t\t\t$sql = \" UPDATE provincias set \"\n\t\t\t\t\t.\" provincia = ? \"\n\t\t\t\t\t.\" where \"\n\t\t\t\t\t.\" id_provincia = ?;\n\t\t\t\t\t\";\n\t\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(1, $provincia);\n\t\t\t\t\t$stmt->bindParam(2, $id_provincia);\n\n\t\t\t\t\t$provincia = limpiar($_POST[\"provincia\"]);\n\t\tif (limpiar($_POST['id_provincia']==\"\")) { $id_provincia = limpiar('0'); } else { $id_provincia = limpiar($_POST['id_provincia']); }\n\t\t\t\t\t$stmt->execute();\n\n\t\t\t\techo \"<span class='fa fa-check-square-o'></span> LA PROVINCIA HA SIDO ACTUALIZADA EXITOSAMENTE\";\n\t\t\t\texit;\n\n\t\t\t\t} else {\n\n\t\t\t\techo \"2\";\n\t\t\t\texit;\n\t\t\t}\n\t}", "public function mantenimientoEspecialidadProfesion() {\n $tablaProfesiones = $this->buscarProfesiones('');\n require_once(\"../../cvista/rrhh/mantenimientoEspecialidadProfesion.php\");\n }", "function promedio_comensal($objeto) {\n\t// Si el objeto viene vacio(llamado desde el index) se le asigna el $_REQUEST que manda el Index\n\t// Si no conserva su valor normal\n\t\t$objeto = (empty($objeto)) ? $_REQUEST : $objeto;\n\n\t// Formatea la fecha y la hora\n\t\t$objeto['f_ini'] = str_replace('T', ' ', $objeto['f_ini']).' 00:01';\n\t\t$objeto['f_fin'] = str_replace('T', ' ', $objeto['f_fin']).' 23:59';\n\n\t// Consulta los promedios por comanda y los regresa en un array\n\t\t$promedios = $this -> comandasModel -> promedio_comensal($objeto);\n\t\t\n\t// Consulta las comandas y las regresa en un array para la grafica lineal\n\t\t$objeto['agrupar'] = 'WEEK(timestamp)';\n\t\t$objeto['status'] = '*';\n\t\t$objeto['mesa'] = '*';\n\t\t$objeto['orden'] = 'c.id ASC';\n\t\t$comandas = $this -> comandasModel -> listar_comandas($objeto);\n\t\t$comandas = $comandas['rows'];\n\n\t// Arma el array para la grafica lineal\n\t\tforeach ($comandas as $key => $value) {\n\t\t\t$lineal[$key]['comandas'] = $value['comandas'];\n\t\t\t$lineal[$key]['promedioComensal'] = $value['promedioComensal'];\n\t\t\t$lineal[$key]['timestamp'] = $value['timestamp'];\n\t\t}\n\n\t// carga la vista para listar los promedios\n\t\trequire ('views/comandas/listar_promedio_comensal.php');\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->p14_sequencial = ($this->p14_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p14_sequencial\"]:$this->p14_sequencial);\n $this->p14_levantamentopatrimonial = ($this->p14_levantamentopatrimonial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p14_levantamentopatrimonial\"]:$this->p14_levantamentopatrimonial);\n $this->p14_placa = ($this->p14_placa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p14_placa\"]:$this->p14_placa);\n }else{\n $this->p14_sequencial = ($this->p14_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p14_sequencial\"]:$this->p14_sequencial);\n }\n }", "function setPrecio($precio) {\n $this->precio = $precio;\n }", "public function configuracao($param = null)\n {\n $this->pf=0;\n $this->pm=0;\n $this->pt=0;\n $this->pd=0;\n $this->provas_geradas=0;\n $this->provas_enviadas=0; \n $this->provas_feitas=0;\n try {\n TTransaction::open('ppconnect');\n $repositorio = new TRepository('BancoDeQuestoes'); \n $criterio = new TCriteria;\n if (TSession::getValue('filtro')){\n $criterio->add(TSession::getValue('filtro')); \n }\n $objetos = $repositorio->load($criterio);\n if ($objetos) {\n foreach ($objetos as $obj) {\n $this->pt++;\n switch($obj->questoes->dificuldade){\n case 0: \n $this->pf++;\n break;\n case 1: \n $this->pm++;\n break;\n case 2: \n $this->pd++;\n break;\n }\n }\n }\n $repositorio1 = new TRepository('ProvasGeradas');\n $critprovasgeradas = new TCriteria();\n $critprovasgeradas->add(new TFilter('provas_id','=',TSession::getValue('form_prova_id')));\n $count = $repositorio1->count($critprovasgeradas);\n $this->provas_geradas = $count;\n if($count>0)\n $this->apagar=true;\n else\n $this->apagar=false;\n $critprovasgeradas->add(new TFilter('data_enviada','!=',null));\n $count = $repositorio1->count($critprovasgeradas);\n $this->provas_enviadas=$count;\n \n $critprovasgeradas->add(new TFilter('data_devolvida','!=',null));\n $count = $repositorio1->count($critprovasgeradas);\n $this->provas_devolvidas=$count;\n \n TTransaction::close();\n } catch (Error $e) {\n new TMessage('Erro', $e->getMessage());\n }\n }", "public function setPro_peso($pro_peso)\n {\n $this->pro_peso = str_replace(',', '.', $pro_peso);\n }", "public static function getProiezioni(array $date) {\n $pm = FPersistentManager::getInstance();\n $elencoProgrammazioni = $pm->loadBetween($date[0], $date[1], \"EProiezione\");\n\n $filmProiezioni = [];\n $immaginiProiezioni = [];\n $giudizifilm = [];\n $dateProiezioni = [];\n $punteggio = [];\n\n foreach($elencoProgrammazioni->getElencoprogrammazioni() as $profilm) {\n array_push($filmProiezioni, $profilm->getFilm());\n\n $giu = $pm->load($profilm->getFilm()->getId(), \"idFilm\", \"EGiudizio\");\n $temp = $profilm->getDateProiezione();\n\n array_push($giudizifilm, $giu);\n array_push($dateProiezioni,$temp);\n }\n\n foreach($giudizifilm as $g) {\n if(sizeof($g) > 0) {\n $p = EGiudizio::getMedia($g);\n } else {\n $p = 0;\n }\n\n array_push($punteggio, $p);\n }\n\n foreach($filmProiezioni as $film) {\n array_push($immaginiProiezioni, $pm->load($film->getId(), \"idFilm\", \"EMedia\"));\n }\n\n $result = [];\n array_push($result, $filmProiezioni, $immaginiProiezioni, $punteggio, $dateProiezioni);\n\n return $result;\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->pc13_sequencial = ($this->pc13_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc13_sequencial\"]:$this->pc13_sequencial);\n $this->pc13_anousu = ($this->pc13_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc13_anousu\"]:$this->pc13_anousu);\n $this->pc13_coddot = ($this->pc13_coddot == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc13_coddot\"]:$this->pc13_coddot);\n $this->pc13_codigo = ($this->pc13_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc13_codigo\"]:$this->pc13_codigo);\n $this->pc13_depto = ($this->pc13_depto == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc13_depto\"]:$this->pc13_depto);\n $this->pc13_quant = ($this->pc13_quant == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc13_quant\"]:$this->pc13_quant);\n $this->pc13_valor = ($this->pc13_valor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc13_valor\"]:$this->pc13_valor);\n $this->pc13_codele = ($this->pc13_codele == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc13_codele\"]:$this->pc13_codele);\n }else{\n $this->pc13_sequencial = ($this->pc13_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc13_sequencial\"]:$this->pc13_sequencial);\n }\n }", "public function aggiungi() {\r\n\r\n $lastRowset = $this->datiVocePrecedente();\r\n $newVsp = new VociSpese();\r\n\r\n if (!is_null($lastRowset) && $lastRowset->count() > 0) {\r\n\r\n $preData = $lastRowset->toArray()[0];\r\n\r\n $data = array(\r\n self::FLD_DATA_COSTO => $preData[self::FLD_DATA_COSTO],\r\n self::FK_TIPI_COSTI => 0,\r\n self::FK_PAESI => $preData[self::FK_PAESI],\r\n self::FK_VALUTE => $preData[self::FK_VALUTE],\r\n self::FK_MOD_PAGAM => $preData[self::FK_MOD_PAGAM] != ModPagam::CONTANTE ? 0 : $preData[self::FK_MOD_PAGAM],\r\n self::FK_MOTIVI_INTERVENTO => $preData[self::FK_MOTIVI_INTERVENTO],\r\n self::FLD_MOTIVO_SPEC => $preData[self::FLD_MOTIVO_SPEC],\r\n self::FK_MATRICOLE => $preData[self::FK_MATRICOLE]\r\n );\r\n } else {\r\n\r\n $data = array(\r\n self::FLD_DATA_COSTO => '0000-00-00',\r\n self::FK_TIPI_COSTI => 0,\r\n self::FK_PAESI => 0,\r\n self::FK_VALUTE => 1,\r\n self::FK_MOD_PAGAM => 0,\r\n self::FK_MOTIVI_INTERVENTO => 0,\r\n self::FLD_MOTIVO_SPEC => '',\r\n self::FK_MATRICOLE => 0\r\n );\r\n }\r\n\r\n\r\n $newVsp->rowset->populate($data);\r\n $ret = $newVsp->rowset->save();\r\n\r\n unset($newVsp);\r\n unset($lastRowset);\r\n\r\n return $ret;\r\n }", "function getCodice_prodotto() {\r\n return $this->codice_prodotto;\r\n }", "public function onPesquisa() {\n\n $obPesq = new TSetPesquisa($this->param['key']); \n $obPesq->show();\n }", "public function nro_operaciones_programadas_nacional($trimestre,$tp_id){\n if($trimestre==1){\n $vi=1;$vf=3;\n }\n elseif($trimestre==2){\n $vi=4;$vf=6; \n }\n elseif($trimestre==3){\n $vi=7;$vf=9; \n }\n elseif($trimestre==4){\n $vi=10;$vf=12; \n }\n if($tp_id==1){\n $sql = 'select count(*) total\n from _proyectos p\n Inner Join aperturaproyectos as ap On ap.proy_id=p.proy_id\n Inner Join aperturaprogramatica as apg On apg.aper_id=ap.aper_id\n \n Inner Join vista_componentes_dictamen as c On c.proy_id=p.proy_id\n Inner Join _productos as prod On prod.com_id=c.com_id\n Inner Join (\n select prod_id\n from prod_programado_mensual\n where g_id='.$this->gestion.' and (m_id>='.$vi.' and m_id<='.$vf.') and pg_fis!=\\'0\\'\n group by prod_id\n ) as pprog On pprog.prod_id=prod.prod_id\n where prod.estado!=\\'3\\' and apg.aper_gestion='.$this->gestion.' and p.tp_id=\\'1\\'';\n }\n else{\n $sql = 'select count(*) total\n from _proyectos p\n Inner Join unidad_actividad as ua On ua.act_id=p.act_id\n Inner Join uni_gestion as ug On ua.act_id=ug.act_id\n\n Inner Join aperturaproyectos as ap On ap.proy_id=p.proy_id\n Inner Join aperturaprogramatica as apg On apg.aper_id=ap.aper_id\n \n Inner Join vista_componentes_dictamen as c On c.proy_id=p.proy_id\n Inner Join _productos as prod On prod.com_id=c.com_id\n Inner Join (\n select prod_id\n from prod_programado_mensual\n where g_id='.$this->gestion.' and (m_id>='.$vi.' and m_id<='.$vf.') and pg_fis!=\\'0\\'\n group by prod_id\n ) as pprog On pprog.prod_id=prod.prod_id\n where prod.estado!=\\'3\\' and apg.aper_gestion='.$this->gestion.' and p.tp_id=\\'4\\' and ua.act_estado!=\\'3\\' and ug.g_id='.$this->gestion.'';\n }\n\n \n $query = $this->db->query($sql);\n return $query->result_array();\n }", "public function MeteCarrito() {\n $datosprod=array(\n \"id\"=>$this->input->post('idpro'),\n\t\t\"cantidad\"=>$this->input->post('cantidad'),\n\t\t\"precio\"=>$this->input->post('prefi'),\n );\n $this->carrito->add($datosprod);\n\n $this->Muestracarrito();\n \n }", "public function prodotti(){\n\t\treturn $this->has_many_through('Prodotto', 'Appartiene', 'IDPizzeria', 'IDProdotto');\n\t}", "function pruebaListarProcesosSecuencia() { // ---> prueba unitaria de la funcion secuenciar procesos (el metoso mas importante \"listar los procesos\")\n //llamamos al metodo que lista los procesos secuencias\n $test = $this->listaProcesosSecuencia();\n //si el valor resultante es una cadena de texto\n $expected_result = 'is_string';\n $test_name = 'comprobar si trae los procesos desde la base de datos';\n $this->unit->run($test, $expected_result, $test_name);\n //retorna el resultado de la prueba\n echo $this->unit->report();\n }", "public function fabrica(): Profesor {\n\t\t//TODO:\n\t}", "function Preposicao(){\n\t\t\t$Tresletras = controle::BuscaPalavras ($this->textoB,3);\n\t\t\t$LetrasFoo = controle::LetraQueTerminaEmTipoFoo($Tresletras);\n\t\t\t$Preposicao = controle::TiraPalavra($LetrasFoo,'b');\n\t\t\t\treturn $Preposicao;\n\t}", "public function getProba()\n {\n return $this->proba;\n }", "function sincronizar(){\n\t\t$arr_query = array();\n\t\t$arr_codproduto = array();\n\t\tif(strlen($this->dthrsinc) > 0){\n\t\t\t$arr_dtsinc = explode(\" \", $this->dthrsinc);\n\t\t\t$dtsinc = value_date($arr_dtsinc[0]);\n\t\t\t$arr_query[] = \"SELECT DISTINCT chave AS codproduto FROM historico WHERE tabela = 'produto' AND operacao IN ('I', 'U') AND dtcriacao >= '{$dtsinc}' ORDER BY 1\";\n\t\t\t$arr_query[] = \"SELECT DISTINCT codproduto FROM logpreco WHERE tipo IN ('PV', 'PA') AND codestabelec = {$this->estabelecimento->getcodestabelec()} AND data >= '{$dtsinc}' ORDER BY 1\";\n\t\t\t$arr_query[] = \"SELECT DISTINCT codproduto FROM produtoestabsaldo WHERE codestabelec = {$this->estabelecimento->getcodestabelec()} AND data >= '{$dtsinc}' ORDER BY 1\";\n\t\t}else{\n\t\t\tif(strlen($this->codproduto) > 0){\n\t\t\t\t$arr_query[] = \"SELECT codproduto FROM produto WHERE foralinha = 'N' AND codproduto > {$this->codproduto} ORDER BY codproduto\";\n\t\t\t}else{\n\t\t\t\t$arr_query[] = \"SELECT codproduto FROM produto WHERE foralinha = 'N' ORDER BY codproduto\";\n\t\t\t}\n\t\t}\n\t\tforeach($arr_query as $query){\n\t\t\t$res = $this->con->query($query);\n\t\t\t$arr = $res->fetchAll(2);\n\t\t\tforeach($arr as $row){\n\n\t\t\t\t// REMOVER\n\t\t\t\tif($row[\"codproduto\"] == 52628){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$arr_codproduto[] = $row[\"codproduto\"];\n\t\t\t}\n\t\t}\n\t\tsort($arr_codproduto);\n\n\t\t// Filtra apenas os produtos que tem foto\n\t\t/*\n\t\t$arr_codproduto_aux = array();\n\t\tif(strlen($this->dirfotoprod) > 0){\n\t\t\tforeach($arr_codproduto as $codproduto){\n\t\t\t\t$filename = \"{$this->dirfotoprod}/{$codproduto}/0.jpg\";\n\t\t\t\tif(!file_exists($filename)){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$size = getimagesize($filename);\n\t\t\t\tif($size[0] > 3200 || $size[1] > 3200){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$arr_codproduto_aux[] = $codproduto;\n\t\t\t}\n\t\t}\n\t\t$arr_codproduto = $arr_codproduto_aux;\n\t\tunset($arr_codproduto_aux);\n\t\t*/\n\n\t\t$this->debug(\"Total de produtos a serem enviados: \".count($arr_codproduto));\n\n\t\t// Carrega os produtos a partir dos codigos\n\t\t$arr_produto = object_array_key(objectbytable(\"produto\", NULL, $this->con), $arr_codproduto, \"codproduto\");\n\n\t\t// Aplica alguns filtros nos produtos\n\t\t$arr_produto_aux = array();\n\t\tforeach($arr_produto as $produto){\n\t\t\tif($produto->getenviarecommerce() === \"N\"){\n//\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(strlen($produto->getcodmarca()) === 0){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$arr_produto_aux[] = $produto;\n\t\t}\n\t\t$arr_produto = $arr_produto_aux;\n\t\tunset($arr_produto_aux);\n\n\t\t// Carrega os departamentos dos produtos\n\t\t$arr_coddepto = array();\n\t\tforeach($arr_produto as $produto){\n\t\t\t$arr_coddepto[] = $produto->getcoddepto();\n\t\t}\n\t\t$arr_departamento = object_array_key(objectbytable(\"departamento\", NULL, $this->con), $arr_coddepto, \"coddepto\");\n\n\t\t// Carrega os grupos dos produtos\n\t\t$arr_codgrupo = array();\n\t\tforeach($arr_produto as $produto){\n\t\t\t$arr_codgrupo[] = $produto->getcodgrupo();\n\t\t}\n\t\t$arr_grupoprod = object_array_key(objectbytable(\"grupoprod\", NULL, $this->con), $arr_codgrupo, \"codgrupo\");\n\n\t\t// Carrega as marcas dos produtos\n\t\t$arr_codmarca = array();\n\t\tforeach($arr_produto as $produto){\n\t\t\t$arr_codmarca[] = $produto->getcodmarca();\n\t\t}\n\t\t$arr_marca = object_array_key(objectbytable(\"marca\", NULL, $this->con), $arr_codmarca, \"codmarca\");\n\n\t\t// Envia os departamentos para o V-Tex\n\t\tforeach($arr_departamento as $departamento){\n\t\t\tif(!$this->enviar_departamento($departamento)){\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Envia os grupos para o V-Tex\n\t\tforeach($arr_grupoprod as $grupoprod){\n\t\t\tif(!$this->enviar_grupoprod($grupoprod)){\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Envia as marcas para o V-Tex\n\t\tforeach($arr_marca as $marca){\n\t\t\tif(!$this->enviar_marca($marca)){\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Envia os produtos para o V-Tex\n\t\tforeach($arr_produto as $produto){\n\t\t\tif(!$this->enviar_produto($produto)){\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Recebe os pedidos do V-Tex\n\t\tif(!$this->receber_pedidos()){\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Atualiza a data e hora de sincronizacao no parametro\n\t\t$this->parametro_atualizar(\"DTHRSINC\", date(\"Y-m-d H:i:s\"));\n\n\t\t$this->debug(\"Sincronização finalizada com sucesso!\");\n\n\t\treturn TRUE;\n\t}", "private function inizVarContratto(){\r\n $this->varWork=$this->post('data');\r\n $giorni=$this->post('giorni');\r\n $giorni[0]=0;\r\n $this->giorni=$giorni;\r\n $this->setTime();\r\n $this->setDate();\r\n $this->setIdPrenotazione();\r\n }", "function actualiza_Ponencia($pp_id, $pp_año, $pp_titulo, $pp_nombre_evento, $pp_lugar, $te_id)\n\t\t{\n\t\t\t$this->sql=\"UPDATE ponencia SET pp_año=$pp_año, pp_titulo='$pp_titulo', pp_nombre_evento='$pp_nombre_evento', pp_lugar='$pp_lugar', te_id=$te_id where pp_id=$pp_id\";\n\t\t\t\n\t\t\tparent::ejecutaQUERY();\n\t\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->k00_numpre = ($this->k00_numpre == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k00_numpre\"]:$this->k00_numpre);\n $this->k00_inscr = ($this->k00_inscr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k00_inscr\"]:$this->k00_inscr);\n }else{\n $this->k00_numpre = ($this->k00_numpre == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k00_numpre\"]:$this->k00_numpre);\n $this->k00_inscr = ($this->k00_inscr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k00_inscr\"]:$this->k00_inscr);\n }\n }", "function subsolFactura() {\n\t\t$this -> expediere();\n\t\t$this -> total();\n\t\t$this -> semnatura();\n\t}", "public function escolherSetorVida()\n {\n $profissional = $this->input->get(\"p\");\n\n if($profissional != 1)\n {\n redirect('jogo/consultaVirtual');\n }\n\n $dados = $this->getDadosTelaInicial();\n \n // carrega o template\n $this->template->view(\"automatico_escolher_setor_vida\", array(\n \"title\" => \"Auto Consulta\",\n \"verticalTabs\" => true,\n \"jogosConsultaVirtual\" => $dados['jogosConsultaVirtual'],\n \"jogosAutoConsulta\" => $dados['jogosAutoConsulta'],\n \"setoresVida\" => $dados['setoresVida'],\n \"profissional\" => $profissional,\n \"codUsuarioCombinacao\" => $dados['codUsuarioCombinacao'],\n \"menuLateral\" => false\n ));\n }", "function setParticipe($noSes) {\n\t$dbh = connectDb();\t\t\t\t// connexion à la bdd\n\t$sql = \"INSERT INTO Propose VALUES (:noMem, :noSes);\";\n\t$sth = $dbh->prepare($sql);\n\t$sth->bindParam(\":noMem\", $_SESSION[\"noMem\"], PDO::PARAM_STR);\n\t$sth->bindParam(\":noSes\", $noSes, PDO::PARAM_STR);\n\tif ($sth->execute() == 0)\n\t\tprint($dbh->errorInfo()); \t// affiche message d'érreur de la bdd \n\t$dbh = null;\t\t\t\t\t\t// déconnexion de la bdd\t\t\t\n}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->p50_sequencial = ($this->p50_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_sequencial\"]:$this->p50_sequencial);\n $this->p50_idusuario = ($this->p50_idusuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_idusuario\"]:$this->p50_idusuario);\n $this->p50_tipo = ($this->p50_tipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_tipo\"]:$this->p50_tipo);\n if($this->p50_data == \"\"){\n $this->p50_data_dia = ($this->p50_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_data_dia\"]:$this->p50_data_dia);\n $this->p50_data_mes = ($this->p50_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_data_mes\"]:$this->p50_data_mes);\n $this->p50_data_ano = ($this->p50_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_data_ano\"]:$this->p50_data_ano);\n if($this->p50_data_dia != \"\"){\n $this->p50_data = $this->p50_data_ano.\"-\".$this->p50_data_mes.\"-\".$this->p50_data_dia;\n }\n }\n $this->p50_hora = ($this->p50_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_hora\"]:$this->p50_hora);\n $this->p50_ip = ($this->p50_ip == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_ip\"]:$this->p50_ip);\n $this->p50_hist = ($this->p50_hist == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_hist\"]:$this->p50_hist);\n $this->p50_web = ($this->p50_web == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_web\"]:$this->p50_web);\n $this->p50_codproc = ($this->p50_codproc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_codproc\"]:$this->p50_codproc);\n $this->p50_exerc = ($this->p50_exerc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_exerc\"]:$this->p50_exerc);\n $this->p50_codimpresso = ($this->p50_codimpresso == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_codimpresso\"]:$this->p50_codimpresso);\n $this->p50_instit = ($this->p50_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_instit\"]:$this->p50_instit);\n $this->p50_arquivo = ($this->p50_arquivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_arquivo\"]:$this->p50_arquivo);\n $this->p50_diasvalidade = ($this->p50_diasvalidade == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_diasvalidade\"]:$this->p50_diasvalidade);\n }else{\n $this->p50_sequencial = ($this->p50_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"p50_sequencial\"]:$this->p50_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->pc66_sequencial = ($this->pc66_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_sequencial\"]:$this->pc66_sequencial);\n $this->pc66_registroprecomovimentacao = ($this->pc66_registroprecomovimentacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_registroprecomovimentacao\"]:$this->pc66_registroprecomovimentacao);\n $this->pc66_orcamforne = ($this->pc66_orcamforne == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_orcamforne\"]:$this->pc66_orcamforne);\n if($this->pc66_datainicial == \"\"){\n $this->pc66_datainicial_dia = ($this->pc66_datainicial_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_datainicial_dia\"]:$this->pc66_datainicial_dia);\n $this->pc66_datainicial_mes = ($this->pc66_datainicial_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_datainicial_mes\"]:$this->pc66_datainicial_mes);\n $this->pc66_datainicial_ano = ($this->pc66_datainicial_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_datainicial_ano\"]:$this->pc66_datainicial_ano);\n if($this->pc66_datainicial_dia != \"\"){\n $this->pc66_datainicial = $this->pc66_datainicial_ano.\"-\".$this->pc66_datainicial_mes.\"-\".$this->pc66_datainicial_dia;\n }\n }\n if($this->pc66_datafinal == \"\"){\n $this->pc66_datafinal_dia = ($this->pc66_datafinal_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_datafinal_dia\"]:$this->pc66_datafinal_dia);\n $this->pc66_datafinal_mes = ($this->pc66_datafinal_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_datafinal_mes\"]:$this->pc66_datafinal_mes);\n $this->pc66_datafinal_ano = ($this->pc66_datafinal_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_datafinal_ano\"]:$this->pc66_datafinal_ano);\n if($this->pc66_datafinal_dia != \"\"){\n $this->pc66_datafinal = $this->pc66_datafinal_ano.\"-\".$this->pc66_datafinal_mes.\"-\".$this->pc66_datafinal_dia;\n }\n }\n $this->pc66_pcorcamitem = ($this->pc66_pcorcamitem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_pcorcamitem\"]:$this->pc66_pcorcamitem);\n $this->pc66_justificativa = ($this->pc66_justificativa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_justificativa\"]:$this->pc66_justificativa);\n $this->pc66_tipomovimentacao = ($this->pc66_tipomovimentacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_tipomovimentacao\"]:$this->pc66_tipomovimentacao);\n $this->pc66_solicitem = ($this->pc66_solicitem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_solicitem\"]:$this->pc66_solicitem);\n }else{\n $this->pc66_sequencial = ($this->pc66_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc66_sequencial\"]:$this->pc66_sequencial);\n }\n }", "function actualiza_Proyecto($ip_id, $proy_id, $proy_lugar, $proy_año, $proy_titulo, $proy_autor, $proy_nom_empresa, $tp_id, $finan_id)\n\t\t{\n\t\t\t//Actualiza los datos del proyecto\n\t\t\t$this->sql=\"update proyecto set proy_lugar='$proy_lugar', proy_año=$proy_año, proy_titulo='$proy_titulo', proy_autor='$proy_autor', proy_nom_empresa='$proy_nom_empresa', tp_id=$tp_id, finan_id=$finan_id \";\n\t\t\t$this->sql.=\"where proy_id=$proy_id\";\n\t\t\t\n\t\t\tparent::ejecutaQUERY();\n\t\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->v75_sequencial = ($this->v75_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v75_sequencial\"]:$this->v75_sequencial);\n $this->v75_seqprocforo = ($this->v75_seqprocforo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v75_seqprocforo\"]:$this->v75_seqprocforo);\n $this->v75_numcgm = ($this->v75_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v75_numcgm\"]:$this->v75_numcgm);\n }else{\n $this->v75_sequencial = ($this->v75_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v75_sequencial\"]:$this->v75_sequencial);\n }\n }", "function Proposta($conn, $ID_USUARIO, $PROPOSTA_RECEBIDA, $DE_ACORDO_DIRECAO, $ENQUADRAMENTO, $ENVIO_PROPOSTA, $COMUNICAR_PROPOSTA_ENVIADA,$ACEITA_RECUSA_CANDIDATO, $COMENTARIO, $COMUNICAR_STATUS){\r\n\t\t$query = \"UPDATE propostas_contratacoes set PROPOSTA_RECEBIDA = '{$PROPOSTA_RECEBIDA}', DE_ACORDO_DIRECAO = '{$DE_ACORDO_DIRECAO}', ENQUADRAMENTO = '{$ENQUADRAMENTO}', ENVIO_PROPOSTA = '{$ENVIO_PROPOSTA}', COMUNICAR_PROPOSTA_ENVIADA = '{$COMUNICAR_PROPOSTA_ENVIADA}', ACEITE_RECUSA_CANDIDATO = '{$ACEITA_RECUSA_CANDIDATO}', COMENTARIO = '{$COMENTARIO}', COMUNICAR_STATUS = '{$COMUNICAR_STATUS}' where ID_USUARIO = '{$ID_USUARIO}'\";\r\n\t\treturn mysqli_query($conn, $query);\r\n\t}", "public function mis_requerimientos($proy_act, $pfec_ejec,$tp_ins){\n if($this->gestion==2018){\n if($proy_act==1){\n if ($pfec_ejec == 1) {\n //PROGRAMACION DIRECTA, DIRECTO = 1\n $sql = 'select *\n from _insumoactividad ia\n Inner Join insumos as i On i.ins_id=ia.ins_id\n Inner Join tipo_insumo as ti On i.ins_tipo=ti.ti_id\n Inner Join partidas as par On par.par_id=i.par_id\n Inner Join insumo_gestion as ig On ig.ins_id=i.ins_id\n Inner Join vifin_prog_mes as ipr On ipr.insg_id=ig.insg_id\n where ia.act_id='.$tp_ins.' and i.ins_estado!=\\'3\\' and ig.g_id='.$this->gestion.' and ig.insg_estado!=\\'3\\' and i.aper_id!=\\'0\\'\n order by par_codigo asc';\n \n } else {\n //PROGRAMACION DELEGADA, DELEGADA = 2\n $sql = 'select *\n from vproy_insumo_componente_programado\n where com_id='.$tp_ins.' and g_id='.$this->gestion.'\n order by par_codigo asc';\n \n }\n }\n else{\n $sql = 'select *\n from _insumoproducto ip\n Inner Join insumos as i On i.ins_id=ip.ins_id\n Inner Join tipo_insumo as ti On i.ins_tipo=ti.ti_id\n Inner Join partidas as par On par.par_id=i.par_id\n Inner Join insumo_gestion as ig On ig.ins_id=i.ins_id\n Inner Join vifin_prog_mes as ipr On ipr.insg_id=ig.insg_id\n where ip.prod_id='.$tp_ins.' and i.ins_estado!=\\'3\\' and ig.g_id='.$this->gestion.' and ig.insg_estado!=\\'3\\' and i.aper_id!=\\'0\\'\n order by par_codigo asc';\n }\n }\n else{\n if($proy_act==1){\n if ($pfec_ejec == 1) {\n //PROGRAMACION DIRECTA, DIRECTO = 1\n $sql = 'select *\n from _insumoactividad ia\n Inner Join insumos as i On i.ins_id=ia.ins_id\n Inner Join partidas as par On par.par_id=i.par_id\n Inner Join insumo_gestion as ig On ig.ins_id=i.ins_id\n Inner Join vifin_prog_mes as ipr On ipr.insg_id=ig.insg_id\n where ia.act_id='.$tp_ins.' and i.ins_estado!=\\'3\\' and ig.g_id='.$this->gestion.' and ig.insg_estado!=\\'3\\' and i.aper_id!=\\'0\\'\n order by par_codigo asc';\n \n } else {\n //PROGRAMACION DELEGADA, DELEGADA = 2\n $sql = 'select *\n from vproy_insumo_componente_programado\n where com_id='.$tp_ins.' and g_id='.$this->gestion.'\n order by par_codigo asc';\n \n }\n }\n else{\n $sql = 'select *\n from _insumoproducto ip\n Inner Join insumos as i On i.ins_id=ip.ins_id\n Inner Join partidas as par On par.par_id=i.par_id\n Inner Join insumo_gestion as ig On ig.ins_id=i.ins_id\n Inner Join vifin_prog_mes as ipr On ipr.insg_id=ig.insg_id\n where ip.prod_id='.$tp_ins.' and i.ins_estado!=\\'3\\' and ig.g_id='.$this->gestion.' and ig.insg_estado!=\\'3\\' and i.aper_id!=\\'0\\'\n order by par_codigo asc';\n }\n }\n \n\n $query = $this->db->query($sql);\n return $query->result_array();\n }", "public function __contruct(){\n $this -> notaPorfolio = 0.0; //el this es para acceder a las propiedad definida anteriormente y darle un valor.\n $this -> notaPhp = 0.0;\n $this -> notaProyecto = 0.0;\n }", "public function atualizarPercentualProjeto($params)\n {\n $this->_mapper->atualizarPercentualProjeto($params);\n }", "function pause(){\r\n\t\tif ($this->getLigado()==true && ($this->getTocando()==true)){\r\n\t\t\t$this->setTocando(false);\r\n\t\t}\r\n\t\telse\r\n\t\t\t//$this->setTocando(true); //sem senso\r\n\t\t\techo \"Nao pode pausar pq o controle esta desligado\";\r\n\t}", "public function reiniciarPlusDevueltos();", "function evt__procesar()\n {\n if(!isset($this->s__prestamo_seleccionado))\n {\n $this->controlador()->get_tabla('prestamo')->nueva_fila($this->s__datos_prestamo);\n } else {\n $id = $this->s__prestamo_seleccionado;\n $this->controlador()->get_tabla('prestamo')->modificar_fila($id, $this->s__datos_prestamo);\n }\n $this->controlador()->get_tabla('prestamo')->set_cursor($id);\n // Procesar las filas del detalle\n if ($this->hay_maestro){\n $this->controlador()->get_tabla('detalle')->procesar_filas($this->s__datos_detalle);\n }\n $this->evt__cancelar();\n }", "function vista_promedio_comensal($objeto) {\n\t// Consulta las sucursales y las regresa en un array\n\t\t$sucursales = $this -> comandasModel -> listar_sucursales($objeto);\n\t\t$sucursales = $sucursales['rows'];\n\n\t// Consulta los empleado sy los regresa en un array\n\t\t$empleados = $this -> comandasModel -> listar_empleados($objeto);\n\t\t\n\t// Carga la vista del promedio por comensal\n\t\trequire ('views/comandas/vista_promedio_comensal.php');\n\t}", "function OutraParte() {\r\n extract($GLOBALS);\r\n global $w_Disabled;\r\n\r\n if ($O == '') $O = 'P';\r\n\r\n $w_erro = '';\r\n $w_chave = $_REQUEST['w_chave'];\r\n $w_chave_aux = $_REQUEST['w_chave_aux'];\r\n $w_cpf = $_REQUEST['w_cpf'];\r\n $w_cnpj = $_REQUEST['w_cnpj'];\r\n $w_sq_pessoa = nvl($_REQUEST['w_sq_pessoa'], $_REQUEST['w_sq_prop']);\r\n $w_pessoa_atual = $_REQUEST['w_pessoa_atual'];\r\n $w_tipo_pessoa = $_REQUEST['w_tipo_pessoa'];\r\n\r\n $sql = new db_getSolicData; $RS = $sql->getInstanceOf($dbms, $w_chave, $SG);\r\n \r\n // Verifica se há necessidade de informar os dados para pagamento das diárias\r\n if (nvl(f($RS, 'diaria'), '') != '' || f($RS, 'hospedagem') != 'N' || f($RS, 'veiculo') != 'N') {\r\n $w_dados_pagamento = true;\r\n } else {\r\n $w_dados_pagamento = false;\r\n }\r\n if ($w_sq_pessoa == '' && strpos($_REQUEST['Botao'], 'Selecionar') === false) {\r\n $w_sq_pessoa = f($RS, 'sq_prop');\r\n $w_pessoa_atual = f($RS, 'sq_prop');\r\n $w_sq_forma_pag = f($RS, 'sq_forma_pagamento');\r\n $w_sq_banco = f($RS, 'sq_banco');\r\n $w_sq_agencia = f($RS, 'sq_agencia');\r\n $w_operacao = f($RS, 'operacao_conta');\r\n $w_nr_conta = f($RS, 'numero_conta');\r\n $w_sq_pais_estrang = f($RS, 'sq_pais_estrang');\r\n $w_aba_code = f($RS, 'aba_code');\r\n $w_swift_code = f($RS, 'swift_code');\r\n $w_endereco_estrang = f($RS, 'endereco_estrang');\r\n $w_banco_estrang = f($RS, 'banco_estrang');\r\n $w_agencia_estrang = f($RS, 'agencia_estrang');\r\n $w_cidade_estrang = f($RS, 'cidade_estrang');\r\n $w_informacoes = f($RS, 'informacoes');\r\n $w_codigo_deposito = f($RS, 'codigo_deposito');\r\n $w_sq_tipo_pessoa = f($RS, 'sq_tipo_pessoa');\r\n }\r\n if (Nvl($w_sq_pessoa, 0) == 0)\r\n $O = 'I'; else\r\n $O='A';\r\n // Verifica se há necessidade de recarregar os dados da tela a partir\r\n // da própria tela (se for recarga da tela) ou do banco de dados (se não for inclusão)\r\n if ($w_troca > '') {\r\n // Se for recarga da página\r\n $w_chave = $_REQUEST['w_chave'];\r\n $w_chave_aux = $_REQUEST['w_chave_aux'];\r\n $w_nome = $_REQUEST['w_nome'];\r\n $w_nome_resumido = $_REQUEST['w_nome_resumido'];\r\n $w_sq_pessoa_pai = $_REQUEST['w_sq_pessoa_pai'];\r\n $w_nm_tipo_pessoa = $_REQUEST['w_nm_tipo_pessoa'];\r\n $w_sq_tipo_vinculo = $_REQUEST['w_sq_tipo_vinculo'];\r\n $w_nm_tipo_vinculo = $_REQUEST['w_nm_tipo_vinculo'];\r\n $w_sq_forma_pag = $_REQUEST['w_sq_forma_pag'];\r\n $w_sq_banco = $_REQUEST['w_sq_banco'];\r\n $w_sq_agencia = $_REQUEST['w_sq_agencia'];\r\n $w_operacao = $_REQUEST['w_operacao'];\r\n $w_nr_conta = $_REQUEST['w_nr_conta'];\r\n $w_sq_pais_estrang = $_REQUEST['w_sq_pais_estrang'];\r\n $w_aba_code = $_REQUEST['w_aba_code'];\r\n $w_swift_code = $_REQUEST['w_swift_code'];\r\n $w_endereco_estrang = $_REQUEST['w_endereco_estrang'];\r\n $w_banco_estrang = $_REQUEST['w_banco_estrang'];\r\n $w_agencia_estrang = $_REQUEST['w_agencia_estrang'];\r\n $w_cidade_estrang = $_REQUEST['w_cidade_estrang'];\r\n $w_informacoes = $_REQUEST['w_informacoes'];\r\n $w_codigo_deposito = $_REQUEST['w_codigo_deposito'];\r\n $w_interno = $_REQUEST['w_interno'];\r\n $w_vinculo_ativo = $_REQUEST['w_vinculo_ativo'];\r\n $w_sq_pessoa_telefone = $_REQUEST['w_sq_pessoa_telefone'];\r\n $w_ddd = $_REQUEST['w_ddd'];\r\n $w_nr_telefone = $_REQUEST['w_nr_telefone'];\r\n $w_sq_pessoa_celular = $_REQUEST['w_sq_pessoa_celular'];\r\n $w_nr_celular = $_REQUEST['w_nr_celular'];\r\n $w_sq_pessoa_fax = $_REQUEST['w_sq_pessoa_fax'];\r\n $w_nr_fax = $_REQUEST['w_nr_fax'];\r\n $w_email = $_REQUEST['w_email'];\r\n $w_sq_pessoa_endereco = $_REQUEST['w_sq_pessoa_endereco'];\r\n $w_logradouro = $_REQUEST['w_logradouro'];\r\n $w_complemento = $_REQUEST['w_complemento'];\r\n $w_bairro = $_REQUEST['w_bairro'];\r\n $w_cep = $_REQUEST['w_cep'];\r\n $w_sq_cidade = $_REQUEST['w_sq_cidade'];\r\n $w_co_uf = $_REQUEST['w_co_uf'];\r\n $w_sq_pais = $_REQUEST['w_sq_pais'];\r\n $w_pd_pais = $_REQUEST['w_pd_pais'];\r\n $w_cpf = $_REQUEST['w_cpf'];\r\n $w_nascimento = $_REQUEST['w_nascimento'];\r\n $w_rg_numero = $_REQUEST['w_rg_numero'];\r\n $w_rg_emissor = $_REQUEST['w_rg_emissor'];\r\n $w_rg_emissao = $_REQUEST['w_rg_emissao'];\r\n $w_passaporte = $_REQUEST['w_passaporte'];\r\n $w_sq_pais_passaporte = $_REQUEST['w_sq_pais_passaporte'];\r\n $w_sexo = $_REQUEST['w_sexo'];\r\n $w_cnpj = $_REQUEST['w_cnpj'];\r\n $w_inscricao_estadual = $_REQUEST['w_inscricao_estadual'];\r\n } else {\r\n if (strpos($_REQUEST['Botao'], 'Alterar') === false && strpos($_REQUEST['Botao'], 'Procurar') === false && ($O == 'A' || $w_sq_pessoa > '' || $w_cpf > '' || $w_cnpj > '')) {\r\n // Recupera os dados do beneficiário em co_pessoa\r\n $sql = new db_getBenef; $RS = $sql->getInstanceOf($dbms, $w_cliente, $w_sq_pessoa, null, $w_cpf, $w_cnpj, null, null, null, null, null, null, null, null, null, null, null, null, null);\r\n if (count($RS) > 0) {\r\n foreach ($RS as $row) {\r\n $RS = $row;\r\n break;\r\n }\r\n $w_sq_pessoa = f($RS, 'sq_pessoa');\r\n $w_tipo_pessoa = f($row, 'sq_tipo_pessoa');\r\n $w_nome = f($RS, 'nm_pessoa');\r\n $w_nome_resumido = f($RS, 'nome_resumido');\r\n $w_sq_pessoa_pai = f($RS, 'sq_pessoa_pai');\r\n $w_nm_tipo_pessoa = f($RS, 'nm_tipo_pessoa');\r\n $w_sq_tipo_vinculo = f($RS, 'sq_tipo_vinculo');\r\n $w_nm_tipo_vinculo = f($RS, 'nm_tipo_vinculo');\r\n $w_interno = f($RS, 'interno');\r\n $w_vinculo_ativo = f($RS, 'vinculo_ativo');\r\n $w_sq_pessoa_telefone = f($RS, 'sq_pessoa_telefone');\r\n $w_ddd = f($RS, 'ddd');\r\n $w_nr_telefone = f($RS, 'nr_telefone');\r\n $w_sq_pessoa_celular = f($RS, 'sq_pessoa_celular');\r\n $w_nr_celular = f($RS, 'nr_celular');\r\n $w_sq_pessoa_fax = f($RS, 'sq_pessoa_fax');\r\n $w_nr_fax = f($RS, 'nr_fax');\r\n $w_email = f($RS, 'email');\r\n $w_sq_pessoa_endereco = f($RS, 'sq_pessoa_endereco');\r\n $w_logradouro = f($RS, 'logradouro');\r\n $w_complemento = f($RS, 'complemento');\r\n $w_bairro = f($RS, 'bairro');\r\n $w_cep = f($RS, 'cep');\r\n $w_sq_cidade = f($RS, 'sq_cidade');\r\n $w_co_uf = f($RS, 'co_uf');\r\n $w_sq_pais = f($RS, 'sq_pais');\r\n $w_pd_pais = f($RS, 'pd_pais');\r\n $w_cpf = f($RS, 'cpf');\r\n $w_nascimento = FormataDataEdicao(f($RS, 'nascimento'));\r\n $w_rg_numero = f($RS, 'rg_numero');\r\n $w_rg_emissor = f($RS, 'rg_emissor');\r\n $w_rg_emissao = FormataDataEdicao(f($RS, 'rg_emissao'));\r\n $w_passaporte = f($RS, 'passaporte_numero');\r\n $w_sq_pais_passaporte = f($RS, 'sq_pais_passaporte');\r\n $w_sexo = f($RS, 'sexo');\r\n $w_cnpj = f($RS, 'cnpj');\r\n $w_inscricao_estadual = f($RS, 'inscricao_estadual');\r\n }\r\n }\r\n }\r\n\r\n // Recupera a sigla da forma de pagamento e, se necessário, recupera a conta padrão do beneficiário\r\n if (nvl($w_sq_forma_pag, '') != '') {\r\n $sql = new db_getFormaPagamento; $RS_Forma_Pag = $sql->getInstanceOf($dbms, $w_cliente, $w_sq_forma_pag, null, 'REGISTRO', null, null);\r\n foreach ($RS_Forma_Pag as $row) {\r\n $RS_Forma_Pag = $row;\r\n break;\r\n }\r\n $w_forma_pagamento = f($RS_Forma_Pag, 'sigla');\r\n\r\n if (strpos('CREDITO,DEPOSITO', $w_forma_pagamento) !== false) {\r\n\r\n if (Nvl($w_sq_banco, '') == '' && Nvl($w_nr_conta, '') == '') {\r\n $sql = new db_getBenef; $RS = $sql->getInstanceOf($dbms, $w_cliente, $w_sq_pessoa, null, $w_cpf, $w_cnpj, null, null, null, null, null, null, null, null, null, null, null, null, null);\r\n if (count($RS) > 0) {\r\n\r\n foreach ($RS as $row) {\r\n $RS = $row;\r\n break;\r\n }\r\n if (Nvl(f($RS, 'nr_conta'), '') != '') {\r\n $w_sq_banco = f($RS, 'sq_banco');\r\n $w_sq_agencia = f($RS, 'sq_agencia');\r\n $w_operacao = f($RS, 'operacao');\r\n $w_nr_conta = f($RS, 'nr_conta');\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n // Recupera informação do campo operação do banco selecionado\r\n if (nvl($w_sq_banco, '') > '') {\r\n $sql = new db_getBankData; $RS_Banco = $sql->getInstanceOf($dbms, $w_sq_banco);\r\n $w_exige_operacao = f($RS_Banco, 'exige_operacao');\r\n }\r\n Cabecalho();\r\n head();\r\n Estrutura_CSS($w_cliente);\r\n // Monta o código JavaScript necessário para validação de campos e preenchimento automático de máscara,\r\n // tratando as particularidades de cada serviço\r\n ScriptOpen('JavaScript');\r\n Modulo();\r\n FormataCPF();\r\n FormataCNPJ();\r\n FormataCEP();\r\n CheckBranco();\r\n FormataData();\r\n SaltaCampo();\r\n ValidateOpen('Validacao');\r\n if (($w_sq_pessoa == '' && $w_cpf == '' && $w_cnpj == '' && $w_passaporte == '') || strpos($_REQUEST['Botao'], 'Procurar') !== false || strpos($_REQUEST['Botao'], 'Alterar') !== false) {\r\n // Se o beneficiário ainda não foi selecionado\r\n /* ShowHTML(' if (theForm.Botao.value == \"Procurar\") {');\r\n Validate('w_nome', 'Nome', '', '1', '4', '20', '1', '');\r\n ShowHTML(' theForm.Botao.value = \"Procurar\";');\r\n ShowHTML('}');\r\n ShowHTML('else {');\r\n Validate('w_cpf', 'CPF', 'CPF', '1', '14', '14', '', '0123456789-.');\r\n ShowHTML(' theForm.w_sq_pessoa.value = \\'\\';');\r\n ShowHTML('}'); */\r\n } elseif ($O == 'I' || $O == 'A') {\r\n ShowHTML(' if (theForm.w_troca.value.indexOf(\\'Alterar\\') >= 0) { return true; }');\r\n Validate('w_nome', 'Nome', '1', 1, 5, 60, '1', '1');\r\n Validate('w_nome_resumido', 'Nome resumido', '1', 1, 2, 21, '1', '1');\r\n Validate('w_sexo', 'Sexo', 'SELECT', 1, 1, 1, 'MF', '');\r\n// if (nvl($w_cpf,'') == '') {\r\n// Validate('w_cpf', 'CPF', 'CPF', '1', '14', '14', '', '0123456789-.');\r\n// }\r\n if ($w_sq_tipo_vinculo == '') {\r\n Validate('w_sq_tipo_vinculo', 'Tipo de vínculo', 'SELECT', 1, 1, 18, '', '1');\r\n }\r\n if ($w_tipo_pessoa == 1) {\r\n Validate('w_rg_numero', 'Identidade', '1', 1, 2, 30, '1', '1');\r\n Validate('w_rg_emissao', 'Data de emissão', 'DATA', '', 10, 10, '', '0123456789/');\r\n Validate('w_rg_emissor', 'Órgão expedidor', '1', 1, 2, 30, '1', '1');\r\n } else {\r\n Validate('w_rg_numero', 'Identidade', '1', '', 2, 30, '1', '1');\r\n Validate('w_rg_emissao', 'Data de emissão', 'DATA', '', 10, 10, '', '0123456789/');\r\n Validate('w_rg_emissor', 'Órgão expedidor', '1', '', 2, 30, '1', '1');\r\n ShowHTML(' if ((theForm.w_rg_numero.value+theForm.w_rg_emissao.value+theForm.w_rg_emissor.value)!=\"\" && (theForm.w_rg_numero.value==\"\" || theForm.w_rg_emissor.value==\"\")) {');\r\n ShowHTML(' alert(\"Os campos identidade, data de emissão e órgão emissor devem ser informados em conjunto!\\\\nDos três, apenas a data de emissão é opcional.\");');\r\n ShowHTML(' theForm.w_rg_numero.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n }\r\n if ($w_tipo_pessoa == 1) {\r\n Validate('w_passaporte', 'Passaporte', '1', '', 1, 20, '1', '1');\r\n Validate('w_sq_pais_passaporte', 'País emissor', 'SELECT', '', 1, 10, '1', '1');\r\n ShowHTML(' if ((theForm.w_passaporte.value+theForm.w_sq_pais_passaporte[theForm.w_sq_pais_passaporte.selectedIndex].value)!=\"\" && (theForm.w_passaporte.value==\"\" || theForm.w_sq_pais_passaporte.selectedIndex==0)) {');\r\n ShowHTML(' alert(\"Os campos passaporte e país emissor devem ser informados em conjunto!\");');\r\n ShowHTML(' theForm.w_passaporte.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n } else {\r\n Validate('w_passaporte', 'Passaporte', '1', '1', 1, 20, '1', '1');\r\n Validate('w_sq_pais_passaporte', 'País emissor', 'SELECT', '1', 1, 10, '1', '1');\r\n }\r\n if ($w_tipo_pessoa == 1) {\r\n Validate('w_ddd', 'DDD', '1', '1', 2, 4, '', '0123456789');\r\n Validate('w_nr_telefone', 'Telefone', '1', 1, 7, 25, '1', '1');\r\n Validate('w_nr_fax', 'Fax', '1', '', 7, 25, '1', '1');\r\n Validate('w_nr_celular', 'Celular', '1', '', 7, 25, '1', '1');\r\n } else {\r\n Validate('w_ddd', 'DDD', '1', '', 2, 4, '', '0123456789');\r\n Validate('w_nr_telefone', 'Telefone', '1', '', 7, 25, '1', '1');\r\n Validate('w_nr_fax', 'Fax', '1', '', 7, 25, '1', '1');\r\n Validate('w_nr_celular', 'Celular', '1', '', 7, 25, '1', '1');\r\n ShowHTML(' if ((theForm.w_nr_telefone.value+theForm.w_nr_fax.value+theForm.w_nr_celular.value)!=\"\" && theForm.w_ddd.value==\"\") {');\r\n ShowHTML(' alert(\"O campo DDD é obrigatório quando informar telefone, fax ou celular!\");');\r\n ShowHTML(' theForm.w_ddd.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n ShowHTML(' if (theForm.w_ddd.value!=\"\" && theForm.w_nr_telefone.value==\"\") {');\r\n ShowHTML(' alert(\"Se informar o DDD, então informe obrigatoriamente o telefone!\\\\nFax e celular são opcionais.\");');\r\n ShowHTML(' theForm.w_nr_telefone.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n }\r\n Validate('w_logradouro', 'Endereço', '1', '', 4, 60, '1', '1');\r\n Validate('w_complemento', 'Complemento', '1', '', 2, 20, '1', '1');\r\n Validate('w_bairro', 'Bairro', '1', '', 2, 30, '1', '1');\r\n Validate('w_sq_pais', 'País', 'SELECT', '1', 1, 10, '1', '1');\r\n Validate('w_co_uf', 'UF', 'SELECT', '1', 1, 10, '1', '1');\r\n Validate('w_sq_cidade', 'Cidade', 'SELECT', '1', 1, 10, '', '1');\r\n if (Nvl($w_pd_pais, 'S') == 'S') {\r\n Validate('w_cep', 'CEP', '1', '', 9, 9, '', '0123456789-');\r\n } else {\r\n Validate('w_cep', 'CEP', '1', '', 5, 9, '', '0123456789');\r\n }\r\n ShowHTML(' if (theForm.w_ddd.value!=\"\" && (theForm.w_sq_pais.value==\"\" || theForm.w_co_uf.value==\"\" || theForm.w_sq_cidade.value==\"\")) {');\r\n ShowHTML(' alert(\"Se informar telefone, fax ou celular, então informe o país, estado e cidade!\");');\r\n ShowHTML(' theForm.w_sq_pais.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n ShowHTML(' if ((theForm.w_complemento.value+theForm.w_bairro.value+theForm.w_cep.value)!=\"\" && theForm.w_logradouro.value==\"\") {');\r\n ShowHTML(' alert(\"O campo logradouro é obrigatório quando informar os campos complemento, bairro ou CEP!\");');\r\n ShowHTML(' theForm.w_logradouro.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n ShowHTML(' if (theForm.w_logradouro.value!=\"\" && theForm.w_cep.value==\"\") {');\r\n ShowHTML(' alert(\"O campo CEP é obrigatório quando informar o endereço da pessoa!\");');\r\n ShowHTML(' theForm.w_cep.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n Validate('w_email', 'E-Mail', '1', '1', 4, 60, '1', '1');\r\n ShowHTML(' if ((theForm.w_ddd.value+theForm.w_logradouro.value+theForm.w_email.value)!=\"\" && (theForm.w_sq_pais.value==\"\" || theForm.w_co_uf.value==\"\" || theForm.w_sq_cidade.value==\"\")) {');\r\n ShowHTML(' alert(\"Se informar algum telefone, o endereço ou o e-mail da pessoa, então informe o país, estado e cidade!\");');\r\n ShowHTML(' theForm.w_sq_pais.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n if ($w_dados_pagamento) {\r\n Validate('w_sq_forma_pag', 'Forma de recebimento', 'SELECT', 1, 1, 18, '', '0123456789');\r\n if (strpos('CREDITO,DEPOSITO', $w_forma_pagamento) !== false) {\r\n Validate('w_sq_banco', 'Banco', 'SELECT', 1, 1, 10, '1', '1');\r\n Validate('w_sq_agencia', 'Agencia', 'SELECT', 1, 1, 10, '1', '1');\r\n if ($w_exige_operacao == 'S')\r\n Validate('w_operacao', 'Operação', '1', '1', 1, 6, '', '0123456789');\r\n Validate('w_nr_conta', 'Número da conta', '1', '1', 2, 30, 'ZXAzxa', '0123456789-');\r\n } elseif ($w_forma_pagamento == 'ORDEM') {\r\n Validate('w_sq_banco', 'Banco', 'SELECT', 1, 1, 10, '1', '1');\r\n Validate('w_sq_agencia', 'Agencia', 'SELECT', 1, 1, 10, '1', '1');\r\n } elseif ($w_forma_pagamento == 'EXTERIOR') {\r\n Validate('w_banco_estrang', 'Banco de destino', '1', '1', 1, 60, 1, 1);\r\n Validate('w_aba_code', 'Código ABA', '1', '', 1, 12, 1, 1);\r\n Validate('w_swift_code', 'Código SWIFT', '1', '1', 1, 30, 1, 1);\r\n Validate('w_endereco_estrang', 'Endereço da agência destino', '1', '', 3, 100, 1, 1);\r\n ShowHTML(' if (theForm.w_aba_code.value == \"\" && theForm.w_swift_code.value == \"\" && theForm.w_endereco_estrang.value == \"\") {');\r\n ShowHTML(' alert(\"Informe código ABA, código SWIFT ou endereço da agência!\");');\r\n ShowHTML(' document.Form.w_aba_code.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n Validate('w_agencia_estrang', 'Nome da agência destino', '1', '1', 1, 60, 1, 1);\r\n Validate('w_nr_conta', 'Número da conta', '1', 1, 1, 30, 1, 1);\r\n Validate('w_cidade_estrang', 'Cidade da agência', '1', '1', 1, 60, 1, 1);\r\n Validate('w_sq_pais_estrang', 'País da agência', 'SELECT', '1', 1, 18, 1, 1);\r\n Validate('w_informacoes', 'Informações adicionais', '1', '', 5, 200, 1, 1);\r\n }\r\n }\r\n if ($w_cadgeral == 'S') {\r\n ShowHTML(' theForm.Botao[0].disabled=true;');\r\n ShowHTML(' theForm.Botao[1].disabled=true;');\r\n } else {\r\n ShowHTML(' theForm.Botao.disabled=true;');\r\n }\r\n }\r\n ValidateClose();\r\n ScriptClose();\r\n ShowHTML('</head>');\r\n ShowHTML('<base HREF=\"' . $conRootSIW . '\">');\r\n if (($w_sq_pessoa == '' && $w_cpf == '' && $w_cnpj == '' && $w_passaporte == '') || strpos($_REQUEST['Botao'], 'Alterar') !== false || strpos($_REQUEST['Botao'], 'Procurar') !== false) {\r\n // Se o beneficiário ainda não foi selecionado\r\n if (strpos($_REQUEST['Botao'], 'Procurar') !== false) {\r\n // Se está sendo feita busca por nome\r\n BodyOpenClean('onLoad=\"this.focus();\"');\r\n } else {\r\n BodyOpenClean('onLoad=\"this.focus();\"');\r\n }\r\n } elseif ($w_troca > '') {\r\n BodyOpenClean('onLoad=\"document.Form.' . $w_troca . '.focus();\"');\r\n } else {\r\n BodyOpenClean('onLoad=\"document.Form.w_nome.focus();\"');\r\n }\r\n Estrutura_Topo_Limpo();\r\n Estrutura_Menu();\r\n Estrutura_Corpo_Abre();\r\n Estrutura_Texto_Abre();\r\n ShowHTML('<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">');\r\n if (strpos('IA', $O) !== false) {\r\n if (($w_sq_pessoa == '' && $w_cpf == '' && $w_cnpj == '' && $w_passaporte == '') || strpos($_REQUEST['Botao'], 'Alterar') !== false || strpos($_REQUEST['Botao'], 'Procurar') !== false) {\r\n $w_nome = $_REQUEST['w_nome'];\r\n if (strpos($_REQUEST['Botao'], 'Alterar') !== false) {\r\n $w_cpf = '';\r\n $w_cnpj = '';\r\n $w_nome = '';\r\n }\r\n ShowHTML('<tr bgcolor=\"' . $conTrBgColor . '\"><td>');\r\n ShowHTML(' <table border=\"0\">');\r\n ShowHTML(' <tr>');\r\n //SelecaoPessoaOrigem('<u>B</u>eneficiário:', 'P', 'Clique na lupa para selecionar o beneficiário.', nvl($w_sq_prop, $_SESSION['SQ_PESSOA']), null, 'w_sq_prop', 'NF,EF', null, 'onFocus=\"alert(document.Form.w_sq_prop.value);\"', 1, 'w_email');\r\n AbreForm('Form', $w_dir.$w_pagina.$par, 'POST', 'return(Validacao(this));', null, $P1, $P2, $P3, $P4, $TP, $SG, $R, $O);\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_sq_pessoa\" value=\"\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave\" value=\"'.$w_chave.'\">');\r\n //SelecaoPessoaOrigem('<u>B</u>eneficiário:', 'P', 'Clique na lupa para selecionar o beneficiário.', nvl($w_sq_pessoa, $_SESSION['SQ_PESSOA']), null, 'w_sq_prop', 'NF,EF', null, 'onFocus=\"javascript:location.href=\\'' . $w_dir . $w_pagina . $par . '&R=' . $R . '&w_sq_pessoa=\\'+document.Form.w_sq_prop.value+\\'' . '&w_chave=' . $w_chave . '&P1=' . $P1 . '&P2=' . $P2 . '&P3=' . $P3 . '&P4=' . $P4 . '&TP=' . $TP . '&SG=' . $SG . '&Botao=Selecionar\\'\";\"', 1, 'w_sq_prop');\r\n SelecaoPessoaOrigem('<u>B</u>eneficiário:', 'P', 'Clique na lupa para selecionar o beneficiário.', nvl($w_sq_pessoa, $_SESSION['SQ_PESSOA']), null, 'w_sq_prop', 'NF,EF', null, null, 1, 'w_sq_prop');\r\n ShowHTML(' <INPUT class=\"stb\" TYPE=\"submit\" NAME=\"Botao\" VALUE=\"Selecionar\" onClick=\"Botao.value=this.value; document.Form.action=\\'' .$w_dir.$w_pagina.$par.'\\'\">');\r\n //SelecaoPessoaOrigem('<u>B</u>eneficiário:', 'P', 'Clique na lupa para selecionar o beneficiário.', nvl($w_sq_prop, $_SESSION['SQ_PESSOA']), null, 'w_sq_prop', 'NF,EF', null, 'onFocus=\"alert(\\\"' . $w_dir . $w_pagina . $par . '&R=' . $R . '&O=A&w_cpf=' . f($row, 'cpf') . '&w_sq_pessoa=' . f($row, 'sq_pessoa') . '&w_chave=' . $w_chave . '&P1=' . $P1 . '&P2=' . $P2 . '&P3=' . $P3 . '&P4=' . $P4 . '&TP=' . $TP . '&SG=' . $SG . '&Botao=Selecionar\")\"', 1, 'w_email');\r\n /* ShowHTML(' <tr><td colspan=4>Informe os dados abaixo e clique no botão \"Selecionar\" para continuar.</TD>');\r\n ShowHTML(' <tr><td colspan=4><b><u>C</u>PF:<br><INPUT ACCESSKEY=\"C\" TYPE=\"text\" class=\"sti\" NAME=\"w_cpf\" VALUE=\"' . $w_cpf . '\" SIZE=\"14\" MaxLength=\"14\" onKeyDown=\"FormataCPF(this, event);\">');\r\n ShowHTML(' <INPUT class=\"stb\" TYPE=\"submit\" NAME=\"Botao\" VALUE=\"Selecionar\" onClick=\"Botao.value=this.value; document.Form.action=\\'' . $w_dir . $w_pagina . $par . '\\'\">');\r\n ShowHTML(' <tr><td colspan=4><p>&nbsp</p>');\r\n ShowHTML(' <tr><td colspan=4 heigth=1 bgcolor=\"#000000\">');\r\n ShowHTML(' <tr><td colspan=4>');\r\n ShowHTML(' <b><u>P</u>rocurar pelo nome:</b> (Informe qualquer parte do nome SEM ACENTOS)<br><INPUT ACCESSKEY=\"P\" TYPE=\"text\" class=\"sti\" NAME=\"w_nome\" VALUE=\"' . $w_nome . '\" SIZE=\"20\" MaxLength=\"20\">');\r\n ShowHTML(' <INPUT class=\"stb\" TYPE=\"submit\" NAME=\"Botao\" VALUE=\"Procurar\" onClick=\"Botao.value=this.value; document.Form.action=\\'' . $w_dir . $w_pagina . $par . '\\'\">'); */\r\n ShowHTML(' </table>');\r\n if ($w_nome > '') {\r\n $sql = new db_getBenef; $RS = $sql->getInstanceOf($dbms, $w_cliente, null, null, null, null, $w_nome, 1, null, null, null, null, null, null, null, null, null, null, null);\r\n ShowHTML('<tr><td colspan=3>');\r\n ShowHTML(' <TABLE WIDTH=\"100%\" bgcolor=\"' . $conTableBgColor . '\" BORDER=\"' . $conTableBorder . '\" CELLSPACING=\"' . $conTableCellSpacing . '\" CELLPADDING=\"' . $conTableCellPadding . '\" BorderColorDark=\"' . $conTableBorderColorDark . '\" BorderColorLight=\"' . $conTableBorderColorLight . '\">');\r\n ShowHTML(' <tr bgcolor=\"' . $conTrBgColor . '\" align=\"center\">');\r\n ShowHTML(' <td><b>Nome</td>');\r\n ShowHTML(' <td><b>Nome resumido</td>');\r\n ShowHTML(' <td><b>CPF</td>');\r\n ShowHTML(' <td><b>Operações</td>');\r\n ShowHTML(' </tr>');\r\n if (count($RS) <= 0) {\r\n ShowHTML(' <tr bgcolor=\"' . $conTrBgColor . '\"><td colspan=4 align=\"center\"><b>Não há pessoas que contenham o texto informado.</b></td></tr>');\r\n } else {\r\n foreach ($RS as $row) {\r\n ShowHTML(' <tr bgcolor=\"' . $conTrBgColor . '\" valign=\"top\">');\r\n ShowHTML(' <td>' . f($row, 'nm_pessoa') . '</td>');\r\n ShowHTML(' <td>' . f($row, 'nome_resumido') . '</td>');\r\n ShowHTML(' <td align=\"center\">' . Nvl(f($row, 'cpf'), '---') . '</td>');\r\n ShowHTML(' <td nowrap>');\r\n ShowHTML(' <A class=\"hl\" HREF=\"' . $w_dir . $w_pagina . $par . '&R=' . $R . '&O=A&w_cpf=' . f($row, 'cpf') . '&w_sq_pessoa=' . f($row, 'sq_pessoa') . '&w_chave=' . $w_chave . '&P1=' . $P1 . '&P2=' . $P2 . '&P3=' . $P3 . '&P4=' . $P4 . '&TP=' . $TP . '&SG=' . $SG . '&Botao=Selecionar\">Selecionar</A>&nbsp');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n }\r\n }\r\n ShowHTML(' </center>');\r\n ShowHTML(' </table>');\r\n ShowHTML(' </td>');\r\n ShowHTML('</tr>');\r\n }\r\n } else {\r\n AbreForm('Form', $w_dir.$w_pagina.'Grava', 'POST', 'return(Validacao(this));', null, $P1, $P2, $P3, $P4, $TP, $SG, $w_pagina.$par, $O);\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_troca\" value=\"\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave\" value=\"' . $w_chave . '\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave_aux\" value=\"' . $w_cliente . '\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_sq_pessoa\" value=\"' . $w_sq_pessoa . '\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_tipo_pessoa\" value=\"' . $w_tipo_pessoa . '\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_pessoa_atual\" value=\"' . $w_pessoa_atual . '\">');\r\n ShowHTML('<tr bgcolor=\"' . $conTrBgColor . '\"><td>');\r\n ShowHTML(' <table width=\"97%\" border=\"0\">');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"2\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" bgcolor=\"#D0D0D0\"><b>Identificação</td></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\"><table border=\"0\" width=\"100%\">');\r\n ShowHTML(' <tr valign=\"top\">');\r\n if ($w_tipo_pessoa == 1)\r\n ShowHTML(' <td>CPF:<br><b><font size=2>' . nvl($w_cpf,'<font color=\"#BC3131\">CPF não informado</font>'));\r\n\r\n //ShowHTML(' <INPUT type=\"hidden\" name=\"w_cpf\" value=\"' . $w_cpf . '\">');\r\n\r\n if (nvl($w_cpf, '') != '') {\r\n ShowHTML(' <INPUT type=\"hidden\" name=\"w_cpf\" value=\"' . $w_cpf . '\">');\r\n }\r\n ShowHTML(' <tr valign=\"top\">');\r\n if (strpos('AE', $O) !== false) {\r\n $readonly = ' readonly ';\r\n } else {\r\n $readonly = '';\r\n }\r\n ShowHTML(' <td><b><u>N</u>ome completo:</b><br><input ' . $w_Disabled . $readonly . ' accesskey=\"N\" type=\"text\" name=\"w_nome\" class=\"sti\" SIZE=\"45\" MAXLENGTH=\"60\" VALUE=\"' . $w_nome . '\"></td>');\r\n ShowHTML(' <td><b><u>N</u>ome resumido:</b><br><input ' . $w_Disabled . $readonly . ' accesskey=\"N\" type=\"text\" name=\"w_nome_resumido\" class=\"sti\" SIZE=\"15\" MAXLENGTH=\"21\" VALUE=\"' . $w_nome_resumido . '\"></td>');\r\n SelecaoSexo('Se<u>x</u>o:', 'X', null, $w_sexo, null, 'w_sexo', null, null);\r\n if (Nvl($w_sq_tipo_vinculo, '') == '') {\r\n SelecaoVinculo('Tipo de <u>v</u>ínculo:', 'V', null, $w_sq_tipo_vinculo, null, 'w_sq_tipo_vinculo', 'S', 'Física', null);\r\n } else {\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_sq_tipo_vinculo\" value=\"' . $w_sq_tipo_vinculo . '\">');\r\n }\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td><b><u>I</u>dentidade:</b><br><input ' . $w_Disabled . ' accesskey=\"I\" type=\"text\" name=\"w_rg_numero\" class=\"sti\" SIZE=\"14\" MAXLENGTH=\"80\" VALUE=\"' . $w_rg_numero . '\"></td>');\r\n ShowHTML(' <td><b>Data de <u>e</u>missão:</b><br><input ' . $w_Disabled . ' accesskey=\"E\" type=\"text\" name=\"w_rg_emissao\" class=\"sti\" SIZE=\"10\" MAXLENGTH=\"10\" VALUE=\"' . $w_rg_emissao . '\" onKeyDown=\"FormataData(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,10,event);\"></td>');\r\n ShowHTML(' <td><b>Ór<u>g</u>ão emissor:</b><br><input ' . $w_Disabled . ' accesskey=\"G\" type=\"text\" name=\"w_rg_emissor\" class=\"sti\" SIZE=\"30\" MAXLENGTH=\"30\" VALUE=\"' . $w_rg_emissor . '\"></td>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td><b>Passapo<u>r</u>te:</b><br><input ' . $w_Disabled . ' accesskey=\"R\" type=\"text\" name=\"w_passaporte\" class=\"sti\" SIZE=\"15\" MAXLENGTH=\"15\" VALUE=\"' . $w_passaporte . '\"></td>');\r\n SelecaoPais('<u>P</u>aís emissor do passaporte:', 'P', null, $w_sq_pais_passaporte, null, 'w_sq_pais_passaporte', null, null);\r\n ShowHTML(' </table>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"2\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" bgcolor=\"#D0D0D0\"><b>Telefones</td></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\"><table border=0 width=\"100%\" cellspacing=0>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td><b><u>D</u>DD:</b><br><input ' . $w_Disabled . ' accesskey=\"D\" type=\"text\" name=\"w_ddd\" class=\"sti\" SIZE=\"4\" MAXLENGTH=\"4\" VALUE=\"' . $w_ddd . '\"></td>');\r\n ShowHTML(' <td><b>Te<u>l</u>efone:</b><br><input ' . $w_Disabled . ' accesskey=\"L\" type=\"text\" name=\"w_nr_telefone\" class=\"sti\" SIZE=\"20\" MAXLENGTH=\"40\" VALUE=\"' . $w_nr_telefone . '\"> ' . consultaTelefone($w_cliente) . '</td>');\r\n ShowHTML(' <td title=\"Se a outra parte informar um número de fax, informe-o neste campo.\"><b>Fa<u>x</u>:</b><br><input ' . $w_Disabled . ' accesskey=\"X\" type=\"text\" name=\"w_nr_fax\" class=\"sti\" SIZE=\"20\" MAXLENGTH=\"20\" VALUE=\"' . $w_nr_fax . '\"></td>');\r\n ShowHTML(' <td title=\"Se a outra parte informar um celular institucional, informe-o neste campo.\"><b>C<u>e</u>lular:</b><br><input ' . $w_Disabled . ' accesskey=\"E\" type=\"text\" name=\"w_nr_celular\" class=\"sti\" SIZE=\"20\" MAXLENGTH=\"20\" VALUE=\"' . $w_nr_celular . '\"></td>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td colspan=2><b>En<u>d</u>ereço:</b><br><input ' . $w_Disabled . ' accesskey=\"D\" type=\"text\" name=\"w_logradouro\" class=\"sti\" SIZE=\"50\" MAXLENGTH=\"50\" VALUE=\"' . $w_logradouro . '\"></td>');\r\n ShowHTML(' <td><b>C<u>o</u>mplemento:</b><br><input ' . $w_Disabled . ' accesskey=\"O\" type=\"text\" name=\"w_complemento\" class=\"sti\" SIZE=\"20\" MAXLENGTH=\"20\" VALUE=\"' . $w_complemento . '\"></td>');\r\n ShowHTML(' <td><b><u>B</u>airro:</b><br><input ' . $w_Disabled . ' accesskey=\"B\" type=\"text\" name=\"w_bairro\" class=\"sti\" SIZE=\"30\" MAXLENGTH=\"30\" VALUE=\"' . $w_bairro . '\"></td>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n SelecaoPais('<u>P</u>aís:', 'P', null, $w_sq_pais, null, 'w_sq_pais', null, 'onChange=\"document.Form.action=\\'' . $w_dir . $w_pagina . $par . '\\'; document.Form.w_troca.value=\\'w_co_uf\\'; document.Form.submit();\"');\r\n ShowHTML(' <td>');\r\n SelecaoEstado('E<u>s</u>tado:', 'S', null, $w_co_uf, $w_sq_pais, null, 'w_co_uf', null, 'onChange=\"document.Form.action=\\'' . $w_dir . $w_pagina . $par . '\\'; document.Form.w_troca.value=\\'w_sq_cidade\\'; document.Form.submit();\"');\r\n SelecaoCidade('<u>C</u>idade:', 'C', null, $w_sq_cidade, $w_sq_pais, $w_co_uf, 'w_sq_cidade', null, null);\r\n ShowHTML(' <tr valign=\"top\">');\r\n if (Nvl($w_pd_pais, 'S') == 'S') {\r\n ShowHTML(' <td><b>C<u>E</u>P:</b><br><input ' . $w_Disabled . ' accesskey=\"E\" type=\"text\" name=\"w_cep\" class=\"sti\" SIZE=\"9\" MAXLENGTH=\"9\" VALUE=\"' . $w_cep . '\" onKeyDown=\"FormataCEP(this,event);\"></td>');\r\n } else {\r\n ShowHTML(' <td><b>C<u>E</u>P:</b><br><input ' . $w_Disabled . ' accesskey=\"E\" type=\"text\" name=\"w_cep\" class=\"sti\" SIZE=\"9\" MAXLENGTH=\"9\" VALUE=\"' . $w_cep . '\"></td>');\r\n }\r\n ShowHTML(' <td colspan=3 title=\"Se informar um e-mail institucional, informe-o neste campo.\"><b>e-<u>M</u>ail:</b><br><input ' . $w_Disabled . ' accesskey=\"M\" type=\"text\" name=\"w_email\" class=\"sti\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"' . $w_email . '\"></td>');\r\n ShowHTML(' </table>');\r\n if ($w_dados_pagamento) {\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"2\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" bgcolor=\"#D0D0D0\"><b>Dados para pagamento das diárias</td></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n SelecaoFormaPagamento('<u>F</u>orma de recebimento:', 'F', 'Selecione na lista a forma de recebimento desejada.', $w_sq_forma_pag, f($RS_Menu, 'sigla'), 'w_sq_forma_pag', null, 'onChange=\"document.Form.action=\\'' . $w_dir . $w_pagina . $par . '\\'; document.Form.O.value=\\'' . $O . '\\'; document.Form.w_troca.value=\\'w_sq_forma_pag\\'; document.Form.submit();\"', 2);\r\n if (strpos('CREDITO,DEPOSITO', $w_forma_pagamento) !== false) {\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\"><table border=0 width=\"100%\" cellspacing=0>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n SelecaoBanco('<u>B</u>anco:', 'B', 'Selecione o banco onde deverão ser feitos os pagamentos referentes ao acordo.', $w_sq_banco, null, 'w_sq_banco', null, 'onChange=\"document.Form.action=\\'' . $w_dir . $w_pagina . $par . '\\'; document.Form.w_troca.value=\\'w_sq_agencia\\'; document.Form.submit();\"');\r\n SelecaoAgencia('A<u>g</u>ência:', 'A', 'Selecione a agência onde deverão ser feitos os pagamentos referentes ao acordo.', $w_sq_agencia, Nvl($w_sq_banco, -1), 'w_sq_agencia', null, null);\r\n ShowHTML(' <tr valign=\"top\">');\r\n if ($w_exige_operacao == 'S')\r\n ShowHTML(' <td title=\"Alguns bancos trabalham com o campo \"Operação\", além do número da conta. A Caixa Econômica Federal é um exemplo. Se for o caso,informe a operação neste campo; caso contrário, deixe-o em branco.\"><b>O<u>p</u>eração:</b><br><input ' . $w_Disabled . ' accesskey=\"O\" type=\"text\" name=\"w_operacao\" class=\"sti\" SIZE=\"6\" MAXLENGTH=\"6\" VALUE=\"' . $w_operacao . '\"></td>');\r\n ShowHTML(' <td title=\"Informe o número da conta bancária, colocando o dígito verificador, se existir, separado por um hífen. Exemplo: 11214-3. Se o banco não trabalhar com dígito verificador, informe apenas números. Exemplo: 10845550.\"><b>Número da con<u>t</u>a:</b><br><input ' . $w_Disabled . ' accesskey=\"T\" type=\"text\" name=\"w_nr_conta\" class=\"sti\" SIZE=\"30\" MAXLENGTH=\"30\" VALUE=\"' . $w_nr_conta . '\"></td>');\r\n ShowHTML(' </table>');\r\n } elseif ($w_forma_pagamento == 'ORDEM') {\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\"><table border=0 width=\"100%\" cellspacing=0>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n SelecaoBanco('<u>B</u>anco:', 'B', 'Selecione o banco onde deverão ser feitos os pagamentos referentes ao acordo.', $w_sq_banco, null, 'w_sq_banco', null, 'onChange=\"document.Form.action=\\'' . $w_dir . $w_pagina . $par . '\\'; document.Form.w_troca.value=\\'w_sq_agencia\\'; document.Form.submit();\"');\r\n SelecaoAgencia('A<u>g</u>ência:', 'A', 'Selecione a agência onde deverão ser feitos os pagamentos referentes ao acordo.', $w_sq_agencia, Nvl($w_sq_banco, -1), 'w_sq_agencia', null, null);\r\n } elseif ($w_forma_pagamento == 'EXTERIOR') {\r\n ShowHTML(' <tr><td colspan=\"2\"><b><font color=\"#BC3131\">ATENÇÃO:</b> É obrigatório o preenchimento de um destes campos: Swift Code, ABA Code ou Endereço da Agência.</font></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\" align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\"><table border=0 width=\"100%\" cellspacing=0>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td title=\"Banco onde o crédito deve ser efetuado.\"><b><u>B</u>anco de crédito:</b><br><input ' . $w_Disabled . ' accesskey=\"B\" type=\"text\" name=\"w_banco_estrang\" class=\"sti\" SIZE=\"40\" MAXLENGTH=\"60\" VALUE=\"' . $w_banco_estrang . '\"></td>');\r\n ShowHTML(' <td title=\"Código ABA da agência destino.\"><b>A<u>B</u>A code:</b><br><input ' . $w_Disabled . ' accesskey=\"B\" type=\"text\" name=\"w_aba_code\" class=\"sti\" SIZE=\"12\" MAXLENGTH=\"12\" VALUE=\"' . $w_aba_code . '\"></td>');\r\n ShowHTML(' <td title=\"Código SWIFT da agência destino.\"><b>S<u>W</u>IFT code:</b><br><input ' . $w_Disabled . ' accesskey=\"W\" type=\"text\" name=\"w_swift_code\" class=\"sti\" SIZE=\"30\" MAXLENGTH=\"30\" VALUE=\"' . $w_swift_code . '\"></td>');\r\n ShowHTML(' <tr><td colspan=3 title=\"Endereço da agência.\"><b>E<u>n</u>dereço da agência:</b><br><input ' . $w_Disabled . ' accesskey=\"N\" type=\"text\" name=\"w_endereco_estrang\" class=\"sti\" SIZE=\"80\" MAXLENGTH=\"100\" VALUE=\"' . $w_endereco_estrang . '\"></td>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td colspan=2 title=\"Nome da agência destino.\"><b>Nome da a<u>g</u>ência:</b><br><input ' . $w_Disabled . ' accesskey=\"C\" type=\"text\" name=\"w_agencia_estrang\" class=\"sti\" SIZE=\"40\" MAXLENGTH=\"60\" VALUE=\"' . $w_agencia_estrang . '\"></td>');\r\n ShowHTML(' <td title=\"Número da conta destino.\"><b>Número da con<u>t</u>a:</b><br><input ' . $w_Disabled . ' accesskey=\"C\" type=\"text\" name=\"w_nr_conta\" class=\"sti\" SIZE=\"30\" MAXLENGTH=\"30\" VALUE=\"' . $w_nr_conta . '\"></td>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td colspan=2 title=\"Cidade da agência destino.\"><b><u>C</u>idade:</b><br><input ' . $w_Disabled . ' accesskey=\"C\" type=\"text\" name=\"w_cidade_estrang\" class=\"sti\" SIZE=\"40\" MAXLENGTH=\"60\" VALUE=\"' . $w_cidade_estrang . '\"></td>');\r\n SelecaoPais('<u>P</u>aís:', 'P', 'Selecione o país de destino', $w_sq_pais_estrang, null, 'w_sq_pais_estrang', null, null);\r\n ShowHTML(' </table>');\r\n ShowHTML(' <tr><td colspan=2 title=\"Se necessário, escreva informações adicionais relevantes para o pagamento.\"><b>Info<u>r</u>mações adicionais:</b><br><textarea ' . $w_Disabled . ' accesskey=\"R\" name=\"w_informacoes\" class=\"sti\" ROWS=3 cols=75 >' . $w_informacoes . '</TEXTAREA></td>');\r\n }\r\n }\r\n ShowHTML(' <tr><td align=\"center\" colspan=\"3\" height=\"1\" bgcolor=\"#000000\"></TD></TR>');\r\n ShowHTML(' <tr><td align=\"center\" colspan=\"3\">');\r\n ShowHTML(' <input class=\"stb\" type=\"submit\" name=\"Botao\" value=\"Gravar\" onClick=\"w_troca.value=this.value;\">');\r\n if ($w_cadgeral == 'S') {\r\n ShowHTML(' <input class=\"stb\" type=\"submit\" name=\"Botao\" value=\"Alterar beneficiário\" onClick=\"w_troca.value=this.value; document.Form.action=\\'' . $w_dir . $w_pagina . $par . '\\'; document.Form.submit();\">');\r\n }\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n ShowHTML(' </table>');\r\n ShowHTML(' </TD>');\r\n ShowHTML('</tr>');\r\n }\r\n ShowHTML('</FORM>');\r\n } else {\r\n ScriptOpen('JavaScript');\r\n ShowHTML(' alert(\"Opção não disponível\");');\r\n ShowHTML(' history.back(1);');\r\n ScriptClose();\r\n }\r\n ShowHTML('</table>');\r\n ShowHTML('</center>');\r\n Estrutura_Texto_Fecha();\r\n Estrutura_Fecha();\r\n Estrutura_Fecha();\r\n Estrutura_Fecha();\r\n Rodape();\r\n}", "public static function prolanis(){\n\t\t$query = \"select ps.id as pasien_id, \";\n\t\t$query .= \"count(*) as jumlah, \";\n\t\t$query .= \"ps.nama as nama_pasien, \";\n\t\t$query .= \"count( px.id ) as jumlah_kali_periksa, \";\n\t\t$query .= \"sum( px.sistolik ) / count( px.id ) as rata_tensi, \";\n\t\t$query .= \"px.pemeriksaan_fisik as pf, \";\n\t\t$query .= \"ps.alamat as alamat, \";\n\t\t$query .= \"ps.no_telp as no_hp, \";\n\t\t$query .= \"ps.id as pasien_id, \";\n\t\t$query .= \"TIMESTAMPDIFF(YEAR, ps.tanggal_lahir, \";\n\t\t$query .= \"CURDATE()) as age, \";\n\t\t$query .= \"px.pemeriksaan_penunjang as lab \";\n\t\t$query .= \"from periksas as px \";\n\t\t$query .= \"join asuransis as asu on asu.id = px.asuransi_id \";\n\t\t$query .= \"join pasiens as ps on ps.id = px.pasien_id \";\n\t\t$query .= \"where TIMESTAMPDIFF(YEAR, ps.tanggal_lahir, CURDATE()) > 49 \";\n\t\t$query .= \"and asu.tipe_asuransi_id=5 \";\n\t\t$query .= \"and px.sistolik not like '' \";\n\t\t$query .= \"and px.sistolik is not null \";\n\t\t$query .= \"and px.tenant_id = \" . session()->get('tenant_id') . \" \";\n\t\t$query .= \"group by ps.id \";\n\t\t$query .= \"having sum( px.sistolik ) / count( px.id ) >139 \";\n\n\t\t$datas = DB::select($query);\n\n\t\t$pasien_ht = [];\n\t\tforeach ($datas as $data) {\n\t\t\t$pasien_ht[] = $data->pasien_id;\n\t\t}\n\n\t\t$query = \"select ps.id as pasien_id, \";\n\t\t$query .= \"count(*) as jumlah, \";\n\t\t$query .= \"ps.nama as nama_pasien, \";\n\t\t$query .= \"px.pemeriksaan_fisik as pf, \";\n\t\t$query .= \"ps.alamat as alamat, \";\n\t\t$query .= \"ps.no_telp as no_hp, \";\n\t\t$query .= \"TIMESTAMPDIFF(YEAR, ps.tanggal_lahir, CURDATE()) as age, \";\n\t\t$query .= \"px.pemeriksaan_penunjang as lab \";\n\t\t$query .= \"from periksas as px \";\n\t\t$query .= \"join asuransis as asu on asu.id = px.asuransi_id \";\n\t\t$query .= \"join diagnosas as dg on dg.id = px.diagnosa_id \";\n\t\t$query .= \"join pasiens as ps on ps.id = px.pasien_id \";\n\t\t$query .= \"join transaksi_periksas as trx on trx.periksa_id = px.id \";\n\t\t$query .= \"join jenis_tarifs as jtf on jtf.id = trx.jenis_tarif_id \";\n\t\t$query .= \"where asu.tipe_asuransi_id= 5 \";\n\t\t$query .= \"and TIMESTAMPDIFF(YEAR, ps.tanggal_lahir, CURDATE()) > 49 \";\n\t\t$query .= \"and jtf.jenis_tarif = 'Gula Darah' \";\n\t\t$query .= \"and trx.keterangan_pemeriksaan not like '' \";\n\t\t$query .= \"and trx.keterangan_pemeriksaan is not null \";\n\t\t$query .= \"and px.tenant_id = \" . session()->get('tenant_id') . \" \";\n\t\t$query .= \"group by ps.id \";\n\t\t$query .= \"having sum( cast(trx.keterangan_pemeriksaan as unsigned) ) / count( trx.id ) > 210 \";\n\n\t\t$dms = DB::select($query);\n\t\t$pasien_dm = [];\n\t\tforeach ($dms as $dm) {\n\t\t\t$pasien_dm[] = $dm->pasien_id;\n\t\t}\n\t\t$pasien_ht = array_unique($pasien_ht);\n\t\t$pasien_dm = array_unique($pasien_dm);\n\n\t\treturn [\n\t\t\t'pasien_dm' => $pasien_dm,\n\t\t\t'pasien_ht' => $pasien_ht\n\t\t];\n\t}", "function precoProduto($id = null, $ml = false, $descMax = false, $custo = false) {\n\tif($id){\n\t\t$sql = query(\"select valor_compra, mlpor, descMaxpor from produto where id='$id'\");\n\t\t\n\t\tif(mysqli_num_rows($sql)){\n\t\t\textract(mysqli_fetch_assoc($sql));\n\t\t\t\n\t\t\t$sql = query(\"select * from produto_tributacao where id_produto='$id'\");\n\t\t\tfor($i = $tributacaoValor = 0; $i<mysqli_num_rows($sql); $i++){\n\t\t\t\textract(mysqli_fetch_assoc($sql));\n\t\t\t\tif($tipo_valor==0){\n\t\t\t\t\t$tributacaoValor += $valor;\n\t\t\t\t}elseif($tipo_valor==1){\n\t\t\t\t\t$tributacaoValor += $valor_compra * $valor / 100;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$valor_custo = $tributacaoValor + $valor_compra;\n\t\t\tif ($ml) {\n\t\t\t\treturn round(($mlpor / 100 * $valor_custo), 2);\n\t\t\t}\n\t\t\tif ($descMax) {\n\t\t\t\t$ml = round(($mlpor / 100 * $valor_custo), 2);\n\t\t\t\treturn round($ml - ($descMaxpor / 100 * $ml), 2);\n\t\t\t}\n\t\t\tif($custo){\n\t\t\t\treturn round($valor_custo, 2);\n\t\t\t}\n\t\t}else{\n\t\t\treturn \"\";\n\t\t}\n\t}else{\n\t\treturn \"\";\n\t}\n\t\n}", "function setprecio_remoto($cod){\r\n $con_remoto = new dbmanager;\r\n //usamos el metodo conectar para realizar la conexion\r\n if($con_remoto->conectar_remoto()==true){\r\n $query = \"SELECT * FROM tbl_inventario WHERE cod_producto='$cod'\"; \r\n\t $result = @mysql_query($query);\r\n\t \r\n\t if (!$result){\r\n\t return false;\r\n\t }\r\n\t else{\r\n\t $row = mysql_fetch_assoc($result);\t \r\n\t return $row['precio'];\r\n\t }\r\n }\r\n }", "public function reprova()\n {\n $this -> estadoAtual -> reprova($this);\n }", "function lortuAforoProgresioa() {\n\t$progresioa = array();\n\t$guztira = 0;\n\t\n\tif ($db = openDB()) {\n\t\t$sarrerak = $db -> query(\"SELECT time, num, gehitu FROM sarrerak WHERE deleted = 'FALSE'\");\n\t\t$irteerak = $db -> query(\"SELECT time, num, gehitu FROM irteerak WHERE deleted = 'FALSE'\");\n\t\t\r\n\t\t$sarreraGehio = ($azkenSarrera = $sarrerak -> fetchArray());\n\t\t$irteeraGehio = ($azkenIrteera = $irteerak -> fetchArray());\n\t\t$hasiera = ($azkenSarrera['time'] < $azkenIrteera['time']) ? $azkenSarrera['time'] : $azkenIrteera['time'];\n\t\twhile ($sarreraGehio || $irteeraGehio) {\n\t\t\tif (! $sarreraGehio)\n\t\t\t\t$sarreraTxanda = false;\n\t\t\telse if (! $irteeraGehio)\n\t\t\t\t$sarreraTxanda = true;\n\t\t\telse\n\t\t\t\t$sarreraTxanda = ($azkenSarrera['time'] < $azkenIrteera['time']);\n\t\t\t\n\t\t\tif ($sarreraTxanda) {\n\t\t\t\tif ($azkenSarrera['gehitu'] == 'TRUE')\n\t\t\t\t\t$guztira += $azkenSarrera['num'];\n\t\t\t\telse\n\t\t\t\t\t$guztira -= $azkenSarrera['num'];\n\t\t\t\t$progresioa[] = array($azkenSarrera[time] - $hasiera, $guztira);\n\t\t\t\t$sarreraGehio = ($azkenSarrera = $sarrerak -> fetchArray());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($azkenIrteera['gehitu'] == 'TRUE')\n\t\t\t\t\t$guztira -= $azkenIrteera['num'];\n\t\t\t\telse\n\t\t\t\t\t$guztira += $azkenIrteera['num'];\n\t\t\t\t$progresioa[] = array($azkenIrteera[time] - $hasiera, $guztira);\n\t\t\t\t$irteeraGehio = ($azkenIrteera = $irteerak -> fetchArray());\n\t\t\t}\n\t\t}\n\t\t$db -> close();\n\t}\n\t\n\treturn json_encode(array($hasiera, $progresioa));\n}", "public function puestaCero (){\n $this->setSegundo(0);\n $this->setMinuto(0);\n $this->setHora(0);\n }", "public function getPropriete()\n {\n return $this->propriete;\n }", "function setPuesto($val)\n\t { return $this->puesto=$val;}", "public function lproevaele($conv)\n {\n $tiempos = $this->ConsultaTiempo3($conv);\n $consulta2 = mysqli_query(\n $this->conexion,\n \"SELECT `propuestas`.*,empresas.razon_social,empresas.nit,empresas.num_ver FROM propuestas,empresas,convocatoria WHERE propuestas.id_empresa=empresas.id and propuestas.id_convocatoria=convocatoria.id and propuestas.id_convocatoria='$conv' ORDER by propuestas.estado ASC\"\n );\n $tipodias = \"\";\n if ($tiempos[0] == \"H\") {\n $tipodias = \"Hábiles\";\n } else {\n $tipodias = \"Calendario\";\n }\n ?>\n<div class=\"row\" style=\"box-sizing: border-box;\"><div class=\"col-md-3\"><i class=\"fa fa-file-excel\" title=\"Descargar excel\" onclick=\"window.open('templates/modules/ExcelProyectos.php')\" style=\"cursor:pointer;color:green;margin-right: 30px;font-size:25px;\"></i>\n<i class=\"fas fa-sync-alt\" title=\"Actualizar\" onclick=\"eval_pro_ele($('#eval_pro_ele'))\" style=\"cursor:pointer;color:#0075b0;margin-right: 30px;font-size:25px;\"></i><i class=\"fa fa-circle\" style=\"color:#F7CEC5;margin-right: 30px;\"></i>Sin Asignar</div><div class=\"col-md-3\"><i class=\"fa fa-circle\" style=\"color:#FEFEA3;margin-right: 30px;\"></i>En proceso de evaluación</div><div class=\"col-md-3\"><i class=\"fa fa-circle\" style=\"color:#B6F9AD;margin-right: 30px;\"></i>Evaluados</div><div class=\"col-md-3\"><i class=\"fa fa-circle\" style=\"color:#70CDF9;margin-right: 30px;\"></i>Aprobado para vizualizar</div></div>\n<i class=\"fa fa-search\" style=\"font-size:20px;position:absolute;left:20px;margin-top:10px;\"></i>\n<input type=\"text\" placeholder=\"Buscar...\" class=\"form-control\" onkeyup=\"TableFilter('#tlproevaele',this.value)\" style=\"padding-left:40px;\" ><table class=\"table table-bordered\" id=\"tlproevaele\"><thead style=\"background:#f8f9fa;\"><tr><th>Id</th><th>No. Radicación-SIGP<i class=\"fa fa-question-circle\" style=\"cursor:help;\" onmouseover=\"$('#help1111B').css('display','block')\" onmouseout=\"$('#help1111B').css('display','none')\"></i>\n\t\t\t<span class=\"tooltiptext\" id=\"help1111B\" style=\"display: none;\">Número de radicación en SIGP </span></th><th>Título proyecto</th><th>Empresa</th><th>Fecha recepción <i class=\"fa fa-question-circle\" style=\"cursor:help;\" onmouseover=\"$('#help1112').css('display','block')\" onmouseout=\"$('#help1112').css('display','none')\"></i>\n\t\t\t<span class=\"tooltiptext\" id=\"help1112\" style=\"display: none;\">Fecha de recepción en CPC Oriente </span></th><th>Fecha límite <i class=\"fa fa-question-circle\" style=\"cursor:help;\" onmouseover=\"$('#help1113').css('display','block')\" onmouseout=\"$('#help1113').css('display','none')\"></i>\n\t\t\t<span class=\"tooltiptext\" id=\"help1113\" style=\"display: none;\">Fecha limite para que el evaluador realice la evaluación en elegibilidad</span></th><th>Días calendario restantes <i class=\"fa fa-question-circle\" style=\"cursor:help;\" onmouseover=\"$('#help1114').css('display','block')\" onmouseout=\"$('#help1114').css('display','none')\"></i>\n\t\t\t<span class=\"tooltiptext\" id=\"help1114\" style=\"display: none;\">Días calendario restantes al evaluador para evaluar el proyecto en elegibilidad</span></th><th>Elegible</th><th>Aprobado para visualizar</th><th>Fecha Aprobado<i class=\"fa fa-question-circle\" style=\"cursor:help;\" onmouseover=\"$('#help111_5').css('display','block')\" onmouseout=\"$('#help111_5').css('display','none')\"></i>\n\t\t\t<span class=\"tooltiptext\" id=\"help111_5\" style=\"display: none;\">Fecha de aprobación para ser visualizado</span></th>\n<th>Acciones</th></tr></thead><tbody id=\"bd-list-convos\">\n<?php\n$fila = 1;\n$color = \"\";\n$labelstate = \"\";\n$icon_dia = \"\";\n$icon_dia2 = \"\";\n$icon_dia3 = \"\";\n$icon_dia4 = \"\";\n$ficha = \"\";\n$warCau=\"\";\n$observaciones=\"\";\nwhile ($datos = mysqli_fetch_array($consulta2)) {\n $num_ver=\"-0\";\n $diasadi=\"<i class='fas fa-calendar-plus icon_evalua22' onclick=\\\"AdicionarDiasProyectEle($datos[id],$fila)\\\" title='Días adicionales a proyecto'></i>\";\n \n if($datos['num_ver']!=0 && $datos['num_ver']!=null)\n {\n $num_ver=\"-\".$datos['num_ver'];\n }\n\n if ($datos['estado'] == 1) {\n $color = \"#F7CEC5\";\n $labelstate = \"POR ASIGNAR\";\n $ficha = \"\";\n \n } elseif ($datos['estado'] == 2) {\n $color = \"#FEFEA3\";\n $labelstate = \"EN PROCESO\";\n $ficha = \"\";\n \n } else {\n $color = \"#B6F9AD\";\n $labelstate = \"EVALUADO\";\n $ficha = \"<i class='fas fa-file-alt icon_evalua22' onclick=\\\"window.open('templates/modules/dompdf/index.php?id=$datos[id]&conv=$conv')\\\" title='Ficha evaluación elegibilidad'></i><i class='fas fa-undo icon_evalua22' onclick=\\\"UndoProyectEle($datos[id],$fila)\\\" title='Cambiar estado a en proceso'></i>\";\n \n }\n if ($datos['dia_ele'] == \"ELEGIBLE\") {\n $icon_dia = \"SI\";\n $icon_dia4 = 1;\n } elseif ($datos['dia_ele'] == \"NO ELEGIBLE\") {\n $icon_dia = \"NO\";\n $icon_dia4 = 0;\n } else {\n $icon_dia = \"\";\n $icon_dia4 = \"\";\n }\n if ($datos['apro_ele'] == \"1\") {\n $color = \"#70CDF9\";\n $icon_dia3 = \"SI\";\n $icon_dia2 = \"1\";\n $observaciones = \"<i class='fas fa-comment-dots icon_evalua22' onclick=\\\"ObservacionesEvaluacion($datos[0],$fila)\\\" title='Observaciones a evaluación'></i>\";\n } elseif ($datos['apro_ele'] == \"0\") {\n $icon_dia3 = \"NO\";\n $icon_dia2 = \"0\";\n $observaciones=\"\";\n } else {\n $icon_dia2 = \"\";\n $icon_dia3 = \"\";\n $observaciones=\"\";\n }\n if($datos['causales_rechazo']==\"Cumple\")\n {\n $warCau=\"\";\n }\n else if($datos['causales_rechazo']==\"No cumple\"){\n $warCau=\"<i class='fas fa-exclamation-circle' title='Incurre en causales de rechazo' style='font-size:22px;color:red;cursor:pointer;' onclick=\\\"VerCausalesEle($datos[0],$fila)\\\"></i>\";\n }\n else{\n $warCau=\"\"; \n }\n \n $plazo = \"\";\n\n if ($datos['plazo_adi'] > 0) {\n $plazo = \"(con plazo adicional de $datos[plazo_adi] dias $tipodias)\";\n }\n $dias = $tiempos[2] + $datos['plazo_adi'];\n $vencimiento = $this->Calculardias($tiempos[0], $dias, $datos['fec_rec']);\n echo \"<tr style='background:$color;' ><td>$datos[id]</td><td>$datos[num_rad]</td><td>\" .\n substr(strtoupper($datos['nom']), 0, 72) .\n \"... $warCau <i class='fa fa-search-plus icon_sesion2' onmouseover=\\\"$('#help1551__$fila').css('display','block')\\\" onmouseout=\\\"$('#help1551__$fila').css('display','none')\\\" onclick=\\\"Detailproevaele($datos[id],'$datos[num_rad]','\".$this->FormatDate2($datos['fec_rad']).\"',$fila,'','\".$this->FormatDate2($datos['fec_rec']).\"','\".$this->FormatDate2($vencimiento[1]).\"','$vencimiento[0]','$tiempos[0]','$labelstate','$icon_dia4','$icon_dia2')\\\" ></i><span class='tooltiptext' id='help1551__$fila' style='display: none;'>$datos[nom]</span></td><td >$datos[nit]$num_ver,&nbsp; $datos[razon_social]</td><td >\" .\n $this->FormatDate2($datos['fec_rec']) .\n \"</td><td >\" .\n $this->FormatDate2($vencimiento[1]) .\n \"</td><td >\" .\n $vencimiento[0] .\n \" $plazo</td><td >$icon_dia</td><td >$icon_dia3</td><td>\".$this->FormatDate2($datos['fec_apro_ele']).\"</td><td><i class='fas fa-eye icon_evalua22' title='Detalles' onclick=\\\"Detailproevaele($datos[id],'$datos[num_rad]','\".$this->FormatDate2($datos['fec_rad']).\"',$fila,'','\".$this->FormatDate2($datos['fec_rec']).\"','\".$this->FormatDate2($vencimiento[1]).\"','$vencimiento[0]','$tiempos[0]','$labelstate','$icon_dia4','$icon_dia2')\\\"></i><i class='fa fa-user-slash icon_evalua22' title='Causales de rechazo' onclick=\\\"VerCausalesEle($datos[0],$fila)\\\"></i>$ficha $diasadi $observaciones</td><td style='display:none;'>\".strtoupper($datos['nom']).\"</td></tr>\";\n $fila++;\n}\nif ($fila == 1) {\n echo \"<tr ><td colspan='10'>No hay proyectos en fase de elegibilidad</td></tr>\";\n}?>\n</tbody></table>\n<?php\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->o50_anousu = ($this->o50_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_anousu\"]:$this->o50_anousu);\n $this->o50_coddot = ($this->o50_coddot == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_coddot\"]:$this->o50_coddot);\n $this->o50_subelem = ($this->o50_subelem == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_subelem\"]:$this->o50_subelem);\n $this->o50_programa = ($this->o50_programa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_programa\"]:$this->o50_programa);\n $this->o50_estrutdespesa = ($this->o50_estrutdespesa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_estrutdespesa\"]:$this->o50_estrutdespesa);\n $this->o50_estrutelemento = ($this->o50_estrutelemento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_estrutelemento\"]:$this->o50_estrutelemento);\n $this->o50_estrutreceita = ($this->o50_estrutreceita == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_estrutreceita\"]:$this->o50_estrutreceita);\n $this->o50_tipoproj = ($this->o50_tipoproj == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_tipoproj\"]:$this->o50_tipoproj);\n $this->o50_utilizapacto = ($this->o50_utilizapacto == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_utilizapacto\"]:$this->o50_utilizapacto);\n $this->o50_liberadecimalppa = ($this->o50_liberadecimalppa == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_liberadecimalppa\"]:$this->o50_liberadecimalppa);\n $this->o50_estruturarecurso = ($this->o50_estruturarecurso == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_estruturarecurso\"]:$this->o50_estruturarecurso);\n $this->o50_estruturacp = ($this->o50_estruturacp == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_estruturacp\"]:$this->o50_estruturacp);\n }else{\n $this->o50_anousu = ($this->o50_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"o50_anousu\"]:$this->o50_anousu);\n }\n }", "public function devolverUltimoColectivo();", "public function nro_operaciones_programadas_regional($dep_id,$trimestre,$tp_id){\n //// $tp_id : 1 - Proyectos de Inversion\n //// $tp_id : 4 - Gasto Corriente\n\n if($trimestre==1){\n $vi=1;$vf=3;\n }\n elseif($trimestre==2){\n $vi=4;$vf=6; \n }\n elseif($trimestre==3){\n $vi=7;$vf=9; \n }\n elseif($trimestre==4){\n $vi=10;$vf=12; \n }\n\n if($tp_id==1){\n $sql = 'select p.dep_id,count(*) total\n from _proyectos p\n Inner Join aperturaproyectos as ap On ap.proy_id=p.proy_id\n Inner Join aperturaprogramatica as apg On apg.aper_id=ap.aper_id\n \n Inner Join vista_componentes_dictamen as c On c.proy_id=p.proy_id\n Inner Join _productos as prod On prod.com_id=c.com_id\n Inner Join (\n select prod_id\n from prod_programado_mensual\n where g_id='.$this->gestion.' and (m_id>='.$vi.' and m_id<='.$vf.') and pg_fis!=\\'0\\'\n group by prod_id\n ) as pprog On pprog.prod_id=prod.prod_id\n where p.dep_id='.$dep_id.' and prod.estado!=\\'3\\' and apg.aper_gestion='.$this->gestion.' and apg.aper_estado!=\\'3\\' and p.tp_id=\\'1\\'\n group by p.dep_id';\n }\n else{\n $sql = 'select p.dep_id,count(*) total\n from _proyectos p\n Inner Join aperturaproyectos as ap On ap.proy_id=p.proy_id\n Inner Join aperturaprogramatica as apg On apg.aper_id=ap.aper_id\n Inner Join unidad_actividad as ua On ua.act_id=p.act_id\n Inner Join uni_gestion as ug On ua.act_id=ug.act_id\n \n Inner Join vista_componentes_dictamen as c On c.proy_id=p.proy_id\n Inner Join _productos as prod On prod.com_id=c.com_id\n Inner Join (\n select prod_id\n from prod_programado_mensual\n where g_id='.$this->gestion.' and (m_id>='.$vi.' and m_id<='.$vf.') and pg_fis!=\\'0\\'\n group by prod_id\n ) as pprog On pprog.prod_id=prod.prod_id\n where p.dep_id='.$dep_id.' and prod.estado!=\\'3\\' and apg.aper_gestion='.$this->gestion.' and apg.aper_estado!=\\'3\\' and p.tp_id=\\'4\\' and ua.act_estado!=\\'3\\' and ug.g_id='.$this->gestion.'\n group by p.dep_id';\n }\n\n $query = $this->db->query($sql);\n return $query->result_array();\n }", "function conf__pant_car(toba_ei_pantalla $pantalla)\r\n {\r\n $this->s__mostrar_ant=0;\r\n $this->s__mostrar_sig=0;\r\n $this->s__pantalla='pant_car';\r\n }", "function loadProvinciasIds()\n {\n $municipios = $this->manager->getRepository('sisconeeAppBundle:Municipio')->findAll();\n foreach ($municipios as $m) {\n $mCode = $m->getCodigo();\n\n $pCode = ($mCode == 4001) ? 400 : $mCode[0] . $mCode[1]; //400-Isla de la Juventud\n $provincia = $this->manager->getRepository('sisconeeAppBundle:Provincia')->findOneByCodigo($pCode);\n $m->setProvincia($provincia);\n $this->manager->persist($m);\n }\n $this->manager->flush();\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->pc56_sequencial = ($this->pc56_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc56_sequencial\"]:$this->pc56_sequencial);\n $this->pc56_orcamforne = ($this->pc56_orcamforne == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc56_orcamforne\"]:$this->pc56_orcamforne);\n $this->pc56_orcamitem = ($this->pc56_orcamitem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc56_orcamitem\"]:$this->pc56_orcamitem);\n $this->pc56_valorunitario = ($this->pc56_valorunitario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc56_valorunitario\"]:$this->pc56_valorunitario);\n $this->pc56_ativo = ($this->pc56_ativo == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc56_ativo\"]:$this->pc56_ativo);\n $this->pc56_pcorcamval = ($this->pc56_pcorcamval == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc56_pcorcamval\"]:$this->pc56_pcorcamval);\n $this->pc56_solicitem = ($this->pc56_solicitem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc56_solicitem\"]:$this->pc56_solicitem);\n }else{\n $this->pc56_sequencial = ($this->pc56_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc56_sequencial\"]:$this->pc56_sequencial);\n }\n }", "function getMuertesPromedio(){\n\t\t\treturn $this->db->select(\"sum(insidencias)/730 AS mPromedio\", FALSE)\n\t\t\t\t\t\t->from('mortalidad')\n\t\t\t\t\t\t->get();\n\t}", "public function notificacionColombiaP1($pro, $nom)\n {\n mysqli_query(\n $this->conexion,\n \"INSERT INTO `notificaciones` ( `pro`, `usu`, `tipo`, `notificacion`, `visto`, `sonido`) VALUES ( '$pro', '0', 'EVALUACION FINALIZADA CP', 'LA <b>EVALUACION DE ELEGIBILIDAD</b> DEL PROYECTO <b>ID</b> :$pro, <b>NOMBRE</b>: $nom, HA SIDO FINALIZADA', '0', '0')\"\n );\n mysqli_query(\n $this->conexion,\n \"INSERT INTO `notificaciones` ( `pro`, `usu`, `tipo`, `notificacion`, `visto`, `sonido`) VALUES ( '$pro', '0', 'EVALUACION FINALIZADA S', 'LA <b>EVALUACION DE ELEGIBILIDAD</b> DEL PROYECTO <b>ID</b> :$pro, <b>NOMBRE</b>: $nom, HA SIDO FINALIZADA', '0', '0')\"\n );\n }", "function pausarInactivos($stb){\n\t// En pr.php se regularizan los pausados. Si están en el rango y están pausados, quedan como están\n\t// Si no están en rango se despausan para que se puedena leer la siguinete vez que estén en el rango.\n\t$q=\"UPDATE programming SET pausado = '1' WHERE screen = '$stb'\";\n\treturn db_query($q);\n}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->k47_sequencial = ($this->k47_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k47_sequencial\"]:$this->k47_sequencial);\n $this->k47_descr = ($this->k47_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k47_descr\"]:$this->k47_descr);\n $this->k47_obs = ($this->k47_obs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k47_obs\"]:$this->k47_obs);\n $this->k47_altura = ($this->k47_altura == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k47_altura\"]:$this->k47_altura);\n $this->k47_largura = ($this->k47_largura == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k47_largura\"]:$this->k47_largura);\n $this->k47_orientacao = ($this->k47_orientacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k47_orientacao\"]:$this->k47_orientacao);\n $this->k47_tipoconvenio = ($this->k47_tipoconvenio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k47_tipoconvenio\"]:$this->k47_tipoconvenio);\n }else{\n $this->k47_sequencial = ($this->k47_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k47_sequencial\"]:$this->k47_sequencial);\n }\n }", "function verificarPresup(){\n\t\t$this->procedimiento='pre.f_verificacion_presup_sel';\n\t\t$this->transaccion='PRE_VERPRE_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t$this->setCount(false);\n\t\t$this->setTipoRetorno('record');\t\n\t\t\t\n\t\t$this->setParametro('tabla','tabla','varchar');\t\t\n\t\t$this->setParametro('id','id','int4');\n\t\t\n\t\t$this->captura('id_ver','bigint');\n\t\t$this->captura('control_partida','VARCHAR');\n\t\t$this->captura('id_par','int4');\n\t\t$this->captura('id_agrupador','INTEGER');\n\t\t$this->captura('monto_mo','NUMERIC');\t\t\n\t\t$this->captura('movimiento','VARCHAR');\n\t\t$this->captura('id_presupuesto','INTEGER');\n\t\t$this->captura('tipo_cambio','NUMERIC');\n\t\t$this->captura('monto_mb','NUMERIC');\n\t\t$this->captura('verificacion','VARCHAR');\n\t\t$this->captura('saldo','NUMERIC');\t\t\n\t\t$this->captura('codigo_partida','VARCHAR');\n\t\t$this->captura('nombre_partida','VARCHAR');\n\t\t$this->captura('desc_tipo_presupuesto','VARCHAR');\n\t\t$this->captura('descripcion','VARCHAR');\t\t\n\t\t$this->captura('desc_cp','VARCHAR');\n\t\t$this->captura('codigo_categoria','VARCHAR');\n\t\t$this->captura('codigo_tcc','VARCHAR');\n\t\t$this->captura('desc_tcc','VARCHAR');\n\t\t\n\t\t$this->captura('pre_verificar_categoria','VARCHAR');\n\t\t$this->captura('pre_verificar_tipo_cc','VARCHAR');\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t//echo $this->consulta;exit;\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function getTotalProposicoes(){\n return $this->proposicoes;\n }", "public function getproduccion()\r\n {\r\n return $this->produccion;\r\n }", "public function verPromociones(){\n $sql = \"SELECT P.ID_prod , P.img , P.nom_prod , P.val_prod , \n P.stok_prod , P.estado_prod , C.nom_categoria , M.nom_medida\n from producto P \n join categoria C on C.ID_categoria = P.CF_categoria\n join tipo_medida M on P.CF_tipo_medida = M.ID_medida \n where estado_prod = 'Promoción'\n order by P.nom_prod asc \";\n $stm = $this->db->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n return $result;\n }", "private function recupera_prodotto_variabile( $prodotto ) {\n\t\t\tglobal $wpdb;\n\t\t\t$CodArtIA = $prodotto[\"CodArtIA\"];\n\t\t\n\t\t\t$sql = \"SELECT * FROM \".$this->_tbl_conversione.\" WHERE CodArtIA = $CodArtIA\";\n\t\t\t$prodotti = $wpdb->get_results( $sql, ARRAY_A );\n\t\t\n\t\t\tforeach ( $prodotti as $prodotto ) {\n\n\t\t\t\tif ( $prodotto[\"NomArtVar\"] != \"\" ) {\n\t\t\t\n\t\t\t\t\t$tmp['CodArt'] = 'IA0000' . $prodotto['CodArtIA'];\n\t\t\t\t\t$tmp['NomArt'] = $prodotto[\"NomArtVar\"];\n\t\t\t\t\t$tmp['NomArtExt'] = $prodotto[\"NomArtExt\"];\n\t\t\t\t\t$tmp['Cat'] = $prodotto[\"Cat\"];\n\t\t\t\t\t$tmp['SttCat'] = $prodotto[\"SttCat\"];\n\t\t\t\t\t$tmp['Tgl'] = $prodotto[\"Tgl\"];\n\t\t\t\t\t$tmp['Col'] = $prodotto[\"Col\"];\n\t\t\t\t\t$tmp['DttArt'] = $prodotto[\"DttArt\"];\n\t\t\t\t\t$tmp['Mat'] = $prodotto[\"Mat\"];\n\t\t\t\t\t$tmp['Mrc'] = $prodotto[\"Mrc\"];\n\t\t\t\t\t$tmp['PrzIng'] = $prodotto[\"PrzIng\"];\n\t\t\t\t\t$tmp['Sct'] = $prodotto[\"Sct\"];\n\t\t\t\t\t$tmp['PrzCns'] = $prodotto[\"PrzCns\"];\n\t\t\t\t\t$tmp['PrzCnsSct'] = $prodotto[\"PrzCnsSct\"];\n\t\t\t\t\t$tmp['FotoMin'] = $prodotto[\"FotoMin\"];\n\t\t\t\t\t$tmp['FotoMed'] = $prodotto[\"FotoMed\"];\n\t\t\t\t\t$tmp['FotoMax'] = $prodotto[\"FotoMax\"];\n\t\t\t\t\t$tmp['Attributo'] = $prodotto[\"Attributo\"];\n\t\t\t\t\t$tmp['Variazioni'][] = array(\n\t\t\t\t\t\t'ArtDsp' \t\t\t=> $prodotto['ArtDsp'],\n\t\t\t\t\t\t'Sku'\t\t\t\t=> $prodotto['CodArt'],\n\t\t\t\t\t\t'Nome'\t\t\t\t=> $prodotto['Variazione'],\n\t\t\t\t\t\t'Prezzo'\t\t\t=> $prodotto['PrzCns'],\n\t\t\t\t\t\t'PrezzoScontato'\t=> $prodotto['PrzCnsSct'],\n\t\t\t\t\t\t'FotoMax'\t\t\t=> $prodotto['FotoMax']\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$tmp['Variazioni'][] = array(\n\t\t\t\t\t\t'ArtDsp' \t\t\t=> $prodotto['ArtDsp'],\n\t\t\t\t\t\t'Sku'\t\t\t\t=> $prodotto['CodArt'],\n\t\t\t\t\t\t'Nome'\t\t\t\t=> $prodotto['Variazione'],\n\t\t\t\t\t\t'Prezzo'\t\t\t=> $prodotto['PrzCns'],\n\t\t\t\t\t\t'PrezzoScontato'\t=> $prodotto['PrzCnsSct'],\n\t\t\t\t\t\t'FotoMax'\t\t\t=> $prodotto['FotoMax']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\treturn $tmp;\n\t\t\n\t\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->cm13_i_codigo = ($this->cm13_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_i_codigo\"]:$this->cm13_i_codigo);\n $this->cm13_i_jazigo = ($this->cm13_i_jazigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_i_jazigo\"]:$this->cm13_i_jazigo);\n $this->cm13_i_sepultamento = ($this->cm13_i_sepultamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_i_sepultamento\"]:$this->cm13_i_sepultamento);\n $this->cm13_i_gaveta = ($this->cm13_i_gaveta == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_i_gaveta\"]:$this->cm13_i_gaveta);\n $this->cm13_i_medico = ($this->cm13_i_medico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_i_medico\"]:$this->cm13_i_medico);\n if($this->cm13_d_exumprevista == \"\"){\n $this->cm13_d_exumprevista_dia = ($this->cm13_d_exumprevista_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_d_exumprevista_dia\"]:$this->cm13_d_exumprevista_dia);\n $this->cm13_d_exumprevista_mes = ($this->cm13_d_exumprevista_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_d_exumprevista_mes\"]:$this->cm13_d_exumprevista_mes);\n $this->cm13_d_exumprevista_ano = ($this->cm13_d_exumprevista_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_d_exumprevista_ano\"]:$this->cm13_d_exumprevista_ano);\n if($this->cm13_d_exumprevista_dia != \"\"){\n $this->cm13_d_exumprevista = $this->cm13_d_exumprevista_ano.\"-\".$this->cm13_d_exumprevista_mes.\"-\".$this->cm13_d_exumprevista_dia;\n }\n }\n if($this->cm13_d_exumfeita == \"\"){\n $this->cm13_d_exumfeita_dia = ($this->cm13_d_exumfeita_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_d_exumfeita_dia\"]:$this->cm13_d_exumfeita_dia);\n $this->cm13_d_exumfeita_mes = ($this->cm13_d_exumfeita_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_d_exumfeita_mes\"]:$this->cm13_d_exumfeita_mes);\n $this->cm13_d_exumfeita_ano = ($this->cm13_d_exumfeita_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_d_exumfeita_ano\"]:$this->cm13_d_exumfeita_ano);\n if($this->cm13_d_exumfeita_dia != \"\"){\n $this->cm13_d_exumfeita = $this->cm13_d_exumfeita_ano.\"-\".$this->cm13_d_exumfeita_mes.\"-\".$this->cm13_d_exumfeita_dia;\n }\n }\n $this->cm13_c_ossario = ($this->cm13_c_ossario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_c_ossario\"]:$this->cm13_c_ossario);\n $this->cm13_c_campa = ($this->cm13_c_campa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_c_campa\"]:$this->cm13_c_campa);\n }else{\n $this->cm13_i_codigo = ($this->cm13_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm13_i_codigo\"]:$this->cm13_i_codigo);\n }\n }", "function DameIdProximoPrepMltar()\r\n {\r\n return $this->modelpremltar->buscaridproximo();\r\n\r\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->cm02_i_codigo = ($this->cm02_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_i_codigo\"]:$this->cm02_i_codigo);\n $this->cm02_i_processo = ($this->cm02_i_processo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_i_processo\"]:$this->cm02_i_processo);\n $this->cm02_i_proprietario = ($this->cm02_i_proprietario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_i_proprietario\"]:$this->cm02_i_proprietario);\n $this->cm02_c_quadra = ($this->cm02_c_quadra == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_c_quadra\"]:$this->cm02_c_quadra);\n $this->cm02_i_lote = ($this->cm02_i_lote == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_i_lote\"]:$this->cm02_i_lote);\n $this->cm02_f_metragem1 = ($this->cm02_f_metragem1 == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_f_metragem1\"]:$this->cm02_f_metragem1);\n $this->cm02_f_metragem2 = ($this->cm02_f_metragem2 == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_f_metragem2\"]:$this->cm02_f_metragem2);\n if($this->cm02_d_aquisicao == \"\"){\n $this->cm02_d_aquisicao_dia = ($this->cm02_d_aquisicao_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_d_aquisicao_dia\"]:$this->cm02_d_aquisicao_dia);\n $this->cm02_d_aquisicao_mes = ($this->cm02_d_aquisicao_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_d_aquisicao_mes\"]:$this->cm02_d_aquisicao_mes);\n $this->cm02_d_aquisicao_ano = ($this->cm02_d_aquisicao_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_d_aquisicao_ano\"]:$this->cm02_d_aquisicao_ano);\n if($this->cm02_d_aquisicao_dia != \"\"){\n $this->cm02_d_aquisicao = $this->cm02_d_aquisicao_ano.\"-\".$this->cm02_d_aquisicao_mes.\"-\".$this->cm02_d_aquisicao_dia;\n }\n }\n if($this->cm02_d_entrada == \"\"){\n $this->cm02_d_entrada_dia = ($this->cm02_d_entrada_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_d_entrada_dia\"]:$this->cm02_d_entrada_dia);\n $this->cm02_d_entrada_mes = ($this->cm02_d_entrada_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_d_entrada_mes\"]:$this->cm02_d_entrada_mes);\n $this->cm02_d_entrada_ano = ($this->cm02_d_entrada_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_d_entrada_ano\"]:$this->cm02_d_entrada_ano);\n if($this->cm02_d_entrada_dia != \"\"){\n $this->cm02_d_entrada = $this->cm02_d_entrada_ano.\"-\".$this->cm02_d_entrada_mes.\"-\".$this->cm02_d_entrada_dia;\n }\n }\n }else{\n $this->cm02_i_codigo = ($this->cm02_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm02_i_codigo\"]:$this->cm02_i_codigo);\n }\n }", "function lortuProgresioa($taula) {\n\t$progresioa = array();\n\t$guztira = 0;\n\t\n\tif ($db = openDB()) {\n\t\t$result = $db -> query(\"SELECT time, num, gehitu FROM \" . $taula . \" WHERE deleted = 'FALSE'\");\n\t\twhile ($row = $result -> fetchArray()) {\n\t\t\tif (! isset($hasiera))\n\t\t\t\t$hasiera = $row['time'];\n\t\t\tif ($row['gehitu'] == 'TRUE')\n\t\t\t\t$guztira += $row['num'];\n\t\t\telse\n\t\t\t\t$guztira -= $row['num'];\n\t\t\t$progresioa[] = array($row['time'] - $hasiera, $guztira);\n\t\t}\n\t\t$db -> close();\n\t}\n\t\n\treturn json_encode(array($hasiera, $progresioa));\n}", "function afficherListeParas() {\r\n \t //requete sql\r\n\t if ($this->numpage) {// Liste des paragraphes li&eacute;s &agrave; la page \r\n\t \tif (isset($this->colonne)) $fin_req=\"AND colonne='$this->colonne'\"\t;\r\n\t \t$result=mysql_query(\"SELECT numpara FROM if_page_para WHERE numpage='$this->numpage' $fin_req ORDER BY ordre\");\r\n\t\t//echo \"SELECT numpara FROM if_page_para WHERE numpage='$this->numpage' $fin_req ORDER BY ordre<br/>\";\r\n\t\twhile ($row=mysql_fetch_row($result)) {\r\n\t\t \t$unPara=new Paragraphe();\r\n\t\t\t$unPara->numpara=$row[0];\r\n\t\t\t$unPara->numpage=$this->numpage;\r\n\t\t\t$unPara->infosPara(); \r\n\t\t\t$this->paras[]=$unPara;\r\n\t\t }\t//fin du while\r\n\t } else if ($this->formation) {\t// Liste des formations IFIP\r\n\t \t $result=mysql_query(\"SELECT numpara FROM if_v_form $this->tri_date\");\r\n\t\t while ($row=mysql_fetch_row($result)) {\r\n\t\t \t$unPara=new Formation();\r\n\t\t\t$unPara->numpara=$row[0]; \r\n\t\t\t$unPara->infosFormation(); \r\n\t\t\t$this->paras[]=$unPara;\r\n\t\t }\t//fin du while\r\n\t } else if ($this->doc) {\t// Liste des docs IFIP\r\n\t \t $result=mysql_query(\"SELECT numpara FROM if_v_doc $this->req_doc\");\r\n\t\t while ($row=mysql_fetch_row($result)) {\r\n\t\t \t$unPara=new Documentation();\r\n\t\t\t$unPara->numpara=$row[0]; \r\n\t\t\tif ($this->docvcourte)$unPara->infosDocVersionCourte(); //uniquement numpara + ann&eacute;e de stock&eacute;s (pour all&eacute;ger)\r\n\t\t\telse $unPara->infosDoc(); \r\n\t\t\t$this->paras[]=$unPara;\r\n\t\t\t//mise en commentaire HC sept. 2009 - on refait un tri sur le champ date\r\n\t\t\t//usort($this->paras, 'trierDocs');//tri sur le tableau d'ojets Documentation (sur anneeDoc cr&eacute;&eacute;e dans InfosDoc)\r\n\t\t\t\r\n\t\t }\t//fin du while \r\n\t\t if ($this->docvcourte) {\r\n\t\t \t$this->nbdocs=count($this->paras); \r\n\t\t\t$this->paras=array_slice($this->paras, $this->borneinf, $this->bornesup); // troncage du tableau\r\n\t\t\t//print_r($this->paras);\r\n\t\t}\r\n\t } else if ($this->breve) {\t// Liste des br&egrave;ves internationales IFIP\r\n\t \t $result=mysql_query(\"SELECT numpara FROM if_v_breve $this->req_breve\");\r\n\t\t while ($row=mysql_fetch_row($result)) {\r\n\t\t \t$unPara=new Breve();\r\n\t\t\t$unPara->numpara=$row[0]; \r\n\t\t\t$unPara->infosBreve(); \r\n\t\t\t$this->paras[]=$unPara;\r\n\t\t }\t//fin du while\r\n\t } else if ($this->actu) {\t// Liste des br&egrave;ves d'actualit&eacute;s IFIP\r\n\t \t $result=mysql_query(\"SELECT numpara FROM if_v_actu $this->req_actu\");\r\n\t\t while ($row=mysql_fetch_row($result)) {\r\n\t\t \t$unPara=new Actualite();\r\n\t\t\t$unPara->numpara=$row[0]; \r\n\t\t\t$unPara->infosActu(); \r\n\t\t\t$this->paras[]=$unPara;\r\n\t\t }\t//fin du while\r\n\t } else {// Liste de tous les paragraphes (pour choisir un paragraphe &agrave; associer lors de la cr&eacute;ation ou modification de la page sauf les paragraphes de type Formation et de type Doc\r\n\t\t $result=mysql_query(\"SELECT numpara FROM if_paragraphe WHERE numpara NOT IN (SELECT numpara FROM if_v_form) AND NOT IN (SELECT numpara FROM if_v_doc)\");\r\n\t\t while ($row=mysql_fetch_row($result)) {\r\n\t\t \t$unPara=new Paragraphe();\r\n\t\t\t$unPara->numpara=$row[0]; \r\n\t\t\t$unPara->numpage=$this->numpage;\r\n\t\t\t$unPara->infosPara(); \r\n\t\t\t$this->paras[]=$unPara;\r\n\t\t }\t//fin du while\r\n\t }\r\n\t if ($this->docvcourte) return $this->nbdocs;\r\n\t else return count($this->paras); \r\n }", "function continutFacturaModel() {\n\t\t$y=100;\n\t\t$this -> pdf -> Rect( 1, $y, 14, $this -> inaltime_pagina); //nrcrt\n\t\t$this -> pdf -> Rect( 15, $y, 100, $this -> inaltime_pagina); //denumire\n\t\t$this -> pdf -> Rect(115, $y, 15, $this -> inaltime_pagina); //um\n\t\t$this -> pdf -> Rect(130, $y, 20, $this -> inaltime_pagina); //cantitate\n\t\t$this -> pdf -> Rect(150, $y, 20, $this -> inaltime_pagina); //pret\n\t\t$this -> pdf -> Rect(170, $y, 20, $this -> inaltime_pagina); //valoare\n\t\t$this -> pdf -> Rect(190, $y, 19, $this -> inaltime_pagina); //valoare tva\n\t}" ]
[ "0.675498", "0.67424446", "0.66058224", "0.6423647", "0.6394647", "0.62641186", "0.62584937", "0.6220568", "0.62063295", "0.6172183", "0.61649054", "0.61066955", "0.6093677", "0.6070827", "0.6057279", "0.6053575", "0.6021926", "0.60195464", "0.6009185", "0.6000091", "0.5964314", "0.59576803", "0.59458417", "0.59197384", "0.5916417", "0.590877", "0.5902491", "0.5887242", "0.5886159", "0.58443946", "0.5840931", "0.58368087", "0.58339703", "0.5821375", "0.5817079", "0.5808096", "0.5791255", "0.5784953", "0.57836944", "0.57798594", "0.5773475", "0.57663596", "0.57616115", "0.5761105", "0.57579654", "0.57506317", "0.5748673", "0.573173", "0.5721993", "0.5709376", "0.5694819", "0.56874084", "0.56873584", "0.5685795", "0.56808853", "0.5679276", "0.56738025", "0.5663643", "0.5663259", "0.5660849", "0.5648725", "0.5640858", "0.5634851", "0.5631719", "0.56129175", "0.5611595", "0.5610569", "0.5605772", "0.5602799", "0.5602286", "0.55986863", "0.5598511", "0.5588799", "0.5582931", "0.55805486", "0.5577449", "0.55760556", "0.5565098", "0.5559603", "0.5559242", "0.5558254", "0.555467", "0.5544385", "0.5539077", "0.55322045", "0.5532063", "0.5529604", "0.5528943", "0.5528721", "0.5528106", "0.551655", "0.55162275", "0.55138826", "0.55133873", "0.55040574", "0.54965454", "0.5492782", "0.54893816", "0.5485878", "0.54823774" ]
0.73211855
0
Funzione che simula la richiesta di un token per l'accesso alla piattaforma. Decodificata la email dell'utente dal formato JSON viene controllaata la reale esistenza nel DB di quest'ultima. Se esiste si provvede ad inviare un token univoco.
Функция, которая имитирует запрос на получение токена для доступа к платформе. После декодирования электронной почты пользователя из формата JSON проверяется её реальное существование в базе данных. Если электронная почта существует, отправляется уникальный токен.
public static function myToken() { $whois = json_decode('php://input',true); //Torna un tipo associativo $utente = FPersistentManager::getInstance()->load($whois["email"], "email", "EUtente"); if(isset($utente)) { VGestoreREST::showJSON(uniqid()); } else { VGestoreREST::showJSON("Errore"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function traeDatoToken($token) {\n $decoded = '';\n $respuesta[\"valid\"] = $valid;\n $respuesta[\"decoded\"] = $decoded;\n $respuesta[\"message \"] = $message;\n try {\n $decoded = JWT::decode($token, llave_super_secreta(), array('HS256'));\n } catch (Exception $e) {\n $valid = false;\n $message = $e->getMessage();\n }\n $respuesta[\"valid\"] = $valid;\n $respuesta[\"decoded\"] = $decoded;\n $respuesta[\"message\"] = $message;\n\n\n return $respuesta;\n}", "public function token_post(){\n \n $date = new DateTime();\n $username = $this->post('user_api',TRUE); \n $pass = $this->post('pass_api',TRUE);\n\t\t\t$email = $this->post('email_user',TRUE);\n\t\t\t\n\t\t\tif($username==$this->auth_username AND $pass==$this->auth_password ){\n\t\t\t\t$user = $this->M_api->get_user($email);\n if ($user){\n\t\t\t\t\tif (password_verify($this->post('email_user'),password_hash($user->email, PASSWORD_DEFAULT))) {\n\t\t\t\t\t\t$payload['email'] = $user->email;\n\t\t\t\t\t\t$payload['iat'] = $date->getTimestamp(); //waktu di buat\n\t\t\t\t\t\t$payload['exp'] = $date->getTimestamp() + 3600; //satu jam\n\t\t\t\t\t\t$output['token'] = JWT::encode($payload,$this->secretkey);\n\t\t\t\t\t\treturn $this->response($output,REST_Controller::HTTP_OK);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->viewtokenfail_email($email);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->viewtokenfail_email($email);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->viewtokenfail_user();\n\t\t\t}\n }", "private function inviaVerificaEmail($token)\r\n\t\t{\r\n\t\t\t//Corpo della mail\r\n\t\t\t$body = '\r\n\t\t\t\t\t<html>\r\n\t\t\t\t\t<head>\r\n\t\t\t\t\t\t<meta charset=\"utf-8\">\r\n\t\t\t\t\t</head>\r\n\t\t\t\t\t<body>\r\n\r\n\t\t\t\t\t\t<div class=\"container\" style=\"margin: black 1px solid\">\r\n\r\n\t\t\t\t\t\t\t<a href=\"www.progettooop.altervista.org/confermaEmail/'.$token.'/'.$this->email.'\" target=\"_blank\">Confirm your email</a>\r\n\r\n\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t</body>\r\n\t\t\t\t\t</html>\t\r\n\t\t\t\t\t';\r\n\t\t\t//SETTO GLI HEADER CHE SERVONO PER INVIARE L'EMAIL\r\n\t\t\t$headers = array(\r\n\t\t\t'Authorization: keyCodeSendgrid',\r\n\t\t\t'Content-Type: application/json'\r\n\t\t\t);\r\n\r\n\t\t\t//ARRAY DI DATI (email destinatario, corpo del messaggio,ecc..)\r\n\t\t\t$data = array(\r\n\t\t \t\"personalizations\" => array(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t\"to\" => array(\r\n\t\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t\"email\" => $this->email,\r\n\t\t\t\t\t\t\t\t\"name\" => $this->user\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t),\r\n\t\t\t\"from\" => array(\r\n\t\t\t\t\"email\" => \"progettoScuola@gmail.com\"\r\n\t\t\t),\r\n\t\t\t\"subject\" => \"Verifica il tuo account!\",\r\n\t\t\t\"content\" => array(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t\"type\" => \"text/html\",\r\n\t\t\t\t\t\"value\" => $body\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t \t$ch = curl_init();\r\n\t\t curl_setopt($ch, CURLOPT_URL, \"https://api.sendgrid.com/v3/mail/send\");\r\n\t\t curl_setopt($ch, CURLOPT_POST, 1);\r\n\t\t curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\r\n\t\t curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\t\t curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\r\n\t\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t $response = curl_exec($ch);\r\n\t\t curl_close($ch);\r\n\r\n\r\n\t\t}", "public function pagsegurotokenid(){\n $email=$this->EMAIL_PAGSEGURO;\n $token=$this->TOKEN_PAGSEGURO;\n $Url=\"https://ws.pagseguro.uol.com.br/v2/sessions?email=\".$email.\"&token=\".$token.\"\";\n $Curl=curl_init($Url);\n curl_setopt($Curl,CURLOPT_HTTPHEADER,array(\"Content-Type: application/x-www-form-urlencoded; charset=UTF-8\"));\n curl_setopt($Curl,CURLOPT_POST,1);\n curl_setopt($Curl,CURLOPT_SSL_VERIFYPEER,false);\n curl_setopt($Curl,CURLOPT_RETURNTRANSFER,true);\n $Retorno=curl_exec($Curl);\n curl_close($Curl);\n\n $Xml=simplexml_load_string($Retorno);\n echo json_encode($Xml);\n }", "public function getToken() {\n $request = array(\n 'usuario' => $this->auth_user,\n 'apikey' => $this->auth_key\n );\n $this->_setXmlOptions();\n $request = $this->_array_to_xml($request, '<SolicitaTokenRequest/>');\n $ret = $this->_POST('https://dev.api.ifacere-fel.com/fel-dte-services/api/solicitarToken', $request);\n $ret_val = array(\n 'status' => false,\n 'data' => array(),\n 'message' => ''\n );\n if(isset($ret['error'])) {\n $ret_val['message'] = $ret['error'];\n } elseif (isset($ret['tipo_respuesta']) && $ret['tipo_respuesta'] == 1) {\n $ret_val['message'] = 'error al token';\n $ret_val['data'] = $ret;\n } else {\n $ret_val['status'] = true;\n $ret_val['message'] = 'token';\n $ret_val['data']['token'] = 'Bearer ' . $ret['token'];\n $ret_val['data']['vigencia'] = $ret['vigencia'];\n }\n return $ret_val;\n }", "public function getAuthoremail() {}", "function login( $email , $password )\n{\n $params = array();\n $params['email'] = $email;\n $params['password'] = $password;\n\n if($content = send_request( 'user_get_token' , $params ))\n {\n $data = json_decode( $content , 1 );\n if( ($data['err_code'] == 0) && is_array( $data['data'] ) )\n return $data['data'];\n else\n return false;\n }\n return null;\n}", "public function verifyEmail(){\r\n if(count($this->postData) > 0){\r\n try{\r\n $data = JWT::decode($this->postData['data'], DEFAULT_TOKEN, array('HS256'));\r\n $email = $data->email;\r\n $hash = $data->secret;\r\n if (is_null($email) || is_null($hash) || md5($email . \":::\" . date(\"Y-m-d\")) != $hash) {\r\n $this->_displayBadRequest(array(\"code\" => 141));\r\n } else {\r\n $user = $this->rest_user_model->findUserByEmail($email);\r\n $userData['isVerifyEmail'] = 1;\r\n $this->user_model->update($user->id, $userData);\r\n $this->_displaySuccess(array(\"code\" => 150));\r\n }\r\n }\r\n catch(DomainException $e){\r\n if($this->getProtectedMember($e,'message' ) == 'Syntax error, malformed JSON'){\r\n $this->_displayBadRequest(array(\"code\" => 142));\r\n }\r\n }\r\n header('Content-Type: application/json');\r\n header(\"HTTP/1.1 500 Internal Server Error\");\r\n }\r\n }", "private function enviarEmailVerificacao( $email, $token ) {\n\n // carrega o template\n $this->load->model( 'Templates/Template' );\n $template = $this->Template->template( 'TEMPLATE_RECOVERY_CLIENTE' )->get( true );\n \n // adiciona os parametros customizaveis\n $template->corpo = str_replace( '%_TOKEN_%', site_url( 'recovery/recovery_cliente/'.$token ), $template->corpo );\n\n // configuracoes do email\n $config = [\n 'mailtype' => 'html',\n 'charset' => 'iso-8859-1'\n ];\n\n // carrega a library\n $this->load->library( 'email', $config );\n\n // seta os emails\n $this->email->from( 'vihh.fernando@gmail.com', \"Suporte\" )\n ->to( $email )\n\n // seta o corpo\n ->subject( 'Recuperacao de Senha Force Investor' )\n ->message( $template->corpo )\n ->set_mailtype( 'html' );\n \n // envia o email\n if( $this->email->send() ) {\n return true;\n } else {\n return false;\n }\n }", "public function __construct($email,$nombre,$token)\n {\n $this->email = $email;\n $this->nombre = $nombre;\n $this->token = urlencode($token);\n }", "static function generateToken($email){\n $users = UserManager::init()->getAll(\"WHERE email='$email'\");\n if( empty($users) ){ return \"Unknown e-mail account\"; }\n \n $users[0]->setToken( Tools::generateRandomString() );\n return UserManager::init()->update($users[0]) ? TRUE : \"DB error\";\n }", "public function findXORCreateToken($email){\n\t\t$userData = $this->find('first', array(\n\t\t\t'conditions' => array('User.email' => $email),\n\t\t\t'fields' => array('User.id', 'User.full_name', 'User.token', 'User.email')\n\t\t));\n\n\t\tif ($userData['User']['token'] === null || empty($userData['User']['token'])) {\n\t\t\t$token = $this->createToken($email);\n\t\t\t$this->id = $userData['User']['id'];\n\t\t\t$this->saveField('token', $token, array(\n\t\t\t\t'callbacks' => false,\n\t\t\t\t'validate' => false\n\t\t\t));\n\t\t\t$userData['User']['token'] = $token;\n\t\t}\n\t\t$userData = Hash::extract($userData, 'User');\n\t\treturn $userData;\n\t}", "function generar_token($objeto){\n $myJWT = new JWT();\n $llave = obtener_llave();\n return $myJWT->encode($objeto,$llave);\n }", "public function cektoken(){\n $jwt = $this->input->get_request_header('Authorization');\n try {\n $decode = JWT::decode($jwt,$this->secretkey,array('HS256'));\n if ($this->M_api->is_valid_email($decode->email)>0) {\n return true;\n }\n } catch (Exception $e) {\n exit(json_encode(array('status' => '0' ,'message' => 'Invalid Token',)));\n }\n }", "protected function getEmailByToken($token)\n {\n }", "public function verificaEmailCriar(){\n $email = trim($this->input->get_post(\"iptCriEmail\"));\n //verifica se existe\n if ($this->usuario->loginExiste($email)){\n echo json_encode(FALSE);\n }else {\n echo json_encode(TRUE);\n }\n exit();\n }", "public function verifyEmail()\n\t{\n\t\t$postData\t=\tjson_decode($_POST['data'], true);\n\t\tif( $postData['token'] == '')\n\t\t{\n\t\t\t$result[\"success\"] \t = false;\n\t\t\t$result[\"error_msg\"] = 'Something went wrong. Please try again';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$email \t = $this->encrypt->decode($postData['token']);\n\t\t\tif( $email != '' )\n\t\t\t{\n\t\t\t\t$exist\t = $this->common->getrow('dibcase_company',array('COM_EMAIL'=>$email));\n\t\t\t\tif( !empty($exist) )\n\t\t\t\t{\n\t\t\t\t\t$st\t = $this->common->verifyEmail($email);\n\t\t\t\t\tif($st)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result[\"success\"] \t\t\t\t= true;\n\t\t\t\t\t\t$result[\"success_msg\"] \t\t= 'Email verified successfully. You can now login.';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$result[\"success\"] \t\t\t= false;\n\t\t\t\t\t\t$result[\"error_msg\"] \t\t= 'Something wrong...';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$result[\"success\"] \t\t\t= false;\n\t\t\t\t\t$result[\"error_msg\"] \t\t= 'Token is invalid.';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result[\"success\"] \t\t\t= false;\n\t\t\t\t$result[\"error_msg\"] \t\t= 'Token is invalid.';\n\t\t\t}\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($result);exit;\n\t}", "public function token(){\n $this->token=json_decode($this->result,true);\n }", "public function traerUsuario($email){\n $usuarios = $this->traerUsuarios();\n\n foreach ($usuarios->usuarios as $usuario) {\n $emailJson = $usuario->email;\n \n\n if ( $emailJson == $email) {\n return $email;\n } \n }\n return NULL;\n \n }", "function validar_token($token){\n\n if( !isset($token) ){\n return array(\n 'err' => TRUE,\n 'mensaje' => 'Token no especificado'\n );\n }\n\n $myJWT = new JWT();\n $llave = obtener_llave();\n\n try{\n // $respuesta = $myJWT->decode($token,$llave,true);\n $respuesta = array(\n 'err' => FALSE,\n 'objeto' => $myJWT->decode($token,$llave,true)\n );\n return $respuesta;\n }catch(UnexpectedValueException $e){\n return array(\n 'err' => TRUE,\n 'mensaje' => 'Token invalido'\n );\n }\n\n }", "public function passwordRecuperabile() {\n if ($this->verificaEsistenzaEmail())\n echo json_encode(true);\n else\n echo json_encode(false);\n }", "function entrar(){\n\t\tif(isset($_POST['token']) and !empty($_POST['token'])){\n\t\t\t\n\t\t\t/* VERIFICA SE O TOKEN É VÁLIDO */\n\t\t\t$token = $this->_cor->_verificaToken('login', $_POST['token']);\n\t\n\t\t\t/* SE FOR VÁLIDO SEGUE ...*/\n\t\t\tif($token === true){\n\n\t\t\t\t/* SETA NOME E SENHA, PASSANDO STRIP_TAGS */\n\t\t\t\t$cpf \t= $this->_util->basico($_POST['cpf'] ?? '');\n\t\t\t\t$senha \t= $this->_util->basico($_POST['senha'] ?? '');\n\n\t\t\t\t/* VALIDA OS DADOS */\n\t\t\t\t$valida = $this->_validacao->_criarLogin(array('cpf' => $cpf, 'senha' => $senha));\n\n\t\t\t\t/* SE FOR VÁLIDO SEGUE ... */\n\t\t\t\tif($valida === true){\n\n\t\t\t\t\t$login = $this->_consulta->login(array('cpf' => $cpf, 'senha' => $senha));\n\n\t\t\t\t\tswitch ($login){\n\n\t\t\t\t\t\tcase 2:\n\n\t\t\t\t\t\t\t/* FALHA QUERY */\n\t\t\t\t\t\t\techo json_encode(array('res' => 'no', 'info' => 'Ops, tente novamente mais tarde!'));\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 3:\n\n\t\t\t\t\t\t\t/* SENHA ERRADA */\n\t\t\t\t\t\t\techo json_encode(array('res' => 'no', 'info' => 'Senha incorreta'));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 4:\n\n\t\t\t\t\t\t\t/* DADOS INVÁLIDOS */\n\t\t\t\t\t\t\techo json_encode(array('res' => 'no', 'info' => 'Tente novamente mais tarde!'));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* LOGADO COM SUCESSO */\n\t\t\t\t\t\t\techo json_encode(array('res' => 'ok', 'info' => 'Logando...'));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\t/* ERROS VALIDAÇÃO */\n\t\t\t\t\techo json_encode(array('res' => 'no', 'info' => $valida));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}else{\n\n\t\t\t\techo json_encode(array('res' => 'no', 'info' => 'token errado seu pnc!'));\n\t\t\t\texit;\n\t\t\t}\n\n\t\t}else{\n\n\t\t\techo json_encode(array('res' => 'no', 'info' => 'informe o token !'));\n\t\t\texit;\n\t\t}\n\t}", "public function verificaEsqueciSenha(){\n $email = trim($this->input->get_post(\"iptEsqueciSenhaEmail\"));\n //verifica se existe\n if ($this->usuario->verificaEmailAtivo($email)){\n echo json_encode(TRUE);\n }else {\n echo json_encode(FALSE);\n }\n exit();\n }", "function recuperar_usuario_con_email($email)\n\t{\n\t\ttry {\n $email = quote($email);\n $sql = \"SELECT usuario, email\n FROM apex_usuario\n WHERE email = $email \";\n $datos = toba::db()->consultar($sql);\n\t\t\treturn $datos[0]['usuario'];\n\t\t} catch (toba_error $e) { \n\t\t\ttoba::logger()->error('Se intento modificar la clave del usuario:' . $usuario);\n\t\t\treturn null;\n\t\t}\n\t}", "public function canjearToken($valor, $user_id) {\n //debemos verificar que ese id de usuario sea de un invitado\n $allowed_profile = 3;\n $user_id = (int)$user_id;\n $success = false;\n $connection = Connection::getConnection();\n if ($connection) {\n $sql_query = \"SELECT id FROM user WHERE id = $user_id AND profile_id = $allowed_profile;\";\n $result = $connection->query($sql_query);\n if($result->num_rows > 0 ) {\n $sql_query = \"SELECT codigo FROM token WHERE codigo='$valor' AND canjeado=0;\";\n $result = $connection->query($sql_query);\n if($result->num_rows > 0 ) {\n $sql_query = \"UPDATE token SET canjeado=1,user_id=$user_id WHERE codigo='$valor';\";\n if ($connection->query($sql_query)){\n $success=true;\n $message=\"El token fue canjeado con éxito\";\n } else {\n $message = \"Hubo errores al canjear el token \" . $connection->error;\n }\n } else {\n $message = \"Revisa que el token que ingresaste exista o no haya sido usado\";\n }\n } else {\n $message = \"Un administrador no puede canjear tokens\";\n }\n }\n return array(\"success\" => $success, \"message\" => $message);\n }", "public function setTokenViaEmail($email) {\r\n $user = UserQuery::create('u')->where('u.Email=?', $email)->findOne();\r\n if (!$user) return FALSE;\r\n\r\n $user->fromArray($this->getTokenSent());\r\n $user->save();\r\n\r\n return $token;\r\n }", "public function checkEmail(){\n $VRegistration= USingleton::getInstance('VRegistration');\n $FRegistration= USingleton::getInstance('FRegistration');\n \n $mail=$VRegistration->get('mail');\n $result=$FRegistration->checkEmail($mail);\n echo json_encode($result);\n exit;\n }", "public function checkTokenEmail($token, $email)\n {\n $sql = (\"SELECT email, firstname, token FROM User WHERE email = :email AND token = :token\");\n $sql = $this->conn->pdo->prepare($sql);\n $sql->execute([\n 'email' => $email,\n 'token' => $token\n ]);\n $result = $sql->fetch(\\PDO::FETCH_ASSOC);\n if (!$result) {\n $this->error[] = \"something went wrong\";\n }\n }", "function get_registration_data($token){\n\t\ttry {\n\t\t\t$response = $this->fb->get('/me?fields=name,first_name,last_name,email,age_range', $token);\n\t\t} catch(Exception $e) {\n\t\t\texit(\"Error: \".$e->getMessage());\n\t\t\t// show_error('La no se ha podido realizar en el tiempo determinado tardado demasiado', 408);\n\t\t}\n\t\treturn $response->getDecodedBody();\t\t\n\t}", "public function getByToken(){\n\n $emailVerificationObj = $this->where(\"token\",$this->token)->where(\"status\",\"Incomplete\")->first();\n\n return $emailVerificationObj;\n\n\n }", "protected function getToken(): string\n {\n $response = $this->getClient()->request(\n 'POST',\n self::URL_TOKEN . 'connexion/oauth2/access_token?realm=%2Fpartenaire',\n [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded'\n ],\n 'query' => [\n 'grant_type' => 'client_credentials',\n 'client_id' => $this->getClientId(),\n 'client_secret' => $this->getSecretKey(),\n 'scope' => 'application_' . $this->getClientId() . ' api_romev1 nomenclatureRome'\n ]\n ]\n );\n\n try {\n return 'Bearer ' . $response->toArray()['access_token'];\n } catch (Exception $e) {\n throw new Exception(\n 'Un problème de connexion avec notre partenaire est en cours.\n Merci de retester ultèrieurement.'\n );\n }\n }", "function base_getAuth($e,$p){\r\n\t\r\n\t\t$url = 'https://sales.futuresimple.com/api/v1/authentication.json';\r\n\t\t$tokenJsonResponse = wCURL($url,array('email'=>$e,'password'=>$p));\r\n\t\t$jsonToken = json_decode($tokenJsonResponse);\r\n\t\tif (isset($jsonToken->authentication->token)) return $jsonToken->authentication->token; else return false;\r\n\t\t\r\n\t}", "public function falabella_getToken()\r\n\t{\r\n\t\t$parametros = \"grant_type=client_credentials&client_id=\".$this->falabella_id.\"&client_secret=\".$this->falabella_secret;\r\n\t\t$url = $this->apiFalabella.\"auth/token\";\r\n\t\t//echo $ordenes;\r\n\t\t$curl = curl_init();\r\n\t\tcurl_setopt_array($curl, array(\r\n\t \tCURLOPT_URL => $url,\r\n\t \tCURLOPT_RETURNTRANSFER => true,\r\n\t \tCURLOPT_ENCODING => \"\",\r\n\t \tCURLOPT_MAXREDIRS => 10,\r\n\t\tCURLOPT_TIMEOUT => 0,\r\n\t\tCURLOPT_FOLLOWLOCATION => true,\r\n\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n\t\tCURLOPT_CUSTOMREQUEST => \"POST\",\r\n\t\tCURLOPT_SSL_VERIFYHOST => 0,\r\n\t\tCURLOPT_POSTFIELDS =>$parametros,\r\n\t\tCURLOPT_SSL_VERIFYPEER => 0,\r\n\t\tCURLOPT_HTTPHEADER => array(\r\n\t\t//\t\"Content-Type: application/json\",\r\n\t\t//\"Authorization: Bearer \".$this->getToken()\r\n\t\t ),\r\n\t\t));\r\n\t\t$result = curl_exec($curl);\r\n\t\tif( $result === false)\r\n\t\t{\r\n\t\t\tdie('aca');\r\n\t\t \techo 'Curl error: ' . curl_error($curl);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$response = json_decode($result ,true);\r\n\t\t\tif($response[\"access_token\"] && $response[\"access_token\"]!='')\r\n\t\t\t{\r\n\t\t\t\t$this->setFalabellaToken($response[\"access_token\"]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\r\n\t\t\treturn $response;\r\n\t\t}\r\n\t}", "function get_token($user ){\n $token = array();\n $token['id'] = $this->uniq_hash(\"ID\");\n $token['iss'] = 'codeignitor_fire';\n $token['username'] = $user['user_name'];\n $token['user_id'] = $user['user_id'];\n $date = new DateTime();\n $token['iat'] = $date->getTimestamp();\n//Storing information on redis server\n $redis_data = array(\n 'user_id' => $user['user_id'],\n 'user_name' => $user['user_name'],\n 'user_email' => $user['user_email'],\n 'user_type' => $user['user_type']\n );\n\n $redis_result = $this->store_redis($token['id'], $redis_data);\n \t\n if($redis_result){\n $msg = JWT::encode($token, $this->key);\n }\n else{\n $msg = \"Redis is not working\";\n }\n\n \n\n return $msg;\n }", "public function getEmail(): string;", "public function verifyEmail()\n {\n $token = $this->request->query->get(\"token\");\n $email = $this->request->query->get(\"user\");\n\n $user = $this->userRepo->findOneBy([\"email\" => $email]);\n if($user && $user->getTokenUser()->getStatus() === \"verified\") {\n return $status = \"already_verified\";\n } elseif(!empty($user) && $user->getTokenUser()->getToken() === $token && $user->getTokenUser()->getStatus() === \"pending\") {\n $user->getTokenUser()->setStatus(\"verified\");\n $user->getTokenUser()->setToken(\"\");\n $this->manager->flush();\n return $status = \"verified\";\n\n } else {\n return $status = \"error\";\n }\n }", "public static function getUserEidFromToken(string $token) : ?string\r\n {\r\n // api key, return null if the token isn't at least 30 characters\r\n if (strlen($token) < 30)\r\n return null;\r\n\r\n $token = self::base64_url_decode($token);\r\n $user_info = \\Flexio\\Base\\Util::decrypt($token, $GLOBALS['g_store']->connection_enckey);\r\n if (!$user_info)\r\n return null;\r\n\r\n $user_info = json_decode($user_info, true);\r\n if ($user_info === false)\r\n return null;\r\n\r\n $token_timestamp = $user_info['timestamp'] ?? false;\r\n if ($token_timestamp === false)\r\n return null;\r\n\r\n // compare the timestamp to the current time; if the timestamp is more than\r\n // a certain period time after the one in the token, then the token is\r\n // no longer valid, so return null; note: we used to also look for instances\r\n // where the token time was less the current system time and treated these\r\n // like an expired token as well; however, this caused problems because\r\n // a token could be generated on one server using and then used on another\r\n // server with time slightly ahead of the original server it was generated on,\r\n // causing a $date_diff_seconds to be negative and the function to not return\r\n // the user; while we want to check for expired tokens, we don't need to worry\r\n // so much about negative $date_diff_seconds, since the negative diff should\r\n // only be slightly, and the token is encrypted, so the negative value can't\r\n // come from somebody else trying to spoof the timestamp; TODO:however, should\r\n // consider moving over to some type of synced timestamp (using NTP?); see note\r\n // in \\Flexio\\Base\\Util::getCurrentTimestamp()\r\n // TODO: current time token period is set to 365 days; should we use a smaller\r\n // time period with refresh tokens?\r\n $current_timestamp = \\Flexio\\Base\\Util::getCurrentTimestamp();\r\n $date_diff_seconds = \\Flexio\\Base\\Util::formatDateDiff($token_timestamp, $current_timestamp);\r\n if ($date_diff_seconds > 60*60*24*365)\r\n return null;\r\n\r\n // return the user info\r\n return $user_info['eid'];\r\n }", "public function getEmail() {}", "public function getEmail() {}", "public function getEmail() {}", "public function getEmail() {}", "public function getEmail() {}", "function verify_email($token = null)\n\t{\n\t\n\t\tif ($this->Auth->user()) {\n\t\t\t$this->redirect(array('controller' => 'users', 'action' => 'index'));\n\t\t}\n\n\t\t$Token = ClassRegistry::init('Token');\n\t\t\n\t\tif($data = $Token->get($token)) \n\t\t{\n\t\t\t$this->User->id = $data['User']['id'];\n\t\t\t$this->User->saveField('verified', true);\n\t\t\t\n\t\t\t$this->_f('Your eamil has been verified');\n\t\t\t$this->redirect(array('controller'=>'users', 'action' => 'index'));\n\t\t}\n\t\t\n\t}", "function forgotPasswordStep2($email, $token, $newpassword,$json=true){\n $body=json_encode(array(\"email\" => $email,\"token\"=>$token,\"newpassword\"=>$newpassword));\n $curl = curl_init();\n curl_setopt($curl,CURLOPT_URL,$this->base_url.'/world/forgot2');\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $body);\n $result=curl_exec($curl);\n if($json){\n return $result;\n }\n else {\n return json_decode($result);\n }\n }", "protected function generateToken($email) {\n\n $expirationDate = new Time(null, 'America/New_York');\n $expirationDate->modify('+4 hours');\n $expirationDate = $expirationDate->format('Y-m-d_H-i-s');\n\n //The token is formed in 2 encrypted parts: email + token expiration Date\n $partA = EncryptionComponent::Crypt($email, Security::salt());\n $partB = EncryptionComponent::Crypt($expirationDate, Security::salt());\n return $partA . '.' . $partB;\n }", "public function testLoginUserInvalidEmail()\n {\n $token = (new UserService)->generateToken('test1@mail.com', 'test1234');\n $this->assertEquals( '', $token);\n }", "function send_token_to_user(){\n\t\t$objUser = $this->User->getUserById($this->Auth->user('id'));\n\n\t\t$objUser->sendEmailWithToken();\n\t\texit();\n\t}", "public function getToken(): string;", "public function getv1email()\n {\n $data = $this->getRequestWithCookie(\"https://accountsettings.roblox.com/v1/email\", [], [\"ReturnStatusCode\"=>true]);\n return $data;\n }", "private function EnviarEmail() {\r\n\r\n// setando conteudo do email para avisos\t\r\n }", "function forgotPasswordStep1($email,$json=true){\n $body=json_encode(array(\"email\" => $email));\n $curl = curl_init();\n curl_setopt($curl,CURLOPT_URL,$this->base_url.'/world/forgot1');\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $body);\n $result=curl_exec($curl);\n if($json){\n return $result;\n }\n else {\n return json_decode($result);\n }\n }", "public function getPersonMail();", "public function getEmail()\n\t{\n\t\treturn (string)$this->getJson()->resource->email;\n\t}", "public function registerTokenMobile() {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $status = \"\";\n $json = file_get_contents('php://input');\n $token = (object) json_decode($json);\n $count = $this->User->isUserExist($token->email);\n if ($count == 1) {\n if ($this->Token->isUserExist($token->email) == 0) {\n $status = $this->Token->registerTokenMobile($token);\n } else {\n $status = '\"token already exist\"';\n }\n } else {\n $status = '\"user does not exist\"';\n }\n\n echo \"{ \" . '\"status\"' . \" : $status }\";\n }\n }", "protected function _getAuthToken()\n {\n $api = Mage::helper('alliance_fivehundredfriends/api');\n $request_parameters = array(\n 'email' => $this->_getCustomerEmail(),\n );\n $response = $api->customerAuthToken($request_parameters);\n\t\tMage::log($response, null, 'fivehundredfriends.log');\n\n\t\tif(! isset($response['data']) || ! isset($response['data']['auth_token'])) return '';\n\t\t\n return $response['data']['auth_token'];\n }", "public function jwtToken($email)\n {\n $secretKey = \"prashant\";\n $token = JWT::encode($email, $secretKey);\n return $token;\n }", "public function getAccessTockenByCode() {\n $subdomain = 'infogastreetcom'; //Поддомен нужного аккаунта\n $link = 'https://' . $subdomain . '.amocrm.ru/oauth2/access_token'; //Формируем URL для запроса\n\n /** Соберем данные для запроса */\n $data = [\n 'client_id' => '8c117ac3-7f66-4a54-a37d-3a5fab849a57',\n 'client_secret' => '5Gf7usLZMZkXro0G36D6Rw4eu0MsFmt2gWlWjq0wITSqMuYGUy9Oh3AntfHJrAuJ',\n 'grant_type' => 'authorization_code',\n 'code' => 'def50200c30e1ad92c23d1df3d9b6352ed614c23c42afc55d7b26200bef93ef711da96f3f0609d084e41e2d9e63364b158d1b99997ab62b645489e7fa6c52ef84332979d20dfae37564927fc38068c945140f53e849efa00803f277dbdd7f54daa908b4ebbe92a505217e80c9c44b8ed7e829c9d9d3bef80f8551b24f4b5a44954e937187d49a1abbfa81c8181b0ea119a3dd2f2683aa6de3d8a349c6493a3f99825ea69a7176f0ae608dacf449d9c3eb4c0a6081477a2b2661af6294d785144a0788ed2ae2969ba80ff5deaf3def31f8820f26dea34b969445629c245730e92c1a486a92af2bc4a96f288600e6e023685399844dfa184bff70cfbadb06bbb531086e054472507cf197b47a3bef72e9fb296ba4a5d8417c9f15c46c97391b3e8c3e57bdd9cffc34dff1afb5118c88a05f1be6e4cee49e4af948328a2011356483b104650a36b6c8aa2d6b6ba88613765055bd13bf850f7429c5eeb4c3f7abb55999fe1d8314853c42caabd67f0f9e1acab333dda482792727eeb07cfaca334c1b2735d8408902a2456ebb9cb82275864f1b1caa67c9fc298e26cc45bedecdc30d889e95416639f7cca7f7c65200c5c409e88fbc7134a2c5670494938ecd9',\n 'redirect_uri' => 'https://gastreet.com/',\n ];\n\n // deb($data);\n\n /**\n * Нам необходимо инициировать запрос к серверу.\n * Воспользуемся библиотекой cURL (поставляется в составе PHP).\n * Вы также можете использовать и кроссплатформенную программу cURL, если вы не программируете на PHP.\n */\n $curl = curl_init(); //Сохраняем дескриптор сеанса cURL\n /** Устанавливаем необходимые опции для сеанса cURL */\n curl_setopt($curl,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl,CURLOPT_USERAGENT,'amoCRM-oAuth-client/1.0');\n curl_setopt($curl,CURLOPT_URL, $link);\n curl_setopt($curl,CURLOPT_HTTPHEADER,['Content-Type:application/json']);\n curl_setopt($curl,CURLOPT_HEADER, false);\n curl_setopt($curl,CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($curl,CURLOPT_POSTFIELDS, json_encode($data));\n curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($curl,CURLOPT_SSL_VERIFYHOST, 2);\n $out = curl_exec($curl); //Инициируем запрос к API и сохраняем ответ в переменную\n $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close($curl);\n /** Теперь мы можем обработать ответ, полученный от сервера. Это пример. Вы можете обработать данные своим способом. */\n $code = (int) $code;\n $errors = [\n 400 => 'Bad request',\n 401 => 'Unauthorized',\n 403 => 'Forbidden',\n 404 => 'Not found',\n 500 => 'Internal server error',\n 502 => 'Bad gateway',\n 503 => 'Service unavailable',\n ];\n\n try {\n /** Если код ответа не успешный - возвращаем сообщение об ошибке */\n if ($code < 200 || $code > 204) {\n throw new Exception(isset($errors[$code]) ? $errors[$code] : 'Undefined error', $code);\n }\n }\n catch(\\Exception $e) {\n die('Ошибка: ' . $e->getMessage() . PHP_EOL . 'Код ошибки: ' . $e->getCode());\n }\n\n /**\n * Данные получаем в формате JSON, поэтому, для получения читаемых данных,\n * нам придётся перевести ответ в формат, понятный PHP\n */\n $response = json_decode($out, true);\n return $response;\n }", "public function test_cambiar_contrasenha_despues_de_recibir_email()\n {\n $this->withoutExceptionHandling();\n $user = factory(User::class)->create([\n 'password' => bcrypt('87654321')\n ]);\n \\Notification::fake();\n $call = $this->postJson(\"/api/v1/password/send_email\", [\n \"email\" => $user->email\n ]);\n $token = '';\n \\Notification::assertSentTo(\n $user,\n PasswordResetRequest::class,\n function ($notification, $channels) use (&$token) {\n $token = $notification->token;\n\n return true;\n });\n\n $call = $this->postJson(\"/api/v1/password/change/\", [\n \"email\" => $user->email,\n \"password\" => \"87654321\",\n \"password_confirmation\" => \"87654321\",\n \"token\" => $token\n ]);\n\n\n\n $call->assertStatus(200);\n }", "private function EnviarEmail(){\n \n // setando conteudo do email para avisos\t\n\n \n }", "public static function getEmailToken($key){\n $sqlQuery = \"select email from BAQ_PASSWORD_RESET WHERE token = '\" . $key . \"';\";\n $response = Executor::doit($sqlQuery);\n $email = mysqli_fetch_array($response[0])[\"email\"];\n return $email;\n }", "public function resetPassword($token){\n require_once \"./application/models/input_manager.php\";\n\n //Verifico che l'email sia stata inviata\n if(isset($_COOKIE['mail_sent'])){\n\n //Verifico i campi inseriti\n $im = new input_manager();\n $token = filter_var($im->checkInput($token), FILTER_SANITIZE_STRING);\n\n //Verifico che l'utente esista\n $user = (new utente_model)->getUserFromToken($token);\n if($user != null){\n //Se esiste genero i cookie che mostreranno la pagina corretta\n setcookie('password_change', true, time()+86400, '/');\n setcookie('user_mail', $user['email'], time()+86400, '/');\n setcookie('mail_sent', '', time()-3600, '/');\n header('Location: ' . URL . 'reset');\n exit();\n }else{\n header('Location: ' . URL . 'login');\n exit();\n }\n }else{\n //Se non è stata inviata l'email riporto l'utente alla pagina di invio\n header('Location: ' . URL . 'reset');\n exit();\n }\n }", "function verify_token(){\n \n \n $decoded = (array)$this->get_decoded();\n if(isset($decoded['user_id'])){\n $redis_data = $this->get_redis_data();\n if($redis_data)\n $auth_data = $redis_data;\n else\n $auth_data = \"Logged Out\";\n }\n else{\n $auth_data = 'Token is not valid';\n }\n\n return $auth_data;\n \n }", "public function getUserByEmail($token) {\n $result = mysql_query(\"SELECT * FROM ras_other_mobile_device_tokens WHERE token= '$token' LIMIT 1\");\n return $result;\n }", "private function get_token()\n {\n $login_user_token = $this->session->userdata('login_user_token');\n\n $response_text = $login_user_token ? $login_user_token : null;\n\n if ($response_text != null && strlen($response_text) > 0) {\n return json_decode($response_text);\n }\n return null;\n }", "public function SolicitudPasswordCorreo($email,$nip)\n\t{\n\t\ttry {\n\n\t\t\t$variableencript = new Encrypter;\n\n\t\t\t$key='mingob$2013SIPOL';\n\n\t\t\t$usuario = new TblUsuario;\n\t\t\t\n\t\t\t$usuarios = $usuario->findAllByAttributes(array('email'=>$email, 'estado'=>1, 'usuario'=>$nip));\n\t\t\t\n\t\t\tif(count($usuarios) > 0)\n\t\t\t{\n\t\t\t\t//ahora obtengo el primer usuario\n\t\t\t\t$usuario_destino = $usuarios[0];\n\t\t\t\t//obtengo el password\n\t\t\t\t$password = $variableencript->decrypt($usuario_destino -> password);\n\t\t\t\t\n\t\t\t\t$asunto = \"Solicitud de usuario y Contraseña - SIPOL\"; \n\t\t\t\t\n\t\t\t\t$listadenuncia = '<div style=\"background:url(http://sipol.mingob.gob.gt/sipol/images/header_little.png) top repeat-x;\">\n\t\t\t\t\t<img src=\"http://sipol.mingob.gob.gt/sipol/images/logo_mingob.png\" alt=\"\"></div>';\n\t\t\t\t\t$listadenuncia = $listadenuncia.\"<h3>PNC SIPOL - SOLICITUD DE CONTRASEÑA</h3><hr>\";\n\t\t\t\t$cuerpo =\"<b>Usuario: </b>\".$usuario_destino->usuario.\"<b><br>Contraseña: </b>\".$password;\n\t\t\t\t\n\t\t\t\t$cuerpoSend = $listadenuncia.$cuerpo;\n\t\t\t\t\n\t\t\t\t$cliente = new SoapClient(\"http://192.168.0.214/serviciosExternos/wsEnvioEmail.php?wsdl\");\n\t\t\n\t\t\t\t$resultado = $cliente->__soapCall(\n\t\t\t\t\t\t\"EnvioEmail\", \n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'usuario' => 'U$rM1ng0b',\n\t\t\t\t\t\t\t\t'contrasena' => 'S1st3m@s2014',\n\t\t\t\t\t\t\t\t'destinatarios' => $email,\n\t\t\t\t\t\t\t\t'motivo' => $asunto,\n\t\t\t\t\t\t\t\t'contenido' => $cuerpoSend\n\t\t\t\t\t\t)\n\t\t\t\t\t); \n\n\t\t\t\t\t$resultadocorreo = \"La informacion fue envia al correo: <b>\".$email.\"</b>\"; \n\t\t\t\t\t\n\t\t\t\treturn '<div class=\"alert alert-info\">\n\t\t\t\t\t\t\t <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n\t\t\t\t\t\t\t <h4>Informacion!</h4>\n\t\t\t\t\t\t\t <br>'.$resultadocorreo.'\t\t\t\t\t \n\t\t\t\t\t\t\t</div>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn '<div class=\"alert alert-error\">\n\t\t\t\t\t <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n\t\t\t\t\t <h4>Informacion!</h4>\n\t\t\t\t\t Éste Correo electrónico no se encuentra registrado en el sistema\n\t\t\t\t\t</div>';\n\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\treturn '<div class=\"alert alert-error\">\n\t\t <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n\t\t <h4>Informacion!</h4>\n\t\t Error en la consulta\n\t\t </div>';\t\t\t\n\t\t}\t\t\n\t}", "private static function getToken(){\n //Body to send in POST\n $body = array(\n \"smartphoneId\" => (new self)->smartphoneId,\n \"username\"=> (new self)->username,\n \"password\"=> (new self)->password\n );\n //Encode body in JSON\n $bodyJSON = json_encode($body);\n //Complete URL\n $newTokeURL = (new self)->baseURL . \"account/authentication/v1/token/new\";\n //Do the call\n $call = self::cUrl($newTokeURL, \"POST\", $bodyJSON);\n //Only return the data if HTTP code equals 200 else return HTTP code\n if ($call[0] == \"200\"){\n return $call[1][\"body\"][\"authToken\"];\n } else {\n return $call[0];\n }\n }", "public function emailConfirm()\r\n {\r\n $new_email = urldecode( $this->input->get( 'new_email', null, 'string' ) );\r\n $token = $this->input->get( 'token', null, 'string' );\r\n \r\n try {\r\n\r\n // If either value is empty, this fails\r\n if (empty($new_email) || empty($token))\r\n {\r\n throw new \\Exception('Invalid inputs'); \r\n }\r\n \r\n $user = (new \\Users\\Models\\Users)->setState('filter.new_email', $new_email)->setState('filter.new_email_token', $token)->getItem();\r\n if (empty($user->id) || $token != (string) $user->{'change_email.token'})\r\n {\r\n throw new \\Exception( 'Token does not exist' );\r\n }\r\n \r\n // check the date when the token was created\r\n if ($user->{'change_email.created.time'} < strtotime('-2 hours'))\r\n {\r\n throw new \\Exception( 'Token has expired' );\r\n }\r\n \r\n // ok, token is valid, so lets change it\r\n $user->email = $user->{'change_email.email'};\r\n $user->change_email = array();\r\n $user->save();\r\n \r\n // is the user logged in? if so, update the identity\r\n $identity = $this->getIdentity();\r\n if (!empty($identity->id) && (string) $identity->id == (string) $user->id) \r\n {\r\n \t\\Dsc\\System::instance()->get('auth')->setIdentity( $user );\r\n }\r\n \r\n } catch (\\Exception $e) {\r\n \r\n \\Dsc\\System::addMessage( 'Change email request has failed.', 'error' );\r\n \\Dsc\\System::addMessage( $e->getMessage(), 'error' );\r\n \\Base::instance()->reroute( '/user/change-email' );\r\n return;\r\n }\r\n \r\n \\Dsc\\System::addMessage( 'Email changed.' );\r\n \\Base::instance()->reroute( '/user/settings' );\r\n }", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "function token(){\n $api_keys = array(\n 'apikey' => 'Ff1X1AgNgmQZsl4n9SdBoof7SRXrwA20xGXMMQDPioHXLVUPJX',\n 'secretkey' => 'E0QN0FAVAHE4CKZ8'\n );\n $payload = json_encode($api_keys);\n $access_token = null;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);\n curl_setopt($curl, CURLOPT_URL,\n 'https://misenvios.com.ar/servicios/api/Tokens');\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($payload))\n );\n $curl_res = curl_exec($curl);\n\n curl_close($curl);\n if( $curl_res ){\n $res = json_decode($curl_res, true);\n if( isset($res[\"isError\"]) && !$res[\"isError\"])\n $access_token = $res[\"result\"][\"access_token\"];\n }\n return $access_token;\n }", "public function get_to_email();", "public static function checkToken()\n\t{\n\t\t\n\t\t$rules = array(\n\t\t\t\t\t\t'email'=>'required|email',\n\t\t\t\t\t\t'token'=>'required'\n\t\t\t\t\t );\n\n\t\t$validator = Validator::make(Input::all(),$rules);\n\t\t\n\t\tif($validator->passes())\n\t\t{\n\t\t\t$exist = DB::table('users')\n\t\t\t\t\t\t\t\t ->where('email',Input::get('email'))\n\t\t\t\t\t\t\t\t ->where('recovery_token',Input::get('token'))\n\t\t\t\t\t\t\t\t ->select('recovery_time','email','recovery_token')\n\t\t\t\t\t\t\t\t ->first();\n\t\t\tif(!is_null($exist))\n\t\t\t{\n\t\t\t\t$token_time = strtotime($exist->recovery_time);\n\t\t\t\t$now = strtotime(date('Y-m-d H:i:s'));\n\n\t\t\t\tif($token_time >= $now)\n\t\t\t\t{\n\t\t\t\t\t$data['token'] = $exist->recovery_token;\n\t\t\t\t\t$data['email'] = $exist->email;\n\t\t\t\t\t$data['status'] = true;\n\t\t\t\t\treturn $data;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['message'] = 'Sorry your token has expired, request a new token!';\n\t\t\t\t\t$data['status'] = false;\n\t\t\t\t\treturn $data;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['message'] = 'Something went wrong, please make sure to click the link from your email';\n\t\t\t\t$data['status'] = false;\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['message'] = 'Something went wrong, please make sure to click the link from your email';\n\t\t\t$data['status'] = false;\n\t\t\treturn $data;\n\t\t}\n\t\t\n\t}", "abstract protected function setResetPasswordToken(string $email, string $token);", "public function show($token)\n {\n $authen = new Authen();\n $data=$authen->where('Token',$token)->get();\n if ($data->count() == 0)\n {\n return response()->json($data,202); \n }\n else\n {\n $ID = explode(\"@\", $token);\n $UserId = $ID[1];\n \n return(response()->json([\n 'notes'=>Result::Where('Etudiant_id',$UserId)->get()\n ])); \n } \n }", "function getemail($token, $lang=0, $headers=true) {\n\n if ($lang == 0) {\n if (!isset($_SESSION['language']) || $_SESSION['language'] == '') { $lang = getsetting('DEFAULT_LANGUAGE'); }\n else { $lang = $_SESSION['language']; }\n }\n \n if (file_exists('xmldata/emails_'.$lang.'.xml')) { $xml = simplexml_load_file('xmldata/emails_'.$lang.'.xml'); }\n else { $xml = simplexml_load_file('../xmldata/emails_'.$lang.'.xml'); }\n if ($xml === false) { return false; }\n \n foreach($xml->email as $email) {\n\n if ($headers) {\n if ($email->id == 'signature') { $signature = $email->body; }\n if ($email->id == 'header') { $header = $email->body; }\n } else {\n $signature = '';\n $header = '';\n }\n\n if ($email->id == $token) {\n $return = Array(\n 'id' => $email->id,\n 'subject' => $email->subject,\n 'body' => $header.$email->body.$signature,\n );\n }\n \n if ($token == '') {\n $return = Array(\n 'id' => $email->id,\n 'subject' => '',\n 'body' => $header.$signature,\n );\n }\n \n }\n\n $return['body'] = str_ireplace('%frontend_root%', getsetting('FRONTEND_ROOT'), $return['body']);\n $return['body'] = str_ireplace('%sendername%', getsetting('AUTOMAIL_SENDER'), $return['body']);\n $return['body'] = str_ireplace('%senderemail%', getsetting('AUTOMAIL_SENDER_ADDRESS'), $return['body']);\n return($return);\n \n}", "private function sendEmailResetPassword($email, $token){\n $user = DB::table('clients')->where('email', $email)->select('razon_social', 'email')->first();\n //Generamos el enlace de reestablecimiento\n $link = config('app.url') .'/'. 'reestablecercontraseña/' . $token . '?email=' . urlencode($user->email);\n\n try {\n \\Mail::to($email)->send(new \\App\\Mail\\RequestResetPassword($link));\n return true;\n } catch (\\Exception $e) {\n return back()->withErrors($e->getMessage());\n }\n }", "public function token($token) {\n\n $this->Model_crud->checkToken();\n\n \n\n if (isset($token)) {\n\n $num = $this->Model_crud->select_where('temp_forgot', array(\"token\" => $token));\n\n if ($num) {\n\n $new_pass = rand();\n\n \n\n $data_update = array(\n\n \"password\" => crypt($new_pass, '$2a$07$padajodadhaihiw1oihlknkxnc8718e01eu0suc9862853uyvjheqvwd')\n\n );\n\n \n\n $this->Model_crud->update('customer', $data_update, array('email'=>$num[0]['email']));\n\n \n\n $title = 'New Password';\n\n $dir = base_url('assets/email/forgotten_reset.php');\n\n $var = array('{base_url}','{password}','{login}');\n\n $var_to_repl = array(base_url(), $new_pass, base_url('account/login'));\n\n \n\n $this->_sendMail($num[0]['email'], $title, $dir, $var, $var_to_repl);\n\n\n\n $this->session->set_userdata('success', 'New password has been send to your mail');\n\n $this->Model_crud->delete('temp_forgot', array(\"token\"=>$token));\n\n redirect('account/login');\n\n } else {\n\n redirect('account/login');\n\n }\n\n } else {\n\n redirect('account/login');\n\n }\n\n }", "public function token()\n {\n return json_encode($this->decodedToken);\n }", "public function buscaCorreoToken($vcorreo,$vtar){\r\n\t\t$query=\"SELECT idcorreo,token FROM correos WHERE correo='$vcorreo'\";\r\n\t\t$res = $this->leer($query,$vtar);\r\n\t\tif ($res['idcorreo'] == \"\"){$res['idcorreo'] = '0';}\r\n\t\tif ($res['token'] == \"\"){$res['token'] = '0';}\r\n\t\treturn $res;\r\n\t}", "public function testGetToken()\n {\n $member = Member::get()->filter(array(\n 'Email' => 'test@test.com',\n ))->first();\n\n $auth = $this->getAuthenticator();\n $result = $auth->getToken($member->ID);\n\n $this->assertTrue(\n is_string($result),\n \"TokenAuth getToken should return token as string\"\n );\n }", "function fn_get_api_user($email, $api_key, $token = '')\n{\n list($email, $api_key, $token) = array_map('trim', [$email, $api_key, $token]);\n $user_data = [];\n\n if ($token) {\n $join = 'LEFT JOIN ?:ekeys AS ekeys ON users.user_id = ekeys.object_id';\n $condition = db_quote('ekeys.ekey = ?s AND ekeys.object_type = ?s', $token, 'U');\n $user_data = db_get_row('SELECT users.* FROM ?:users AS users ?p WHERE ?p', $join, $condition);\n } elseif ($api_key && $email) {\n $condition = db_quote('email = ?s AND api_key <> ?s', $email, '');\n $user_data = db_get_row('SELECT * FROM ?:users WHERE ?p', $condition);\n $user_data = isset($user_data['api_key']) && fn_verify_api_key($api_key, $user_data['api_key'])\n ? $user_data\n : [];\n }\n\n return $user_data;\n}", "function get_decoded(){\n $headers = $this->request_headers();\n if(isset($headers['JWT'])){\n $jwt = $headers['JWT'];\n try {\n $decoded = JWT::decode($jwt, $this->key, array('HS256'));\n } catch (Exception $e){\n $decoded = \"Token expired\";\n }\n \n }\n else{\n $decoded = \"Token doesn't exist\";\n }\n return $decoded;\n \n \t}", "public function verifyToken($token,$email){\n $isValidToken = array();\n try{\n Connection::getInstance();\n $sqlQuery = ApplicationConstants::$VerifyToken;//\"CALL sp_verify_token(?,?)\";\n $spParams = array(\"p_email\"=>$email,\"p_token\"=>$token);\n $isValidToken = Connection::$repoInstance->executeSelectQuery($sqlQuery,$spParams);\n $isValidToken = array_shift($isValidToken);\n return $isValidToken;\n }\n catch(Exception $ex){\n throw $ex;\n }\n }", "public function signup($email, $password, $getToken = null){\n /*$sql = 'SELECT * FROM users WHERE users.email=? AND users.password=?';\n $user = DB::select($sql,\n [\n $email,\n $password\n ]\n );*/\n $user= User::where([\n 'email' => $email,\n 'password' => $password\n ])->first(); // Se usa el metodo first para obtener los datos de un objeto.\n\n //Comprobar si son correctas\n $signup = false;\n\n //VERIFICAR SI EL SIZEOF DEL ARRAY ES IGUAL A 1 \n if(is_object($user)){\n // En el caso de que los datos sean correctos \n $signup = true;\n \n }\n\n //Generar el token con los datos del usuario identificado\n if($signup){\n\n\n $token = array(\n // sub hace referencia al id del usuario o registro\n 'sub' => $user->id,\n 'email' => $user->email,\n 'name_u' => $user->name_u,\n 'surname' => $user->surname,\n 'description' => $user->description,\n 'image' => $user->image,\n 'iat' => time(), // Cuando se ha creado el token\n 'exp' => time() + (7* 24* 60* 60) // Caducidad del token (dias * horas* minutos * segundos)\n );\n\n $jwt = JWT::encode($token, $this->key, 'HS256');\n\n $decoded = JWT::decode($jwt, $this->key, ['HS256']);\n\n //Devolver los datos decodificados o el token en funcion de un parametro\n if(is_null($getToken)){\n $data = $jwt;\n }else{\n $data = $decoded;\n }\n\n }else{\n\n $data = array(\n 'status' => 'error',\n 'message' => 'Login incorrecto.'\n );\n }\n\n return $data;\n }", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function getConfirmEmail($token){\n\n // select information user\n $users = DB::table('users')->where('remember_token', $token)->get();\n // check empty user\n if(empty($users)){\n\n return redirect('users/getResetPassword')->with(['flash_level'=>'danger','flash_message'=>'Accounts do not exist in the database.']);\n\n }\n\n //$times = \\Carbon\\Carbon::createFromTimestamp(strtotime($users[0]->created_at))->diffForHumans();\n $times = \\Carbon\\Carbon::now();\n // update status\n $user = User::find($users[0]->id);\n\n $user->status = 1;\n\n $user->save();\n\n return redirect('users/getLogin')->with(['flash_level'=>'success','flash_message'=>'Successful confirmation email']);\n\n }", "function validar_token(){\n $id_usuario = mysql_real_escape_string( $_POST['par1'] );\n $token = mysql_real_escape_string( $_POST['par2'] );\n $resultado = mysql_query(\" SELECT usu_id FROM usuario\n WHERE usu_id = '$id_usuario' AND usu_token = '$token' \");\n if (mysql_num_rows($resultado) > 0){\n $resultado = [ 'respuesta' => 'ok'];\n } else {\n $resultado = [ 'respuesta' => 'fallo'];\n }\n return $resultado;\n }" ]
[ "0.65422785", "0.6416374", "0.6405679", "0.6404077", "0.6142741", "0.6131673", "0.60931146", "0.59660757", "0.58827007", "0.585793", "0.58398455", "0.5830171", "0.58266485", "0.5826092", "0.58256495", "0.5813184", "0.5807527", "0.5777043", "0.5772372", "0.5764011", "0.5718324", "0.5693613", "0.5679588", "0.5672701", "0.5668614", "0.5640581", "0.56215775", "0.560955", "0.55805457", "0.55641264", "0.5536318", "0.5531167", "0.5526972", "0.5525722", "0.5524836", "0.5523228", "0.552319", "0.5503458", "0.5503458", "0.5503458", "0.5503458", "0.55029434", "0.54903454", "0.5486341", "0.5481183", "0.5478363", "0.5477737", "0.54752123", "0.54701084", "0.5462053", "0.545772", "0.5453462", "0.544496", "0.544054", "0.54372185", "0.54324096", "0.54156053", "0.5413356", "0.54119575", "0.540765", "0.54068035", "0.5398273", "0.53967935", "0.5394523", "0.5389899", "0.53873813", "0.53847706", "0.5384706", "0.5384706", "0.5384706", "0.5384706", "0.5384706", "0.5384706", "0.5384706", "0.5384706", "0.5384706", "0.53804845", "0.5378907", "0.53734493", "0.53732294", "0.53726", "0.53710705", "0.53610784", "0.5359741", "0.5359052", "0.5355163", "0.53360945", "0.53323925", "0.5331226", "0.5328934", "0.53255683", "0.5324783", "0.5324783", "0.5324783", "0.5324783", "0.5324783", "0.5324783", "0.5324783", "0.5321135", "0.5317019" ]
0.7646341
0
Can command be run on directories?
Можно ли выполнять команду в директориях?
public function runOnDirectories(): bool { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search_in_dirs($dirs, $cmd, $show_dirs)\n{\n foreach($dirs as $dir){\n if ($show_dirs)\n echo \"$dir\\n\";\n\n if (check_exact($dir, $cmd))\n return $dir;\n }\n\n return null;\n}", "abstract public function dir($path);", "public function test_handle_directory()\n {\n\n $artisan = $this->getArtisan();\n $finder = m::mock(Finder::class);\n $command = new Find();\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n\n $artisan->add($command);\n $finder\n ->shouldReceive('in')->with(__DIR__)\n ->shouldReceive('name')->with('*')\n ->shouldReceive('depth')->with('<1')\n ->shouldReceive('directories')\n ->shouldReceive('getIterator')->andReturn(new AppendIterator());\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n\n $artisan->getLaravel()->shouldReceive('call')->andReturnUsing(function () use ($command, $finder) {\n $filesystem = m::mock(Filesystem::class);\n $command->handle($finder, $filesystem);\n });\n\n $artisan->call('find ./ -name * -type d -maxdepth 0 -delete');\n }", "function pestle_cli($argv)\n{\n// output(\"@TODO: Check format in m1-to-convert (top level module folder)\");\n// output(\"@TODO: Check that all folders are what they say they are\");\n \n $cmd = \"php {$argv['unirgy_path']} s={$argv['module_path']} o={$argv['desination_path']} m={$argv['m1_path']}\";\n runCommand($cmd);\n}", "public function directoriesMustExist();", "protected function isDirectory() {}", "function check_exact($dir, $cmd)\n{\n $result = false;\n if ($handle = @opendir($dir)) {\n while (false !== ($entry = readdir($handle))) {\n if ($entry == $cmd){\n $result = true;\n break;\n }\n }\n closedir($handle);\n }else {\n echo \"unable to open $dir\\n\";\n }\n\n return $result;\n}", "function testAll(string $command) {\n if ($command !== \"all\") {\n return;\n }\n $files = array_diff(scandir('.'), array('..', '.','test.php','test'));\n foreach ($files as $file) {\n $this->testItem($file);\n }\n exit();\n }", "public function isDirectory();", "public function isDir();", "public function isDir();", "public function testx()\n {\n $dir = new \\Aw\\Filesystem\\Dir(__DIR__);\n $dir->mkdir('dir-test');\n $this->assertFileExists(__dir__ . \"/dir-test\", \"ok\");\n $dir->cd('dir-test');\n $this->assertEquals('/dir-test',$dir->getRelativePath());\n $dir->mkdir('examples');\n $this->assertFileExists(__dir__ . \"/dir-test/examples\", \"ok\");\n\n $f = $dir->cd('examples');\n $this->assertTrue($f);\n\n $dir->mkdir('aa');\n $f = $dir->cd('aa');\n $this->assertTrue($f);\n\n $dir->touch(\"qq\");\n $this->assertFileExists(__dir__ . \"/dir-test/examples/aa/qq\", \"ok\");\n\n $dir->cd();\n $dir->cd('dir-test');\n $this->assertTrue($dir->copyDir(\"examples\", \"balabala\"),'copied ok');\n $this->assertFileExists(__dir__ . \"/dir-test/balabala/aa/qq\", \"ok\");\n//\n //examples\n $dir->cd('examples');\n $dir->cd('aa');\n $dir->copyFile(\"qq\", \"exe\");\n $this->assertFileExists(__dir__ . \"/dir-test/examples/aa/exe\");\n\n $dir->up(2);// /dir-test\n $dir->mkdir('ba');\n $this->assertTrue($dir->hasDir('ba'));\n\n $this->assertTrue($dir->delDir(\"ba\"));\n\n $this->assertTrue($dir->hasDir('balabala'));\n $this->assertTrue($dir->delDir(\"balabala\"));\n $this->assertFileNotExists(__dir__ . \"/dir-test/balabala\");\n $dir->cd();\n $this->assertTrue($dir->delDir(\"dir-test\"));\n }", "function open_directory()\n{\n if(Parse::$directory_arg)\n {\n if(is_dir(Parse::$directory_path))\n {\n $directory = opendir(Parse::$directory_path);\n make_html();\n \n echo \"<p><b>Testy byly spuštěny z adresáře:\".Parse::$directory_path.\"</b></p>\";\n test(Parse::$directory_path);\n }\n else \n {\n exit(11);\n }\n }\n else \n {\n $directory = opendir(\".\");\n make_html();\n \n \n echo \"<p><b>Testy byly spuštěny z adresáře:\".getcwd().\"</b></p>\";\n test(\".\");\n }\n \n \n \n}", "function find_files($arguments, $directory)\n\t{\n\t\tglobal $all_tests;\n\t\t$files_dirs = scandir($directory);\n\t\t$files_dirs = array_diff($files_dirs, array('.','..'));\n\t\tforeach ($files_dirs as $file) {\n\t\t\tif (is_dir($directory.$file)) {\n\t\t\t\t#it is directory\n\t\t\t\tif ($arguments->recursive) {\n\t\t\t\t\tfind_files($arguments, $directory.$file.'/');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t#it is file\n\t\t\t\tif (preg_match('/^.*\\.src$/', $file)) {\n\t\t\t\t\t$all_tests[$arguments->tests_count] = run_tests($arguments, $directory, $file);\n\t\t\t\t\t$arguments->tests_count += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public abstract function run($directory, $showExtensions = false);", "public function supportDirectories(): self;", "function statFolder()\n {\n }", "public function processDirectories(): void\n {\n if (empty($this->directories)) {\n return;\n }\n\n $directory = new DirectoryProcessor(\n $this,\n $this->directories\n );\n\n $directory->execute();\n }", "abstract protected function locateInSyncDir();", "function pestle_cli($argv)\n{\n \n\n $path = $argv['path'];\n \n $olds = `find $path/ -name '*.php.old'`;\n $olds = explode(\"\\n\", $olds);\n $olds = array_filter($olds);\n if(count($olds) > 0)\n {\n \\Pulsestorm\\Pestle\\Library\\exitWithErrorMessage(\"BAILING: Found *.php.old files -- looks like you already ran this command.\");\n }\n\n// var_dump($olds);\n// exit(__FUNCTION__ . \"\\n\");\n // $path = 'm2-converted';\n // $path = 'app/code/LCG/Ambassador';\n $oldFiles = `find $path/ -name '*.php'`;\n $convertedFiles = `find $path/ -name '*.php.converted'`;\n \n \n\n $oldFiles = explode(\"\\n\", $oldFiles); \n $oldFiles = array_filter($oldFiles);\n foreach($oldFiles as $file)\n { \n $cmd = sprintf('mv %s %s', $file, $file . '.old');\n runCommand($cmd);\n }\n \n $convertedFiles = explode(\"\\n\", $convertedFiles);\n $convertedFiles = array_filter($convertedFiles);\n foreach($convertedFiles as $file)\n {\n $newPhpFile = preg_replace('%.php.converted$%', '.php', $file); \n $cmd = sprintf('mv %s %s', $file, $newPhpFile);\n runCommand($cmd);\n }\n\n}", "abstract public function ls($path);", "public function runCommand($command)\n {\n $folder = dirname($this->file);\n $olddir = getcwd();\n chdir($folder);\n\n ob_start();\n $output = null;\n $cmd = system('composer ' . $command, $output);\n $output = ob_end_clean();\n chdir($olddir);\n\n return $cmd !== false;\n }", "protected function searchCommands()\n {\n $this->addModulesCommandDirs();\n }", "public function test_it_finds_lang_directories(): void\n\t{\n\t\t$fs = new Filesystem();\n\t\t$fs->makeDirectory($this->module1->path('resources/lang'));\n\t\t$fs->makeDirectory($this->module2->path('resources/lang'));\n\t\t\n\t\t$resolved = [];\n\t\t\n\t\t$this->helper->langDirectoryFinder()->each(function(SplFileInfo $directory) use (&$resolved) {\n\t\t\t$resolved[] = str_replace('\\\\', '/', $directory->getPathname());\n\t\t});\n\t\t\n\t\t$this->assertContains($this->module1->path('resources/lang'), $resolved);\n\t\t$this->assertContains($this->module2->path('resources/lang'), $resolved);\n\t}", "public function cd($dir);", "public function cd($dir);", "function _dirApp($d)\r\n {\r\n// return ap_mkdir($d); \r\n $d = explode('/', $d);\r\n $base = '';\r\n\t\r\n foreach($d as $f)\r\n {\r\n if(!empty($f) && !is_dir($base.$f))\r\n {\r\n $ok = @mkdir($base.$f, 0777);\r\n if(!$ok) return false;\r\n }\r\n $base .= \"$f/\";\r\n }\r\n }", "protected function addModulesCommandDirs()\n {\n $pathToPhpFiles = $this->getPathsOfCommands();\n\n foreach ($pathToPhpFiles as $phpFile) {\n $classesFromPhpFile = $this->getAllClassesFromPhpFile($phpFile);\n array_walk(\n $classesFromPhpFile,\n function ($class) use ($phpFile) {\n $this->add($class, $phpFile);\n }\n );\n }\n\n }", "function directory_readable($dirname) {\r\n if (!is_dir($dirname))\r\n echo \"Directory $dirname does not exist.\";\r\n elseif (!is_readable($dirname))\r\n echo \"Directory $dirname is not readable.\";\r\n else\r\n echo \"Directory $dirname is readable.\";\r\n}", "abstract public function processFolder();", "function pestle_cli($argv)\n{\n $base = \\Pulsestorm\\Magento2\\Cli\\Library\\getBaseMagentoDir();\n $cmds = [\n \"find $base/pub/static -exec chmod 777 '{}' +\",\n\t \"find $base/var/ -exec chmod 777 '{}' +\",\n ];\n \n foreach($cmds as $cmd)\n {\n $results = `$cmd`;\n if($results)\n {\n \\Pulsestorm\\Pestle\\Library\\output($results);\n }\n }\n}", "protected function getFilesInDirCreateTestDirectory() {}", "function privDirCheck($p_dir, $p_is_dir = \\false)\n {\n }", "private static function _check_directory($dir) {\n\t\t$error = false;\n\t\tif(!Disk::writeable($dir)) {\n\t\t\techo HTML::paragraph(I18n::_(\"system.updater.set_permission\",array(\"path\"=>$dir)),array(\"class\"=>\"error\"));\n\t\t\t$error = true;\n\t\t} else {\n\t\t foreach(Disk::read_directory($dir) as $folder => $files) {\n \t\t\tif($folder == \".\") {\n \t\t\t\tforeach($files as $file) {\n \t\t\t\t\tif(!Disk::writeable($dir.\"/\".$file)) {\n \t\t\t\t\t\techo HTML::paragraph(I18n::_(\"system.updater.set_permission\",array(\"path\"=>$dir.\"/\".$file)),array(\"class\"=>\"error\"));\n \t\t\t\t\t\t$error = true;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tif(!Disk::writeable($dir.\"/\".$folder)) {\n \t\t\t\t\techo HTML::paragraph(I18n::_(\"system.updater.set_permission\",array(\"path\"=>$dir.\"/\".$folder)),array(\"class\"=>\"error\"));\n \t\t\t\t\t$error = true;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\t\t}\n\t\tif($error) {\n\t\t\texit;\n\t\t}\n\t}", "final protected function shouldBeDirectory ($path) {\n\t\t$arguments = func_get_args();\n\t\tforeach ($arguments as $argument) {\n\t\t\tif (!is_dir($argument)) {\n\t\t\t\treturn $this->fail();\n\t\t\t}\n\t\t}\n\t\treturn $this->pass();\n\t}", "function fam_monitor_directory($fam, $dirname)\n{\n}", "function test_directories(): void {\n # Test if we can write to MAIN_DIR (needed for the .htaccess file).\n if (!is_writable(MAIN_DIR))\n alert(\n __(\"Please CHMOD or CHOWN the installation directory to make it writable.\")\n );\n\n # Test if we can write to INCLUDES_DIR (needed for config.json.php).\n if (!is_writable(INCLUDES_DIR))\n alert(\n __(\"Please CHMOD or CHOWN the <em>includes</em> directory to make it writable.\")\n );\n\n # Test if we can write to CACHES_DIR (needed by some extensions).\n if (!is_writable(CACHES_DIR))\n alert(\n __(\"Please CHMOD or CHOWN the <em>caches</em> directory to make it writable.\")\n );\n\n # Test if we can write to twig cache.\n if (!is_writable(CACHES_DIR.DIR.\"twig\"))\n alert(\n __(\"Please CHMOD or CHOWN the <em>twig</em> directory to make it writable.\")\n );\n\n # Test if we can write to thumbs cache.\n if (!is_writable(CACHES_DIR.DIR.\"thumbs\"))\n alert(\n __(\"Please CHMOD or CHOWN the <em>thumbs</em> directory to make it writable.\")\n );\n }", "private function discoverCommands()\n {\n if (count($this->commands) > 1) {\n return;\n }\n\n if ([] === $files = $this->files($locator = Services::locator())) {\n return; // @codeCoverageIgnore\n }\n\n foreach ($files as $file) {\n $className = $locator->getClassname($file);\n\n if ($className === '' || ! class_exists($className)) {\n continue;\n }\n\n try {\n $this->addCommand($className, $this->logger);\n } catch (CLIException $e) {\n continue;\n } catch (ReflectionException $e) {\n $this->logger->error($e->getMessage());\n\n continue;\n }\n }\n }", "public function testRunScansRecursive()\n {\n $this->watcher->addDirectory(dirname(dirname(__FILE__)));\n $this->watcher->run();\n $filename = dirname(__FILE__) . '/' . basename(__FILE__, 'php') . 'pp';\n $expected = array($filename => filemtime($filename));\n $this->assertAttributeEquals($expected, 'files', $this->watcher);\n \n }", "public function isDirectoryOperationAllowed() {}", "function pestle_cli($argv)\n{\n $files = [\n './app/.htaccess',\n './.htaccess',\n './app/.htaccess',\n './bin/.htaccess',\n './dev/.htaccess',\n './lib/.htaccess',\n './phpserver/.htaccess',\n './pub/.htaccess',\n './pub/errors/.htaccess',\n './pub/media/.htaccess',\n './pub/media/customer/.htaccess',\n './pub/media/downloadable/.htaccess',\n './pub/media/import/.htaccess',\n './pub/media/theme_customization/.htaccess',\n './pub/static/.htaccess',\n './pub/static.finally/.htaccess',\n './setup/.htaccess',\n './setup/config/.htaccess',\n './setup/performance-toolkit/.htaccess',\n './setup/pub/.htaccess',\n './setup/src/.htaccess',\n './setup/view/.htaccess',\n './update/.htaccess',\n './update/app/.htaccess',\n './update/dev/.htaccess',\n './update/pub/.htaccess',\n './update/var/.htaccess',\n './var/.htaccess',\n './var/composer_home/.htaccess',\n './var/composer_home/cache/.htaccess', \n ];\n \n foreach($files as $file)\n {\n if(!file_exists($file))\n {\n \\Pulsestorm\\Pestle\\Library\\output(\"ERROR: Missing: \" . $file);\n continue;\n }\n \\Pulsestorm\\Pestle\\Library\\output(\"Found: $file\");\n }\n \\Pulsestorm\\Pestle\\Library\\output(\"Done\");\n}", "abstract public function isDir($path);", "protected static function checkMainPathsExist() {}", "public function exec($command=\"\") {\n\t}", "function getDirectories($path='', $str = ''){\n\n\n\tforeach (glob(\"*\") as $dirname ) {\n\tif( is_dir( $dirname ) )\n\techo \"<a target=\\\"_blank\\\" href=\\\"$dirname \\\">$dirname</a><br />\";}\n\t}", "function chkMaindir($rdir) {\n global $errorlist;\n $returnValue = false;\n if (isDir($rdir)) {\n $returnValue = true;\n }\n return $returnValue;\n}", "function pestle_cli($argv)\n{ \n // $path = inputOrIndex('Which folder?','/path/to/magento/app/code/Pulsestorm',$argv, 0);\n $path = $argv['folder'];\n \n $files = \\Pulsestorm\\Phpdotnet\\glob_recursive($path . '/*');\n \n foreach($files as $file)\n {\n $file = realpath($file);\n if(strpos($file, '.php') === false)\n {\n \\Pulsestorm\\Pestle\\Library\\output(\"NOT .php: Skipping $file\");\n continue;\n }\n\n $contents = file_get_contents($file);\n $namespace = parseNamespace($contents);\n if(!$namespace)\n {\n \\Pulsestorm\\Pestle\\Library\\output(\"No Namespace: Skipping $file\");\n continue; \n }\n $class = parseClass($contents);\n if(!$class)\n {\n \\Pulsestorm\\Pestle\\Library\\output(\"No Class: Skipping $class\");\n continue; \n } \n $full_class = $namespace . '\\\\' . $class;\n $path = str_replace('\\\\','/', $full_class) . '.php';\n \n if(strpos($file, $path) === false)\n {\n \\Pulsestorm\\Pestle\\Library\\output(\"ERROR: Path `$path` not in\");\n \\Pulsestorm\\Pestle\\Library\\output($file);\n }\n else\n {\n \\Pulsestorm\\Pestle\\Library\\output('.');\n }\n }\n}", "function genesis_extender_dir_check( $dir )\n{\n\tif( !is_dir( $dir ) )\n\t{\n\t\tmkdir( $dir );\n\t\t@chmod( $dir, 0755 );\n\t}\n\t\n\tif( is_dir( $dir ) )\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public function testScanDir(): void\n {\n $actualResult = $this->adapter->scan([self::getPathToCleanDir()]);\n\n $this->assertCount(1, $actualResult->getFiles());\n }", "function is_dir($path)\n{\n return false;\n}", "public function areExecutable($paths);", "function run($command, $args = array(), $return = false) {\n\t\textract($this->config);\n\n\t\t$gitDir = null;\n\t\tif (empty($this->_before) && empty($this->gitDir)) {\n\t\t\t$gitDir = \"--git-dir={$this->path} \";\n\t\t}\n\t\treturn parent::run(\"{$gitDir}{$command}\", $args, $return);\n\t}", "function file_checker($dirname, $name)\n{\n \n $in = false;\n $out = false;\n $rc = false;\n \n $directory = opendir($dirname);\n while(false !== ($file = readdir($directory)))\n {\n \n if(!((is_dir($dirname .\"/\". $file) && $file !== \".\" && $file !== \"..\") || ($file === \".\" && $file === \"..\") ) )\n {\n \n $extension = pathinfo($file, PATHINFO_EXTENSION);\n $name2 = basename($file, $extension);\n \n if($extension === \"in\" && $name === $name2) \n {\n $in = true;\n \n }\n elseif($extension === \"out\" && $name === $name2)\n {\n $out = true;\n \n }\n elseif($extension === \"rc\" && $name === $name2)\n {\n $rc = true;\n \n \n }\n }\n }\n \n \n if(!$in)\n {\n exec(\"touch \".$dirname.\"/\".$name.\"in\"); //dogeneruje .in\n }\n if(!$out)\n {\n exec(\"touch \".$dirname.\"/\".$name.\"out\"); //dogeneruje .out\n }\n if(!$rc)\n { \n exec(\"touch \".$dirname.\"/\".$name.\"rc\"); //dogeneruje .rc a nastavi na nulu\n exec('echo \"0\" > '.$dirname.\"/\".$name.\"rc\");\n }\n \n return;\n}", "public function is_dir($path)\n {\n }", "function view_dir()\n{\n \n if (array_key_exists('subcommand', $_GET)) {$subcommand = $_GET['subcommand'];}\n else {$subcommand = ''; }\n switch ($subcommand)\n {\n case '':\n /* initial click on \"view\" -> view webfolder*/\n view_my_directory();\n break;\n case 'unsubscribefolder':\n unsubscribe_folder();\n break;\n case 'addcollection':\n add_collection();\n break;\n case 'pushrevisionform':\n view_push_revision_form();\n break;\n case 'pushrevision':\n push_revision();\n break;\n case 'pullrevisionform':\n view_pull_revision_form();\n break;\n case 'pullrevision':\n pull_revision();\n break;\n default:\n echo '<span class=\"failure\">failure!<br />invalid subcommand given</span>';\n echo 'invalid command was: |'. $subcommand . \"|\\n\";\n break;\n }\n}", "function testItem(string $name) {\n if (!$this->checkFolder($name)) {\n return;\n }\n chdir($name);\n system(\"bash test.sh\");\n chdir(\"..\");\n }", "public function testDirectoryListing()\n {\n $cmd = new Doodad();\n $ret = $cmd->execute('ls');\n $this->assertEquals(0, $ret->getStatusCode());\n $this->assertEquals(\"0\", $ret->getReturnVal());\n $this->assertContains(\"LICENSE\", $ret->getOutput());\n }", "function scandir($directory)\n{\n return array();\n}", "function directory_exists($dirname) {\r\n if (is_dir($dirname))\r\n echo \"Directory $dirname exists.\";\r\n else\r\n echo \"Directory $dirname does not exist.\";\r\n}", "public function allow(...$directories) : RobotsInterface;", "abstract protected function getDirectories(): array;", "function listele($dizin_adi){\n echo '<ul>';\n $dosyalar = glob($dizin_adi);\n foreach ($dosyalar as $dosya){\n echo '<li>' . $dosya;\n if (is_dir($dosya)){\n listele($dosya . '*/');\n }\n echo '</li>';\n }\n echo '</ul>'; \n }", "abstract protected function getDirectory(): string;", "function run($command);", "public function check_dirAction(){\n\t\t$check_dir = array(\n\t\t\t'/cache'\t\t=>\tarray(\n\t\t\t\t\t'name'\t=>\t'/cache',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH.'cache',\n\t\t\t\t),\n\t\t\t'/cache/_sessions' => array(\n\t\t\t\t\t'name'\t=>\t'/cache/_sessions',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH.'cache'.DS.'_sessions',\n\t\t\t\t),\n\t\t\t'/web/upload'\t=>\tarray(\n\t\t\t\t\t'name'\t=>\t'/web/upload',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH .'web'.DS.'upload',\n\t\t\t\t),\n\t\t\t'/web/upload/contacts'\t=>\tarray(\n\t\t\t\t\t'name'\t=>\t'/web/upload/contacts',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH . 'web'.DS.'upload'.DS.'contacts',\n\t\t\t\t),\n\t\t\t'/web/upload/csv'\t=>\tarray(\n\t\t\t\t\t'name'\t=>\t'/web/upload/csv',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH . 'web'.DS.'upload'.DS.'csv',\n\t\t\t\t),\n\t\t\t'/web/upload/logo'\t=>\tarray(\n\t\t\t\t\t'name'\t=>\t'/web/upload/logo',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH . 'web'.DS.'upload'.DS.'logo',\n\t\t\t\t),\n\t\t\t'/web/upload/tmp'\t=>\tarray(\n\t\t\t\t\t'name'\t=>\t'/web/upload/tmp',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH . 'web'.DS.'upload'.DS.'tmp',\n\t\t\t\t),\n\t\t\t'/log'\t=>\tarray(\n\t\t\t\t\t'name'\t=>\t'/log',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH . 'log',\n\t\t\t\t),\n\t\t\t'/log/error'\t=>\tarray(\n\t\t\t\t\t'name'\t=>\t'/log/error',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH . 'log'.DS.'error',\n\t\t\t\t),\n\t\t\t'/log/import'\t=>\tarray(\n\t\t\t\t\t'name'\t=>\t'/log/import',\n\t\t\t\t\t'dir'\t=>\tROOT_PATH . 'log'.DS.'import',\n\t\t\t\t),\n\t\t);\n\n\t\tforeach ($check_dir as $dir) {\n\t\t\tif(!is_dir($dir['dir'])){\n\t\t\t\t$check_dir[$dir['name']]['result']= 'Dossier absent';\n\n\t\t\t\tif(@mkdir($dir['dir'], '0777'))\n\t\t\t\t\t$check_dir[$dir['name']]['result'] = '<br/>OK';\n\t\t\t\telse\n\t\t\t\t\t$check_dir[$dir['name']]['result'] = '<br/>Erreur';\t\t\t\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$check_dir[$dir['name']]['result']= '<span class=\"label label-success\"><strong>OK</strong></span>';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->registry->smarty->assign('check_dir', $check_dir);\n\n\t\treturn $this->registry->smarty->fetch(VIEW_PATH.'adm'.DS.'check_dir.meg');\n\t}", "public function getDirectory();", "public function getDirectory();", "public function directory_readable() {\n if (!is_dir($this->directoryName)) {\n $this->errorMessage = \"Error (directory_readable): Directory (\".$this->directoryName.\") does not exist.\";\n $this->errorLog->add_to_error_log($this->errorMessage);\n return false;\n } elseif (!is_readable($this->directoryName)) {\n $this->errorMessage = \"Error (directory_readable): Directory (\".$this->directoryName.\") is not readable.\";\n $this->errorLog->add_to_error_log($this->errorMessage);\n return false;\n } else\n return true;\n}", "public function dir(): DirInterface;", "public function testLoadDirs()\n {\n $this->expectOutputString('123234345456678789');\n $this->createInstance()->loadDirs($this->addRootDir([\n 'example/8-my-other-module/',\n '2-a-module/'\n ]));\n }", "function MyDirectory ()\n\t{\n\t}", "function pestle_cli($argv)\n{\n $base = \\Pulsestorm\\Magento2\\Cli\\Library\\askForModuleAndReturnFolder($argv) . '/view';\n \n $view_areas = glob($base . '/*');\n foreach($view_areas as $area)\n {\n \\Pulsestorm\\Pestle\\Library\\output(\"Checking $area\");\n if(is_dir($area . '/template'))\n {\n \\Pulsestorm\\Pestle\\Library\\output(\" `template` should be `templates`\");\n continue;\n }\n \\Pulsestorm\\Pestle\\Library\\output(\" OK\");\n }\n \\Pulsestorm\\Pestle\\Library\\output(\"Done\");\n}", "public function in()\n {\n $files = array();\n $here_dir = getcwd();\n $numargs = func_num_args();\n $arg_list = func_get_args();\n\n // first argument is an array?\n if ($numargs == 1 && is_array($arg_list[0])) {\n $arg_list = $arg_list[0];\n $numargs = count($arg_list);\n }\n\n $dirs = array();\n for ($i = 0; $i < $numargs; $i++) {\n if ($argDirs = glob($arg_list[$i])) {\n $dirs = array_merge($dirs, $argDirs);\n }\n }\n\n foreach ($dirs as $dir)\n {\n $real_dir = realpath($dir);\n\n // absolute path?\n if (!self::isPathAbsolute($real_dir)) {\n $dir = $here_dir . DIRECTORY_SEPARATOR . $real_dir;\n } else {\n $dir = $real_dir;\n }\n\n if (!is_dir($real_dir)) {\n continue;\n }\n\n $this->search_dir = $dir;\n\n if ($this->relative) {\n $files = array_merge($files, str_replace($dir . DIRECTORY_SEPARATOR, '', $this->search_in($dir)));\n } else {\n $files = array_merge($files, $this->search_in($dir));\n }\n }\n\n return array_unique($files);\n }", "static function es_directorio_vacio($dir)\n\t{\n\t\t$dh = @opendir($dir);\n\t\tif ($dh !== false) {\n\t\t\twhile ($file = readdir($dh)) {\n\t\t\t\tif ($file != '.' && $file != '..') {\n\t\t\t\t\tclosedir($dh);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function cliRunShallow($params) {\n\t$locations = isset($params['dir']) ? $params['dir'] : './';\n\t$locations = str_replace('{','',$locations);\n\t$locations = str_replace('}','',$locations);\n\tif(strpos(',',$locations) !== false) {\n\t\t$locations = explode(',',$locations);\n\t} else {\n\t\t$locations[] = $locations;\n\t}\n\t$m = initEmperic($params);\n\t$result = $m->shallowSearch($locations);\n\tif(true === $GLOBALS['errors']->has_error()) {\n\t\t$GLOBALS['errors']->display_errors(true,true);\n\t}\n\tif(false === $result) {\n\t\tdie(\"\\nan unknown error occured\\n\");\n\t}\n\tdie(\"\\noperation complete\\n\");\n}", "public function getDirectories();", "public function getDirectories();", "public function test_execute_plan_creates_one_directory() {\n global $CFG;\n $child_directories = self::_get_child_directories($CFG->dataroot . '/temp/backup');\n $this->assertCount(0, $child_directories);\n $this->_cut->execute_plan();\n $child_directories = self::_get_child_directories($CFG->dataroot . '/temp/backup');\n $this->assertCount(1, $child_directories);\n }", "function run_parse_tests($dir){\n\t#echo \"parse\\n\";\n\t#echo $GLOBALS['recursive_test'].\"\\n\";\n\t#echo $dir.\"\\n\";\n\tif (substr($dir,-1)!=\"/\") {\n\t\t$dir.=\"/\";\n\t}\n\tif ($GLOBALS['recursive_test']){\n\t\t#echo \"rec\";\n\n\t\t$files=recursion_function($dir.\"*.src\");\n\t\t#var_dump($files);\n\t\tforeach ($files as $src_file) {\n\t\t\t#echo \"som tu\\n\";\n\t\t\t\n\t\t\ttest_parse_in_globe($src_file);\n\t\t\t\n\t\t}\n\t}else{\n\t\t#echo \"non\\n\";\n\t\tforeach (glob($dir.\"*.src\") as $src_file) {\n\t\t\t#echo \"som tu\\n\";\n\t\t\ttest_parse_in_globe($src_file);\n\t\t\t\n\t\t}\n\t}\n}", "public function testScanComposerOnlyDir(): void\n {\n $this->assertEquals(\n 2,\n $this->oMap->scan(\n [self::$fixtureGroups['composer']['only-dir']]\n )\n );\n }", "public function scandir($path);", "public abstract function folderExists($path);", "function isDir($path);", "function testWritableDir() {\n\t\t// a directory that is writable\n\t\t// we test our directory, it must be writable, amirite?\n\t\t$this->condition = new \n\t\t\t\\Chaperone4php\\Pre\\WritableFileSystemPreCondition(__DIR__);\n\t\t$this->assertTrue($this->condition->check());\n\t}", "abstract protected function locateInVcsWorkdir();", "function get_dir($dir,$ext){\r\n\t$files = glob($dir.$ext);\r\n\t$f = array();\r\n\tforeach ($files as $k=>$v){\r\n\t\tif(is_dir($v)){\r\n\t\t\techo $v.'(is dir)'.PHP_EOL; \r\n\t\t\tget_dir($v.'\\\\', $ext);\r\n\t\t\t \r\n\t\t}else{\r\n\t\t\techo $v.PHP_EOL;\r\n\t\t}\r\n\t}\r\n\t\r\n}", "function getSubfolders() ;", "public function testLoadDir()\n {\n $dir = __DIR__ . '/resources/definition';\n\n $sut = new DirStrategy();\n $this->assertTrue($sut->supports($dir));\n\n $this->assertEquals(\n [\n file_get_contents($dir.'/test1.json'),\n file_get_contents($dir.'/test2.json'),\n ],\n $sut->load($dir)\n );\n }", "abstract public function runCommand();", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n }", "protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n }", "function explore_directory($path) {\n\tglobal $excluded;\n\n\tforeach (glob($path . '/*') as $name) {\n\t\tif ($name == '.svn') continue;\n\t\t\n\t\tif (is_dir($name) && !in_array($name, $excluded)) {\n\t\t\texplore_directory($name);\n\t\t}\n\t\tif (is_file($name)) {\n\t\t\t$pi = pathinfo($name);\n\t\t\tif (strtolower($pi['extension']) == 'php') {\n\t\t\t\tparse_class_file($name);\n\t\t\t}\n\t\t}\n\t}\n}", "public function dir($path, $createMissing = false);", "public function areDirs($paths);", "public function directoryContains($dir, $file);", "public function check ()\n\t{\n\t\tif (is_dir($this->directory_path)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function testDefaultFolderTreesRead()\n {\n }", "function analyse_directories($from, $to, $del)\n{\n\t$list = array();\n\t// main/lib/highlight/ => main/class/highlight/ ?\n\t$forbidden = array('cache/sql/', 'cache/xml/', 'cache/sql_backup/', 'cache/diff/', 'tpl/WhiteSummer/cache/', 'admin/adm_tpl/cache/', 'upload/', 'main/lib/highlight/', 'programms/', 'doc/', 'config/', 'install/', 'tpl/WhiteSummer/img/', 'admin/adm_tpl/img/', 'img/');\n\tforeach ($forbidden AS $f)\n\t{\n\t\tif (preg_match('#' . $f . '$#', $from) || preg_match('#' . $f . '$#', $to))\n\t\t{\n\t\t\treturn (array());\n\t\t}\n\t}\n\n\tif (is_dir($from))\n\t{\n\t\t$fd = opendir($from);\n\t\twhile ($file = readdir($fd))\n\t\t{\n\t\t\tif ($file == '.' || $file == '..' || $file == 'Thumbs.db')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_dir($from . $file))\n\t\t\t{\n\t\t\t\tarray_push($list, analyse_directories($from . $file . '/', $to . $file . '/', $del));\n\t\t\t}\n\t\t\telse if (file_exists($to . $file))\n\t\t\t{\n\t\t\t\t$list[] = array(\n\t\t\t\t\t'filename' =>\tsubstr($to, strlen($del)) . $file,\n\t\t\t\t\t'status' =>\t\tFILE_UPDATED,\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$list[] = array(\n\t\t\t\t\t'filename' =>\tsubstr($to, strlen($del)) . $file,\n\t\t\t\t\t'status' =>\t\tFILE_DELETED,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tclosedir($fd);\n\t}\n\n\tif (is_dir($to))\n\t{\n\t\t$fd = opendir($to);\n\t\twhile ($file = readdir($fd))\n\t\t{\n\t\t\tif ($file == '.' || $file == '..' || $file == 'Thumbs.db')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!file_exists($from . $file) && !is_dir($to . $file))\n\t\t\t{\n\t\t\t\t$list[] = array(\n\t\t\t\t\t'filename' =>\tsubstr($to, strlen($del)) . $file,\n\t\t\t\t\t'status' =>\t\tFILE_ADDED,\n\t\t\t\t);\n\t\t\t}\n\t\t\telse if (!file_exists($from . $file))\n\t\t\t{\n\t\t\t\tarray_push($list, analyse_directories($from . $file . '/', $to . $file . '/', $del));\n\t\t\t}\n\t\t}\n\t\tclosedir($fd);\n\t}\n\n\treturn ($list);\n}", "function getDirectoryListing($basedir = \"\");", "public function testDefaultFolderTreesSearch()\n {\n }" ]
[ "0.6496603", "0.6333574", "0.6128029", "0.60901064", "0.6049324", "0.5964366", "0.58663183", "0.5861767", "0.5831037", "0.58295363", "0.58295363", "0.5784794", "0.5762996", "0.5731287", "0.57283324", "0.56625336", "0.56572104", "0.5635658", "0.5615061", "0.56111324", "0.560516", "0.5590287", "0.55659837", "0.5560958", "0.55597484", "0.55597484", "0.5550859", "0.5540762", "0.5515818", "0.5514068", "0.5465752", "0.5459817", "0.5457404", "0.54553264", "0.5432453", "0.5426377", "0.5406315", "0.54045343", "0.53884864", "0.53846663", "0.53745097", "0.53733075", "0.5363916", "0.5340708", "0.5324653", "0.53219086", "0.53129226", "0.5299512", "0.5297992", "0.52968645", "0.52961075", "0.52960175", "0.5288465", "0.5281856", "0.52777994", "0.5272431", "0.5271481", "0.52694136", "0.5244798", "0.52417314", "0.524097", "0.5234471", "0.52329844", "0.5232237", "0.52265936", "0.52159476", "0.52159476", "0.5212309", "0.5206727", "0.51975733", "0.5194782", "0.51940566", "0.51922846", "0.519059", "0.5186812", "0.51752883", "0.51752883", "0.5173795", "0.5169306", "0.51690525", "0.51672214", "0.5158301", "0.51532274", "0.5149515", "0.5147966", "0.5147685", "0.51458967", "0.51359224", "0.5131273", "0.5129662", "0.51295507", "0.5128016", "0.512759", "0.5126802", "0.5122629", "0.5112831", "0.5111722", "0.5108578", "0.510839", "0.51033" ]
0.7095985
0
returns the metadata of an archive
возвращает метаданные архива
public static function getMetaData($archive) { $current = self::acquire($archive); if (isset($current['index']) == false) { throw new StarException('Star file ' . $archive . ' does not exist or is not a valid star file.'); } $metaData = array(); fseek($current['handle'], $current['header']['totalSize']); while (feof($current['handle']) == false) { $line = trim(fgets($current['handle'], 4096)); if (empty($line) == true) { continue; } $lineData = explode(' => ', $line); $metaData[$lineData[0]] = $lineData[1]; } return $metaData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExtractedMetadata() {\n\t\treturn $this->metadata;\n\t}", "public function getMetaData()\n {\n return $this->metaData;\n }", "public function get_metadata() {\n return $this->metadata;\n }", "public function get_metadata() {\n return $this->metadata;\n }", "public function get_metadata() {\n return $this->metadata;\n }", "public function get_metadata() {\n return $this->metadata;\n }", "public function get_metadata() {\n return $this->metadata;\n }", "public function getMetaData();", "public function getMetadata($path)\n {\n $object = $this->applyPathPrefix($path);\n\n try {\n $result = $this->ossClient->getObjectMeta($this->bucket, $object);\n } catch (OssException $e) {\n return false;\n }\n\n return [\n 'type' => 'file',\n 'dirname' => Util::dirname($path),\n 'path' => $path,\n 'timestamp' => strtotime($result['last-modified']),\n 'mimetype' => $result['content-type'],\n 'size' => $result['content-length'],\n ];\n }", "public function getMetadata();", "public function getArchive()\n {\n return $this->archive;\n }", "public function getMetadata()\n\t{\n\t\treturn $this->_metadata;\n\t}", "public function getMetadata()\n {\n return $this->filterMetadata($this->metadata);\n }", "function osubs_get_archive_info() {\n\t\t$archive_title = '';\n\t\t$archive_description = '';\n\n\t\tif ( is_search() ) {\n\t\t\tglobal $wp_query;\n\n\t\t\t$archive_title = sprintf(\n\t\t\t\t'%1$s %2$s',\n\t\t\t\t__( 'Search results for:', 'osubs' ),\n\t\t\t\t'&ldquo;' . get_search_query() . '&rdquo;'\n\t\t\t);\n\n\t\t\tif ( $wp_query->found_posts ) {\n\t\t\t\t$archive_description = sprintf(\n\t\t\t\t/* translators: %s: Number of search results. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'We found %s result for your search.',\n\t\t\t\t\t\t'We found %s results for your search.',\n\t\t\t\t\t\t$wp_query->found_posts,\n\t\t\t\t\t\t'osubs'\n\t\t\t\t\t),\n\t\t\t\t\tnumber_format_i18n( $wp_query->found_posts )\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( ! is_home() ) {\n\t\t\t$archive_title = get_the_archive_title();\n\t\t\t$archive_description = get_the_archive_description();\n\t\t}\n\n\t\treturn array(\n\t\t\t'title' => $archive_title,\n\t\t\t'description' => $archive_description,\n\t\t);\n\t}", "public function getArchive() {\n return $this->archive;\n }", "public function meta(): FileMetaInterface;", "function get_metadata($args = []) {\n\t\t$Tainacan_Item_Metadata = \\Tainacan\\Repositories\\Item_Metadata::get_instance();\n\n\t\treturn $Tainacan_Item_Metadata->fetch( $this, 'OBJECT', $args );\n\n\t}", "public function getMetadata()\n {\n if (!$this->has(self::METADATA)) {\n $this->loadMetadata();\n }\n\n return $this->get(self::METADATA);\n }", "public function getMetadata() {\n return $this->_metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->getResponse()['data']['metadata'];\n }", "public function getMetaData()\n {\n return $this->meta;\n }", "public function getMetaData()\n {\n if (!isset($this->metadata['name'])) {\n $this->metadata['name'] = $this->name;\n }\n\n return $this->metadata;\n }", "public function getMetadata(): array\n {\n return [\n 'name' => $this->getId(),\n 'path' => $this->getPath(),\n 'size' => $this->getSize(),\n 'mime' => $this->getMimeType()\n ];\n }", "public function getMetaData() {\n\t\tif(isset($this->data['lid'])) {\n\t\t\treturn getMetaData($this->data['lid'],'link');\n\t\t}\n\t\treturn array();\n\t}", "public function getMetadata(): array\n {\n $this->parseMetadata();\n\n return $this->metadata;\n }", "public function getMetadata($path)\n\t{\n\t\ttry {\n\t\t\t$result = $this->ossClient->getObjectMeta($this->bucket, $this->applyPathPrefix($path));\n\t\t}\n\t\tcatch (OssException $exception) {\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->normalizeResponse($result, $path);\n\t}", "function get_the_archive_description()\n{\n}", "public function getArchiveTimestamp()\n {\n return $this->archive_timestamp;\n }", "public function getMetadata($path)\n {\n $objectMeta = $this->client->getObjectMetadata([\n \"Bucket\" => $this->bucket,\n \"Key\" => $path\n ]);\n\n return $this->normalizeMetaData($path, $objectMeta);\n }", "public function getMetadata($path)\n {\n try {\n $response = $this->httpClient->get($this->applyPathPrefix($path), [\n 'headers' => [\n 'X-Akamai-ACS-Action' => $this->getAcsActionHeaderValue('stat')\n ]\n ]);\n } catch (\\GuzzleHttp\\Exception\\RequestException $e) {\n if ($e->getCode() != 404) {\n throw $e;\n }\n\n return false;\n }\n\n $xml = simplexml_load_string((string) $response->getBody());\n\n $meta = $this->handleFileMetaData($xml['directory'], (sizeof($xml->file) > 0) ? $xml->file : null);\n\n return $meta;\n }", "public function getMetadata(): array\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return stream_get_meta_data($this->mPipes[1]);\n }", "public function metadata(): array;", "public function metadata(): array;", "public function getArchiveImageID()\n {\n return $this->getMeta('archive_image');\n }", "public function getPackageMetaData();", "public function getPackageMetaData();", "public function get_meta($filename)\n {\n if (isset($this->metadata_cache[$filename])) \n {\n return $this->metadata_cache[$filename];\n }\n elseif (file_exists($this->dir.$filename.\".meta\"))\n {\n // Open and read meta data file\n // The start_time and interval are saved as two consequative unsigned integers\n $meta = new stdClass();\n $metafile = fopen($this->dir.$filename.\".meta\", 'rb');\n\n $tmp = unpack(\"I\",fread($metafile,4));\n $tmp = unpack(\"I\",fread($metafile,4));\n $tmp = unpack(\"I\",fread($metafile,4)); \n $meta->interval = $tmp[1];\n $tmp = unpack(\"I\",fread($metafile,4)); \n $meta->start_time = $tmp[1];\n \n fclose($metafile);\n \n // Save to metadata_cache so that we dont need to open the file next time\n $this->metadata_cache[$filename] = $meta;\n \n return $meta;\n }\n else\n {\n return false;\n }\n }", "public function getMetaData(): array;", "public function getMetaData() : array\n {\n if (isset($this->source['metadata'])) {\n return $this->source['metadata'];\n }\n\n return $this->metaData && is_array($this->metaData) ? $this->metaData : [];\n }", "function metaData( $contentObjectAttribute )\n {\n $ezFlickrImage =& $contentObjectAttribute->content();\n if ($ezFlickrImage->attribute('is_valid'))\n {\n return $ezFlickrImage->attribute('title');\n }\n return \"\";\n }", "public function archiveDataProvider()\n {\n $loader = new ZipArchiveLoader;\n $archive = $loader->loadArchive('allure-cli');\n $data = array();\n foreach ($archive->getFileList() as $relativeFilePath) {\n $data[] = array(\n $archive->getPath(),\n $relativeFilePath,\n $archive->getMd5($relativeFilePath)\n );\n }\n return $data;\n }", "abstract public function parse_archive(Archive $archive);", "public function getMetadata($path)\n {\n list($ret, $err) = Qiniu_RS_Stat($this->getClient(), $this->bucket, $path);\n if ($err !== null) {\n return false;\n }\n $ret['key'] = $path;\n return $this->normalizeData($ret);\n }", "public static function getMetadata($mid) {\n try {\n $midFilePath = self::getEcho360MetadataMidPath($mid);\n if(file_exists($midFilePath)) {\n $week = 60 * 60 * 24;\n $weekago = time() - $week;\n if(filemtime($midFilePath) < $weekago) {\n return self::getMetadatForMid($mid, $midFilePath);\n } else {\n return unserialize(file_get_contents($midFilePath));\n }\n } else {\n return self::getMetadatForMid($mid, $midFilePath);\n }\n } catch(Exception $ex) {\n Zend_Registry::get('logger')->warn($ex->getMessage());\n return array(); \n }\n }", "public function getMetadata()\n {\n return isset($this->metadata) ? $this->metadata : null;\n }", "public function metadata($params = array()) {\n return $this->client->get($this->path() . '/metadata', $params);\n }", "function getPackageMetaData() ;", "protected function getData()\n {\n return wp_get_attachment_metadata($this->id);\n }", "function metaData( $contentObjectAttribute )\n {\n $array = $contentObjectAttribute->objectAttributeContent( );\n $retVal = $array['code'];\n return $retVal;\n }", "public function getMetaData()\n {\n return [];\n }", "public function getMetaData(): MetaDataInterface\n {\n return $this->metaData;\n }", "protected static function metadata( $files ) {\n\n // Require that files be given in the form of a string or array.\n if( !is_string($files) and !is_array($files) ) return false;\n\n // Get metadata for a single file.\n if( is_string($files) ) return File::metadata($files);\n\n // Otherwise, get metadata for an array of files.\n else {\n\n // For associative arrays, assume keys are file paths, and replace their values with metadata.\n if( is_associative_array($files) ) {\n\n $files = array_map(function($file) {\n\n // Get the file's metadata.\n return File::metadata($file);\n\n }, $files);\n\n }\n\n // Otherwise, assume the array values are file paths, and lookup their metadata associatively.\n else {\n\n // Make the array associative, where keys are file paths and values are metadata.\n $files = array_reduce($files, function($result, $file) {\n\n // Get the file's metadata, and save it.\n $result[$file] = File::metadata($file);\n\n // Continue reducing.\n return $result;\n\n }, []);\n\n }\n\n // Return the files with their metadata.\n return $files;\n\n }\n\n }", "function getPersistentArchive() {\n\t\treturn $this->get('persistent_archive');\n\t}", "public function metadata() {\n $endpoint = '/meta/fields/' . $this->model_name;\n $result = $this->client->get($endpoint);\n return $result;\n }", "public function getMetadata($path);", "public function parsePackageMetadata(Package $package)\n\t{\n\t\t$packageZipFilePath = $package->storagePath();\n\t\t$parsedMetadata = Parser::parse($packageZipFilePath, true);\n\n\t\tif ($parsedMetadata === false) {\n\t\t\tthrow new Exception(sprintf('The Package archive file \"%s\" could not be parsed for metadata.', $packageZipFilePath));\n\t\t}\n\n\t\t$isPlugin = $parsedMetadata['type'] === 'plugin';\n\t\t$header = $parsedMetadata['header'];\n\t\t$readme = $parsedMetadata['readme'];\n\n\t\tif (!array_key_exists('Version', $header)) {\n\t\t\tthrow new Exception('The Package metadata did not supply a package version. This is required.');\n\t\t}\n\n\t\tif (!array_key_exists('Name', $header)) {\n\t\t\tthrow new Exception('The Package metadata did not supply a package name. This is required.');\n\t\t}\n\n\t\t$homepageUrl = $isPlugin ? $header['PluginURI'] : $header['ThemeURI']; // PluginURI/ThemeURI\n\n\t\t$metadata = [\n\t\t\t'name' => $header['Name'],\n\t\t\t'slug' => $package->slug,\n\t\t\t'version' => $header['Version'],\n\t\t\t'homepage' => $homepageUrl,\n\t\t\t'author' => $header['Author'],\n\t\t\t'author_homepage' => $header['AuthorURI'],\n\t\t\t'details_url' => isset($header['DetailsURI']) ?\n\t\t\t\t\t\t\t\t\t$header['DetailsURI']\n\t\t\t\t\t\t\t\t\t: $homepageUrl,\n\t\t\t// 'depends' => '',\n\t\t\t// 'provides' => '',\n\t\t\t'type' => $parsedMetadata['type']\n\t\t];\n\n\t\t// Add relevant information from readme\n\t\tif (is_array($readme) && count($readme) > 0) {\n\t\t\t$metadata['requires'] = $readme['requires'];\n\t\t\t$metadata['tested'] = $readme['tested'];\n\n\t\t\t// Add sections (Installation, Screenshots etc)\n\t\t\t$sections = $readme['sections'];\n\t\t\t$metadata['sections'] = [];\n\t\t\tif (is_array($sections) && count ($sections) > 0) {\n\t\t\t\tforeach($sections as $sectionName => $sectionContent) {\n\t\t\t\t\t// Key-ify section name\n\t\t\t\t\t$sectionName = str_replace(' ', '_', strtolower($sectionName));\n\n\t\t\t\t\t$metadata['sections'][$sectionName] = $sectionContent;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Parse upgrade notice\n\t\t\tif (isset($metadata['sections']['upgrade_notice'])) {\n\t\t\t\t$regex = '/^\\= ' . preg_quote($header['Version']) . ' \\=\\\\s?\\\\n(.*)\\\\n$/';\n\n\t\t\t\t$matches = null;\n\t\t\t\tif (preg_match($regex, $matches)) {\n\t\t\t\t\t$metadata['upgrade_notice'] = trim($matches[1]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add last updated timestamp\n\t\t\t$metadata['last_updated'] = gmdate('Y-m-d H:i:s', filemtime($packageZipFilePath));\n\t\t}\n\n\n\t\treturn $metadata;\n\t}", "public function getPackageMetaData() {}", "public function getInfo()\n {\n return $this->file->getInfo();\n }", "public function getMetaData()\n {\n $metaData = new SiteMeta($this->card->site_identifier);\n\n return $metaData->get();\n }", "public function getMetaFile()\n {\n return $this->fileMeta;\n }", "public function getMetadata($path)\n {\n return $this->preferDestination($path)->getMetadata($path);\n }", "public static function acquire($archive)\n {\n static $archives = array();\n $archive = str_replace('\\\\', '/', $archive);\n if (isset($archives[$archive]) == true) {\n return $archives[$archive];\n }\n \n $archives[$archive] = array();\n if (file_exists($archive) == false) {\n return array();\n }\n \n $current =& $archives[$archive];\n $current['handle'] = fopen($archive, 'rb');\n if (str_replace('\\\\', '/', __FILE__) == $archive && defined('__COMPILER_HALT_OFFSET__') == true) {\n fseek($current['handle'], __COMPILER_HALT_OFFSET__);\n } else {\n fseek($current['handle'], 0);\n }\n \n $header = unpack('a4id/c1version/a8indexsize/a14buildtime/a*reserved', fread($current['handle'], 0x0100));\n if (false === $header) {\n // invalid star file\n return array();\n }\n \n $current['index'] = array();\n $current['header'] = $header;\n if (str_replace('\\\\', '/', __FILE__) == $archive && defined('__COMPILER_HALT_OFFSET__') == true) {\n $current['header']['totalSize'] = __COMPILER_HALT_OFFSET__ + 0x0100;\n } else {\n $current['header']['totalSize'] = 0x0100;\n }\n \n if (1 === $header['version']) {\n $key = 'a80id/a72filename/a80path/a8size/a8offset/a*reserved';\n } else {\n $key = 'a232id/a8size/a8offset/a*reserved';\n }\n\n for ($i = 0; $i < $header['indexsize']; $i++) {\n $entry = unpack($key, fread($current['handle'], 0x0100));\n $current['index'][$entry['id']] = array('size' => (int) $entry['size'], 'offset' => (int) $entry['offset']);\n $current['header']['totalSize'] += 0x0100 + ((int) $entry['size']);\n }\n \n return $archives[$archive];\n }", "function metaData( $contentObjectAttribute )\n {\n return \"\";\n }", "public function getArchive()\n {\n return $this->_options['archive'];\n }", "public function &getMetadata() {\n return $this->metadata;\n }", "public function &getMetadata() {\n return $this->metadata;\n }", "function metadata() {\n global $Category_String;\n return array( 'intid' => $this->intid,\n 'img' => '<img width=\"'.$this->cover_scaled_width.'\" height=\"'.$this->cover_scaled_height.'\" alt=\"'.t('Missing Cover').'\"'\n .(($_SESSION[\"show_video_covers\"] && file_exists($this->cover_url)) ? ' src=\"data/video_covers/'.basename($this->cover_file).'\"' : '')\n .'>',\n 'title' => '<a href=\"'.$this->url.'\">'.$this->title.'</a>',\n 'subtitle' => $this->subtitle,\n 'season' => $this->season,\n 'episode' => $this->episode,\n 'playtime' => nice_length($this->length * 60),\n 'category' => strlen($Category_String[$this->category]) ? $Category_String[$this->category] : t('Uncategorized'),\n 'imdb' => ($this->inetref != '00000000') ? '<a href=\"http://www.imdb.com/Title?'.$this->inetref.'\">'.$this->inetref.'</a>' : '',\n 'plot' => $this->plot,\n 'rating' => $this->rating,\n 'director' => $this->director,\n 'inetref' => $this->inetref,\n 'year' => $this->year,\n 'userrating' => $this->userrating,\n 'length' => $this->length,\n 'showlevel' => $this->showlevel\n );\n }", "public function getTag()\n {\n return 'metadata';\n }", "public function ADArchive_Read_Object_Meta($DocumentId='' ){\n\t \n\t $result_key = parent::Initial_Result('read');\n\t $result = &$this->ModelResult[$result_key];\n\t \n\t try{\n\t \n\t\tif(!preg_match('/^[\\w\\d\\-]+$/',$DocumentId) ){ // ORL_150708_00034686\n\t\t throw new Exception('_SYSTEM_ERROR_PARAMETER_FAILS');\t\t \n\t\t}\n\t\t\n\t\t$identifier = $DocumentId;\n\t\t$meta = array();\n\t\t\n\t\t// 查詢資料\n\t\t$DB_Query = $this->DBLink->prepare(SQL_AdArchive::GET_OBJECT_METADATA());\n\t\t$DB_Query->bindValue(':id',$identifier); \n\t\t\n\t if(!$DB_Query->execute()){\n\t\t throw new Exception('_SYSTEM_ERROR_DB_ACCESS_FAIL');\t\n\t\t}\n\t\t\n\t\tif(!$meta = $DB_Query->fetch(PDO::FETCH_ASSOC)){\n\t\t throw new Exception('_SYSTEM_ERROR_DB_RESULT_NULL');\t\n\t\t}\n\t\t\n\t\t$pho_info = array();\n\t\t\n\t\t//$meta['objsrc'] \t= 'index.php?act=Archive/photo.php?src='.$meta['_store'].$meta['identifier'];\n\t\t\t\n\t $file_name = $meta['identifier'].'.'.$meta['file_type'];\n\t\t$file_path = _SYSTEM_FILE_PATH.'document/'.substr($meta['identifier'],0,1).'/'.$file_name;\t\t\n\t\t\n\t\t// 確認檔案\n\t\tif(!is_file($file_path)){\n\t\t $file_path = 'theme/image/error_file_not_found.png';\t\t\t \n\t\t $meta['objsrc'] \t= $file_path;\n\t\t $meta['file_type'] = 'png';\n\t\t}else if(strtolower($meta['file_type'])!='pdf'){\n\t\t $file_path = 'theme/image/error_file_un_view.png';\t\t\n\t\t $meta['objsrc'] \t= $file_path;\t \n\t\t $meta['file_type'] = 'png';\n\t\t}else{\n\t\t $meta['objsrc'] \t= 'index.php?act=Archive/preview/'.$meta['identifier']; //(安全疑慮暫時關閉)\t\n\t\t}\n\t\t\n\t\t$meta['tags']\t\t= $meta['tags'];\n\t\t\n\t\t$meta['editable']\t= 1;\t\n\t\tif(in_array('R01',$this->USER->PermissionNow['group_roles']) || \n\t\t in_array('R03',$this->USER->PermissionNow['group_roles']) || \n\t\t in_array('R00',$this->USER->PermissionNow['group_roles'])){\n\t\t $meta['editable']\t= 1;\t\n\t\t}\n\t\t\n\t\t// 取得所在資料夾\n\t\t$folders = array();\n\t\t$DB_Query = $this->DBLink->prepare(SQL_AdArchive::GET_OBJECT_FOLDERS());\n\t\t$DB_Query->bindValue(':sid',$meta['system_id']); \n\t\tif( $DB_Query->execute() ){\n\t\t $folders = $DB_Query->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\t\t\n\t\t\n\t\t// 取得下載紀錄\n\t\t$DB_Count = $this->DBLink->prepare(SQL_AdArchive::COUNT_FILE_DOWNLOAD());\n\t\t$DB_Count->bindValue(':id',$meta['identifier']); \n\t\t$DB_Count->execute();\n\t\t$meta['download'] \t= intval($DB_Count->fetchColumn());\n\t\t\n\t\t\n\t\t$result['session']['identifier'] = $meta['identifier'];\n\t\t$result['data'] = array('meta'=>$meta , 'folder'=>$folders ); \n\t\t$result['action'] = true;\n\t \n\t } catch (Exception $e) {\n $result['message'][] = $e->getMessage();\n }\t\n\t return $result;\t\n\t}", "public function getSeoMetadata();", "public function getMetadata($path)\n {\n $metadata = $this->fetchRemoteFileMetadata($this->buildUrl($path));\n\n return $this->normalizeFileInfo($path, $metadata);\n }", "public function getMetadata()\n {\n if (array_key_exists(\"metadata\", $this->_propDict)) {\n return $this->_propDict[\"metadata\"];\n } else {\n return null;\n }\n }" ]
[ "0.6475699", "0.6432432", "0.6406671", "0.6406671", "0.6406671", "0.6406671", "0.6406671", "0.63992375", "0.63657457", "0.63400596", "0.6285833", "0.628581", "0.6272409", "0.6252846", "0.62081015", "0.6188192", "0.61597306", "0.6103179", "0.6097773", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.60717726", "0.6069449", "0.60568184", "0.6048723", "0.604399", "0.6032104", "0.6005812", "0.5991857", "0.5952172", "0.5949313", "0.5948215", "0.5939815", "0.5939595", "0.5934612", "0.5923545", "0.5923545", "0.5918066", "0.58892816", "0.58892816", "0.5888404", "0.5883916", "0.5883419", "0.58736783", "0.58655554", "0.58590925", "0.5829257", "0.58267856", "0.5820678", "0.5820246", "0.57807773", "0.57774293", "0.5775606", "0.5774644", "0.5757961", "0.5752148", "0.574045", "0.5729827", "0.572477", "0.57220334", "0.5719982", "0.57164216", "0.56923056", "0.56744254", "0.56694627", "0.565875", "0.5658002", "0.5655041", "0.56547743", "0.56547743", "0.56523365", "0.56494963", "0.56436306", "0.5633444", "0.5633303", "0.56249213" ]
0.7177799
0
Copy all the newly created tiles to the projects folder
Скопируйте все новые созданные плитки в папку проектов
private function copyTiles() { $files = Storage::allFiles($this->jobPath . "/tiles"); foreach ($files as $file) { $stream = Storage::getDriver()->readStream($file); $fileName = str_replace($this->jobPath . "/tiles/", "", $file); Storage::disk('projects')->put($this->project->path . '/tiles/' . $fileName, $stream); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function incident_move_templates(){\n copy(dirname(__FILE__).'/templates/emergency-form.php', get_template_directory().DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'emergency-form.php');\n copy(dirname(__FILE__).'/templates/emergency-map.php', get_template_directory().DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'emergency-map.php');\n copy(dirname(__FILE__).'/templates/single-incident.php', get_template_directory().DIRECTORY_SEPARATOR.'single-incident.php');\n}", "public function copyAssets() {\n $this->core->component('file')->copyFolder('themes/' . $this->core->setting('theme') . '/assets/', 'public/assets/');\n }", "function create_new_template($folder_name_id,$template_name,$parent_template_name){\n\n global $dir_path, $new_path, $temp_dir_path, $temp_new_path, $xerte_toolkits_site;\n\n\n $row_framework = db_query_one(\"SELECT template_framework from {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails WHERE template_name = ?\", array($template_name));\n\n\n // I think this is wrong, currently looking like : /home/david/src/xerteonlinetoolkits/modules//templates/0 should presumably be home/david/src/xerteonlinetoolkits/modules/xerte/templates/Nottingham\n $dir_path = $xerte_toolkits_site->basic_template_path . $row_framework['template_framework'] . \"/templates/\" . $template_name;\n\n /**\n * Get the id of the folder we are looking to copy into\n */\n\n _debug(\"Creating new template : $folder_name_id, $template_name\");\n $new_path = $xerte_toolkits_site->users_file_area_full . $folder_name_id . \"-\" . $_SESSION['toolkits_logon_username'] . \"-\" . $template_name;\n $path = $xerte_toolkits_site->users_file_area_full . $folder_name_id . \"-\" . $_SESSION['toolkits_logon_username'] . \"-\" . $template_name;\n if(is_dir($path)) {\n _debug(\"Trying to create new template at location - $path - it's already in use. Aborting\");\n die(\"Template directory already exists; will not overwrite/re-create.\");\n }\n if(mkdir($path)){\n _debug(\"Created $path ok\");\n if(@chmod($path,0777)){\n $ok = copy_r($dir_path, $path);\n _debug(\"Copy_r returned \" . print_r($ok, true));\n return $ok;\n }else{\n _debug(\"Failed to set rights \");\n receive_message($_SESSION['toolkits_logon_username'], \"FILE_SYSTEM\", \"MAJOR\", \"Failed to set rights on parent folder for template\", \"Failed to set rights on parent folder \" . $path);\n return false;\n }\n }else{\n receive_message($_SESSION['toolkits_logon_username'], \"FILE_SYSTEM\", \"CRITICAL\", \"Failed to create parent folder for template\", \"Failed to create parent folder \" . $path);\n return false;\n }\n}", "function copy_loop($start_path, $final_path){\n\n global $xerte_toolkits_site;\n\n if (!file_exists($final_path)) {\n mkdir($final_path, 0777, true);\n }\n\n $d = opendir($start_path);\n\n while($f = readdir($d)){\n\n if(is_dir($start_path . $f)){\n\n if(($f!=\".\")&&($f!=\"..\")){\n\n copy_loop($start_path . $f . \"/\", $final_path . $f . \"/\");\n\n }\t\t\t\n\n }else{\n $ok = copy($start_path . $f, $final_path . $f);\n /*\n $data = file_get_contents($start_path . $f);\n\n $fh = fopen($final_path . $f, \"w\");\n\n fwrite($fh,$data);\n\n fclose($fh);\n */\n }\n\n }\t\n\n closedir($d);\n\n}", "function UPL_move_files_to_theme(){\r\n\r\n $theme_dir = UPL_site_active_theme() . '/ultimate-member/templates';\r\n\r\n if (! is_dir($theme_dir)) {\r\n mkdir( $theme_dir, 0777, true );\r\n }\r\n\r\n $src = UPL_PLUGIN_PATH.'/includes/core/profile-mycustomprofile.php';\r\n $dest = $theme_dir.'/profile-mycustomprofile.php';\r\n\r\n $src1 = UPL_PLUGIN_PATH.'/includes/core/profile.php';\r\n $dest1 = $theme_dir.'/profile.php';\r\n\r\n copy( $src, $dest);\r\n copy( $src1, $dest1);\r\n}", "public function tempToLive() {\n\n $styles = ['json', 'base', 'theme', 'grid', 'icons'];\n\n foreach ($styles as $style) {\n $from = $this->getStyleSheetFilename($style);\n $to = $this->getStyleSheetFilename($style, TRUE);\n if (file_exists($from)) {\n // Copy the file.\n file_unmanaged_move($from, $to, FILE_EXISTS_REPLACE);\n }\n }\n\n // Clean up.\n $this->refreshCaches();\n }", "private function copySampleAssets()\n {\n $sourceDir = dirname(dirname(__FILE__)) . '/' . $this->sampleAssetsBasePathInModule;\n\n try {\n $mediaDirectory = $this->filesystem->getDirectoryWrite(\n \\Magento\\Framework\\App\\Filesystem\\DirectoryList::MEDIA\n );\n $destinationDir = $mediaDirectory->getAbsolutePath() . 'wysiwyg/synchrony/sample_assets';\n // create destination dir if doesn't exist\n $this->fileManager->checkAndCreateFolder($destinationDir);\n $this->fileManager->cd($sourceDir);\n $files = $this->fileManager->ls(File::GREP_FILES);\n foreach ($files as $file) {\n if (!$file['is_image']) {\n continue;\n }\n $this->fileManager->cp($sourceDir . '/' . $file['text'], $destinationDir . '/' . $file['text']);\n }\n } catch (\\Exception $e) {\n // intentionally doing nothing, any issues here do not worth interrupting installation\n }\n }", "public function copyAssets()\n {\n $this->filesystem->copyDirectory(__DIR__ . '/../../resources/css', resource_path('css/vendor/crisvegadev/jet-dark'));\n }", "private function moveProjectFilesToRoot()\n {\n r_copy($this->backupPath . '/src', __ROOT_DIRECTORY__);\n }", "public function copy_template(){\n\t\t$dir = get_stylesheet_directory() . '/WooCommerce/single-product';\n\t\tif( ! is_dir( $dir ) ){\n\t\t\t@wp_mkdir_p( $dir );\n\t\t}\n\n\t\t/**\n\t\t * a 'week check'. if the files are not same, then copy\n\t\t */\n\t\tif( @md5_file( dirname( __FILE__ ) . '/templates/review.php' ) != @md5_file( $dir . '/review.php' ) ){\n\t\t\tcopy( dirname( __FILE__ ) . '/templates/review.php' , $dir . '/review.php' );\n\t\t}\n\t}", "public function copyFiles()\n {\n file_put_contents(\n config_path('auth.php'),\n $this->compileFileStub('config/auth.stub')\n );\n\n foreach ($this->filesToCopy as $stub => $file) {\n file_put_contents(\n app_path($file),\n $this->compileFileStub($stub)\n );\n }\n }", "public function copyFiles(): void\n {\n file_put_contents(\n config_path('auth.php'),\n $this->compileFileStub('config/auth.stub')\n );\n\n foreach ($this->filesToCopy as $stub => $file) {\n file_put_contents(\n app_path($file),\n $this->compileFileStub($stub)\n );\n }\n }", "function opening_times_install() {\n\n\t$json_files = array(\n\t\t'group_54ad5f47f3015.json',\n\t\t'group_54af9b82ba978.json',\n\t\t'group_54b3a2fe5477e.json',\n\t);\n\n\t$source_path = plugin_dir_path( __FILE__ ) . 'acf-json/';\n\t$destination_path = get_stylesheet_directory() . '/acf-json/';\n\n\tforeach ( $json_files\tas $file) {\n\t\tcopy($source_path.$file, $destination_path.$file);\n\t}\n\n}", "function copy_raw_push_package_files($package_dir, $raw_files) {\n mkdir($package_dir . '/icon.iconset');\n foreach ($raw_files as $raw_file) {\n copy(\"Package_Push.raw/$raw_file\", \"$package_dir/$raw_file\");\n }\n}", "public function copySuites()\n\t{\n\t\tforeach ($this->sourceSuites as &$sourceSuite) {\n\t\t\tif (!isset($sourceSuite['destination_id'])) {\n\t\t\t\t$destinationSuite = $this->addSuite($this->destinationProject, $sourceSuite);\n\t\t\t\t$sourceSuite['destination_id'] = $destinationSuite['id'];\n\t\t\t}\n\t\t}\n\t}", "protected function _copySkeleton()\n {\n $this->_source = dirname(ROOT) . DS . 'ThePhpLeague' . DS . 'skeleton';\n $this->_destination = dirname(ROOT) . DS . 'Packages' . DS . 'Plain' . DS . $this->params['directory'];\n $folder = new Folder();\n $folder->copy([\n 'to' => $this->_destination,\n 'from' => $this->_source,\n 'mode' => 0755,\n 'skip' => ['.git', '.gitattributes', '.gitignore'],\n 'scheme' => Folder::SKIP,\n ]);\n }", "public function loadImages()\n {\n foreach ($this->images as $oldPath => $newPath){\n $p = base_path($newPath);\n\n if(!file_exists($p)) {\n \\File::copy(__DIR__ . '/../views/' . $oldPath, $p);\n }\n }\n }", "public function moveContentAndCopyLivePage() {}", "public function copyImages()\n {\n $imageFolder = $this->getImagePath();\n $dest = $this->disk->path($this->template . '/images');\n return File::copyDirectory($imageFolder, $dest);\n }", "private function oneClick_Copy()\n {\n if (!Rules::isBrowserTriggerEnabled()) {\n @chmod($this->pathRootExtractedPiwik . '/misc/cron/archive.sh', 0755);\n }\n\n $model = new Model();\n\n /*\n * Copy all files to PIWIK_INCLUDE_PATH.\n * These files are accessed through the dispatcher.\n */\n Filesystem::copyRecursive($this->pathRootExtractedPiwik, PIWIK_INCLUDE_PATH);\n $model->removeGoneFiles($this->pathRootExtractedPiwik, PIWIK_INCLUDE_PATH);\n\n /*\n * These files are visible in the web root and are generally\n * served directly by the web server. May be shared.\n */\n if (PIWIK_INCLUDE_PATH !== PIWIK_DOCUMENT_ROOT) {\n /*\n * Copy PHP files that expect to be in the document root\n */\n $specialCases = array(\n '/index.php',\n '/piwik.php',\n '/js/index.php',\n );\n\n foreach ($specialCases as $file) {\n Filesystem::copy($this->pathRootExtractedPiwik . $file, PIWIK_DOCUMENT_ROOT . $file);\n }\n\n /*\n * Copy the non-PHP files (e.g., images, css, javascript)\n */\n Filesystem::copyRecursive($this->pathRootExtractedPiwik, PIWIK_DOCUMENT_ROOT, true);\n $model->removeGoneFiles($this->pathRootExtractedPiwik, PIWIK_DOCUMENT_ROOT);\n }\n\n /*\n * Config files may be user (account) specific\n */\n if (PIWIK_INCLUDE_PATH !== PIWIK_USER_PATH) {\n Filesystem::copyRecursive($this->pathRootExtractedPiwik . '/config', PIWIK_USER_PATH . '/config');\n }\n\n Filesystem::unlinkRecursive($this->pathRootExtractedPiwik, true);\n\n Filesystem::clearPhpCaches();\n }", "public function generateTilesAction($id)\n {\n $em = $this->getDoctrine()->getEntityManager();\n $rootDir = $this->get('kernel')->getRootDir();\n $command = 'nice ' . $rootDir . '/console atlas_viewer:atlas:generate_tiles ' . $id . ' ' . $this->getWorkingDir() . ' ' . $this->getTilesDir() . ' -m';\n $job = new Job($command, 6 * 60 * 60);\n $em->persist($job);\n $em->flush();\n return $this->render('BerkmanAtlasViewerBundle:Atlas:pending.html.twig');\n }", "public function execute()\n {\n foreach (scandir('../assets/images') as $imageFile) {\n file_put_contents('../content/images/new', file_get_contents($imageFile));\n unlink($imageFile);\n }\n }", "public function go()\n {\n // TODO: Implement go() method.\n $sourcePath = env('VIEW_PATH').'frontend'.DIRECTORY_SEPARATOR.env('THEME_NAME').DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR;\n\n $destinationPath = env('ROOT_PATH').DIRECTORY_SEPARATOR.'public_html'.DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.env('THEME_NAME').DIRECTORY_SEPARATOR;\n\n echo 'From: '.$sourcePath.PHP_EOL;\n echo 'To: '.$destinationPath.PHP_EOL;\n $result = copy_dir($sourcePath,$destinationPath);\n echo $result ? 'Done!'.PHP_EOL : 'Failed!'.PHP_EOL;\n }", "public function createContentAndCopyLivePage() {}", "public static function writeTemplateFiles()\n\t{\n\t\tXenForo_Model::create('DevTools_Model_File')->writeAllFiles();\n\t}", "protected function copyStubs(): void\n {\n $this->files->copyDirectory(__DIR__ . '/stubs/support', $this->cypressPath('support'));\n $this->files->copyDirectory(__DIR__ . '/stubs/plugins', $this->cypressPath('plugins'));\n\n $this->lineBreak();\n\n $this->status('Updated', $this->cypressPath('support/index.js', false));\n $this->status('Updated', $this->cypressPath('plugins/index.js', false));\n $this->status('Created', $this->cypressPath('plugins/swap-env.js', false));\n $this->status('Created', $this->cypressPath('support/laravel-commands.js', false));\n $this->status('Created', $this->cypressPath('support/laravel-routes.js', false));\n $this->status('Created', $this->cypressPath('support/assertions.js', false));\n $this->status('Created', $this->cypressPath('support/index.d.ts', false));\n\n $this->createCypressConfig();\n\n if (!$this->files->exists($path = base_path('.env.cypress'))) {\n $this->files->copy(base_path('.env'), $path);\n\n $this->status('Created', '.env.cypress');\n }\n\n $this->lineBreak();\n }", "public function run()\n {\n factory(\\App\\Models\\Project::class, 'project', 40)->create()->each(function($project) {\n $project->addMedia(storage_path('111.png'))->preservingOriginal()->toMediaCollection('posters');\n $project->translate('en')->save(factory(\\App\\Models\\ProjectTranslation::class, 'project_en')->make());\n $project->translate('ru')->save(factory(\\App\\Models\\ProjectTranslation::class, 'project_ru')->make());\n $project->translate('ua')->save(factory(\\App\\Models\\ProjectTranslation::class, 'project_ua')->make());\n });\n }", "private function CopyFiles()\n {\n $root = $_SERVER['DOCUMENT_ROOT'];\n \n foreach ($this->Package_Files AS $source => $destination) \n {\n $t_source = \"{$root}/{$source}\";\n $t_destination = \"{$root}/{$this->Package_Directory}/{$this->Package_Folder}/{$destination}\";\n $copy_result = $this->smartCopy($t_source, $t_destination);\n \n if (!$copy_result) {\n $this->OutputMessage (\"<b style='color:red;'>FILE DID NOT COPY:</b <br /><b>Source</b> ==> {$t_source} <br /><b>Destination</b> ==> {$t_destination} <br />\");\n } else {\n $this->OutputMessage (\"<b style='color:blue;'>FILE COPIED:</b <br /><b>Source</b> ==> {$t_source} <br /><b>Destination</b> ==> {$t_destination} <br />\");\n }\n \n \n # write the contents for the file (install.php)\n $temp = explode('/', $source);\n $count = count($temp);\n \n $source_filename = $temp[$count-1];\n $source_filename_length = strlen($source_filename);\n \n $temp_length = -($source_filename_length);\n $destination_new = substr($source, 0, $temp_length);\n $source_new = \"{$destination}{$source_filename}\";\n \n $this->Install_File_Content_FILES .= \"'{$source_new}' => '{$destination_new}',\n \";\n \n \n # write the contents for the file (remove.php)\n $delete_file = \"{$destination_new}{$source_filename}\";\n $this->Remove_File_Content_FILES .= \"'{$delete_file}',\n \";\n \n }\n \n ### TO DO ###\n # determine if folder exists - create if not there\n # determine if file exists - copy if not - ask to overwrite if YES\n }", "public function setFilesToCopy()\n\t{\n\t\t$params = $this->getFormParams();\n\t\t\n\t\t// TODO: stack or align stack?\n\t\t// Extract the stack id from the stack string\n\t\t$stack = $params->getParamValue( \"stack\" );\n\t\tlist($stackid, $apix, $boxsz, $totpart) = preg_split('%\\|--\\|%',$stack);\n\t\t\n\t\t// Get the stack file path\n\t\t$particle = new particledata();\n\t\t$stackdata = $particle->getStackParams($stackid);\n\t\t$stackfile = $stackdata['path'].\"/\".$stackdata['name'];\n\t\t\n\t\t// Get the stack file path and name\n\t\t$this->filesToCopy[] = $stackfile;\n\t}", "public function run()\n {\n $this->copyStockImages();\n }", "protected function installLivewireTeamStack()\n {\n // Directories...\n (new Filesystem)->ensureDirectoryExists(resource_path('views/teams'));\n\n // Other Views...\n (new Filesystem)->copyDirectory(__DIR__.'/../../../stubs/v4/livewire/resources/views/teams', resource_path('views/teams'));\n }", "public function copy_bridge_files_tc(){\n\t\t$plugin_path_tc = WP_PLUGIN_DIR . '/' . TC_PLUGIN_NAME;\n\t\t$plugin_bridge_file_path = $plugin_path_tc . '/wp-tcapsule-bridge';\n\t\t$current_bridge_file_name = $this->config->get_option('current_bridge_file_name');\n\t\t$root_bridge_file_path = ABSPATH . '/' . $current_bridge_file_name;\n\t\t$restore_id = WPTC_Factory::get('config')->get_option('restore_action_id');\n $logger = WPTC_Factory::get('logger');\n\t\t$this_config_like_file = $this->create_config_like_file();\n\t\t\n\t\t$files_other_than_bridge = array();\n\t\t$files_other_than_bridge['DBTables.php'] = $plugin_path_tc . '/Classes/Processed/DBTables.php';\n\t\t$files_other_than_bridge['Factory.php'] = $plugin_path_tc . '/Classes/Factory.php';\n\t\t$files_other_than_bridge['FileList.php'] = $plugin_path_tc . '/Classes/FileList.php';\n\t\t$files_other_than_bridge['tc-config.php'] = $plugin_path_tc . '/Classes/Config.php';\n\t\t$files_other_than_bridge['wp-tc-config.php'] = $this_config_like_file;\t\t\t\t\t\t//config-like-file which was prepared already\n\t\t$files_other_than_bridge['Files.php'] = $plugin_path_tc . '/Classes/Processed/Files.php';\n\t\t$files_other_than_bridge['Restoredfiles.php'] = $plugin_path_tc . '/Classes/Processed/Restoredfiles.php';\n\t\t$files_other_than_bridge['class-wp-filesystem-base.php'] = ABSPATH . '/wp-admin/includes/class-wp-filesystem-base.php';\n\t\t$files_other_than_bridge['class-wp-filesystem-direct.php'] = ABSPATH . '/wp-admin/includes/class-wp-filesystem-direct.php';\n\t\t$files_other_than_bridge['class-wp-filesystem-ftpext.php'] = ABSPATH . '/wp-admin/includes/class-wp-filesystem-ftpext.php';\n\t\t$files_other_than_bridge['class-wp-error.php'] = ABSPATH . '/wp-includes/class-wp-error.php';\n\t\t$files_other_than_bridge['jquery.min.js'] = ABSPATH . '/wp-includes/js/jquery/jquery.js';\n\t\t$files_other_than_bridge['formatting.php'] = ABSPATH . '/wp-includes/formatting.php';\n\t\t\n\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n ----plugin_bridge_file_path------- \".var_export($plugin_bridge_file_path,true).\"\\n\",FILE_APPEND);\n\t\t\n\t\t//create the folder in root directory if it doesnt exist\n\t\tglobal $wp_filesystem;\n\t\tif ( !$wp_filesystem->is_dir($root_bridge_file_path) ) \n\t\t{\n\t\t\tif ( !$wp_filesystem->mkdir($root_bridge_file_path, FS_CHMOD_DIR) )\n\t\t\t{\n\t\t\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n -----root folder creation error------- \".var_export($root_bridge_file_path,true).\"\\n\",FILE_APPEND);\n $logger->log('Failed to create bridge directory while restoring . Check your folder permissions','restore_error',$restore_id);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//call the copy function to copy the bridge folder files\n\t\t$copy_res = $this->tc_file_system_copy_dir($plugin_bridge_file_path, $root_bridge_file_path, true);\n\t\tif(!$copy_res)\n\t\t{\n\t\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n -----copy false------- \\n\",FILE_APPEND);\n $logger->log('Failed to Copying Downloaded files','restore_error',$restore_id);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//copy the files which the bridge will use\n\t\tforeach($files_other_than_bridge as $key => $value){\n\t\t\t$this->tc_file_system_copy($value, $root_bridge_file_path . '/' . $key, true);\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function copyToDeployDirectory() {\n $source = Variables::BinaryCompilationFilepath()->get();\n $targetDirectory = Variables::DeployDirectory()->get();\n $target = $targetDirectory . \"/\" . Variables::BinaryFilename()->get();\n copy( $source, $target);\n printf(\"Copying [%s] to [%s]\\n\", $source, $target);\n }", "public function directory_content() {\n\n\t\tbp_buffer_template_part( 'project-loop' );\n\n\t}", "public function prepare(){\n mkdir($this->runtimePath, 0755, true);\n shell_exec(\"cp -R \" . rtrim($this->path, \"/\") . \"/* \" . $this->runtimePath);\n }", "public function register_project_templates( $atts ) {\n\t\t// Create the key used for the themes cache\n\t\t$cache_key = 'page_templates-' . md5( get_theme_root() . '/' . get_stylesheet() );\n\t\t// Retrieve the cache list.\n\t\t// If it doesn't exist, or it's empty prepare an array\n\t\t$templates = wp_get_theme()->get_page_templates();\n\t\tif ( empty( $templates ) ) {\n\t\t\t$templates = array();\n\t\t}\n\t\t// New cache, therefore remove the old one\n\t\twp_cache_delete( $cache_key , 'themes');\n\t\t// Now add our template to the list of templates by merging our templates\n\t\t// with the existing templates array from the cache.\n\t\t$templates = array_merge( $templates, $this->templates );\n\t\t// Add the modified cache to allow WordPress to pick it up for listing\n\t\t// available templates\n\t\twp_cache_add( $cache_key, $templates, 'themes', 1800 );\n\t\treturn $atts;\n\t}", "public function createproject() {\r\n\r\n //Creating project \r\n $themeName = $this->request->getParam(\"theme\");\r\n $xml = $this->request->getParam(\"xml\");\r\n $this->theme = new Theme($themeName);\r\n $this->name = $this->request->getParam(\"name\");\r\n\r\n //1. Create project\r\n //2. Add templates and schemas\r\n //3. Add Server\r\n //4. Add Css, images and common\r\n //5. Add ximlet\r\n //6. Add document\r\n\r\n $nodeTypeName = \"Project\";\r\n $nodeType = new NodeType();\r\n $nodeType->SetByName($nodeTypeName);\r\n\r\n //Creating project\r\n $data = array(\r\n 'NODETYPENAME' => $nodeTypeName,\r\n 'NAME' => $this->name,\r\n 'NODETYPE' => $nodeType->GetID(),\r\n 'PARENTID' => 10000\r\n );\r\n\r\n $io = new BaseIO();\r\n $projectId = $io->build($data);\r\n if ($projectId < 1) {\r\n return false;\r\n }\r\n\r\n $xsparrowProject= new XSparrowProject();\r\n $projectToSearch = array($this->theme->projectName, $this->theme->version);\r\n $projectFound = $xsparrowProject->find(\"idproject\",\"name=%s AND version=%s\", $projectToSearch, MONO);\r\n \r\n if (is_array($projectFound) && count($projectFound)){\r\n $idXsparrowProject = $projectFound[0];\r\n $installedProject = new XSparrowInstalledProjects();\r\n \r\n $installedProject->set(\"idnode\",$projectId);\r\n $installedProject->set(\"idproject\", $idXsparrowProject);\r\n error_log(\"Se instalará: $projectId y $idXsparrowProject\");\r\n $installedProject->add();\r\n \r\n $servers = $this->theme->project->getServers();\r\n $schemas = $this->theme->project->getSchemes();\r\n $templates = $this->theme->project->getTemplates();\r\n \r\n foreach($schemas as $schema){\r\n $this->schemas = array_merge($this->schemas, $this->insertFiles($projectId, \"schemas\", array($schema)));\r\n }\r\n \r\n foreach($templates as $template){\r\n $this->insertFiles($projectId, \"templates\", array($template));\r\n }\r\n \r\n foreach ($servers as $server) {\r\n $this->insertServer($projectId, $server);\r\n }\r\n }\r\n \r\n $template = \"success\";\r\n\r\n $values = array();\r\n\r\n $this->render($values, $template, 'default-3.0.tpl');\r\n }", "protected function copyDefaultPrecommitToTestDirectory()\n {\n mkdir($this->path . '/hooks', 0777, true);\n shell_exec('cp -r hooks ' . $this->path);\n }", "public function copyClients() {\n $templates = array_reverse($this->config['templates'], true);\n foreach ($templates as $template => $a) {\n foreach (array('base', 'mobile') as $client) {\n if (file_exists(MB_TEMPLATES . '/' . $template . '/clients/' . $client)) {\n $this->copyMetaRecursive(MB_TEMPLATES . '/' . $template . '/clients/' . $client, $this->path . '/clients/' . $client);\n }\n }\n }\n }", "public function index() {\n\t\t$data['title'] = 'CodeIgniter Tiles Plugin Example';\n\t\t$data['meta_keywords'] = 'codeigniter, tiles, plugin';\n\t\t$data['meta_description'] = 'This page serves as an example showing the implementation of the CodeIgniter Tiles plugin by Drew Harvey.';\n\t\t\n\t\t$this->load->tile('test2', 'example/example_index.php', $data);\n\t\n\t}", "public function run()\n {\n $tags = Tag::all();\n $project = Project::factory()\n ->create([\n 'title' => 'Sitio público y privado',\n 'image' => 'public/diners-club-image.png',\n 'logo' => 'public/diners-club-logo.png',\n 'background' => '#223B82'\n ]);\n\n $this->setAttach($project, $tags);\n\n $project = Project::factory()\n ->create([\n 'title' => 'Sitio web 2017',\n 'image' => 'public/derco-image.png',\n 'logo' => 'public/derco-logo.png',\n 'background' => '#C92C3A'\n ]);\n\n $this->setAttach($project, $tags);\n\n $project = Project::factory()\n ->create([\n 'title' => 'TV App',\n 'image' => 'public/copec-image.png',\n 'logo' => 'public/copec-logo.png',\n 'background' => '#FFFFFF'\n ]);\n\n $this->setAttach($project, $tags);\n\n }", "public function run()\n {\n $dir = resource_path('views/components/partials');\n $partials = extractFiles($dir);\n foreach ($partials as $partial) {\n Partial::create($partial);\n }\n }", "private function copyDynamicFilesToViews ($files)\n { \n \n foreach ($files as $file) \n {\n $this->deleteDynamicFileIfExists ($file);\n\n $this->streamCopy($this->templateDisk, $file['name'], 'resources', 'views/' . $file['basename']);\n }\n\n }", "public function moveTemporaryTemplateToLive() {\n // Create cohesion:// templates if it doesn't exist.\n if (!file_exists(COHESION_TEMPLATE_PATH)) {\n \\Drupal::service('file_system')->mkdir(COHESION_TEMPLATE_PATH, 0777, FALSE);\n }\n\n $files = [];\n if (($templates = \\Drupal::keyValue('cohesion.temporary_template')->get('temporary_templates', []))) {\n\n foreach ($templates as $temp_template) {\n $template_file = COHESION_TEMPLATE_PATH . '/' . basename($temp_template);\n\n if (!file_exists($temp_template)) {\n continue;\n }\n\n if (($file = file_unmanaged_move($temp_template, $template_file, FILE_EXISTS_REPLACE))) {\n $files[] = $file;\n }\n else {\n drupal_set_message(t('Error moving @file', ['@file' => $temp_template]), 'error');\n }\n }\n\n // Reset temporary template list\n \\Drupal::keyValue('cohesion.temporary_template')->set('temporary_templates', []);\n }\n\n // Refresh some caches.\n drupal_flush_all_caches();\n\n return !empty($files) ? TRUE : FALSE;\n }", "function copy($new_name=false) {\r\n $this->initialise();\r\n $this->_copy_system($new_name);\r\n $this->_copy_persons();\r\n $this->_copy_groups();\r\n $this->_copy_group_assign();\r\n $this->_copy_group_members();\r\n $this->_copy_block_layouts();\r\n $this->_copy_components();\r\n $this->_copy_content_blocks();\r\n $this->_copy_ecl_tags();\r\n $this->_copy_field_templates();\r\n $this->_copy_payment_methods();\r\n $this->_copy_listtypes();\r\n $this->_copy_listdata();\r\n $this->_copy_category_assign();\r\n $this->_copy_mail();\r\n $this->_copy_navbutton_styles();\r\n $this->_copy_navsuites();\r\n $this->_copy_navbuttons();\r\n $this->_copy_layouts();\r\n $this->_copy_themes();\r\n $this->_copy_pages();\r\n $this->_copy_postings();\r\n $this->_remap_category_assigns();\r\n $this->_remap_group_assigns();\r\n $this->_remap_page_parents();\r\n// $this->copy_reports();\r\n return $this->_New_SystemID;\r\n }", "private function copy_language_files() {\n\t\t$_tests_dir = getenv( 'WP_TESTS_DIR' );\n\t\t$_from_dir = dirname( dirname( __FILE__ ) ) . '/languages';\n\t\t$_to_dir = $_tests_dir . '/data/languages';\n\n\t\t// Put ja_JP.mo file.\n\t\ttouch( $_to_dir . '/ja_JP.mo' );\n\n\t\t// Copy *-ja.mo then rename to *-ja_JP.mo .\n\t\tcopy( $_from_dir . '/combined-calendar-ja.mo', $_to_dir . '/plugins/combined-calendar-ja_JP.mo' );\n\t}", "public function copyMilestones()\n\t{\n\t\tforeach ($this->sourceMilestones as &$sourceMilestone) {\n\t\t\tif (!isset($sourceMilestone['destination_id'])) {\n\t\t\t\t$destinationMilestone = $this->addMilestone($this->destinationProject, $sourceMilestone);\n\t\t\t\t$sourceMilestone['destination_id'] = $destinationMilestone['id'];\n\t\t\t}\n\t\t}\n\t}", "public function testMoveToTmpDir()\n\t{\n\t\t$dir = $this->getDirectory();\n\n\t\t$wam_file = $this->wam->load($this->getFile());\n\t\t\n\t\t$params = $wam_file->getParams();\n\n\t\t$this->assertFileExists($wam_file->getTmpdir()->getRootPath() . '/' . $params['name']);\n\n\t\tcopy($wam_file->getTmpdir()->getRootPath() . '/' . $params['name'], __DIR__ . '/../../tmp/files/logo.jpg');\n\t\tchmod(__DIR__ . '/../../tmp/files/logo.jpg', 0777);\n\t}", "function wpai_wp_all_import_copy_uploaded_file_into_files_folder($copy_uploaded_files) {\n return $copy_uploaded_files;\n}", "protected static function updateLayoutViews(): void\n {\n File::deleteDirectory(resource_path('views/layouts'));\n File::copyDirectory(self::STUBSPATH.'/resources/views/layouts', resource_path('views/layouts'));\n }", "public function copyAction() {\r\n\t\t$extDir = ExtensionManagementUtility::extPath($this->extKey);\r\n\t\t$filename = $extDir.'Resources/Public/Contrib/Bootstrap/less/variables.less';\r\n\t\tif (file_exists($filename)) {\r\n\t\t\t$copyPath = GeneralUtility::getFileAbsFileName('fileadmin/BootstrapLessConfig/');\r\n\t\t\tif (!is_dir($copyPath)) GeneralUtility::mkdir($copyPath);\r\n\t\t\tif ( copy($filename,$copyPath.'variables_copy.less') && copy($filename,$copyPath.'variables_'.time().'.less') ) {\r\n\t\t\t\t$this->addFlashMessage('Success! Your configuration has been saved to fileadmin/BootstrapLessConfig/variables_copy.less & variables_'.time().'.less', '', AbstractMessage::OK);\r\n\t\t\t} else {\r\n\t\t\t\t$this->addFlashMessage('Copy failed', '', AbstractMessage::ERROR);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t $this->addFlashMessage('This file is not writable', '', AbstractMessage::ERROR);\r\n\t\t}\r\n\r\n\t\t$this->redirect('index');\r\n\t}", "function crear_subtiles($tile) {\r\n\r\n if( $tile->z >= 14 ){ return; }\r\n\r\n // Abre la zona en 4, duplicando x, y (siguiente nivel)\r\n $scope_x = $tile->x*2;\r\n $scope_y = $tile->y*2;\r\n $z = $tile->z + 1;\r\n\r\n for( $x=$scope_x; $x<=$scope_x+1; $x++ ) {\r\n for( $y=$scope_y; $y<=$scope_y+1; $y++ ) {\r\n\r\n if( ! R::findOne('tile', ' x = :x AND y = :y AND z = :z ', array(':x' => $x, ':y' => $y, ':z' => $z)) ) {\r\n // Crea este tile y todos los inferiores hasta el nivel 14\r\n $tile = R::dispense('tile');\r\n $tile->x = $x;\r\n $tile->y = $y;\r\n $tile->z = $z;\r\n\r\n if( ! $tile->get_zonas() ){ continue; }\r\n\r\n R::store($tile);\r\n crear_subtiles($tile);\r\n }\r\n\r\n }\r\n }\r\n}", "public function run()\n {\n\n\n \\DB::table('templates')->delete();\n\n \\DB::table('templates')->insert(array(\n 0 =>\n array(\n 'id' => 1,\n 'temp_name' => 'support',\n 'folder' => 'support',\n 'site_name' => 'main',\n 'is_active' => 0,\n 'is_deleted' => 0,\n 'userc_id' => NULL,\n 'useru_id' => NULL,\n 'userd_id' => NULL,\n 'deleted_at' => NULL,\n 'created_at' => NULL,\n 'updated_at' => '2019-10-23 17:09:13',\n ),\n 1 =>\n array(\n 'id' => 2,\n 'temp_name' => 'support new',\n 'folder' => 'supportNew',\n 'site_name' => 'test',\n 'is_active' => 1,\n 'is_deleted' => 0,\n 'userc_id' => NULL,\n 'useru_id' => NULL,\n 'userd_id' => NULL,\n 'deleted_at' => NULL,\n 'created_at' => NULL,\n 'updated_at' => '2019-10-23 17:09:13',\n ),\n ));\n }", "protected function installInertiaTeamStack()\n {\n // Directories...\n (new Filesystem)->ensureDirectoryExists(resource_path('js/Pages/Profile'));\n\n // Pages...\n (new Filesystem)->copyDirectory(__DIR__.'/../../../stubs/v4/inertia/resources/js/Pages/Teams', resource_path('js/Pages/Teams'));\n }", "public function postflight($type, $parent)\n {\n // $parent is the class calling this method\n // $type is the type of change (install, update or discover_install)\n \n\t // $parent is the class calling this method\n // $type is the type of change (install, update or discover_install)\n $dir = \"/components/com_joomshoppingzarrinpal/bank\";//\"path/to/targetFiles\";\n $dirNew = \"viejo2014\";//path/to/destination/files\n // Open a known directory, and proceed to read its contents\n \n //copy('foo/test.php', 'bar/test.php');\n \n jimport('joomla.filesystem.folder'); \n jimport( 'joomla.filesystem.file' );\n \n //change this to the name of the folder you want to create\n $newfolder = 'pm_zarinpal';\n\n if(JFolder::create( '../components/com_jshopping/payments/' . $newfolder)) { \n //duplicate the line below as many times as you want for each file you want to move\n \n }\n\t\t\n\t\tJFolder::move(JPATH_ROOT.DS.\"components/com_joomshoppingzarrinpal/bank/lib\", JPATH_ROOT.DS.\"components/com_jshopping/payments/pm_zarinpal/lib\");\n \n $filename = '../components/com_joomshoppingzarrinpal/bank/paymentform.php';\n \n\t$newfile ='../components/com_jshopping/payments/pm_zarinpal/paymentform.php';\n\tJFile::copy($filename, $newfile);\n\t\n\t $filename = '../components/com_joomshoppingzarrinpal/bank/adminparamsform.php';\n \n\t$newfile ='../components/com_jshopping/payments/pm_zarinpal/adminparamsform.php';\n\tJFile::copy($filename, $newfile);\n\n $filename = '../components/com_joomshoppingzarrinpal/bank/pm_zarinpal.php';\n \n\t$newfile ='../components/com_jshopping/payments/pm_zarinpal/pm_zarinpal.php';\n\tJFile::copy($filename, $newfile);\n\t\n\t\n\t$filename = '../components/com_joomshoppingzarrinpal/bank/finish.php';\n \n\t$newfile ='../components/com_jshopping/templates/default/checkout/finish.php';\n\tJFile::copy($filename, $newfile);\n\n\t \n\t \n\t \n }", "public function build_all() {\n $this->make_dir();\n $this->make_img_dir();\n }", "public static function recloneAll()\n {\n $universeDir = \"/myphp/universe\";\n $baseUrl = \"https://github.com/lingtalfi\";\n $planetDirs = PlanetTool::getPlanetDirs($universeDir);\n\n ini_set(\"max_execution_time\", 0);\n foreach ($planetDirs as $planetDir) {\n\n $galaxyDir = dirname($planetDir);\n\n $pInfo = PlanetTool::getGalaxyNamePlanetNameByDir($planetDir);\n if (false !== $pInfo) {\n list($galaxy, $planet) = $pInfo;\n echo \"parsing $planet<br>\";\n\n FileSystemTool::remove($planetDir);\n $cmd = \"cd \\\"$galaxyDir\\\"; git clone $baseUrl/$planet.git\";\n passthru($cmd);\n } else {\n a(\"invalid planet dir: $planetDir\");\n }\n }\n }", "function shiftnav_backup_custom_assets(){\n\n\t$custom_dir = trailingslashit( SHIFTNAV_DIR ).'custom/';\n\n\t$custom_css = $custom_dir.'custom.css';\n\tif( file_exists( $custom_css ) ){\n\t\tshiftnav_backup_file( $custom_css , 'custom.css' , 'css' );\n\t}\n\n\t$custom_less = $custom_dir.'custom.less';\n\tif( file_exists( $custom_less ) ){\n\t\tshiftnav_backup_file( $custom_less , 'custom.less' , 'less' );\n\t}\n\n\t$custom_js = $custom_dir.'custom.js';\n\tif( file_exists( $custom_js ) ){\n\t\tshiftnav_backup_file( $custom_js , 'custom.js' , 'js' );\n\t}\n\n}", "protected function _concatenateTiles($tiles)\r\n\t{\r\n\t\t$height = count($tiles) * $this->_tileSource->getTileWidth();\r\n\t\t$width = count($tiles[0]) * $this->_tileSource->getTileHeight();\r\n\t\t$imageHandler = $this->_tileSource->getImageHandler();\r\n\t\t$mapImage = $imageHandler->createImage($width, $height);\r\n\t\t$y = 0;\r\n\t\t$firstTile = $tiles[0][0];\r\n\t\tforeach ($tiles as $rowKey => $row) {\r\n\t\t\t$x = 0;\r\n\t\t\tforeach ($row as $tileKey => $tile) {\r\n\t\t\t\timagecopy($mapImage, $tile->getImage(), $x, $y, 0, 0, $this->_tileSource->getTileWidth(),\r\n\t\t\t\t$this->_tileSource->getTileHeight());\r\n\t\t\t\t$x += $this->_tileSource->getTileWidth();\r\n\t\t\t}\r\n\t\t\t$y += $this->_tileSource->getTileHeight();\r\n\t\t}\r\n\t\t$map = new Map($mapImage);\r\n\t\t$leftUp = $firstTile->getLeftUpCorner();\r\n\t\t$map->setLeftUpCorner($leftUp['lon'], $leftUp['lat']);\r\n\t\t$map->setWorldMap($this->_worldMap);\r\n\t\t$map->setImageHandler($this->_tileSource->getImageHandler());\r\n\t\treturn $map;\r\n\t}", "protected function copyHomepageViewToApplication()\n {\n $target = $this->__DIR__ . '/../../../views/installer/index-post-install.blade.php';\n $source = $this->base_path . '/resources/views/homepage.blade.php';\n\n if (!$this->File->exists($source))\n {\n $this->File->copy($target, $source);\n }\n }", "public function duplicate() {\n $admins = $this->getAdmins();\n $admin_ids = array();\n foreach($admins as $admin) {\n $admin_ids[] = $admin;\n }\n\n // Retrieve the design\n $blocks = array();\n foreach($this->getBlocks() as $block) {\n $blocks[] = $block->getData();\n }\n $layout_id = $this->getLayoutId();\n\n // Load the options\n $option_values = $this->getOptions();\n $value_ids = array();\n\n // Save the new application\n $old_app_id = $this->getId();\n $this->setId(null)\n ->setName($this->getName() . \" (Copy)\")\n ->setLayoutId($layout_id)\n ->unsCreatedAt()\n ->unsUpdatedAt()\n ->setBundleId(null)\n ->setDomain(null)\n ->setSubdomain(null)\n ->setSubdomainIsValidated(null)\n ->save()\n ;\n\n // Save the design\n if(!empty($blocks)) {\n foreach($blocks as $template_block) {\n $block = new Template_Model_Block();\n $block->setData($template_block);\n $block->setAppId($this->getId());\n $block->save();\n }\n }\n $this->setLayoutId($layout_id)\n ->save();\n\n // Copy all the features but folders\n foreach($option_values as $option_value) {\n if($option_value->getCode() != 'folder') {\n $option_value->copyTo($this);\n $value_ids[$option_value->getOldValueId()] = $option_value->getId();\n }\n }\n\n // Copy the folders\n foreach($option_values as $option_value) {\n if($option_value->getCode() == 'folder') {\n $option_value->copyTo($this);\n $value_ids[$option_value->getOldValueId()] = $option_value->getId();\n }\n }\n\n // Lock the features\n $locker = new Padlock_Model_Padlock();\n $old_locked_value_ids = $locker->getValueIds($old_app_id);\n $locked_value_ids = array();\n foreach($old_locked_value_ids as $old_locked_value_id) {\n if(!empty($value_ids[$old_locked_value_id])) {\n $locked_value_ids[] = $value_ids[$old_locked_value_id];\n }\n }\n\n if(!empty($locked_value_ids)) {\n $locker->setValueIds($locked_value_ids)\n ->saveValueIds($this->getId())\n ;\n }\n\n // Set the accounts to the application\n $this->setAdminIds($admin_ids);\n $this->save();\n\n return $this;\n\n }", "public function copyStaticFiles()\n {\n $exclude = ['js', 'javascripts', 'stylesheets', 'less', 'sass'];\n\n // Include the excludes from the config\n $exclude = array_merge($exclude, (array) $this->app->getSetting('exclude', []));\n\n // Create pattern\n $pattern = '/\\\\.(' . implode(\"|\", $exclude) . ')$/';\n\n // Get list of files & directories to copy\n $to_copy = (array) $this->app->getSetting('copy', []);\n\n // Assets folder is hardcoded into copy\n $to_copy = array_merge(['assets'], $to_copy);\n $to_copy = array_unique($to_copy);\n\n // Initialize file system\n $filesystem = new Filesystem();\n\n // Fire event\n if ($response = Event::fire('copy.before', [$this, $to_copy])) {\n $to_copy = $response[0];\n }\n\n // Copy\n foreach ($to_copy as $location) {\n $fileInfo = new \\SplFileInfo($this->source . DIRECTORY_SEPARATOR . $location);\n\n // Copy a complete directory\n if ($fileInfo->isDir()) {\n $finder = new Finder();\n $finder->files()\n ->exclude($exclude)\n ->notName($pattern)\n ->in($this->source . DIRECTORY_SEPARATOR . $location);\n\n foreach ($finder as $file) {\n $path = $location . DIRECTORY_SEPARATOR . $file->getRelativePathname();\n echo \"$path\\n\";\n $source = $file->getRealPath();\n $target = $this->target . DIRECTORY_SEPARATOR . $path;\n\n $filesystem->copy($source, $target);\n\n $this->app->writeln(\"Copied: <info>$path</info>\");\n }\n } // Copy Single File\n else {\n $filesystem->copy($fileInfo->getRealPath(), $this->target . DIRECTORY_SEPARATOR . $location);\n $this->app->writeln(\"Copied: <info>$location</info>\");\n }\n }\n }", "public function register_project_templates( $atts ) {\n\n\t\t// Create the key used for the themes cache\n\t\t$cache_key = 'page_templates-' . md5( get_theme_root() . '/' . get_stylesheet() );\n\n\t\t// Retrieve the cache list.\n\t\t// If it doesn't exist, or it's empty prepare an array\n\t\t$templates = wp_get_theme()->get_page_templates();\n\t\tif ( empty( $templates ) ) {\n\t\t\t$templates = [];\n\t\t}\n\n\t\t// New cache, therefore remove the old one\n\t\twp_cache_delete( $cache_key, 'themes' );\n\n\t\t// Now add our template to the list of templates by merging our templates\n\t\t// with the existing templates array from the cache.\n\t\t$templates = array_merge( $templates, $this->templates );\n\n\t\t// Add the modified cache to allow WordPress to pick it up for listing\n\t\t// available templates\n\t\twp_cache_add( $cache_key, $templates, 'themes', 1800 );\n\n\t\treturn $atts;\n\n\t}", "public function run() {\r\n $this->temporaryFiles();\r\n }", "public function run()\n {\n $this->createProject('samsung', '#004ba2');\n $this->createProject('omo', '#ea0000');\n $this->createProject('popeyes', '#fe7900');\n $this->createProject('organist', '#002310');\n $this->createProject('the glenlivet', '#4f2a38');\n }", "public function run()\n {\n $directory = resource_path('views/pages');\n $files = array_values(array_diff(scandir($directory), ['.', '..']));\n foreach($files as $file){\n Page::create([\n 'name' => str_replace('.blade.php' , '' , $file),\n 'slug' => $file,\n 'path' => 'pages/',\n\n ]);\n }\n }", "public function copyFilesAction()\n {\n if (!is_readable($this->sourceDir)) {\n throw new Exception($this->sourceDir.\" must be readable\");\n }\n\n if (!is_writeable($this->targetDir)) {\n throw new Exception($this->targetDir.\" must be writable\");\n }\n\n $this->say($this->getActionsCount().\". Copying files...\");\n\n if (empty($this->items)) {\n throw new Exception(\"Please specify files for deployment in your \"\n .$this->configPath);\n }\n\n foreach($this->items as $file) {\n\n $srcItemName = $this->sourceDir.DIRECTORY_SEPARATOR.$file;\n $dstItemName = $this->targetDir.DIRECTORY_SEPARATOR.$file;\n $this->verbose ? $this->say($srcItemName.\" to \".$dstItemName):false;\n if (!file_exists($srcItemName)) {\n $this->say(\"File not found:\". $srcItemName);\n }\n if (is_dir($srcItemName)) {\n $this->recDirCopy($srcItemName, $dstItemName);\n }\n\n if (is_file($srcItemName)) {\n $this->recFileCopy($srcItemName, $dstItemName);\n\n }\n }\n\n $this->verbose ? $this->say(\"Files successfully copied from \"\n .$this->sourceDir.\" to \".$this->targetDir) : \n $this->sayYes(\"Done\");\n\n\n }", "protected function execute(InputInterface $input, OutputInterface $output)\n\t{\n\t\t$cwd = getcwd();\n\n\t\t$this->xcopy(__DIR__ . '/templates', $cwd . '/templates');\n\n\t\tcopy(__DIR__ . '/generator.json', $cwd . '/generator.json');\n\n\t\t$output->writeln('Finished copying template and generator.json, happy customizing!');\n\t}", "public function testCopy()\n {\n $i = FileManager::getInstance();\n $this->assertEquals(1, $i->copy(\n __DIR__ . DIRECTORY_SEPARATOR . \"foc\",\n __DIR__ . DIRECTORY_SEPARATOR . \"moved/foc\",\n \"directory\"\n ));\n $this->assertTrue(is_dir(__DIR__ . DIRECTORY_SEPARATOR . \"moved/foc\"));\n $this->assertEquals(1, $i->create(__DIR__ . DIRECTORY_SEPARATOR . \"blue.txt\", \"file\"));\n $this->assertEquals(1, $i->copy(\n __DIR__ . DIRECTORY_SEPARATOR . \"blue.txt\",\n __DIR__ . DIRECTORY_SEPARATOR . \"moved/blue.txt\",\n \"file\"\n ));\n $this->assertTrue(file_exists(__DIR__ . DIRECTORY_SEPARATOR . \"moved/blue.txt\"));\n $this->assertEquals(1, $i->create(__DIR__ . DIRECTORY_SEPARATOR . \"oncopy\", \"directory\"));\n $this->assertTrue(is_dir(__DIR__ . DIRECTORY_SEPARATOR . \"oncopy\"));\n $this->assertEquals(1, $i->create(__DIR__ . DIRECTORY_SEPARATOR . \"oncopy/red.txt\", \"file\"));\n $this->assertEquals(1, $i->create(__DIR__ . DIRECTORY_SEPARATOR . \"oncopy/orange.txt\", \"file\"));\n $this->assertTrue(file_exists(__DIR__ . DIRECTORY_SEPARATOR . \"oncopy/red.txt\"));\n $this->assertTrue(file_exists(__DIR__ . DIRECTORY_SEPARATOR . \"oncopy/orange.txt\"));\n $this->assertEquals(1, $i->copy(\n __DIR__ . DIRECTORY_SEPARATOR . \"oncopy\",\n __DIR__ . DIRECTORY_SEPARATOR . \"moved/oncopy\",\n \"directory\"\n ));\n $this->assertTrue(is_dir(__DIR__ . DIRECTORY_SEPARATOR . \"moved/oncopy\"));\n $this->assertTrue(file_exists(__DIR__ . DIRECTORY_SEPARATOR . \"moved/oncopy/red.txt\"));\n $this->assertTrue(file_exists(__DIR__ . DIRECTORY_SEPARATOR . \"moved/oncopy/orange.txt\"));\n $this->assertEquals(1, $i->create(__DIR__ . DIRECTORY_SEPARATOR . \"oncopysyms\", \"directory\"));\n $this->assertTrue(is_dir(__DIR__ . DIRECTORY_SEPARATOR . \"oncopysyms\"));\n $this->assertEquals(1, $i->copy(\n __DIR__ . DIRECTORY_SEPARATOR . \"oncopysyms\",\n __DIR__ . DIRECTORY_SEPARATOR . \"moved/oncopysyms\",\n \"directory\",\n true\n ));\n $this->assertTrue(is_link(__DIR__ . DIRECTORY_SEPARATOR . \"moved/oncopysyms\"));\n\n $this->assertEquals(1, $i->create(__DIR__ . DIRECTORY_SEPARATOR . \"iumio.txt\", \"file\"));\n $this->assertTrue(file_exists(__DIR__ . DIRECTORY_SEPARATOR . \"iumio.txt\"));\n $this->assertEquals(1, $i->copy(\n __DIR__ . DIRECTORY_SEPARATOR . \"iumio.txt\",\n __DIR__ . DIRECTORY_SEPARATOR . \"moved/iumio.txt\",\n \"file\",\n true\n ));\n $this->assertTrue(is_link(__DIR__ . DIRECTORY_SEPARATOR . \"moved/iumio.txt\"));\n }", "private function copyPublicRootFiles()\n {\n $source = [\n \"{$this->basePath}resources{$this->ds}manifest.json\",\n \"{$this->basePath}resources{$this->ds}serviceworker.js\",\n ];\n $destination = \"public{$this->ds}\";\n $this->copyFilesFromSource($source, $destination);\n }", "public function run()\n {\n $dir = resource_path('views/components');\n $components = extractFiles($dir , ['.' , '..' , 'blocks' , 'layouts' , 'partials']);\n foreach ($components as $component) {\n Component::create($component);\n }\n }", "private function copyFavicons()\n {\n $source = \"{$this->basePath}resources{$this->ds}images{$this->ds}favicons\";\n $destination = \"public{$this->ds}images{$this->ds}favicons\";\n $this->copyFilesFromSource($source, $destination);\n }", "public function run()\n {\n DB::table('templates')->insert([\n 'logo' => 'logo.png',\n 'logo_title' => 'logo_title.png',\n 'logo_auth' => 'logo_auth.png'\n ]);\n }", "public function run()\n {\n $projects = factory(App\\Models\\Project::class, 5)->create()->each(function($post){\n $post->images()->save(factory(App\\Models\\ProjectImage::class)->create(['id_project' => $post->id]));\n $post->images()->save(factory(App\\Models\\ProjectImage::class)->create(['id_project' => $post->id]));\n $post->images()->save(factory(App\\Models\\ProjectImage::class)->create(['id_project' => $post->id]));\n $post->images()->save(factory(App\\Models\\ProjectImage::class)->create(['id_project' => $post->id]));\n $post->images()->save(factory(App\\Models\\ProjectImage::class)->create(['id_project' => $post->id]));\n $post->images()->save(factory(App\\Models\\ProjectImage::class)->create(['id_project' => $post->id]));\n });\n }", "protected function copyPublicAssets()\n {\n $target = $this->__DIR__ . '/../../../../public';\n $source = $this->public_path . '/packages/devisephp/cms';\n $this->File->copyDirectory($target, $source);\n }", "protected function taskCopy()\n {\n if ($this->view !== 'pages') {\n return false;\n }\n\n if (!$this->authorizeTask('copy page', ['admin.pages', 'admin.pages.create', 'admin.super'])) {\n return false;\n }\n\n try {\n $pages = $this->admin::enablePages();\n\n // Get the current page.\n $original_page = $this->admin->page(true);\n\n // Find new parent page in order to build the path.\n $parent = $original_page->parent() ?: $pages->root();\n // Make a copy of the current page and fill the updated information into it.\n $page = $original_page->copy($parent);\n\n $order = 0;\n if ($page->order()) {\n $order = $this->getNextOrderInFolder($page->parent()->path());\n }\n\n // Make sure the header is loaded in case content was set through raw() (expert mode)\n $page->header();\n\n if ($page->order()) {\n $page->order($order);\n }\n\n $folder = $this->findFirstAvailable('folder', $page);\n $slug = $this->findFirstAvailable('slug', $page);\n\n $page->path($page->parent()->path() . DS . $page->order() . $folder);\n $page->route($page->parent()->route() . '/' . $slug);\n $page->rawRoute($page->parent()->rawRoute() . '/' . $slug);\n\n // Append progressive number to the copied page title\n $match = preg_split('/(\\d+)(?!.*\\d)/', $original_page->title(), 2, PREG_SPLIT_DELIM_CAPTURE);\n $header = $page->header();\n if (!isset($match[1])) {\n $header->title = $match[0] . ' 2';\n } else {\n $header->title = $match[0] . ((int)$match[1] + 1);\n }\n\n $page->header($header);\n $page->save(false);\n\n $redirect = $this->view . $page->rawRoute();\n $header = $page->header();\n\n if (isset($header->slug)) {\n $match = preg_split('/-(\\d+)$/', $header->slug, 2, PREG_SPLIT_DELIM_CAPTURE);\n $header->slug = $match[0] . '-' . (isset($match[1]) ? (int)$match[1] + 1 : 2);\n }\n\n $page->header($header);\n\n $page->save();\n\n Cache::clearCache('invalidate');\n\n // DEPRECATED: page\n $this->grav->fireEvent('onAdminAfterSave', new Event(['object' => $page, 'page' => $page]));\n\n // Enqueue message and redirect to new location.\n $this->admin->setMessage($this->admin::translate('PLUGIN_ADMIN.SUCCESSFULLY_COPIED'), 'info');\n $this->setRedirect($redirect);\n\n } catch (\\Exception $e) {\n throw new \\RuntimeException('Copying page failed on error: ' . $e->getMessage());\n }\n\n return true;\n }", "public function run()\n {\n $count = 10;\n\n for ($i = 0; $i < $count; $i++) {\n $project = new Project;\n $project->name = 'Hoa văn đại việt '.$i;\n $project->aim_money = 1000000000;\n $project->summary = 'Hoa văn Đại Việt (với tiêu đề Sách tô màu cho người lớn) là nhan đề một đồ án \"vector hóa\"[1] các họa tiết trang trí cổ truyền Việt Nam, do nhóm Đại Việt Cổ Phong khởi xướng và thực hiện trong thời kỳ 2015-7.';\n $project->content = 'Hoa văn Đại Việt (với tiêu đề Sách tô màu cho người lớn) là nhan đề một đồ án \"vector hóa\"[1] các họa tiết trang trí cổ truyền Việt Nam, do nhóm Đại Việt Cổ Phong khởi xướng và thực hiện trong thời kỳ 2015-7.';\n $project->thumbnail = 'http://homestead.test/images/default.jpg';\n $project->user_id = 1;\n $project->save();\n }\n }", "public function copy()\n\t{\n\t\t$title = $this->getTitle();\n\t\t$questions = $this->getPageLayout();\n\t\t$oldId = $this->getId();\n\n\t\t// Save new\n\t\t$this->id = null;\n\t\t$id = $this->getId();\n\t\t$this->setTitle($title);\n\n\t\t$base = $this->base . $oldId;\n\n\t\t// Copy actual files\n\t\tif (is_dir($base))\n\t\t{\n\t\t\t// Scan for versions\n\t\t\t$versions = array();\n\t\t\t$dirs = scandir($base);\n\t\t\tforeach ($dirs as $dir)\n\t\t\t{\n\t\t\t\tif (is_numeric($dir) && is_dir($base . DS . $dir) && $dir != '.' && $dir != '..')\n\t\t\t\t{\n\t\t\t\t\t$versions[] = $dir;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($versions))\n\t\t\t{\n\t\t\t\t$base .= DS . max($versions);\n\t\t\t}\n\n\t\t\t\\Filesystem::copyDirectory($base, $this->base . $id);\n\t\t}\n\n\t\t// Copy questions\n\t\t$this->setPageLayout($questions);\n\n\t\t// Copy deployment (only most recent)\n\t\ttry\n\t\t{\n\t\t\t$dep = PdfFormDeployment::latestFromFormId($oldId);\n\t\t\t$dep->setId(null);\n\t\t\t$dep->setFormId($id);\n\t\t\t$dep->genNewCrumb();\n\t\t\t$dep->save();\n\n\t\t\t// Return the deployment crumb\n\t\t\treturn $dep->getCrumb();\n\t\t}\n\t\tcatch (\\Hubzero\\Error\\Exception\\RuntimeException $e)\n\t\t{\n\t\t\t// Just return the form id\n\t\t\treturn $id;\n\t\t}\n\t}", "public function all() {\n // Clear folder before generating\n $this->clearFolder();\n\n // Copy assets folder\n $this->copyAssets();\n\n // Intialize variables\n $files = [];\n $posts = $this->core->component('database')->table('posts')->select(['published' => '1'])->selected();\n\n // Generate Homepage\n $index = $this->core->component('pages')->home();\n $this->core->component('file')->save('public/index.html', $index);\n $files[] = 'index.html';\n\n // Apply pagination if enabled\n if ($this->core->setting('pagination') == 'yes') {\n $steps = $this->core->setting('pagination_steps');\n if (!is_numeric($steps)) {\n $steps = 20;\n }\n\n $num = count($posts);\n \n // Create new pages while there are still posts left\n for ($i = 1; ($i * $steps) < $num; $i++) {\n $page = $this->core->component('pages')->home($i);\n $this->core->component('file')->save('public/home-' . $i . '.html', $page);\n $files[] = 'home-' . $i . '.html';\n\n // Stop if $i bigger 200 - there is probably an error\n if ($i > 200) {\n echo \"Oh! We couldn't generate your blog as there was an error while generating:<br />\";\n echo \"There were over 200 home pages to generate - this is probably an error.<br />\";\n echo \"Journal has stopped generating new files to save your webserver from crashing.<br />\";\n echo \"Debugging Info: <br />\";\n var_dump($i, $steps, $num, is_numeric($steps), $this->core->version);\n exit();\n }\n }\n }\n\n // Generate Posts\n foreach($posts as $post) {\n $page = $this->core->component('pages')->post($post);\n $path = $this->core->component('url')->get($post);\n\n $this->core->component('file')->save('public/' . $path, $page);\n $files[] = $path;\n }\n\n // Generate RSS Feed\n $index = $this->core->component('pages')->feed();\n $this->core->component('file')->save('public/feed.xml', $index);\n $files[] = 'feed.xml';\n\n // Generate info.json\n $info = [\n 'generator' => 'Journal',\n 'last_update' => time(),\n 'files' => $files\n ];\n $this->core->component('file')->save('public/info.json', json_encode($info));\n }", "public function run()\n {\n Project_path::create([\n 'code' => 'SCHEME',\n 'folder_path' => 'http://',\n 'status' => '1'\n ]);\n Project_path::create([\n 'code' => 'HOST',\n 'folder_path' => 'sitco.homeip.net/',\n 'status' => '1'\n ]);\n Project_path::create([\n 'code' => 'BASE',\n 'folder_path' => 'fukai',\n 'status' => '1'\n ]);\n Project_path::create([\n 'code' => 'IMG',\n 'folder_path' => 'img/',\n 'status' => '1'\n ]);\n Project_path::create([\n 'code' => 'JS',\n 'folder_path' => 'js/',\n 'status' => '1'\n ]);\n Project_path::create([\n 'code' => 'CSS',\n 'folder_path' => 'css/',\n 'status' => '1'\n ]);\n Project_path::create([\n 'code' => 'POST_CREATE',\n 'folder_path' => 'st-inc/post_create.php',\n 'status' => '1'\n ]);\n Project_path::create([\n 'code' => 'POST_EDIT',\n 'folder_path' => 'st-inc/post_edit.php',\n 'status' => '1'\n ]);\n Project_path::create([\n 'code' => 'POST_DEL',\n 'folder_path' => 'st-inc/post_del.php',\n 'status' => '1'\n ]);\n Project_path::create([\n 'code' => 'POSTS',\n 'folder_path' => 'content/posts/',\n 'status' => '1'\n ]);\n }", "public function run()\n {\n collect($this->templateList())->each(function (array $template){\n $title = \\Illuminate\\Support\\Arr::get($template, 'title');\n $i = \\Illuminate\\Support\\Arr::get($template, 'id');\n \\App\\Models\\Template::create([\n 'title' => $title,\n 'slug' => \\Illuminate\\Support\\Str::slug($title),\n 'description' => \\Illuminate\\Support\\Arr::get($template, 'description'),\n 'price' => \\Illuminate\\Support\\Arr::get($template, 'price'),\n 'thumbnail' => \"/storage/templates/template-{$i}.png\",\n 'file_name' => \"template-{$i}\",\n ]);\n });\n }", "function createParcialBackupFolder_Panels(){\n $ID_User=$this->session->idusu;\n $Fname=date(\"d:m:Y H:i:s\").\"-\".$ID_User.\"-\".\"Panels\";\n mkdir(\"./backups/$Fname\");\n\n $this->generateBoardsJson($Fname);\n $this->generateCellJson($Fname);\n $this->generateGroupBoardsJson($Fname);\n $this->generatePictogramsJson($Fname);\n $this->generatePictogramsLanguageJson($Fname);\n $this->generateRBoardCellJson($Fname);\n $this->createParcialBackupFolder_Pictograms();\n}", "public function run()\n {\n $projects = [\n [\n 'name' => 'Doctype Admin',\n 'excerpt' => 'Doctype Admin Panel',\n 'description' => '',\n 'image' => 'uploads/website/project/project1-1602405773.jpg'\n ],\n [\n 'name' => 'Doctype Admin',\n 'excerpt' => 'Doctype Admin Panel',\n 'description' => '',\n 'image' => 'uploads/website/project/project2-1602405792.jpg'\n ],\n [\n 'name' => 'Doctype Admin',\n 'excerpt' => 'Doctype Admin Panel',\n 'description' => '',\n 'image' => 'uploads/website/project/project6-1602405829.jpg'\n ],\n ];\n\n foreach ($projects as $project) {\n Project::create($project);\n }\n }", "protected static function updateLayoutViews()\n {\n // copy new one from your stubs folder\n static::copyDirectory('resources/views/layouts', resource_path('views/layouts'));\n static::copyDirectory('resources/views/pages', resource_path('views/pages'));\n }", "protected function copyFiles()\n {\n $this->logger->log(\"Copying files\\n\");\n \n $count = 0;\n foreach ($this->filesToCopy as $srcFile=>$dstFile) {\n \n $srcFile = str_replace('//', '/', $srcFile);\n $dstFile = str_replace('//', '/', $dstFile);\n \n if(!is_dir(dirname($dstFile)))\n mkdir(dirname($dstFile), 0775, true);\n if(!is_readable($srcFile)) {\n $this->warnings[] = 'Failed to copy file: ' . $srcFile;\n $this->logger->log('Failed to copy file: ' . $srcFile . \"\\n\");\n } else if(copy($srcFile, $dstFile)) {\n $this->logger->log(\"Copied file \" . $srcFile . \" to \" . $dstFile . \"\\n\");\n $count ++;\n }\n }\n \n $this->logger->log(\"$count files copied.\\n\");\n }", "public function run()\n {\n $categories = ['3d', 'design', 'branding', 'drawing', 'painting', 'photography', 'webdesign'];\n $dest = 'public/img/upload/';\n\n foreach ($categories as $key => $category)\n {\n $path = 'public/img/model/' . $category;\n if(is_dir($path))\n {\n $handle = opendir($path);\n while (($file = readdir($handle)) !== false)\n {\n if ($file != '.' && $file != '..' && $file != '.DS_Store')\n {\n $extension = pathinfo($file, PATHINFO_EXTENSION);\n $options = [\n 'jpg',\n 'JPG',\n 'jpeg',\n 'JPEG',\n 'png',\n 'PNG'\n ];\n\n if (in_array($extension, $options))\n {\n $title = str_slug(basename($file, \".\".$extension));\n $filename = $file;\n\n copy($path . '/' . $filename, $dest . $filename);\n\n DB::table('images')->insert([\n 'user_id' => rand(1, 3),\n 'category_id' => $key+1,\n 'title' => $title,\n 'filename' => $filename,\n 'description' => Str::random(50),\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }\n }\n }\n closedir($handle);\n }\n }\n }", "public function liveToTemp() {\n $from = $this->getStyleSheetFilename('json', TRUE);\n $to = $this->getStyleSheetFilename('json');\n if (file_exists($from)) {\n file_unmanaged_move($from, $to, FILE_EXISTS_REPLACE);\n }\n }", "private function load_files() {\n \n require PREMIUM_ADDONS_PATH . 'includes/templates/classes/config.php';\n \n require PREMIUM_ADDONS_PATH . 'includes/templates/classes/assets.php';\n \n require PREMIUM_ADDONS_PATH . 'includes/templates/classes/manager.php';\n\n require PREMIUM_ADDONS_PATH . 'includes/templates/types/manager.php';\n\n require PREMIUM_ADDONS_PATH . 'includes/templates/classes/api.php';\n \n }", "public function copyFiles($dirs)\n {\n // copy module settings and template\n $src = __DIR__ . '/../files/modules/*';\n shell_exec(\"cp -rn $src {$dirs['modules']}\");\n }", "private function _makeTagMapFiles()\n {\n $cacheFolder = $this->directoryTags;\n if (!is_dir($cacheFolder)) {\n $this->makeDirRecursive($cacheFolder);\n }\n\n if (empty($this->tags)) {\n $this->tags[] = '___global';\n }\n\n foreach ($this->tags as $tag) {\n $cacheFile = $this->_getTagMapPathByName($tag);\n if (!is_file($cacheFile)) {\n //WAS $save = @file_put_contents($cacheFile, json_encode([]));\n $this->cacheHandler->writeToCache($cacheFile, json_encode([]));\n// if (!$save) {\n// @file_put_contents($cacheFile, json_encode([]));\n// }\n }\n }\n }", "public function registerProjectTemplates($atts)\n {\n //create the key used for the themes cache\n $cache_key = 'page_templates-'.md5(get_theme_root().'/'.get_stylesheet());\n\n // Retrieve the cache list and save in $templates.\n // If it doesnt exist, or it's empty, prepare an array to hold custom templates\n $templates = wp_get_theme()->get_page_templates();\n if (empty($templates)) {\n $templates = array();\n }\n\n // We will create a New cache, therefore remove the old one\n wp_cache_delete($cache_key, 'themes');\n\n // Now Add our template to the list of templates by merging our templates\n // with the existing templates array from the cache\n $templates = array_merge($templates, $this->templates);\n\n // Now, Add a new cache whicn includes the default theme templates and\n // our custom template to allow WordPress pick it up when Listing all available templates\n wp_cache_add($cache_key, $templates, 'themes', 1800);\n\n return $atts;\n }", "function mapContent() {\r\n\t\t$path = substr(t3lib_div::_GP('id'), strlen(PATH_site));\r\n\t\t\r\n\t\tif(preg_match('/\\:/', t3lib_div::_GP('id'))) {\r\n\t\t\t$parr = explode(':', t3lib_div::_GP('id'));\r\n\t\t\t$path = 'fileadmin'.$parr[1];\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($_GET['SLCMD']['SELECT']['txdamFolder'])) {\r\n\t\t\t$patharr = array_keys($_GET['SLCMD']['SELECT']['txdamFolder']);\r\n\t\t\t$path = $patharr[0];\r\n\t\t\t$path = str_replace(PATH_site, '', $path);\r\n\t\t}\r\n\t\t\r\n\t\tif ( $path == \"\" || ! is_dir(PATH_site . $path) ) {\r\n\t\t\t$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('err'), $GLOBALS['LANG']->getLL('choos_dir'), 0, 1);\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\tif ( $path[strlen($path)-1] != '/' ) { $path .= '/'; }\r\n\t\t\r\n\t\t$db =& $GLOBALS['TYPO3_DB'];\r\n\t\t$content = '';\r\n\t\t$template = file_get_contents( MODULE_DIR.'/templates/template_map.html' );\r\n\t\t$add_part = $this->cObj->getSubpart( $template, '###ADD_PART###' );\r\n\t\t$list_part = $this->cObj->getSubpart( $template, '###LIST_PART###' );\r\n\t\t$list_item = $this->cObj->getSubpart( $template, '###LIST_ITEM###' );\r\n\r\n\t\tswitch ( t3lib_div::_GP('action') ) {\r\n\t\t\tcase 'add':\r\n\t\t\t\tif ( trim(t3lib_div::_GP('name')) === '' ) {\r\n\t\t\t\t\tif ( ! ( $res = $db->exec_SELECTquery('count(*)', 'tx_mwimagemap_map', '') ) || ! ( $row = $db->sql_fetch_row($res) ) ) {\r\n\t\t\t\t\t\tif ( $_FILES['usr_file']['tmp_name'] ) { unlink( $_FILES['usr_file']['tmp_name'] ); }\r\n\t\t\t\t\t\t$content .= 'exec_SELECT sql_error: '.$db->sql_error().'<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$name = 'map_'.($row[0]+1);\r\n\t\t\t\t}\r\n\t\t\t\telse { $name = trim(t3lib_div::_GP('name')); }\r\n\t\t\t\tif ( is_uploaded_file($_FILES['usr_file']['tmp_name']) ) {\r\n\t\t\t\t\tif ( ! $_FILES['usr_file']['name'] || $_FILES['usr_file']['error'] ) {\r\n\t\t\t\t\t\tif ( $_FILES['usr_file']['tmp_name'] ) { unlink( $_FILES['usr_file']['tmp_name'] ); }\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('err_upload1').'<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( $_FILES['usr_file']['size'] > 1000000 ) {\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('err_file_size').'<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$file = str_replace(' ', '-', $_FILES['usr_file']['name']);\r\n\t\t\t\t\tif ( ! ( $res = $db->exec_SELECTquery('id', 'tx_mwimagemap_map', 'file = '.$db->fullQuoteStr($file, 'tx_mwimagemap_map').' and folder = '.$db->fullQuoteStr($path, 'tx_mwimagemap_map') ) ) ) {\r\n\t\t\t\t\t\t$content .= 'exec_SELECT sql_error: '.$db->sql_error().'<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( $db->sql_fetch_row($res) ) {\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('err_file_exists').'<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( $file[0] == 't' && $file[1] == '_' ) {\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('ilegal_filename').'<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( is_file( PATH_site . $path . $file ) ) { unlink( PATH_site . $path . $file ); }\r\n\t\t\t\t\tif ( ! move_uploaded_file($_FILES['usr_file']['tmp_name'], PATH_site . $path . $file) ) {\r\n\t\t\t\t\t\t$content .= 'move_uploaded_file NOT successful<br />'.$_FILES['usr_file']['tmp_name'].','. PATH_site . $path . $file.'<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( ! is_file(PATH_site . $path . $file) ) {\r\n\t\t\t\t\t\t$content .= '! is_file('.PATH_site . $path . $file.')<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( is_file(PATH_site . $path . $file) ) { t3lib_div::fixPermissions(PATH_site . $path . $file); }\r\n\t\t\t\t\t$new_file = TRUE;\r\n\t\t\t\t}\r\n\t\t\t\telseif ( t3lib_div::_GP('use_pic') ) {\r\n\t\t\t\t\t$new_file = FALSE;\r\n\t\t\t\t\tif ( ! ( $res = $db->exec_SELECTquery('file', 'tx_mwimagemap_map', 'id='.intval(t3lib_div::_GP('use_pic')).' AND folder='.$db->fullQuoteStr($path, 'tx_mwimagemap_map') ) ) ) {\r\n\t\t\t\t\t\t$content .= 'exec_SELECT sql_error:'.$db->sql_error().'<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( ! ( $row = $db->sql_fetch_row($res) ) ) {\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('nofile');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$file = $row[0];\r\n\t\t\t\t}\r\n\t\t\t\telseif ( t3lib_div::_GP('use_file') ) {\r\n\t\t\t\t\t$new_file = FALSE;\r\n\t\t\t\t\tif ( is_file(PATH_site . $path . t3lib_div::_GP('use_file')) ) { $file = t3lib_div::_GP('use_file'); }\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('nofile');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('nofile');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif ( ! $db->exec_INSERTquery('tx_mwimagemap_map', array( 'file' => $file, 'name' => $name, 'folder' => $path ) ) ) {\r\n\t\t\t\t\t$content .= 'exec_INSERT sql_error: '.$db->sql_error().'<br />';\r\n\t\t\t\t\tif ( $new_file ) { unlink(PATH_site . $path . $file); }\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$mid = $db->sql_insert_id();\r\n\t\t\t\t$use_map = intval(t3lib_div::_GP('use_map'));\r\n\t\t\t\tif ( $new_file ) { $this->create_thumb($file, $path); }\r\n\t\t\t\tif ( $use_map != 0 ) {\r\n\t\t\t\t\tif ( ! ( $res = $db->exec_SELECTquery('*', 'tx_mwimagemap_area', 'mid = '.$use_map) ) ) {\r\n\t\t\t\t\t\t$content .= 'exec_SELECT sql_error: '.$db->sql_error().'<br />could not create a copy of the selected imagemap<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\twhile ( $row = $db->sql_fetch_assoc($res) ) {\r\n\t\t\t\t\t\t$row['mid'] = $mid;\r\n\t\t\t\t\t\t$old_aid = $row['id'];\r\n\t\t\t\t\t\tunset($row['id']);\r\n\t\t\t\t\t\tif ( ! $db->exec_INSERTquery('tx_mwimagemap_area', $row) ) {\r\n\t\t\t\t\t\t\t$content .= 'exec_INSERT sql_error: '.$db->sql_error().'<br />could not create a proper copy of the selected imagemap<br />';\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$aid = $db->sql_insert_id();\r\n\t\t\t\t\t\tif ( ! ( $res1 = $db->exec_SELECTquery('*', 'tx_mwimagemap_point', 'aid = '.$old_aid) ) ) {\r\n\t\t\t\t\t\t\t$content .= 'exec_SELECT sql_error: '.$db->sql_error().'<br />could not create a\tproper copy of the selected imagemap<br />';\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\twhile ( $row = $db->sql_fetch_assoc($res1) ) {\r\n\t\t\t\t\t\t\t$row['aid'] = $aid;\r\n\t\t\t\t\t\t\tunset($row['id']);\r\n\t\t\t\t\t\t\tif ( ! $db->exec_INSERTquery('tx_mwimagemap_point', $row) ) {\r\n\t\t\t\t\t\t\t\t$content .= 'exec_INSERT sql_error: '.$db->sql_error().'<br />could not create a proper copy of the selected imagemap<br />';\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$this->createFePics(intval($mid), 0);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'del':\r\n\t\t\t\t$this->deleteFePics(intval(t3lib_div::_GP('map_id')));\r\n\t\t\t\tif ( ! ( $res = $db->exec_SELECTquery( 'file', 'tx_mwimagemap_map', 'id = '.intval(t3lib_div::_GP('map_id')).' AND folder='.$db->fullQuoteStr($path, 'tx_mwimagemap_map') ) )\r\n\t\t\t\t\t|| ! ( $row = $db->sql_fetch_row($res) ) ) {\r\n\t\t\t\t\t$content .= 'Fatal db error, deleting \\''.t3lib_div::_GP('map_id').'\\' not successfull<br />sql_error:'.$db->sql_error().'<br />';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif ( ! ( $res = $db->exec_SELECTquery( 'id', 'tx_mwimagemap_map', 'file = \\''.$row[0].'\\' AND folder = '.$db->fullQuoteStr($path, 'tx_mwimagemap_map') ) ) ) {\r\n\t\t\t\t\t$content .= 'Fatal db error, deleting \\''.t3lib_div::_GP('map_id').'\\' not successfull<br />sql_error:'.$db->sql_error().'<br />';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif ( $db->sql_num_rows($res) == 1 && t3lib_div::_GP('del_unused') == 'on' ) {\r\n\t\t\t\t\tunlink(PATH_site . $path . $row[0]);\r\n\t\t\t\t\tunlink(PATH_site.'typo3temp/tx_mwimagemap/'.md5($path.$row[0]));\r\n\t\t\t\t}\r\n\t\t\t\tif (\t! ( $res = $db->exec_SELECTquery('id', 'tx_mwimagemap_area', 'mid = '.intval(t3lib_div::_GP('map_id')) ) ) ) {\r\n\t\t\t\t\t$content .= 'db error, sql_error: '.$db->sql_error.'<br />imagemap might be not deleted completly!<br />';\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\twhile ( $row = $db->sql_fetch_row($res) ) {\r\n\t\t\t\t\t\tif ( ! $db->exec_DELETEquery( 'tx_mwimagemap_point', 'aid = '.$row[0] ) ) { $content .= 'sql_error:'.$db->sql_error().'<br />'; }\r\n\t\t\t\t\t\tif ( ! $db->exec_DELETEquery( 'tx_mwimagemap_area', 'mid = '.intval(t3lib_div::_GP('map_id')) ) ) {\r\n\t\t\t\t\t\t\t$content .= 'sql_error:'.$db->sql_error().'<br />';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( ! $db->exec_DELETEquery('tx_mwimagemap_map', 'id = '.intval(t3lib_div::_GP('map_id'))) ) { $content .= 'sql_error:'.$db->sql_error().'<br />'; }\r\n\t\t\t\t$this -> checkFecache();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'chg_name':\r\n\t\t\t\t$file = '';\r\n\t\t\t\tif ( is_uploaded_file($_FILES['usr_file']['tmp_name']) ) {\r\n\t\t\t\t\tif ( ! $_FILES['usr_file']['name'] || $_FILES['usr_file']['error'] ) {\r\n\t\t\t\t\t\tif ( $_FILES['usr_file']['tmp_name'] ) { unlink( $_FILES['usr_file']['tmp_name'] ); }\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('err_upload1').'<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( $_FILES['usr_file']['size'] > 1000000 ) {\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('err_file_size').'<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$afile = str_replace(' ', '-', $_FILES['usr_file']['name']);\r\n\t\t\t\t\tif ( ! ( $res = $db->exec_SELECTquery('id', 'tx_mwimagemap_map', 'file = '.$db->fullQuoteStr($afile, 'tx_mwimagemap_map').' and folder = '.$db->fullQuoteStr($path, 'tx_mwimagemap_map') ) ) ) {\r\n\t\t\t\t\t\t$content .= 'exec_SELECT sql_error: '.$db->sql_error().'<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( $db->sql_fetch_row($res) ) {\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('err_file_exists').'<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( $afile[0] == 't' && $afile[1] == '_' ) {\r\n\t\t\t\t\t\t$content .= $GLOBALS['LANG']->getLL('ilegal_filename').'<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( is_file( PATH_site . $path . $afile ) ) { unlink( PATH_site . $path . $afile ); }\r\n\t\t\t\t\tif ( ! move_uploaded_file($_FILES['usr_file']['tmp_name'], PATH_site . $path . $afile) ) {\r\n\t\t\t\t\t\t$content .= 'move_uploaded_file NOT successfull<br />'.$_FILES['usr_file']['tmp_name'].','. PATH_site . $path . $afile.'<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( ! is_file(PATH_site . $path . $afile) ) {\r\n\t\t\t\t\t\t$content .= '! is_file('.PATH_site . $path . $afile.')<br />';\r\n\t\t\t\t\t\tunlink($_FILES['usr_file']['tmp_name']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( is_file(PATH_site . $path . $afile) ) { t3lib_div::fixPermissions(PATH_site . $path . $afile); }\r\n\t\t\t\t\t$file = $afile;\r\n\t\t\t\t}\r\n\t\t\t\t$name = trim(t3lib_div::_GP('name'));\r\n\t\t\t\tif ( $file != '' ) {\r\n\t\t\t\t\tif ( ! ( $res = $db->exec_SELECTquery('file', 'tx_mwimagemap_map', 'id = '.intval(t3lib_div::_GP('map_id')).' AND folder='.$db->fullQuoteStr($path, 'tx_mwimagemap_map') ) ) ) {\r\n\t\t\t\t\t\tunlink( PATH_site . $path . $_FILES['usr_file']['name'] );\r\n\t\t\t\t\t\t$content .= 'exec_SELECT sql_error: '.$db->sql_error().'<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( ! ( $row = $db->sql_fetch_row($res) ) ) {\r\n\t\t\t\t\t\tunlink( PATH_site . $path . $_FILES['usr_file']['name'] );\r\n\t\t\t\t\t\t$content .= 'error occured, action aborted<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( ! ( $res = $db->exec_SELECTquery('id', 'tx_mwimagemap_map', 'file= \"'.$row[0].'\" AND folder='.$db->fullQuoteStr($path, 'tx_mwimagemap_map') ) ) ) {\r\n\t\t\t\t\t\tunlink( PATH_site . $path . $_FILES['usr_file']['name'] );\r\n\t\t\t\t\t\t$content .= 'exec_SELECT sql_error: '.$db->sql_error().'<br />';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( $db->sql_num_rows($res) == 1 && t3lib_div::_GP('del_unused') == 'on' ) { $do_unlink = TRUE; }\r\n\t\t\t\t\telse { $do_unlink = FALSE; }\r\n\t\t\t\t}\r\n\t\t\t\tif ( $name != '' || $file != '' ) {\r\n\t\t\t\t\t$res = array();\r\n\t\t\t\t\tif ( $name != '' ) { $res['name'] = $name; }\r\n\t\t\t\t\tif ( $file != '' ) { $res['file'] = $file; }\r\n\t\t\t\t\tif ( !$db->exec_UPDATEquery( 'tx_mwimagemap_map', 'id = '.intval(t3lib_div::_GP('map_id')).' AND folder='.$db->fullQuoteStr($path, 'tx_mwimagemap_map'), $res ) ) {\r\n\t\t\t\t\t\tunlink( PATH_site . $path . $_FILES['usr_file']['name'] );\r\n\t\t\t\t\t\t$content .= 'chg_name sql_error: '.$db->sql_error();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( $file != '' ) {\r\n\t\t\t\t\t\t$this->create_thumb($file, $path);\r\n\t\t\t\t\t\tif ( $do_unlink ) {\r\n\t\t\t\t\t\t\t@unlink(PATH_site . $path . $row[0]);\r\n\t\t\t\t\t\t\t@unlink(PATH_site.'typo3temp/tx_mwimagemap/'.md5($path.$row[0]));\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\t$this->createFePics(intval(t3lib_div::_GP('map_id')), 0);\r\n\t\t\t\t$this -> checkFecache();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif ( $content ) { $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('err'), $content, 0, 1); }\r\n\t\t\t$content = '';\r\n\r\n\t\t\tpreg_match('/(.*?)\\/(typo3|typo3conf)\\/ext\\//i', $_SERVER['SCRIPT_URL'], $match);\r\n\t\t\t$mA['###TYPO3_PATH###'] = $match[1];\r\n\r\n\t\t\t$markerArray['###MAP_NAME###'] = $GLOBALS['LANG']->getLL('Map Name');\r\n\t\t\t$markerArray['###PICTURE###'] = $GLOBALS['LANG']->getLL('Picture');\r\n\t\t\t$markerArray['###ADD_SUBMIT###'] = $GLOBALS['LANG']->getLL('Add');\r\n\t\t\t$markerArray['###USE_PICTURE###'] = $GLOBALS['LANG']->getLL('use_pic');\r\n\t\t\t$markerArray['###OPTIONS###'] = '';\r\n\t\t\t$markerArray['###USE_MAP###'] = $GLOBALS['LANG']->getLL('use_map');\r\n\t\t\t$markerArray['###USE_FILE###'] = $GLOBALS['LANG']->getLL('use_file');\r\n\t\t\t$markerArray['###PATHID###'] = t3lib_div::_GP('id');\r\n\r\n\t\t\t$i = 0;\r\n\t\t\t$res = $db->exec_SELECTquery('id, file, name', 'tx_mwimagemap_map', 'folder='.$db->fullQuoteStr($path, 'tx_mwimagemap_map') );\r\n\t\t\t$mA['###L_DEL###'] = $GLOBALS['LANG']->getLL('del');\r\n\t\t\t$mA['###L_SAVE###'] = $GLOBALS['LANG']->getLL('save');\r\n\t\t\t$mA['###NEW_PICTURE###'] = $GLOBALS['LANG']->getLL('new_pic');\r\n\t\t\t$mA['###DEL_UNUSED###'] = $GLOBALS['LANG']->getLL('del_unused');\r\n\t\t\t$files = array();\r\n\t\t\twhile ( $row = $db->sql_fetch_row($res) ) {\r\n\t\t\t\tif ( ! file_exists(PATH_site.$path.$row[1]) ) { continue; }\r\n\t\t\t\tif ( ! is_file(PATH_site.'typo3temp/tx_mwimagemap/'.md5($path.$row[1])) ) { $this->create_thumb($row[1], $path); }\r\n\t\t\t\t$tw = 5;\r\n\t\t\t\t$isize = getimagesize(PATH_site.'typo3temp/tx_mwimagemap/'.md5($path.$row[1]));\r\n\t\t\t\tif(isset($isize[0]) ) { $tw = $isize[0]; }\r\n\t\t\t\t\r\n\t\t\t\t$mA['###ID###'] = $row[0];\r\n\t\t\t\t$mA['###NAME###'] = $row[2];\r\n\t\t\t\t$mA['###PATHID###'] = t3lib_div::_GP('id');\r\n\t\t\t\t$mA['###SRC###'] = t3lib_div::getIndpEnv('TYPO3_SITE_URL').'typo3temp/tx_mwimagemap/'.md5($path.$row[1]);\r\n\t\t\t\t$mA['###TW###'] = $tw;\r\n\t\t\t\t\r\n\t\t\t\t$content .= '<td>'.$this->cObj->substituteMarkerArray($list_item, $mA).'</td>';\r\n\t\t\t\t$markerArray['###OPTIONS###'] .= '<option value=\"'.$row[0].'\">'.$row[2].'</option>';\r\n\t\t\t\t$files[] = $row[1];\r\n\t\t\t}\r\n\r\n\t\t\t$markerArray['###FILE_OPTIONS###'] = '';\r\n\t\t\tif ( $dh = opendir(PATH_site . $path) ) {\r\n\t\t\t\twhile ( $dir = readdir($dh) ) {\r\n\t\t\t\t\tif ( $dir == '.' || $dir == '..' ) continue;\r\n\t\t\t\t\tif ( strpos($dir, '.png') !== strlen($dir) - 4 && strpos($dir, '.jpg') !== strlen($dir) - 4 && strpos($dir, '.jpeg') !== strlen($dir) - 5 && strpos($dir, '.gif') !== strlen($dir) - 4 )\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif ( strpos($dir, 't_') === 0 ) $tmp = substr($dir, 2);\r\n\t\t\t\t\telse $tmp = $dir;\r\n\t\t\t\t\tif ( in_array( $tmp, $files ) ) continue;\r\n\t\t\t\t\t$markerArray['###FILE_OPTIONS###'] .= '<option>'.$dir.'</option>';\r\n\t\t\t\t}\r\n\t\t\t\tclosedir($dh);\r\n\t\t\t}\r\n\r\n\t\t\t$markerArray['###CREATEMAP###'] = $GLOBALS['LANG']->getLL('upload_pic');\r\n\t\t\t$markerArray['###L_SHOWOPTIONS###'] = $GLOBALS['LANG']->getLL('show options');\r\n\t\t\t$markerArray['###L_HIDEOPTIONS###'] = $GLOBALS['LANG']->getLL('hide options');\r\n\t\t\t\r\n\t\t\t$this->content .= $this->cObj->substituteMarkerArray($add_part, $markerArray);\r\n\t\t\t\r\n\t\t\tif(strlen($content) != 0) {\r\n\t\t\t\t$this->content .= $this->cObj->substituteMarkerArray($list_part, array(\r\n\t\t\t\t'###LIST###' => $content,\r\n\t\t\t\t'###EIM###' => $GLOBALS['LANG']->getLL('eim'),\r\n\t\t\t\t'###DELIMG1###' => $GLOBALS['LANG']->getLL('delimg1'),\r\n\t\t\t\t'###DELIMG2###' => $GLOBALS['LANG']->getLL('delimg2'),\r\n\t\t\t\t'###ERROC###' => $GLOBALS['LANG']->getLL('erroc'),\r\n\t\t\t\t'###CONTACTION###' => $GLOBALS['LANG']->getLL('contaction'),\r\n\t\t\t\t'###L_SHOWOPTIONS###' => $GLOBALS['LANG']->getLL('show options'),\r\n\t\t\t\t'###L_HIDEOPTIONS###' => $GLOBALS['LANG']->getLL('hide options')\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}", "public function run() {\n Post::truncate();\n\n // delete old files before seeding\n File::delete(File::glob(storage_path('app/public') . '/images/posts/*.jpg'));\n\n $faker = Factory::create();\n\n // getting template images\n $files = collect(File::glob(storage_path('app/public') . '/images/templates/posts/*.jpg'));\n\n for ($i = 1; $i <= 1500; $i++) {\n $post = Post::create([\n 'title' => $faker->sentence(6),\n 'slug' => $faker->slug(5),\n 'description' => $faker->sentence(100),\n 'content' => $faker->sentence(500),\n 'status' => mt_rand(0, 1)\n ]);\n\n // around 25% of posts will be without image\n if (mt_rand(0, 3)) {\n Storage::disk('public')->copy('images/templates/posts/' . basename($files->random()), 'images/posts/' . $post->id . '.jpg');\n }\n }\n }", "public function wordCopyWizard()\n {\n $projects = Project::orderBy('title', 'ASC')->pluck('title', 'id_project')->all();\n return view('user.modules.tool.wizard', compact('projects'));\n }", "public function run()\n {\n $projects = [\n [\n 'id' => '1',\n 'area_id' => '1',\n 'target_id' => '1',\n ],\n [\n 'id' => '2',\n 'area_id' => '2',\n 'target_id' => '1',\n ],\n [\n 'id' => '3',\n 'area_id' => '1',\n 'target_id' => '2',\n ],\n ];\n\n foreach ($projects as $project) {\n\n DB::table('projects')->insert([\n 'id' => $project['id'],\n 'area_id' => $project['area_id'],\n 'target_id' => $project['target_id'],\n ]);\n }\n }", "protected function create_screenshots_directory() {\n\t\tmkdir( base_path( 'tests/browser/screenshots' ), 0755, true );\n\n\t\tfile_put_contents(\n\t\t\tbase_path( 'tests/browser/screenshots/.gitignore' ),\n\t\t\t$this->get_gitignore()\n\t\t);\n\t}", "public function cache()\n\t{\n\t\t//var_dump($this->app->dir->copy('/var/www/test', '/var/www/test-copy'));\n\t\tvar_dump($this->app->dir->delete('/var/www/test-copy'));\n\t\tdie;\n\n\t\t//$libraries = $this->app->dir->getDirs($this->app->libraries_path . 'css');\n\t\t$libraries = $this->app->dir->getFiles($this->app->libraries_path . 'css');\n\t\tprint_r($libraries);\n\t\tdie;\n\t\tforeach ($libraries as $library) {\n\t\t}\n\t}", "function copy_as($id,$new_tplan_id,$tplan_name=null,$tproject_id=null,$user_id=null,\r\n $options=null,$mappings=null)\r\n {\r\n $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;\r\n\r\n $cp_methods = array('copy_milestones' => 'copy_milestones',\r\n 'copy_user_roles' => 'copy_user_roles',\r\n 'copy_platforms_links' => 'copy_platforms_links',\r\n 'copy_attachments' => 'copy_attachments');\r\n\r\n $mapping_methods = array('copy_platforms_links' => 'platforms');\r\n\r\n $my['options'] = array();\r\n\r\n // Configure here only elements that has his own table.\r\n $my['options']['items2copy']= array('copy_tcases' => 1,'copy_milestones' => 1, 'copy_user_roles' => 1, \r\n 'copy_builds' => 1, 'copy_platforms_links' => 1, \r\n 'copy_attachments' => 1, 'copy_priorities' => 1);\r\n\r\n $my['options']['copy_assigned_to'] = 0;\r\n $my['options']['tcversion_type'] = null;\r\n\r\n $my['options'] = array_merge($my['options'], (array)$options);\r\n \r\n $safe['new_tplan_id'] = intval($new_tplan_id);\r\n\r\n // get source testplan general info\r\n $rs_source=$this->get_by_id($id);\r\n \r\n if(!is_null($tplan_name))\r\n {\r\n $sql=\"/* $debugMsg */ UPDATE \".$this->db->get_table('nodes_hierarchy').\" \" .\r\n \"SET name='\" . $this->db->prepare_string(trim($tplan_name)) . \"' \" .\r\n \"WHERE id=\" . $safe['new_tplan_id'];\r\n $this->db->exec_query($sql);\r\n }\r\n \r\n if(!is_null($tproject_id))\r\n {\r\n $sql=\"/* $debugMsg */ UPDATE \".$this->db->get_table('testplans').\" SET testproject_id={$tproject_id} \" .\r\n \"WHERE id=\" . $safe['new_tplan_id'];\r\n $this->db->exec_query($sql);\r\n }\r\n\r\n // copy builds and tcversions out of following loop, because of the user assignments per build\r\n // special measures have to be taken\r\n $build_id_mapping = null;\r\n if($my['options']['items2copy']['copy_builds']) \r\n {\r\n $build_id_mapping = $this->copy_builds($id,$safe['new_tplan_id']);\r\n }\r\n\r\n // Important Notice:\r\n // Since the addition of Platforms, test case versions are linked to Test Plan AND Platforms\r\n // this means, that not matter user choice, we will force Platforms COPY.\r\n // This is a lazy approach, instead of complex one that requires understand what Platforms\r\n // have been used on SOURCE Test Plan.\r\n //\r\n // copy test cases is an special copy\r\n if( $my['options']['items2copy']['copy_tcases'] )\r\n {\r\n $my['options']['items2copy']['copy_platforms_links'] = 1;\r\n $this->copy_linked_tcversions($id,$new_tplan_id,$user_id,$my['options'],$mappings, $build_id_mapping);\r\n }\r\n\r\n foreach( $my['options']['items2copy'] as $key => $do_copy )\r\n {\r\n if( $do_copy )\r\n {\r\n if( isset($cp_methods[$key]) )\r\n {\r\n $copy_method=$cp_methods[$key];\r\n if( isset($mapping_methods[$key]) && isset($mappings[$mapping_methods[$key]]))\r\n {\r\n $this->$copy_method($id,$new_tplan_id,$mappings[$mapping_methods[$key]]);\r\n }\r\n else\r\n {\r\n $this->$copy_method($id,$new_tplan_id);\r\n } \r\n }\r\n }\r\n }\r\n }", "private function syncSuites()\n\t{\n\t\t$this->sourceSuites = $this->getSuites($this->sourceProject);\n\t\t$this->destinationSuites = $this->getSuites($this->destinationProject);\n\n\t\t$this->deleteOrphanedSuites();\n\t\t$this->matchSuites();\n\t\t$this->copySuites();\n\t}", "public function initializeTiles() {\n\t\tfor($y = 1; $y <= $this->aSize['y']; $y++) {\n\t\t\tfor($x = 1; $x <= $this->aSize['x']; $x++) {\n\n\t\t\t\t$sUuid = \\A4\\Map\\TileUtility::getUuid($x, $y);\n\t\t\t\t$oTile = \\A4\\Factory::get(\\A4\\Map\\Tile::class)\n\t\t\t\t\t->setUuid($sUuid)\n\t\t\t\t\t->setX($x)\n\t\t\t\t\t->setY($y);\n\n\t\t\t\t$this->addTile($oTile);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}" ]
[ "0.668832", "0.60669106", "0.5942049", "0.59072894", "0.58192414", "0.57863134", "0.57116055", "0.57075214", "0.5665444", "0.56511855", "0.5575456", "0.555965", "0.55449426", "0.5523673", "0.551347", "0.5487688", "0.5486043", "0.53768367", "0.536572", "0.53627986", "0.53598636", "0.53528214", "0.5347974", "0.53378314", "0.53165275", "0.53093946", "0.5293565", "0.52801037", "0.52728444", "0.5260034", "0.5253021", "0.52390146", "0.5195621", "0.5194993", "0.51553", "0.51477766", "0.5137753", "0.5136496", "0.5133312", "0.5120057", "0.51174283", "0.5104295", "0.510216", "0.50936025", "0.5090973", "0.5086564", "0.50839996", "0.5072004", "0.5071172", "0.5056705", "0.5054555", "0.5051613", "0.5050195", "0.50472796", "0.50472486", "0.50444174", "0.5036867", "0.5035516", "0.5035497", "0.5020801", "0.5015994", "0.50136226", "0.50070876", "0.5007062", "0.50019544", "0.49963984", "0.49894074", "0.4987297", "0.49817273", "0.49783766", "0.4964805", "0.49605495", "0.49570096", "0.49535608", "0.49514255", "0.4950893", "0.49508414", "0.4946708", "0.4942508", "0.49215215", "0.49182454", "0.49172738", "0.49076968", "0.49072766", "0.4906899", "0.49067423", "0.49008486", "0.48952988", "0.48924768", "0.48918533", "0.48905215", "0.4889423", "0.48852238", "0.4884845", "0.4876718", "0.48698232", "0.48675436", "0.4856834", "0.4855049", "0.48548067" ]
0.82459825
0
Get the image filename based on it's size.
Получить имя файла изображения в зависимости от его размера.
private function getFilename(string $size) { return $size == 'original' ? $this->original_filename : $this->filename; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getName($size=null) {\n\t\t$name = md5($this->source);\n\t\tif ($size === null) {\n\t\t\t$size = $this->size;\n\t\t}\n\t\treturn $name.'-'.$size[0].'-'.$size[1].'.png';\n\t}", "public function GetImageFile($size = 'default')\n\t{\treturn $this->ImageFileDirectory($size) . '/' . (int)$this->id .'.png';\n\t}", "public function getImagePathname($size = 'thumb')\n\t{\n\t\tif ($image = $this->image)\n\t\t{\n\t\t\treturn $image->getSize($size)->getPathname();\n\t\t}\n\n\t\t// Return placeholder by default.\n\t\treturn '/images/person.png';\n\t}", "public function getFileName() {\n\t\treturn $this->getAsString('image');\n\t}", "public function getImageName(){\n return basename($this->imageUrl);\n }", "public function GetImageFile($size = 'default')\n\t{\treturn $this->ImageFileDirectory($size) . '/' . (int)$this->details['ccid'] .'.png';\n\t}", "public function getFilename(){\n return isset($this->imgFilename) ? $this->imgFilename : '';\n }", "function getFilename($width = 0, $height = 0) {\n\t\t\tif ($width == 0 && $height == 0)\n\t\t\t\treturn $this->filename;\n\n\t\t\t// Create a filename based on the original\n\t\t\t// filename, but including the size and the type\n\t\t\t// of resize performed (only \"crop\" supported\n\t\t\t// now), and always use the JPG extension.\n\t\t\t$filename = substr_replace($this->filename, '', -4);\n\t\t\t$filename .= '_' . $width . 'x' . $height;\n\t\t\t$filename .= '_crop';\n\t\t\t$filename .= '.jpg';\n\n\t\t\tif (!file_exists(self::ROOT_PATH . $filename))\n\t\t\t\t$this->resizeTo($width, $height, self::ROOT_PATH . $filename);\n\n\t\t\treturn $filename;\n\t\t}", "public function getImageFilename () {}", "public function getImageFilename()\n\t{\n\t\treturn $this->getWorkflowFilename(self::WORKFLOW_IMAGE_EXTENSION);;\n\t}", "function MakePicFileBaseName($id, $size)\n{\n $f = PicFolderFromSize($size) . '/pic_' . sprintf(\"%06u\", $id) . \".jpg\";\n return $f;\n}", "function PicPathName($id, $size)\n{\n global $config;\n $f = MakePicFileBaseName($id, $size);\n return $config[\"UploadDir\"] . \"pics/\". $f;\n}", "public function get_avatar_filename($uid, $size = 'min')\n {\n $uid = abs(intval($uid));\n $uid = sprintf('%\\'09d', $uid);\n\n return substr($uid, -2) . '_avatar_' . $size . '.jpg';\n }", "public function getImageBaseName() {\n return (string) md5(uniqid() . time());\n }", "public function GetImageName()\r\n {\r\n $value = null;\r\n\r\n if ($handle = opendir('movie_images')) {\r\n $lookFor = $this->_id . '.';\r\n $len = strlen($lookFor);\r\n while (false !== ($file = readdir($handle)))\r\n {\r\n if(substr($file, 0, $len) == $lookFor)\r\n {\r\n $value = 'movie_images/' . $file;\r\n break;\r\n }\r\n }\r\n closedir($handle);\r\n }\r\n \r\n return $value;\r\n\r\n }", "public function getSmallImageFilename()\n\t{\n\t\treturn $this->getWorkflowFilename(self::WORKFLOW_SMALL_IMAGE_EXTENSION);;\n\t}", "public function getFilename() {\n return 'ui-ej-boss-'. $this->urlSlug.'.png';\n }", "public function getThumbnailFileName() {\n\t\treturn $this->getAsString('thumbnail');\n\t}", "private function genFilename($size = 16) {\n\t\tdo {\n\t\t\t// Generate random filename\n\t\t\tdo {\n\t\t\t\t$bytes = openssl_random_pseudo_bytes($size, $cstrong);\n\t\t\t} while(!$cstrong);\n\t\t\t$filename = bin2hex($bytes);\n\n\t\t}while($this->fileExists($filename));\n\n\t\treturn $filename;\n\t}", "public function getWaveImageFileName()\n {\t\n \treturn RYiiPath::changeExtension($this->file_name, 'png');\n }", "public function generate_filename(){\n\t\t\t$md5 = md5(microtime() * time());\n\n\t\t\t$filename = $md5 . \".jpg\";\n\n\t\t\treturn $filename;\n\t\t}", "protected function filename()\n {\n return basename($this->path);\n }", "protected function getAvatarName()\n {\n return md5($this->model->id) . '.jpg';\n }", "public function generateImageName()\r\n {\r\n return md5(rand(1, 9999999)).'.jpg';\r\n }", "public function getMainImage($size = 'original')\n {\n\t if($this->images)\n\t {\n\t\t $imagesPath = Yii::app()->request->getBaseUrl(true).'/media/'.Mark::getFolderName($this->mark_id).'/'.$this->id.'/';\n\t\t $imageName = $this->images[0]->link;\n\t }\n\t else\n\t {\n\t\t $imagesPath = Yii::app()->request->getBaseUrl(true).'/media/default/';\n\t\t $imageName = 'auto-rasevic-pale-default-image.jpg';\n\t }\n\n if($size == 'thumbnail')\n $imagesPath .= 'slider/';\n else if ($size == 'slider')\n $imagesPath .= 'slider/';\n else\n $imagesPath .= 'original/';\n\n return $imagesPath.$imageName;\n\n }", "protected function _getFileName($data)\n {\n $fileName = 'image';\n if (isset($data['file_name']) && $data['file_name']) {\n $fileName = $data['file_name'];\n }\n $fileName .= '.' . $this->_getExtensionByMimeType($data['file_mime_type']);\n return $fileName;\n }", "static function get_image_filename ( $name ) {\t\t\n\t\t$ext = array_pop(explode( '.', $name ));\t\t\t\t\n\t\t$ext = strtolower ( $ext );\n\t\tif( $ext == 'jpg' || $ext == 'jpeg' ) $ext = 'jpg';\n\t\telseif( $ext == 'gif' )\t$ext = 'gif';\n\t\telseif( $ext == 'png' ) $ext = 'png';\t\t\t\n\t\telseif ( $ext == 'swf' ) $ext = 'swf';\n\t\telse return ''; // неизвестный тип файла\n\t\treturn substr(md5(uniqid(rand(), true)), 0, rand(15, 20)).'.'.$ext;\n\t}", "public function getFileName() {\n $info = $this->getPathInfo();\n if(isset($info['filename'])) {\n return $info['filename'];\n }\n \n return '';\n }", "public function getFileName() {\r\n $info = pathinfo($this->path);\r\n return $info['filename'];\r\n }", "function imagesize($imgfile,$type){\n\tif(!empty($imgfile)){\n\t\t$filetype = strtolower(substr($imgfile, strrpos($imgfile, '.') + 1));\n\t\t$basename = substr($imgfile, 0, strrpos($imgfile, '.') );\n\t\t$filename = $basename.$type.\".\".$filetype;\n\t\treturn $filename;\n\t}\n}", "protected function image_size_field( $size ) {\n\n\t\t\treturn ( isset( $size ) ? $size[0] . 'x' . $size[1] : '' );\n\t\t}", "public function getLargeFilePath()\r\n\t{\r\n\t\treturn $this->getProducerPath() . $this->image_large;\r\n\t}", "public function getFilename(): string\n {\n $pathParts = pathinfo($this->path);\n return $pathParts['filename'];\n }", "public function getShopImageFileNameAttribute()\n {\n return $this->id . '-image.png';\n }", "public function getThumbFilename($src,$asset_id,$w,$h) {\n $storage_basedir = $this->xpdo->getOption('assets_path').rtrim($this->xpdo->getOption('assman.library_path'),'/').'/';\n $dir = $storage_basedir.'resized/'.$asset_id.'/';\n // dirname : omits trailing slash\n // basename : same as basename()\n // extension : omits period\n // filename : w/o extension\n $p = pathinfo($src);\n return $dir . $w.'x'.$h.'.'.$p['extension'];\n }", "public function getImageName()\n {\n return $this->image_name;\n }", "private function getFileName()\n {\n return $this->file->getBaseName() . '.' . $this->file->getExtension();\n }", "public function getFilenameByName($name)\r\n\t{\r\n\t\treturn $this->images[$name];\r\n\t}", "public function getImageName()\n {\n return $this->imageName;\n }", "public function getImageName()\n\t{\n\t\treturn $this->imageName;\n\t}", "public function metaFilename(string $name, int $size): string {\n $name = make_utf8(strtr($name, \"\\n\\r\\t\", ' '));\n $extPos = mb_strrpos($name, '.');\n $ext = $extPos === false ? '' : trim(mb_substr($name, $extPos + 1));\n return sprintf(\".%s s%ds %s %s\", $ext, $size, $name, self::FILELIST_DELIM_UTF8);\n }", "protected function fileName() : string\n {\n return $this->setName ?? generate_key_md5($length = 10);\n }", "public function getImgFileName($rId){\r\n $tagPos = strpos($this->temporaryDocumentRels, $rId);\r\n $fileNameStart = strpos($this->temporaryDocumentRels, 'Target=\"media/',$tagPos)+14;\r\n $fileName=strstr(substr($this->temporaryDocumentRels, $fileNameStart),'\"', true);\r\n return $fileName;\r\n }", "public function image_name( $format = '' )\r\n\t{\r\n\t\treturn $this->getVar( 'image_name', $format );\r\n\t}", "public function getFilename()\n {\n return str_replace($this->getRootDir(), '', $this->getPathname());\n }", "public function getImageNameById() {\n return $this->id.'_'.$this->name;\n }", "public function getFileName()\n {\n return $this->getEntity() . '_' . date('Ymd_His') . '.' . $this->getFileExtension();\n }", "public static function getFilename();", "protected function getFileName($imageId, $version = 'original')\n {\n $folder = $this->getGalleryId();\n if (!$folder) {\n $folder = $this->tempDirectory;\n }\n\n return implode('/', [\n $folder,\n $imageId,\n $version . '.' . $this->extension,\n ]);\n }", "static function getAvailableUploadsFileName() {\n do {\n $filename = UPLOAD_PATH . '/' . make_string(10) . '-' . make_string(10) . '-' . make_string(10) . '-' . make_string(10);\n } while(is_file($filename));\n\n return $filename;\n }", "public function getFileName()\n {\n return basename($this->path);\n }", "function getFilename($name){\r\n\t\t$name=$this->clearFilename($name);\r\n\t\tif ($this->mgconfig['random_filenames'] && $name != \"\") {\r\n\t\t\t$ext = strtolower(substr($name, strrpos($name, \".\")));\r\n\t\t\t$name = $this->getRandomString(8).$ext;\r\n\t\t}\r\n\t\tif($name!=\"\") {\r\n\t\t\t//check for existing filenames\r\n\t\t\t$ni = 1;\r\n\t\t\t$base = $name;\r\n\t\t\twhile (file_exists($this->path_to_gal.$name)) { \r\n\t\t\t\t$name=$ni.$base; \r\n\t\t\t\t$ni++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $name;\r\n\t}", "public function generateFilename()\n {\n return str_random() . '.jpg';\n }", "function getFilename() { return basename($this->path); }", "public function mainImage()\n {\n if ($this->images->isEmpty()) {\n return 'images/default-image.jpg';\n }\n\n return $this->images->where('ad_id', $this->id)->first()->path;\n }", "public function getSmallFilePath()\r\n\t{\r\n\t\treturn $this->getProducerPath() . $this->image_small;\r\n\t}", "public static function get_image_size_names() {\n\t\treturn apply_filters( 'image_size_names_choose', array(\n\t\t\t'thumbnail' => __( 'Thumbnail', 'blazersix-widget-image-i18n' ),\n\t\t\t'medium' => __( 'Medium', 'blazersix-widget-image-i18n' ),\n\t\t\t'large' => __( 'Large', 'blazersix-widget-image-i18n' ),\n\t\t\t'full' => __( 'Full Size', 'blazersix-widget-image-i18n' )\n\t\t) );\n\t}", "private function _determine_image_by_size( $size ) {\n\t\t$token = 'thumbnail';\n\n\t\tif ( $size <= 150 ) { $token = 'thumbnail'; }\n\t\tif ( $size <= 306 && $size > 150 ) { $token = 'low_resolution'; }\n\t\tif ( ( $size <= 612 || $size > 612 ) && $size > 306 ) { $token = 'standard_resolution'; }\n\n\t\treturn $token;\n\t}", "private function generateFilename()\n {\n $filename = str_random(100) . \".\" . $this->extension;\n\n if(Storage::exists($this->folder . '/' . $filename))\n {\n $this->generateFilename();\n }\n\n return $filename;\n }", "public function getFileName(): string\n {\n return basename(\n $this->file->getFilename(),\n '.' . $this->file->getExtension()\n );\n }", "public function getFilename () {}", "public function getImagename($type, $product_cd = ''){\r\n\t\t$md5 \t\t= md5(time());\r\n\t\t$filename \t= substr($md5, rand(5, 25), 5);\r\n\t\tif($product_cd != ''){\r\n\t\t\t$filename = $filename . '-' . $product_cd . \".\" . $this->getExtention($type);\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$filename = $filename . \".\" . $this->getExtention($type);\r\n\t\t}\r\n\t\treturn $filename;\r\n\t}", "function get_image_name_from_url($url)\n {\n $arr = explode('/', $url);\n return $arr[count($arr)-1];\n }", "private static function getFilename()\n {\n return self::$folder . '/' . sprintf(self::FILENAME_FORMAT, date('m-d-Y'));\n }", "function ombi60ProductImgUrl($filename, $size) {\n /*\n $html = new HtmlHelper();\n return $html->image(UP_ONE_DIR_LEVEL . PRODUCT_IMAGES_THUMB_URL . $size . '/' . $filename);\n */\n\t\tif (empty($filename)) {\n\t\t\t$filename = 'no-image-' . $size . '.gif';\n\t\t\treturn '/img/admin/' . $filename;\n\t\t}\n\t\t\n return '/' . PRODUCT_IMAGES_THUMB_URL . $size . '/' . $filename;\n}", "function getFilename(){\r\n return implode(\"_\", $this->property).\"_\".$this->paint.\".gif\";\r\n }", "public function generateFilename()\n {\n $unique = uniqid(str_random(25));\n\n $filename = \"$unique.jpg\";\n\n return $this->setFilename($filename);\n }", "private function _getFileNameFromPath($image_path)\n\t{\n\t\treturn substr($image_path, strrpos($image_path, '/') + 1);\n\t}", "public function createFileName(): string\n {\n if (is_int($this->configs['file_name'])) {\n switch ($this->configs['file_name']) {\n case Chunk::RANDOM_FILE_NAME:\n $this->configs['file_name'] = $this->createRandomString();\n break;\n\n case Chunk::ORIGINAL_FILE_NAME:\n $this->configs['file_name'] = pathinfo($this->header->fileName, PATHINFO_FILENAME);\n break;\n }\n }\n\n return $this->getFullFileName();\n }", "public function getImage($id, $size)\n\t{\n\t\t$result = '';\n\n\t\tswitch ($size) {\n\t\t\tcase 'xsmall':\n\t\t\t\tif (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5(\"Image\".$id).'_XS.jpg')) {\n\t\t\t\t\t$result = '<figure><img src=\"'.JURI::root().'/media/k2/items/cache/'.md5(\"Image\".$id).'_XS.jpg\" /></figure>';\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'small':\n\t\t\t\tif (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5(\"Image\".$id).'_S.jpg')) {\n\t\t\t\t\t$result = '<figure><img src=\"'.JURI::root().'/media/k2/items/cache/'.md5(\"Image\".$id).'_S.jpg\" /></figure>';\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'medium':\n\t\t\t\tif (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5(\"Image\".$id).'_M.jpg')) {\n\t\t\t\t\t$result = '<figure><img src=\"'.JURI::root().'/media/k2/items/cache/'.md5(\"Image\".$id).'_M.jpg\" /></figure>';\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'large':\n\t\t\t\tif (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5(\"Image\".$id).'_L.jpg')) {\n\t\t\t\t\t$result = '<figure><img src=\"'.JURI::root().'/media/k2/items/cache/'.md5(\"Image\".$id).'_L.jpg\" /></figure>';\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'xlarge':\n\t\t\t\tif (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5(\"Image\".$id).'_XL.jpg')) {\n\t\t\t\t\t$result = '<figure><img src=\"'.JURI::root().'media/k2/items/cache/'.md5(\"Image\".$id).'_XL.jpg\" /></figure>';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function getThumbFilename($width, $height, $options)\n {\n return 'thumb_' . $this->id . '_' . $width . '_' . $height . '_' . $options['offset'][0] . '_' . $options['offset'][1] . '_' . $options['mode'] . '.' . $options['extension'];\n }", "public function imagePath()\n {\n if (!empty($this->image) && !empty($this->id)) {\n return storage_path($this->image).'.thumb.jpg';\n } else {\n return '';\n }\n }", "public function getSize($size){\n $original = UPLOADS.DS.$this->file;\n $info = pathinfo($original);\n $destination = dirname($original).DS.str_replace($info['basename'],$info['filename'].'_'.$size.'.'.$info['extension'],$info['basename']);\n if(!file_exists($destination) OR filemtime($destination) < filemtime($original)){\n $image = new Image($original);\n $image->resize($size)->save($destination);\n }\n return $this->render($destination);\n }", "public function GetImageSRC($size = 'default')\n\t{\treturn $this->imagelocation . $this->InputSafeString($size) . '/' . (int)$this->id .'.png';\n\t}", "public function getFileName()\n\t{\n\t\treturn basename($this->filename);\n\t}", "public function getFilename() {\n\t\treturn (string) $this->name;\n\t}", "protected function filename() {\n if(!empty($this->extension)) {\n $extension = $this->extension;\n } else {\n $extension = $this->source->extension();\n }\n\n return f::safeName($this->source->name()) . '-placeholder-' . $this->option('style') . '.' . $extension;\n\n }", "private function getFullPath(array $size)\n {\n return \"{$this->file_path}/{$size['width']}-{$size['height']}/{$size['mode']}{$this->filename}\";\n }", "public function getFilename();", "public function getFilename();", "public function getFilename();", "private function imagename($filename){\n \n $char = 'ea011088ddc8b17e619322202f1f177d';\n $pswd = sha1(sha1($char) . date('Y-m-d H:i:s')); \n $newpwd = substr($pswd, 10, 20);\n $pecah = explode(\".\", $filename);\n $belah = count($pecah);\n $ext = strtolower($pecah[$belah-1]);\n $newName = substr($newpwd, 0,10).\".\".$ext;\n return $newName;\n }", "public function getImageTitle() {\n\t\treturn $this->getFileTitle( FILETYPE_IMG );\n\t}", "protected function getOutputFilename() :string\n {\n $suffix = \"__processed__\" . time();\n $filename = basename($this->inputFile);\n $extension = pathinfo($this->inputFile)['extension'];\n\n return str_replace(\".$extension\", \"{$suffix}.$extension\", $filename);\n }", "public function JPGViewName()\n\t{\treturn $this->details['mmslug'] . '.jpg';\n\t}", "function GenImgName()\n{\n // Determine what format we should use when we save the images\n $supported = imagetypes();\n if ($supported & IMG_PNG) $img_format = \"png\";\n elseif ($supported & IMG_GIF) $img_format = \"gif\";\n elseif ($supported & IMG_JPG) $img_format = \"jpeg\";\n elseif ($supported & IMG_WBMP) $img_format = \"wbmp\";\n elseif ($supported & IMG_XPM) $img_format = \"xpm\";\n\n\n if (!isset($_SERVER['PHP_SELF']))\n JpGraphError::RaiseL(25005);\n//(\" Can't access PHP_SELF, PHP global variable. You can't run PHP from command line if you want to use the 'auto' naming of cache or image files.\");\n $fname = basename($_SERVER['PHP_SELF']);\n if (!empty($_SERVER['QUERY_STRING'])) {\n $q = @$_SERVER['QUERY_STRING'];\n $fname .= '_' . preg_replace(\"/\\W/\", \"_\", $q) . '.' . $img_format;\n } else {\n $fname = substr($fname, 0, strlen($fname) - 4) . '.' . $img_format;\n }\n return $fname;\n}", "function ImageFile()\n\t{\treturn $this->imagedir . (int)$this->id . \".jpg\";\n\t}", "private function _getFileName()\n {\n $arrName = explode('/', $this->urlDownload);\n return end($arrName);\n }", "function image_url( $unique, $size = 'large' ){\n\techo 'uploads/' . $unique . '_' . $size . '.jpg';\n}", "protected function constructFileName()\n {\n $name = uniqid();\n $extension = $this->file->getClientOriginalExtension();\n\n return \"{$name}.{$extension}\";\n }", "public function getFileName()\n {\n if (str_contains($this->name, '.')) return $this->name;\n return $this->name . '.' . $this->extension;\n }", "private function getImageCacheFilePath(): string {\n\t\t$extension = strtolower(pathinfo($this->originalFile, PATHINFO_EXTENSION));\n\n\t\tif ($extension == 'jpeg') {\n\t\t\t$extension = 'jpg';\n\t\t}\n\n\t\t// Create unique filename in the cache folder:\n\t\t// The hash makes it possible to clearly identify an unchanged file in the cache,\n\t\t// since the given hashData will always result in the same hash.\n\t\t// So if a file gets requested, the hash is generated from the path, calculated width x height, the mtime from the original and the cropping setting.\n\t\t$hashData = $this->originalFile . '-' . $this->width . 'x' . $this->height . '-' . filemtime($this->originalFile) . '-' . var_export($this->crop, true);\n\t\t$hash = sha1($hashData);\n\n\t\t$file = Cache::DIR_IMAGES . '/' . $hash . '.' . $extension;\n\n\t\tDebug::log($hashData, 'Hash data for ' . $hash);\n\n\t\treturn $file;\n\t}", "public function GetFilename()\n\t{\n\t\t$filename = preg_replace(\"/[^A-Za-z0-9]/\", \"-\", strtolower($this->details['title']));\n\t\treturn $this->id .'-'. $filename . '.' . $this->GetExtension();\n\t}", "public function getRealPathname()\n\t{\n\t\treturn $this->getRealPath().DIRECTORY_SEPARATOR.$this->getThumbnail();\n\t}", "function PicFolderFromSize($size)\n{\n if(in_array($size, PicFolderList(), true)) {return $size; }\n if(strtolower($size) == \"orig\") return \"orig\";\n if(strtolower($size) == \"huge\") return \"w1920\";\n if(strtolower($size) == \"big\") return \"w1920\";\n if(strtolower($size) == \"medium\") return \"w1024\";\n if(strtolower($size) == \"small\") return \"w640\";\n if(strtolower($size) == \"standard\") return \"w640\";\n if(strtolower($size) == \"tiny\") return \"w320\";\n if(strtolower($size) == \"thumb\") return \"w80\";\n return \"w640\"; // our default\n}", "public function getFileName()\n {\n $value = $this->get(self::FILENAME);\n return $value === null ? (string)$value : $value;\n }", "public function getHumanReadableFilename()\n {\n $file_name = $this->getBasename();\n return WebFilesystem::getHumanReadableName($file_name);\n }", "private function getFileName(TrickImage $image): string\n {\n $category = str_replace(' ', '-', strtolower($image->getTrick()->getCategory()->getName()));\n\n return $category . '-' . $image->getTrick()->getSlug() . '-' . $image->getId() . '.jpeg';\n }", "static function getFileIconUrl($filename, $size) {\n \t$extension = get_file_extension($filename);\n $possible_location = ENVIRONMENT_FRAMEWORK_PATH . \"/assets/default/images/file-types/$size/$extension.png\";\n\n if (!is_file($possible_location)) {\n \treturn AngieApplication::getImageUrl(\"file-types/$size/default.png\", ENVIRONMENT_FRAMEWORK);\n } else {\n \treturn AngieApplication::getImageUrl(\"file-types/$size/$extension.png\", ENVIRONMENT_FRAMEWORK);\n } // if\n }", "public function filename()\n {\n return $this->resource->getFilename();\n }" ]
[ "0.7880579", "0.745687", "0.7379689", "0.7373712", "0.72637886", "0.72454655", "0.7103706", "0.70652676", "0.7060269", "0.7024408", "0.702333", "0.69696647", "0.69382596", "0.6920701", "0.690786", "0.6754031", "0.6744758", "0.66881084", "0.66576105", "0.66439986", "0.663571", "0.6590462", "0.65867007", "0.65578586", "0.653485", "0.65249765", "0.6517734", "0.65079695", "0.6492697", "0.64763737", "0.646278", "0.64469224", "0.64438397", "0.6432519", "0.64292157", "0.6424698", "0.6424284", "0.64221966", "0.64211005", "0.6416203", "0.64076585", "0.6401428", "0.63949955", "0.6364126", "0.6359908", "0.6355307", "0.633284", "0.63246983", "0.63103753", "0.6296375", "0.6292956", "0.62836534", "0.6272817", "0.6269857", "0.62679434", "0.62628645", "0.62524885", "0.62518495", "0.6243687", "0.62337905", "0.6232533", "0.62325215", "0.62321645", "0.62312925", "0.62234944", "0.6222694", "0.62221223", "0.6221789", "0.62156916", "0.62150836", "0.62064475", "0.62055236", "0.6199275", "0.6194002", "0.619187", "0.61869735", "0.6171357", "0.6168499", "0.61646557", "0.61646557", "0.61646557", "0.6161989", "0.6161116", "0.61580193", "0.615203", "0.6150638", "0.614519", "0.61441237", "0.6142689", "0.6139828", "0.61357874", "0.6134079", "0.6133622", "0.6130184", "0.61106896", "0.6108086", "0.6107654", "0.61033225", "0.6097243", "0.6088127" ]
0.75453424
1
Make the paths for different sizes
Создайте пути для разных размеров
private function createSizeDirectories() { foreach (self::SIZES as $size => $sizes) { Storage::makeDirectory('public/' . self::PATH . $size); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createImageSizes()\n {\n $this->createSizeDirectories();\n\n // Image\n $image = Image::make($this->getPath('original'))->encode(self::EXT, 90);\n\n // Large\n $image->resize(self::SIZES['large']['width'], self::SIZES['large']['height'], function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n });\n $image->save($this->getPath('large'));\n\n // Mid\n $image->fit(self::SIZES['mid']['width'], self::SIZES['mid']['height']);\n $image->save($this->getPath('mid'));\n\n // Thumb\n $image->fit(self::SIZES['thumb']['width'], self::SIZES['thumb']['height']);\n $image->save($this->getPath('thumb'));\n }", "public function generateLocalSizes()\n {\n foreach ($this->getSizes() as $size => $dimensions) {\n // Make sure we don't upscale but only make smaller versions\n if ($dimensions['width'] < $this->get('width')) {\n $cachePath = $this->getLocalCachePath($size);\n\n // Resize image\n $img = ImageLibrary::make($this->pathAbs);\n $img->resize($dimensions['width'], $dimensions['height'], function ($constraint) {\n $constraint->aspectRatio();\n });\n\n $img->save($cachePath);\n }\n }\n }", "function createResizedImages(){\n\t\t$this->createLarge();\n\t\t$this->createMedium();\n\t\t$this->createSmall();\n\t\t$this->createThumbnail();\n\t\t$this->createSquare();\n\t}", "function getSizePath($size = \"\"){\n\t\tif($size == \"\")\n\t\t\t$size = \"o\";\n\t\tif($size == \"l\")\n\t\t\t$path = $this->getLarge();\n\t\telse if($size == \"o\")\n\t\t\t$path = $this->getOriginal();\n\t\telse if($size == \"m\")\n\t\t\t$path = $this->getMedium();\n\t\telse if($size == \"s\")\n\t\t\t$path = $this->getSmall();\n\t\telse if($size == \"sq\")\n\t\t\t$path = $this->getSquare();\n\t\telse if($size == \"thumbnail\")\n\t\t\t$path = $this->getThumbnail();\n\t\telse if($size == \"t\")\n\t\t\t$path = $this->getThumbnail();\n\t\telse\n\t\t\t$path = $this->getOriginal();\n\t\treturn $path;\n\t}", "public function check_paths() {\n\t\t// what CHMOD permissions should we use for the upload folders?\n\t\t$chmod = $this->config->item('tinycimm_asset_upload_chmod');\n\t\t\n\t\t// upload dir\n\t\tif (!file_exists($this->config->item('tinycimm_asset_path_full'))) {\n\t\t\t@mkdir($this->config->item('tinycimm_asset_path_full'), $chmod) or die('Error: Unable to create asset folder '.$this->config->item('tinycimm_asset_path_full').'<br/><strong>Please adjust permissions</strong>');\n\t\t}\n\t\t// cache dir\n\t\tif (!file_exists($this->config->item('tinycimm_asset_cache_path_full'))) {\n\t\t\t@mkdir($this->config->item('tinycimm_asset_cache_path_full'), $chmod) or die('Error: Unable to create asset cache folder '.$this->config->item('tinycimm_asset_cache_path_full').'<br/><strong>Please adjust permissions</strong>');\n\t\t}\n\t}", "private static function createPath(&$paths, &$folder_names)\n {\n $depth = self::$depth; \n $files = self::$files_count;\n $path_count = rand(1,$depth);\n $path = \"\";\n\n $k = 1;\n for ($j = 1; $j <= $path_count;) {\n $ext = $j = $k;\n $folder_name = 'folder' . $j;\n $path_name = $folder_name;\n \n if(array_key_exists($path_name, $folder_names)){\n $ext = $k;\n $folder_name = 'folder' . $ext;\n $path_name = $folder_name;\n }\n if(!array_key_exists($path_name, $folder_names)){\n $j++;\n $path .= $path_name .'/';\n }\n $k++;\n }\n\n if(!array_key_exists($path, $folder_names)){\n $folder_names[$path] = 0;\n }\n\n if($folder_names[$path] < $files && !empty(trim($path))){\n $folder_names[$path]++;\n $paths[] = $path;\n }else{\n self::createPath($paths, $folder_names);\n }\n \n }", "private function preparePathProps() {\n $this->imageInitialPath = $this->imageTempDirName . '/initial.' . $this->imageExtension;\n $this->imageRotatedPath = $this->imageTempDirName . '/rotated.' . $this->imageExtension;\n $this->imagePhonePath = $this->imageTempDirName . '/phone.' . $this->imageExtension;\n $this->imageShortMessagePath = $this->imageTempDirName . '/short_message.' . $this->imageExtension;\n $this->imageFullMessagePath = $this->imageTempDirName . '/full_message.' . $this->imageExtension;\n $this->imageFromPath = $this->imageTempDirName . '/from.' . $this->imageExtension;\n\n }", "function getPathSize($path);", "public function generateThumbnails()\n\t{\n\t\t$tmpFilename = tempnam('./temp', 'tmp');\n file_put_contents($tmpFilename,$this->content);\n\t\t// medium 300x300px\n $this->medium = Image2::thumbnail($tmpFilename,300,300,\\Imagine\\Image\\ManipulatorInterface::THUMBNAIL_INSET)->get('png');\n\t\t// small 100x100px\n $this->small = Image2::thumbnail($tmpFilename,100,100,\\Imagine\\Image\\ManipulatorInterface::THUMBNAIL_INSET)->get('png');\n unlink($tmpFilename);\n\t}", "public function createPathFolder();", "function makeSpecificThumbs($path) {\n\t// set specific path\n\t$path_base = BASE_THUMBNAIL . $path;\n\t$convPath2 = $path;\n\t$thumbPath = $path . '_thumbnails/';\n\techo $path_base . '<br />';\n\techo $convPath2 . '<br />';\n\techo $thumbPath . '<br />';\n\n\t// check if the path exists\n\t$i = 0;\n\t$dir = opendir($path_base);\n\t$list = array();\n\twhile($file = readdir($dir)){\n\t\tif($file != \".\" and $file != \"..\" and $file != \"Thumbs.db\" and $file != \"_thumbnails\"){\n\t\t\t$ctime = filectime($data_path . $file) . \",\" . $file;\n\t\t\t$list[$ctime] = $file;\n\t\t}\n\t}\n\tclosedir($dir);\n\tkrsort($list);\n\n\tforeach($list as $image){\n\t\t$i++;\n\t\t$dirCheck = BASE_THUMBNAIL . $thumbPath;\n\t\t//create directory if it doesn't exist\n\t\tif (!file_exists($dirCheck)) {\n \t\tmkdir($dirCheck, 0755, true);\n\t\t}\n\t\t//get sha1 hash of image\n\t\t$currentHash = (sha1_file($path_base . $image));\n\t\t//separate parts of image name\n\t\t$thumbImage = $image;\n\t\t$path_parts = pathinfo($thumbImage);\n\t\t$matchedImageName = $path_parts['filename'];\n\t\t//set rest of thumbnail conversion path\n\t\t$smallThumb = '/usr/bin/convert' . ' ' . BASE_THUMBNAIL . $convPath2 . $image . ' -resize x68 ' . BASE_THUMBNAIL . $thumbPath . $path_parts['filename'] . '_sm' . '.' . $path_parts['extension'];\n\t\t$medThumb = '/usr/bin/convert' . ' ' . BASE_THUMBNAIL . $convPath2 . $image . ' -resize x186 ' . BASE_THUMBNAIL . $thumbPath . $path_parts['filename'] . '_med' . '.' . $path_parts['extension'];\n\t\t$qCheckHash = mysql_query( \"SELECT * FROM xxxxxx WHERE thumbhash = '\" . $currentHash . \"' and imgname = '\" . $matchedImageName . \"' and selector = '\" . $selector . \"'\" );\n\t\t$matchedImageName = $path_parts['filename'];\n\t\t//convert image to thumbnails\n\t\texec($smallThumb);\n\t\texec($medThumb);\n\t\t//insert image information\n\t\t$addHash = mysql_query(\"INSERT INTO xxxxxx (thumbhash, selector, imgname) VALUES ('$currentHash','$selector','$matchedImageName')\");\n\t\techo 'thumbnail for ' . $selector . ' ' . $matchedImageName .' created' . ' at ' . $thumbPath . '<br />';\t\n\t}\n}", "public function resize() {\n $pengaturan = DB::table('folder')->where('id','=','1')->get()->first();\n $dirfotonya = public_path('png');\n $fotoArray = scandir($dirfotonya,1);\n $dirResult = public_path($pengaturan->FolderHasil);\n foreach ($fotoArray as $foto) {\n if ($foto == '..' || $foto == '.') {\n break;\n }\n $npmfoto = str_replace(\".jpg\",\"\",$foto);\n $npm = $npmfoto;\n if ($npmfoto === $npm) {\n // echo \"Ketemu \". $npm.\"<br>\";\n $fotoKetemu = $dirfotonya . \"/\" . $foto;\n $fotoBaru = $dirResult .\"/\" . $foto;\n $dirError = public_path($pengaturan->FolderGagal);\n $fotoError = $dirError . \"/\" .$foto;\n //fungsi copy image yg ditemukan ke folder result\n if(copy($fotoKetemu, $fotoBaru)){\n echo \"foto \".$npm.\" telah di copy \";\n\n //fungsi biar image nya ga kebolak gapake $im = imagecreatefrompng($fotoBaru);\n try {\n $img = imagecreatefrompng($fotoBaru);\n $exif = exif_read_data($fotoBaru);\n if ($img && $exif && isset($exif['Orientation']))\n {\n $ort = $exif['Orientation'];\n if ($ort == 6 || $ort == 5)\n $img = imagerotate($img, 270, null);\n if ($ort == 3 || $ort == 4)\n $img = imagerotate($img, 180, null);\n if ($ort == 8 || $ort == 7)\n $img = imagerotate($img, 90, null);\n if ($ort == 5 || $ort == 4 || $ort == 7)\n imageflip($img, IMG_FLIP_HORIZONTAL);\n }\n } catch (Exception $e) {\n $errornya = true;\n }\n $errornya = false;\n\n if ($errornya == true) {\n $img = imagecreatefrompng($fotoBaru);\n $fotoerror = $fotoerror.\",\".$npm;\n copy($fotoBaru, $fotoError);\n }\n //fungsi resize image menggunakan max width dan max height\n //agar image nya tidak jadi aneh ok oc :v\n //parameter nya : $namafile, $max_width, $max_height\n $max_width = 70;\n $max_height = 70;\n\n list($orig_width, $orig_height) = getimagesize($fotoBaru);\n $width = $orig_width;\n $height = $orig_height;\n # ketinggian\n if ($height > $max_height) {\n $width = ($max_height / $height) * $width;\n $height = $max_height;\n }\n # kelebaran\n if ($width > $max_width) {\n $height = ($max_width / $width) * $height;\n $width = $max_width;\n }\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefrompng($fotoBaru);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n $width, $height, $orig_width, $orig_height);\n\n\n } else {\n echo \"masalah dalam copy\";\n }\n\n }\n\n //tutup foreach 1\n }\n //tutup fungsi proses\n }", "public function getDiagonalPaths()\n {\n for ($fKey = array_search($this->getFile(), $this->files), $rKey = array_search($this->getRank(), $this->ranks); array_key_exists($fKey, $this->files) && array_key_exists($rKey, $this->ranks); $fKey ++, $rKey ++) {\n $possiblePath[] = array((string) $this->files[$fKey], (string) $this->ranks[$rKey]);\n }\n $possiblePaths[] = $possiblePath;\n unset($possiblePath);\n for ($fKey = array_search($this->getFile(), $this->files), $rKey = array_search($this->getRank(), $this->ranks); array_key_exists($fKey, $this->files) && array_key_exists($rKey, $this->ranks); $fKey --, $rKey ++) {\n $possiblePath[] = array((string) $this->files[$fKey], (string) $this->ranks[$rKey]);\n }\n $possiblePaths[] = $possiblePath;\n unset($possiblePath);\n for ($fKey = array_search($this->getFile(), $this->files), $rKey = array_search($this->getRank(), $this->ranks); array_key_exists($fKey, $this->files) && array_key_exists($rKey, $this->ranks); $fKey --, $rKey --) {\n $possiblePath[] = array((string) $this->files[$fKey], (string) $this->ranks[$rKey]);\n }\n $possiblePaths[] = $possiblePath;\n unset($possiblePath);\n for ($fKey = array_search($this->getFile(), $this->files), $rKey = array_search($this->getRank(), $this->ranks); array_key_exists($fKey, $this->files) && array_key_exists($rKey, $this->ranks); $fKey ++, $rKey --) {\n $possiblePath[] = array((string) $this->files[$fKey], (string) $this->ranks[$rKey]);\n }\n $possiblePaths[] = $possiblePath;\n return $possiblePaths;\n }", "public function createImageWithDifferentSizes ($imageFullPath, $folder)\r\n {\r\n $createdFiles = array();\r\n $imageDirectory = $this->uploadDirectory . DIRECTORY_SEPARATOR . self::PRODUCT_FOLDER . $folder;\r\n $imageSizes = array (\r\n self::PRODUCT_FOLDER_THUMBNAIL => array (\r\n 'width'=> self::SIZE_THUMBNAIL_WIDTH,\r\n 'height'=> self::SIZE_THUMBNAIL_HEIGHT,\r\n ),\r\n self::PRODUCT_FOLDER_SMALL => array (\r\n 'width'=> self::SIZE_SMALL_WIDTH,\r\n 'height'=> self::SIZE_SMALL_HEIGHT,\r\n ),\r\n self::PRODUCT_FOLDER_MEDIUM => array (\r\n 'width'=> self::SIZE_MEDIUM_WIDTH,\r\n 'height'=> self::SIZE_MEDIUM_HEIGHT,\r\n ),\r\n self::PRODUCT_FOLDER_LARGE => array (\r\n 'width'=> self::SIZE_LARGE_WIDTH,\r\n 'height'=> self::SIZE_LARGE_HEIGHT,\r\n ),\r\n );\r\n\r\n $pathParts = pathinfo($imageFullPath);\r\n $imageManipulator = $this->container->get(\"yilinker_core.service.image_manipulation\");\r\n \r\n foreach ($imageSizes as $folderName => $imageSize) {\r\n\r\n if (!file_exists($imageDirectory . DIRECTORY_SEPARATOR . $folderName)) {\r\n mkdir($imageDirectory . DIRECTORY_SEPARATOR . $folderName , 0777);\r\n }\r\n\r\n $newWidth = $imageSize['width'];\r\n $newHeight = $imageSize['height'];\r\n $imageToReSize = $imageDirectory . DIRECTORY_SEPARATOR . $folderName . DIRECTORY_SEPARATOR . $pathParts['basename'];\r\n\r\n $imageManipulator->writeThumbnail(\r\n DIRECTORY_SEPARATOR.ltrim($imageFullPath, 'web/'),\r\n DIRECTORY_SEPARATOR.ltrim($imageToReSize, 'web/'),\r\n array(\r\n \"filters\" => array(\r\n \"relative_resize\" => array(\r\n \"heighten\" => $newHeight,\r\n \"widen\" => $newWidth,\r\n ),\r\n \"background\" => array(\"color\" => \"#fff\")\r\n )\r\n ));\r\n\r\n $createdFiles[] = new File($imageToReSize);\r\n }\r\n foreach ($createdFiles as $file) {\r\n $this->uploadToCloud ($file);\r\n }\r\n\r\n return $createdFiles;\r\n }", "function copyimages($sizes, $file, $name, $CropToFit = false, $AllowSmaller = false){\n if (file_exists($file) && !is_dir($file)) {\n foreach ($sizes as $path => $size) {\n $rsize = resize($file, $size, $CropToFit, $AllowSmaller);\n copy($rsize, public_path($path . $name));\n if(file_exists($rsize)){\n @unlink($rsize);\n }\n }\n }\n }", "function setupFileDirectories(){\r\n\t\t\tglobal $directory_dot_graph;\r\n\t\t\tglobal $directory_dot_map;\r\n\t\t\tglobal $directory_dot_img;\t\r\n\t\t\t\r\n\t\t\tif(!file_exists($directory_dot_graph)){\r\n\t\t\t\t$result_dot = mkdir($directory_dot_graph,0755);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!file_exists($directory_dot_map)){\r\n\t\t\t\t$result_map = mkdir($directory_dot_map,0755);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!file_exists($directory_dot_img)){\r\n\t\t\t\t$result_img = mkdir($directory_dot_img,0755);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//if($result_dot and $result_map and $result_img) return True;\r\n\t\t\t//else return False;\r\n\t\t\treturn True;\r\n\t\t}", "private function getFullPath(array $size)\n {\n return \"{$this->file_path}/{$size['width']}-{$size['height']}/{$size['mode']}{$this->filename}\";\n }", "static function createSizes($item)\n\t{\n\t\t$config = config('nova-media-library.resize');\n\t\tif (\n\t\t\t'image' != data_get($item, 'options.mime')\n\t\t or !is_array($config)\n\t\t or !class_exists('\\Intervention\\Image\\ImageManager')\n\t\t) return;\n\n\t\t$sizes = [];\n\t\t$name = explode('.', $item->name);\n\t\t$ext = '.'. array_pop($name);\n\t\t$name = implode('.', $name) .'-';\n\n\t\t$folder = Helper::folder($item->folder . $item->name);\n\t\t$file = Helper::storage()->get($folder);\n\t\tif ( !$file ) return;\n\n\t\t$img_sizes = data_get($item->options, 'img_sizes');\n\t\tif ( $img_sizes ) {\n\t\t\tdata_set($item->options, 'img_sizes', []);\n\t\t\tforeach ($img_sizes as $key)\n\t\t\t\tHelper::storage()->delete(API::getImageSize($folder, $key));\n\t\t}\n\n\t\t$manager = new \\Intervention\\Image\\ImageManager([ 'driver' => $config['driver'] ]);\n\n\t\tforeach ($config['sizes'] as $size => $data) {\n\t\t\tif ( !is_int($data[0]) and !is_int($data[1]) or self::cantResize($item, $data) ) continue;\n\n\t\t\ttry {\n\t\t\t\t$fn = ( $data[0] and $data[1] ) ? 'fit' : 'resize';\n\t\t\t\t$img = $manager->make($file)->$fn($data[0], $data[1], function ($constraint) use ($data) {\n\t\t\t\t\tif ( !$data[0] or !$data[1] ) $constraint->aspectRatio();\n\t\t\t\t\tif ( $data[2] !== true ) $constraint->upsize();\n\t\t\t\t})->stream(null, $config['quality'])->__toString();\n\n\t\t\t\tif (\n\t\t\t\t\tHelper::storage()->put(\n\t\t\t\t\t\tHelper::folder($item->folder . $name . $size . $ext),\n\t\t\t\t\t\t$img,\n\t\t\t\t\t\tHelper::visibility($item->private)\n\t\t\t\t\t)\n\t\t\t\t) $sizes[] = $size;\n\t\t\t} catch (\\Exception $e) {}\n\t\t}\n\n\t\tif ( $sizes ) {\n\t\t\t$item->options = data_set($item->options, 'img_sizes', $sizes);\n\t\t\t$item->save();\n\t\t}\n\t}", "function createpath($path)\n\n{\n\n\t\t$exp=explode(\"/\",$path);\n\n\t\t\t\t$way='';\n\n\t\t\t\tforeach($exp as $n)\n\n\t\t\t\t{\n\n\t\t\t\t\t\n\n\t\t\t\t\t$way.=$n;\n\n\t\t\t\t\t\t@mkdir($way, 0777);\n\n\t\t\t\t\t\t@chmod($way, 0777);\n\n\t\t\t\t\t$way.='/';\n\n\t\t\t\t\t\t\n\n\t\t\t\t}\n\n}", "function createThumbs( $pathToImages, $thumbWidth ) {\n global $imgTypes;\n $pathToThumbs = $pathToImages.\"thumbnails/\";\n\n // open the directory\n $dir = opendir( $pathToImages );\n\n if(is_dir($pathToImages) == false){\n return;\n }\n\n // loop through it, looking for any/all JPG files:\n while (false !== ($fname = readdir( $dir ))) {\n // parse path for the extension\n $info = pathinfo($pathToImages . $fname);\n // continue only if this is a JPEG image\n $extension = preg_split('/\\./',$fname);\n $extension = strtolower($extension[count($extension)-1]);\n\n $arr = preg_split('/\\.(?=[^.]*$)/',$fname);\n $imgName = $arr[0];\n if ($fname != \".\" && $fname != \"..\" && $fname != \".DS_Store\" && is_dir($pathToImages.$fname) == false && array_search($extension,$imgTypes) !== FALSE && $imgName != \"folderCover\") {//If it is a folder\n echo \"Creating thumbnail for {$pathToThumbs}{$fname} <br />\";\n\n // load image and get image size\n $img = imagecreatefromjpeg( \"{$pathToImages}{$fname}\" );\n $width = imagesx( $img );\n $height = imagesy( $img );\n\n // calculate thumbnail size\n $new_width = $thumbWidth;\n $new_height = floor( $height * ( $thumbWidth / $width ) );\n\n // create a new temporary image\n $tmp_img = imagecreatetruecolor( $new_width, $new_height );\n\n // copy and resize old image into new image \n imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\n if (!file_exists($pathToThumbs)) {\n //mkdir($pathToThumbs, 0755, true);\n if (mkdir($pathToThumbs, 0755, true)) chmod($pathToThumbs, 0755);\n }\n\n // save thumbnail into a file\n imagejpeg( $tmp_img, \"{$pathToThumbs}{$fname}\" );\n }else if($fname != \".\" && $fname != \"..\" && $fname != \".DS_Store\" && is_dir($pathToImages.'/'.$fname) && $fname != \"thumbnails\" ){\n createThumbs($pathToImages.$fname.'/', $thumbWidth );\n }\n }\n // close the directory\n closedir( $dir );\n }", "protected function generateImages() {\n\t\tforeach ($this->sets as $set) {\t\n\t\t\t$img = new rImage(JPATH_ROOT.$this->files->getImage(),\n\t\t\t\t$this->files->getCacheFolder('items'),\n\t\t\t\t$set->name,\n\t\t\t\t$set->width,\n\t\t\t\t$set->height,\n\t\t\t\t$set->quality,\n\t\t\t\t$set->ratio\n\t\t\t);\n\t\t\t$this->generateImage($img);\n\t\t}\t\t\n\t}", "protected function _setupTestPath($_types)\n {\n $testPaths = array();\n $types = (array) $_types;\n \n foreach ($types as $type) {\n switch ($type) {\n case Tinebase_Model_Container::TYPE_PERSONAL:\n $testPaths[] = Tinebase_Model_Container::TYPE_PERSONAL . '/' . Tinebase_Core::getUser()->getId() . '/' \n . $this->_personalContainer->getId() . '/unittestdir_personal';\n break;\n case Tinebase_Model_Container::TYPE_SHARED:\n $testPaths[] = Tinebase_Model_Container::TYPE_SHARED . '/' . $this->_sharedContainer->getId();\n $testPaths[] = Tinebase_Model_Container::TYPE_SHARED . '/' . $this->_sharedContainer->getId() . '/unittestdir_shared';\n break;\n case Tinebase_Model_Container::TYPE_OTHERUSERS:\n $personas = Zend_Registry::get('personas');\n $testPaths[] = Tinebase_Model_Container::TYPE_PERSONAL . '/' . $personas['sclever']->getId() . '/' \n . $this->_otherUserContainer->getId() . '/unittestdir_other';\n break;\n }\n }\n \n foreach ($testPaths as $path) {\n $path = Filemanager_Controller_Node::getInstance()->addBasePath($path);\n $this->_objects['paths'][] = $path;\n $this->_fsController->mkdir($path);\n }\n }", "function maxImageUpload(){\r\n \r\n if (!file_exists($this->baseDir)) {\r\n if (!@mkdir($this->baseDir)){\r\n $this->baseDir = getcwd();\r\n }\r\n }\r\n \r\n $this->originalDir = $this->baseDir.DIRECTORY_SEPARATOR.$this->originalDir.DIRECTORY_SEPARATOR;\r\n if (!file_exists($this->originalDir)) {\r\n mkdir($this->originalDir);\r\n }\r\n $this->normalDir = $this->baseDir.DIRECTORY_SEPARATOR.$this->normalDir.DIRECTORY_SEPARATOR;\r\n if (!file_exists($this->normalDir)) {\r\n mkdir($this->normalDir);\r\n }\r\n $this->thumbDir = $this->baseDir.DIRECTORY_SEPARATOR.$this->thumbDir.DIRECTORY_SEPARATOR;\r\n if (!file_exists($this->thumbDir)) {\r\n mkdir($this->thumbDir);\r\n }\r\n }", "public function callResizeImagesInsideUploadFolder(){\n\n $this->resizeImagesInsideUploadFolder(public_path().'/uploads/pix');\n\n\n\n }", "function bfg_image_size_names_choose( $sizes ) {\n\n\t$sizes['desktop-size'] = 'Desktop';\n\treturn $sizes;\n\n}", "function PicFolderFromSize($size)\n{\n if(in_array($size, PicFolderList(), true)) {return $size; }\n if(strtolower($size) == \"orig\") return \"orig\";\n if(strtolower($size) == \"huge\") return \"w1920\";\n if(strtolower($size) == \"big\") return \"w1920\";\n if(strtolower($size) == \"medium\") return \"w1024\";\n if(strtolower($size) == \"small\") return \"w640\";\n if(strtolower($size) == \"standard\") return \"w640\";\n if(strtolower($size) == \"tiny\") return \"w320\";\n if(strtolower($size) == \"thumb\") return \"w80\";\n return \"w640\"; // our default\n}", "public function differentSizesDataProvider() {}", "function createThumb($path1, $path2, $file_type, $new_w, $new_h, $squareSize = ''){\n\t\t/* read the source image */\n\t\t$source_image = FALSE;\n\t\t\n\t\tif (preg_match(\"/jpg|JPG|jpeg|JPEG/\", $file_type)) {\n\t\t\t$source_image = imagecreatefromjpeg($path1);\n\t\t}\n\t\telseif (preg_match(\"/png|PNG/\", $file_type)) {\n\t\t\t\n\t\t\tif (!$source_image = @imagecreatefrompng($path1)) {\n\t\t\t\t$source_image = imagecreatefromjpeg($path1);\n\t\t\t}\n\t\t}\n\t\telseif (preg_match(\"/gif|GIF/\", $file_type)) {\n\t\t\t$source_image = imagecreatefromgif($path1);\n\t\t}\t\t\n\t\tif ($source_image == FALSE) {\n\t\t\t$source_image = imagecreatefromjpeg($path1);\n\t\t}\n\n\t\t$orig_w = imageSX($source_image);\n\t\t$orig_h = imageSY($source_image);\n\t\t\n\t\tif ($orig_w < $new_w && $orig_h < $new_h) {\n\t\t\t$desired_width = $orig_w;\n\t\t\t$desired_height = $orig_h;\n\t\t} else {\n\t\t\t$scale = min($new_w / $orig_w, $new_h / $orig_h);\n\t\t\t$desired_width = ceil($scale * $orig_w);\n\t\t\t$desired_height = ceil($scale * $orig_h);\n\t\t}\n\t\t\t\t\n\t\tif ($squareSize != '') {\n\t\t\t$desired_width = $desired_height = $squareSize;\n\t\t}\n\n\t\t/* create a new, \"virtual\" image */\n\t\t$virtual_image = imagecreatetruecolor($desired_width, $desired_height);\n\t\t// for PNG background white----------->\n\t\t$kek = imagecolorallocate($virtual_image, 255, 255, 255);\n\t\timagefill($virtual_image, 0, 0, $kek);\n\t\t\n\t\tif ($squareSize == '') {\n\t\t\t/* copy source image at a resized size */\n\t\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $orig_w, $orig_h);\n\t\t} else {\n\t\t\t$wm = $orig_w / $squareSize;\n\t\t\t$hm = $orig_h / $squareSize;\n\t\t\t$h_height = $squareSize / 2;\n\t\t\t$w_height = $squareSize / 2;\n\t\t\t\n\t\t\tif ($orig_w > $orig_h) {\n\t\t\t\t$adjusted_width = $orig_w / $hm;\n\t\t\t\t$half_width = $adjusted_width / 2;\n\t\t\t\t$int_width = $half_width - $w_height;\n\t\t\t\timagecopyresampled($virtual_image, $source_image, -$int_width, 0, 0, 0, $adjusted_width, $squareSize, $orig_w, $orig_h);\n\t\t\t}\n\n\t\t\telseif (($orig_w <= $orig_h)) {\n\t\t\t\t$adjusted_height = $orig_h / $wm;\n\t\t\t\t$half_height = $adjusted_height / 2;\n\t\t\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $squareSize, $adjusted_height, $orig_w, $orig_h);\n\t\t\t} else {\n\t\t\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $squareSize, $squareSize, $orig_w, $orig_h);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (@imagejpeg($virtual_image, $path2, 90)) {\n\t\t\timagedestroy($virtual_image);\n\t\t\timagedestroy($source_image);\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function createThumbnailsForProject($user_id,$image_path,$file,$dir){\n\r\n\t\t\t// create project folder and save path for directory\r\n\t\t\t$config = new \\Zend_Config(\\Zend_Registry::get('config'));\r\n\t\t\t$path = $config->app->storage->project;\r\n\t\r\n\t\t\t$thumbDir = $dir.'/thumbs/';\n\t\t\trrmdir($path.$dir); // delete previous files\r\n\t\t\tmkdir($path.$dir); // creating of the new directory\n\t\t\tmkdir($path.$thumbDir); // creating dir for thumbs\n\t\t\t\t\r\n\t\t\t$newImagePath = $path.$thumbDir.$file;\r\n\t\t\t\r\n\t\t\tif (copy($image_path,$newImagePath)) {\r\n\t\t\t\t// creating new thumbs\r\n\t\t\t\t$imageManager = new \\Boilerplate_Util_ImageManager($newImagePath);\r\n\t\t\t\t$ext = substr(strrchr($newImagePath, '.'), 1);\r\n\t\t\t\t\n\t\t\t\t$pre = substr($newImagePath,0,strrpos($newImagePath, '.'));\n\t\t\t\t$preFile = substr($file,0,strrpos($file, '.'));\r\n\n\t\t\t\t$output = $this->bucket.'/projects/'.$thumbDir;\r\n\n\t\t\t\t//Create all resolutions and copy them to s3 server\n\t\t\t\tforeach($this->resolutionsProject as $r){\r\n\t\t\t\t\t$imagePath = $pre.'_'.$r['type'].'.'.$ext;\r\n\t\t\t\t\t$imageS3Path = $output.$preFile.'_'.$r['type'].'.'.$ext; // addres to S3 server\r\n\t\t\t\t\t$imageManager->resizeImage($r['width'], $r['height'], 'crop');\r\n\t\t\t\t\t$imageManager->saveImage($imagePath, 100);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// upload to S3 server\r\n\t\t\t\t\t$this->s3->putFile($imagePath, $imageS3Path,\r\n\t\t\t\t\t\t\tarray(Zend_Service_Amazon_S3::S3_ACL_HEADER =>\r\n\t\t\t\t\t\t\t\t\tZend_Service_Amazon_S3::S3_ACL_PUBLIC_READ));\n\t\t\t\t}\n\t\t\t\t\r\n\t\t\t\treturn array('file'=>$preFile.'_large.'.$ext);\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t\t\r\n\t\t\t\tthrow new \\Exception(\"Can't copy the file.\" );\r\n\t\t\t}\n\n\t\t}", "protected final function create_image_tree()\n {\n // Full directory structure for images and thumbs\n $path = $this->get_image_path() . MODEL_THUMBS; \n \n // Creation attemp or die\n if(!is_dir($path))\n if(!FileSystem::create_tree($path)) \n trigger_error('I cannot create '. $path .', please check permissions', E_USER_ERROR);\n }", "function getThumbPath($fileNameSrc, $size){\r\n if(empty($size['width']) && empty($size['height'])){\r\n return false;\r\n }\r\n $srcFile = basename($fileNameSrc);\r\n $srcDir = dirname($fileNameSrc);\r\n $folder = 'thumbs';\r\n $folder .= (empty($size['width']))?'':$size['width'];\r\n $folder .= 'x';\r\n $folder .= (empty($size['height']))?'':$size['height'];\r\n $fileNameDest = $srcDir.DS.$folder.DS.$srcFile;\r\n return $fileNameDest;\r\n }", "abstract public function paths(): array;", "private function createPath($path){\r\n\t\t$directorys = explode(\"/\",$path);\r\n\t\t$processed_path = $this->getAbsStorageDir();\r\n\r\n\t\tforeach($directorys as $directory){\r\n\t\t\t$cmd['newfolder'][0] = array(\"data\" => $directory, \"target\" => $processed_path);\r\n\t\t\t$this->fileProcessor->start($cmd);\r\n\t\t\t$this->fileProcessor->processData();\r\n\t\t\t$processed_path = $processed_path.\"/\".$directory;\r\n\t\t}\r\n\t}", "private function &pathTree()\n {\n $t =& self::$pathTrees[get_class($this->owner)];\n if($t) return $t;\n\n $this->imagesRoot = $this->imagesRoot ? array_merge(self::$imgRoot, $this->imagesRoot) : self::$imgRoot;\n\n $imagesFolder = DIRECTORY_SEPARATOR . ($this->imagesRoot['IMAGES_FOLDER'] ?\n $this->imagesRoot['IMAGES_FOLDER'] . DIRECTORY_SEPARATOR : '');\n\n $t['saveRoot'] = Yii::getAlias('@'. $this->imagesRoot['ROOT_ALIAS_NAME']) . $imagesFolder;\n FileHelper::createDirectory($t['saveRoot'], self::GENERATE_SUB_FOLDER_MODE);\n\n $t['showRoot'] = (Yii::$app->id == $this->imagesRoot['APP_OWNER'] ?\n BaseUrl::base(true) . DIRECTORY_SEPARATOR . $this->imagesRoot['ROOT_ALIAS_NAME'] :\n Yii::$app->assetManager->getPublishedUrl(Yii::getAlias('@' . $this->imagesRoot['ROOT_ALIAS_NAME'])))\n . $imagesFolder;\n\n $modelFolder = get_class($this->owner);\n $modelFolder = substr($modelFolder, strripos($modelFolder, '\\\\') + 1) ;\n $modelFolder = strtolower(substr($modelFolder, 0, 1)) . substr($modelFolder, 1);\n\n foreach ($this->imagesSettings as $attribute => $iS) {\n $img =& $t['pathTree'][$attribute];\n $img['attr'] = $iS['imageAttribute'];\n $img['dir'] = ((isset($iS['saveFolder']) && $iS['saveFolder']) ?\n $iS['saveFolder'] : $modelFolder . DIRECTORY_SEPARATOR . $iS['imageAttribute'])\n . DIRECTORY_SEPARATOR;\n\n foreach ($iS['variants'] as $variant => $vS) {\n $keyName = (isset($vS['name']) && $vS['name']) ? $vS['name'] : $variant;\n $vS['dir'] = $keyName ? $keyName . DIRECTORY_SEPARATOR : '';\n $vS['keyName'] = $keyName ?\n strtoupper(substr($keyName, 0, 1)) . substr($keyName, 1) : '';\n\n $img['variants'][$variant] = $vS;\n }\n }\n\n return $t;\n }", "function createThumbs($pathToImages, $pathToThumbs, $thumbWidth) {\r\n // parse path for the extension\r\n $allowtypes = array(\"jpg\", \"jpeg\", \"png\", \"gif\", \"bmp\");\r\n $info = pathinfo($pathToImages);\r\n // continue only if this is a JPEG image\r\n if (in_array($info['extension'], $allowtypes)) {\r\n // load image and get image size\r\n $img = \"\"; // imagecreatefromjpeg(\"{$pathToImages}\");\r\n\r\n if ($info['extension'] == 'jpg' || $info['extension'] == 'jpeg')\r\n $img = imagecreatefromjpeg(\"{$pathToImages}\");\r\n if ($info['extension'] == 'png')\r\n $img = imagecreatefrompng(\"{$pathToImages}\");\r\n if ($info['extension'] == 'gif')\r\n $img = imagecreatefromgif(\"{$pathToImages}\");\r\n if ($info['extension'] == 'bmp')\r\n $img = imagecreatefromwbmp(\"{$pathToImages}\");\r\n\r\n $width = imagesx($img);\r\n $height = imagesy($img);\r\n\r\n // calculate thumbnail size\r\n $new_width = $thumbWidth;\r\n $new_height = floor($height * ( $thumbWidth / $width ));\r\n\r\n // create a new temporary image\r\n $tmp_img = imagecreatetruecolor($new_width, $new_height);\r\n\r\n // copy and resize old image into new image\r\n imagecopyresized($tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\r\n\r\n // save thumbnail into a file\r\n\r\n if ($info['extension'] == 'jpg' || $info['extension'] == 'jpeg')\r\n imagejpeg($tmp_img, \"{$pathToThumbs}\");\r\n if ($info['extension'] == 'png')\r\n imagepng($tmp_img, \"{$pathToThumbs}\");\r\n if ($info['extension'] == 'gif')\r\n imagegif($tmp_img, \"{$pathToThumbs}\");\r\n if ($info['extension'] == 'bmp')\r\n imagewbmp($tmp_img, \"{$pathToThumbs}\");\r\n }\r\n}", "private function buildPaths()\n\t{\n\t\t// set the working dir\n\t\t$workingDir = getcwd();\n\n\t\t// are we in default_www or library?\n\t\t$posFrontend = strpos($workingDir, 'frontend');\n\t\t$posBackend = strpos($workingDir, 'backend');\n\t\t$posDefWWW = strpos($workingDir, 'default_www');\n\t\t$posLib = strpos($workingDir, 'library');\n\n\t\t// this is a check if we're in one of the directories\n\t\tif($posFrontend !== false || $posBackend !== false || $posLib !== false || $posDefWWW !== false)\n\t\t{\n\t\t\t// we're in a 2.x version of fork, with default_www\n\t\t\tif($posDefWWW !== false)\n\t\t\t{\n\t\t\t\t// get the base path\n\t\t\t\t$basePath = explode('default_www', $workingDir);\n\t\t\t\t$basePath = $basePath[0];\n\t\t\t\t$frontendPath = $basePath . 'default_www/frontend/';\n\t\t\t\t$backendPath = $basePath . 'default_www/backend/';\n\t\t\t\t$libraryPath = $basePath . 'library/';\n\t\t\t}\n\t\t\t// we're in 3.x\n\t\t\telse\n\t\t\t{\n\t\t\t\t// get the base path\n\t\t\t\tif($posFrontend !== false) $basePath = explode('frontend', $workingDir);\n\t\t\t\telseif($posBackend !== false) $basePath = explode('backend', $workingDir);\n\t\t\t\telseif($posLib !== false) $basePath = explode('library', $workingDir);\n\n\t\t\t\t// set the paths\n\t\t\t\t$basePath = $basePath[0];\n\t\t\t\t$frontendPath = $basePath . 'frontend/';\n\t\t\t\t$backendPath = $basePath . 'backend/';\n\t\t\t\t$libraryPath = $basePath . 'library/';\n\t\t\t}\n\t\t}\n\t\t// we're not in a fork subdirectory\n\t\telseif(file_exists($workingDir . '/VERSION.md') && (is_dir($workingDir . '/default_www') || is_dir($workingDir . '/frontend')) && is_dir($workingDir . '/library'))\n\t\t{\n\t\t\t// we're in a 2.x version of fork, with default_www\n\t\t\tif(is_dir($workingDir . '/default_www'))\n\t\t\t{\n\t\t\t\t$frontendPath = $workingDir . '/default_www/frontend/';\n\t\t\t\t$backendPath = $workingDir . '/default_www/backend/';\n\t\t\t\t$basePath = $workingDir . '/';\n\t\t\t\t$libraryPath = $workingDir . '/library/';\n\t\t\t}\n\t\t\t// we're in fork 3.x\n\t\t\telse\n\t\t\t{\n\t\t\t\t$frontendPath = $workingDir . '/frontend/';\n\t\t\t\t$backendPath = $workingDir . '/backend/';\n\t\t\t\t$basePath = $workingDir . '/';\n\t\t\t\t$libraryPath = $workingDir . '/library/';\n\t\t\t}\n\t\t}\n\t\telse throw new Exception('You are not in a working fork directory');\n\n\t\t// read the version\n\t\t$oVersion = fopen($basePath . 'VERSION.md', 'r');\n\t\t$rVersion = fread($oVersion, filesize($basePath . 'VERSION.md'));\n\t\t$rVersion = str_replace(\"\\n\", '', $rVersion);\n\t\tdefine('VERSION', $rVersion);\n\t\t$versionCode = explode('.', $rVersion);\n\t\tdefine('VERSIONCODE', $versionCode[0]);\n\n\t\t// set paths for overall use\n\t\tdefine('PROJECT_NAME', trim(strrchr($workingDir, '/'), '/'));\n\t\tdefine('FRONTENDPATH', $frontendPath);\n\t\tdefine('BACKENDPATH', $backendPath);\n\t\tdefine('BASEPATH', $basePath);\n\t\tdefine('LIBRARYPATH', $libraryPath);\n\t}", "function new_resize_images(){\n\n\t\t\tglobal $db;\n\t\t\t$select = ' SELECT * FROM fs_products WHERE id <= 500';\n//\t\t\t$select = ' SELECT * FROM fs_products WHERE id < 1500 AND id >=1000';\n\t\t\t$sql = $db->query($select);\n\t\t\t\n\t\t\t$list = $db->getObjectList();\n\t\t\t\n\t\t\t$arr_img_paths = array(array('resized',141,197,'resized_not_crop'),array('large',251,350,'resized_not_crop'));\n\t\t\t$fsFile = FSFactory::getClass('FsFiles','');\n\t\t\tfor($i = 0; $i < count($list) ; $i ++){\n\t\t\t\t$item = $list[$i]; \n\t\t\t\t$image = PATH_BASE.str_replace('/',DS,$item -> image);\n//\t\t\t\t$fsFile -> create_folder($folder_image_destination);\n//\t\t\t\tif(!$fsFile -> copy_file($folder_image_begin.$image,$folder_image_destination.$image))\n//\t\t\t\t\tcontinue;\n\t\t\t\tforeach($arr_img_paths as $path){\n\t\t\t\t\t$path_resize = str_replace(DS.'original'.DS, DS.$path[0].DS, $image);\n//\t\t\t\t\t$fsFile -> create_folder($path_resize);\n\t\t\t\t\t$method_resize = $path[3]?$path[3]:'resized_not_crop';\n//\t\t\t\t\t$fsFile -> remove_file_by_path($path_resize);\n\t\t\t\t\tif(!$fsFile ->$method_resize($image, $path_resize,$path[1], $path[2])){\n\t\t\t\t\t\techo $item->id.'_';\n\t\t\t\t\t}\n//\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function eino_add_image_sizes() {\n\n\tadd_image_size( 'eino-thumbnail-download', 330, 330, true );\n\tadd_image_size( 'eino-bigger-image', 860, 9999 );\n\t\n}", "function _makeFolders( $pathname, $ouputFolder )\n{\n\tif( !file_exists( $ouputFolder.$pathname ) )\n\t{\n\t\t$arrFolder = split( \"[\\\\/\\\\\\\\]\", $pathname );\n\t\t//var_dump( $arrFolder );\n\t\t$basePath = $ouputFolder;\n\t\tforeach ( $arrFolder as $folder )\n\t\t{\n\t\t\t$basePath .= \"/\".$folder;\n\t\t\tif( !file_exists( $basePath ) )\n\t\t\t{\n\t\t\t\tmkdir( $basePath );\n\t\t\t\tchmod( $basePath, 0777 );\n\t\t\t}\n\t\t}\n\t}\n}", "function getImageSize($path);", "public function makeAll($dir, $sourceFileName, $username, $sizes){\n\t\t//var_dump($sizes);// exit;\n\t\tforeach ($sizes as $key=>$size) { \n\t\t\tif (!$this->make($dir, $sourceFileName, $dir . '/' . $username . '_' . $size .'.png', $size, $size)) \n\t\t\t{\n\t\t\t\t$this->addError('Thumbnail could not be created.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function uploadFiles($file, $folder = \"\", array $paths, $sizes = array(), $perm = 'public-read')\n {\n\n $data = array();\n $fileNameParts = explode(\".\", $file['name']);\n $ext = end($fileNameParts);\n $fileName = time() . \".\" . $ext;\n\n if (in_array(strtolower($ext), $this->allowedExt)) {\n\n if (count($paths) > 0) {\n\n foreach ($paths as $key => $value) {\n $filePath = $this->tempFolder . $fileName;\n\n // Resize image\n\n $hostname = $_SERVER['SERVER_NAME'];\n\n if ($hostname == 'ovessence.com') {\n exec(\"/usr/bin/convert \" . $file['tmp_name'] . \" -resize \" . $value . \"% $filePath\");\n } else if ($hostname == 'dev.clavax.us') {\n exec(\"/usr/local/bin/convert \" . $file['tmp_name'] . \" -resize \" . $value . \"% $filePath\");\n } else {\n exec(\"convert \" . $file['tmp_name'] . \" -resize \" . $value . \"% $filePath\");\n }\n\n // Upload file to S3 server\n $result = $this->client->putObject(array(\n 'Bucket' => $this->bucket,\n 'Key' => $folder . \"/\" . $key . \"/\" . $fileName,\n //'SourceFile' => $filePath,\n //'SourceFile' => $file['tmp_name'],\n 'SourceFile' => $filePath,\n 'ACL' => $perm\n ));\n\n $data[$key] = $result['ObjectURL'];\n\n // Delete temperary file\t\t\t\n if (is_file($filePath)) {\n @unlink($filePath);\n }\n }\n } else {\n\n if (count($sizes) > 0) {\n\n foreach ($sizes as $key => $value) {\n $filePath = $this->tempFolder . $fileName;\n\n // Resize image\n $resizeTo = (is_numeric($value)) ? $value . '%' : $value;\n $hostname = $_SERVER['SERVER_NAME'];\n\n if ($hostname == 'ovessence.com') {\n exec(\"/usr/bin/convert \" . $file['tmp_name'] . \" -resize \" . $resizeTo . \" $filePath\");\n } else if ($hostname == 'dev.clavax.us') {\n exec(\"/usr/local/bin/convert \" . $file['tmp_name'] . \" -resize \" . $resizeTo . \" $filePath\");\n } else {\n exec(\"convert \" . $file['tmp_name'] . \" -resize \" . $resizeTo . \" $filePath\");\n }\n\n // Upload file to S3 server\n $result = $this->client->putObject(array(\n 'Bucket' => $this->bucket,\n 'Key' => $key . \"/\" . $fileName,\n //'SourceFile' => $filePath,\n //'SourceFile' => $file['tmp_name'],\n 'SourceFile' => $filePath,\n 'ACL' => $perm\n ));\n\n $data[$key] = $result['ObjectURL'];\n\n // Delete temperary file\t\t\t\n if (is_file($filePath)) {\n @unlink($filePath);\n }\n }\n } else {\n // Upload file to S3 server\n $result = $this->client->putObject(array(\n 'Bucket' => $this->bucket,\n 'Key' => $folder . \"/\" . $fileName,\n 'SourceFile' => $file['tmp_name'],\n 'ACL' => $perm\n ));\n\n $data['Original'] = $result['ObjectURL'];\n\n // Delete temperary file\t\t\t\n if (is_file($file['tmp_name'])) {\n @unlink($file['tmp_name']);\n }\n }\n }\n\n return $data;\n }\n\n return false;\n }", "function format_size($size) { //pass the whole file location \r\n\t\t $sizes = array(\" Bytes\", \" KB\", \" MB\", \" GB\", \" TB\", \" PB\", \" EB\", \" ZB\", \" YB\");\r\n\t\t if ($size == 0) { return('n/a'); } else {\r\n\t\t return (round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $sizes[$i]); }\r\n\t}", "public function process(array $sizes)\n {\n foreach ($sizes as $format => $size)\n {\n $filename = sprintf(\n '%s-0.png',\n $size['directory'].DIRECTORY_SEPARATOR.$this->file\n );\n\n if (!isset($size['overwrite'])\n || (true == $size['overwrite'])\n || !$this->filesystem->exists($filename))\n {\n $this->resize($size);\n }\n }\n\n return basename($this->file).'-0.png';\n }", "function createThumbnail($sourcePath, $targetPath, $size)\r\n{\r\n $sourcefileName = basename($sourcePath);\r\n $extension = strtolower(pathinfo($sourcefileName,PATHINFO_EXTENSION));\r\n list($currentW, $currentH) = getimagesize($sourcePath);\r\n $ar = $currentW / $currentH;\r\n $image = $extension == 'png' ? imagecreatefrompng($sourcePath) : imagecreatefromjpeg($sourcePath);\r\n $w = $ar > 1 ? $size : $size * $ar;\r\n $h = $ar > 1 ? $size / $ar : $size;\r\n $image2 = imagecreatetruecolor($w, $h);\r\n imagecopyresampled($image2, $image, 0, 0, 0, 0, $w, $h, $currentW, $currentH);\r\n $targetFileName = basename($targetPath);\r\n $targetDir = str_replace($targetFileName, '', $targetPath);\r\n //debug($targetDir);\r\n if (!file_exists($targetDir))\r\n {\r\n mkdir($targetDir, 0777, true);\r\n }\r\n if ($extension == 'png')\r\n {\r\n imagepng($image2, $targetPath);\r\n }\r\n else\r\n {\r\n imagejpeg($image2, $targetPath);\r\n }\r\n}", "function imgUrl($path, $size='')\n{\n\n if ( $size )\n {\n $arrPath = explode('/', $path);\n $arrPath_= explode('-', end($arrPath));\n $oriSize = explode('.', end($arrPath_))[0];\n $path = str_replace($oriSize, $size, $path);\n }\n\n return config('app.media_url').$path;\n}", "function createPhotos($path)\n{\n $path = photoRoot . \"_thumb\" . $path;\n $files = scandir($path);\n $displayedItems = 0;\n foreach ($files as $key => $value) {\n $realPath = realpath($path . DIRECTORY_SEPARATOR . $value);\n if (isValidImage($realPath)) {\n $imageSrc = $path . DIRECTORY_SEPARATOR . $value;\n $imageId = \"photo-\" . $displayedItems;\n include(\"includes/photos/photo_template.php\");\n $displayedItems++;\n }\n }\n}", "abstract protected function getPath();", "public static function add_image_sizes() {\n\t\tadd_image_size( 'newspack-article-block-landscape-large', 1200, 900, true );\n\t\tadd_image_size( 'newspack-article-block-portrait-large', 900, 1200, true );\n\t\tadd_image_size( 'newspack-article-block-square-large', 1200, 1200, true );\n\n\t\tadd_image_size( 'newspack-article-block-landscape-medium', 800, 600, true );\n\t\tadd_image_size( 'newspack-article-block-portrait-medium', 600, 800, true );\n\t\tadd_image_size( 'newspack-article-block-square-medium', 800, 800, true );\n\n\t\tadd_image_size( 'newspack-article-block-landscape-intermediate', 600, 450, true );\n\t\tadd_image_size( 'newspack-article-block-portrait-intermediate', 450, 600, true );\n\t\tadd_image_size( 'newspack-article-block-square-intermediate', 600, 600, true );\n\n\t\tadd_image_size( 'newspack-article-block-landscape-small', 400, 300, true );\n\t\tadd_image_size( 'newspack-article-block-portrait-small', 300, 400, true );\n\t\tadd_image_size( 'newspack-article-block-square-small', 400, 400, true );\n\n\t\tadd_image_size( 'newspack-article-block-landscape-tiny', 200, 150, true );\n\t\tadd_image_size( 'newspack-article-block-portrait-tiny', 150, 200, true );\n\t\tadd_image_size( 'newspack-article-block-square-tiny', 200, 200, true );\n\n\t\tadd_image_size( 'newspack-article-block-uncropped', 1200, 9999, false );\n\t}", "private function checkPath(){\n\t\t\tif(!is_dir($this->cachepath)) {\n\n\t\t\t\t// Set recursive = true to create all parent directories\n\t\t\t\tmkdir($this->cachepath, true);\n\n\t\t\t}\n\n\t\t\t// Check if the media storage path exists\n\t\t\t$this->jsonpath = $this->cachepath . '/json/';\n\n\t\t\t// If the media path doesn't exist\n\t\t\tif(!is_dir($this->jsonpath)){\n\n\t\t\t\t// Make the directory\n\t\t\t\tmkdir($this->jsonpath);\n\t\t\t}\n\n\t\t\t// Check if the assets path exists\n\t\t\t$this->assetpath = $this->cachepath . '/assets/';\n\n\t\t\tif(!is_dir($this->assetpath)){\n\n\t\t\t\t// Make directory\n\t\t\t\tmkdir($this->assetpath);\n\n\t\t\t}\n\n\t\t}", "public function getPictures($size=null, $path=null);", "function path($number) {\n return DIR . pic($number);\n}", "public function createPaths() {\n\t\t$timestamp = (new \\DateTime())->format(\\DateTime::ISO8601);\n\t\t$path = $this->path . $timestamp;\n\t\t$paths['cert'] = $path . '-aws.crt';\n\t\t$paths['key'] = $path . '-aws.key';\n\t\treturn $paths;\n\t}", "function generatePath($path)\n{\n $folders = explode(DIRECTORY_SEPARATOR, $path);\n $currentPath = \"\";\n $pathTitle = \"Menu\";\n $pathLink = \"?\" . urlParam . \"=\";\n include(\"includes/photos/path_template.php\");\n foreach ($folders as $value) {\n if ($value != \"\") {\n $pathTitle = $value;\n $currentPath .= DIRECTORY_SEPARATOR . $value;\n $pathLink = \"?\" . urlParam . \"=\" . $currentPath;\n include(\"includes/photos/path_template.php\");\n }\n }\n}", "public function make($size);", "function bt_intermediate_image_sizes_advanced( $sizes ) {\n\treturn array();\n}", "function createSmall($size = 240){\n\t\t$path = $this->resizeImage($size,\"s\");\n\t\tif($path)\n\t\t\t$this->small = $path;\n\t}", "function custom_image_size_names($sizes) {\n return array_merge($sizes, array(\n 'thumbnail' => ('Thumbnail - Small'),\n 'thumbnail-medium' => ('Thumbnail - Medium'),\n 'thumbnail-large' => ('Thumbnail - Large'),\n 'jumbo' => ('Jumbo')\n ));\n }", "public function build_all() {\n $this->make_dir();\n $this->make_img_dir();\n }", "public function testCreatePath()\n {\n\n }", "protected function _generateThumbs($foreign_id,$image) {\n $sizes = array('320X240','120X76','80X45','120X76');\n $image_path = IMPORT_DIR.$this->model_path.DS.$foreign_id.DS.$image;\n $src = basename($image_path);\n $dir = new Folder(IMPORT_DIR.'x'.DS.$this->model_path.DS.$foreign_id, true, 0775);\n foreach($sizes as $k => $size) {\n $s = explode('X',$size);\n $width = $s[0];\n $height = $s[1];\n $cut = false;\n $img = new SmartImage($image_path);\n if($k <> 3 && !file_exists(IMPORT_DIR.'x'.DS.$this->model_path.DS.$foreign_id.DS.$width.'X'.$height.'_'.$src)) {\n $img->resize($width, $height, $cut);\n $img->saveImage(IMPORT_DIR.'x'.DS.$this->model_path.DS.$foreign_id.DS.$width.'X'.$height.'_'.$src, 85);\n }\n if($k == 3 && !file_exists(IMPORT_DIR.'x'.DS.$this->model_path.DS.$foreign_id.DS.'120X76_cut_'.$src)) {\n $cut = true;\n $img->resize($width, $height, $cut);\n $img->saveImage(IMPORT_DIR.'x'.DS.$this->model_path.DS.$foreign_id.DS.'120X76_cut_'.$src, 85);\n }\n $img->close();\n $this->out($size.' ok');\n }\n return;\n }", "function welt2pixelKoordPath($pathWelt, $minx, $miny, $pixsize) {\n $explosion = explode(' ', $pathWelt);\n for($i = 0; $i < count($explosion); $i++){\n if($explosion[$i] != 'M' AND $explosion[$i] != ''){\n $explosion[$i] = round(($explosion[$i] - $minx) / $pixsize);\n $explosion[$i+1] = round(($explosion[$i+1] - $miny) / $pixsize);\n $i++;\n }\n }\n $path = '';\n for($i = 0; $i < count($explosion); $i++){\n $path .= $explosion[$i].' ';\n }\n return $path;\n }", "public function getPathForResizedImage(File $entity, int $width, int $height, string $format = ''): string;", "function makeThumbs( $selector) {\n\t// select the product from the database\n\t$getProduct = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $selector . \"'\" );\n\t$product = mysql_fetch_assoc( $getProduct );\n\t// get the products parent information\n\t$getParent = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $product['parent'] . \"'\" );\n\t$parent = mysql_fetch_assoc( $getParent );\n\t// set the path for the products gallery\n\tif($product['is_base'] == 1) {\n\t\t$path = './_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t$convPath2 = '/_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t$thumbPath = '/_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/_thumbnails/';\n\t} else {\n\t\t$path = './_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t$convPath2 = '/_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t$thumbPath = '/_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/_thumbnails/';\n\t}\n\n\t// check if the path exists\n\t$i = 0;\n\t$dir = opendir($path);\n\t$list = array();\n\twhile($file = readdir($dir)){\n\t\tif($file != \".\" and $file != \"..\" and $file != \"Thumbs.db\" and $file != \"_thumbnails\"){\n\t\t\t$ctime = filectime($data_path . $file) . \",\" . $file;\n\t\t\t$list[$ctime] = $file;\n\t\t}\n\t}\n\tclosedir($dir);\n\tkrsort($list);\n\n\tforeach($list as $image){\n\t\t$i++;\n\t\t$dirCheck = BASE_THUMBNAIL . $thumbPath;\n\t\t//create directory if it doesn't exist\n\t\tif (!file_exists($dirCheck)) {\n \t\tmkdir($dirCheck, 0755, true);\n\t\t}\n\t\t//get sha1 hash of image\n\t\t$currentHash = (sha1_file($path . $image));\n\t\t//separate parts of image name\n\t\t$thumbImage = $image;\n\t\t$path_parts = pathinfo($thumbImage);\n\t\t$matchedImageName = $path_parts['filename'];\n\t\t//set rest of thumbnail conversion path\n\t\t$smallThumb = '/usr/bin/convert' . ' ' . BASE_THUMBNAIL . $convPath2 . $image . ' -resize x68 ' . BASE_THUMBNAIL . $thumbPath . $path_parts['filename'] . '_sm' . '.' . $path_parts['extension'];\n\t\t$medThumb = '/usr/bin/convert' . ' ' . BASE_THUMBNAIL . $convPath2 . $image . ' -resize x186 ' . BASE_THUMBNAIL . $thumbPath . $path_parts['filename'] . '_med' . '.' . $path_parts['extension'];\n\t\t$qCheckHash = mysql_query( \"SELECT * FROM xxxxxx WHERE thumbhash = '\" . $currentHash . \"' and imgname = '\" . $matchedImageName . \"' and selector = '\" . $selector . \"'\" );\n\t\t$matchedImageName = $path_parts['filename'];\n\t\tif(mysql_num_rows($qCheckHash)>0) {\n\t\t\t//matched with hash, do nothing\n\t\t} else {\n\t\t \t//convert image to thumbnails\n\t\t\texec($smallThumb);\n\t\t\texec($medThumb);\n\t\t\t//insert image information\n\t\t\t$addHash = mysql_query(\"INSERT INTO xxxxxx (thumbhash, selector, imgname) VALUES ('$currentHash','$selector','$matchedImageName')\");\n\t\t}\n\t}\n\tif(mysql_num_rows($qCheckHash)>0) {\n\t \techo $selector . ' ' . $matchedImageName . ' already has thumbnails' . '<br />';\n\t} else {\n\t\techo $selector . ' ' . $matchedImageName . ' thumbnails created' . '<br />';\n\t}\n}", "function setRealPaths (){\n\t\t$this->json_students_schedule['path'] = realpath(dirname(dirname(dirname(dirname(__FILE__))))).'/'.$this->json_main_folder_name.'/'.$this->json_students_schedule['name'].'.json';\n\t\t$this->json_students_schedule['url'] = URL.$this->json_main_folder_name.'/'.$this->json_students_schedule['name'].'.json';\n\t\t\n\t\t$this->json_students_schedule_count['path'] = realpath(dirname(dirname(dirname(dirname(__FILE__))))).'/'.$this->json_main_folder_name.'/'.$this->json_students_schedule_count['name'].'.json';\n\t\t$this->json_students_schedule_count['url'] = URL.$this->json_main_folder_name.'/'.$this->json_students_schedule_count['name'].'.json';\n\t\t\n\t\t$this->json_teachers_schedule['path'] = realpath(dirname(dirname(dirname(dirname(__FILE__))))).'/'.$this->json_main_folder_name.'/'.$this->json_teachers_schedule['name'].'.json';\n\t\t$this->json_teachers_schedule['url'] = URL.$this->json_main_folder_name.'/'.$this->json_teachers_schedule['name'].'.json';\n\n\t\t$this->json_settings['path'] = realpath(dirname(dirname(dirname(dirname(__FILE__))))).'/'.$this->json_main_folder_name.'/'.$this->json_settings['name'].'.json';\n\t\t$this->json_settings['url'] = URL.$this->json_main_folder_name.'/'.$this->json_settings['name'].'.json';\n\t\t\n\t\t$this->python_script_path = realpath(dirname(dirname(__FILE__))).'/'.$this->python_main_folder_name.'/'.$this->python_script_path;\n\t\t\n\t\t$this->python_script_debug_path = realpath(dirname(dirname(__FILE__))).'/'.$this->python_main_folder_name.'/'.$this->python_script_debug_path;\n\t\t\n }", "function custom_image_sizes( $size_names ) {\n $new_sizes = array(\n 'profileThumb' => 'Фото для профиля',\n );\n return array_merge( $size_names, $new_sizes );\n }", "function cp_build_srcset_sizes($small,$medium,$large) {\n\n $sizes = '';\n\n if ( isset( $small ) ) {\n // $sizes['640px'] = $small;\n $sizes .= '(max-width: 640px) '.$small.', ';\n }\n\n if ( isset( $medium ) ) {\n // $sizes['1024px'] = $medium;\n $sizes .= '(max-width: 1024px) '.$medium.', ';\n }\n\n if ( isset( $large ) ) {\n // $sizes['1200px'] = $large;\n $sizes .= $large;\n }\n\n return $sizes;\n\n}", "function getImageFolderUrl($url, $size = ImageHelper::IMAGE_SMALL)\r\n {\r\n return $url.$size.'/';\r\n }", "public function create_image_sizes()\n {\n\n return array();\n }", "private function createImagePath(array $row, $size)\n {\n return sprintf('%s/%s/%s', Module::PARAM_ROOM_GALLERY_PATH . $row['id'], $size, $row['file']);\n }", "function files_resizeImg($fileName, $sizes = array()) {\n\n # Base name without extention\n $fileParts = pathinfo($fileName);\n\n $baseName = $fileParts['filename'];\n\n # Create the new image\n $newImage = new \\Eventviva\\ImageResize($fileName);\n\n if (is_array($sizes)) {\n foreach ($sizes as $size) {\n grace_debug(\"Creating a new version of the image: \" . $size);\n $newImage->resizeToMax($size);\n $newImage->save(str_replace($baseName, $baseName . \"_\" . $size, $fileName));\n }\n } else {\n grace_debug(\"Resizing image and keeping the same name\");\n $newImage->resizeToMax($sizes);\n $newImage->save($fileName);\n }\n\n return true;\n}", "function image_arr_resize_to_folder($source_pic, $destination_folder, $filename, $max_width, $max_height)\n{\n $tmp_dest = $destination_folder;\n for ($index = 0; $index < count($source_pic['tmp_name']); $index++) {\n $destination_folder = $tmp_dest;\n $image_info = getimagesize($source_pic['tmp_name'][$index]);\n $source_pic_name = $source_pic['name'][$index];\n $source_pic_tmpname = $source_pic['tmp_name'][$index];\n $source_pic_size = $source_pic['size'][$index];\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].gif\";\n $namafile = \"$filename[$index].gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].png\";\n $namafile = \"$filename[$index].png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].bmp\";\n $namafile = \"$filename[$index].bmp\";\n }\n break;\n }\n\n //chmod($destination_pic,0777);\n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n $url[] = $namafile;\n }\n return ($url);\n}", "abstract public function generateTo($path);", "public function resize(){\n\t\t$imgSplit = explode(\"/\",$this->image);\n\t\t$srcName = end($imgSplit);\n\t\t//$srcUrl = str_ireplace($srcName, \"\", $this->image);\n\t\t$srcUrl = str_ireplace($srcName, \"\", $this->image);\n\t\t\n\t\t\n\t\t//$srcPath = $_SERVER['DOCUMENT_ROOT'] .\"/resize/\". str_ireplace($srcName, \"\", $this->image);\n\t\t//$srcPath = $this->image;\n\t\t$srcPath = $srcUrl;\n\t\t// Get extension\n \n\t\t$split = explode(\".\",$srcName);\n\t\t$ext = strtolower($split[1]);\n\n\t\t// Misc variables\n\t\t$rszUrl = $srcUrl . $this->folder;\n\t\t$rszName = $this->prefix . $srcName;\n\t\t$rszPath = $this->folder;\n\t\t$rszQuality = $this->quality;\n\t\t\n\t\t// If save path doesn't exist, create it\n\t\t//echo \"<br />resize Path : $rszPath <br />\";\n\t\t//echo \"<br />and :\".$targetImage;\n \n\t\tif (!file_exists($rszPath)){ mkdir($rszPath, 0777);\t}\n\t\t\t\n\t\t// If the resized img doesn't exist, create it\n\t\t\n\t\t//if(file_exists(\"$rszPath/$rszName\") || !file_exists(\"$rszPath/$rszName\")){ \n\t\t\t\n\t\t\tswitch($ext){\n\t\t\t\tcase('jpg'): $srcImage = imagecreatefromjpeg(\"$srcPath$srcName\"); break;\n\t\t\t\tcase('jpeg'): $srcImage = imagecreatefromjpeg(\"$srcPath$srcName\"); break;\n\t\t\t\tcase('png'): $srcImage = imagecreatefrompng(\"$srcPath$srcName\"); if($rszQuality==10){ $rszQuality=9; } break;\n\t\t\t\tcase('gif'): $srcImage = imagecreatefromgif(\"$srcPath$srcName\"); break;\n\t\t\t}\n\t\t\t\n\t\t\t$srcWidth = imagesx($srcImage);\n\t\t\t$srcHeight = imagesy($srcImage);\n\t\t\t\n\t\t\t// Determine specs based on type\n\t\t\t$rszWidth = $this->width;\n\t\t\t$rszHeight = $this->height;\n\t\t\t/*if(strtolower($this->type)==\"width\"){\n\t\t\t\t$rszWidth = $this->max;\n\t\t\t\t$rszHeight = $srcHeight/($srcWidth/$rszWidth);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$rszHeight = $this->max;\n\t\t\t\t$rszWidth = $srcWidth/($srcHeight/$rszHeight);\n\t\t\t}\n\t\t\t*/\n\t\t\t\n\t\t\t// Determine specs if crop applied\n\t\t\t\n\t\t\t$srcX = 0; $srcY = 0;\n\t\t\t$srcNewWidth = $srcWidth; $srcNewHeight = $srcHeight;\n\t\t\t$dest = $srcImage;\n\t\t\t\n\t\t\t// Square crop\n\t\t\t\n\t\t\tif($this->square==true){\n\t\t\t\t$rszWidth = $this->width;\n\t\t\t\t$rszHeight = $this->height;\n\t\t\t\t\n\t\t\t\tif($srcHeight>$srcWidth){\n\t\t\t\t\t$srcX = 0;\n\t\t\t\t\t$srcY = floor(($srcHeight-$srcWidth)/2);\n\t\t\t\t\t$srcNewHeight = $srcWidth;\n\t\t\t\t\t$srcNewWidth = $srcWidth;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($srcWidth>$srcHeight){\n\t\t\t\t\t$srcX = floor(($srcWidth-$srcHeight)/2);\n\t\t\t\t\t$srcY = 0;\n\t\t\t\t\t$srcNewHeight = $srcHeight;\n\t\t\t\t\t$srcNewWidth = $srcHeight;\n\t\t\t\t}\n\t\t\t\t// Create new image with a new width and height.\n\t\t\t\t$dest = imagecreatetruecolor($srcNewWidth, $srcNewHeight);\n\t\t\t\t$this->resize_png($this->image,$srcImage,$dest);\n\t\t\t\t// Copy new image to memory after cropping.\n\t\t\t\timagecopy($dest, $srcImage, 0, 0, $srcX, $srcY, $srcNewWidth, $srcNewHeight);\n\t\t\t}\n\t\t\t\t\n\t\t\t$targetImage = imagecreatetruecolor($rszWidth,$rszHeight);\n\t\t\t\n\t\t\t/* starts */\n\t\t\tif($ext == 'png'){\n\t\t\t\t\n\t\t\t\t$this->resize_png($this->image,$srcImage,$targetImage);\n\t\t\t\t// Save file, quality=9, Add filters... although sometimes better without.\n\t\t\t\t//imagepng( $d, substr($rszUrl . $rszName,1), 9, PNG_ALL_FILTERS);\n\t\t\t}\n\t\t\t/* ends */\n\t\t\t\n\t\t\t\t\n\t\t\timagecopyresampled($targetImage,$dest,0,0,0,0,$rszWidth,$rszHeight,$srcNewWidth,$srcNewHeight);\n\t\t\t\n\t\t\tswitch($ext){\n\t\t\t\tcase('jpg'): imagejpeg($targetImage, \"$rszPath/$rszName\", $rszQuality * 10); break;\n\t\t\t\tcase('jpeg'): imagejpeg($targetImage, \"$rszPath/$rszName\", $rszQuality * 10);\tbreak;\n\t\t\t\tcase('png'): imagepng($targetImage, \"$rszPath/$rszName\", $rszQuality); break;\n\t\t\t\tcase('gif'): imagegif($targetImage, \"$rszPath/$rszName\"); break;\n\t\t\t}\n\t\t\t\n\t\t//}\n\t\t\n\t\t// Return the resized image\n\t\t\n\t\treturn($rszUrl . $rszName);\n\t\t\n\t\t// Clear temps\n\t\timagedestroy($dest);\n\t\timagedestroy($targetImage);\n\t\t\n\t}", "abstract public function getPath();", "protected function createPath()\n {\n if (is_dir($this->path)) {\n $cmd = \"rm -rf {$this->path}/*\";\n system($cmd);\n } else {\n $cmd = \"mkdir -p {$this->path}\";\n system($cmd);\n }\n }", "function MoveImages($root,$oldname,$usrid,$dummy=false,$innerfolder='')\n\t{\n\t$folder = $root .$usrid.$innerfolder.'/';\n\t$finalname = $folder.'normal.jpg';\n\n\tif(preg_match('/[.]/', $folder)) die();\n\n\tif(!file_exists($folder))\n\t\tmkdir($folder, 0777,true);\n\n\t$ext_arr = split(\"\\.\",$form->image);\n\t$ext = strtolower($ext_arr[count($ext_arr)-1]); //Get the last extension\n\n\trequire('../lib/resize.php');\n\tif ($ext=='png')//if png convert it to jpg\n\t\t{\n\t\t$input = imagecreatefrompng($oldname);\n\t\tlist($width, $height) = getimagesize($oldname);\n\t\t$output = imagecreatetruecolor($width, $height);\n\t\t$white = imagecolorallocate($output, 255, 255, 255);\n\t\timagefilledrectangle($output, 0, 0, $width, $height, $white);\n\t\timagecopy($output, $input, 0, 0, 0, 0, $width, $height);\n\t\timagejpeg($output,$finalname);\n\t\tunlink($oldname);\n\n\t\t//create thumbnail and regular size\n\t\t$image = new SimpleImage();\n\t\t$image->load($finalname);\n\t\t$image->resize(264,264);\n\n\t\t$image2 = new SimpleImage();\n\t\t$image2->load($finalname);\n\t\t$image2->resize(22,22);\n\n\t\t$image3 = new SimpleImage();\n\t\t$image3->load($finalname);\n\t\t$image3->resize(224,224);\n\n\t\t$image->save($folder.'medium.jpg');\n\t\t$image2->save($folder.'mini.jpg');\n\t\t$image3->save($folder.'small.jpg');\n\t\t}\n\t\telse\n\t\t{\n\t\tcopy($oldname,$finalname);\n\t\tif ($dummy!=true)\n\t\t\tunlink($oldname);\n\t\t//create thumbnail and regular size\n\t\t$image = new SimpleImage();\n\t\t$image->load($finalname);\n\t\t$image->resize(264,264);\n\n\t\t$image2 = new SimpleImage();\n\t\t$image2->load($finalname);\n\t\t$image2->resize(22,22);\n\n\t\t$image3 = new SimpleImage();\n\t\t$image3->load($finalname);\n\t\t$image3->resize(224,224);\n\n\t\t$image->save($folder.'medium.jpg');\n\t\t$image2->save($folder.'mini.jpg');\n\t\t$image3->save($folder.'small.jpg');\n\t\t}\n\t}", "function MoveImages($root,$oldname,$usrid,$dummy=false,$innerfolder='')\n\t{\n\t$folder = $root .$usrid.$innerfolder.'/';\n\t$finalname = $folder.'normal.jpg';\n\t\n\tif(preg_match('/[.]/', $folder)) die();\n\n\tif(!file_exists($folder)) \n\t\tmkdir($folder, 0777,true);\n\n\t$ext_arr = split(\"\\.\",$form->image);\n\t$ext = strtolower($ext_arr[count($ext_arr)-1]); //Get the last extension\n\n\trequire('resize.php');\n\tif ($ext=='png')//if png convert it to jpg\n\t\t{\n\t\t$input = imagecreatefrompng($oldname);\n\t\tlist($width, $height) = getimagesize($oldname);\n\t\t$output = imagecreatetruecolor($width, $height);\n\t\t$white = imagecolorallocate($output, 255, 255, 255);\n\t\timagefilledrectangle($output, 0, 0, $width, $height, $white);\n\t\timagecopy($output, $input, 0, 0, 0, 0, $width, $height);\n\t\timagejpeg($output,$finalname);\n\t\tunlink($oldname);\n\n\t\t//create thumbnail and regular size\n\t\t$image = new SimpleImage();\n\t\t$image->load($finalname);\n\t\t$image->resize(264,264);\n\t\t\n\t\t$image2 = new SimpleImage();\n\t\t$image2->load($finalname);\n\t\t$image2->resize(22,22);\n\n\t\t$image3 = new SimpleImage();\n\t\t$image3->load($finalname);\n\t\t$image3->resize(224,224);\n\n\t\t$image->save($folder.'medium.jpg');\n\t\t$image2->save($folder.'mini.jpg');\n\t\t$image3->save($folder.'small.jpg');\n\t\t}\n\t\telse\n\t\t{\n\t\tcopy($oldname,$finalname);\n\t\tif ($dummy!=true)\n\t\t\tunlink($oldname);\n\t\t//create thumbnail and regular size\n\t\t$image = new SimpleImage();\n\t\t$image->load($finalname);\n\t\t$image->resize(264,264);\n\t\t\n\t\t$image2 = new SimpleImage();\n\t\t$image2->load($finalname);\n\t\t$image2->resize(22,22);\n\n\t\t$image3 = new SimpleImage();\n\t\t$image3->load($finalname);\n\t\t$image3->resize(224,224);\n\n\t\t$image->save($folder.'medium.jpg');\n\t\t$image2->save($folder.'mini.jpg');\n\t\t$image3->save($folder.'small.jpg');\n\t\t}\n\t}", "public function createPath() {\n\t\treturn $this->_createPath($this->path()); \n\t}", "function make_thumb($folder,$src,$dest,$thumb_width) {\r\n $source_image = imagecreatefromjpeg($folder.'/'.$src);\r\n $width = imagesx($source_image);\r\n $height = imagesy($source_image); \r\n $thumb_height = floor($height*($thumb_width/$width));\r\n $virtual_image = imagecreatetruecolor($thumb_width,$thumb_height);\r\n imagecopyresampled($virtual_image,$source_image,0,0,0,0,$thumb_width,$thumb_height,$width,$height);\r\n imagejpeg($virtual_image,$dest,100);\r\n }", "public function getPathToMiniImage()\n {\n $path = $this->getPath('tmb');\n \n if(!file_exists($path)){\n $path = false;\n }\n return $path;\n }", "function showBigImg($aPath, $aIdx)\n{\n global $files, $isDir; \n\n echo \"<center>\";\n echo \"<table border=\\\"0\\\" cellspacing=\\\"10\\\" cellpadding=\\\"0\\\">\";\n\n if($isDir[$files[$aIdx]]) {\n showDir($aPath, $files[$aIdx]);\n } else {\n // generate the html\n echo \"<td>\";\n echo \"<center><img border=\\\"0\\\" src=\\\"\".$aPath.$files[$aIdx].\"\\\"></img></center>\";\n echo \"</td>\";\n\n echo \"</table>\";\n echo \"</center>\";\n }\n}", "function __createFileSizesFile($sid, $files)\n {\n if (file_exists($this->uploadDir.DS.$sid.'.filesizes')) \n return true;\n \n $data = array();\n $fileCounter = 0; \n while (true)\n { \n if (isset($files['upfile_'.$fileCounter]))\n { \n $fn = $files['upfile_'.$fileCounter]; \n $data[] = $fn;\n $data[] = @filesize($this->uploadDir.DS.$fn);\n }\n else \n break;\n \n $fileCounter++;\n }\n \n file_put_contents($this->uploadDir.DS.$sid.'.filesizes', join(\"\\n\", $data));\n }", "function pathCompany()\n{\n return 'files/avatar/company/';\n}", "private function buildDestPath($imgsrc, $filename, $basedir, $destroot){\n\n \t$dirlist = array('1920'=>array(),'848'=>array('100','200'),'440'=>array());\n\n \t$destroot .= DIRECTORY_SEPARATOR . $basedir;\n\n \tforeach ($dirlist as $key => $value) {\n \t\t$imgsizedir = $destroot . DIRECTORY_SEPARATOR . $key;\n\n \t\t//create folder for parent\n \t\taddFolders($imgsizedir);\n\n \t\tresizeImage($imgsrc, $filename, $imgsizedir, $key);\n\n \t\tif(!empty($value)){\n \t\t\tforeach($value as $dt=>$dn){\n \t\t\t\taddFolders($imgsizedir . DIRECTORY_SEPARATOR . $dn);\n \t\t\t\tresizeImage($imgsrc, $filename, $imgsizedir . DIRECTORY_SEPARATOR . $dn, $dn);\n \t\t\t}\n \t\t}\n \t}\n }", "private function _calculate_size () {\n # Calculate thumbnail size\n $thumb_w = $this->src_w;\n $thumb_h = $this->src_h;\n $thumb_w_name = $this->src_w;\n $thumb_h_name = $this->src_h;\n\n if ($this->dest_scale > 0) {\n $thumb_w = intval($this->src_w * $this->dest_scale / 100);\n $thumb_h = intval($this->src_h * $this->dest_scale / 100);\n $thumb_w_name = $thumb_w;\n $thumb_h_name = $thumb_h;\n } elseif ($this->dest_square) {\n if ($this->dest_w > 0) {\n $thumb_w = $this->dest_w;\n $thumb_h = $this->dest_w;\n $thumb_w_name = $this->dest_w;\n $thumb_h_name = $this->dest_w;\n } elseif($this->dest_h > 0) {\n $thumb_w = $this->dest_h;\n $thumb_h = $this->dest_h;\n $thumb_w_name = $this->dest_h;\n $thumb_h_name = $this->dest_h;\n } else {\n // dest_w and dest_h is unset;\n if($this->src_w > $this->src_h){\n $thumb_w = $this->src_h;\n $thumb_h = $this->src_h;\n $thumb_w_name = $this->src_h;\n $thumb_h_name = $this->src_h;\n } else {\n $thumb_w = $this->src_w;\n $thumb_h = $this->src_w;\n $thumb_w_name = $this->src_w;\n $thumb_h_name = $this->src_w;\n }\n }\n } elseif ($this->dest_w > 0 || $this->dest_h > 0) {\n $thumb_w_name = 'auto';\n $thumb_h_name = 'auto';\n $x = $this->dest_w;\n $y = $this->dest_h;\n $pct = $this->dest_w > 0 ? ($x / $thumb_w) : ($y / $thumb_h);\n $thumb_w = (int)($thumb_w * $pct);\n $thumb_h = (int)($thumb_h * $pct);\n if ($this->dest_w > 0 && $thumb_w == $this->dest_w ) $thumb_w_name = $this->dest_w;\n if ($this->dest_h > 0 && $thumb_h == $this->dest_h ) $thumb_h_name = $this->dest_h;\n }\n\n return array($thumb_w, $thumb_h, $thumb_w_name, $thumb_h_name);\n }", "function resize( $idx, $size_code = 0 ){\n if(empty($idx)) {\n // * return empty string if idx is empty\n return \"\";\n }\n\n $image = $this->dsp->db->SelectRow( 'select * from images where idx = ?--', (int)$idx );\n\n if(empty($image)) {\n // * if we dont find eny records related with incoming idx we return empty string\n return \"\";\n }\n $ext = $this->image_type_to_extension( (int)$image['type'] );\n //$path = $this->th_dir . $size_code . '/' . $this->subfolder( $image['name'] ) . '/' . $image['name'] . '-' . $this->hashme($image['name']) . '.' . $ext;\n $path = (!empty($size_code) ? ($size_code. '/') : \"0/\") . $this->subfolder( $image['name'] ) . '/' . $image['name'] . '-' . $this->hashme($image['name']) . '.' . $ext;\n return $path;\n }", "public function getSize($path){}", "function env_image_sizes($sizes){\n\t$custom_sizes = array(\n\t\t'page-fullwidth-image' => 'Page Full-Width Image',\n\t\t'page-cwidth-image' => 'Page Content-Width Image'\n\t);\n\treturn array_merge( $sizes, $custom_sizes );\n}", "function PicPathName($id, $size)\n{\n global $config;\n $f = MakePicFileBaseName($id, $size);\n return $config[\"UploadDir\"] . \"pics/\". $f;\n}", "public function resize() {\n // korzystamy potem z odpowiednich funkcji GD\n $i = explode('.', $this->file_name);\n \n // rozszerzeniem pliku jest ostatni element tablicy $i\n $rozszerzenie = end($i);\n $rozszerzenie = strtolower($rozszerzenie);\n \n // pobieramy rozmiary obrazka\n list($this->image_real_x, $this->image_real_y) = getimagesize($this->serverPath.'/'.$this->file_bufor_path.$this->file_name);\n\n //wyliczanie nowych rozmiarów obrazka w zależności od wybranych opcji\n if($this->image_resize) {\n\t if($this->image_ratio_x) { if($this->image_real_y > $this->image_y) $this->calculateImageSize('ratio_x');}\n\t elseif($this->image_ratio_y) { if($this->image_real_x > $this->image_x) $this->calculateImageSize('ratio_y'); }\n\t elseif($this->image_ratio) { \n\t \t//sprawdza czy zdjęcie jest poziome (true: ustawia wysokość i dopasowuje szerokość; false: odwrotnie)\n\t \tif($this->image_real_x >= $this->image_real_y) $this->calculateImageSize('ratio_x');\n\t \telse $this->calculateImageSize('ratio_y');\t\n\t }\n\t else {\n\t \t$this->image_new_x = $this->image_x;\n \t\t$this->image_new_y = $this->image_y;\n\t }\n\t }\n else {\n \t$this->image_new_x = $this->image_real_x;\n \t$this->image_new_y = $this->image_real_y;\n } \n\n if(!$this->image_new_x && !$this->image_new_y) //sprawdzić\n {\n \t$this->image_new_y = $this->image_real_y;\n \t$this->image_new_x = $this->image_real_x;\n }\n\n // tworzymy nowy obrazek o zadanym rozmiarze\n // korzystamy tu z funkcji biblioteki GD\n // która musi być dołączona do twojej instalacji PHP,\n // najpierw tworzymy canvas.\n ini_set('memory_limit','1000M');\n ini_set(\"gd.jpeg_ignore_warning\", 1);\n set_time_limit(600); //przy dużych plikach duży czas oczekiwania (trzeba zmienić też max_execution_time w php.ini)\n\n $canvas = imagecreatetruecolor($this->image_new_x, $this->image_new_y);\n switch($rozszerzenie) {\n case 'jpeg':\n $org = imagecreatefromjpeg($this->serverPath.'/'.$this->file_bufor_path.$this->file_name);\n break;\n case 'jpg':\n $org = imagecreatefromjpeg($this->serverPath.'/'.$this->file_bufor_path.$this->file_name);\n break;\n case 'gif':\n $org = imagecreatefromgif($this->serverPath.'/'.$this->file_bufor_path.$this->file_name);\n break;\n case 'png':\n $org = imagecreatefrompng($this->serverPath.'/'.$this->file_bufor_path.$this->file_name);\n break;\n }\n\n // kopiujemy obraz na nowy canvas\n imagecopyresampled($canvas, $org, 0, 0, 0, 0,$this->image_new_x, $this->image_new_y, $this->image_real_x, $this->image_real_y);\n\n // zapisujemy jako jpeg \n if(imagejpeg($canvas, $this->newAddress, $this->image_quality)) return true;\n else return false;\n\t}", "public function pathStorage() {\n $year = date(\"Y\");\n $month = date(\"m\");\n $day = date(\"d\");\n $week = '';\n switch ($day) {\n case $day > 0 && $day <= 7: {\n $week .= 'week1';\n break;\n }\n case $day > 7 && $day <= 14: {\n $week .= 'week2';\n break;\n }\n case $day > 14 && $day <= 21: {\n $week .= 'week3';\n break;\n }\n case $day > 21 && $day <= 31: {\n $week .= 'week4';\n break;\n }\n }\n $path = \"{$year}/{$month}/{$week}\";\n\n return $path;\n\n }", "private function writeImageOnDisk($basePath, $newPath, $destWidth = NULL, $destHeight = NULL, $imageTypes = NULL, $parentPath = NULL)\n\t{\n\t\tlist($sourceWidth, $sourceHeight, $type, $attr) = getimagesize($basePath);\n\t\tif (!$sourceWidth)\n\t\t{\n\t\t\t$this->setError(400, 'Image width was null');\n\t\t\treturn false;\n\t\t}\n\t\tif ($destWidth == NULL) $destWidth = $sourceWidth;\n\t\tif ($destHeight == NULL) $destHeight = $sourceHeight;\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\t$sourceImage = imagecreatefromgif($basePath);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$sourceImage = imagecreatefrompng($basePath);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\tdefault:\n\t\t\t\t$sourceImage = imagecreatefromjpeg($basePath);\n\t\t\t\tbreak;\n\t\t}\n\t\n\t\t$widthDiff = $destWidth / $sourceWidth;\n\t\t$heightDiff = $destHeight / $sourceHeight;\n\t\t\n\t\tif ($widthDiff > 1 AND $heightDiff > 1)\n\t\t{\n\t\t\t$nextWidth = $sourceWidth;\n\t\t\t$nextHeight = $sourceHeight;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 2 OR ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 AND $widthDiff > $heightDiff))\n\t\t\t{\n\t\t\t\t$nextHeight = $destHeight;\n\t\t\t\t$nextWidth = (int)(($sourceWidth * $nextHeight) / $sourceHeight);\n\t\t\t\t$destWidth = ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 ? $destWidth : $nextWidth);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nextWidth = $destWidth;\n\t\t\t\t$nextHeight = (int)($sourceHeight * $destWidth / $sourceWidth);\n\t\t\t\t$destHeight = ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 ? $destHeight : $nextHeight);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$borderWidth = (int)(($destWidth - $nextWidth) / 2);\n\t\t$borderHeight = (int)(($destHeight - $nextHeight) / 2);\n\t\t\n\t\t// Build the image\n\t\tif (\n\t\t\t!($destImage = imagecreatetruecolor($destWidth, $destHeight)) ||\t\n\t\t\t!($white = imagecolorallocate($destImage, 255, 255, 255)) ||\n\t\t\t!imagefill($destImage, 0, 0, $white) ||\n\t\t\t!imagecopyresampled($destImage, $sourceImage, $borderWidth, $borderHeight, 0, 0, $nextWidth, $nextHeight, $sourceWidth, $sourceHeight) ||\n\t\t\t!imagecolortransparent($destImage, $white)\n\t\t)\n\t\t{\n\t\t\t$this->setError(500, 'Unable to build the image \"'.str_replace(_PS_ROOT_DIR_, '[SHOP_ROOT_DIR]', $newPath).'\".');\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\t// Write it on disk\n\t\t$imaged = false;\n\t\tswitch ($this->_imgExtension)\n\t\t{\n\t\t\tcase 'gif':\n\t\t\t\t$imaged = imagegif($destImage, $newPath);\n\t\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t\t$imaged = imagepng($destImage, $newPath, 7);\n\t\t\t\tbreak;\n\t\t\tcase 'jpeg':\n\t\t\tdefault:\n\t\t\t\t$imaged = imagejpeg($destImage, $newPath, 90);\n\t\t\t\tbreak;\n\t\t}\n\t\timagedestroy($destImage);\n\t\tif (!$imaged)\n\t\t{\n\t\t\t$this->setError(500, 'Unable to write the image \"'.str_replace(_PS_ROOT_DIR_, '[SHOP_ROOT_DIR]', $newPath).'\".');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Write image declinations if present\n\t\tif ($imageTypes)\n\t\t{\n\t\t\tforeach ($imageTypes as $imageType)\n\t\t\t{\n\t\t\t\tif ($this->_defaultImage)\n\t\t\t\t\t$declination_path = $parentPath.$this->_urlSegment[3].'-default-'.$imageType['name'].'.jpg';\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($this->_imageType == 'products')\n\t\t\t\t\t{\n\t\t\t\t\t\t$declination_path = $parentPath.$this->_urlSegment[2].'-'.$this->_productImageDeclinationId.'-'.$imageType['name'].'.jpg';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$declination_path = $parentPath.$this->_urlSegment[2].'-'.$imageType['name'].'.jpg';\n\t\t\t\t}\n\t\t\t\tif (!$this->writeImageOnDisk($basePath, $declination_path, $imageType['width'], $imageType['height']))\n\t\t\t\t{\n\t\t\t\t\t$this->setError(500, 'Unable to save the declination \"'.$imageType['name'].'\" of this image.');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn !$this->hasErrors() ? $newPath : false;\n\t}", "function createSquare($size = 75){\n\t\t$path = $this->resizeImageStrict($size,$size,\"sq\");\n\t\tif($path)\n\t\t\t$this->square = $path;\n\t}", "function eino_custom_name_image_sizes( $sizes ) {\n\n $sizes['eino-thumbnail-download'] = __( 'Eino Download Thumbnail', 'eino' );\n\t$sizes['eino-bigger-image'] = __( 'Eino Bigger Image', 'eino' );\n\t\n return $sizes;\n}", "protected function makeImageDirectories($path)\n {\n if(! is_dir($path))\n {\n mkdir($path);\n }\n if(! is_dir($path.'/large'))\n {\n mkdir($path.'/large');\n }\n if(! is_dir($path.'/medium'))\n {\n mkdir($path.'/medium');\n }\n if(! is_dir($path.'/small'))\n {\n mkdir($path.'/small');\n }\n }", "function wd_add_image_sizes() {\n\n\t// add discography image sizes\n\tadd_image_size( 'CD', 400, 400, true );\n\tadd_image_size( 'DVD', 400, 570, true );\n}", "public function generateThumbnails() {\n\t\tif (empty($this->objects)) {\n\t\t\t$this->readObjects();\n\t\t}\n\t\t\n\t\tforeach ($this->objects as $avatar) {\n\t\t\t$adapter = ImageHandler::getInstance()->getAdapter();\n\t\t\t$adapter->loadFile($avatar->getLocation());\n\t\t\t\n\t\t\tforeach (UserAvatar::$avatarThumbnailSizes as $size) {\n\t\t\t\tif ($avatar->width <= $size && $avatar->height <= $size) break 2;\n\t\t\t\t\n\t\t\t\t$thumbnail = $adapter->createThumbnail($size, $size, false);\n\t\t\t\t$adapter->writeImage($thumbnail, $avatar->getLocation($size));\n\t\t\t}\n\t\t}\n\t}", "private function setupDirectories()\n {\n // Check if the internal directory is present\n if(!file_exists($dir = config('assetprocessor.cache.directory')))\n {\n // It doesn't, so make the folder\n mkdir($dir, 0777, true);\n }\n\n // Check if the external directory is available\n if(!file_exists($dir = config('assetprocessor.cache.external', config('assetprocessor.cache.directory'))))\n {\n // It doesn't, so make the folder\n mkdir($dir, 0777, true);\n }\n\n // Check if the external directory is available (CSS)\n if(!file_exists($dir = config('assetprocessor.cache.external', config('assetprocessor.cache.directory')) . '/css'))\n {\n // It doesn't, so make the folder\n mkdir($dir, 0777, true);\n }\n\n // Check if the external directory is available (JavaScript)\n if(!file_exists($dir = config('assetprocessor.cache.external', config('assetprocessor.cache.directory')) . '/js'))\n {\n // It doesn't, so make the folder\n mkdir($dir, 0777, true);\n }\n }", "function resizeImage($filename, $filesizes) {\n /// $imagick = new \\Imagick(realpath($imagePath));\n /// https://stackoverflow.com/questions/34687115/image-color-ruined-while-resizing-it-using-imagecopyresampled;\n\n\n\n list($width, $height) = getimagesize( $filename);\n\n //split filename on the dot.\n $extractFile = $this->extractFilename($filename , '/');\n $folder = $extractFile[0] . '/';\n $fileExt = $this->extractFilename(substr($extractFile[1], 1), '.');\n\n foreach ($filesizes as $key => $maxWidth) {\n\n $useUploadFolder = $folder . '_'. $key ;\n $this->createFolderIfnotExist($useUploadFolder);\n\n $thumbFilename = $useUploadFolder . '/' . $fileExt[0] . $fileExt[1];\n\n if(file_exists($thumbFilename) && !$this->overwrite){\n $thumbFilename = $useUploadFolder . '/' . $fileExt[0] . '-' . date('ymdHis'). $fileExt[1];\n }\n\n // calculate new sizes\n $percent = ($maxWidth / $width);\n if($percent > 1){\n $percent = 1;\n }\n $newwidth = $width * $percent;\n $newheight = $height * $percent;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n\n if($fileExt[1] === '.png'){\n $source = imagecreatefrompng( $filename);\n imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $thumbFilename , 9);\n }else if($fileExt[1] === '.gif'){\n $source = imagecreatefromgif( $filename);\n imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagegif($thumb, $thumbFilename );\n }else{\n $source = imagecreatefromjpeg( $filename);\n imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagejpeg($thumb, $thumbFilename , 100);\n }\n\n imagedestroy($thumb);\n $this->success[] = [$thumbFilename,$newwidth, $newheight];\n }\n }" ]
[ "0.6728006", "0.62277466", "0.61977196", "0.6042613", "0.5916339", "0.5815982", "0.5795479", "0.5735102", "0.573065", "0.5697461", "0.56590736", "0.5630438", "0.5578921", "0.5565444", "0.5544388", "0.5541741", "0.5481829", "0.54710144", "0.54417497", "0.5435088", "0.54345137", "0.54231095", "0.54219884", "0.54034173", "0.5402377", "0.53981113", "0.5392481", "0.53904295", "0.5381659", "0.5379481", "0.53781706", "0.53750116", "0.53682387", "0.5358223", "0.53557247", "0.53361607", "0.53344417", "0.52901024", "0.5289635", "0.5288161", "0.52871156", "0.5285757", "0.52838314", "0.5279033", "0.526972", "0.52678776", "0.52668387", "0.52651125", "0.5259715", "0.52572733", "0.5252189", "0.52500397", "0.5246895", "0.52423304", "0.5239629", "0.52336574", "0.5213302", "0.5210487", "0.5202949", "0.51913756", "0.51911795", "0.51841927", "0.5172807", "0.5170466", "0.5168972", "0.516259", "0.51618576", "0.51581675", "0.5154962", "0.5145212", "0.51430637", "0.51333493", "0.51311463", "0.5131021", "0.5127722", "0.5124519", "0.5119975", "0.5119471", "0.511899", "0.51072437", "0.5103763", "0.5103063", "0.5101997", "0.5099106", "0.5094256", "0.50887746", "0.50852954", "0.50807333", "0.50778747", "0.5072596", "0.506593", "0.5065842", "0.50566244", "0.50564086", "0.50535417", "0.5053327", "0.50495076", "0.504077", "0.5034711", "0.5034682" ]
0.7138257
0
Extracts the first available item Return null if there are no items
Извлекает первый доступный элемент, возвращает null, если элементов нет
public function first() { $item = reset($this->items); return $item ?: null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFirst()\n {\n $first = reset($this->items);\n return $first !== false ? $first : null;\n }", "public function first()\n {\n if ($this->fetch()->totalItems) {\n return $this->fetch()->items[0];\n }\n\n return null;\n }", "public function one()\n {\n return isset($this->items[0]) ? $this->items[0] : null;\n }", "public function getFirst() {\n return reset($this->items);\n }", "public function first()\n {\n return reset($this->items);\n }", "public function first () {\n\t\tif ($this->h === null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn $this->h->item;\n\t\t}\n\t}", "public function firstItem(): ?int;", "public function fetchItem() {\n return array_shift($this->items);\n }", "public function first()\n {\n return array_values($this->items)[0];\n }", "public function first()\n\t{\n\t\treturn (count($results = call_user_func_array(array($this->take(1), 'get'), func_get_args())) > 0) ? $results[0] : null;\n\t}", "public function first() {\n foreach ($this as $value) {\n return $value;\n }\n\n return null;\n }", "public function first()\n\t{\n\t\treturn isset( $this->data[0] ) ? $this->data[0] : null;\n\t}", "public function first()\n {\n $this->rewind();\n\n if (count($this->current_result)) {\n return $this->current_result[0];\n }\n }", "public function first(){\n if(empty($this->items))\n throw new ListException(\"Item empty\");\n\n return $this->items[0];\n }", "public function first()\n {\n $this->get();\n\n return array_shift($this->results);\n }", "public function first()\n {\n return $this->items->first();\n }", "public function first() {\n return count($this) > 0 ? $this[0] : null;\n }", "public function getSingleItem()\n {\n if (count($this) === 1) {\n return reset($this);\n }\n\n return $this->getEmpty();\n }", "public function getFirstAvailablePosition() {\r\n $position = $this->getFirstPosition();\r\n while ($position <= $this->getLastPosition()) {\r\n if (!isset($this->_equipementsByPosition[$position])) {\r\n return $position;\r\n }\r\n $position++;\r\n }\r\n return null;\r\n }", "public function first() {\r\n\t return $this->count() > 0 ? $this->_collection[0] : null;\r\n\t}", "public function getOne()\n {\n if ($this->count() > 0)\n {\n $this->seek(0);\n return $this->current();\n } else\n return null;\n }", "public function getOne()\n {\n if ($this->count() > 0)\n {\n $this->seek(0);\n return $this->current();\n } else\n return null;\n }", "public function getOne()\n {\n if ($this->count() > 0)\n {\n $this->seek(0);\n return $this->current();\n } else\n return null;\n }", "public function first()\n {\n return array_values($this->data)[0] ?? null;\n }", "function first_item() {\n\t\treturn $this->offset() + 1;\t\n\t}", "public function getFirst()\r\n {\r\n\r\n if (is_array($this->getResult())) {\r\n $array = $this->getResult();\r\n\r\n $array = array_shift($array);\r\n\r\n if (!is_null($array)) {\r\n return current($array);\r\n }\r\n }\r\n\r\n return null;\r\n }", "public function first()\n {\n if ($this->valid()) {\n $this->rewind();\n return $this->current();\n }\n }", "public function firstOrNull()\n {\n return count($this->data) === 0 ? null : $this->data[0];\n }", "public function first(){\n return $this->_results[0]; #Can update to use results function\n }", "public function first()\n {\n return $this->get()[0];\n }", "public function first(){\n return $this->_results[0];\n }", "public function getFirstElement() {\r\n\t\t$tmp = $this->toArray();\r\n\t\treset($tmp);\r\n\t\treturn current($tmp);\r\n\t}", "public function first()\n {\n if (! empty($this->items))\n {\n $firstKey = key($this->items);\n return $this->items[$firstKey];\n }\n\n return false;\n }", "public function first()\n {\n return array_shift($this->working_array);\n }", "public function first()\n {\n return array_slice($this->get(), 0, 1, true);\n }", "public function first() {\n return $this->data[0];\n }", "protected function _first() {\n\t\treturn reset($this->_objects);\n\t}", "public function first(){\n return $this->results()[0];\n }", "public function getFirst()\n {\n return reset($this->_data);\n }", "public function first()\n {\n return $this->search[0];\n }", "public function first(){\n return $this ->results()[0];\n }", "public function getFirst()\n {\n return $this->getByIndex(0);\n }", "function first() \n\t{\n\t\tif (count($this->object_array) > 0)\n\t\t\treturn $this->object_array[0];\n\t\telse\n\t\t\treturn null;\n\t}", "public function getFirst()\n {\n return isset($this->_content[0]) ? $this->_content[0] : null;\n }", "public function first(): ?\\StructType\\EwsSearchPreviewItemType\n {\n return parent::first();\n }", "public function first($default = null)\n {\n if ($this instanceof \\Iterator) {\n $item = $default;\n foreach ($this as $item) {\n break;\n }\n return $item;\n }\n\n return null;\n }", "public function first() {\n\t\treturn $this->results()[0];\n\t}", "public function first() {\n\t\treturn $this->results()[0];\n\t}", "public function getFirstItem(): GraphItem\n {\n return $this->links[0]->getLeftItem();\n }", "abstract public function getFirst();", "public function first()\n {\n return $this->data_seek(0);\n }", "public function getFirstEquipmentReservation()\n {\n $listStayedResEquips = $this->getStayedEquipmentReservation();\n if ($listStayedResEquips != null) {\n Log::info(\"Found first used reservation equipment\");\n return $listStayedResEquips->first();\n }\n Log::info(\"NOT Found first used reservation equipment\");\n return null;\n }", "public function getFirst(): ?\\Recurly\\RecurlyResource\n {\n $options = array_replace_recursive($this->_options, [ 'params' => [ 'limit' => 1 ] ]);\n $page = $this->_client->nextPage($this->_path, $options);\n if ($page->valid()) {\n return $page->current();\n }\n return null;\n }", "abstract public function first();", "public function first()\n {\n return $this->results[0];\n }", "public function findFirst($req){\n\n \t\treturn current($this->find($req)); //current renvoi l'element courant , cest a dire le premier element dans ce cas là\n\n \t}", "public function getCurrentPageFirstItem(): float|int|null\n {\n $first = ($this->currentPage - 1) * $this->itemsPerPage + 1;\n\n if ($first > $this->totalItems) {\n return null;\n }\n\n return $first;\n }", "public function first(?callable $predicate = null)\n {\n if ($predicate === null)\n return isset($this->items[0]) ? $this->items[0] : null;\n\n foreach ($this as $i => $item)\n if ($predicate($item, $i) === true)\n return $item;\n\n return null;\n }", "public function getFirstItem()\n {\n $output = 0;\n $tem_start_item_number = (($this->current_page - 1) * $this->items_per_page + 1);\n if ($this->total_items && $tem_start_item_number <= $this->total_items) {\n $output = $tem_start_item_number;\n }\n\n return $output;\n }", "public function first()\n {\n reset($this->array);\n return $this->array[key($this->array)];\n }", "public function first() {\n\t\tif ( empty( $this->data ) ) {\n\t\t\tthrow new UnderflowException( 'Collection is empty, can not get first value' );\n\t\t}\n\t\treturn array_values( $this->data )[0];\n\t}", "function peek() {\n if(isset($this->data[0])){\n return $this->data[0];\n }\n return null;\n }", "public function first()\n {\n // Mute notices if there is no requested fields to search inside the items.\n error_reporting($errorReporting = error_reporting() & ~E_NOTICE);\n\n // Match collection\n $collection = $this->collection->matching($this->criteria);\n\n // Restore error_reporting\n error_reporting($errorReporting);\n\n // Gets first matching result\n $results = $collection->first();\n\n // Return first matching result\n return is_array($results) ? Arrays::undot($results) : $results;\n }", "public function getItem()\n {\n return $this->itemIterator ? $this->itemIterator->current() : $this->item;\n }", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first()\n {\n return reset($this->collection);\n }", "public function first(){\n return (!empty($this->_result)) ? $this->_result[0] : [];\n }", "public function getFirstItem()\n {\n $this->load();\n\n if (count($this->_items)) {\n reset($this->_items);\n return current($this->_items);\n }\n\n return new $this->_itemObjectClass();\n }", "public function getItem(): ?Item\n {\n return $this->item;\n }", "public function current(): ?object\n\t{\n\t\t$this->load(false);\n\t\t\n\t\treturn $this->items[\\current($this->keys)] ?? null;\n\t}", "public function getItem() {\n\t\treturn $this->getItemMasterItemRelatedByInititemnbr();\n\t}", "public function getFirst()\n {\n return Arrays::getFirstElement($this->elements);\n }", "function peek()\r\n {\r\n if ( $this->isEmpty() )\r\n {\r\n return null;\r\n }\r\n\r\n return $this->get($this->size() - 1);\r\n }", "public function getFirst()\n\t{\n\t\treturn isset($this->rows[0]) ? $this->rows[0] : null;\n\t}", "public function first() {\n $keys = array_keys($this->toArray());\n if(!empty($keys)) {\n return $this[$keys[0]];\n }\n }", "public function first() {\n return $this -> results()[0];\n }", "function getItem() ;", "public function first()\n\t{\n\t\tif (count($this->object_keys) === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\t//looks strange, but avoids resetting internal pointer of $this->objects\n\t\treturn $this->objects[reset($this->object_keys)];\n\t}", "public function peek()\n {\n if ($this->count() === 0) {\n return null;\n }\n\n return $this[$this->index];\n }", "public function getFirstEntry ()\n {\n $retval = null;\n\n if (isset($this->stack[0]))\n {\n $retval = $this->stack[0];\n }\n\n return $retval;\n }", "public function first(): mixed\n {\n $this->rewind();\n $document = $this->getCursor()->current();\n\n if (!$document) {\n return null;\n }\n\n return $this->getAssembler()->assemble($document, $this->entitySchema);\n }", "public function first()\n {\n return reset($this->element);\n }", "public function getFirstEntry()\n {\n $retval = null;\n\n if (isset($this->stack[0]))\n {\n $retval = $this->stack[0];\n }\n\n return $retval;\n }", "public function first(): mixed;", "public function getFirst() {}", "public function queryFirst() {\n $this->setLimit(1, 0);\n\n $result = $this->query();\n\n if (empty($result)) {\n return null;\n }\n\n return array_shift($result);\n }", "public function getFirstContent() {\r\n\t\t$contents = $this->cacheContents();\r\n\t\treturn isset($contents[0]) ? $contents[0] : null;\r\n\t}", "function mapToFirstItem($value)\n{\n return $value[0];\n}", "function head(array $items)\n{\n return $items[0];\n}" ]
[ "0.76106536", "0.75202805", "0.7413485", "0.7396272", "0.7390677", "0.7310774", "0.73105913", "0.7260318", "0.7158318", "0.6880267", "0.68418735", "0.6833137", "0.6817038", "0.6810719", "0.6793982", "0.6775496", "0.67276686", "0.6720521", "0.66944784", "0.66813976", "0.66785204", "0.66785204", "0.66785204", "0.6678247", "0.66760534", "0.66649306", "0.66442233", "0.66205823", "0.65971094", "0.65736383", "0.65536845", "0.6545441", "0.65439546", "0.6542983", "0.6527611", "0.6521169", "0.65104306", "0.6501735", "0.6477694", "0.64742947", "0.64665186", "0.64629656", "0.6451543", "0.64504206", "0.6447156", "0.6446998", "0.6436116", "0.6436116", "0.6423996", "0.64186704", "0.6410575", "0.64068025", "0.6391409", "0.63675165", "0.6352814", "0.6350923", "0.6327181", "0.6326219", "0.6318387", "0.63140166", "0.62978125", "0.6279713", "0.62749213", "0.624909", "0.62422484", "0.62422484", "0.62422484", "0.62422484", "0.62422484", "0.62422484", "0.62422484", "0.62422484", "0.62422484", "0.62422484", "0.62422484", "0.62422484", "0.62355167", "0.6216398", "0.62052315", "0.62002003", "0.61967623", "0.61910576", "0.6188015", "0.6180634", "0.61806154", "0.6176875", "0.6170633", "0.6168882", "0.61565846", "0.61395514", "0.61385137", "0.612758", "0.6127441", "0.61216164", "0.6114585", "0.6107711", "0.61060107", "0.6101448", "0.609557", "0.6091336" ]
0.78268784
0
Add the given data at the given index of linked list.
Добавьте данные в заданный индекс связанного списка.
public function addAt(string $data, int $index): void { $count = $this->count; if ($index > $count) { throw new RuntimeException(sprintf( 'Data cannot be added to linked list index "%s" which has "%s" nodes.', $index, $count )); } $newNode = new Node($data); if ($index === 0) { // First node $this->addFirst($data); } elseif ($index === $count) { // Last node $this->addLast($data); } else { // Node between first and last node $node = $this->firstNode; $i = 0; while ($node->next !== null) { // If next node should be new node index if ($i + 1 === $index) { // New node needs to show where current node showed before $newNode->next = $node->next; // Current node shows to new node $node->next = $newNode; // Increment node counter and exit function $this->count++; return; } $node = $node->next; $i++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAtIndex($index, $val) {\n\t\tif ($index > $this->length) {\n\t\t} else if ($index == $this->length) {\n\t\t\t$this->addAtTail($val);\n\t\t} else if ($index < 0) {\n\t\t\t$this->addAtHead($val);\n\t\t} else {\n\t\t\t$q = $this->link;\n\t\t\t$p = $this->link->next;\n\t\t\t$i = 0;\n\t\t\twhile ($p->next && ($i++ < $index)) {\n\t\t\t\t$q = $q->next;\n\t\t\t\t$p = $p->next;\n\t\t\t}\n\t\t\t$new_node = new Node($val);\n\t\t\t$new_node->next = $q->next;\n\t\t\t$q->next = $new_node;\n\t\t\t$this->length++;\n\t\t}\n\t\treturn NULL;\n\t}", "public function add($index, $value) {}", "public function add($item, int $index): void\n {\n }", "public function add($data)\n {\n //n is object of Node class\n $n = new Node($data);\n // if condition to enter 1st value in the linked list \n // if head is null then it will make 1st value as head and and tail will aslo \n // point the 1st value at that time \n // and next of node will be null \n if ($this->head == null) \n {\n $this->head = $n;\n $this->tail = $this->head;\n $n->next = null;\n $this->count++;\n return;\n }\n\n //if head is not null the all value will add in the tail and that value change to tail\n //and break the method \n $this->tail->next = $n;\n $this->tail = $n;\n $this->count++;\n return;\n }", "public function addNode(int|string $index, $node)\n {\n }", "public function addAt($index, $element) {\n\t\t$this->testTypeParameters( $element );\n\t\t$index = (int) $index;\n\t\t$this->rangeCheckForAdd( $index );\n\t\t\n\t\t$this->ensureCapacityInternal( $this->size + 1 );\n\t\tSystem::arraycopy( $this->elementData, $index, $this->elementData, $index + 1, $this->size - $index );\n\t\t$this->elementData[$index] = $element;\n\t\t$this->size++;\n\t}", "public function add($data)\n {\n //check if list is empty\n if (!$this->front) \n {\n //add at first;\n $node = new Node($data, null);\n $this->front = $node;\n $this->last = $node;\n $this->size++;\n } \n else \n {\n //check if data is less than the data in front\n if ($data < $this->front->data) \n {\n $node = new Node($data,$this->front);\n $this->front = $node;\n $this->size++;\n return;\n }\n\n //stores in desired position\n $current = $this->front;\n while ($current) \n {\n if ($current->data < $data && isset($current->next) && $current->next->data > $data) \n {\n $node = new Node($data,$current->next);\n $current->next = $node;\n $this->size++;\n }\n\n if ($current->data < $data && !isset($current->next)) \n {\n $node = new Node($data,$current->next);\n $current->next = $node;\n $this->size++;\n }\n $current = $current->next;\n \n }\n }\n }", "public function insert(int $index, $data)\n {\n $node = new Node($data);\n return $this->insertNode($index, $node);\n }", "public function addAt($index, $element)\n {\n $this->insertElementAt($element, $index);\n }", "public function add($data) {\n $this->data[$data->getID()] = $data;\n }", "public function add( $data );", "public function insert($index, $element) {\n $this->rangeCheckForAdd($index);\n\n if ($index == 0) {\n $newElementData = array($element);\n ThinUtil::arraycopy($this->elementData, 0, $newElementData, 1, $this->size);\n $this->elementData = $newElementData;\n $this->size++;\n } else if ($index == $this->size) {\n $this->elementData[$this->size++] = $element;\n } else {\n $newElementData = array();\n ThinUtil::arraycopy($this->elementData, 0, $newElementData, 0, $index);\n $newElementData[$index] = $element;\n ThinUtil::arraycopy($this->elementData, $index, $newElementData, $index + 1, $this->size - $index);\n $this->elementData = $newElementData;\n $this->size++;\n }\n }", "function push($data)\n {\n $this->list->append($data);\n }", "public function add($data) {\n // any syntax\n }", "public function add($data);", "public function add($data);", "public function add($data){\r\n if(!isset($data))\r\n return null;\r\n\r\n if($this->count == $this->size)\r\n $this->resize();\r\n\r\n $this->array[$this->count] = $data;\r\n $this->count++;\r\n\r\n return $data;\r\n }", "public function insertAt($index, $item)\n\t{\n\t\tif ($this->getReadOnly()) {\n\t\t\tthrow new TInvalidOperationException('list_readonly', $this::class);\n\t\t}\n\n\t\tif (($priority = $this->priorityAt($index, true)) !== false) {\n\t\t\t$this->internalInsertAtIndexInPriority($item, $priority[1], $priority[0]);\n\t\t\treturn $priority[0];\n\t\t} else {\n\t\t\tthrow new TInvalidDataValueException('list_index_invalid', $index);\n\t\t}\n\t}", "public function attachAt(Tx_Extbase_DomainObject_AbstractDomainObject $add, $index, $information) {\n\t\t$this->rewind();\n\t\t$storage = $this->objectManager->get(get_class(self));\n\t\tif ($index >= $this->count()) {\n\t\t\t$this->attach($add, $information);\n\t\t}\n\t\tforeach ($this as $key=>$item) {\n\t\t\tif ($currentIndex == $index) {\n\t\t\t\t$this->insertAt($add, $key, TRUE, $information);\n\t\t\t\t$this->detach($item);\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\t$currentIndex++;\n\t\t}\n\t\treturn $this;\n\t}", "public function add($key, $data);", "function addToBack($data){\n // add to head if empty\n if ($this->head == NULL) {\n $this->head = new node($data);\n // add object to end of list\n } else {\n $curr = $this->head;\n while ($curr->next != NULL) {\n $curr = $curr->next;\n if ($curr->next == NULL) {\n $curr->next = new node($data, NULL,$curr);\n $curr = $curr->next;\n }\n }\n }\n }", "public function insertAt($index, $item)\n\t{\n\t\tif ($index === $this->_c) {\n\t\t\t$this->_d[$this->_c++] = $item;\n\t\t} elseif ($index >= 0 && $index < $this->_c) {\n\t\t\tarray_splice($this->_d, $index, 0, array($item));\n\t\t\t$this->_c++;\n\t\t} else {\n\t\t\tthrow new InvalidParamException('Index out of range: ' . $index);\n\t\t}\n\t}", "public function _set( int $index, Node $n ): void {\n\t\t$this->_list[$index] = $n;\n\t}", "public function addElement($index, $element)\n {\n $this->elements[$index] = $element;\n }", "function insert($index, $item);", "private function addData(string $data): void\n {\n $ref = $this->collectedRef - 1;\n $this->collected[$ref][2] = $this->collected[$ref][2] . $data;\n }", "public function insertNodeAtTail($head, int $data)\n {\n if (!$head) {\n return new SinglyLinkedListNode($data);\n } else {\n if (!$head->next) {\n $head->next = new SinglyLinkedListNode($data);\n } else {\n $this->insertNodeAtTail($head->next, $data);\n }\n\n return $head;\n }\n }", "public function addOptionAt($index, $label, $data = '') {\r\n\t\t$label = htmlentities($label);\r\n\t\t$option = new Larc_Html_Element('option', $label);\r\n\t\t\r\n\t\t$options = $this->getElementsByTagName('option');\r\n\t\t$child = $options->item($index);\r\n\t\t\r\n\t\t$node = $this->insertBefore($option, $child);\r\n\t\t\r\n\t\tif($data != '') {\r\n\t\t\t$node->setAttribute(\"value\", $data);\r\n\t\t}\r\n\t\t\r\n\t\treturn $node;\r\n\t}", "public function set($index, $data){\r\n if($index >= 0 && $index < $this->size) {\r\n $this->array[$index] = $data;\r\n return true;\r\n }\r\n return false;\r\n }", "public function set(int $index, $data)\n {\n if ($index == $this->length) {\n $this->add($data);\n return $this;\n }\n $node = $this->getNode($index);\n if (is_null($node)) return false;\n\n $node->setData($data);\n\n return $this;\n }", "public function add($index, $id, array $data)\n {\n $this->driver->add($index, $id, $data);\n\n return $this;\n }", "public function addElement(ElementInformationInterface $element, $index = -1);", "public function addIndex($idx){\n //added to stack for post processing\n if($this->GENERATE_FK_IDX) array_push($this->indexStack,$idx);\n }", "public function addAt($index, $element) \n {\n $this->doCheckValid($element);\n \n if ($index == 0 || $index < $this->count())\n {\n $this->elements[$index] = $element;\n\n return true;\n }\n\n throw new \\OutOfBoundsException('Invalid index');\n }", "public function add ($item) {\n\t\t$x = new ListNode($item, null);\n\t\tif ($this->h === null) {\n\t\t\t$this->h = $x;\n\t\t} else {\n\t\t\t$this->q->next = $x;\n\t\t}\n\t\t$this->q = $x;\n\t\t$this->length++;\n\t}", "public function add($key , $data)\n {\n\n $this->level3->add($key , $data);\n\n }", "function addToFront($data){\n if ($this->head == NULL) {\n $this->head = new node($data,$this->head,NULL);\n } else {\n $next = $this->head;\n $this->head = new node($data,$next,NULL);\n $next->prev = $this->head;\n }\n }", "public function addToFront($data)\n\t{\n\t\t$node = new DTNode($data);\n\n\t\tif ($this->head) {\n\t\t\t$node->setNextNode($this->head);\n\t\t}\n\n\t\t$setAsTailNode = $this->isEmpty();\n\n\t\t$this->setHead($node);\n\n\t\tif ($setAsTailNode) {\n\t\t\t$this->setTail($node);\n\t\t}\n\t}", "function addAtHead($val) {\n\t\t$new_node = new Node($val);\n\t\t$new_node->next = $this->link->next;\n\t\t$this->link->next = $new_node;\n\t\t$this->length++;\n\t}", "public function addMultiple($index, array $data)\n {\n $this->driver->addMultiple($index, $data);\n\n return $this;\n }", "public function addItem( array $data ) {\r\n\t\t\t$this->formList[] = $data;\r\n\t\t}", "public function addLast(string $data): void\n {\n // New node\n $newNode = new Node($data);\n\n // If linked list is empty\n if ($this->isEmpty()) {\n // Set first node\n $this->firstNode = $newNode;\n } else {\n // Set link from old last node to new last node\n $this->lastNode->next = $newNode;\n }\n\n // Set new last node\n $this->lastNode = $newNode;\n $this->count++;\n }", "public function insertElementAt($obj, $index)\n {\n $this->testTypeParameters($obj);\n if ($index > $this->elementCount) {\n throw new ArrayIndexOutOfBoundsException(\n $index . '>=' . $this->elementCount);\n }\n $this->ensureCapacityHelper($this->elementCount + 1);\n System::arraycopy($this->elementData, $index, $this->elementData,\n $this->elementCount - 1, $index);\n $this->elementData[$index] = $obj;\n $this->elementCount++;\n }", "function addAtTail($val) {\n\t\t$p = $this->link;\n\n\t\twhile ($p->next) {\n\t\t\t$p = $p->next;\n\t\t}\n\t\t$new_node = new Node($val);\n\t\t$new_node->next = $p->next;\n\t\t$p->next = $new_node;\n\t\t$this->length++;\n\t}", "public function add($data): int;", "public function add($data){\n\t\t$session = new Session();\n\t\t$userId = $session->currentId();\n\t\tif($userId != false){\n\t\t\t//insert fq into database\n\t\t\t$uniqueId = uniqid();\n\t\t\t$response = $this->client->batchWriteItem(array(\n\t\t\t\t\"RequestItems\" => array(\n\t\t\t\t\t\"Links\" => array(\n\t\t\t\t\t\t array(\n\t\t\t\t\t\t\t\"PutRequest\" => array(\n\t\t\t\t\t\t\t\t\"Item\" => array(\n\t\t\t\t\t\t\t\t\t\"LinkId\"\t=> array(Type::STRING => $uniqueId),\n\t\t\t\t\t\t\t\t\t\"UserId\"\t=> array(Type::NUMBER => $userId),\n\t\t\t\t\t\t\t\t\t\"Text\"\t\t=> array(Type::STRING => htmlspecialchars($data[\"Text\"])),\n\t\t\t\t\t\t\t\t\t\"Url\"\t\t=> array(Type::STRING => htmlspecialchars($data[\"Url\"]))\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t));\n\t\t\t$this->LinkId = $uniqueId;\n\t\t\t$this->UserId = $userId;\n\t\t\t$this->Text = htmlspecialchars($data[\"Text\"]);\n\t\t\t$this->Url = htmlspecialchars($data[\"Url\"]);\n\n\t\t\treturn $this;\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function addChild($element, $index = -1) {\r\n\t\tif ($element !== NULL) {\r\n\t\t\t$this->children->add($element, $index);\r\n\t\t}\r\n\t}", "public function add(array $data);", "function rules_action_data_list_add($list, $item, $pos = 'end', $settings) {\n switch ($pos) {\n case 'start':\n array_unshift($list, $item);\n break;\n\n default:\n $list[] = $item;\n break;\n }\n return array('list' => $list);\n}", "public function addData($key, $data)\n {\n $this->data[$key] = $data;\n }", "public function addAt(int $index, string $item): self\n {\n array_splice($this->items, $index, 0, $item);\n\n return $this;\n }", "public function add($data){\n\t\t$this->output[]=$data;\n\t}", "public function insertData(int $offset, string $data):void {\n\t\t$this->getNativeNode()->insertData($offset, $data);\n\t}", "public function add(Option $option, $index = -1)\n {\n if (!$option->getValue()) {\n throw new GUIException(\"Cannot add an option without a value to DataList!\");\n }\n parent::add($option, $index);\n }", "public function index($data)\n {\n if($this->size==0)\n {\n echo \"list is empty\\n\";\n return -1;\n }\n $temp = $this->front;\n $count = -1;\n while($temp!=null)\n {\n $count++;\n if($temp->data == $data)\n {\n return $count;\n }\n else\n {\n $temp = $temp->next;\n }\n }\n echo \"item not found\\n\";\n return -1;\n }", "public function addValues($value, $index)\n {\n $this->values[$index] = $value;\n }", "public function add(string $key, array $data);", "public function addItem($data = NULL) {\n $this->deleteRecord(Yii::app()->user->id); //delete\n\n $names = $data->getPost('name', '');\n $nameens = $data->getPost('nameen', '');\n $phones = $data->getPost('phone', '');\n $values = $data->getPost('value', '');\n $orders = $data->getPost('order', '');\n $types = $data->getPost('type', '');\n\n for ($i = 0; $i < 6; $i++) {\n if (!empty($values[$i]) && !empty($types[$i])) {\n $this->insertItem(trim($names[$i]), ($nameens) ? trim($nameens[$i]) : '', trim($phones[$i]), trim($values[$i]), trim($orders[$i]), trim($types[$i]));\n }\n }\n }", "public function add( $data )\n\t{\n\t\t$this->_set_columns( (array) array_keys( (array) $data ));\n\n\t\t// put all the data into the right columns\n\t\t$row = array_fill_keys( $this->_columns , NULL );\n\t\t$data = array_intersect_key( (array) $data, (array) $row );\n\t\t$row = array_merge( $row, $data );\n\t\t$this->_send_line( $row );\n\t}", "public function insert($data) {\n\t\t$this->_data[] = $data;\n\t}", "function joinData($data){\n $this->data += $data;\n }", "public function insertAndSort($data)\n {\n $existingNode = $this->searchNode($data);\n if (!empty($existingNode)) {\n $existingNode->count++;\n $prevNode = $existingNode->prev;\n if (!empty($prevNode)) {\n while ($prevNode != null && $prevNode->count < $existingNode->count) {\n $existingNext = $existingNode->next;\n $prevPrev = $prevNode->prev;\n\n $existingNode->next = $prevNode;\n $existingNode->prev = $prevPrev;\n if (!empty($prevPrev))\n $prevPrev->next = $existingNode;\n else\n $this->firstNode = $existingNode;\n\n $prevNode->prev = $existingNode;\n if (!empty($existingNext)) {\n $prevNode->next = $existingNext;\n $existingNext->prev = $prevNode;\n }\n $prevNode = $existingNode->prev;\n }\n }\n } else {\n $link = new ListNode($data);\n $link->next = null;\n $link->prev = $this->lastNode;\n if ($link->prev != null) {\n $link->prev->next = $link;\n } else {\n $this->firstNode = $link;\n }\n $this->lastNode = &$link;\n $this->count++;\n }\n }", "function get($index) {\n\t\tif ($index < 0 || $index > $this->length - 1) {\n\t\t\treturn -1;\n\t\t}\n\t\t$i = 0;\n\t\t$p = $this->link->next;\n\t\twhile ($p && $i++ < $index) {\n\t\t\t$p = $p->next;\n\t\t}\n\t\tif (!$p) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn $p->data;\n\t}", "public function insertNode(int $index, Node $node)\n {\n if (is_null($node)) return false;\n if ($index == 0) {\n $node->setNext($this->head);\n $this->head = $node;\n if ($this->length == 0) $this->tail = $node;\n ++$this->length;\n\n return $this;\n }\n if ($index > $this->length || $index < 0) return false;\n\n $prevNode = $this->getNode($index - 1);\n if (is_null($prevNode)) return false;\n\n $nextNode = $prevNode->getNext();\n $node->setNext($nextNode);\n $prevNode->setNext($node);\n\n // Insert to last of list.\n if ($index == $this->length) {\n $this->tail = $node;\n }\n ++$this->length;\n\n return $this;\n }", "public function add($o, $key = null){\r\n\t\tif($key != null){\r\n\t\t\t$this->lista[$key] = $o;\r\n\t\t}else{\r\n\t\t\t$this->lista[$this->size()] = $o;\r\n\t\t}\r\n\t}", "public function add($data)\n {\n $node = new Node($data);\n return $this->addNode($node);\n }", "public function _append( Node $n ): void {\n\t\t$this->_list[] = $n;\n\t}", "public function add($data)\n {\n if (count($data) == count($data, COUNT_RECURSIVE)) return $this->db->insert($this->_table, $data);\n else return $this->db->insert_batch($this->_table, $data);\n }", "public function insertAll($index, $c) {\n $this->rangeCheckForAdd($index);\n\n $element = null;\n $size = 0;\n if (is_array($c)) {\n $element = $c;\n $size = count($c);\n } else if ($c instanceof TList) {\n $element = $c->elementData;\n $size = $c->size;\n } else {\n throw new TIllegalArgumentException(\"Parameter must be array() or List\");\n }\n\n if ($size == 0) {\n return;\n }\n\n if ($index == 0) {\n $newElementData = array();\n $i = 0;\n foreach ($element as $key => $value) {\n $newElementData[$i++] = $value;\n }\n ThinUtil::arraycopy($this->elementData, 0, $newElementData, $i, $this->size);\n $this->elementData = $newElementData;\n $this->size += $i;\n } else if ($index == $this->size) {\n foreach ($element as $key => $value) {\n $this->elementData[$this->size++] = $value;\n }\n } else {\n $newElementData = array();\n ThinUtil::arraycopy($this->elementData, 0, $newElementData, 0, $index);\n\n $i = $index;\n foreach ($element as $key => $value) {\n $newElementData[$i++] = $value;\n }\n\n ThinUtil::arraycopy($this->elementData, $index, $newElementData, $index + $i, $this->size - $index);\n $this->elementData = $newElementData;\n $this->size += ($i - $index);\n }\n }", "public function addData()\n {\n $this->addTo('data', func_get_args());\n }", "public function addEntry($index = null, $value)\n {\n return $this->setEntry($index, $value);\n }", "public function add($index,$value=0){\n\t\t//this index equal array's index\n\t\tif(! $this -> checkIndex($index))return false;\n\t\tif((int)$value !== 0)$value = '1';\n\t\t$binCheck = decbin($this -> getValue());\n\t\t$binCheck = substr($binCheck,0,$index) . $value . substr($binCheck,$index);\n\t\treturn bindec($binCheck);\n\t}", "public function add($data) {\n\t\t// this method can be overloaded\n\t\tforeach ( func_get_args () as $data ) {\n\t\t\t// redefine var\n\t\t\t$data = ( string ) $data;\n\t\t\t\n\t\t\t// load data\n\t\t\t$value = $this->load ( $data );\n\t\t\t$key = ($data != $value) ? $data : 0;\n\t\t\t\n\t\t\t// initialize key\n\t\t\tif (! array_key_exists ( $key, $this->data ))\n\t\t\t\t$this->data [$key] = '';\n\t\t\t\t\n\t\t\t\t// store data\n\t\t\t$this->data [$key] .= $value;\n\t\t}\n\t}", "public function insert($obj, $index) {\n\t\t$obj->pzkParentId = isset($this->id) ? $this->id : null;\n\t\tarray_splice($this->children, $index, 0, $obj);\n\t}", "public function add($data, $type = '')\n {\n }", "public function addData($data, $type) {\n\t\t$this->data[$type] = $data;\n\t}", "function _add($table,$data,$index){\n\t\tglobal $con_db;\n\t\t$set = '';\n\t\tif(is_array($data)){\n\t\t\t$i = 0;\n\t\t\tforeach ($data as $key=>$value) {\n\t\t\t\t$set .= $key.'=\"'. $value.'\"';\n\t\t\t\tif($i < count($data)){\n\t\t\t\t\t$set .= ','; \n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t$set = rtrim($set, ',');\n\t\t$sql = \"INSERT INTO $table SET $set\";\n\t\tif ($con_db->query($sql)) {\n\t\theader('location:'.$index);\n\t\t}else{\n\t\techo $con_db->error;\n\t\t}\n\t\treturn $sql;\n\t}", "public function add_meta(&$data, $meta);", "public function insertNode(int $nodeData)\n {\n /** @var SinglyLinkedListNode $node */\n $node = new SinglyLinkedListNode($nodeData);\n\n if (!$this->head) {\n $this->head = $node;\n } else {\n $this->tail->next = $node;\n }\n\n $this->tail = $node;\n }", "public function add_data($key, $data){\n if(isset($this->data[$key])){\n trigger_error(\"Data for key $key is already set.\", E_USER_NOTICE);\n }\n $this->data[$key] = $data;\n }", "function add_to_list_bottom() {\n\t\t$this->data[$this->position_field] = $this->bottom_position_in_list() + 1;\n\t}", "public static function insert_at_index(&$array, $index, $val){\r\n \r\n $size = count($array); //because I am going to use this more than one time\r\n \r\n if (!is_int($index) || $index < 0 || $index > $size){\r\n return -1;\r\n }\r\n else{\r\n $temp = array_slice($array, 0, $index);\r\n $temp[] = $val;\r\n $array = array_merge($temp, array_slice($array, $index, $size));\r\n }\r\n }", "function add_item($artnr, $num) {\r\n $this->items[$artnr] += $num;\r\n }", "public function add($item)\n\t{\n\t\t$this->data[] = $item;\n\t}", "public function add($data, $config)\n {\n throw new Exception('Method: '.get_class($this).'->add() not implemented');\n }", "abstract function addToItem($dataItem, $field, $value);", "public function add($key, $data)\n {\n $this->body[$key] = $data;\n }", "public function insert($object, int $index) : bool;", "public function addFirst(string $data): void\n {\n // New node\n $newNode = new Node($data);\n\n if ($this->isEmpty()) {\n // Set last node\n $this->lastNode = $newNode;\n } else {\n // Set link from new first node to old first node\n $newNode->next = $this->firstNode;\n }\n\n // Set first node\n $this->firstNode = $newNode;\n $this->count++;\n }", "protected function addWithPosition(int $index, $element)\n {\n if (($this->keyExists($index, $this->getAll()))\n && ($this->keyExists($index + 1, $this->getAll()))) {\n $arr = [];\n for ($i = $index; $i < $this->size(); $i++) {\n $arr[] = $this->get($i);\n }\n\n $y = $index + 1;\n $this->arrayable[$index] = $element;\n for ($i = 0; $i < count($arr); $i++) {\n $this->set($y, $arr[$i]);\n $y++;\n }\n\n unset($arr);\n } elseif (($this->keyExists($index, $this->getAll()))\n && (!$this->keyExists($index + 1, $this->getAll()))) {\n\n $var = $this->get($index);\n $this->set($index, $element);\n $this->set($index + 1, $var);\n\n unset($var);\n } elseif (!$this->keyExists($index, $this->getAll())) {\n $this->set($index, $element);\n }\n }", "public function addDocuments($index, $type, array $data);", "public function appendData(string $data):void {\n\t\t$this->getNativeNode()->appendData($data);\n\t}", "public function append($data) {}", "public function add($value) {\n\t\t$this->data[$this->nextKey()] = $value;\n\t}", "private function rangeCheckForAdd($index) {\n if ($index > $this->size || $index < 0) {\n throw new TIndexOutOfBoundsException(\"Index: \".$index.\", Size: \".$this->size);\n }\n }", "public function addData($point, $data)\n {\n $this->data[$point][] = $data;\n \n return $this;\n }", "public function merge(Index $index): void\n {\n foreach ($index as $item) {\n $this->add($item);\n }\n }", "public function addData($bit, $data)\r\n\t{\r\n\t\tif ($bit<1 || $bit>128)\r\n\t\t\tthrow new \\Exception('addData invalid bit:'.$bit.':'.$data);\r\n\r\n $result = $this->_packElement($this->DATA_ELEMENT[$bit], $data);\r\n\r\n\t\tif (is_null($result))\r\n\t\t\tthrow new \\Exception('addData failure for bit:'.$bit);\r\n\r\n\t\t$this->_data[$bit] = $result;\r\n\t\tksort($this->_data);\r\n\t\t$this->_calculateBitmap();\r\n\t}", "public function add ($data)\n {\n $q = $this->query->insert(...array_keys($data))->into(static::$table);\n return $this->save($q->build(), $data, true);\n }", "public function add( $Item, $Index = null ) {\n\t\tif ( !$Item->getField( 'id' ) ) $Item->setField( 'id', $this->nextId() ); // Generate ID\n\t\tif ( is_int( $Index ) ) {\n\t\t\t// Insert $Item\n\t\t\tarray_splice( $this->items, $Index, 0, array ( $Item ) ); // This is ugly hack :P\n\t\t\t\t// NOTE: To insert an object into an array by array_splice(),\n\t\t\t\t// you need to wrap the object with another array.\n\t\t\t\t// @see also http://php.net/manual/en/function.array-splice.php\n\t\t}\n\t\telse $this->items[] = $Item;\n\t\treturn $this;\n\t}" ]
[ "0.70713013", "0.6817654", "0.66063446", "0.6513411", "0.64991534", "0.63396573", "0.6335847", "0.616452", "0.6090438", "0.5920749", "0.5909146", "0.58708394", "0.5807889", "0.5804387", "0.5775538", "0.5775538", "0.57629883", "0.5761547", "0.57472587", "0.57466143", "0.57404125", "0.5725528", "0.5689655", "0.56801164", "0.5676965", "0.5650136", "0.5643773", "0.56402755", "0.56230986", "0.56051356", "0.5577831", "0.557415", "0.5569603", "0.55637056", "0.55570734", "0.554284", "0.55362517", "0.55267316", "0.5520239", "0.55188847", "0.5499149", "0.5490039", "0.5485006", "0.54800916", "0.5478137", "0.5475926", "0.54481715", "0.54172724", "0.5390821", "0.538214", "0.53747284", "0.535723", "0.535392", "0.53522456", "0.5348242", "0.5338737", "0.53278476", "0.5324309", "0.52826154", "0.52821946", "0.528074", "0.52743167", "0.5269428", "0.5252151", "0.52428406", "0.52264905", "0.5206805", "0.5205213", "0.5190345", "0.5165206", "0.5158693", "0.5153856", "0.51488423", "0.51447433", "0.5144113", "0.5142353", "0.51416755", "0.514043", "0.5134588", "0.51240695", "0.5116325", "0.51103246", "0.5104575", "0.5102229", "0.50963086", "0.5093939", "0.50830895", "0.5081991", "0.50798494", "0.50771344", "0.50743735", "0.5074022", "0.5067251", "0.5061709", "0.5057026", "0.50487727", "0.5040054", "0.5039158", "0.5020172", "0.50001204" ]
0.79796714
0
Add the given data at the end of linked list.
Добавьте данные в конец связанного списка.
public function addLast(string $data): void { // New node $newNode = new Node($data); // If linked list is empty if ($this->isEmpty()) { // Set first node $this->firstNode = $newNode; } else { // Set link from old last node to new last node $this->lastNode->next = $newNode; } // Set new last node $this->lastNode = $newNode; $this->count++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToBack($data){\n // add to head if empty\n if ($this->head == NULL) {\n $this->head = new node($data);\n // add object to end of list\n } else {\n $curr = $this->head;\n while ($curr->next != NULL) {\n $curr = $curr->next;\n if ($curr->next == NULL) {\n $curr->next = new node($data, NULL,$curr);\n $curr = $curr->next;\n }\n }\n }\n }", "public function add($data)\n {\n //n is object of Node class\n $n = new Node($data);\n // if condition to enter 1st value in the linked list \n // if head is null then it will make 1st value as head and and tail will aslo \n // point the 1st value at that time \n // and next of node will be null \n if ($this->head == null) \n {\n $this->head = $n;\n $this->tail = $this->head;\n $n->next = null;\n $this->count++;\n return;\n }\n\n //if head is not null the all value will add in the tail and that value change to tail\n //and break the method \n $this->tail->next = $n;\n $this->tail = $n;\n $this->count++;\n return;\n }", "public function add($data)\n {\n //check if list is empty\n if (!$this->front) \n {\n //add at first;\n $node = new Node($data, null);\n $this->front = $node;\n $this->last = $node;\n $this->size++;\n } \n else \n {\n //check if data is less than the data in front\n if ($data < $this->front->data) \n {\n $node = new Node($data,$this->front);\n $this->front = $node;\n $this->size++;\n return;\n }\n\n //stores in desired position\n $current = $this->front;\n while ($current) \n {\n if ($current->data < $data && isset($current->next) && $current->next->data > $data) \n {\n $node = new Node($data,$current->next);\n $current->next = $node;\n $this->size++;\n }\n\n if ($current->data < $data && !isset($current->next)) \n {\n $node = new Node($data,$current->next);\n $current->next = $node;\n $this->size++;\n }\n $current = $current->next;\n \n }\n }\n }", "function _store_Tail($data) {\n\t\tif (strlen($data) > $this->_MaxDataSize) {\n\t\t\t$data = $this->_get_continue($data);\n\t\t}\n\t\t$this->_Data = $this->_Data.$data;\n\t\t$this->_DataSize += strlen($data);\n\t}", "function push($data)\n {\n $this->list->append($data);\n }", "public function append($data) {}", "private function addData(string $data): void\n {\n $ref = $this->collectedRef - 1;\n $this->collected[$ref][2] = $this->collected[$ref][2] . $data;\n }", "public function append($data) {\n\t\tif ($data instanceof self)\n\t\t\t$data = $data->toArray();\n\n\t\t$this->data = array_merge($this->data, $data);\n\t}", "function joinData($data){\n $this->data += $data;\n }", "public function append($data)\n {\n\n }", "public function appendData(string $data):void {\n\t\t$this->getNativeNode()->appendData($data);\n\t}", "public function add($data){\r\n if(!isset($data))\r\n return null;\r\n\r\n if($this->count == $this->size)\r\n $this->resize();\r\n\r\n $this->array[$this->count] = $data;\r\n $this->count++;\r\n\r\n return $data;\r\n }", "public function add($data) {\n // any syntax\n }", "public function add($data) {\n $this->data[$data->getID()] = $data;\n }", "public function add( $data );", "public function add($data){\n\t\t$this->output[]=$data;\n\t}", "public function add($data);", "public function add($data);", "public function appendData(string $data): void\n {\n $this->doReplaceData($this->getLength(), 0, $data);\n }", "public function append($data){\r\n if(isset($data)){\r\n foreach($data as $aData) {\r\n if (isset($aData))\r\n $this->add($aData);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }", "public function add($data)\n {\n if (count($data) == count($data, COUNT_RECURSIVE)) return $this->db->insert($this->_table, $data);\n else return $this->db->insert_batch($this->_table, $data);\n }", "public function addToFront($data)\n\t{\n\t\t$node = new DTNode($data);\n\n\t\tif ($this->head) {\n\t\t\t$node->setNextNode($this->head);\n\t\t}\n\n\t\t$setAsTailNode = $this->isEmpty();\n\n\t\t$this->setHead($node);\n\n\t\tif ($setAsTailNode) {\n\t\t\t$this->setTail($node);\n\t\t}\n\t}", "public function add( $data )\n\t{\n\t\t$this->_set_columns( (array) array_keys( (array) $data ));\n\n\t\t// put all the data into the right columns\n\t\t$row = array_fill_keys( $this->_columns , NULL );\n\t\t$data = array_intersect_key( (array) $data, (array) $row );\n\t\t$row = array_merge( $row, $data );\n\t\t$this->_send_line( $row );\n\t}", "public function insert($data) {\n\t\t$this->_data[] = $data;\n\t}", "public function addItem($data = NULL) {\n $this->deleteRecord(Yii::app()->user->id); //delete\n\n $names = $data->getPost('name', '');\n $nameens = $data->getPost('nameen', '');\n $phones = $data->getPost('phone', '');\n $values = $data->getPost('value', '');\n $orders = $data->getPost('order', '');\n $types = $data->getPost('type', '');\n\n for ($i = 0; $i < 6; $i++) {\n if (!empty($values[$i]) && !empty($types[$i])) {\n $this->insertItem(trim($names[$i]), ($nameens) ? trim($nameens[$i]) : '', trim($phones[$i]), trim($values[$i]), trim($orders[$i]), trim($types[$i]));\n }\n }\n }", "public function add($data)\n {\n $node = new Node($data);\n return $this->addNode($node);\n }", "public function add($data) {\n\t\t// this method can be overloaded\n\t\tforeach ( func_get_args () as $data ) {\n\t\t\t// redefine var\n\t\t\t$data = ( string ) $data;\n\t\t\t\n\t\t\t// load data\n\t\t\t$value = $this->load ( $data );\n\t\t\t$key = ($data != $value) ? $data : 0;\n\t\t\t\n\t\t\t// initialize key\n\t\t\tif (! array_key_exists ( $key, $this->data ))\n\t\t\t\t$this->data [$key] = '';\n\t\t\t\t\n\t\t\t\t// store data\n\t\t\t$this->data [$key] .= $value;\n\t\t}\n\t}", "public function insertAfter($key, $data) {\n if (!$this->first) {\n return false;\n }\n $newNode = new Node($data);\n $iterator = $this->first;\n while ($iterator) {\n if ($iterator->data == $key) {\n $newNode->next = $iterator->next;\n $iterator->next = $newNode;\n $this->count++;\n if($iterator->data== $this->last->data){\n $this->last=$newNode;\n }\n return true;\n }\n $iterator = $iterator->next;\n }\n return false;\n }", "function addAtTail($val) {\n\t\t$p = $this->link;\n\n\t\twhile ($p->next) {\n\t\t\t$p = $p->next;\n\t\t}\n\t\t$new_node = new Node($val);\n\t\t$new_node->next = $p->next;\n\t\t$p->next = $new_node;\n\t\t$this->length++;\n\t}", "public function addAfter($nodeId, $arData);", "public function end($data = null)\n {\n if ($this->isClosed) {\n return;\n }\n\n $this->isEnding = $this->isClosed = true;\n\n if (null !== $data) {\n $this->buffer .= $data;\n }\n $this->transformBuffer();\n }", "public function insertNodeAtTail($head, int $data)\n {\n if (!$head) {\n return new SinglyLinkedListNode($data);\n } else {\n if (!$head->next) {\n $head->next = new SinglyLinkedListNode($data);\n } else {\n $this->insertNodeAtTail($head->next, $data);\n }\n\n return $head;\n }\n }", "function _store_Head($data) {\n\t\tif (strlen($data) > $this->_MaxDataSize) {\n\t\t\t$data = $this->_get_continue($data);\n\t\t}\n\t\t$this->_Data = $data.$this->_Data;\n\t\t$this->_DataSize += strlen($data);\n\t}", "public function addAt(string $data, int $index): void\n {\n $count = $this->count;\n\n if ($index > $count) {\n throw new RuntimeException(sprintf(\n 'Data cannot be added to linked list index \"%s\" which has \"%s\" nodes.',\n $index,\n $count\n ));\n }\n\n $newNode = new Node($data);\n if ($index === 0) {\n // First node\n $this->addFirst($data);\n } elseif ($index === $count) {\n // Last node\n $this->addLast($data);\n } else {\n // Node between first and last node\n\n $node = $this->firstNode;\n $i = 0;\n\n while ($node->next !== null) {\n // If next node should be new node index\n if ($i + 1 === $index) {\n // New node needs to show where current node showed before\n $newNode->next = $node->next;\n // Current node shows to new node\n $node->next = $newNode;\n // Increment node counter and exit function\n $this->count++;\n return;\n }\n\n $node = $node->next;\n $i++;\n }\n }\n }", "public function append($data) {\n $this->data .= preg_replace('/^\\s+/', ' ', $data);\n return(true);\n }", "function append($_data)\n {\n $this->buffer[]=$_data;\n if ($this->lastFlush+$this->bufferTime<time())\n { //at least 10 seconds passed since the last flush, now flush our buffer\n foreach ($this->callbacks as $callback)\n {\n call_user_func($callback,$this->buffer);\n }\n $this->buffer=array();\n $this->lastFlush=time();\n }\n }", "public function add($data) {\n return $this->buildInsertStatement($data);\n }", "function add_to_list_bottom() {\n\t\t$this->data[$this->position_field] = $this->bottom_position_in_list() + 1;\n\t}", "public function append($node)\n {\n $this->list[] = $node;\n }", "public function add_data( $data ){\n\t\tif( false == $this->printed && is_string( $data ) ){\n\t\t\t$this->data[] = $data;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function addData($data = array())\n {\n if (count($data) > 0) {\n foreach ($data as $key => $value) {\n $this->data[$key] = $value;\n }\n }\n }", "public function addItem( array $data ) {\r\n\t\t\t$this->formList[] = $data;\r\n\t\t}", "function addToFront($data){\n if ($this->head == NULL) {\n $this->head = new node($data,$this->head,NULL);\n } else {\n $next = $this->head;\n $this->head = new node($data,$next,NULL);\n $next->prev = $this->head;\n }\n }", "public function appendChild(Ynbusinesspages_Model_Node $node, $data) {\n\n\t\t$newNode = $this -> fetchNew();\n\t\t$newNode -> setFromArray($data);\n\t\t$anchor = $node -> pright;\n\t\t$newNode -> pleft = $anchor;\n\t\t$newNode -> pright = $anchor + 1;\n\n\t\t$newNode -> parent_id = $node -> getIdentity();\n\t\t$db = $this -> getAdapter();\n\t\t$tableName = $this -> info('name');\n\n\t\ttry {\n\t\t\t$db -> beginTransaction();\n\t\t\t$db -> update($tableName, array('pright' => new Zend_Db_Expr('pright+2'), ), array('pright > ?' => $anchor - 1));\n\t\t\t$db -> update($tableName, array('pleft' => new Zend_Db_Expr('pleft+2'), ), array('pleft > ?' => $anchor));\n\t\t\t$newNode -> save();\n\t\t\t$this -> updateTree();\n\t\t\t$db -> commit();\n\t\t} catch(Exception $e) {\n\t\t\t$db -> rollBack();\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function addLast($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function addnew($data) {\n $this->insert($data);\n }", "public function add($data)\n {\n if (!empty($data) && is_array($data))\n {\n return $this->_insertData($data);\n }\n return false;\n }", "public static function addFreedl($data) {\n\t\tif (!is_array($data)) return false;\n\t\t$data = self::_cookData($data);\n\t\t$ret = self::_getDao()->insert($data);\n\t\tif (!$ret) return $ret;\n\t\treturn self::_getDao()->getLastInsertId();\n\t}", "public function insertAndSort($data)\n {\n $existingNode = $this->searchNode($data);\n if (!empty($existingNode)) {\n $existingNode->count++;\n $prevNode = $existingNode->prev;\n if (!empty($prevNode)) {\n while ($prevNode != null && $prevNode->count < $existingNode->count) {\n $existingNext = $existingNode->next;\n $prevPrev = $prevNode->prev;\n\n $existingNode->next = $prevNode;\n $existingNode->prev = $prevPrev;\n if (!empty($prevPrev))\n $prevPrev->next = $existingNode;\n else\n $this->firstNode = $existingNode;\n\n $prevNode->prev = $existingNode;\n if (!empty($existingNext)) {\n $prevNode->next = $existingNext;\n $existingNext->prev = $prevNode;\n }\n $prevNode = $existingNode->prev;\n }\n }\n } else {\n $link = new ListNode($data);\n $link->next = null;\n $link->prev = $this->lastNode;\n if ($link->prev != null) {\n $link->prev->next = $link;\n } else {\n $this->firstNode = $link;\n }\n $this->lastNode = &$link;\n $this->count++;\n }\n }", "public function add($data)\n {\n $this->db->insert($this->table, $data);\n }", "public function add($data)\n {\n $this->get();\n\n $resultAdd = $this->results;\n\n array_push($resultAdd, $data);\n\n return $resultAdd;\n }", "public function addData()\n {\n $this->addTo('data', func_get_args());\n }", "public function add($data)\n {\n if(!empty($data)){\n $fields = $placeholder = [];\n foreach($data as $field => $value){\n $fields[] = $field;\n $placeholder[] = \":{$field}\";\n }\n }\n $sql = \"INSERT INTO {$this->tableName} (\".implode(',', $fields).\") VALUES (\".implode(',', $placeholder).\")\";\n $stmt = $this->conn->prepare($sql);\n try{\n $this->conn->beginTransaction();\n $stmt->execute($data);\n $lastInsertId = $this->conn->lastInsertId();\n $this->conn->commit();\n return $lastInsertId;\n }catch(PDOException $e){\n\n echo \"Error: \".$e;\n $this->conn->rollBack();\n\n }\n }", "public function addCustomData($data)\n {\n $this->data = \\array_merge($this->data, $data);\n }", "public function add($data, $type = '')\n {\n }", "public function add(array $data);", "public function push($data)\n {\n if ($this->isFull()) {\n throw new \\OverflowException('Stack is full');\n }\n\n if ($this->head == null) {\n $this->head = new Node($data);\n $this->size++;\n return;\n }\n\n $node = new Node($data);\n $node->next = $this->head;\n $this->head = $node;\n $this->size++;\n }", "public function addFirst(string $data): void\n {\n // New node\n $newNode = new Node($data);\n\n if ($this->isEmpty()) {\n // Set last node\n $this->lastNode = $newNode;\n } else {\n // Set link from new first node to old first node\n $newNode->next = $this->firstNode;\n }\n\n // Set first node\n $this->firstNode = $newNode;\n $this->count++;\n }", "public function addLoop($data) {\n $length = is_array($data) || $data instanceof \\Countable ? count($data) : null;\n $parent = array_last($this->loopsStack);\n $this->loopsStack[] = [\n 'iteration' => 0,\n 'index' => 0,\n 'remaining' => isset($length) ? $length : null,\n 'count' => $length,\n 'first' => true,\n 'last' => isset($length) ? $length == 1 : null,\n 'depth' => count($this->loopsStack) + 1,\n 'parent' => $parent ? (object)$parent : null,\n ];\n }", "public function remove($data)\n {\n //check the linked list have data of not \n if ($this->head == null) {\n echo \"no data\";\n return;\n }\n //if data is equal to head data then is will make next data as head\n if ($this->head->data == $data) {\n $this->head = $this->head->next;\n $this->count--;\n return;\n }\n\n //temp to hold head data \n $temp = $this->head;\n $i;\n //for loop to store next node of data node\n for ($i=1; $i <= $this->count ; $i++) { \n //if temp data is equal to data then it will break tha loop\n if ($temp->data == $data) {\n //and if data is in the last index the it will not increment the temp value \n if ($i == $this->count) {\n break;\n }\n $temp = $temp->next;\n break;\n }\n $temp = $temp->next;\n }\n\n //temp2 to hold privious node\n $temp2 = $this->head;\n //for loop to store privious node in temp\n for ($j=1; $j < $i-1; $j++) { \n $temp2 = $temp2->next;\n }\n\n //if the data is in last index thin it will remove and \n //privious node of last index will change to tail\n if ($this->count == $i) {\n $temp2->next = null;\n $this->tail = $temp2;\n $this->count--;\n return;\n }\n //point privious to the next node of tha node\n $temp2->next = $temp;\n $this->count--;\n return;\n }", "public function add($data=array()){\n\t\t\treturn $this->requestor->put(sprintf( $this->requests['add']['url'] , $this->accountid ),$data);\n\t\t}", "public function add($data) {\n\t\ttry {\n\t\t\t$data = $this->cleanData($data);\n\t\t\t$this->isDataValid($data);\n\t\t\t$this->data[$data['start']] = $data;\n\t\t\tif($data['start'] < $this->lastValue) {\n\t\t\t\t$this->sortNeeded = true;\n\t\t\t}\n\t\t\t$this->lastValue = $data['start'];\n\t\t}\n\t\tcatch (UnexpectedValueException $e) {\n\t\t\tthrow new UnexpectedValueException(sprintf('The given data is not valid for %s: %s', get_class($this), $e->getMessage()));\n\t\t}\n\t\treturn $this;\n\t}", "public function addContents($data /* $data = null, ... */)\n {\n // bogus \"usage\" of parameter $data: scrutinizer warns this variable is\n // not used (we're using func_get_args instead to support overloading),\n // but it still needs to be defined because it makes no sense to have\n // this function without argument :)\n $args = array($data) + func_get_args();\n\n // this method can be overloaded\n foreach ($args as $value) {\n // redefine var\n $value = (string) $value;\n\n $key = count($this->data);\n\n // store data\n $this->data[$key] = $value;\n }\n }", "public function addContents($data /* $data = null, ... */)\n {\n // bogus \"usage\" of parameter $data: scrutinizer warns this variable is\n // not used (we're using func_get_args instead to support overloading),\n // but it still needs to be defined because it makes no sense to have\n // this function without argument :)\n $args = array($data) + func_get_args();\n\n // this method can be overloaded\n foreach ($args as $value) {\n // redefine var\n $value = (string) $value;\n\n $key = count($this->data);\n\n // store data\n $this->data[$key] = $value;\n }\n }", "public function setData($data)\n {\n $this->objectData[] = $data;\n }", "public function add ($data)\n {\n $q = $this->query->insert(...array_keys($data))->into(static::$table);\n return $this->save($q->build(), $data, true);\n }", "public function append( $node ){\n $this->nodes[] = $node;\n $this->numNodes++; \n }", "public function add($data){\n\t\t$session = new Session();\n\t\t$userId = $session->currentId();\n\t\tif($userId != false){\n\t\t\t//insert fq into database\n\t\t\t$uniqueId = uniqid();\n\t\t\t$response = $this->client->batchWriteItem(array(\n\t\t\t\t\"RequestItems\" => array(\n\t\t\t\t\t\"Links\" => array(\n\t\t\t\t\t\t array(\n\t\t\t\t\t\t\t\"PutRequest\" => array(\n\t\t\t\t\t\t\t\t\"Item\" => array(\n\t\t\t\t\t\t\t\t\t\"LinkId\"\t=> array(Type::STRING => $uniqueId),\n\t\t\t\t\t\t\t\t\t\"UserId\"\t=> array(Type::NUMBER => $userId),\n\t\t\t\t\t\t\t\t\t\"Text\"\t\t=> array(Type::STRING => htmlspecialchars($data[\"Text\"])),\n\t\t\t\t\t\t\t\t\t\"Url\"\t\t=> array(Type::STRING => htmlspecialchars($data[\"Url\"]))\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t));\n\t\t\t$this->LinkId = $uniqueId;\n\t\t\t$this->UserId = $userId;\n\t\t\t$this->Text = htmlspecialchars($data[\"Text\"]);\n\t\t\t$this->Url = htmlspecialchars($data[\"Url\"]);\n\n\t\t\treturn $this;\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}", "private function append($data)\n {\n $logFilePath = config('runningtime.path') . '/' . date('Y-m-d') . '.log';\n $this->checkLogDir();\n\n file_put_contents($logFilePath, $data, FILE_APPEND);\n\n if ($this->isDelayMode) {\n\n }\n }", "public function add($data)\n {\n unset($data['itemid']);\n\n if ($data['tax'] == '') {\n unset($data['tax']);\n }\n\n $this->db->insert(INVOICE_ITEMS_LIST_TABLE, $data);\n $insert_id = $this->db->insert_id();\n\n if ($insert_id) {\n logActivity('New Invoice Item Added [ID:'.$insert_id.', ' . $data['description'] . ']');\n return true;\n }\n\n return false;\n }", "public function end($data = null)\n {\n if ($this->complete) {\n return $this;\n }\n\n if ($data) {\n $this->write($data);\n }\n\n $new = clone $this;\n $new->complete = true;\n return $new;\n }", "public function end($data = null)\n {\n if ($this->complete) {\n return $this;\n }\n\n if ($data) {\n $this->write($data);\n }\n\n $new = clone $this;\n $new->complete = true;\n return $new;\n }", "public function appendInput($data)\n {\n $this->input->append($data);\n }", "public function add(Node $node){\n //because it's gonna remove its next element, but by cloning it\n //it'll keep the next element of the original node\n $newNode = clone $node;\n $newNode->setNext($this->head);\n $this->head = $newNode;\n }", "public function setTail(DTNode $node)\n\t{\n\t\t$this->tail = $node;\n\t}", "public function appendData($data)\n {\n fputcsv($this->fileHandle, $data);\n }", "public function add($data)\n {\n\n if (!empty($data)) {\n $fileds = $placholders = [];\n foreach ($data as $field => $value) {\n $fileds[] = $field;\n $placholders[] = \":{$field}\";\n }\n }\n\n $sql = \"INSERT INTO {$this->tableName} (\" . implode(',', $fileds) . \") VALUES (\" . implode(',', $placholders) . \")\";\n $stmt = $this->conn->prepare($sql);\n try {\n $this->conn->beginTransaction();\n $stmt->execute($data);\n $lastInsertedId = $this->conn->lastInsertId();\n $this->conn->commit();\n return $lastInsertedId;\n } catch (PDOException $e) {\n echo \"Error: \" . $e->getMessage();\n $this->conn->rollback();\n }\n\n }", "public function Append(Node $node)\n {\n if ($this->back === null) {\n $this->Prepend($node);\n return;\n }\n //set back next to node\n $this->back->setNext($node);\n //set node previous to current back\n $node->setPrevious($this->back);\n //set new back\n $this->back = &$node;\n // track linked list\n $this->nodes[] = $node;\n $this->counter ++;\n }", "public function append($data)\n {\n $content = file_get_contents($this->_filleFullName);\n $data = $content.PHP_EOL.$data;\n $saveToFileRes = file_put_contents($this->_filleFullName, $data);\n return $saveToFileRes;\n }", "public function addAdresse($data)\n {\n return static::$adresseImpdao->addAdresse($data);\n\n }", "public function _append( Node $n ): void {\n\t\t$this->_list[] = $n;\n\t}", "public function insertAfter(Ynbusinesspages_Model_Node $node, $data) {\n\t\tif($node -> pleft == 1) {\n\t\t\tthrow new Exception(\"can not insert after root\");\n\t\t}\n\t\t$newNode = $this -> fetchNew();\n\t\t$newNode -> setFromArray($data);\n\t\t$anchor = $node -> pright;\n\t\t$newNode -> pleft = $anchor + 1;\n\t\t$newNode -> pright = $anchor + 2;\n\t\t$newNode -> parent_id = $node -> parent_id;\n\t\t$db = $this -> getAdapter();\n\t\t$tableName = $this -> info('name');\n\n\t\ttry {\n\t\t\t$db -> beginTransaction();\n\t\t\t$db -> update($tableName, array('pright' => new Zend_Db_Expr('pright+2'), ), array('pright > ?' => $anchor));\n\t\t\t$db -> update($tableName, array('pleft' => new Zend_Db_Expr('pleft+2'), ), array('pleft > ?' => $anchor));\n\t\t\t$newNode -> save();\n\t\t\tif(!empty($data['photo']))\n\t\t\t{\n\t\t\t\t$newNode -> setPhoto($data['photo']);\n\t\t\t}\n\t\t\t$this -> updateTree();\n\t\t\t$optionId = Engine_Api::_()->getApi('core', 'Ynbusinesspages')->typeCreate($newNode->title);\n\t\t\t$newNode->option_id = $optionId;\n\t\t\t$newNode->save();\n\t\t\t$db -> commit();\n\t\t\treturn $newNode;\n\t\t} catch(Exception $e) {\n\t\t\t$db -> rollBack();\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function appendData($data) {\n if (!is_array($data)) {\n throw new \\InvalidArgumentException('Cannot append view data. Expected array argument.');\n }\n $this->_data = array_merge($this->_data, $data);\n }", "public function add(array $data)\n {\n $current = $this->session->get(self::KEY, []);\n $current[] = $data;\n\n $this->session->set(self::KEY, $current);\n }", "public function addRear($item)\n {\n $new_node = new DNode($item);\n if (!$this->isEmpty()) {\n $this->tail->next = $new_node;\n } else {\n $this->head = $new_node;\n }\n $new_node->prev = $this->tail;\n $this->tail = $new_node;\n }", "public function add($data)\n {\n return $this->db->insert($this->table, $data);\n }", "public static function add($data) {\n\t\tif (!is_array($data)) return false;\n\t\t$data = self::_cookData($data);\n\t\treturn self::_getDao()->insert($data);\n\t}", "public static function add($data) {\n\t\tif (!is_array($data)) return false;\n\t\t$data = self::_cookData($data);\n\t\treturn self::_getDao()->insert($data);\n\t}", "public function addRecordToList($identifier, array $data) {\n\t\treturn $this->sharepointHandler->write($identifier, $data);\n\t}", "public function addData($data, $type) {\n\t\t$this->data[$type] = $data;\n\t}", "function next() {\n\t\t++$this->_dataPointer;\n\t}", "public function end($data = null)\n {\n if($this->isWritable())\n {\n $this->getStream()->end($data);\n }\n }", "public function add_order_item_data($data)\n\t{\n\t\treturn $this->db->insert('order_items', $data);\n\t}", "public function add($key, $data);", "function insertRelTagData($data) {\n\t\treturn $this->insertByArray($this->_rel_tag, $data);\n\t}", "public function write($data)\n {\n $this->chunks[] = $data;\n }", "public function add($data): int;", "public function enqueue($data)\n {\n $new_node = new QNode($data);\n /**\n * checking the Queue is empty or not\n */\n if ($this->isEmpty()) {\n $this->front = $this->rear = $new_node;\n } else {\n $this->rear->next = $new_node;\n $this->rear = $new_node;\n }\n /**\n * increases the size by adding the elements\n */\n self::$size++;\n }", "public function add($data)\n\t{\n\t\t$precioSoles = round($data['precio'] * $data['tdc'], 2);\n\t\t$precioDolar = round($precioSoles / $data['tdcDolar'], 2);\n\n\t\t/**\n\t\t * Posible problema de precision\n\t\t */\n\t\t$monto = round($data['precio'] * $data['cantidad'], 2);\n\t\t$montoSoles = round($monto * $data['tdc'], 2);\n\t\t$montoDolares = round($montoSoles / $data['tdcDolar'], 2);\n\n\t\t$item = $data;\n\t\t$item['precioSoles'] = $precioSoles;\n\t\t$item['precioDolar'] = $precioDolar;\n\t\t$item['total'] = $monto;\n\t\t$item['totalSoles'] = $montoSoles;\n\t\t$item['totalDolares'] = $montoDolares;\n\n\t\t/**\n\t\t * monto de gasto en dolares\n\t\t */\n\t\tif(isset($data['gastoUnitario']) && !is_null($data['gastoUnitario'])) {\n\t\t\t$gastoUnitario = $data['gastoUnitario'];\n\t\t\t$item['gastoUnitario'] = $gastoUnitario;\n\t\t\t$item['gastoTotal'] = round($gastoUnitario * $data['cantidad'], 2);\n\t\t\t$item['precioLiquido'] = round($item['precioDolar'] + $item['gastoUnitario'], 2);\n\t\t\t$item['totalLiquido'] = round($item['precioLiquido'] * $item['cantidad'], 2);\n\n\t\t\t$this->unitarioGastoDolares += $gastoUnitario;\n\t\t\t$this->totalGastoDolares += $item['gastoTotal'];\n\t\t\t$this->unitarioCostoDolares += $item['precioLiquido'];\n\t\t\t$this->totalCostoDolares += $item['totalLiquido'];\n\t\t}\n\n\t\t$this->items[] = $item;\n\n\t\t$this->totalUnitario += round($data['precio'], 2);\n\n\t\t$this->total += $monto;\n\t\t$this->totalSoles += $montoSoles;\n\t\t$this->totalDolares += $montoDolares;\n\t}", "public function push($data);" ]
[ "0.7572776", "0.7510909", "0.7045585", "0.6970518", "0.6874907", "0.67199886", "0.65950865", "0.6589362", "0.65292245", "0.65070426", "0.6503594", "0.6438791", "0.63861305", "0.63757586", "0.6365969", "0.6360373", "0.6257623", "0.6257623", "0.6220747", "0.62000823", "0.61797357", "0.61310995", "0.6101583", "0.6101042", "0.6084714", "0.60724765", "0.5980448", "0.59740144", "0.5971668", "0.59653056", "0.59321445", "0.5929667", "0.5929125", "0.59290105", "0.58974016", "0.58892035", "0.5870746", "0.585639", "0.58477634", "0.5847168", "0.5817695", "0.5790712", "0.5782544", "0.5776805", "0.5763367", "0.57315195", "0.5714307", "0.5707385", "0.5687324", "0.5687193", "0.5665838", "0.5665008", "0.56598276", "0.5654588", "0.5647806", "0.5640931", "0.5634547", "0.56283635", "0.56253636", "0.56213105", "0.5606131", "0.56006527", "0.5567946", "0.5567946", "0.5566455", "0.5559604", "0.55494136", "0.55401474", "0.5536621", "0.5524354", "0.5513313", "0.5513313", "0.55126375", "0.5508783", "0.54906195", "0.54808426", "0.54805446", "0.54675037", "0.54475677", "0.54420286", "0.54396015", "0.54264206", "0.5418292", "0.53920907", "0.5384576", "0.53800493", "0.53783005", "0.53783005", "0.53779316", "0.5375439", "0.537209", "0.5355338", "0.5336337", "0.5328094", "0.5319204", "0.53175795", "0.53163594", "0.53091097", "0.53041536", "0.5297166" ]
0.79067224
0
Remove node with given index of linked list.
Удалить узел с заданным индексом из связанного списка.
public function removeAt(int $index): void { $count = $this->count; if ($index > $count - 1) { throw new RuntimeException(sprintf( 'Node with index "%s" cannot be removed from linked list which has "%s" nodes.', $index, $count )); } if ($index === 0) { // First node $this->removeFirst(); } elseif ($index === $count - 1) { // Last node $this->removeLast(); } else { // Node between first and last node $node = $this->firstNode; $i = 0; while ($node->next !== null) { // If next node should be remove node index if ($i + 1 === $index) { // Move node next step ahead $node->next = $node->next->next; // Decrement node counter and exit function $this->count--; return; } $node = $node->next; $i++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function remove($index)\n {\n $prev = null;\n $node = $this->head;\n\n if($index < 0){\n throw new \\LogicException(\"Index out of range: $index\");\n }\n\n for($i = 0; $i < $index && $node !== null; $i++){\n $prev = $node;\n $node = $node->getNext();\n }\n\n if($node === null){\n throw new \\LogicException(\"Index out of range: $index\");\n }\n\n $next = $node->getNext();\n\n if($prev === null){\n $this->head = $next;\n }else {\n $next ? $prev->setNext($next) : $prev->clearNext();\n }\n }", "public function deleteNodeByIndex($index) {\n\n $current = $this->firstNode;\n $previous = $this->firstNode;\n $start = 0;\n\n while ($start != $index) {\n\n if ($current->next == null) {\n return;\n } else {\n $previous = $current;\n $current = $current->next;\n $start++;\n }\n }\n\n if ($current == $this->firstNode) {\n\n if ($this->counter == 1) {\n $this->lastNode = $this->firstNode;\n }\n\n $this->firstNode = $this->firstNode->next;\n } else {\n\n if ($this->lastNode == $current) {\n $this->lastNode = $previous;\n }\n\n $previous->next = $current->next;\n $previous->next->prev = $current->prev;\n }\n\n $this->counter--;\n }", "function deleteAtIndex($index) {\n\t\tif ($index < 0 || $index > $this->length) {\n\t\t\treturn NULL;\n\t\t}\n\t\t$q = $this->link;\n\t\t$p = $this->link->next;\n\t\t$i = 0;\n\t\twhile ($p && $i++ < $index) {\n\t\t\t$q = $q->next;\n\t\t\t$p = $p->next;\n\t\t}\n\t\tif (!$p) {\n\t\t\treturn -1;\n\t\t}\n\t\t$q->next = $p->next;\n\t\tunset($p);\n\t\t$this->length--;\n\t}", "public function remove($index) {}", "public function remove($index) {}", "function removeAt($index);", "public function destroyNode(int|string $index)\n {\n }", "public function remove(int $index)\n {\n }", "public function removeAt($index)\n\t{\n\t\tif ($this->getReadOnly()) {\n\t\t\tthrow new TInvalidOperationException('list_readonly', $this::class);\n\t\t}\n\n\t\tif (($priority = $this->priorityAt($index, true)) !== false) {\n\t\t\treturn $this->internalRemoveAtIndexInPriority($priority[1], $priority[0]);\n\t\t}\n\t\tthrow new TInvalidDataValueException('list_index_invalid', $index);\n\t}", "public function removeItem($index){\n\t\t// Keep them honest, make sure that it is an integer above zero\n\t\t$ix = intval($index);\n\t\tif ($ix<0){\n\t\t\tthrow Exception(\"ERROR: \".__CLASS__.\":\".__FUNCTION__.\" - Illegal index value.\");\n\t\t}\n\t\t\n\t\t// ----------------------\n\t\t// remove that element\n\t\t// ----------------------\n\t\tunset($this->_data[$ix]);\n\t\t\n\t\treturn;\n\t}", "public function unsetItem($index);", "public function remove($index) {\n $this->rangeCheck($index);\n\n $oldValue = $this->elementData[$index];\n\n $numMoved = $this->size - $index - 1;\n if ($numMoved > 0) {\n ThinUtil::arraycopy($this->elementData, $index + 1, $this->elementData, $index, $numMoved);\n }\n $this->elementData[--$this->size] = null; // clear to let GC do its work\n\n return $oldValue;\n }", "#[Generic(['return' => 'T'])]\n public function remove($index) {\n if ($index < 0 || $index >= $this->size) {\n throw new IndexOutOfBoundsException('Offset '.$index.' out of bounds');\n }\n\n $orig= $this->elements[$index];\n unset($this->elements[$index]);\n $this->elements= array_values($this->elements);\n $this->size--;\n return $orig;\n }", "function remove($index)\n\t{\n\t\tif ($this->children != null && $index >= 0)\n\t\t{\n\t\t\t$child = $this->getChildAt($index);\n\t\t\t\n\t\t\tif ($child != null)\n\t\t\t{\n\t\t\t\tarray_splice($this->children, $index, 1);\n\t\t\t\t$child->setParent(null);\n\t\t\t}\n\t\t\t\n\t\t\treturn $child;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "private function fastRemove($index) {\n\t\t$index = (int) $index;\n\t\t$numMoved = $this->size - $index - 1;\n\t\tif ($numMoved > 0) {\n\t\t\tSystem::arraycopy( $this->elementData, $index + 1, $this->elementData, $index, $numMoved );\n\t\t}\n\t\t$this->elementData[--$this->size] = null;\n\t}", "public function removeAt($index) {\n\t\t$index = (int) $index;\n\t\t$this->rangeCheck( $index );\n\t\t\n\t\t$oldValue = $this->elementData( $index );\n\t\t\n\t\t$numMoved = $this->size - $index - 1;\n\t\tif ($numMoved > 0) {\n\t\t\tSystem::arraycopy( $this->elementData, $index + 1, $this->elementData, $index, $numMoved );\n\t\t}\n\t\t$this->elementData[--$this->size] = null;\n\t\treturn $oldValue;\n\t}", "public function removeAt($index)\n\t{\n\t\tif ($index >= 0 && $index < $this->_c) {\n\t\t\t$this->_c--;\n\t\t\tif ($index === $this->_c) {\n\t\t\t\treturn array_pop($this->_d);\n\t\t\t} else {\n\t\t\t\t$item = $this->_d[$index];\n\t\t\t\tarray_splice($this->_d, $index, 1);\n\t\t\t\treturn $item;\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new InvalidParamException('Index out of range: ' . $index);\n\t\t}\n\t}", "public function remove($index){\r\n if ($index < 0 || $index > $this->count)\r\n return null;\r\n\r\n $tmp = $this->array[$index];\r\n $this->array[$index] = null;\r\n $this->count--;\r\n return $tmp;\r\n }", "public function remove(Node $node);", "public function removeAt(int $index) : bool;", "public function delete(int $index);", "public function taskRemove($index);", "public function taskRemove( $index );", "public function removeItem($index): void\n {\n unset($this->items[$index]);\n $this->memorize('items', $this->items);\n }", "public function deleteIndex ($index) {}", "public function removeCell(int $index):void;", "public function remove( $index )\n {\n if ( $index < 0 || $index >= count( $this->tasks ) )\n {\n throw new \\OutOfBoundsException( '$index is outside range' );\n }\n unset( $this->tasks[$index] );\n $this->sortTasks();\n }", "public function remove($index)\n\t{\n\t\tunset($this->list[$index]);\n\t\treturn $this;\n\t}", "public function unchangeIndex ($index) {}", "public function drop($index)\n {\n if (false === array_key_exists($index, $this->elements)) {\n throw new \\OutOfBoundsException();\n }\n unset($this->elements[$index]);\n $this->elements = array_values($this->elements);\n foreach ($this->subLists as $subList) {\n $subList->drop($index, true);\n }\n return $this;\n }", "function deleteByIndex($p_index)\n {\n }", "public function delete( string $index )\n {\n \n if( $this->id === NULL ) {\n $this->getContent();\n }\n \n if( array_key_exists( $index, $this->content ) ) {\n unset( $this->content[$index] );\n }\n }", "public function remove($pos) {\n if ($pos < 0 || $pos >= sizeof($this->nodes)) return null;\n\n $candidate= $this->nodes[$pos];\n unset($this->nodes[$pos]);\n return $candidate;\n }", "public function dropIndex(string $index): void;", "public function removeOptionAt($index) {\r\n\t\t$options = $this->getElementsByTagName('option');\r\n\t\t$this->removeChild($options->item($index));\r\n\t}", "public function unsetURL($index)\n {\n unset($this->uRL[$index]);\n }", "public function unsetURL($index)\n {\n unset($this->uRL[$index]);\n }", "public function remove($index) {\n array_splice($this->collection, $index, 1);\n }", "public function unsetItem($index)\n {\n unset($this->item[$index]);\n }", "function deleteNode($key) {\n $node = $this->head;\n // check head\n if ($node != NULL){\n if ($node->data == $key) {\n $this->head = $node->next;\n $node = NULL;\n return;\n }\n }\n // check rest of list\n while ($node != NULL) {\n if ($node->data == $key) {\n break;\n }\n $prev = $node;\n $node = $node->next;\n }\n if ($node == NULL) {\n return;\n }\n $prev->next = $node->next;\n if ($prev->next->prev != NULL) {\n $prev->next->prev = $prev;\n }\n $node = NULL;\n }", "public function removeAt($index)\n {\n $index = (int) $index;\n if ($index >= $this->elementCount) {\n throw new ArrayIndexOutOfBoundsException($index);\n }\n $oldValue = $this->elementData($index);\n \n $numMoved = $this->elementCount - $index - 1;\n if ($numMoved > 0) {\n System::arraycopy($this->elementData, $index + 1,\n $this->elementData, $index, $numMoved);\n }\n $this->elementData[--$this->elementCount] = null;\n \n return $oldValue;\n }", "public function remove($index)\n {\n unset(self::$sessionStorage[$index]);\n }", "public function remove($data)\n {\n //check the linked list have data of not \n if ($this->head == null) {\n echo \"no data\";\n return;\n }\n //if data is equal to head data then is will make next data as head\n if ($this->head->data == $data) {\n $this->head = $this->head->next;\n $this->count--;\n return;\n }\n\n //temp to hold head data \n $temp = $this->head;\n $i;\n //for loop to store next node of data node\n for ($i=1; $i <= $this->count ; $i++) { \n //if temp data is equal to data then it will break tha loop\n if ($temp->data == $data) {\n //and if data is in the last index the it will not increment the temp value \n if ($i == $this->count) {\n break;\n }\n $temp = $temp->next;\n break;\n }\n $temp = $temp->next;\n }\n\n //temp2 to hold privious node\n $temp2 = $this->head;\n //for loop to store privious node in temp\n for ($j=1; $j < $i-1; $j++) { \n $temp2 = $temp2->next;\n }\n\n //if the data is in last index thin it will remove and \n //privious node of last index will change to tail\n if ($this->count == $i) {\n $temp2->next = null;\n $this->tail = $temp2;\n $this->count--;\n return;\n }\n //point privious to the next node of tha node\n $temp2->next = $temp;\n $this->count--;\n return;\n }", "public function offsetUnset($index)\n {\n $this->Remove($index);\n }", "public function removeElementAt($index)\n {\n if ($index >= $this->elementCount) {\n throw new ArrayIndexOutOfBoundsException(\n $index . '>=' . $this->elementCount);\n } elseif ($index < 0) {\n throw new ArrayIndexOutOfBoundsException($index);\n }\n $j = $this->elementCount - $index - 1;\n if ($j > 0) {\n System::arraycopy($this->elementData, $index + 1,\n $this->elementData, $index, $j);\n }\n $this->elementCount--;\n $this->elementData[$this->elementCount] = null;\n }", "public function removeRowAtIndex($index)\n {\n $tempData = [];\n foreach ($this->data as $key => $row) {\n if ($key !== $index) {\n $tempData[] = $row;\n }\n }\n $this->data = null;\n unset($this->data);\n $this->data = $tempData;\n\n $this->_markAsDirty();\n }", "public function remove_menu_item($index)\n {\n array_splice($this->menu_items, $index, 1);\n }", "public function removeAt(int $index): void\n {\n $this->collection->remove($index);\n }", "public function removerItem($idx)\n {\n $carrinho = $this->getCarrinho();\n if (!isset($carrinho[$idx])) {\n throw new \\Exception('Item inexistente no carrinho!');\n }\n unset($carrinho[$idx]);\n $this->atualizar($carrinho);\n }", "public function removeRow($index){\n\t\tif(isset($this->children[$index])){\n\t\t\t$row = $this->children[$index];\n\t\t\t$this->removeChild($index);\n\t\t\treturn $row;\n\t\t}\n\t\treturn false;\n\t}", "public function unsetListValue($index)\n {\n unset($this->listValue[$index]);\n }", "public function deleteElement($indexOrNameOrInstance);", "public function remove($index, $key = 'id')\n {\n if ($key == 'id') {\n if (isset($this->items[$index])) {\n unset($this->items[$index]);\n }\n }\n else {\n foreach ($this->filter($key, '=', $index)->fetch() as $i => $filtered) {\n unset($this->items[$i]);\n }\n }\n\n return $this;\n }", "public function remove()\n\t{\n\t\tparent::remove() ;\n\t\t$this->node->remove() ;\n\t}", "public function removeAt(int $idx): void\n {\n array_splice($this->records, $idx, 1);\n\n // Change ref index of every subsquent doc\n for ($i = $idx, $len = $this->size(); $i < $len; $i += 1) {\n $this->records[$i]['i'] -= 1;\n }\n }", "public function removeData($index) {\n\t\t$this->datas[$index] = null;\n\t}", "private function removeFieldAtIndex($index)\n {\n return array_splice($this->fields, $index, 1);\n }", "public function deleteNode($i) {\n\t\tif (isset($this -> nodes[$i])) {\n\t\t\t$node = $this -> nodes[$i];\n\t\t\tif (!empty($node -> getSerials())) {\n\t\t\t\t// Node has configured Serial interfaces\n\t\t\t\tforeach ($node -> getSerials() as $interface_id => $interface) {\n\t\t\t\t\tif ($interface -> getRemoteId() != 0) {\n\t\t\t\t\t\t// Serial interface is configured, unlink remote node\n\t\t\t\t\t\t$rc = $this -> nodes[$interface -> getRemoteId()] -> unlinkInterface($interface -> getRemoteIf());\n\t\t\t\t\t\tif ($rc !== 0) {\n\t\t\t\t\t\t\terror_log(date('M d H:i:s ').'WARNING: '.$this -> path .'/'.$this -> filename.'?node='.$interface -> getRemoteId().' '.$GLOBALS['messages'][20035]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Delete the node\n\t\t\tunset($this -> nodes[$i]);\n\t\t} else {\n\t\t\terror_log(date('M d H:i:s ').'WARNING: '.$this -> path .'/'.$this -> filename.'?node='.$i.' '.$GLOBALS['messages'][20024]);\n\t\t}\n\t\treturn $this -> save();\n\t}", "function remove() {\n\t\tif ( false === $this->last_index ) return;\n\t\tunset( $this->block[$this->last_index] );\n\t}", "protected function _remove_node(DOMNode $node, array &$children, $index)\n {\n $child = $children[$index];\n $previousChild = $child->previousSibling;\n $nextChild = $child->nextSibling;\n $node->removeChild($child);\n if (isset($previousChild, $nextChild)) {\n if ($previousChild->nodeName === \"#text\" && $nextChild->nodeName === \"#text\") {\n $previousChild->nodeValue .= $nextChild->nodeValue;\n $this->_remove_node($node, $children, $index+1);\n }\n }\n array_splice($children, $index, 1);\n }", "public function remove( $Index ) {\n\t\t$r = $this->get( $Index );\n\t\tif ( !$r ) return null; // Index out of bounds\n\t\tarray_splice( $this->items, $Index, 1 );\n\t\treturn $r;\n\t}", "public function removeAt(int $index): self\n {\n if (array_key_exists($index, $this->items)) {\n unset($this->items[$index]);\n }\n\n return $this;\n }", "public function offsetUnset($index)\n\t\t{\n\t\t\tif (!$this->offsetExists($index)) \n\t\t\t\tthrow new IndexError();\n\t\t\t$this->data[$index - $this->baseIndex] = NULL;\n\t\t}", "public function removeJobByIndex($index){\n unset($this->jobs[$index]);\n }", "public function delete($index) {\n\t\treturn $this->_entryDelete($index);\n\t}", "public function remove(int $offset);", "public function unsetWorkId($index)\n {\n unset($this->workId[$index]);\n }", "public function unsetURLDetails($index)\n {\n unset($this->uRLDetails[$index]);\n }", "public function offsetUnset($index) {\r\n return;\r\n }", "public function deleteFirstNode() {\n\n $this->firstNode = $this->firstNode->next;\n $this->counter--;\n }", "public function remove($data)\n {\n $current = null;\n $temp = null;\n\n if($this->size==0)\n {\n echo \"list is empty\\n\";\n }\n else if($this->front->data == $data && $this->front->next == null)\n {\n $this->front =null;\n $this->last = null;\n echo \"$data removed from list\\n\";\n $this->size--;\n }\n else if($this->front->data == $data && $this->front->next != null)\n {\n $temp = $this->front;\n $this->front = $this->front->next;\n $temp = null;\n echo \"$data removed from list\\n\";\n $this->size--;\n }\n else\n {\n $temp = $this->front;\n $current = $this->front->next;\n while($current!=null)\n {\n if($current->data == $data)\n {\n $temp->next = $current->next;\n $current->next = null;\n echo \"$data removed from list\\n\";\n $this->size--;\n break;\n }\n else\n {\n $temp = $current;\n $current = $current->next;\n }\n }\n }\n }", "public function remove(): void\n {\n $this->tree->removeNode($this);\n }", "public function offsetUnset($index)\n {\n if (is_object($index)) {\n if (method_exists($index, \"__toString\")) {\n $index = $index->__toString();\n } else {\n $index = spl_object_hash($index);\n }\n }\n\n if ($this->offsetExists($index) !== false) {\n $this->size--;\n $this->array[$index] = null;\n }\n }", "public function removeIndex(int $index, mixed &$value = null): bool\n {\n $this->indexCheck($index);\n\n // Clear ref.\n $value = null;\n\n if ($ok = $this->hasIndex($index)) {\n $count = $this->count();\n\n // Fill ref.\n $value = $this->data[$index];\n\n unset($this->data[$index]);\n\n // Re-index if no last index dropped.\n if ($index != $count - 1) {\n $this->resetIndexes();\n }\n }\n\n return $ok;\n }", "public function removeElementByName(string $name, int $index = null): HtmlForm\n {\n\t\tif($index !== null) {\n\t\t\tunset($this->elements[$name][$index]);\n\t\t}\n\t\telse {\n\t\t\tunset($this->elements[$name]);\n\t\t}\n return $this;\n\t}", "public function remove()\n {\n if ($this->node->parentNode) {\n $this->node->parentNode->removeChild($this->node);\n }\n }", "public function unsetConnectionLink($index)\n {\n unset($this->connectionLink[$index]);\n }", "public function unsetFlightRefNumberRPHList($index)\n {\n unset($this->flightRefNumberRPHList[$index]);\n }", "public function unsetNameValueList($index)\n {\n unset($this->nameValueList[$index]);\n }", "public function unsetInformation($index)\n {\n unset($this->information[$index]);\n }", "public function removeChapter($index) {\n\t\t$this->chapters[$index] = null;\n\t}", "public function removeAtIndexInPriority($index, $priority = null)\n\t{\n\t\t$this->scrubWeakReferences();\n\t\treturn $this->internalRemoveAtIndexInPriority($index, $priority);\n\t}", "public function unsetResourceId($index)\n {\n unset($this->resourceId[$index]);\n }", "public function remove(mixed $value, int &$index = null): bool\n {\n if ($ok = $this->has($value, $index)) {\n $count = $this->count();\n\n unset($this->data[$index]);\n\n // Re-index if no last index dropped.\n if ($index != $count - 1) {\n $this->resetIndexes();\n }\n }\n\n return $ok;\n }", "public function remove( $key )\n\t{\n\t\tunset($this->nodes[$key]);\n\t}", "public function unsetRelatedResource($index)\n {\n unset($this->relatedResource[$index]);\n }", "public function remove() {\n\t\tif(is_null($this->_))\n\t\t\treturn;\n\t\t$index = array_search($this, $this->_->children);\n\t\tif($index !== false)\n\t\t\tarray_splice($this->_->children, $index, 1);\n\t}", "public function unsetRelatedRelease($index)\n {\n unset($this->relatedRelease[$index]);\n }", "public function deleteComment($index)\n {\n $this->find(\"id\", $index);\n $this->delete();\n }", "public function offsetUnset($index)\n {\n $position = array_search($index, $this->data_keys);\n unset($this->data[$index]);\n array_splice($this->data_keys, $position, 1);\n\n // for right unset through foreach\n $this->prev();\n }", "public function unsetNote($index)\n {\n unset($this->note[$index]);\n }", "public function unsetNote($index)\n {\n unset($this->note[$index]);\n }", "public function unsetNote($index)\n {\n unset($this->note[$index]);\n }", "public function unsetNote($index)\n {\n unset($this->note[$index]);\n }", "public function unsetNote($index)\n {\n unset($this->note[$index]);\n }", "function pop(&$list, $index, &$dis) {\n $dis = $list[$index];\n unset($list[$index]);\n return $dis;\n}", "function remove_index($courseIndex, $plan){\n\t\t$lessonList = DBManager::retrieve_list_of_lesson($courseIndex->get_lesson_index());\n\t\tforeach($lessonList as $lesson){\n\t\t\t$day_index = get_day_index($lesson->get_lesson_day());\n\t\t\t$start_time_index = get_time_index($lesson->get_lesson_start_time());\n\t\t\t$end_time_index = get_time_index($lesson->get_lesson_end_time());\n\t\t\t$lesson_weeks = get_lesson_weeks($lesson->get_lesson_remark());\n\t\t\tfor($i=$start_time_index; $i<$end_time_index; $i++){\n\t\t\t\tarray_pop($plan[$i][$day_index]);\n\t\t\t}\n\t\t}\n\t\treturn $plan;\n\t}", "function popNode(){\n $pop = $this->head;\n $this->head = $this->head->next;\n $this->head->prev = NULL;\n return $pop;\n\n }", "public function remove($offset);", "public static function delete_at_(array &$arr, $index) {\n\t\tif(isset($arr[$index])) {\n\t\t\t$ret = $arr[$index];\n\t\t\tunset($arr[$index]);\n\t\t\treturn $ret;\n\t\t}\n\t\treturn;\n\t}" ]
[ "0.77084136", "0.7564076", "0.7510192", "0.7290734", "0.7290734", "0.7250377", "0.7225157", "0.7110584", "0.69139963", "0.6827777", "0.67300457", "0.65700656", "0.6542714", "0.65260446", "0.65191656", "0.65107137", "0.6406956", "0.63929015", "0.6361767", "0.6353597", "0.63166904", "0.6309464", "0.63073546", "0.62639403", "0.6195122", "0.6172654", "0.61510897", "0.614486", "0.61136514", "0.6106542", "0.60908216", "0.60757715", "0.6071667", "0.60605764", "0.60417753", "0.6020909", "0.6020909", "0.59940666", "0.597456", "0.5966752", "0.59613216", "0.59347373", "0.5859064", "0.5858225", "0.58564895", "0.5829459", "0.58239096", "0.5821823", "0.57981586", "0.5787302", "0.5785693", "0.5777808", "0.57613075", "0.5750386", "0.5743842", "0.5734223", "0.57317674", "0.5725711", "0.57141584", "0.57014793", "0.56962556", "0.5684809", "0.5634528", "0.56130326", "0.5600866", "0.55891514", "0.5586228", "0.5568233", "0.5562928", "0.55615985", "0.55611587", "0.5540481", "0.5530418", "0.55218315", "0.5516924", "0.55166775", "0.5510357", "0.55090547", "0.5501119", "0.5478317", "0.5468417", "0.54660606", "0.54324955", "0.5427444", "0.54259205", "0.5405855", "0.5399414", "0.53892505", "0.5385373", "0.5380793", "0.536913", "0.536913", "0.536913", "0.536913", "0.536913", "0.5353811", "0.534535", "0.5345162", "0.5337663", "0.53357434" ]
0.78221846
0
Remove first node of linked list.
Удалить первый узел списка связей.
public function removeFirst(): void { if ($this->isEmpty()) { throw new RuntimeException('It is not possible remove first node from empty linked list.'); } // Save to local variable and destroy first node $firstNode = $this->firstNode; $this->firstNode = null; if ($this->isEmpty()) { $this->lastNode = null; } else { $this->firstNode = $firstNode->next; } $this->count--; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteFirstNode() {\n\n $this->firstNode = $this->firstNode->next;\n $this->counter--;\n }", "public function deleteLastNode() {\n\n if ($this->firstNode->next == null) {\n\n $this->firstNode = null;\n $this->counter--;\n } else {\n\n $previous = $this->firstNode;\n $current = $this->firstNode->next;\n\n while ($current->next != null) {\n $previous = $current;\n $current = $current->next;\n }\n\n $previous->next = null;\n $this->lastNode = $previous;\n $this->counter--;\n }\n }", "public function removeFront()\n {\n $temp = $this->head;\n if ($this->head == $this->tail) {\n $this->tail = null;\n }\n if ($this->isEmpty()) {\n echo \"underflow\\n\";\n } else {\n $this->head->next->prev = null;\n }\n $this->head = $this->head->next;\n $this->temp->next = null;\n }", "function popNode(){\n $pop = $this->head;\n $this->head = $this->head->next;\n $this->head->prev = NULL;\n return $pop;\n\n }", "function deleteNode($key) {\n $node = $this->head;\n // check head\n if ($node != NULL){\n if ($node->data == $key) {\n $this->head = $node->next;\n $node = NULL;\n return;\n }\n }\n // check rest of list\n while ($node != NULL) {\n if ($node->data == $key) {\n break;\n }\n $prev = $node;\n $node = $node->next;\n }\n if ($node == NULL) {\n return;\n }\n $prev->next = $node->next;\n if ($prev->next->prev != NULL) {\n $prev->next->prev = $prev;\n }\n $node = NULL;\n }", "public function removeLast(): void\n {\n if ($this->isEmpty()) {\n throw new RuntimeException('It is not possible remove last node from empty linked list.');\n }\n\n // Destroy last node\n $this->lastNode = null;\n\n if ($this->isEmpty()) {\n $this->firstNode = null;\n } else {\n $node = $this->firstNode;\n while ($node !== null) {\n if ($node->next->next === null) {\n $node->next = null;\n $this->lastNode = $node;\n }\n\n $node = $node->next;\n }\n }\n\n $this->count--;\n }", "public function deleteNodeByIndex($index) {\n\n $current = $this->firstNode;\n $previous = $this->firstNode;\n $start = 0;\n\n while ($start != $index) {\n\n if ($current->next == null) {\n return;\n } else {\n $previous = $current;\n $current = $current->next;\n $start++;\n }\n }\n\n if ($current == $this->firstNode) {\n\n if ($this->counter == 1) {\n $this->lastNode = $this->firstNode;\n }\n\n $this->firstNode = $this->firstNode->next;\n } else {\n\n if ($this->lastNode == $current) {\n $this->lastNode = $previous;\n }\n\n $previous->next = $current->next;\n $previous->next->prev = $current->prev;\n }\n\n $this->counter--;\n }", "public function removeRear()\n {\n $temp = $this->tail;\n if ($this->head == $this->tail) {\n $this->head = null;\n } else {\n $this->tail->prev->next = null;\n }\n $val = $this->tail->data;\n $this->tail = $this->tail->prev;\n $temp->prev = null;\n return $val;\n }", "public function remove($data)\n {\n $current = null;\n $temp = null;\n\n if($this->size==0)\n {\n echo \"list is empty\\n\";\n }\n else if($this->front->data == $data && $this->front->next == null)\n {\n $this->front =null;\n $this->last = null;\n echo \"$data removed from list\\n\";\n $this->size--;\n }\n else if($this->front->data == $data && $this->front->next != null)\n {\n $temp = $this->front;\n $this->front = $this->front->next;\n $temp = null;\n echo \"$data removed from list\\n\";\n $this->size--;\n }\n else\n {\n $temp = $this->front;\n $current = $this->front->next;\n while($current!=null)\n {\n if($current->data == $data)\n {\n $temp->next = $current->next;\n $current->next = null;\n echo \"$data removed from list\\n\";\n $this->size--;\n break;\n }\n else\n {\n $temp = $current;\n $current = $current->next;\n }\n }\n }\n }", "public function remove()\n\t{\n\t\tparent::remove() ;\n\t\t$this->node->remove() ;\n\t}", "public function remove($index)\n {\n $prev = null;\n $node = $this->head;\n\n if($index < 0){\n throw new \\LogicException(\"Index out of range: $index\");\n }\n\n for($i = 0; $i < $index && $node !== null; $i++){\n $prev = $node;\n $node = $node->getNext();\n }\n\n if($node === null){\n throw new \\LogicException(\"Index out of range: $index\");\n }\n\n $next = $node->getNext();\n\n if($prev === null){\n $this->head = $next;\n }else {\n $next ? $prev->setNext($next) : $prev->clearNext();\n }\n }", "public function remove() {\n\t\tif(is_null($this->_))\n\t\t\treturn;\n\t\t$index = array_search($this, $this->_->children);\n\t\tif($index !== false)\n\t\t\tarray_splice($this->_->children, $index, 1);\n\t}", "public function removeAt(int $index): void\n {\n $count = $this->count;\n\n if ($index > $count - 1) {\n throw new RuntimeException(sprintf(\n 'Node with index \"%s\" cannot be removed from linked list which has \"%s\" nodes.',\n $index,\n $count\n ));\n }\n\n if ($index === 0) {\n // First node\n $this->removeFirst();\n } elseif ($index === $count - 1) {\n // Last node\n $this->removeLast();\n } else {\n // Node between first and last node\n\n $node = $this->firstNode;\n $i = 0;\n\n while ($node->next !== null) {\n // If next node should be remove node index\n if ($i + 1 === $index) {\n // Move node next step ahead\n $node->next = $node->next->next;\n // Decrement node counter and exit function\n $this->count--;\n return;\n }\n\n $node = $node->next;\n $i++;\n }\n }\n }", "public function remove()\n {\n if ($this->node->parentNode) {\n $this->node->parentNode->removeChild($this->node);\n }\n }", "public function remove(Node $node);", "public function removeCurrentItem()\n {\n $this->list->offsetUnset($this->list->key());\n $this->list->next();\n }", "public function removeOne()\r\n {\r\n }", "public function clear()\n {\n $this->head = null;\n }", "public function remove($data)\n {\n //check the linked list have data of not \n if ($this->head == null) {\n echo \"no data\";\n return;\n }\n //if data is equal to head data then is will make next data as head\n if ($this->head->data == $data) {\n $this->head = $this->head->next;\n $this->count--;\n return;\n }\n\n //temp to hold head data \n $temp = $this->head;\n $i;\n //for loop to store next node of data node\n for ($i=1; $i <= $this->count ; $i++) { \n //if temp data is equal to data then it will break tha loop\n if ($temp->data == $data) {\n //and if data is in the last index the it will not increment the temp value \n if ($i == $this->count) {\n break;\n }\n $temp = $temp->next;\n break;\n }\n $temp = $temp->next;\n }\n\n //temp2 to hold privious node\n $temp2 = $this->head;\n //for loop to store privious node in temp\n for ($j=1; $j < $i-1; $j++) { \n $temp2 = $temp2->next;\n }\n\n //if the data is in last index thin it will remove and \n //privious node of last index will change to tail\n if ($this->count == $i) {\n $temp2->next = null;\n $this->tail = $temp2;\n $this->count--;\n return;\n }\n //point privious to the next node of tha node\n $temp2->next = $temp;\n $this->count--;\n return;\n }", "public function remove(): void\n {\n $this->tree->removeNode($this);\n }", "public function clear()\n {\n $this->_value_ = new SplDoublyLinkedList();\n }", "public function remove($pos) {\n if ($pos < 0 || $pos >= sizeof($this->nodes)) return null;\n\n $candidate= $this->nodes[$pos];\n unset($this->nodes[$pos]);\n return $candidate;\n }", "public function getFirst() {\n return reset($this->Nodes);\n }", "public function removeNode(Node $node = null) {\n\t\t/**\n\t\t *\n\t\t * @var Node\n\t\t */\n\t\t$removedNode = null;\n\t\tif (is_null($node))\n\t\t\tthrow new \\Exception(\"can't remove a null node from a process definition\");\n\t\t$this->nodes->removeElement($node);\n\t\tunset($this->nodesMaps[$node->getName()]);\n\t\t\n\t\tif ($this->startState == $removedNode){\n\t\t\t$this->startState = null;\n\t\t}\n\t\t\n\t\treturn $removedNode;\n\t}", "function pop_front ()\n {\n $it =& $this->begin ();\n $this->erase ($it);\n }", "public function removeFirst($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function remove(): void\n {\n foreach ($this as $node) {\n /**\n * @var DOMNode $node\n */\n if ($node->parentNode instanceof DOMElement) {\n $node->parentNode->removeChild($node);\n }\n }\n $this->clear();\n }", "function DOMRemove(DOMNode $from) {\n\t$sibling = $from->firstChild;\n\tdo {\n\t\t$next = $sibling->nextSibling;\n\t\t$from->parentNode->insertBefore($sibling, $from);\n\t} while ($sibling = $next);\n\t$from->parentNode->removeChild($from);\n}", "function deleteItem()\n\t{\n\t\t$parent_node = $this->getNode()->parent_node();\n\t\t$cnt = count($parent_node->child_nodes());\n\t\tif ($cnt == 1)\n\t\t{\n\t\t\t// if list item is the last one -> delete whole list\n\t\t\t$grandma = $parent_node->parent_node();\n\t\t\t$grandma->unlink($grandma);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$li =& $this->getNode();\n\t\t\t$li->unlink($li);\n\t\t}\n\t}", "public static function removeAndGetNext($node)\n {\n $nextNode = self::getNextNode($node, true);\n $node->parentNode->removeChild($node);\n\n return $nextNode;\n }", "public function removeAndGetNext($node)\n {\n $nextNode = $this->getNextNode($node, true);\n $node->node->parentNode->removeChild($node->node);\n\n return $nextNode;\n }", "public function pop()\n {\n\n \n if($this->front == null)\n {\n echo \"list is empty\\n\";\n return null;\n }\n\n if($this->front == $this->last)\n {\n $temp = $this->front->data;\n $this->front = $this->last = null;\n return $temp;\n }\n\n else\n {\n $temp = $this->front;\n $current = $this->front;\n while($current->next != null)\n {\n $temp = $current;\n $current = $current->next;\n }\n\n $tdata = $current->data;\n $this->last = $temp;\n $temp->next = null;\n return $tdata;\n }\n }", "function deleteAtIndex($index) {\n\t\tif ($index < 0 || $index > $this->length) {\n\t\t\treturn NULL;\n\t\t}\n\t\t$q = $this->link;\n\t\t$p = $this->link->next;\n\t\t$i = 0;\n\t\twhile ($p && $i++ < $index) {\n\t\t\t$q = $q->next;\n\t\t\t$p = $p->next;\n\t\t}\n\t\tif (!$p) {\n\t\t\treturn -1;\n\t\t}\n\t\t$q->next = $p->next;\n\t\tunset($p);\n\t\t$this->length--;\n\t}", "public function reset() { \n\t$this->current_node = null;\n }", "function lpop(){\n\t\tif($this->_length == 0)\n\t\t\treturn \"ERROR: null\";\n\t\telse if($this->_length == 1){\n\t\t\t$tempNode = $this->_head;\n\t\t\t$this->_head = null;\n\t\t\t$this->_tail = null;\n\t\t\t\n\t\t\t$this->_length--;\n\t\t\t\n\t\t\treturn $tempNode->_data;\n\t\t}\n\t\telse{\n\t\t\t$tempNode = $this->_head;\n\t\t\t$this->_head = $tempNode->_next;\n\t\t\t$this->_head->_prev = null;\n\t\t\t$tempNode->_next = null;\n\t\t\t\n\t\t\t$this->_length--;\n\t\t\t\n\t\t\treturn $tempNode->_data;\n\t\t}\t\t\t\n\t}", "public function removeMin(){\n $size = $this->getSize();\n if($this->isEmpty())\n {\n echo 'The Heap is empty!';\n return;\n }\n \n $retVal = $this->getRoot();\n $this->setRoot($this->getElem($size));\n //echo $this->getRoot();\n //echo $this->getRoot();\n unset($this->minHeap[$size]);\n \n //heapifyDown\n $this->heapifyDown(1); //at the root\n return $retVal;\n }", "public function remove($data)\n\t{\n\t\t$currentSearchNode = $this->fetchFrontElement();\n\n\t\t$foundMatchingNode = $currentSearchNode ? $currentSearchNode->data == $data : false;\n\t\t$nodeBeforeFoundNode = false;\n\n\t\twhile (!$foundMatchingNode && $currentSearchNode->nextNode) {\n\t\t\t$foundMatchingNode = $currentSearchNode->data == $data;\n\t\t\tif (!$foundMatchingNode) {\n\t\t\t\t$nodeBeforeFoundNode = $currentSearchNode;\n\t\t\t\t$currentSearchNode = $currentSearchNode->nextNode;\n\t\t\t}\n\t\t}\n\n\t\tif (!$foundMatchingNode) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($nodeBeforeFoundNode) {\n\t\t\t$nodeBeforeFoundNode->setNextNode(\n\t\t\t\t$currentSearchNode->nextNode\n\t\t\t);\n\t\t}\n\n\t\tif ($this->tail == $currentSearchNode) {\n\t\t\t$this->tail = $nodeBeforeFoundNode;\n\t\t}\n\n\t\tunset($currentSearchNode);\n\t}", "function rpop(){\n\t\tif($this->_length == 0)\n\t\t\treturn \"ERROR: null\";\n\t\telse if($this->_length == 1){\n\t\t\t$tempNode = $this->_tail;\n\t\t\t$this->_head = null;\n\t\t\t$this->_tail = null;\n\t\t\t\n\t\t\t$this->_length--;\n\t\t\t\n\t\t\treturn $tempNode->_data;\n\t\t}\n\t\telse{\n\t\t\t$tempNode = $this->_tail;\n\t\t\t$this->_tail = $tempNode->_prev;\n\t\t\t$this->_tail->_next = null;\n\t\t\t$tempNode->_prev = null;\n\t\t\t\n\t\t\t$this->_length--;\n\t\t\t\n\t\t\treturn $tempNode->_data;\n\t\t}\n\t}", "public function pop(){\n if($this->top == null){ \n echo \"stack underflow \\n\";\n return ;\n }\n $val = $this->top->data;\n /** move top to next node */\n $this->top = $this->top->next; \n self::$size--;\n \n /**return value of removed node */\n return $val; \n }", "public function popFront()\n {\n if($this->head === null){\n throw new \\LogicException(\"List is empty\");\n }\n\n $next = $this->head->getNext();\n\n $value = $this->head->getValue();\n\n $this->head = $next;\n\n return $value;\n }", "function remove() {\n\t\tif ( false === $this->last_index ) return;\n\t\tunset( $this->block[$this->last_index] );\n\t}", "public function testRemoveSimpleNode()\n {\n $rootNode = new Node('root');\n $this->nestedSet->addRoot($rootNode);\n\n $childNode = new Node('child');\n $this->nestedSet->addNode($rootNode, $childNode);\n\n $this->assertEquals(4, $rootNode->getRight());\n\n $removedNode = $this->nestedSet->removeNode($childNode);\n\n $this->assertEquals($childNode, $removedNode);\n $this->assertEquals(2, $rootNode->getRight());\n }", "public function deleteNodeByInfo($info) {\n\n $current = $this->firstNode;\n $previous = $this->firstNode;\n\n while ($current->info != $info) {\n\n if ($current->next == null) {\n return;\n } else {\n $previous = $current;\n $current = $current->next;\n }\n }\n\n if ($current == $this->firstNode) {\n\n if ($this->counter == 1) {\n $this->lastNode = $this->firstNode;\n }\n\n $this->firstNode = $this->firstNode->next;\n } else {\n\n if ($this->lastNode == $current) {\n $this->lastNode = $previous;\n }\n\n $previous->next = $current->next;\n $previous->next->prev = $current->prev;\n }\n\n $this->counter--;\n }", "function removeFirstElement($content, $element){\n $html = str_get_html($content);\n $html->find($element, 0)->outertext = '';\n $ret = $html->save();\n return $ret;\n }", "public function removeFromTree()\n\t{\n\t\tassert(null !== $this->parentTree);\n\t\t$this->parentTree->removeChild($this);\n\t\t$this->parentTree = null;\n\t}", "public function remove( $key )\n\t{\n\t\tunset($this->nodes[$key]);\n\t}", "public function pop () {\n\t\tif ($this->h === null) {\n\t\t\treturn null;\n\t\t}\n\t\t$x = $this->h->item;\n\t\t$this->h = $this->h->next;\n\t\tif ($this->h === null) {\n\t\t\t$this->q = null;\n\t\t}\n\t\t$this->length--;\n\t\treturn $x;\n\t}", "public function removeNode($node) {\n\t\t$parent = $node->parentNode;\n\t\treturn $parent->removeChild($node);\n\t}", "private function removeNode(DOMNode $node) {\n $node->parentNode->removeChild($node);\n }", "private function removeSingle(EntityWrapper $wrapped)\n {\n $meta = $this->getClassMetadata();\n $config = $this->listener->getConfiguration($this->_em, $meta->name);\n\n $pk = $meta->getSingleIdentifierFieldName();\n $nodeId = $wrapped->getIdentifier();\n // prevent from deleting whole branch\n $qb = $this->_em->createQueryBuilder();\n $qb->update($config['useObjectClass'], 'node')\n ->set('node.'.$config['left'], 0)\n ->set('node.'.$config['right'], 0)\n ->where($nodeId === null ?\n $qb->expr()->isNull('node.'.$pk) :\n $qb->expr()->eq('node.'.$pk, is_string($nodeId) ? $qb->expr()->literal($nodeId) : $nodeId)\n )\n ;\n $qb->getQuery()->getSingleScalarResult();\n\n // remove the node from database\n $qb = $this->_em->createQueryBuilder();\n $qb->delete($config['useObjectClass'], 'node')\n ->where($nodeId === null ?\n $qb->expr()->isNull('node.'.$pk) :\n $qb->expr()->eq('node.'.$pk, is_string($nodeId) ? $qb->expr()->literal($nodeId) : $nodeId)\n )\n ;\n $qb->getQuery()->getSingleScalarResult();\n\n // remove from identity map\n $this->_em->getUnitOfWork()->removeFromIdentityMap($wrapped->getObject());\n }", "function pop()\n {\n if ($this->list->isEmpty()) {\n echo \"empty\";\n return;\n }\n return $this->list->pop();\n }", "public function remove()\n {\n if ($this->count() === 0) {\n throw new NoSuchElementException('Can\\'t return element from Queue. Queue is empty.');\n }\n $head = $this[$this->index];\n\n unset($this[$this->index]);\n $this->index++;\n\n return $head;\n }", "public function removeOne()\n {\n // $rem_stmt = $this->connect()->prepare($sql);\n // return $rem_stmt;\n return null;\n }", "public function pop()\n {\n if ($this->isEmpty()) {\n return;\n }\n\n $data = $this->head->data;\n $this->head = $this->head->next;\n $this->size--;\n\n return $data;\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function remove($index){\r\n if ($index < 0 || $index > $this->count)\r\n return null;\r\n\r\n $tmp = $this->array[$index];\r\n $this->array[$index] = null;\r\n $this->count--;\r\n return $tmp;\r\n }", "function getLast(){\n if ($this->head->next == NULL) {\n return $this->head;\n } else {\n $curr = $this->head;\n while ($curr->next != NULL) {\n $curr = $curr->next;\n if ($curr->next == NULL) {\n return $curr;\n }\n }\n }\n }", "public function delete() { \n\t\t$this->checkDisposed();\n\t\t\t\n\t\t// Delete nodes\n\t\t$result = DataBase::query(\n\t\t\t\"SELECT node.id \".\n\t\t\t\"FROM \".DataBase::formTableName('Premanger', 'Nodes').\" AS node \".\n\t\t\t\"WHERE node.treeID = '$this->_id'\");\n\t\t// Change node type to SIMPLE because otherwise we could not delete \n\t\t// them\n\t\tDataBase::query(\n\t\t\t\"UPDATE \".DataBase::formTableName('Premanger', 'Nodes').\" \".\n\t\t\t\"SET id = 0 \".\n\t\t\t\"WHERE treeID = '$this->_id'\");\n\t\twhile ($result->next()) {\n\t\t\t$node = StructureNode::getFromID($result->get('nodeID'));\n\t\t\t$node->delete();\n\t\t}\n\t\t\t\n\t\tDataBase::query(\n\t\t\t\"DELETE FROM \".DataBase::formTableName('Premanger', 'Trees').\" \".\n\t\t\t\"WHERE tree.id = '$this->_id'\");\n\t\t\t\n\t\tif (self::$_count !== null)\n\t\t\tself::$_count--;\t\n\t\n\t\t$this->_id = null;\n\t}", "public function popBack()\n {\n if($this->head === null){\n throw new \\LogicException(\"List is empty\");\n }\n\n $prev = null;\n $node = $this->head;\n\n while($next = $node->getNext()){\n $prev = $node;\n $node = $next;\n }\n\n $value = $node->getValue();\n\n if($prev === null){\n $this->head = null;\n }else {\n $prev->clearNext();\n }\n\n return $value;\n }", "function clear_head(){\n\t\t\n\t\t$this->data['head'] = '';\n\t\t\n\t}", "public function clear(){\n $this->nodes = null;\n $this->numNodes = 0; \n }", "private function fastRemove($index) {\n\t\t$index = (int) $index;\n\t\t$numMoved = $this->size - $index - 1;\n\t\tif ($numMoved > 0) {\n\t\t\tSystem::arraycopy( $this->elementData, $index + 1, $this->elementData, $index, $numMoved );\n\t\t}\n\t\t$this->elementData[--$this->size] = null;\n\t}", "public function remove ()\n {\n if (isset($this->parent))\n $this->parent->removeChild ($this);\n }", "public static function removeNode($node)\n {\n $parent = $node->parentNode;\n if ($parent) {\n $parent->removeChild($node);\n }\n }", "public function unsetCurrent() {\n\t\tunset($this->data[key($this->data)]);\n\t\t// see description for next() on why this property is set\n\t\t$this->nextAsCurrent = true;\n\t}", "public function remove( $node ){\n $status = new StatusTYPE();\n if ( $node ){\n $found = false; \n for ( $i = 0; ($i < $this->numNodes) && !$found; $i++ ){\n if ( $node->getID() == $this->nodes[$i]->getID() ){\n $this->numNodes--;\n unset( $this->nodes[$i] );\n $found = true; \n }\n }\n }\n else\n $status->setFalse( 'invalid field passed' ); \n return $status; \n }", "public function getNextNode(): TreenodeAbstractInterface|null\n {\n if (!$this->getStartNode()) {\n throw new StartNodeUnsetException();\n }\n $nextNode = $this->getNextNodeProtected();\n while ($nextNode && !$this->filter->testNode($nextNode)) {\n $nextNode = $this->getNextNodeProtected();\n }\n return $nextNode;\n }", "function reverseList($head) {\n if (empty($head)) {\n return $head;\n }\n $prev = NULL;\n $next = NULL;\n $curr = $head;\n while (!empty($curr)) {\n $next = $curr->next;\n $curr->next = $prev;\n $prev = $curr;\n $curr = $next;\n }\n return $prev;\n}", "public function pop() {\n\t\treturn array_pop( $this->liste );\n\t}", "function removeFromTerminal($source)\n\t{\n\t \t$terminal = $this->getTerminal($source);\n\t \t\n\t \tif (isset($terminal))\n\t \t{\n\t \t\t$terminal->removeEdge($this, $source);\n\t \t}\n\t}", "public function remove_linked_children()\n\t{\n\t\tunset($this->data[ 'linked_children' ]);\n\t\t$this->modified();\n\t}", "public function removeFirst(&$assign = null) {\n\t\t$array = $this->val();\n\n\t\tif(count(func_get_args()) > 0) {\n\t\t\t$assign = $this->first()->val();\n\t\t}\n\t\tarray_shift($array);\n\n\t\t$this->val($array);\n\n\t\treturn $this;\n\t}", "public function pop()\n {\n reset($this->list);\n $key = key($this->list);\n $mo = $this->list[$key];\n unset($this->list[$key]);\n return $mo;\n }", "public function remove($o = null)\n {\n return $this->removeElement($o);\n }", "function remove($index)\n\t{\n\t\tif ($this->children != null && $index >= 0)\n\t\t{\n\t\t\t$child = $this->getChildAt($index);\n\t\t\t\n\t\t\tif ($child != null)\n\t\t\t{\n\t\t\t\tarray_splice($this->children, $index, 1);\n\t\t\t\t$child->setParent(null);\n\t\t\t}\n\t\t\t\n\t\t\treturn $child;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "static function removeFirst($array = []){ array_shift($array); return $array; }", "public function deleteNode()\n {\n return $this->delete();\n }", "public function remove(string $selector=null)\n {\n $result = $this;\n if ($selector) {\n $result = $result->filter($selector);\n }\n foreach ($result->nodes as $node) {\n if ($node->parentNode) {\n $node->parentNode->removeChild($node);\n }\n }\n\n $result->nodes = array();\n $result->length = 0;\n\n return $result;\n }", "public function remove($object) {\n\t\tif ($this->addedNodes->contains($object)) {\n\t\t\t$this->addedNodes->detach($object);\n\t\t}\n\t\t$this->removedNodes->attach($object);\n\t\tparent::remove($object);\n\t}", "private function p_delete_min($h) {\n\t\tif ($h->get_left() == null){\n\t\t\treturn null;\n\t\t}\n\t\n\t\tif (!$this->is_red($h->get_left()) && !$this->is_red($h->get_left()->get_left())){\n\t\t\t$h = $this->move_red_left($h);\n\t\t}\n\t\t\t\n\t\t$h->set_left($this->delete_min($h->get_left()));\n\t\treturn $this->balance($h);\n\t}", "public function remove() {}", "public function remove() {}", "function removeNode($xml, $path, $multi = 'one') {\r\n $result = $xml->xpath($path);\r\n\r\n if (!isset($result[0]))\r\n return false;\r\n\r\n switch ($multi) {\r\n case 'all':\r\n $errlevel = error_reporting(E_ALL & ~E_WARNING);\r\n foreach ($result as $r) {\r\n unset($r[0]);\r\n }\r\n error_reporting($errlevel);\r\n return true;\r\n case 'child':\r\n unset($result[0][0]);\r\n return true;\r\n\r\n case 'one':\r\n if (count($result[0]->children()) == 0 && count($result) == 1) {\r\n unset($result[0][0]);\r\n return true;\r\n }\r\n default:\r\n return false;\r\n }\r\n }", "public function firstChild(): ?Node\n {\n return $this->traverseChildren('first');\n }", "protected function nodeFirst($tree)\n {\n // empty tree\n if (is_null($tree) or is_null($tree->root)) {\n $this->setStatus(102);\n return null;\n }\n $p = $tree->root;\n while ($p->link[0] != null) {\n $p = $p->link[0];\n }\n return $p;\n }", "public static function clear() : void\n {\n static::$current = null;\n }", "public function deleteNodeImmediately($path)\n {\n $this->deleteNode($path);\n }", "public function remove()\n\t{\n\t\t$this->offsetUnset($this->position);\n\t}", "public function remove()\n {\n if ($this->id) {\n static::delete($this->id);\n }\n }", "public function testRemoveOne()\n {\n $osm = new Services_OpenStreetMap();\n $createWith = [\n 'name' => 'cafe',\n 'amenity' => 'cafe',\n 'name:en' => 'cafe',\n 'name:uk' => 'cafe'\n ];\n $node = $osm->createNode(0, 0, $createWith);\n $tags = $node->getTags();\n $this->assertEquals($tags, $createWith);\n $node->removeTag(\"name:uk\");\n $tagRemoved = $node->getTags();\n $this->assertEquals(\n $tagRemoved,\n [\n 'name' => 'cafe',\n 'amenity' => 'cafe',\n 'name:en' => 'cafe',\n ]\n );\n }", "private function removeFirstParameter() {\n array_shift($this->urlParameters);\n }", "public function removeChild(Node $node);", "public function pop() {\n return $this->getListaSimplesmenteEncadeada()->removeFirst();\n }", "public function remove ($v) {\n\t\t$prev = null;\n\t\t$l = $this->h;\n\t\twhile ($l !== null) {\n\t\t\tif (Boot::equal($l->item, $v)) {\n\t\t\t\tif ($prev === null) {\n\t\t\t\t\t$this->h = $l->next;\n\t\t\t\t} else {\n\t\t\t\t\t$prev->next = $l->next;\n\t\t\t\t}\n\t\t\t\tif ($this->q === $l) {\n\t\t\t\t\t$this->q = $prev;\n\t\t\t\t}\n\t\t\t\t$this->length--;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$prev = $l;\n\t\t\t$l = $l->next;\n\t\t}\n\t\treturn false;\n\t}", "abstract public function remove( Element $elt );" ]
[ "0.8015358", "0.70046115", "0.6955474", "0.6789327", "0.64152384", "0.6375034", "0.6307879", "0.62946516", "0.62896097", "0.6131225", "0.6104197", "0.60772586", "0.60600936", "0.59440017", "0.59322506", "0.5898116", "0.58897185", "0.58702624", "0.5864846", "0.58344406", "0.5829843", "0.57928944", "0.5789259", "0.575091", "0.5747936", "0.56789523", "0.567504", "0.5651923", "0.56377304", "0.56198245", "0.5613478", "0.5580949", "0.5558074", "0.55278957", "0.55130684", "0.54401666", "0.5425747", "0.5418314", "0.5399877", "0.53989255", "0.5380976", "0.5364426", "0.5317119", "0.5301255", "0.5292035", "0.5275215", "0.52549446", "0.52438134", "0.5191272", "0.5186365", "0.5177222", "0.5156737", "0.5145256", "0.5125527", "0.51096755", "0.51096755", "0.51096755", "0.51096755", "0.51096755", "0.51096755", "0.51010054", "0.50989497", "0.5096505", "0.5082466", "0.50771886", "0.50655735", "0.50641733", "0.50627667", "0.50553304", "0.5051665", "0.50339925", "0.50234395", "0.50165945", "0.50075626", "0.5001448", "0.49939594", "0.49851286", "0.49765593", "0.49736655", "0.49699193", "0.49592313", "0.4955098", "0.49404562", "0.4924347", "0.49124718", "0.49080002", "0.49080002", "0.49022388", "0.49019042", "0.4898414", "0.48917213", "0.48901737", "0.48861283", "0.48826218", "0.4881133", "0.48708305", "0.48644868", "0.48517823", "0.48420683", "0.48321" ]
0.8314597
0
Remove last node of linked list.
Удалить последний узел из связанного списка.
public function removeLast(): void { if ($this->isEmpty()) { throw new RuntimeException('It is not possible remove last node from empty linked list.'); } // Destroy last node $this->lastNode = null; if ($this->isEmpty()) { $this->firstNode = null; } else { $node = $this->firstNode; while ($node !== null) { if ($node->next->next === null) { $node->next = null; $this->lastNode = $node; } $node = $node->next; } } $this->count--; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteLastNode() {\n\n if ($this->firstNode->next == null) {\n\n $this->firstNode = null;\n $this->counter--;\n } else {\n\n $previous = $this->firstNode;\n $current = $this->firstNode->next;\n\n while ($current->next != null) {\n $previous = $current;\n $current = $current->next;\n }\n\n $previous->next = null;\n $this->lastNode = $previous;\n $this->counter--;\n }\n }", "public function removeRear()\n {\n $temp = $this->tail;\n if ($this->head == $this->tail) {\n $this->head = null;\n } else {\n $this->tail->prev->next = null;\n }\n $val = $this->tail->data;\n $this->tail = $this->tail->prev;\n $temp->prev = null;\n return $val;\n }", "function popNode(){\n $pop = $this->head;\n $this->head = $this->head->next;\n $this->head->prev = NULL;\n return $pop;\n\n }", "function getLast(){\n if ($this->head->next == NULL) {\n return $this->head;\n } else {\n $curr = $this->head;\n while ($curr->next != NULL) {\n $curr = $curr->next;\n if ($curr->next == NULL) {\n return $curr;\n }\n }\n }\n }", "public function removeFirst(): void\n {\n if ($this->isEmpty()) {\n throw new RuntimeException('It is not possible remove first node from empty linked list.');\n }\n\n // Save to local variable and destroy first node\n $firstNode = $this->firstNode;\n $this->firstNode = null;\n\n if ($this->isEmpty()) {\n $this->lastNode = null;\n } else {\n $this->firstNode = $firstNode->next;\n }\n\n $this->count--;\n }", "function lpop(){\n\t\tif($this->_length == 0)\n\t\t\treturn \"ERROR: null\";\n\t\telse if($this->_length == 1){\n\t\t\t$tempNode = $this->_head;\n\t\t\t$this->_head = null;\n\t\t\t$this->_tail = null;\n\t\t\t\n\t\t\t$this->_length--;\n\t\t\t\n\t\t\treturn $tempNode->_data;\n\t\t}\n\t\telse{\n\t\t\t$tempNode = $this->_head;\n\t\t\t$this->_head = $tempNode->_next;\n\t\t\t$this->_head->_prev = null;\n\t\t\t$tempNode->_next = null;\n\t\t\t\n\t\t\t$this->_length--;\n\t\t\t\n\t\t\treturn $tempNode->_data;\n\t\t}\t\t\t\n\t}", "public function last() {\n $s= sizeof($this->nodes);\n return $s ? $this->nodes[$s - 1] : null;\n }", "function rpop(){\n\t\tif($this->_length == 0)\n\t\t\treturn \"ERROR: null\";\n\t\telse if($this->_length == 1){\n\t\t\t$tempNode = $this->_tail;\n\t\t\t$this->_head = null;\n\t\t\t$this->_tail = null;\n\t\t\t\n\t\t\t$this->_length--;\n\t\t\t\n\t\t\treturn $tempNode->_data;\n\t\t}\n\t\telse{\n\t\t\t$tempNode = $this->_tail;\n\t\t\t$this->_tail = $tempNode->_prev;\n\t\t\t$this->_tail->_next = null;\n\t\t\t$tempNode->_prev = null;\n\t\t\t\n\t\t\t$this->_length--;\n\t\t\t\n\t\t\treturn $tempNode->_data;\n\t\t}\n\t}", "function remove() {\n\t\tif ( false === $this->last_index ) return;\n\t\tunset( $this->block[$this->last_index] );\n\t}", "public function removeLast() {\n\t\t$array = $this->val();\n\t\tarray_pop($array);\n\n\t\t$this->val($array);\n\n\t\treturn $this;\n\t}", "public function popBack()\n {\n if($this->head === null){\n throw new \\LogicException(\"List is empty\");\n }\n\n $prev = null;\n $node = $this->head;\n\n while($next = $node->getNext()){\n $prev = $node;\n $node = $next;\n }\n\n $value = $node->getValue();\n\n if($prev === null){\n $this->head = null;\n }else {\n $prev->clearNext();\n }\n\n return $value;\n }", "public function remove()\n\t{\n\t\tparent::remove() ;\n\t\t$this->node->remove() ;\n\t}", "public function getLast() {\n return end($this->Nodes);\n }", "public function remove($data)\n {\n $current = null;\n $temp = null;\n\n if($this->size==0)\n {\n echo \"list is empty\\n\";\n }\n else if($this->front->data == $data && $this->front->next == null)\n {\n $this->front =null;\n $this->last = null;\n echo \"$data removed from list\\n\";\n $this->size--;\n }\n else if($this->front->data == $data && $this->front->next != null)\n {\n $temp = $this->front;\n $this->front = $this->front->next;\n $temp = null;\n echo \"$data removed from list\\n\";\n $this->size--;\n }\n else\n {\n $temp = $this->front;\n $current = $this->front->next;\n while($current!=null)\n {\n if($current->data == $data)\n {\n $temp->next = $current->next;\n $current->next = null;\n echo \"$data removed from list\\n\";\n $this->size--;\n break;\n }\n else\n {\n $temp = $current;\n $current = $current->next;\n }\n }\n }\n }", "public function deleteFirstNode() {\n\n $this->firstNode = $this->firstNode->next;\n $this->counter--;\n }", "public function removeFront()\n {\n $temp = $this->head;\n if ($this->head == $this->tail) {\n $this->tail = null;\n }\n if ($this->isEmpty()) {\n echo \"underflow\\n\";\n } else {\n $this->head->next->prev = null;\n }\n $this->head = $this->head->next;\n $this->temp->next = null;\n }", "public function pop()\n {\n\n \n if($this->front == null)\n {\n echo \"list is empty\\n\";\n return null;\n }\n\n if($this->front == $this->last)\n {\n $temp = $this->front->data;\n $this->front = $this->last = null;\n return $temp;\n }\n\n else\n {\n $temp = $this->front;\n $current = $this->front;\n while($current->next != null)\n {\n $temp = $current;\n $current = $current->next;\n }\n\n $tdata = $current->data;\n $this->last = $temp;\n $temp->next = null;\n return $tdata;\n }\n }", "public function remove($data)\n {\n //check the linked list have data of not \n if ($this->head == null) {\n echo \"no data\";\n return;\n }\n //if data is equal to head data then is will make next data as head\n if ($this->head->data == $data) {\n $this->head = $this->head->next;\n $this->count--;\n return;\n }\n\n //temp to hold head data \n $temp = $this->head;\n $i;\n //for loop to store next node of data node\n for ($i=1; $i <= $this->count ; $i++) { \n //if temp data is equal to data then it will break tha loop\n if ($temp->data == $data) {\n //and if data is in the last index the it will not increment the temp value \n if ($i == $this->count) {\n break;\n }\n $temp = $temp->next;\n break;\n }\n $temp = $temp->next;\n }\n\n //temp2 to hold privious node\n $temp2 = $this->head;\n //for loop to store privious node in temp\n for ($j=1; $j < $i-1; $j++) { \n $temp2 = $temp2->next;\n }\n\n //if the data is in last index thin it will remove and \n //privious node of last index will change to tail\n if ($this->count == $i) {\n $temp2->next = null;\n $this->tail = $temp2;\n $this->count--;\n return;\n }\n //point privious to the next node of tha node\n $temp2->next = $temp;\n $this->count--;\n return;\n }", "public function pop(){\n if($this->top == null){ \n echo \"stack underflow \\n\";\n return ;\n }\n $val = $this->top->data;\n /** move top to next node */\n $this->top = $this->top->next; \n self::$size--;\n \n /**return value of removed node */\n return $val; \n }", "public function removeCurrentItem()\n {\n $this->list->offsetUnset($this->list->key());\n $this->list->next();\n }", "public function pop () {\n\t\tif ($this->h === null) {\n\t\t\treturn null;\n\t\t}\n\t\t$x = $this->h->item;\n\t\t$this->h = $this->h->next;\n\t\tif ($this->h === null) {\n\t\t\t$this->q = null;\n\t\t}\n\t\t$this->length--;\n\t\treturn $x;\n\t}", "function pop_back ()\n {\n $it =& $this->end ();\n $it->advance (-1);\n $this->erase ($it);\n }", "public static function removeAndGetNext($node)\n {\n $nextNode = self::getNextNode($node, true);\n $node->parentNode->removeChild($node);\n\n return $nextNode;\n }", "public function removeAndGetNext($node)\n {\n $nextNode = $this->getNextNode($node, true);\n $node->node->parentNode->removeChild($node->node);\n\n return $nextNode;\n }", "function deleteItem()\n\t{\n\t\t$parent_node = $this->getNode()->parent_node();\n\t\t$cnt = count($parent_node->child_nodes());\n\t\tif ($cnt == 1)\n\t\t{\n\t\t\t// if list item is the last one -> delete whole list\n\t\t\t$grandma = $parent_node->parent_node();\n\t\t\t$grandma->unlink($grandma);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$li =& $this->getNode();\n\t\t\t$li->unlink($li);\n\t\t}\n\t}", "public function remove()\n {\n if ($this->node->parentNode) {\n $this->node->parentNode->removeChild($this->node);\n }\n }", "public function removeLast($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function removeLastPostFromBlog() {}", "public function pop()\n {\n if ($this->isEmpty()) {\n return;\n }\n\n $data = $this->head->data;\n $this->head = $this->head->next;\n $this->size--;\n\n return $data;\n }", "public function remove(Node $node);", "function removeLastElement($content, $element){\n $html = str_get_html($content);\n // link content\n $html->find($element, -1)->outertext = '';\n $ret = $html->save();\n return $ret;\n }", "public function remove(): void\n {\n $this->tree->removeNode($this);\n }", "protected function nodeLast($tree)\n {\n // empty tree\n if (is_null($tree) or is_null($tree->root)) {\n $this->setStatus(102);\n return null;\n }\n $p = $tree->root;\n while ($p->link[1] != null) {\n $p = $p->link[1];\n }\n return $p;\n }", "public function last() {\n\t\tif ($this->documentElement->hasChildNodes()) {\n\t\t\t$this->_node = $this->documentElement->lastChild;\n\t\t\treturn $this->_node;\n\t\t} else {\n\t\t\t$this->_node = null;\n\t\t\treturn false;\n\t\t}\n\t}", "function pop()\n {\n if ($this->list->isEmpty()) {\n echo \"empty\";\n return;\n }\n return $this->list->pop();\n }", "public function lastChild(): ?Node\n {\n return $this->traverseChildren('last');\n }", "function deleteNode($key) {\n $node = $this->head;\n // check head\n if ($node != NULL){\n if ($node->data == $key) {\n $this->head = $node->next;\n $node = NULL;\n return;\n }\n }\n // check rest of list\n while ($node != NULL) {\n if ($node->data == $key) {\n break;\n }\n $prev = $node;\n $node = $node->next;\n }\n if ($node == NULL) {\n return;\n }\n $prev->next = $node->next;\n if ($prev->next->prev != NULL) {\n $prev->next->prev = $prev;\n }\n $node = NULL;\n }", "public function remove($data)\n\t{\n\t\t$currentSearchNode = $this->fetchFrontElement();\n\n\t\t$foundMatchingNode = $currentSearchNode ? $currentSearchNode->data == $data : false;\n\t\t$nodeBeforeFoundNode = false;\n\n\t\twhile (!$foundMatchingNode && $currentSearchNode->nextNode) {\n\t\t\t$foundMatchingNode = $currentSearchNode->data == $data;\n\t\t\tif (!$foundMatchingNode) {\n\t\t\t\t$nodeBeforeFoundNode = $currentSearchNode;\n\t\t\t\t$currentSearchNode = $currentSearchNode->nextNode;\n\t\t\t}\n\t\t}\n\n\t\tif (!$foundMatchingNode) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($nodeBeforeFoundNode) {\n\t\t\t$nodeBeforeFoundNode->setNextNode(\n\t\t\t\t$currentSearchNode->nextNode\n\t\t\t);\n\t\t}\n\n\t\tif ($this->tail == $currentSearchNode) {\n\t\t\t$this->tail = $nodeBeforeFoundNode;\n\t\t}\n\n\t\tunset($currentSearchNode);\n\t}", "public function deleteNodeByIndex($index) {\n\n $current = $this->firstNode;\n $previous = $this->firstNode;\n $start = 0;\n\n while ($start != $index) {\n\n if ($current->next == null) {\n return;\n } else {\n $previous = $current;\n $current = $current->next;\n $start++;\n }\n }\n\n if ($current == $this->firstNode) {\n\n if ($this->counter == 1) {\n $this->lastNode = $this->firstNode;\n }\n\n $this->firstNode = $this->firstNode->next;\n } else {\n\n if ($this->lastNode == $current) {\n $this->lastNode = $previous;\n }\n\n $previous->next = $current->next;\n $previous->next->prev = $current->prev;\n }\n\n $this->counter--;\n }", "public function remove($index)\n {\n $prev = null;\n $node = $this->head;\n\n if($index < 0){\n throw new \\LogicException(\"Index out of range: $index\");\n }\n\n for($i = 0; $i < $index && $node !== null; $i++){\n $prev = $node;\n $node = $node->getNext();\n }\n\n if($node === null){\n throw new \\LogicException(\"Index out of range: $index\");\n }\n\n $next = $node->getNext();\n\n if($prev === null){\n $this->head = $next;\n }else {\n $next ? $prev->setNext($next) : $prev->clearNext();\n }\n }", "function pop()\r\n {\r\n if ( $this->isEmpty() )\r\n {\r\n return null;\r\n }\r\n\r\n return $this->remove($this->size() - 1);\r\n }", "public function remove() {\n\t\tif(is_null($this->_))\n\t\t\treturn;\n\t\t$index = array_search($this, $this->_->children);\n\t\tif($index !== false)\n\t\t\tarray_splice($this->_->children, $index, 1);\n\t}", "public function remove_linked_children()\n\t{\n\t\tunset($this->data[ 'linked_children' ]);\n\t\t$this->modified();\n\t}", "public function pop() {\n\t\treturn array_pop( $this->liste );\n\t}", "public function remove(): void\n {\n foreach ($this as $node) {\n /**\n * @var DOMNode $node\n */\n if ($node->parentNode instanceof DOMElement) {\n $node->parentNode->removeChild($node);\n }\n }\n $this->clear();\n }", "function whatsLast() {\n if (count($this->list) != 0) {\n return $this->list[count($this->list) - 1];\n }else{\n return null;\n }\n }", "public function last()\n {\n $this->pointer = count($this->data) - 1;\n }", "public function clear()\n {\n $this->_value_ = new SplDoublyLinkedList();\n }", "public function pop()\n {\n return $this->count() ? $this->last() : null;\n }", "function deleteLast() {\n if ($this -> isEmpty()) {\n return false;\n }\n array_pop($this -> _array);\n $this -> _size --;\n return true;\n }", "public function tailqueue()\n {\n return array_pop($this->links);\n }", "public function back()\n {\n if($this->head === null){\n throw new \\LogicException(\"List is empty\");\n }\n\n $node = $this->head;\n\n while($next = $node->getNext()){\n $node = $next;\n }\n\n return $node->getValue();\n }", "public function getLastLink()\n {\n return end($this->links);\n }", "public function last(string $path = null) {\n if (null !== $path) {\n $this->setPath($path);\n }\n $this->Nodes = [end($this->Nodes)];\n\n return $this;\n }", "public function removeAt(int $index): void\n {\n $count = $this->count;\n\n if ($index > $count - 1) {\n throw new RuntimeException(sprintf(\n 'Node with index \"%s\" cannot be removed from linked list which has \"%s\" nodes.',\n $index,\n $count\n ));\n }\n\n if ($index === 0) {\n // First node\n $this->removeFirst();\n } elseif ($index === $count - 1) {\n // Last node\n $this->removeLast();\n } else {\n // Node between first and last node\n\n $node = $this->firstNode;\n $i = 0;\n\n while ($node->next !== null) {\n // If next node should be remove node index\n if ($i + 1 === $index) {\n // Move node next step ahead\n $node->next = $node->next->next;\n // Decrement node counter and exit function\n $this->count--;\n return;\n }\n\n $node = $node->next;\n $i++;\n }\n }\n }", "public function addLast(string $data): void\n {\n // New node\n $newNode = new Node($data);\n\n // If linked list is empty\n if ($this->isEmpty()) {\n // Set first node\n $this->firstNode = $newNode;\n } else {\n // Set link from old last node to new last node\n $this->lastNode->next = $newNode;\n }\n\n // Set new last node\n $this->lastNode = $newNode;\n $this->count++;\n }", "public function getLastChild();", "public function removeNode(Node $node = null) {\n\t\t/**\n\t\t *\n\t\t * @var Node\n\t\t */\n\t\t$removedNode = null;\n\t\tif (is_null($node))\n\t\t\tthrow new \\Exception(\"can't remove a null node from a process definition\");\n\t\t$this->nodes->removeElement($node);\n\t\tunset($this->nodesMaps[$node->getName()]);\n\t\t\n\t\tif ($this->startState == $removedNode){\n\t\t\t$this->startState = null;\n\t\t}\n\t\t\n\t\treturn $removedNode;\n\t}", "function remove() {\r\n\t\tif ( $this->last_key_line === -1 ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tunset( $this->block[$this->last_key_line] );\r\n\t}", "public function end(): void\n {\n $this->current = $this->tail->prev();\n $this->offset = $this->count - 1;\n }", "function pop()\n {\n while ($this->l1->count() > 1) {\n $this->l2->push($this->l1->shift());\n }\n list($this->l1, $this->l2) = [$this->l2, $this->l1];\n return $this->l2->shift();\n }", "public function last()\n\t{\n\t\tif($this->current + $this->links < $this->total)\n\t\t{\n\t\t\treturn HTML::tag('li', HTML::link($this->url($this->total), _('Last &gt;')), array('class' => 'last'));\n\t\t}\n\t}", "public function removeLastTagFromPost() {}", "public function last()\n {\n return $this->elements->last();\n }", "public function remove ($v) {\n\t\t$prev = null;\n\t\t$l = $this->h;\n\t\twhile ($l !== null) {\n\t\t\tif (Boot::equal($l->item, $v)) {\n\t\t\t\tif ($prev === null) {\n\t\t\t\t\t$this->h = $l->next;\n\t\t\t\t} else {\n\t\t\t\t\t$prev->next = $l->next;\n\t\t\t\t}\n\t\t\t\tif ($this->q === $l) {\n\t\t\t\t\t$this->q = $prev;\n\t\t\t\t}\n\t\t\t\t$this->length--;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$prev = $l;\n\t\t\t$l = $l->next;\n\t\t}\n\t\treturn false;\n\t}", "public function last()\n {\n return end($this->element);\n }", "public function getLastChild() {\n\t return $this->children[count($this->children) - 1];\n\t}", "function deleteAtIndex($index) {\n\t\tif ($index < 0 || $index > $this->length) {\n\t\t\treturn NULL;\n\t\t}\n\t\t$q = $this->link;\n\t\t$p = $this->link->next;\n\t\t$i = 0;\n\t\twhile ($p && $i++ < $index) {\n\t\t\t$q = $q->next;\n\t\t\t$p = $p->next;\n\t\t}\n\t\tif (!$p) {\n\t\t\treturn -1;\n\t\t}\n\t\t$q->next = $p->next;\n\t\tunset($p);\n\t\t$this->length--;\n\t}", "public function getEndNode()\n\t{\n\t\treturn $this->end;\n\t}", "protected function popNode()\n {\n $stack_count = count($this->_stack);\n unset($this->_stack[$stack_count-1]);\n return true;\n }", "public function pop()\n {\n reset($this->list);\n $key = key($this->list);\n $mo = $this->list[$key];\n unset($this->list[$key]);\n return $mo;\n }", "public function last(){\n if(empty($this->items))\n throw new ListException(\"Item empty\");\n\n return end($this->items);\n }", "public static function getLastElement(array $list)\n {\n return \\end($list);\n }", "public function clear()\n {\n $this->head = null;\n }", "public function remove ()\n {\n if (isset($this->parent))\n $this->parent->removeChild ($this);\n }", "static function removeLast($array = []){ array_pop($array); return $array; }", "public function removeNode($node) {\n\t\t$parent = $node->parentNode;\n\t\treturn $parent->removeChild($node);\n\t}", "public function getLastElement() {\r\n\t\t$tmp = $this->toArray();\r\n\t\tend($tmp);\r\n\t\treturn current($tmp);\r\n\t}", "public function pop(): void\n {\n array_pop($this->elements);\n }", "private function removeNode(DOMNode $node) {\n $node->parentNode->removeChild($node);\n }", "public function pop()\n {\n return array_pop($this->breadcrumb);\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function deleteNodeByInfo($info) {\n\n $current = $this->firstNode;\n $previous = $this->firstNode;\n\n while ($current->info != $info) {\n\n if ($current->next == null) {\n return;\n } else {\n $previous = $current;\n $current = $current->next;\n }\n }\n\n if ($current == $this->firstNode) {\n\n if ($this->counter == 1) {\n $this->lastNode = $this->firstNode;\n }\n\n $this->firstNode = $this->firstNode->next;\n } else {\n\n if ($this->lastNode == $current) {\n $this->lastNode = $previous;\n }\n\n $previous->next = $current->next;\n $previous->next->prev = $current->prev;\n }\n\n $this->counter--;\n }", "function reverseList($head) {\n if (empty($head)) {\n return $head;\n }\n $prev = NULL;\n $next = NULL;\n $curr = $head;\n while (!empty($curr)) {\n $next = $curr->next;\n $curr->next = $prev;\n $prev = $curr;\n $curr = $next;\n }\n return $prev;\n}", "public function delLastID(){\n\n $bdd = self::getInstance();\n $stat = $bdd->prepare(\"SELECT MAX(id) FROM user\");\n $state = $stat->execute();\n if ($state) {\n $result = $stat->fetch(); ;\n $sql = \"DELETE FROM user WHERE id = \".$result['MAX(id)'];\n if ($bdd->exec($sql) !== false){\n echo \"ligne avec id \".$result['MAX(id)'].\" est supprimé\";\n }\n }\n }", "public function pop()\n {\n $this->has_next = false;\n\n return $this->graph;\n }", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();" ]
[ "0.79999554", "0.67121893", "0.6643529", "0.66140413", "0.64299834", "0.6182703", "0.61790115", "0.6082961", "0.6020417", "0.6008881", "0.59825", "0.58637255", "0.58602995", "0.5842045", "0.5787531", "0.5759474", "0.5752997", "0.57197356", "0.5696285", "0.5684415", "0.56826586", "0.5677489", "0.5656286", "0.564276", "0.5605356", "0.56002915", "0.5594292", "0.55493885", "0.55337936", "0.55152357", "0.5508262", "0.5487399", "0.5476151", "0.5468972", "0.54587466", "0.5436226", "0.5434435", "0.5433635", "0.543289", "0.5423894", "0.5419475", "0.54129726", "0.5403428", "0.537237", "0.53335136", "0.5326114", "0.5321", "0.52854544", "0.5263721", "0.52328414", "0.522527", "0.5210906", "0.52104", "0.51913685", "0.5189568", "0.51761895", "0.5158905", "0.5153822", "0.5152861", "0.5151806", "0.51311755", "0.5119407", "0.5119356", "0.5112558", "0.5100407", "0.5078812", "0.50753355", "0.5063728", "0.50613135", "0.5048174", "0.5033497", "0.5027745", "0.50269896", "0.50080115", "0.49999577", "0.49927035", "0.49831384", "0.4980746", "0.4974653", "0.4971833", "0.49702278", "0.4969021", "0.4969021", "0.4969021", "0.4969021", "0.4969021", "0.4969021", "0.496525", "0.49638447", "0.4962597", "0.49540997", "0.49335265", "0.49335265", "0.49335265", "0.49335265", "0.49335265", "0.49335265", "0.49335265", "0.49335265", "0.49335265" ]
0.8197436
0
Transforms a namespace to an array
Преобразует пространство имен в массив
public function toArray($namespace = null) { // If namespace is not set, get the default namespace if ($namespace == null) { $namespace = $this->_defaultNameSpace; } // Get the namespace $ns = $this->_registry[$namespace]['data']; $array = array(); foreach (get_object_vars( $ns ) as $k => $v) { $array[$k] = $v; } return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toArray($namespace = null)\r\n\t{\r\n\t\t// If namespace is not set, get the default namespace\r\n\t\tif ($namespace == null) {\r\n\t\t\t$namespace = $this->_defaultNameSpace;\r\n\t\t}\r\n\r\n\t\t// Get the namespace\r\n\t\t$ns = & $this->_registry[$namespace]['data'];\r\n\r\n\t\t$array = array();\r\n\t\tforeach (get_object_vars( $ns ) as $k => $v) {\r\n\t\t\t$array[$k] = $v;\r\n\t\t}\r\n\r\n\t\treturn $array;\r\n\t}", "function GetXmlNsArray() {\n\n $ns = array();\n foreach( $this->namespaces AS $n => $p ) {\n if ( $p == \"\" ) $ns[\"xmlns\"] = $n; else $ns[\"xmlns:$p\"] = $n;\n }\n\n return $ns;\n }", "function __prepareNamespaces() {\n\t\tif (!empty($this->__namespaces)) {\n\t\t\t$keys = array_keys($this->__namespaces);\n\t\t\t$count = count($keys);\n\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t$keys[$i] = 'xmlns:' . $keys[$i];\n\t\t\t}\n\t\t\treturn array_combine($keys, array_values($this->__namespaces));\n\t\t}\n\t\treturn array();\n\t}", "public function toArray()\n {\n return (isset($_SESSION[$this->_namespace]) && is_array($_SESSION[$this->_namespace])) ? $_SESSION[$this->_namespace] : [];\n }", "public function getCustomNamespaces(): array;", "public function namespaces()\n {\n return [];\n }", "public function getNamespaces()\n {\n $r = [];\n \n foreach ($this -> prefixes as $i) {\n $r[$i[0]] = $i[1];\n }\n \n return $r;\n }", "public static function get_namespaces() {\n\t\t// The default namespaces\n\t\t$def_namespaces = self::get_default_namespaces();\n\n\t\t// Change the array into the same format as the user saved namespaces\n\t\t$def_namespaces = array(\n\t\t\t'names' =>\tarray_keys( $def_namespaces ),\n\t\t\t'urls'\t=>\tarray_values( $def_namespaces ),\n\t\t);\n\n\t\t// Get the namespaces added by the user\n\t\t$user_namespaces = self::get_instance()->get( 'user_feed_namespaces' );\n\t\tif ( !is_array($user_namespaces) || count($user_namespaces) === 0 ) {\n\t\t\t$user_namespaces = self::get_instance()->get_default( 'user_feed_namespaces' );\n\t\t}\n\n\t\t// Return both as 1 array\n\t\treturn array(\n\t\t\t'names'\t\t=>\tarray_merge( $def_namespaces['names'], $user_namespaces['names'] ),\n\t\t\t'urls'\t\t=>\tarray_merge( $def_namespaces['urls'], $user_namespaces['urls'] ),\n\t\t);\n\t}", "protected function loadNamespaces(): array\n {\n $classes = [];\n\n foreach (config('apitizer.schemas.namespaces', []) as $namespace) {\n $classes = array_merge($classes, $this->loadFromNamespace($namespace));\n }\n\n return $classes;\n }", "public abstract function getNamespaces();", "public function getNamespaces(){\n return array();\n }", "protected function loadNamespaces(): array\n {\n $classes = [];\n\n foreach (config('apitizer.query_builders.namespaces', []) as $namespace) {\n $classes = array_merge($classes, $this->loadFromNamespace($namespace));\n }\n\n return $classes;\n }", "public function getNamespaces();", "public function getNamespaces();", "public function getNamespaces();", "public function namespacedXMLToArray($xml)\n {\n return json_decode(json_encode(simplexml_load_string($this->removeNamespaceFromXML($xml))), true);\n }", "public function getValues(string $namespace): Map;", "public function asArray();", "public function asArray();", "public function asArray();", "private function getNamespace($depth){\r\n\t\t$namespace = [];\r\n\t\tfor($i = 0; $i <= $depth; $i++){\r\n\t\t\tif(ArrayHelper::getValue($this->namespace, $i)){\r\n\t\t\t\t$namespace[] = $this->namespace[$i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $namespace;\r\n\t}", "public function return_namespaces(){\r\n $namespaces = array (\r\n \"lh\" => \"http://localhero.biz/namespace/lhero/\",\r\n \"sioc\" => \"http://rdfs.org/sioc/ns#\",\r\n \"dc\" => \"http://purl.org/dc/elements/1.1/\",\r\n \"content\" => \"http://purl.org/rss/1.0/modules/content/\",\r\n \"dcterms\" => \"http://purl.org/dc/terms/\",\r\n \"admin\" => \"http://webns.net/mvcb/\",\r\n \"skos\" => \"http://www.w3.org/2004/02/skos/core#\",\r\n \"sioct\" => \"http://rdfs.org/sioc/types#\",\r\n \"bio\" => \"http://purl.org/vocab/bio/0.1/\",\r\n \"img\" => \"http://jibbering.com/2002/3/svg/#\",\r\n \"ore\" => \"http://www.openarchives.org/ore/terms/\",\r\n \"void\" => \"http://rdfs.org/ns/void#\",\r\n );\r\n\r\n $namespaces = apply_filters( \"lh_rdf_namespaces\", $namespaces);\r\n return $namespaces;\r\n }", "function toArray() ;", "function toArray() ;", "public function toArray(): array ;", "public function get_namespaces()\n {\n }", "function toArray($useAttr = true)\n {\n $array[$this->name] = array();\n switch ($this->type) {\n case 'directive':\n if ($useAttr && count($this->attributes) > 0) {\n $array[$this->name]['#'] = $this->content;\n $array[$this->name]['@'] = $this->attributes;\n } else {\n $array[$this->name] = $this->content;\n }\n break;\n case 'section':\n if ($useAttr && count($this->attributes) > 0) {\n $array[$this->name]['@'] = $this->attributes;\n }\n if (count($this->children) > 0) {\n for ($i = 0; $i < count($this->children); $i++) {\n $newArr = $this->children[$i]->toArray($useAttr);\n if (!is_null($newArr)) {\n foreach ($newArr as $key => $value) {\n if (isset($array[$this->name][$key])) {\n // duplicate name/type\n if (!is_array($array[$this->name][$key]) ||\n !isset($array[$this->name][$key][0])) {\n $old = $array[$this->name][$key];\n unset($array[$this->name][$key]);\n $array[$this->name][$key][0] = $old;\n }\n $array[$this->name][$key][] = $value;\n } else {\n $array[$this->name][$key] = $value;\n }\n }\n }\n }\n }\n break;\n default:\n return null;\n }\n return $array;\n }", "protected function loadFromNamespace(string $namespace): array\n {\n return ComposerNamespaceClassFinder::make($namespace, QueryBuilder::class)->all();\n }", "public abstract function as_array();", "public function toArray()\n {\n $list = array();\n foreach($this->packages as $name => $package)\n {\n $list[$name] = $package;\n }\n return $list;\n }", "public function toArray(): array\n {\n $result = [];\n\n foreach ($this->storage as $key => $value) {\n if (strpos($key, '.') === false) {\n $result[$key] = ($value instanceof self) ? $value->toArray() : $value;\n }\n }\n\n return $result;\n }", "public function toTokenArray();", "protected function loadFromNamespace(string $namespace): array\n {\n return ComposerNamespaceClassFinder::make($namespace, Schema::class)->all();\n }", "public function getNamespaces()\n {\n if ($this->userNamespaces === null) {\n $data = $this->conn->fetchAll('SELECT * FROM phpcr_namespaces');\n $this->userNamespaces = array();\n\n foreach ($data AS $row) {\n $this->validNamespacePrefixes[$row['prefix']] = true;\n $this->userNamespaces[$row['prefix']] = $row['uri'];\n }\n }\n return $this->userNamespaces;\n }", "public function toArray ();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();" ]
[ "0.7714645", "0.7005352", "0.6897015", "0.6828961", "0.676027", "0.66680026", "0.65812933", "0.6538771", "0.6462087", "0.6401549", "0.63848156", "0.6348529", "0.6316275", "0.6316275", "0.6316275", "0.62849075", "0.6270569", "0.6221439", "0.6221439", "0.6221439", "0.61974555", "0.6107961", "0.61022437", "0.6102043", "0.6101927", "0.60992277", "0.6094106", "0.6077375", "0.6069818", "0.6067076", "0.604386", "0.6033328", "0.602941", "0.60099065", "0.598757", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941", "0.5986941" ]
0.74394006
1
Transforms a namespace to an object
Преобразует пространство имен в объект
public function toObject($namespace = null) { // If namespace is not set, get the default namespace if ($namespace == null) { $namespace = $this->_defaultNameSpace; } // Get the namespace $ns = $this->_registry[$namespace]['data']; return $ns; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toObject($namespace = null)\r\n\t{\r\n\t\t// If namespace is not set, get the default namespace\r\n\t\tif ($namespace == null) {\r\n\t\t\t$namespace = $this->_defaultNameSpace;\r\n\t\t}\r\n\r\n\t\t// Get the namespace\r\n\t\t$ns = & $this->_registry[$namespace]['data'];\r\n\r\n\t\treturn $ns;\r\n\r\n\t}", "public function setNamespace($namespace);", "public function getNamespace();", "public function getNamespace();", "public function getNamespace();", "public function getNamespace();", "public function getNamespace();", "function setNamespace($namespace);", "public static function modelFromNamespace($namespace)\n {\n $pattern = '/.+\\\\\\/i';\n \n return preg_replace($pattern, '', $namespace);\n }", "abstract protected function getNamespace();", "function getNamespace();", "public static function getNamespace();", "static public function setNamespace($namespace);", "public static function get_namespace();", "public function getByNamespace($namespace);", "public function load($namespace);", "public function testReplaceNamespace()\n {\n }", "function get_namespace( $obj ) {\n if ( is_object( $obj ) ) {\n $class = get_class( $obj );\n } elseif ( class_exists( $obj, false ) ) {\n $class = $obj;\n }\n $idx = strrpos( $class, '\\\\' );\n $ns = substr( $class, 0, $idx );\n return ( $ns ? $ns : '' );\n}", "public function getNamespace(): string;", "public function createNamespace($namespace)\n\t{\n\t\tif (isset($this->namespaces[$namespace])) {\n\t\t\treturn $this->namespaces[$namespace];\n\t\t}\n\n\t\t$this->namespaces[$namespace] = new SessionNamespace($this, $namespace);\n\t\treturn $this->namespaces[$namespace];\n\t}", "abstract public function namespace(): string;", "public function convertPHPNamespaceToArbitrage($namespace)\n\t{\n\t\t$namespace = preg_replace('/\\\\\\/', '.', $namespace);\n\t\t$namespace = preg_replace('/^\\./', '', $namespace);\n\t\treturn $namespace;\n\t}", "public function withNamespace(string $namespace): InputInterface;", "public function setNamespace( $namespace )\n\t{\n\t\t//$this->explicitType = $namespace;\n\t}", "function setNamespace(array $namespace);", "public function setNamespace($var)\n {\n GPBUtil::checkString($var, True);\n $this->namespace = $var;\n\n return $this;\n }", "private function transposeNamespace($namespace)\n {\n if (isset($this->namespaceTransposition[$namespace])) {\n return $this->namespaceTransposition[$namespace];\n }\n\n return $namespace;\n }", "static public function resetNamespace();", "public function getNamespace() { return $this->getCacheVariable('namespace'); }", "function setNamespace($inNamespace) {\n\t\tif ( $inNamespace !== $this->_Namespace ) {\n\t\t\t$this->_Namespace = $inNamespace;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function testCreateNamespace()\n {\n }", "public function getNamespaceRegistry();", "public function getClassName($namespace);", "function getObjectNamespace( $object ) {\r\n\tif ( !is_object( $object ) )\r\n\t\treturn false; // throw error\r\n\t$class = get_class( $object );\r\n\treturn substr( $class, 0, strrpos( $class, '\\\\' ) );\r\n}", "abstract public function clearInNamespace($namespace);", "public function declareNamespace($prefix, $namespace) {}", "public static function ns($namespace)\n {\n if (empty(self::$instances[$namespace])) {\n self::$instances[$namespace] = new self($namespace);\n }\n return self::$instances[$namespace];\n }", "public function setNamespace($namespace) { $this->setCacheVariable('namespace', $namespace); }", "public function convertArbitrageNamespaceToPHP($namespace)\n\t{\n\t\t$namespace = preg_replace('/\\./', '\\\\', $namespace);\n\t\treturn \"\\\\$namespace\";\n\t}", "public function get_namespaces()\n {\n }", "private function marcxml2namespace() {\n return str_replace(\n array('<?xml version=\"1.0\"?>', '<record xmlns=\"http://www.loc.gov/MARC21/slim\">', '</record>', 'leader','controlfield','datafield','subfield'),\n array('', '<marc:record>', '</marc:record>', 'marc:leader','marc:controlfield','marc:datafield','marc:subfield'),\n $this->metadata_xml);\n }", "public function applyNamespacePrefix($prefix);", "public function applyNamespacePrefix($prefix);", "public static function namespaceToVersion($namespace) {\n $array = explode('\\\\', $namespace);\n return strtolower($array[count($array) - 2]);\n }", "public function testReadNamespace()\n {\n }", "public function getNamespace(string $namespace): stdClass\n {\n if ($this->sessionEnabled === false) {\n throw new SessionNotStartedException('Session not started',);\n }\n if (!isset($_SESSION[$namespace]) || $_SESSION[$namespace] instanceof stdClass === false) {\n $_SESSION[$namespace] = new stdClass();\n }\n\n return $_SESSION[$namespace];\n }", "function loadNamespace ( $namespace ) {\n $file = geratePath ( getPath ( ), $namespace ).\".php\";\n \n if ( callClass ( $file ) ){\n array_push ( $GLOBALS [ \"CLASSES\" ], $file );\n };\n}", "public function replaceNamespace(string $namespace, $hints): self;", "protected function getNamespace()\n {\n return 'Redking\\Bundle\\ODMTranslatorBundle';\n }", "function toArray($namespace = null)\r\n\t{\r\n\t\t// If namespace is not set, get the default namespace\r\n\t\tif ($namespace == null) {\r\n\t\t\t$namespace = $this->_defaultNameSpace;\r\n\t\t}\r\n\r\n\t\t// Get the namespace\r\n\t\t$ns = & $this->_registry[$namespace]['data'];\r\n\r\n\t\t$array = array();\r\n\t\tforeach (get_object_vars( $ns ) as $k => $v) {\r\n\t\t\t$array[$k] = $v;\r\n\t\t}\r\n\r\n\t\treturn $array;\r\n\t}", "public function unshiftNamespace($namespace)\n {\n array_unshift($this->namespaces, $namespace);\n }", "static public function setNamespace($namespace)\n {\n static::$_namespace = $namespace;\n static::resetCache();\n }", "public function resolveType($useMap, $namespace) {\n\t\t$newType = new self();\n\t\t$newType->type = $this->type;\n\t\t$newType->keyType = $this->keyType;\n\t\t\n\t\tif ($this->subType != null) {\n\t\t\t$newType->subType = $this->subType->resolveType($useMap, $namespace);\n\t\t}\n\t\t\n\t\tif ($newType->type == null || $newType->type == \"array\" || $newType->isPrimitiveType()) {\n\t\t\treturn $newType;\n\t\t}\n\t\n\t\t$index = strpos($newType->type, '\\\\');\n\t\tif ($index === false) {\n\t\t\tif (isset($useMap[$newType->type])) {\n\t\t\t\t$newType->type = '\\\\'.$useMap[$newType->type];\n\t\t\t\treturn $newType;\n\t\t\t} else {\n\t\t\t\tif ($namespace) {\n\t\t\t\t\t$newType->type = '\\\\'.$namespace.'\\\\'.$newType->type;\n\t\t\t\t\treturn $newType;\n\t\t\t\t} else {\n\t\t\t\t\t$newType->type = '\\\\'.$newType->type;\n\t\t\t\t\treturn $newType;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($index === 0) {\n\t\t\t// Starting with \\. Already a fully qualified name.\n\t\t\treturn $newType;\n\t\t}\n\t\t$leftPart = substr($newType->type, 0, $index);\n\t\t$rightPart = substr($newType->type, $index);\n\t\n\t\tif (isset($useMap[$leftPart])) {\n\t\t\t$newType->type = '\\\\'.$useMap[$leftPart].$rightPart;\n\t\t\treturn $newType;\n\t\t} else {\n\t\t\t$newType->type = '\\\\'.$namespace.'\\\\'.$newType->type;\n\t\t\treturn $newType;\n\t\t}\n\t}", "public function findByNamespace($namespace);", "static public function resetNamespace()\n {\n static::$_namespace = static::DEFAULT_NAMESPACE;\n static::resetCache();\n }", "private function addNamespaceToTypeName($namespace) {\n\t\tif ( $namespace == \"\" ) return;\n\t\t$namespace = trim($namespace, \"\\\\\");\n\t\t$this->typeName = $namespace .\"\\\\\". $this->typeName;\n\t}", "public function create(object $data): NamespaceInterface\n {\n $descriptor = new NamespaceDescriptor();\n $descriptor->setName($data->getName());\n $descriptor->setFullyQualifiedStructuralElementName($data->getFqsen());\n $namespace = substr((string) $data->getFqsen(), 0, -strlen($data->getName()) - 1);\n $descriptor->setNamespace($namespace === '' ? '\\\\' : $namespace);\n\n return $descriptor;\n }", "public function setNamespace($namespace) {\n\t\t$this->removeNamespaceFromTypeName($this->getNamespace());\n\t\tparent::setNamespace($namespace);\n\t\t$this->addNamespaceToTypeName($this->getNamespace());\n\t}", "public function getNamespace()\n {\n return 'http://example.org/schema/dic/' . $this->getAlias();\n }", "public function buildControllerNamespace();", "public function getNamespaceName(): string\n {\n }", "public function removeNamespaceCacheKey();", "private function removeNamespaceFromTypeName($namespace) {\n\t\tif ( $namespace == \"\" ) return;\n\n\t\t// It must be the starting namespace, we don't want to take part of a namespace away from the middle\n\t\tif ( ($namespacePosition = strpos($this->typeName, $namespace)) === 0 ) {\n\t\t\t$typeName = substr_replace($this->getTypeName(), $namespace, 0, strlen($namespace));\n\t\t\t$this->typeName = $typeName;\n\t\t}\n\t}", "public function setAdapterNamespace($namespace);", "function rdf2obj($rdf)\n{\n\t// Fix IPNI bugs\n\t$rdf = preg_replace('/ & /', ' &amp; ', $rdf);\n\t$rdf = preg_replace('/< /', '&lt; ', $rdf);\n\t\n\t\n\n\t$obj = new stdclass;\n\t\n\t// extract extra details...\n\t$dom= new DOMDocument;\n\t$dom->loadXML($rdf);\n\t$xpath = new DOMXPath($dom);\n\t\n\t$xpath->registerNamespace(\"rdf\", \t\t\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\");\n\t$xpath->registerNamespace(\"dc\", \t\t\"http://purl.org/dc/elements/1.1/\" );\n\t$xpath->registerNamespace(\"dcterms\", \t\"http://purl.org/dc/terms/\");\n\t$xpath->registerNamespace(\"tn\", \t\t\"http://rs.tdwg.org/ontology/voc/TaxonName#\");\n\t$xpath->registerNamespace(\"tm\", \t\t\"http://rs.tdwg.org/ontology/voc/Team#\" );\n\t$xpath->registerNamespace(\"tcom\", \t\t\"http://rs.tdwg.org/ontology/voc/Common#\" );\n\t$xpath->registerNamespace(\"p\", \t\t\t\"http://rs.tdwg.org/ontology/voc/Person#\" );\n\t$xpath->registerNamespace(\"owl\", \t\t\"http://www.w3.org/2002/07/owl#\" );\n\t\n\t\n\t$nodeCollection = $xpath->query (\"//tn:TaxonName/@rdf:about\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->Id = $node->firstChild->nodeValue;\n\t\t$obj->Id = str_replace('urn:lsid:ipni.org:names:', '', $obj->Id);\n\t}\n\t\n\t$nodeCollection = $xpath->query (\"//owl:versionInfo\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->versionInfo = $node->firstChild->nodeValue;\n\t\t$obj->Id = str_replace(':' . $obj->versionInfo, '', $obj->Id);\n\t}\n\t\n\t$nodeCollection = $xpath->query (\"//tn:year\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->year = $node->firstChild->nodeValue;\n\t}\n\n\t$nodeCollection = $xpath->query (\"//tn:nameComplete\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->nameComplete = $node->firstChild->nodeValue;\n\t}\n\n\t$nodeCollection = $xpath->query (\"//tn:genusPart\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->genusPart = $node->firstChild->nodeValue;\n\t}\n\n\t$nodeCollection = $xpath->query (\"//tn:infragenericEpithet\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->infragenericEpithet = $node->firstChild->nodeValue;\n\t}\n\n\t$nodeCollection = $xpath->query (\"//tn:specificEpithet\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->specificEpithet = $node->firstChild->nodeValue;\n\t}\n\n\t$nodeCollection = $xpath->query (\"//tn:infraspecificEpithet\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->infraspecificEpithet = $node->firstChild->nodeValue;\n\t}\n\n\t$nodeCollection = $xpath->query (\"//tn:rankString\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->rankString = $node->firstChild->nodeValue;\n\t}\n\n\tif ($obj->rankString == 'gen.')\n\t{\n\t\t// tn:uninomial Diphyllocalyx\n\t\t$nodeCollection = $xpath->query (\"//tn:uninomial\");\n\t\tforeach($nodeCollection as $node)\n\t\t{\n\t\t\t$obj->uninomial = $node->firstChild->nodeValue;\n\t\t}\t\t\n\t}\n\n\t//------------------------ authors -----------------------------------------------\n\t$nodeCollection = $xpath->query (\"//tn:authorship\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->authorship = $node->firstChild->nodeValue;\n\t}\t\t\n\t\n\t\n\t/*\n\t<tm:Team>\n\t<tm:name>Gagnon, G.P.Lewis &amp; C.E.Hughes</tm:name>\n\t<tm:hasMember rdf:resource=\"urn:lsid:ipni.org:authors:20028451-1\"\n\t*/\n\t\n\t$nodeCollection = $xpath->query (\"//tm:Team/tm:hasMember/@rdf:resource\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->team[] = str_replace('urn:lsid:ipni.org:authors:', '', $node->firstChild->nodeValue);\n\t}\n\t\n\n\t//------------------------ publication--------------------------------------------\n\t$nodeCollection = $xpath->query (\"//tcom:publishedIn\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$publishedIn = $node->firstChild->nodeValue;\n\t\n\t\t$obj->Publication = $publishedIn;\n\t\n\t\t// debug\n\t\t$obj->publishedIn = $publishedIn;\n\t\n\t\t$matched = false;\n\t\n\t\tif (!$matched)\n\t\t{\n\t\t\tif (preg_match('/(?<publication>.*)\\s+(?<collation>\\d.*)\\.\\s+\\(?(?<year>[0-9]{4})\\)?/Uu', $publishedIn, $m))\n\t\t\t{\n\t\t\t\t$obj->Publication = $m['publication'];\n\t\t\t\t$obj->Collation = $m['collation'];\n\t\t\t\t$matched = true;\n\t\t\t}\n\t\t}\n\t\n\t\n\t\tif (!$matched)\n\t\t{\n\t\t\tif (preg_match('/(?<publication>.*)\\s+(?<collation>\\d.*)\\.?\\s+\\(?(?<year>[0-9]{4})\\)?/Uu', $publishedIn, $m))\n\t\t\t{\n\t\t\t\t$obj->Publication = $m['publication'];\n\t\t\t\t$obj->Collation = $m['collation'];\n\t\t\t\t$matched = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t//----------------------- synonyms -----------------------------------------------\n\t// Basionym\n\t// tn:basionymAuthorship\n\t$nodeCollection = $xpath->query (\"//tn:basionymAuthorship\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->basionymAuthorship = $node->firstChild->nodeValue;\n\t}\n\t// tn:hasBasionym\n\t$nodeCollection = $xpath->query (\"//tn:hasBasionym/@rdf:resource\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$obj->hasBasionym = str_replace('urn:lsid:ipni.org:names:', '', $node->firstChild->nodeValue);\n\t}\n\n\t// NomenclaturalNote (e.g., replacement name)\n\t$nodeCollection = $xpath->query (\"//tn:NomenclaturalNote\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$noteType = '';\n\t\t$nc = $xpath->query (\"tn:noteType/@rdf:resource\", $node);\n\t\tforeach($nc as $n)\n\t\t{\n\t\t\t$noteType = str_replace('http://rs.tdwg.org/ontology/voc/TaxonName#', '', $n->firstChild->nodeValue);\n\t\t}\n\t\t\n\t\tif ($noteType != '' )\n\t\t{\n\t\t\t$nc = $xpath->query (\"tn:objectTaxonName/@rdf:resource\", $node);\n\t\t\tforeach($nc as $n)\n\t\t\t{\n\t\t\t\t$obj->{$noteType} = str_replace('urn:lsid:ipni.org:names:', '', $n->firstChild->nodeValue);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// types\n\t/*\n\t<tn:typifiedBy>\n<tn:NomenclaturalType>\n<dc:title>Arquita mimosifolia (Griseb.) Gagnon, G.P.Lewis &amp; C.E.Hughes</dc:title>\n<tn:typeName rdf:resource=\"urn:lsid:ipni.org:names:77148634-1\"/>\n</tn:NomenclaturalType>\n</tn:typifiedBy> */\n\n/* <tn:typifiedBy>\n<tn:NomenclaturalType>\n<dc:title>T.M.Salter 5119, BOL (holo)</dc:title>\n<tn:typeSpecimen>T.M.Salter 5119, BOL</tn:typeSpecimen>\n<tn:typeOfType rdf:resource=\"http://rs.tdwg.org/ontology/voc/TaxonName#holo\"/>\n</tn:NomenclaturalType>\n</tn:typifiedBy>\n*/\n\t$nodeCollection = $xpath->query (\"//tn:typifiedBy/tn:NomenclaturalType\");\n\tforeach($nodeCollection as $node)\n\t{\n\t\t$nc = $xpath->query (\"tn:typeName/@rdf:resource\", $node);\n\t\tforeach($nc as $n)\n\t\t{\n\t\t\t$obj->typeName = str_replace('urn:lsid:ipni.org:names:', '', $n->firstChild->nodeValue);\n\t\t}\n\t\t$nc = $xpath->query (\"tn:typeSpecimen\", $node);\n\t\tforeach($nc as $n)\n\t\t{\n\t\t\t$typeSpecimen = $n->firstChild->nodeValue;\n\t\t\t\n\t\t\t$nnc = $xpath->query (\"tn:typeOfType/@rdf:resource\", $node);\n\t\t\tforeach($nnc as $nn)\n\t\t\t{\n\t\t\t\t$type = $nn->firstChild->nodeValue;\n\t\t\t\t$type = str_replace('http://rs.tdwg.org/ontology/voc/TaxonName#', '', $type);\n\t\t\t\t$typeSpecimen .= ' (' . $type . ')';\n\t\t\t}\n\t\t\t$obj->typeSpecimen[] = $typeSpecimen;\n\n\t\t}\n\t\t\n\t}\n\n\t\n\t\n\t// unset stuff if needed\n\tunset($obj->Publication);\n\tunset($obj->Collation);\n\n\n\treturn $obj;\n}", "public function testReplaceNamespaceStatus()\n {\n }", "function getNamespaces() {\n global $http, $name, $lang, $wiki, $oldlang, $oldwiki;\n\n $namespaces = $http->get( 'https://'.$oldlang.'.'.$oldwiki.'.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces&format=php', false );\n $namespaces = unserialize( $namespaces );\n $namespaces = $namespaces['query']['namespaces'];\n if( !$namespaces[0] ) { toDie( 'Not a valid wiki.' ); };\n\n\n unset( $namespaces[-2] );\n unset( $namespaces[-1] );\n\n $namespaces[0]['*'] = 'Article';\n\n return $namespaces;\n}", "function getNamespace($namespaceClass)\n{\n if (is_object($namespaceClass)) {\n $namespaceClass = get_class($namespaceClass);\n }\n\n $lastSlashPosition = mb_strrpos($namespaceClass, '\\\\');\n\n if ($lastSlashPosition !== false) {\n return mb_substr($namespaceClass, 0, $lastSlashPosition);\n }\n\n return \"\";\n}", "public function setNamespace($namespace)\n {\n if ('global' !== $namespace\n && 'default' !== $namespace\n ) {\n // Srip leading and trailing slash\n $this->namespace = trim((string)$namespace, '\\\\');\n } else {\n $this->namespace = '';\n }\n return $this;\n }", "public function getNamespace()\n {\n return $this->getUri().$this->namespaceAddition;\n }", "public function setNamespace($namespace)\n {\n $this->namespace = $namespace;\n return $this;\n }", "public function setNamespace($namespace)\n {\n $this->namespace = $namespace;\n return $this;\n }", "protected function parseNamespaceMapping()\n {\n $this->expectToken(Token::TK_SYMBOL, '<');\n $prefix = $this->parseCndString();\n $this->expectToken(Token::TK_SYMBOL, '=');\n $uri = substr($this->expectToken(Token::TK_STRING)->getData(), 1, -1);\n $this->expectToken(Token::TK_SYMBOL, '>');\n\n $this->namespaces[$prefix] = $uri;\n }", "protected function ParseObject( $data = false, $estructuraClase = false, $namespace = 'Wisquimas\\\\' ){\n /*\n **PREFIJAMOS EL NAMESPACE\n */\n $estructuraClase = $namespace.(string)$estructuraClase;\n $data = (array)$data;\n if( !$data ){\n $this->add_error('La información enviada al sistema está vacía');\n return;\n };\n if( !$estructuraClase || !class_exists( $estructuraClase ) ){\n $this->add_error('No se ha devuelto una estructura de Objecto dada de alta en el sistema');\n return;\n };\n $objetoBase = new $estructuraClase();\n if( !$objetoBase ){\n $this->add_error('Ha habido un error al crear el objeto modelo');\n return;\n };\n /*\n ** RECORREMOS OBJETO\n */\n foreach ($objetoBase as $key => $value) {\n if( isset( $data[$key] ) ){\n $objetoBase->$key = $data[$key];\n };\n }\n return $objetoBase;\n }", "public function getNamespace($prefix) {\n $constant = get_class().'::'.strtoupper($prefix);\n if (!defined($constant)) {\n return;\n }\n\n return constant($constant);\n }", "public function setNamespace($namespace)\n {\n $this->namespace = (string)$namespace;\n\n return $this;\n }", "public function setFormatNamespace($formatNamespace);", "public static function namespaceToIdentifier($namespace) {\n $array = explode('\\\\', $namespace);\n return strtolower(end($array));\n }", "public function setNamespace($namespace) {\n\t\t\t$this->generatedNamespace = $namespace;\n\t\t\treturn $this;\n\t\t}", "public function __construct($namespace = 'window')\n {\n $this->namespace = $namespace;\n }", "public function getNamespace()\n {\n return $this->namespace;\n }", "private function normalizeNamespace(string $namespace): string\n {\n $namespace = \\str_replace('\\\\\\\\', '\\\\', $namespace);\n\n return \\trim($namespace, '\\\\');\n }", "public function toArray($namespace = null)\r\r\n\t{\r\r\n\t\t// If namespace is not set, get the default namespace\r\r\n\t\tif ($namespace == null) {\r\r\n\t\t\t$namespace = $this->_defaultNameSpace;\r\r\n\t\t}\r\r\n\r\r\n\t\t// Get the namespace\r\r\n\t\t$ns = $this->_registry[$namespace]['data'];\r\r\n\r\r\n\t\t$array = array();\r\r\n\t\tforeach (get_object_vars( $ns ) as $k => $v) {\r\r\n\t\t\t$array[$k] = $v;\r\r\n\t\t}\r\r\n\r\r\n\t\treturn $array;\r\r\n\t}", "function getNamespace() {\n\t\treturn $this->_Namespace;\n\t}", "public function namespaceAction() {\n $namespace = implode(ApiBrowser::NAMESPACE_SEPARATOR, func_get_args());\n $variables = array(\n 'namespaces' => $this->apiBrowser->getNamespaces($namespace),\n 'namespace' => $namespace,\n 'classes' => $this->apiBrowser->getClassesForNamespace($namespace),\n );\n\n $this->setView('api/namespace', $variables, $namespace);\n }", "protected function __construct($namespace) {\n\t\t\t$this->_namespace = $namespace;\n\t\t}", "public static function convertPathToNamespace($path)\n {\n return str_replace('/', '\\\\', $path);\n }", "function create($class_name, k_Context $context, $namespace = \"\");", "function __construct($namespace = 'default')\n\t\t{\t\n\t\t\t$this->setCacheVariable('namespace', $namespace);\n\t\t\t$this->clear();\n\t\t}", "public function getNamespace($object)\n {\n $namespace = explode('\\\\', get_class($object));\n\n array_pop($namespace);\n\n return implode('\\\\', $namespace);\n }", "public function namespaces(): void\n {\n $this\n ->namespace(\n \\Cobra\\Interfaces\\Cache\\CacheInterface::class,\n \\Cobra\\Cache\\Cache::class\n )->namespace(\n \\Cobra\\Interfaces\\Cache\\CacheKeyInterface::class,\n \\Cobra\\Cache\\CacheKey::class\n );\n }", "protected function getNamespace() {\r\n \treturn $this->namespace;\r\n }", "private function _findNamespace()\n\t{\n\t\t$parts = explode(\"\\\\\", get_class($this));\n\t\tarray_pop($parts);\n\t\t\n\t\treturn implode(\"\\\\\", $parts);\n\t}", "public function getFormatNamespace();", "public function return_namespaces(){\r\n $namespaces = array (\r\n \"lh\" => \"http://localhero.biz/namespace/lhero/\",\r\n \"sioc\" => \"http://rdfs.org/sioc/ns#\",\r\n \"dc\" => \"http://purl.org/dc/elements/1.1/\",\r\n \"content\" => \"http://purl.org/rss/1.0/modules/content/\",\r\n \"dcterms\" => \"http://purl.org/dc/terms/\",\r\n \"admin\" => \"http://webns.net/mvcb/\",\r\n \"skos\" => \"http://www.w3.org/2004/02/skos/core#\",\r\n \"sioct\" => \"http://rdfs.org/sioc/types#\",\r\n \"bio\" => \"http://purl.org/vocab/bio/0.1/\",\r\n \"img\" => \"http://jibbering.com/2002/3/svg/#\",\r\n \"ore\" => \"http://www.openarchives.org/ore/terms/\",\r\n \"void\" => \"http://rdfs.org/ns/void#\",\r\n );\r\n\r\n $namespaces = apply_filters( \"lh_rdf_namespaces\", $namespaces);\r\n return $namespaces;\r\n }", "public function getNamespace()\r\n {\r\n return $this->namespace;\r\n }", "public function setNamespace($namespace) {\n\t\t$this->namespace = $namespace;\n\t}", "public function setNamespace($namespace) {\n\t\t$this->namespace = $namespace;\n\t}", "public function namespaceRequest($id){\n return $this->fetch_nis('/namespace', [\n 'namespace' => $id\n ]);\n }", "public function setNamespace($ns) {\n\t\t$this->namespace = $ns;\n\t}" ]
[ "0.75711435", "0.6313325", "0.6299111", "0.6299111", "0.6299111", "0.6299111", "0.6299111", "0.622082", "0.62058306", "0.62012756", "0.6173785", "0.6145897", "0.611151", "0.6109082", "0.6097143", "0.60254735", "0.5955933", "0.57012093", "0.5697534", "0.5681025", "0.56664824", "0.551417", "0.55121493", "0.5505505", "0.54971474", "0.5480944", "0.5447655", "0.54447097", "0.54403794", "0.5438046", "0.541097", "0.5404749", "0.5401442", "0.53933156", "0.5386781", "0.5372061", "0.53523177", "0.53435093", "0.5334574", "0.5307186", "0.5296183", "0.5286291", "0.5286291", "0.5275994", "0.52505946", "0.52433026", "0.52256763", "0.522163", "0.5221522", "0.5212397", "0.5206715", "0.5193941", "0.5187503", "0.51852065", "0.51849234", "0.51823163", "0.5179868", "0.51724535", "0.51674986", "0.51632667", "0.5140941", "0.513669", "0.5134417", "0.51339793", "0.51310384", "0.5128465", "0.51282454", "0.51262534", "0.51259774", "0.5120549", "0.5108288", "0.5108288", "0.5105788", "0.51024127", "0.5077621", "0.5074082", "0.5064371", "0.50620496", "0.50614464", "0.50504273", "0.5046888", "0.5045041", "0.50411296", "0.50323373", "0.50302726", "0.5029817", "0.5023436", "0.5023181", "0.502225", "0.50203407", "0.5015595", "0.5005556", "0.50042063", "0.500415", "0.5002892", "0.49974522", "0.4992417", "0.4992417", "0.49917364", "0.49839967" ]
0.7311622
1
Factory method for creating a reading element.
Фабричный метод для создания элемента чтения.
protected function new_reading() { return new JMDictReadingElement(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newElement();", "abstract protected function read();", "abstract protected function read();", "abstract protected function read();", "function create_element( $name ){\n return new xNode( $name,XNODE_TYPE_ELEM, $this ); \n }", "public static function factory()\n\t{\n\t\t/*\n\t\t * Tequila_Reader_Readline is very limited:\n\t\t * - it does not provide any completion;\n\t\t * - it does not save the history between runs.\n\t\t *\n\t\t * It is therefore disabled for now and all advanced editing will be\n\t\t * provided by “rlwrap”.\n\t\t */\n\t\t/* if (extension_loaded('readline')) */\n\t\t/* { */\n\t\t/* \treturn new Tequila_Reader_Readline(); */\n\t\t/* } */\n\n\t\treturn new Tequila_Reader_Plain();\n\t}", "abstract public function getElementProvider();", "public function __construct(\\SimpleXMLElement $readXml)\r\n {\r\n $this->readXml = $readXml;\r\n $this->readSection();\r\n }", "public final static function initializeReader()\n { // N2wReaders::initializeReader();\n return new N2wReaders();\n }", "public function getReader()\n\t{\n\t\t// a bit of flexibility, you pass in the name of the Concrete Reader class when creating the Container\n\t\t$class = $this->parameters['reader.class'];\n\n\t\t$reader = new $class(array(\n\t\t\t'url' => $this->parameters['reader.url'],\n\t\t\t'max' => $this->parameters['reader.max'],\n\t\t));\n\n\t\treturn $reader;\n\t}", "abstract protected function _getFormElement($name);", "public function initFromReader(\\XMLReader $xml)\r\n {\r\n $empty = $xml->isEmptyElement;\r\n\r\n if ($xml->hasAttributes) {\r\n $moreAttributes = $xml->moveToFirstAttribute();\r\n while ($moreAttributes) {\r\n if (!$this->setKnownAttribute($xml)) {\r\n //skip unknown attributes...\r\n }\r\n $moreAttributes = $xml->moveToNextAttribute();\r\n }\r\n }\r\n\r\n if (!$empty) {\r\n $xml->read();\r\n while ($xml->nodeType != \\XMLReader::END_ELEMENT) {\r\n if ($xml->nodeType != \\XMLReader::ELEMENT) {\r\n //no-op: skip any insignificant whitespace, comments, etc.\r\n }\r\n else if (!$this->setKnownChildElement($xml)) {\r\n $n = $xml->localName;\r\n $ns = $xml->namespaceURI;\r\n $elementIsEmpty = $xml->isEmptyElement;\r\n $dom = new \\DOMDocument();\r\n $nodeFactory = $dom;\r\n $dom->formatOutput = true;\r\n\r\n $e = $nodeFactory->createElementNS($xml->namespaceURI, $xml->localName);\r\n $dom->appendChild($e);\r\n if ($xml->hasAttributes) {\r\n $moreAttributes = $xml->moveToFirstAttribute();\r\n while ($moreAttributes) {\r\n $e->setAttributeNS($ns, $xml->localName, $xml->value);\r\n $moreAttributes = $xml->moveToNextAttribute();\r\n }\r\n }\r\n $dom = $e;\r\n if (!$elementIsEmpty) {\r\n //create any child elements...\r\n while ($xml->read() && $xml->nodeType != \\XMLReader::END_ELEMENT && $xml->localName != $n) {\r\n if ($xml->nodeType == \\XMLReader::ELEMENT) {\r\n $e = $nodeFactory->createElementNS($xml->namespaceURI, $xml->localName);\r\n $dom->appendChild($e);\r\n if ($xml->hasAttributes) {\r\n $moreAttributes = $xml->moveToFirstAttribute();\r\n while ($moreAttributes) {\r\n $e->setAttributeNS($xml->namespaceURI, $xml->localName, $xml->value);\r\n $moreAttributes = $xml->moveToNextAttribute();\r\n }\r\n }\r\n } else if ($xml->nodeType == \\XMLReader::TEXT) {\r\n $dom->textContent = $xml->value;\r\n } else if ($xml->nodeType == \\XMLReader::END_ELEMENT) {\r\n $dom = $dom->parentNode;\r\n }\r\n }\r\n }\r\n array_push($this->extensionElements, $dom);\r\n }\r\n $xml->read(); //advance the reader.\r\n }\r\n }\r\n }", "public function read()\n {\n }", "public function read()\n {\n }", "public function create($input, $mode = 'html') {\n\t\t\n\t\t// is file ?\n\t\tif (substr(trim($input), 0, 1) != '<' && file_exists($input) && is_file($input)) {\n\t\t\t$input = file_get_contents($input);\n\t\t}\n\n\t\t// create object\n\t\t$dom = new WidgetkitDOMDocument();\n\n\t\t// load xml/html\n\t\tif ($mode == 'xml') {\n\t\t\t$dom->loadXML($input);\n\t\t} else {\n\n\t\t\t// set doctype\n\t\t\tif (strpos($input, '<!DOCTYPE') === false) {\n\t\t\t\t$input = sprintf(self::HTML_DOCTYPE, $input);\n\t\t\t}\n\t\t\t\n\t\t\t$dom->loadHTML($input);\n\t\t}\n\t\t\n\t\treturn $dom;\n\t}", "public function read($name) { }", "public function read()\n {\n\n }", "public function read(string $name);", "private function getElement()\r\n {\r\n $element = new Element('div');\r\n\r\n $element->addAttribute('id', $this->id);\r\n $element->addAttribute('class', $this->classes);\r\n\r\n foreach (explode(' ', $this->attributes) as $attribute) {\r\n $element->addAttribute($attribute, true);\r\n }\r\n\r\n return $element;\r\n }", "public function read() {\n\t}", "function read()\n\t{\n\t\tglobal $ilBench, $ilDB;\n\n\t\tif(!isset($this->data_record))\n\t\t{\n\t\t\t$query = \"SELECT * FROM skl_tree_node WHERE obj_id = \".\n\t\t\t\t$ilDB->quote($this->id, \"integer\");\n\t\t\t$obj_set = $ilDB->query($query);\n\t\t\t$this->data_record = $ilDB->fetchAssoc($obj_set);\n\t\t}\n\t\t$this->setType($this->data_record[\"type\"]);\n\t\t$this->setTitle($this->data_record[\"title\"]);\n\t\t$this->setOrderNr($this->data_record[\"order_nr\"]);\n\t\t$this->setSelfEvaluation($this->data_record[\"self_eval\"]);\n\t\t$this->setDraft($this->data_record[\"draft\"]);\n\t}", "public function createElement($name) {\n return new $this->nodeType($name);\n }", "function readElement ($node)\n {\n $this->video_url = $this->getVal($node, 'div', 'src');\n $this->cls = $this->getVal($node, 'div', 'class');\n $this->href = $this->getVal($node, 'a', 'href');\n \n \n $this->image_src = $this->getVal($node, 'img', 'src');\n \n $this->align = $this->getVal($node, 'figure', 'align');\n \n $figcaption = $this->getVal($node, 'figcaption', false);\n if ($figcaption !== '') {\n $this->caption = $this->getVal($figcaption, 'i', 'html');\n }\n \n\n $this->caption_display = $this->getVal($node, 'figcaption', 'data-display');\n //$this->text_align = $this->getVal(node, 'figcaption', 'style','text-align');\n $this->width = $this->getVal($node, true, 'data-width');\n //$this->margin = $this->getVal(node, 'figure', 'style', 'margin');\n \n }", "public static function instantiate($tag,$attrib){\n return new self($tag,$attrib);\n}", "public function getReader()\n {\n return new Reader();\n }", "function read() {}", "function &Factory($element, $moduleID)\n{\n return new RecordMetaField($element, $moduleID);\n}", "public function offsetGet($offset) {\r\n# print \"GET: $offset\\n\";\r\n # Check if attribute is called or element number\r\n # !An attribute name cannot start with a number so we're save with the assumption\r\n # that if an offset is int it can never be a reference to an attribute!\r\n if (is_string($offset)) {\r\n $elementName = $offset;\r\n\r\n list($elementPrefix, $elementLocalName) = SimpleDOMFunctions::processNodeName($elementName);\r\n if ($node = SimpleDOMFunctions::getElement($this->domElement, $elementLocalName)) {\r\n return SimpleDOMFactory::create($node);\r\n }\r\n\r\n if (SimpleDOMDocument::getReadOnly()) {\r\n throw new Exception(\"No element found with name `$elementName`\");\r\n } else {\r\n $newElement = SimpleDOMFunctions::createNewElement($this->domElement, $elementLocalName, $elementPrefix);\r\n }\r\n\r\n return (SimpleDOMFactory::create($newElement));\r\n } else {\r\n if (is_int($offset)) {\r\n $simpleDOMElement = SimpleDOMFactory::create($this->process_element_by_offset($offset));\r\n\r\n # Child comes from a call with an offset\r\n $simpleDOMElement->set_offsetChild(true);\r\n\r\n return $simpleDOMElement;\r\n } else {\r\n throw new Exception ('The offset given is not supported!');\r\n }\r\n }\r\n }", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "function read()\n {\n }", "private function createNotFoundElementException()\n\t{\n\t\tthrow new InvalidArgumentException(\n\t\t\t'Element passed to Yampee_Annotations_Reader::read() does not exists.'\n\t\t);\n\t}", "public function read ();", "public function getReadIn()\n {\n return null;\n }", "abstract public function getDOMElement(): \\DOMElement;", "protected function define_structure() {\n $userinfo = $this->get_setting_value('userinfo');\n \n // Define each element separated\n $reader = new backup_nested_element('reader', array('id'), array(\n 'course', 'name', 'intro', 'introformat', 'timeopen', 'timeclose', 'optionflags', 'penaltyscheme', 'attempts', 'attemptonlast',\n 'grademethod', 'decimalpoints', 'review', 'questionsperpage', 'shufflequestions', 'shuffleanswers', 'questions',\n 'sumgrades', 'grade', 'usecourse', 'timecreated', 'timemodified', 'timelimit', 'password',\n 'subnet', 'popup', 'individualstrictip', 'delay1', 'delay2', 'percentforreading', 'nextlevel',\n 'quizpreviouslevel', 'quiznextlevel', 'pointreport', 'questionmark', 'bookcovers', 'attemptsofday', 'ignordate',\n 'goal', 'wordsorpoints', 'secmeass', 'promotionstop', 'levelcheck', 'reportwordspoints', 'wordsprogressbar',\n 'individualbooks', 'sendmessagesaboutcheating', 'cheated_message', 'not_cheated_message', 'checkbox'));\n \n // Build the tree\n \n // Define sources\n $reader->set_source_table('reader', array('id' => backup::VAR_ACTIVITYID, 'course' => backup::VAR_COURSEID));\n \n // Define id annotations\n\n // Return the root element (reader), wrapped into standard activity structure\n \n return $this->prepare_activity_structure($reader);\n }", "public function createReader(): ConfigReaderInterface\n\t{\n\t\treturn new ConfigReader();\n\t}", "public static function builder(): ReadRequestBuilder\n\t{\n\t\treturn new ReadRequestBuilder();\n\t}", "public function readXML() {\n $this->create();\n $this->checkStorageFile();\n return new \\SimpleXMLElement($this->storage_file->getContent());\n }", "public function readXml();", "function ODD_factory(XmlElement $element)\n\t{\n\t\t$name = $element->name; \n\t\t$odd = false;\n\t\t\n\t\tswitch ($name)\n\t\t{\n\t\t\tcase 'entity' : $odd = new ODDEntity(\"\",\"\",\"\"); break;\n\t\t\tcase 'metadata' : $odd = new ODDMetaData(\"\",\"\",\"\",\"\"); break;\n\t\t\tcase 'relationship' : $odd = new ODDRelationship(\"\",\"\",\"\"); break;\n\t\t}\n\t\t\n\t\t// Now populate values\n\t\tif ($odd)\n\t\t{\n\t\t\t// Attributes\n\t\t\tforeach ($element->attributes as $k => $v)\n\t\t\t\t$odd->setAttribute($k,$v);\n\t\t\t\t\n\t\t\t// Body\n\t\t\t$body = $element->content;\n\t\t\t$a = stripos($body, \"<![CDATA\");\n\t\t\t$b = strripos($body, \"]]>\");\n\t\t\tif (($body) && ($a!==false) && ($b!==false))\n\t\t\t\t$body = substr($body, $a+8, $b-($a+8));\n\t\t\t\n\t\t\t$odd->setBody($body);\n\t\t}\n\t\t\n\t\treturn $odd;\n\t}", "public function getElement() {}", "abstract public function read($n);", "private function __construct($tag,$attrib){\n $this->createTag($tag,$attrib);\n}", "public function get_element($name){\n return $this->$name;\n }", "public function readAttribute($attribute) {}", "public function __call(string $name, array $attributes) : self {\n\t\t// Instantiate a new Factory for returning\n\t\t$element = new $this($this->output);\n\t\t$element->tag = $name;\n\t\tif (empty($attributes)) {\n\t\t\treturn $element;\n\t\t}\n\t\t// If the first (and only the first) parameter is an array, those are the element's attributes\n\t\tif (is_array($attributes[0])) {\n\t\t\t// array_shift returns the first $attribute and also removes it from the array\n\t\t\t$element->attributes = array_shift($attributes);\n\t\t}\n\t\t// The rest of the parameters will be the child elements. If none, it's an empty array\n\t\t$element->children = $attributes;\n\t\treturn $element;\n\t}", "public function get_object_read()\n {\n }", "abstract protected function read(): array;", "public function createReading($name, $type)\n {\n $id = Reading::create(['name' => $name, 'type' => $type])->id;\n\n // Insert into neo4j and link to eloquent\n $cypher = \"CREATE (r:Reading { name: '\" . $name . \"', type: '\" . $type . \"', eloquentID: \". $id .\"})\";\n\n $this->client->run($cypher);\n }", "public function element( ) : \\DOMElement\n {\n $el = $this->feed->getDocument( )->createElement(\n sprintf('rawvoice:%s', $this->getTagName() ),\n $this->url\n );\n\n if ( $this->schedule ) {\n $el->setAttribute( 'schedule', $this->schedule->format( DATE_RSS ) );\n }\n if ( $this->duration ) {\n $el->setAttribute( 'duration', $this->duration );\n }\n if ( $this->type ) {\n $el->setAttribute( 'type', $this->type );\n }\n return $el;\n }", "function read()\r\n\t{\r\n\t\tglobal $ilDB;\r\n\t\t\r\n\t\tparent::read();\r\n\t\t\r\n\t\t$set = $ilDB->query(\"SELECT * FROM skl_templ_ref \".\r\n\t\t\t\" WHERE skl_node_id = \".$ilDB->quote($this->getId(), \"integer\")\r\n\t\t\t);\r\n\t\t$rec = $ilDB->fetchAssoc($set);\r\n\t\t$this->setSkillTemplateId((int) $rec[\"templ_id\"]);\r\n\t}", "public function createHumidity()\n {\n $humidity = new Reading();\n $humidity->name = \"Wilgotność\";\n $humidity->units = Uniter::humidity;\n $humidity->value = $this->lastArchive->getOutHumidity();\n return $humidity;\n }", "function Read() {\n\t\t}", "function __get($mixed) {\r\n# print \"GET: \\n\";\r\n# var_dump($mixed);\r\n switch ($mixed) {\r\n case 'attr' : return new SimpleDOMElementAttr($this->domElement); break;\r\n }\r\n\r\n return $this->domElement->$mixed;\r\n }", "function getElement($name,$label)\n {\n \treturn new T_Form_Text($name,$label);\n }", "public function getItemFactory();", "public function transformReading(&$reading)\n {\n //Create TreeReading with values\n $read = new TreeReading($reading->temperature, $reading->humidity, $reading->wind_speed, $reading->cloudiness, $reading->day,\n false, false, false, false);\n\n //Fetch conditions from DB, and then set boolen TreeReading values according to the condition\n $condition = DB::table('weather_conditions')->where('id', '=', $reading->condition_id)->first();\n $values = $this->condition_values[$condition->condition];\n $read->clear = $values[0];\n $read->clouds = $values[1];\n $read->rain = $values[2];\n $read->snow = $values[3];\n\n return $read;\n }", "public static function newElement($elementType, $options = array()){\n \t\t$elementClassName = 'htmlElement_' . $elementType;\n \t\t$widgetClassName = 'htmlWidget_' . $elementType;\n\t\t$elementDir = sysConfig::getDirFsCatalog() . 'includes/classes/html/elements/';\n\t\t$widgetDir = sysConfig::getDirFsCatalog() . 'includes/classes/html/widgets/';\n\n \t\tif (file_exists($elementDir . $elementType . '.php')){\n \t \t\tif (!class_exists($elementClassName, false)){\n \t \t\t\trequire($elementDir . $elementType . '.php');\n\t \t\t}\n\t \t\t$element = new $elementClassName($options);\n \t\t}elseif (file_exists($widgetDir . $elementType . '.php')){\n \t \t\tif (!class_exists($widgetClassName, false)){\n \t \t\t\trequire($widgetDir . $elementType . '.php');\n\t \t\t}\n\t \t\t$element = new $widgetClassName($options);\n \t\t}else{\n \t\t\t$element = new htmlElement($elementType);\n \t\t}\n\t\treturn $element->startChain();\n \t}", "abstract protected function createRootElement();", "function element(): AbstractElement\r\n {\r\n }", "public function &create_textinput()\n {\n $obj = new happy_linux_rss_parse_textinput();\n return $obj;\n }", "public function getReader($class);", "abstract protected function getSubElement($element);", "function read_form($fields_to_read = null)\n\t{\n\t\t$h = parent::read_form($fields_to_read);\n\n\t\treturn $h;\n\t}", "function read_form($fields_to_read = null)\n\t{\n\t\t$h = parent::read_form($fields_to_read);\n\n\t\treturn $h;\n\t}", "abstract protected function create();", "public static function openRead($file) {\r\n return new static($file, 'r');\r\n }", "function read_form($fields_to_read = null)\n {\n $h = parent::read_form($fields_to_read);\n\n return $h;\n }", "protected function createElement($id) {\n return new Element($this->executor, $id);\n }", "function elemreader($elml) {\n $elements = [];\n $renderelement = new Renderelement();\n $array = explode(\"\\n\", $elml);\n for ($i = 0; $i < count($array); $i++) {\n if (mb_substr($array[$i], 0, 1) == \" \" || mb_substr($array[$i], 0, 1) == \"\\t\") {\n $renderelement->set_content($renderelement->get_content().$array[$i]);\n } else {\n if ($renderelement->get_name() != \"\" && $renderelement->get_content() != \"\") {\n array_push($elements, $renderelement);\n $renderelement = new renderelement();\n }\n $index = strpos($array[$i],\":\"); // Gets the first index where a colon occours\n if ($index == false) {\n echo \"Missing seperator or wrong intent in elml file on line \".$i;\n } else {\n $renderelement->set_name(mb_substr($array[$i], 0, $index)); // Gets the first part (name)\n $renderelement->set_content(mb_substr($array[$i], $index + 1)); // Gets the text part (content)\n }\n }\n }\n if ($renderelement->get_name() != \"\" && $renderelement->get_content() != \"\") {\n array_push($elements, $renderelement);\n $renderelement = new renderelement();\n }\n echo \"<br />Test<br />\";\n print_r($elements); //TODO: remove test output\n return $elements;\n}", "public function readDOM ( ) {\n\n return dom_import_simplexml($this);\n }", "function getRead(){\n\t}", "protected function _getElement($type = 'checkbox', array $data = [], array $formData = [])\n {\n $element = $this->elementFactory\n ->create($type, ['data' => $data])\n ->setForm($this->_getFormMock($formData));\n return $element;\n }", "public function get_element($name)\n {\n return $this->$name;\n }", "public function testInstance()\n {\n $file = $this->getFileInstance('popup.csv');\n $this->assertTrue($file instanceof ReadInterface);\n }", "public function getElement();", "private function readRecipe(): callable\n {\n return function (BaseRecipeInterface $recipe): ChefInterface {\n /**\n * @var Chef $this\n */\n $this->recipe = $recipe->train($this);\n\n $this->updateStates();\n\n return $this;\n };\n }", "public static function create () {\n return self::load();\n }", "public function __construct( $element_name ) {\n\t\t$this->_element_name = $element_name;\n\t}", "abstract public static function create();", "public function getElement ($position) {\n\n if ($this->data[$position]) {\n\n if (class_exists('RKW\\\\RkwSearch\\\\TreeTagger\\\\TreeTaggerRecord'))\n if (! $this->data[$position] instanceof \\RKW\\RkwSearch\\TreeTagger\\TreeTaggerRecord)\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('RKW\\\\RkwSearch\\\\TreeTagger\\\\TreeTaggerRecord', $this->data[$position]);\n //===\n }\n\n return parent::getElement($position);\n //===\n }", "abstract function newParser():XMLClassParser;", "public function setRead($read)\n {\n $this->read = $read;\n\n return $this;\n }", "public function it_construct_via_factory_method($writer, $reader)\n {\n $this->beConstructedThrough('create', [$writer, $reader]);\n\n $reader->getMarkdown('Hi, there!')->willReturn('<p>Hi, there!</p>')->shouldBeCalled();\n $this->toHtmlFromReader('Hi, there!')->shouldReturn('<p>Hi, there!</p>');\n\n // spy\n $reader->getMarkdown('Hi, there!')->shouldHaveBeenCalled();\n }", "protected function read(\\XMLReader $r, $name)\n\t{\n\t\t$names = is_array($name)\n\t\t\t? $name\n\t\t\t: array($name);\n\n\t\tdo\n\t\t{\n\t\t\t$read = $r->read();\n\t\t\t$nt = $r->nodeType;\n\t\t\t$nn = $r->name;\n\n\t\t}\n\t\twhile($read && !(in_array($nn, $names) && ($nt === \\XMLReader::ELEMENT)));\n\n\t\tif (!$read)\n\t\t{\n\t\t\tthrow new \\RuntimeException(sprintf('Can not read any of elements \"%s\".', implode(',', $names)));\n\t\t}\n\t}", "public function createTag()\n {\n $class = $this->getClass();\n $tag = new $class();\n \n return $tag;\n }", "public function read() { return; }", "function create(string $name): Tag;", "public function __construct($name, $reader) {\n $this->name= $name;\n $this->reader= $reader;\n }" ]
[ "0.5836232", "0.56532896", "0.56532896", "0.56532896", "0.5602231", "0.55801076", "0.55612063", "0.5489677", "0.54336023", "0.5401356", "0.53767824", "0.5350216", "0.53387654", "0.53387654", "0.5312346", "0.5304161", "0.52978027", "0.52964044", "0.5291961", "0.52696383", "0.5257774", "0.5255664", "0.5248697", "0.5226778", "0.51993525", "0.5181717", "0.51620424", "0.51522386", "0.5125818", "0.5125818", "0.5125818", "0.5125818", "0.5125818", "0.5125818", "0.5125818", "0.5125818", "0.5125818", "0.5125818", "0.5125818", "0.51221764", "0.5085996", "0.50813955", "0.50787055", "0.50746864", "0.5068284", "0.50665784", "0.5064858", "0.5061193", "0.50542396", "0.5035242", "0.5006381", "0.49983597", "0.4991658", "0.4977244", "0.49768537", "0.49602175", "0.49369442", "0.49161577", "0.4912098", "0.4911734", "0.49032548", "0.4880684", "0.48690814", "0.48648483", "0.48594287", "0.48585016", "0.4858493", "0.485501", "0.48385605", "0.4831423", "0.48225203", "0.4818085", "0.4817388", "0.4804421", "0.4804421", "0.47868082", "0.47723156", "0.47699928", "0.47690308", "0.4767137", "0.47613782", "0.47575697", "0.47541398", "0.4748029", "0.47380838", "0.47330287", "0.47249112", "0.4724439", "0.47220263", "0.47198072", "0.47172442", "0.47158673", "0.47123265", "0.47104934", "0.4710458", "0.47102773", "0.4709651", "0.47017986", "0.46949986" ]
0.7164047
0
Factory method for creating a kanji element.
Фабричный метод для создания элемента канижи.
protected function new_kanji() { return new JMDictKanjiElement(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function kanji() {\n\t\t$this->filter('kanji');\n\t}", "function ciniki_writingcatalog_maps($ciniki) {\n\n $maps = array();\n $maps['item'] = array(\n 'typecode'=>array(\n ''=>'unknown',\n '0'=>'unknown',\n '30'=>'book',\n '31'=>'shortstory',\n '32'=>'article',\n ),\n 'typepermalinks'=>array(\n '30'=>'books',\n '31'=>'shortstories',\n '32'=>'articles',\n ), \n 'type'=>array(\n '30'=>'Book',\n '40'=>'Short Story',\n '50'=>'Articles',\n '60'=>'Poetry',\n ),\n );\n \n return array('stat'=>'ok', 'maps'=>$maps);\n}", "public function randomKanji() {\n\t\t$this->request->getSession()->unsetAttribute('answer');\n\t\t$limit = 1;\n\t\t$this->generateView(array(\n\t\t\t'question' => $this->kanjiQCM->getRandomQCM($limit)\n\t\t));\n\t}", "function CreateNode(){\n // so we can put alias on the labell\n}", "protected function new_sense()\n {\n return new JMDictSenseElement();\n }", "protected function new_sense()\n {\n return new JMDictSenseElement();\n }", "public function newElement();", "public function createTag();", "public function makeShortcutButton() {}", "function isKanji($str) {\r\n return preg_match('/[\\x{4E00}-\\x{9FBF}]/u', $str) > 0;\r\n}", "function mapNilaiKomponen() {\n\t\t\treturn array('Pelatihan' => 'nilaiperusahaan', 'Proses' => 'nilaipembimbing', 'Laporan' => 'nilaipenguji');\n\t\t}", "function create_element( $name ){\n return new xNode( $name,XNODE_TYPE_ELEM, $this ); \n }", "function i($code)\n{\n $icon = '<i class=\"fa fa-' . $code . ' \" ></i>';\n return $icon;\n}", "public function get_kanjis(string $entry_uids_flat, int $version_id, int $fetch_style, string $order_by, array $fields);", "public function lblTestBit_Create($strControlId = null) {\n\t\t\t$this->lblTestBit = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblTestBit->Name = QApplication::Translate('Test Bit');\n\t\t\t$this->lblTestBit->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->lblTestBit->LinkedNode = QQN::TypeTest()->TestBit;\n\t\t\t$this->lblTestBit->Text = $this->objTypeTest->TestBit ? QApplication::Translate('Yes') : QApplication::Translate('No');\n\t\t\treturn $this->lblTestBit;\n\t\t}", "protected function nodeStub() {\n $node = (object) ['type' => 'petition', 'title' => $this->publicTitle];\n $lang = field_language('node', $node, 'field_admin_title');\n $node->field_admin_title[$lang][0]['value'] = $this->adminTitle;\n $node->field_admin_title[$lang][0]['safe_value'] = check_plain($this->adminTitle);\n return $node;\n }", "protected function createTrueTypeFontTestImage() {}", "function atkNode($type, $flags=0)\n {\n atkdebug(\"Creating a new atkNode for $type\");\n $this->m_type = $type;\n $this->m_flags = $flags;\n }", "public function icon()\n\t{\n\t\t$input = [\n\t\t\t[icon('plane'), \"icon('plane');\", ],\n\t\t\t[icon('bolt'), \"icon('bolt');\", ],\n\t\t\t[icon('bolt', '#FF00FF'), \"icon('bolt', '#FF00FF');\", ],\n\t\t\t[icon('info', 'info'), \"icon('info', 'info');\", ],\n\t\t\t[icon(true), \"icon(true);\", ],\n\t\t\t[icon(false), \"icon(false);\", ],\n\t\t];\n\t\t$data = array_reduce($input, function ($output, $arr)\n\t\t{\n\t\t\t$output[] = (object) ['code' => $arr[1], 'icon' => $arr[0]];\n\t\t\treturn $output;\n\t\t}, []);\n\t\treturn view('sketchpad::help/helpers/icon', compact('data'));\n\t}", "public static function factory($title, $url, $identifier, $icon = null, BreadcrumbNode $parentNode = null)\n {\n // Create new node\n $node = new static($title, $url, $identifier, $icon, $parentNode);\n\n return $node;\n }", "public function lblGroupTypeBitmap_Create($strControlId = null, $strFormat = null) {\n\t\t\t$this->lblGroupTypeBitmap = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblGroupTypeBitmap->Name = QApplication::Translate('Group Type Bitmap');\n\t\t\t$this->lblGroupTypeBitmap->Text = $this->objMinistry->GroupTypeBitmap;\n\t\t\t$this->lblGroupTypeBitmap->Format = $strFormat;\n\t\t\treturn $this->lblGroupTypeBitmap;\n\t\t}", "public function icon (\\stdClass $param = NULL)\n {\n return new Text(sprintf('<i class=\"icon-%s\"></i>', $param->type));\n }", "public function factory(): Kerl\n {\n return new Kerl($this->keccak384);\n }", "public function create()\n\t{\n\t\treturn view('accessoryTypes.create');\n\t}", "public function lblExampleCode_Create($strControlId = null) {\n\t\t\t$this->lblExampleCode = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblExampleCode->Name = QApplication::Translate('Example Code');\n\t\t\t$this->lblExampleCode->Text = $this->objIssue->ExampleCode;\n\t\t\treturn $this->lblExampleCode;\n\t\t}", "function makedefaultviewcode($locatie)\n{\n\tglobal $aantalcategories;\n\n $view = str_repeat('0', $aantalcategories);\n\t$view[$locatie] = '1';\n return $view;\n}", "public function lblTestInt_Create($strControlId = null) {\n\t\t\t$this->lblTestInt = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblTestInt->Name = QApplication::Translate('Test Int');\n\t\t\t$this->lblTestInt->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->lblTestInt->LinkedNode = QQN::TypeTest()->TestInt;\n\t\t\t$this->lblTestInt->Text = $this->objTypeTest->TestInt;\n\t\t\treturn $this->lblTestInt;\n\t\t}", "function creaMenukeyboard() {\r\n\t$replyMarkup = array('keyboard' => array(array(array('text' => '/preferiti'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t array('text' => '/posizione',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'request_location' => true))),\r\n\t\t\t\t\t\t 'resize_keyboard' => true,\r\n\t\t\t\t\t\t 'one_time_keyboard' => false\r\n\t\t\t\t\t);\r\n\r\n\t// codifica l'array in formato json\r\n\treturn json_encode($replyMarkup);\r\n}", "public static function &alt_namespace_factory()\n\t{\n\t\t\n\t\t\treturn new Interface_node();\n\n\t\t\n\t}", "public function lblIssueResolutionTypeId_Create($strControlId = null) {\n\t\t\t$this->lblIssueResolutionTypeId = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblIssueResolutionTypeId->Name = QApplication::Translate('Issue Resolution Type');\n\t\t\t$this->lblIssueResolutionTypeId->Text = ($this->objIssue->IssueResolutionTypeId) ? IssueResolutionType::$NameArray[$this->objIssue->IssueResolutionTypeId] : null;\n\t\t\treturn $this->lblIssueResolutionTypeId;\n\t\t}", "public function createCategoryInstance();", "public function setImei($val)\n {\n $this->_propDict[\"imei\"] = $val;\n return $this;\n }", "protected function new_entry()\n {\n return new JMDictEntry();\n }", "protected function new_entry()\n {\n return new JMDictEntry();\n }", "public static function new(): self\n {\n return Wei::getContainer()->getBy(static::class);\n }", "public function lblSignupFormTypeBitmap_Create($strControlId = null, $strFormat = null) {\n\t\t\t$this->lblSignupFormTypeBitmap = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblSignupFormTypeBitmap->Name = QApplication::Translate('Signup Form Type Bitmap');\n\t\t\t$this->lblSignupFormTypeBitmap->Text = $this->objMinistry->SignupFormTypeBitmap;\n\t\t\t$this->lblSignupFormTypeBitmap->Format = $strFormat;\n\t\t\treturn $this->lblSignupFormTypeBitmap;\n\t\t}", "public function buildCodePane(): SyntaxHighlightingPane {\n $codePane = new SyntaxHighlightingPane();\n $icon = FileIcons::instance()->iconFor('php')->addCssClass('fa-fw');\n $codePane->setPaneTitle($icon . ' ' . $this->titles[self::EXAMPLECODE]);\n $codePane->loadFromFile($this->path);\n $codePane->addCssClass('code');\n return $codePane;\n }", "public function lblType_Create($strControlId = null, $strFormat = null) {\n\t\t\t$this->lblType = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblType->Name = QApplication::Translate('Type');\n\t\t\t$this->lblType->Text = $this->objMessage->Type;\n\t\t\t$this->lblType->Required = true;\n\t\t\t$this->lblType->Format = $strFormat;\n\t\t\treturn $this->lblType;\n\t\t}", "function createField($keyName, $uitype, $value, $name, $addToMap = false, $inCallback = null, $outCallback = null){\r\n\t\t$fieldClass = FromUITypesHandlersClass::getClass($uitype);\r\n\t\t$field = new $fieldClass([\r\n\t\t\t'key' => $keyName,\r\n\t\t\t'type' => $uitype,\r\n\t\t\t'value' => $value,\r\n\t\t\t'title' => $name\r\n\t\t], $this->parentForm);\r\n\t\t$field->setCallBacks($inCallback, $outCallback);\r\n\t\tif($addToMap){\r\n\t\t\treturn $this->addFieldToForm($field);\r\n\t\t}\r\n\t\treturn $field;\r\n\t}", "static public function createBit($key, $group = 'default') {\n return Zend_Bitfield::$bitClass[$group]->createBit($key);\n }", "public function createElement($name) {\n return new $this->nodeType($name);\n }", "private function buildFurigana($kanji, $furigana)\n {\n return $this->tags['kanji_furigana_wrapper']['open'].\n $this->tags['kanji_wrapper']['open'].\n $kanji.\n $this->tags['kanji_wrapper']['close'].\n $this->tags['furigana_wrapper']['open'].\n $furigana.\n $this->tags['furigana_wrapper']['close'].\n $this->tags['kanji_furigana_wrapper']['close'];\n }", "public function create()\n\t{\n\t\treturn view('imagelabels.create');\n\t}", "public function create()\n {\n return view('admin.faicons.create');\n }", "public function newInstance();", "public function newInstance();", "public function generate()\n {\n $name = substr($this->kind, strlen(static::getPrefix()));\n\n return $this->factory($name);\n }", "public function icon();", "static function init()\n {\n // define html-like shortcodes\n foreach (self::$HTML_TAGS as $tag) {\n self::$_shortcodes[$tag] = [\n 'handler' => ['Wydra', 'do_tag'],\n 'depth' => self::$HTML_TAGS_DEPTH,\n ];\n }\n\n // define data-related shortcodes\n self::$_shortcodes['define'] = [\n 'handler' => ['Wydra', 'define_data'],\n ];\n\n // define shortcodes from template files\n $available_shortcodes = self::scan_templates();\n foreach ($available_shortcodes as $shortcode) {\n self::$_shortcodes[$shortcode['name']] = [\n 'handler' => ['Wydra', 'do_shortcode'],\n 'template' => $shortcode['file'],\n ];\n }\n\n $prefix_list = [\n Wydra\\SHORTCODE_PREFIX_CORE,\n Wydra\\SHORTCODE_PREFIX,\n ];\n // register shortcodes and aliases\n foreach (self::$_shortcodes as $code => $params) {\n foreach ($prefix_list as $prefix) {\n $shortcode_name = $prefix . $code;\n self::$_shortcode_alias[$shortcode_name] = $code;\n add_shortcode($shortcode_name, $params['handler']);\n }\n\n if (!empty($params['depth'])) {\n $depth = min(max((int)$params['depth'], 1), self::$HTML_TAGS_DEPTH);\n // register depth suffixes, like wydra-div-0, w-tag-3\n for ($i = 0; $i <= $depth; $i++) {\n foreach ($prefix_list as $prefix) {\n $shortcode_name = $prefix . $code . '-' . $i;\n self::$_shortcode_alias[$shortcode_name] = $code;\n add_shortcode($shortcode_name, $params['handler']);\n }\n };\n }\n }\n\n // register post type\n self::register_yaml_post_type();\n add_action('admin_menu', function () {\n // add management page with list of registered wydra shortcodes\n add_submenu_page('tools.php',\n __('Wydra shortcodes', 'wydra'),\n __('Wydra shortcodes', 'wydra'),\n 'edit_posts',\n 'wydra_shortcodes',\n 'wydra_wpadmin_shortcodes'\n );\n });\n }", "abstract public static function create();", "abstract function make($flag_int);", "function emojii()\n\t{\n\t return view('admin.emojii');\n\t}", "public function lblIssuePriorityTypeId_Create($strControlId = null) {\n\t\t\t$this->lblIssuePriorityTypeId = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblIssuePriorityTypeId->Name = QApplication::Translate('Issue Priority Type');\n\t\t\t$this->lblIssuePriorityTypeId->Text = ($this->objIssue->IssuePriorityTypeId) ? IssuePriorityType::$NameArray[$this->objIssue->IssuePriorityTypeId] : null;\n\t\t\t$this->lblIssuePriorityTypeId->Required = true;\n\t\t\treturn $this->lblIssuePriorityTypeId;\n\t\t}", "protected function createIndexDefinitionItem() : AST\\CreateIndexDefinitionItem {}", "public static function create();", "public static function create();", "public static function create();", "public static function create();", "public static function create();", "public static function create();", "protected function createLabel($label)\n {\n if (!is_string($label)) {\n throw new InvalidArgumentException(\n \"Provided label is not a string or an ElementInterface \".\n \"interface object.\"\n );\n }\n\n $element = class_exists($label)\n ? $this->createLabelFromClass($label)\n : new Label('', $label);\n\n return $element;\n }", "public function create()\n {\n $postTypeIcon = new PostTypeIcon();\n $iconLists = $postTypeIcon->iconList();\n return view('admin.post_type.create', compact('iconLists'));\n }", "public function LabelType()\n{\n$sim['res'][0]=['base'=>'ShortTokenType'];\n$sim['res'][0]['mil'][0]=['1'];\nreturn $sim;\n}", "function create($keycode) {\n\t\tglobal $dbConn;\n\t\t//Parse the keycode\n\t\t$keycode = str_replace('\"','\"\"',$keycode);\n\t\t\n\t\t//Check for duplicates\n\t\t$exists = $dbConn->rows($dbConn->query('SELECT id FROM `keys` WHERE `key`=\"'.$keycode.'\" LIMIT 1'));\n\t\tif ($exists !== 0) return false;\n\t\t\n\t\t//Doesn't exist, continue\n\t\t$dbConn->query('INSERT INTO `keys` (`key`) VALUES (\"'.$keycode.'\")');\n\t\treturn new KeyCode($dbConn->insert_id());\n\t}", "function lic_genimg_code ($index) {\n // Codes are for historical reasons (placement of icons in font)\n // \"-\" will never be used, it's to make this a simple index lookup\n $LIC_GENIMG_CODES = ['-', 'bna', 'bn', 'bnd', 'b', 'ba', 'bd', '0'];\n return $LIC_GENIMG_CODES[$index];\n}", "function __tstb_khaki_icon() {\n\n\t\treturn plugins_url( 'thesis-toolbar/images/icon-thesis-khaki.png', dirname( __FILE__ ) );\n\t}", "function CreateLabel($text)\n\t{\n\t\treturn new Label($text,$this->id);\n\t}", "public function __construct() {\n \tparent::__construct(self::TRANSLATION_NAME, self::ICON);\n }", "public function createTag()\n {\n $class = $this->getClass();\n $tag = new $class();\n \n return $tag;\n }", "protected function createMenu() {\n $this->setName( 'short_code' );\n $this->setLabel( Translate::translate( 'Short codes' ) );\n $this->setIcon( 'font-awesome:fa-css3' );\n\n $button = new Section( 'button' );\n $button->setLabel( Translate::translate( 'Button' ) );\n\n $color = new Color( 'button_color' );\n $color->setLabel( Translate::translate( 'Custom color' ) );\n $color->setDefault( get_theme_mod( 'brand-primary' ) );\n\n $button->addControl( $color );\n $this->addControl( $button );\n\n $flip_box = new Section( 'flipbox' );\n $flip_box->setLabel( Translate::translate( 'Flip box' ) );\n\n $front_title = new Color( 'flipbox_front_title_color' );\n $front_title->setLabel( Translate::translate( 'Front Side Title Text Color' ) );\n $front_title->setDefault( get_theme_mod( 'brand-primary' ) );\n $flip_box->addControl( $front_title );\n\n $front_description = new Color( 'flipbox_front_description_color' );\n $front_description->setLabel( Translate::translate( 'Front Side Description Text Color' ) );\n $front_description->setDefault( get_theme_mod( 'brand-primary' ) );\n $flip_box->addControl( $front_description );\n\n $back_title = new Color( 'flipbox_back_title_color' );\n $back_title->setLabel( Translate::translate( 'Back Side Title Text Color' ) );\n $back_title->setDefault( get_theme_mod( 'brand-primary' ) );\n $flip_box->addControl( $back_title );\n\n $back_description = new Color( 'flipbox_back_description_color' );\n $back_description->setLabel( Translate::translate( 'Back Side Description Text Color' ) );\n $back_description->setDefault( get_theme_mod( 'brand-primary' ) );\n $flip_box->addControl( $back_description );\n\n $this->addControl( $flip_box );\n\n $pie_charts = new Section( 'piecharts' );\n $pie_charts->setLabel( Translate::translate( 'Pie charts' ) );\n\n $pie_charts_color = new Color( 'piecharts_color' );\n $pie_charts_color->setLabel( Translate::translate( 'Chart Color' ) );\n $pie_charts_color->setDefault( get_theme_mod( 'brand-primary' ) );\n $pie_charts->addControl( $pie_charts_color );\n $this->addControl( $pie_charts );\n\n $progressbar = new Section( 'progressbar' );\n $progressbar->setLabel( Translate::translate( 'Progress bar' ) );\n\n $progressbar_color = new Color( 'progressbar_color' );\n $progressbar_color->setLabel( Translate::translate( 'Chart Color' ) );\n $progressbar_color->setDefault( get_theme_mod( 'brand-primary' ) );\n $progressbar->addControl( $progressbar_color );\n $this->addControl( $progressbar );\n\n $separator = new Section( 'separator' );\n $separator->setLabel( Translate::translate( 'Separator' ) );\n\n $separator_color = new Color( 'separator_color' );\n $separator_color->setLabel( Translate::translate( 'Separator color' ) );\n $separator_color->setDefault( get_theme_mod( 'brand-primary' ) );\n $separator->addControl( $separator_color );\n\n $this->addControl( $separator );\n\n $counter = new Section( 'counter' );\n $counter->setLabel( Translate::translate( 'Counter' ) );\n\n $label_color = new Color( 'counter_label_color' );\n $label_color->setLabel( Translate::translate( 'Separator color' ) );\n $label_color->setDefault( get_theme_mod( 'brand-primary' ) );\n $counter->addControl( $label_color );\n\n $border_color = new Color( 'counter_border_color' );\n $border_color->setLabel( Translate::translate( 'Border color' ) );\n $border_color->setDefault( get_theme_mod( 'brand-primary' ) );\n $counter->addControl( $border_color );\n\n $background_color = new Color( 'counter_background_color' );\n $background_color->setLabel( Translate::translate( 'Background color' ) );\n $background_color->setDefault( get_theme_mod( 'brand-primary' ) );\n $counter->addControl( $background_color );\n $this->addControl( $counter );\n }", "function getModule_nicEdit()\n{\n\treturn new NicEdit();\n}", "public function newAction($id=null, $dataname=\"ZaikoHenkanKbns\")\n {\n $this->view->imax = 0;\n\n if ($id) {\n $nameDts = $dataname;\n $zaiko_henkan_kbn = $nameDts::findFirstByid($id);\n if (!$zaiko_henkan_kbn) {\n $this->flash->error(\"在庫変換区分が見つからなくなりました。\");\n\n $this->dispatcher->forward(array(\n 'controller' => \"zaiko_henkan_kbns\",\n 'action' => 'index'\n ));\n\n return;\n }\n $this->_setDefault($zaiko_henkan_kbn, \"new\", $dataname);\n $this->tag->setDefault(\"id\", null);\n $this->tag->setDefault(\"cd\", null);\n }\n\n }", "protected function createPageElement($pageNumber) {\n\t\treturn [\n\t\t\t'number' => $pageNumber,\n\t\t\t'label' => isset($this->pageLabelMap[$pageNumber])\n\t\t\t\t? $this->pageLabelMap[$pageNumber]\n\t\t\t\t: $pageNumber\n\t\t];\n\t}", "public function __construct() {\n\t\t\tparent::__construct(\n\t\t\t\tfalse,\n\t\t\t\tesc_html__( 'QT: Icon Box', 'the-landscaper-wp' ),\n\t\t\t\tarray(\n\t\t\t\t\t'description' => esc_html__( 'Custom text with a Icon', 'the-landscaper-wp' ),\n\t\t\t\t\t'classname' => 'widget-icon-box',\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function __construct() {\n\t\t\t$this->name = 'fa_icon';\n\t\t\t$this->label = __( 'Font-Awesome Icon Picker' );\n\t\t\t$this->category = __( 'Basic' );\n\t\t\t$this->defaults = array(\n\n\t\t\t);\n\n\t\t\tparent::__construct();\n\t\t}", "public function txtGroupTypeBitmap_Create($strControlId = null) {\n\t\t\t$this->txtGroupTypeBitmap = new QIntegerTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtGroupTypeBitmap->Name = QApplication::Translate('Group Type Bitmap');\n\t\t\t$this->txtGroupTypeBitmap->Text = $this->objMinistry->GroupTypeBitmap;\n\t\t\treturn $this->txtGroupTypeBitmap;\n\t\t}", "function dawn_build_labels( $type )\n{\n $labels = array( 'name' => $type['plural'],\n 'singular_name' => $type['single'],\n 'menu_name' => $type['plural'],\n 'add_new' => \"Add New \" . $type['single'],\n 'edit_item' => \"Edit \" . $type['single'],\n 'all_items' => \"All \" . $type['plural'],\n 'new_item' => \"New \" . $type['single'],\n 'view_item' => \"View \" . $type['single'],\n 'search_items' => \"Search \" . $type['plural'] );\n return $labels;\n}", "public function icons(): static;", "public static function create($mapping);", "public function lblUrk_Create($strControlId = null) {\n\t\t\t$this->lblUrk = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblUrk->Name = QApplication::Translate('Urk');\n\t\t\t$this->lblUrk->Text = $this->objRooms->Urk;\n\t\t\t$this->lblUrk->Required = true;\n\t\t\treturn $this->lblUrk;\n\t\t}", "public static function _register()\n {\n self::assignElements([\n 'DescriptionTemplate' => ['type' => 'DescriptionTemplateType', 'xmlns' => self::XMLNS, 'cardinality' => '0..*'],\n 'LayoutTotal' => ['type' => 'int'],\n 'ObsoleteLayoutID' => ['type' => 'int', 'cardinality' => '0..*'],\n 'ObsoleteThemeID' => ['type' => 'int', 'cardinality' => '0..*'],\n 'ThemeGroup' => ['type' => 'ThemeGroupType', 'xmlns' => self::XMLNS, 'cardinality' => '0..*'],\n 'ThemeTotal' => ['type' => 'int']\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "public function createAction()\n {\n if ($this->request->isPost()) {\n\n $npfLookuptypes = new NpfLookupTypes();\n $lookuptypeid = $this->request->getPost('lookuptype_id', 'int');\n $npfLookuptypes->assign(array(\n 'name' => $this->request->getPost('name', 'striptags'),\n 'description' => $this->request->getPost('description', 'striptags'),\n 'lookuptype_id' => $lookuptypeid?$lookuptypeid:0,\n 'is_common' => $this->request->getPost('is_common', 'int'),\n 'active' => 1,\n ));\n\n if (!$npfLookuptypes->save()) {\n $this->flash->error($npfLookuptypes->getMessages());\n } else {\n\n $this->flash->success(\"Lookup Types was created successfully\");\n\n Tag::resetInput();\n }\n }\n\n $this->view->form = new NpfLookupTypesForm(null);\n }", "public function __construct($keyType, $valueType) {}", "final public function get_icon() {\n return new \\pix_icon('icon', $this->get_name(), $this->component, array('class' => 'icon'));\n }", "public function createItemDefinitionInstance();", "public function create()\n {\n return view('admin.kitchens.create');\n }", "public function create()\n {\n return view('cell_member_mappings.create');\n }", "function create(string $name): Tag;", "private function initializeWidgetIdentifier() {}", "abstract protected function createRootElement();", "function icon ($icon = null);", "public static function instantiate($tag,$attrib){\n return new self($tag,$attrib);\n}", "public function create()\n {\n return view('keyboards.create');\n }", "public function setXianshiTitle($xianshi_title)\n {\n $this->xianshi_title = $xianshi_title;\n\n return $this;\n }", "function _getShowElement($literal, $accesskey = '', $tabindex = 0)\n\t{\n\t\t$link = $literal;\n\t\t//$link->set_tag_attribute('accesskey',$accesskey);\n\t\t//$link->set_tag_attribute('tabindex', $tabindex);\n\t\t$elem = html_td(\"\", \"\", $link);\n\t\t$elem = html_td(\"colorMedium-bg\", \"\", $link);\n\t\t$elem->set_id(\"cell-sitename\");\n\t\t$elem->set_tag_attribute(\"target\",\"_blank\");\n\n\t\treturn $elem;\n\t}", "protected function _constructInt($int) { }", "public function create()\n {\n return view('master.tools.kaki.kaki_create');\n }", "public static function create($key)\n {\n $instance = new static;\n $instance->key = $key;\n\n $instance->headingLabel = \"\";\n $instance->size = 2;\n $instance->sortable = false;\n\n return $instance;\n }", "public function frontend_element_items()\n {\n\t\t$this->items = array(\n\t\t\t'action' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'btn_convert',\n\t\t\t\t\t'type' => 'button_group',\n\t\t\t\t\t'bound' => 0,\n\t\t\t\t\t'actions' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'std' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_ACTION_TAB' ),\n\t\t\t\t\t\t\t'action_type' => 'convert',\n\t\t\t\t\t\t\t'action' => 'list_to_tab',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'std' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_ACTION_ACCORDION' ),\n\t\t\t\t\t\t\t'action_type' => 'convert',\n\t\t\t\t\t\t\t'action' => 'list_to_accordion',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'std' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_ACTION_CAROUSEL' ),\n\t\t\t\t\t\t\t'action_type' => 'convert',\n\t\t\t\t\t\t\t'action' => 'list_to_carousel',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'content' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_ELEMENT_TITLE' ),\n\t\t\t\t\t'id' => 'el_title',\n\t\t\t\t\t'type' => 'text_field',\n\t\t\t\t\t'class' => 'jsn-input-xxlarge-fluid',\n\t\t\t\t\t'std' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_ELEMENT_TITLE_STD' ),\n\t\t\t\t\t'role' => 'title',\n\t\t\t\t\t'tooltip' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_ELEMENT_TITLE_DES' )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'list_items',\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_ITEMS' ),\n\t\t\t\t\t'type' => 'group',\n\t\t\t\t\t'shortcode' => $this->config['shortcode'],\n\t\t\t\t\t'sub_item_type' => $this->config['has_subshortcode'],\n\t\t\t\t\t'sub_items' => array(\n\t\t\t\t\t\tarray( 'std' => '' ),\n\t\t\t\t\t\tarray( 'std' => '' ),\n\t\t\t\t\t),\n\t\t\t\t\t'label_item' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_ITEMS_LABEL' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'styling' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'preview',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_SHOW_ICON' ),\n\t\t\t\t\t'id' => 'show_icon',\n\t\t\t\t\t'type' => 'radio',\n\t\t\t\t\t'std' => 'yes',\n\t\t\t\t\t'options' => array( 'yes' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_YES' ), 'no' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_NO' ) ),\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_SHOW_ICON_DES' ),\n\t\t\t\t\t'has_depend' => '1',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_ICON_POSITION' ),\n\t\t\t\t\t'id' => 'icon_position',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'class' => 'input-small',\n\t\t\t\t\t'std' => JSNPagebuilderHelpersType::getFirstOption( JSNPagebuilderHelpersType::getIconPosition() ),\n\t\t\t\t\t'options' => JSNPagebuilderHelpersType::getIconPosition(),\n\t\t\t\t\t'tooltip' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_ICON_POSITION_DES' ),\n\t\t\t\t\t'dependency' => array( 'show_icon', '=', 'yes' )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_ICON_BACKGROUND' ),\n\t\t\t\t\t'type' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'icon_size_value',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'class' => 'input-mini',\n\t\t\t\t\t\t\t'std' => '32',\n\t\t\t\t\t\t\t'options' => JSNPagebuilderHelpersType::getIconSizes(),\n\t\t\t\t\t\t\t'parent_class' => 'combo-item input-append',\n\t\t\t\t\t\t\t'append_text' => 'px',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'icon_background_type',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'class' => 'input-small',\n\t\t\t\t\t\t\t'std' => 'circle',\n\t\t\t\t\t\t\t'options' => JSNPagebuilderHelpersType::getIconBackground(),\n\t\t\t\t\t\t\t'parent_class' => 'combo-item',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'icon_background_color',\n\t\t\t\t\t\t\t'type' => 'color_picker',\n\t\t\t\t\t\t\t'std' => '#0088CC',\n\t\t\t\t\t\t\t'parent_class' => 'combo-item',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'tooltip' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_ICON_BACKGROUND_DES' ),\n\t\t\t\t\t'container_class' => 'combo-group',\n\t\t\t\t\t'dependency' => array( 'show_icon', '=', 'yes' )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_ICON_COLOR' ),\n\t\t\t\t\t'type' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'icon_c_value',\n\t\t\t\t\t\t\t'type' => 'text_field',\n\t\t\t\t\t\t\t'class' => 'input-small',\n\t\t\t\t\t\t\t'std' => '#FFFFFF',\n\t\t\t\t\t\t\t'parent_class' => 'combo-item',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'icon_c_color',\n\t\t\t\t\t\t\t'type' => 'color_picker',\n\t\t\t\t\t\t\t'std' => '#ffffff',\n\t\t\t\t\t\t\t'parent_class' => 'combo-item',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'tooltip' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_ICON_COLOR_DES' ),\n\t\t\t\t\t'container_class' => 'combo-group',\n\t\t\t\t\t'dependency' => array( 'show_icon', '=', 'yes' )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'hr',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_SHOW_HEADING' ),\n\t\t\t\t\t'id' => 'show_heading',\n\t\t\t\t\t'type' => 'radio',\n\t\t\t\t\t'std' => 'yes',\n\t\t\t\t\t'options' => array( 'yes' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_YES' ), 'no' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_NO' ) ),\n\t\t\t\t\t'tooltip' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_SHOW_HEADING_DES' ),\n\t\t\t\t\t'has_depend' => '1',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_HEADING_FONT' ),\n\t\t\t\t\t'id' => 'font',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'std' => 'inherit',\n\t\t\t\t\t'options' => array( 'inherit' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_INHERIT' ), 'custom' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_CUSTOM' ) ),\n\t\t\t\t\t'has_depend' => '1',\n\t\t\t\t\t'tooltip' => JText::_( 'JSN_PAGEBUILDER_ELEMENT_LIST_HEADING_FONT_DES' ),\n\t\t\t\t\t'class' => 'input-medium',\n\t\t\t\t\t'dependency' => array( 'show_heading', '=', 'yes' )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_FONT_FACE' ),\n\t\t\t\t\t'id' => 'font-family',\n\t\t\t\t\t'type' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'font_face_type',\n\t\t\t\t\t\t\t'type' => 'jsn_select_font_type',\n\t\t\t\t\t\t\t'class' => 'input-medium',\n\t\t\t\t\t\t\t'std' => 'standard fonts',\n\t\t\t\t\t\t\t'options' => JSNPagebuilderHelpersType::getFonts(),\n\t\t\t\t\t\t\t'parent_class' => 'combo-item',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'font_face_value',\n\t\t\t\t\t\t\t'type' => 'jsn_select_font_value',\n\t\t\t\t\t\t\t'class' => 'input-medium',\n\t\t\t\t\t\t\t'std' => 'Verdana',\n\t\t\t\t\t\t\t'options' => '',\n\t\t\t\t\t\t\t'parent_class' => 'combo-item',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'dependency' => array( 'font', '=', 'custom' ),\n\t\t\t\t\t'tooltip' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_FONT_FACE_DES' ),\n\t\t\t\t\t'container_class' => 'combo-group',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_FONT_ATTRIBUTES' ),\n\t\t\t\t\t'id' => 'font-attributes',\n\t\t\t\t\t'type' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'font_size_value',\n\t\t\t\t\t\t\t'type' => 'text_append',\n\t\t\t\t\t\t\t'type_input' => 'number',\n\t\t\t\t\t\t\t'class' => 'input-mini',\n\t\t\t\t\t\t\t'std' => '',\n\t\t\t\t\t\t\t'append' => 'px',\n\t\t\t\t\t\t\t'validate' => 'number',\n\t\t\t\t\t\t\t'parent_class' => 'combo-item',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'font_style',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'class' => 'input-medium',\n\t\t\t\t\t\t\t'std' => 'bold',\n\t\t\t\t\t\t\t'options' => JSNPagebuilderHelpersType::getFontStyles(),\n\t\t\t\t\t\t\t'parent_class' => 'combo-item',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'color',\n\t\t\t\t\t\t\t'type' => 'color_picker',\n\t\t\t\t\t\t\t'std' => '#000000',\n\t\t\t\t\t\t\t'parent_class' => 'combo-item',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'dependency' => array( 'font', '=', 'custom' ),\n\t\t\t\t\t'tooltip' => JText::_( 'JSN_PAGEBUILDER_DEFAULT_ELEMENT_FONT_ATTRIBUTES_DES' ),\n\t\t\t\t\t'container_class' => 'combo-group',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}" ]
[ "0.6609231", "0.49886218", "0.4935303", "0.4864706", "0.48574424", "0.48574424", "0.48487228", "0.48413414", "0.4657719", "0.46440524", "0.46231565", "0.46126115", "0.4612081", "0.46069863", "0.45844764", "0.45775974", "0.45522046", "0.45462355", "0.45314237", "0.4526155", "0.45142427", "0.45024845", "0.44891766", "0.44851106", "0.4478512", "0.4471918", "0.4455121", "0.44352144", "0.44287917", "0.44281262", "0.44196457", "0.4402746", "0.4401956", "0.4401956", "0.44013318", "0.44007364", "0.43997413", "0.43905938", "0.43900508", "0.4382916", "0.43815893", "0.4354629", "0.43385372", "0.43211484", "0.4310999", "0.4310999", "0.4310848", "0.4303028", "0.43000597", "0.42981756", "0.4297891", "0.4294643", "0.42759308", "0.4274998", "0.42642528", "0.42642528", "0.42642528", "0.42642528", "0.42642528", "0.42642528", "0.4257049", "0.42499706", "0.4241416", "0.4232954", "0.4225649", "0.42251384", "0.4224591", "0.42192888", "0.42166483", "0.4210295", "0.42094597", "0.42002326", "0.41988617", "0.41984245", "0.41931847", "0.41914758", "0.41900718", "0.41880473", "0.41805184", "0.4177208", "0.41771254", "0.41754597", "0.41753295", "0.41744035", "0.41624802", "0.4150319", "0.41408092", "0.41393223", "0.4135476", "0.41348806", "0.41317895", "0.41295603", "0.41289493", "0.41258216", "0.41255385", "0.41197965", "0.41190058", "0.41165736", "0.4114448" ]
0.8328931
0
Creates a client for the given arguments. This method can be overridden in subclasses as needed.
Создает клиента для заданных аргументов. Этот метод может быть переопределен в подклассах по необходимости.
protected function createClient(array $args) { return new $args['client_class']($args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create(array $args = [])\n {\n static $required = [\n 'store',\n 'environment',\n 'api_provider',\n 'endpoint_provider',\n ];\n\n static $defaultArgs = [\n 'credentials' => [],\n 'scheme' => 'https',\n 'store' => null,\n 'environment' => null,\n 'signature' => false,\n 'class_name' => false,\n 'version' => 'v1'\n ];\n\n // Merge in and handle default arguments\n $args += $defaultArgs;\n $this->addDefaultArgs($args);\n\n // Ensure required arguments are provided.\n foreach ($required as $r) {\n if (!isset($args[$r])) {\n throw new InvalidArgumentException(\"{$r} is a required configuration setting when creating a client.\");\n }\n }\n\n // Process each argument and keep track of deferred ones\n $deferred = [];\n foreach ($this->validArguments as $key => $type) {\n if (isset($args[$key])) {\n if ($type === 1) {\n $normalizedMethod = ucfirst($this->underlineToCamelCase($key));\n $this->{\"handle{$normalizedMethod}\"}($args[$key], $args);\n } elseif ($type === 2) {\n $deferred[$key] = $args[$key];\n }\n }\n }\n\n // Create the client and then handle deferred and post-create logic\n $client = $this->createClient($args);\n foreach ($deferred as $key => $value) {\n $this->{\"handle_{$key}\"}($value, $args, $client);\n }\n\n $this->postCreate($client);\n\n return $client;\n }", "public function createClient();", "public function createClient()\n\t{\n\t}", "public function createClient()\n\t{\n\t\t$this->client = new Client;\n\t}", "public function createClient()\n {\n return parent::createClient();\n }", "public function createClient(){\r\n\t\treturn new Client($this->data[self::FIRSTNAME_REF], $this->data[self::SECONDNAME_REF], $this->data[self::EMAIL_REF], $this->data[self::STATUS_REF], $this->data[self::TELEPHONE_REF]);\r\n\t}", "public function createClient(array $config = []);", "abstract protected function createClient($identifier);", "public function createClient() {\n $this->client = $this->getKernel()->getContainer()->get('test.client');\n $client = $this->client;\n return $client;\n }", "public static function createClient() : Client {\n try {\n // Initializes an instance of the DeliveryClient client\n if(is_null(static::$app))\n $client = new DeliveryClient(env(\"KONTENT_AI_KEY\"));\n else\n return static::$app;\n } catch (\\Throwable $e) {\n throw new \\Exception($e->getMessage());\n }\n static::$client = $client;\n static::$app = new Client();\n static::$query = new QueryParams();\n return static::$app;\n }", "public function create()\n {\n return new Client();\n }", "abstract public function makeClient(): Client;", "public function createClient($from, $to);", "public static function factory( $config = array() ){\n \n // Provide a hash of default client configuration options\n $default = array (\n 'key' => '',\n );\n\n // No values are currently required when creating the client\n $required = array ();\n\n // Merge in default settings and validate the config\n $config = Collection::fromConfig( $config, $default, $required );\n\n // Add configured API key as default command parameter although individual command execution may override\n $config->add( Client::COMMAND_PARAMS, array ( \n 'key' => $config->get('key'),\n ) );\n \n // Sanitize authentication type now to pre-empty errors\n if( $mode = $config->get('auth') ){\n if( ! in_array( $mode, array('loco','basic','query'), true ) ){\n throw new InvalidArgumentException('No such authentication mode, '.json_encode($mode) ); \n }\n }\n\n // Create a new instance of self\n $client = new self( '', $config );\n\n // describe service from included php file.\n $service = ServiceDescription::factory( __DIR__.'/Resources/service.php');\n \n // allow override of base_url after it's been set by service description\n if( $baseUrl = $config->get('base_url') ){\n $service->setBaseUrl( $baseUrl );\n }\n \n // Prefix Loco identifier to user agent string\n $client->setUserAgent( $service->getName().'/'.$service->getApiVersion(), true );\n\n return $client->setDescription( $service );\n \n }", "protected function commandClient()\n {\n $handlerStack = HandlerStack::create();\n\n if ($this->app['config']->get('app.debug')) {\n $handlerStack->push($this->getLogMiddleware());\n }\n\n $product = $this->app['config']->get('mtn-momo.product');\n\n $options = array_merge([\n 'handler' => $handlerStack,\n 'progress' => function () {\n echo '. ';\n },\n 'base_uri' => $this->app['config']->get('mtn-momo.api.base_uri'),\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => $this->app['config']->get(\"mtn-momo.products.{$product}.key\"),\n ],\n 'json' => [\n 'non-empty-body',\n ],\n ], (array) $this->app['config']->get('mtn-momo.guzzle.options'));\n\n return new Client($options);\n }", "public function create(\n array $config = []\n ): Client {\n if (count($config) === 0) {\n $config = $this->defaultConfig;\n }\n\n $options = [];\n\n if (isset($config['options'])) {\n $options = $config['options'];\n\n unset($config['options']);\n }\n\n $client = new Client($config);\n\n foreach ($options as $option => $value) {\n $method = $this->resolveOptionMutatorMethod($client, $option);\n\n $client->$method($value);\n }\n\n return $client;\n }", "private function client()\n {\n return new Client;\n }", "public function client();", "public function __construct($args, $client = null)\n {\n parent::__construct($args, $client);\n }", "protected static function createFactory($args)\n {\n $class = new \\ReflectionClass(ClientFactory::class);\n\n return $class->newInstanceArgs(array_values($args));\n }", "private function createClient(): self\n {\n $this->client = new Client([\n 'base_uri' => self::API_URL,\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'Authorization' => \"Client-ID {$this->accessKey}\",\n ],\n ]);\n\n return $this;\n }", "public function client()\n {\n return new Client;\n }", "public function client(){}", "public function client(){}", "function createClient()\r\n{\r\n global $endpoint;\r\n return new UserEventServiceClient([\r\n 'apiEndpoint' => $endpoint\r\n ]);\r\n}", "private function createClient()\n {\n if (!$this->instanceName) {\n throw new MissingInstanceException(\"Instance name not specified!\");\n }\n\n $client = new Client();\n\n return $client;\n }", "public static function factory($config = array())\n {\n $config['allow_redirects'] = false;\n\n $stack = new HandlerStack();\n $stack->setHandler(new CurlHandler());\n $stack->push(add_header('Authorization', 'Bearer ' . $config['token']));\n $stack->push(add_header('Accept', 'application/json'));\n $config['handler'] = $stack;\n\n $config['description'] = ClientCommands::getCommands();\n\n $client = new self($config);\n\n return $client;\n }", "protected function makeClient()\n {\n //Generate OAuth1.0 handler\n $stack = HandlerStack::create();\n\n $middleware = new Oauth1([\n 'consumer_key' => $this->api_key,\n 'consumer_secret' => $this->api_secret\n ]);\n $stack->push($middleware);\n\n return new Client([\n 'base_uri' => $this->base_url,\n 'timeout' => $this->timeout,\n 'handler' => $stack,\n 'auth' => 'oauth'\n ]);\n }", "public function client(): Client\n {\n return new Client([\n 'handler' => $this->handlerStack(),\n ]);\n }", "public static function factory($config = array()) {\n\t\t$default = array(\n 'base_url' => 'https://my.rightscale.com/',\n 'version' => '1.0',\n 'curl.CURLOPT_FOLLOWLOCATION' => false,\n 'curl.CURLOPT_RETURNTRANSFER' => true\n );\n\t\t$required = array ('acct_num', 'base_url', 'version');\n\t\t$config = Inspector::prepareConfig ( $config, $default, $required );\n\t\t\n\t\t$client = new self ( $config->get( 'base_url' ),\n\t\t\t$config->get('acct_num'),\n $config->get('oauth_refresh_token'),\n\t\t\t$config->get('email'),\n\t\t\t$config->get('password'),\n\t\t\t$config->get('version')\n\t\t);\n\t\t$client->setConfig ( $config );\n\t\t\n\t\t// Add the XML service description to the client\n $path = __DIR__ . DIRECTORY_SEPARATOR . 'rs_guzzle_client_v'. $client->getVersion() . '.xml';\n $client->setDescription(ServiceDescription::factory($path));\n\n\t\t// Keep them cookies\n\t\t$client->cookieJar = new IndiscriminateArrayCookieJar();\n $client->getEventDispatcher()->addSubscriber(new CookiePlugin($client->cookieJar));\n\n $client->getEventDispatcher()->addSubscriber(new HttpAuthenticationPlugin($client));\n $client->getEventDispatcher()->addSubscriber(new ShardAwarenessPlugin($client));\n\n\t\treturn $client;\n\t}", "private function __clientClass()\n {\n return new Client();\n }", "public function make(array $config): Client\n {\n return $this->buildClient($config);\n }", "public function make(array $config): Client\n {\n return $this->buildClient($config);\n }", "protected function getClient() : ClientInterface {}", "protected function getClient(InputInterface $in) : Client {\n if (!$this->client) {\n $this->client = new Client([\n 'key' => $in->getOption('key'),\n 'baseUri' => $in->getOption('base-uri'),\n 'collection' => $in->getOption('collection'),\n ]);\n }\n\n return $this->client;\n }", "public function clientFactory(): Client\n {\n $client = new Client();\n\n return $client;\n }", "function createClient()\r\n{\r\n global $endpoint;\r\n return new PredictionServiceClient([\r\n 'apiEndpoint' => $endpoint\r\n ]);\r\n}", "public function create($data)\n {\n $client = Client::create($data);\n return $client;\n }", "public static function factory($config = array())\n {\n $default = array(\n 'base_url' => '{scheme}://{hostname}/oauth',\n 'scheme' => 'https',\n 'hostname' => 'www.sparkreel.com'\n );\n\n $required = array('base_url', 'client_id', 'client_secret');\n $config = Collection::fromConfig($config, $default, $required);\n\n $client = new self($config->get('base_url'), $config);\n\n // Attach a service description to the client\n $description = ServiceDescription::factory(dirname(__DIR__) . '/Resources/OAuth2.json');\n $client->setDescription($description);\n\n // send client_id & client_secret as Basic auth\n $client->setDefaultOption('auth', array($config->get('client_id'), $config->get('client_secret'), 'Basic'));\n\n return $client;\n }", "protected function getClient(array $parameters = array(), array $options = array()) {\n\t\treturn $this->createClient ( $parameters, $options );\n\t}", "public function __construct($param = array())\n {\n $this->_client = new Client($param);\n }", "private function createConnection()\n {\n $this->eventListener = new EventListenerStub();\n $cli = new ClientConnection(NULL, NULL, NULL);\n $cli->addEventListener($this->eventListener);\n return $cli;\n }", "function __construct()\n {\n $this->client = new Client();\n }", "public static function make($param1 = null, $param2 = null, $options = [])\n {\n if (preg_match('/\\.jar$/', func_get_arg(0)))\n {\n return new CLIClient($param1, $param2);\n }\n else\n {\n return new WebClient($param1, $param2, $options);\n }\n }", "public function setUpClient()\n {\n // Get the Cloud Function URL.\n $targetAudience = self::getBaseUri();\n if ($targetAudience === '') {\n // A URL was not available for this function.\n // Skip client setup.\n return;\n }\n\n // Create middleware.\n $middleware = ApplicationDefaultCredentials::getIdTokenMiddleware($targetAudience);\n $stack = HandlerStack::create();\n $stack->push($middleware);\n\n // Create the HTTP client.\n $this->client = new Client([\n 'handler' => $stack,\n 'auth' => 'google_auth',\n 'base_uri' => $targetAudience,\n 'http_errors' => false,\n ]);\n }", "public function __construct(array $clientOptions) {}", "public function __construct(ClientCredentialsInterface $clientCredentials);", "private function getClient(): Client\n {\n return new Client([\n 'base_uri' => $this->getAuthorizationUrl(),\n ]);\n }", "public function create($args);", "private function makeClient($name)\n {\n $config = $this->getClientConfig($name);\n\n return $this->factory->create($config);\n }", "public static function getClient()\n {\n // get configurations from config file here.\n $config = file_get_contents(__DIR__.'/../config.json');\n $config = (array)json_decode($config);\n\n $client = new Client(\n $config['dns'] . '/' . $config['database']\n );\n $client->useDatabase($config['database']);\n\n return $client;\n }", "private function getClient()\n {\n return new JustGivingClient($this->getAuthMock(), Mockery::mock(ClientInterface::class));\n }", "public function createClient(array $data)\n {\n $client = new Client();\n $client->name = $data['Name'];\n $client->rfc = $data['RFC'];\n $client->numero_seguro = $data['NumeroSocial'];\n\n return $client;\n }", "public function __construct ()\n {\n $this->client = new Client();\n }", "protected function createClient(array $parameters = null, array $options = null, $flushdb = true)\n {\n $parameters = array_merge(\n $this->getDefaultParametersArray(),\n $parameters ?: array()\n );\n\n $options = array_merge(\n array(\n 'profile' => $this->getProfile(),\n ),\n $options ?: array()\n );\n\n $client = new Client($parameters, $options);\n $client->connect();\n\n if ($flushdb) {\n $client->flushdb();\n }\n\n return $client;\n }", "public function __construct()\n {\n $this->client = new Client();\n }", "public function getClient(array $options = []): Client\n {\n return new Client(\n $options + [\n 'handler' => $this->handlerStack\n ]\n );\n }", "public function getClient(array $options = []): Client\n {\n return new Client(\n $options + [\n 'handler' => $this->handlerStack\n ]\n );\n }", "protected function createHttpClient()\n {\n $client = new HttpClient();\n\n return $this->setHttpClient($client);\n }", "protected function getClient()\n {\n return new Client([\n 'base_uri' => $this->baseUrl(), 'handler' => $this->createHandler()\n ]);\n }", "function create($client)\n {\n }", "public function __construct()\n {\n $this->auth_service_client = new Client([\n // Base URI is used with relative requests\n 'base_uri' => env('AUTH_SERVICE_IP'),\n // You can set any number of default request options.\n 'timeout' => 2.0,\n ]);\n\n $this->mail_service_client = new Client([\n // Base URI is used with relative requests\n 'base_uri' => env('MAIL_SERVICE_IP'),\n // You can set any number of default request options.\n 'timeout' => 2.0,\n ]);\n }", "function __construct()\n\t\n\t\t{\n\n\t\t\t$num=func_num_args(); \n\t\t//ca renvois le nombre d'arguments\n\t\t\n\t\t\t$args=func_get_args(); \n\t\t//cela retourne un tableau avec les arguments\n\t\t\n\n\t\t\tswitch ($num)\n\t\t\n\t\t\t{\n\n\n\t\tcase 0:\n\t\n\t\t\t$this->nomClient=\"Charlie\";\n\n\t\t\t\t//$this->facture=0;\n\n\t\t\t\tbreak;\n\t\t\t\n\t\tcase 1:\n\t\t\t \n\t\t\t$this->nomClient=$args[0];\n\t\t\t \n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\techo \"error\";\n\n\t\t\t\tbreak;\n\t \n \t\t\t}\n\n\t\t}", "abstract public function getClient();", "public function __construct(array $parameters)\n{\n\n$this->_parameters = $parameters;\n$baseUrl = $this->getParameter('base_url');\n$client = new Client(['base_url' => $baseUrl]);\n$this->_client = $client;\n}", "public function create(array $arguments);", "public function createCliente() {\n $res = $this->create();\n return $res;\n }", "public function createClient()\n {\n $this->artisan('migrate', ['--database' => 'testbench']);\n $client = app(ClientRepository::class)->createPasswordGrantClient(null, 'test', 'http://localhost');\n config()->set('lighthouse-graphql-passport.client_id', $client->id);\n config()->set('lighthouse-graphql-passport.client_secret', $client->secret);\n }", "private function _createNewClient(ConnectionInterface $connection)\n {\n $universeBaskets = [];\n for ($i = 0; $i < UNIVERSE_BASKET_COUNT; $i++) {\n $universeBaskets[] = $this->_basketFactory\n ->createFilled(UNIVERSE_BASKET_SIZE);\n }\n return new Client(\n $this,\n $connection,\n new JsonProtocol(),\n $this->_basketFactory->create(USER_BASKET_SIZE),\n $universeBaskets\n );\n }", "protected function getTest_ClientService()\n {\n include_once $this->targetDirs[3].'/vendor/symfony/browser-kit/History.php';\n include_once $this->targetDirs[3].'/vendor/symfony/browser-kit/CookieJar.php';\n include_once $this->targetDirs[3].'/vendor/symfony/browser-kit/Client.php';\n include_once $this->targetDirs[3].'/vendor/symfony/http-kernel/Client.php';\n include_once $this->targetDirs[3].'/vendor/symfony/framework-bundle/Client.php';\n\n return new \\Symfony\\Bundle\\FrameworkBundle\\Client(${($_ = isset($this->services['kernel']) ? $this->services['kernel'] : $this->get('kernel')) && false ?: '_'}, array(), new \\Symfony\\Component\\BrowserKit\\History(), new \\Symfony\\Component\\BrowserKit\\CookieJar());\n }", "protected function init_client( $config ) {\n\t\t$default = array(\n\t\t\t'base_url' => '{{scheme}}://api.{{domain}}/{{version}}/?appid={{appid}}&appkey={{appkey}}',\n\t\t\t'scheme' => 'https',\n\t\t\t'version' => '0.1',\n\t\t\t'domain' => \\PSU::isDev() ? 'dev.plymouth.edu' : 'plymouth.edu',\n\t\t);\n\n\t\t$required = array(\n\t\t\t'appid',\n\t\t\t'appkey',\n\t\t\t'base_url',\n\t\t);\n\n\t\t$config = \\Guzzle\\Common\\Inspector::prepareConfig( $config, $default, $required );\n\n\t\t$client = new \\Guzzle\\Service\\Client(\n\t\t\t$config->get('base_url'),\n\t\t\t$config\n\t\t);\n\n\t\t$client->setConfig( $config );\n\n\t\treturn $client;\n\t}", "final protected function _createClient()\n {\n $aCreds = array(\n 'customer_id' => $this->_sCustomerId,\n 'api_key' => $this->_sApiKey\n );\n return new Postmates_Shipping_Client_Client('', $aCreds);\n }", "protected function createClient()\n {\n $isActive = $this->settings->getSettingByKey('marketingVendorsValue');\n if ($isActive && $isActive->getValue() === Config::KEY) {\n $config = $this->settings->getSettingByKey(Config::KEY);\n\n if ($config) {\n $configArray = $config->getValue();\n\n // validate configuration\n $requiredConfigFields = array_keys($this->config->getSettingsConfig());\n $isValid = true;\n foreach ($requiredConfigFields as $requiredConfigField) {\n if (!array_key_exists($requiredConfigField, $configArray)) {\n $isValid = false;\n }\n if (empty($configArray[$requiredConfigField])) {\n $isValid = false;\n }\n }\n\n // if configuration is not valid then do nothing\n if (!$isValid) {\n return;\n }\n\n $endpoint = $configArray['api_url'];\n $apiSecret = $configArray['api_secret'];\n $apiKey = $configArray['api_key'];\n $customerId = $configArray['customer_id'];\n try {\n $this->connector = $this->createConnector(new Client($customerId, $endpoint, $apiSecret, $apiKey));\n } catch (\\Exception $exception) {\n $this->logger->debug(json_encode($exception->getMessage()));\n }\n\n $this->ownerEmail = $configArray['email'];\n }\n }\n }", "public function __construct(array $args)\n {\n list($service, $exceptionClass) = $this->parseClass();\n if (!isset($args['service'])) {\n $args['service'] = manifest($service)['endpoint'];\n }\n if (!isset($args['exception_class'])) {\n $args['exception_class'] = $exceptionClass;\n }\n $this->handlerList = new HandlerList();\n $resolver = new ClientResolver(static::getArguments());\n $config = $resolver->resolve($args, $this->handlerList);\n $this->api = $config['api'];\n $this->signatureProvider = $config['signature_provider'];\n $this->endpoint = new Uri($config['endpoint']);\n $this->credentialProvider = $config['credentials'];\n $this->tokenProvider = $config['token'];\n $this->region = isset($config['region']) ? $config['region'] : null;\n $this->config = $config['config'];\n $this->setClientBuiltIns($args);\n $this->clientContextParams = $this->setClientContextParams($args);\n $this->defaultRequestOptions = $config['http'];\n $this->endpointProvider = $config['endpoint_provider'];\n $this->serializer = $config['serializer'];\n $this->addSignatureMiddleware();\n $this->addInvocationId();\n $this->addEndpointParameterMiddleware($args);\n $this->addEndpointDiscoveryMiddleware($config, $args);\n $this->addRequestCompressionMiddleware($config);\n $this->loadAliases();\n $this->addStreamRequestPayload();\n $this->addRecursionDetection();\n $this->addRequestBuilder();\n\n if (isset($args['with_resolved'])) {\n $args['with_resolved']($config);\n }\n }", "public function initClient();", "public function __construct(array $config) {\n $this->remoteServerAddress = Arrays::get($config, \"address\");\n $this->client = new Client([\n \"base_uri\" => $this->remoteServerAddress,\n \"auth\" => [\n Arrays::get($config, [\"auth\", \"username\"], \"re\"),\n Arrays::get($config, [\"auth\", \"password\"], \"codex\")\n ],\n \"connect_timeout\" => floatval(Arrays::get($config, [\"timeouts\", \"connection\"], 1000)) / 1000.0,\n \"timeout\" => floatval(Arrays::get($config, [\"timeouts\", \"request\"], 30000)) / 1000.0\n ]);\n }", "public function __construct($options = [])\n {\n $this->client = new Client(array_merge([\n 'base_url' => 'https://fapi.binance.com',\n 'base_websocket_url' => 'wss://fstream.binance.com',\n ], $options));\n }", "public function __construct()\n {\n $this->client = $this->getClient();\n }", "private function setupClient()\n {\n return new GuzzleClient([\n 'base_uri' => $this->apiBaseUrl,\n 'timeout' => $this->apiTimeout,\n ]);\n }", "public function __call(string $method, array $arguments) : Client {\n if(method_exists(Query::class, $method)) {\n [$key, $val] = Query::$method($arguments);\n static::$query->data[$key] = $val; \n return static::$app;\n } elseif(method_exists(QueryParams::class, $method)) {\n static::$query->$method(...$arguments);\n return static::$app;\n } else {\n throw new \\BadMethodCallException(\"Method $method() does not exist\");\n }\n }", "public function __construct()\n {\n $this->client = new Client(['base_uri' => static::MAIN_URL, 'timeout' => 360]);\n $this->setConfigs();\n }", "public function client()\n {\n if($this->client) return $this->client;\n\n return new Client([\n 'base_url' => \"https://$this->subdomain.Capsule.com\",\n 'defaults' => [\n 'auth' => [$this->key, 'x', 'basic'],\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json'\n ]\n ]\n ]);\n }", "public static function factory(array $config)\n {\n return GuzzleClientFactory::createClient($config);\n }", "public function __call($name, $arguments)\n {\n return $this->client->{$name}(...$arguments);\n }", "public function build($type = self::ENTERPRISE)\n {\n\n $soap_client_factory = new SoapClientFactory();\n $soap_client = $soap_client_factory->factory($this->wsdl, $this->soap_options);\n\n if($type == self::PARTNER){\n $client = new PartnerClient($soap_client, $this->username, $this->password, $this->token);\n } else {\n $client = new EnterpriseClient($soap_client, $this->username, $this->password, $this->token);\n }\n\n if($this->log) {\n $log_plugin = new LogPlugin($this->log);\n $client->getEventDispatcher()->addSubscriber($log_plugin);\n }\n\n return $client;\n }", "abstract protected function getClient();", "public function __construct( array $args = array() ) {\n\t\tif ( is_array( $args ) && count($args) > 2 ) {\n\t\t\tcall_user_func_array( array( $this, 'connect'), $args );\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n\n $this->client = new Client;\n }", "public function getClient()\n {\n return new Client($this->app, []);\n }", "public function it_automatically_instantiates_a_psr_18_client()\n {\n // Overload the Guzzle client class to make sure the JustGiving client is instantiating it internally\n $http = Mockery::mock('overload:' . Client::class);\n $http->shouldReceive('send')\n ->withArgs(function (RequestInterface $request) {\n return $request->getUri()->__toString() === 'https://api.justgiving.com/v1/account';\n })\n ->once()\n ->andReturn(new Response);\n\n $client = new JustGivingClient($this->getAuthMock());\n\n $client->Account->retrieve();\n }", "function createClient($server='www.livejournal.com', $interface='/interface/xmlrpc', $port=80){\n\t\t\t$this->lj = new xmlrpc_client($interface, $server, $port);\n\t\t}", "protected function createClient(IContainer $container): IHttpClient\n {\n // Create the application so that the API gateway is resolvable\n $this->createApplication($container);\n\n return new ApplicationClient($this->createApiGateway($container), $container);\n }", "public function __construct()\n {\n $this->client = new Client();\n parent::__construct();\n }", "public function __construct()\n {\n $this->client = new Client();\n parent::__construct();\n }", "public function __construct(ClientInterface $client){\n \n //instanciamos atributo en base a dependencia inyectada\n $this->client=$client;\n\n }", "protected function buildClient(array $config): Client\n {\n $clientBuilder = ClientBuilder::create();\n\n // Configure hosts\n $clientBuilder->setHosts($config['hosts']);\n\n // Configure logging\n if (Arr::get($config, 'logging')) {\n $logObject = Arr::get($config, 'logObject');\n $logPath = Arr::get($config, 'logPath');\n $logLevel = Arr::get($config, 'logLevel');\n if ($logObject && $logObject instanceof LoggerInterface) {\n $clientBuilder->setLogger($logObject);\n } elseif ($logPath && $logLevel) {\n $handler = new StreamHandler($logPath, $logLevel);\n $logObject = new Logger('log');\n $logObject->pushHandler($handler);\n $clientBuilder->setLogger($logObject);\n }\n }\n\n // Configure tracer\n if ($tracer = Arr::get($config, 'tracer')) {\n $clientBuilder->setTracer(app($tracer));\n }\n\n // Set additional client configuration\n foreach ($this->configMappings as $key => $method) {\n $value = Arr::get($config, $key);\n if (is_array($value)) {\n foreach ($value as $vItem) {\n $clientBuilder->$method($vItem);\n }\n } elseif ($value !== null) {\n $clientBuilder->$method($value);\n }\n }\n\n // Configure handlers for any AWS hosts\n foreach ($config['hosts'] as $host) {\n if (isset($host['aws']) && $host['aws']) {\n $clientBuilder->setHandler(function (array $request) use ($host) {\n $psr7Handler = \\Aws\\default_http_handler();\n $signer = new \\Aws\\Signature\\SignatureV4('es', $host['aws_region']);\n $request['headers']['Host'][0] = parse_url($request['headers']['Host'][0])['host'] ?? $request['headers']['Host'][0];\n\n // Create a PSR-7 request from the array passed to the handler\n $psr7Request = new Request(\n $request['http_method'],\n (new Uri($request['uri']))\n ->withScheme($request['scheme'])\n ->withPort($host['port'])\n ->withHost($request['headers']['Host'][0]),\n $request['headers'],\n $request['body']\n );\n\n // Create the Credentials instance with the credentials from the environment\n $credentials = new \\Aws\\Credentials\\Credentials(\n $host['aws_key'],\n $host['aws_secret'],\n $host['aws_session_token'] ?? null\n );\n // check if the aws_credentials from config is set and if it contains a Credentials instance\n if (!empty($host['aws_credentials']) && $host['aws_credentials'] instanceof \\Aws\\Credentials\\Credentials) {\n // Set the credentials as in config\n $credentials = $host['aws_credentials'];\n }\n\n // If the aws_credentials is an array try using it as a static method of the class\n if (\n !empty($host['aws_credentials'])\n && is_array($host['aws_credentials'])\n && Reflector::isCallable($host['aws_credentials'], true)\n ) {\n $host['aws_credentials'] = call_user_func([$host['aws_credentials'][0], $host['aws_credentials'][1]]);\n }\n\n if (!empty($host['aws_credentials']) && $host['aws_credentials'] instanceof \\Closure) {\n // If it contains a closure you can obtain the credentials by invoking it\n $credentials = $host['aws_credentials']()->wait();\n }\n\n // Sign the PSR-7 request\n $signedRequest = $signer->signRequest(\n $psr7Request,\n $credentials\n );\n\n // Get curl stats\n $http_stats = new class\n {\n public $data = [];\n public function __invoke(...$args)\n {\n $this->data = $args[0];\n }\n };\n\n // Send the signed request to Amazon ES\n $response = $psr7Handler($signedRequest, ['http_stats_receiver' => $http_stats])\n ->then(function (ResponseInterface $response) {\n return $response;\n }, function ($error) {\n return $error['response'];\n })\n ->wait();\n\n // Convert the PSR-7 response to a RingPHP response\n return new CompletedFutureArray([\n 'status' => $response->getStatusCode(),\n 'headers' => $response->getHeaders(),\n 'body' => $response->getBody()->detach(),\n 'transfer_stats' => [\n 'total_time' => $http_stats->data['total_time'] ?? 0,\n 'primary_port' => $http_stats->data['primary_port'] ?? '',\n ],\n 'effective_url' => (string) $psr7Request->getUri(),\n ]);\n });\n }\n }\n\n // Build and return the client\n if (\n !empty($host['api_id']) && $host['api_id'] !== null &&\n !empty($host['api_key']) && $host['api_key'] !== null\n ) {\n $clientBuilder->setApiKey($host['api_id'], $host['api_key']);\n }\n\n return $clientBuilder->build();\n }", "protected function createConnection(array $config): Client\n {\n return $this->factory->make($config);\n }", "public function create(array $options = array())\n {\n return new UpholdClient($options);\n }", "public function __construct($options)\n\t\t{\n\t\t\t// Check the provided options\n\n\t\t\tif ($options === null) {\n\t\t\t\tthrow new \\InvalidArgumentException('options is null');\n\t\t\t}\n\n\t\t\t// Base URIs\n\n\t\t\tif (!array_key_exists(VerifaliaRestClientOptions::BASE_URIS, $options)) {\n\t\t\t\t$options[VerifaliaRestClientOptions::BASE_URIS] = self::DEFAULT_BASE_URIS;\n\t\t\t}\n\n\t\t\t// Authentication settings\n\n\t\t\tif (!array_key_exists(VerifaliaRestClientOptions::USERNAME, $options)) {\n\t\t\t\tthrow new \\InvalidArgumentException(\"username is null or empty: please visit https://verifalia.com/client-area to set up a new user, if you don't have one.\");\n\t\t\t}\n\n\t\t\tif (!array_key_exists(VerifaliaRestClientOptions::PASSWORD, $options)) {\n\t\t\t\tthrow new \\InvalidArgumentException(\"password is null or empty: please visit https://verifalia.com/client-area to set up a new user, if you don't have one.\");\n\t\t\t}\n\n\t\t\t$authenticator = new UsernamePasswordAuthenticator(\n\t\t\t\t$options[VerifaliaRestClientOptions::USERNAME],\n\t\t\t\t$options[VerifaliaRestClientOptions::PASSWORD]\n\t\t\t);\n\n\t\t\t$restClient = new MultiplexedRestClient(\n\t\t\t\t$options[VerifaliaRestClientOptions::BASE_URIS],\n\t\t\t\t$authenticator\n\t\t\t);\n\n\t\t\t$this->credits = new CreditsRestClient($restClient);\n\t\t\t$this->emailValidations = new EmailValidationsRestClient($restClient);\n\t\t}", "public function make(array $config)\n {\n $config = $this->getConfig($config);\n\n return $this->getClient($config);\n }" ]
[ "0.7466663", "0.7390803", "0.7102528", "0.7005842", "0.68918216", "0.68238556", "0.6800288", "0.6794146", "0.6538675", "0.6525422", "0.6508005", "0.6505717", "0.6505527", "0.6491341", "0.6478772", "0.64333534", "0.6408162", "0.63717985", "0.6306415", "0.62681776", "0.6224597", "0.622023", "0.6213708", "0.6213708", "0.62090325", "0.61880356", "0.6184951", "0.6156229", "0.6122284", "0.6078069", "0.60714793", "0.60616547", "0.60616547", "0.60586023", "0.60488695", "0.604678", "0.6010145", "0.60000587", "0.5987834", "0.5979593", "0.5972536", "0.5966608", "0.5964843", "0.59556645", "0.595386", "0.5945545", "0.5889721", "0.5889696", "0.5878664", "0.587813", "0.58676714", "0.5842743", "0.5842288", "0.5828449", "0.58261704", "0.58195883", "0.58193475", "0.58193475", "0.5801754", "0.5799773", "0.5792324", "0.5792001", "0.5789004", "0.5784018", "0.5781695", "0.57773894", "0.5770362", "0.5770342", "0.5765322", "0.5760518", "0.57536834", "0.5749992", "0.5747558", "0.5746908", "0.571809", "0.57080644", "0.5694737", "0.5674254", "0.5672727", "0.56678575", "0.5666369", "0.566494", "0.5662889", "0.5662096", "0.5654308", "0.5645907", "0.5641949", "0.5640505", "0.5639641", "0.56336534", "0.5631454", "0.56221294", "0.5621797", "0.5621797", "0.56207854", "0.5614126", "0.55984706", "0.559739", "0.55918473", "0.55903924" ]
0.76057744
0
Returns the cart total.
Возвращает общую стоимость корзины.
public function total() { return $this->cart_contents[ $this->cart_name ]['cart_total']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCartTotal()\n {\n $total = 0;\n foreach ($this->cartItems as $item) {\n $total += $item->getAmount();\n }\n return $total;\n }", "public function total()\n {\n return $this->cart_contents['cart_total'];\n }", "public function get_cart_total()\n {\n }", "function cart_total()\n\t{\n\t\treturn $this->view_formatted_number($this->_calculate_total());\n\t}", "public function total(){ \r\n return $this->cart_contents['cart_total']; \r\n }", "private function total()\n {\n \t$cart = \\Session::get('cart');\n \t$total = 0;\n \tforeach($cart as $item){\n \t\t$total += $item->price * $item->quantity;\n \t}\n\n \treturn $total;\n }", "function cart_total()\n {\n $output = $this->EE->TMPL->fetch_param('output','formatted');\n \n // return based on output parameter\n if ($output == 'formatted') {\n return $this->_format_money($this->_get_cart_total());\n } elseif ($output == 'basic') {\n return $this->_get_cart_total();\n }\n }", "public function getTotal()\n {\n return $this->rules->getTotalPrice($this->checkoutCart);\n }", "public function total()\n\t{\n\t\t$total \t\t\t= 0;\n\t\t$cartCollection = $this->getCartCollection();\n\n\t\tif(empty($cartCollection))\n\t\t{\n\t\t\treturn $total;\n\t\t}\n\n\t\tforeach($cartCollection as $row)\n\t\t{\n\t\t\t$total += $row->subtotal;\n\t\t}\n\n\t\t// check that, don't have free shipping\n\t\tif( ! $this->hasFreeShipping())\n\t\t{\n\t\t\t// sum shipping amount\n\t\t\t$total += $this->getShippingAmount();\n\t\t}\n\n\t\t$total -= $this->discount();\n\n\t\treturn $total;\n\t}", "public function get_actual_cart_total()\n {\n $contents=$this->cart->contents();\n $count=0;\n foreach ($contents as $k=>$v)\n {\n if ($v['id']!='postage' && $v['id']!='voucher')\n {\n $count+=$v['qty'];\n }\n }\n return $count;\n }", "public function total_items()\r\n\t{\r\n\t\treturn $this->cart_contents[ $this->cart_name ]['total_items'];\r\n\t}", "public function totalPrice() {\n\t\t$total = 0;\n\t\tforeach($this->contents as $inCart) {\n\t\t\t$total += $inCart->getPrice() * $inCart->getQty();\n\t\t}\n\t\treturn $total;\n\t}", "public static function get_cart_totals()\n {\n }", "protected function get_cart_total_for_order()\n {\n }", "private function getCartTotal(){\n \t$userCartCourses = Cart::where('user_id', Auth::user()->id)->get();\n\n $total = 0;\n foreach ($userCartCourses as $key => $value) {\n $total+=($value->seat*$value->offer_price);\n }\n\n $discountP = isset($userCartCourses[0]->discount) ? $userCartCourses[0]->discount: 0;\n $discount = ($discountP/100)*$total;\n $grandTotal = $total - $discount;\n return $grandTotal;\n }", "public function total_items() {\n return $this->cart_contents['total_items'];\n }", "public function get_cart_contents_total()\n {\n }", "public static function totalItems()\n {\n $carts = Cart::totalCarts();\n $total_item = 0;\n\n foreach ($carts as $cart) {\n $total_item += $cart->product_quantity;\n }\n return $total_item;\n }", "public function total_items(){ \r\n return $this->cart_contents['total_items']; \r\n }", "public function totalItems() {\n\t\t$total = 0;\n\t\tforeach($this->contents as $inCart) {\n\t\t\t$total += $inCart->getQty();\n\t\t}\n\t\treturn $total;\n\t}", "public function getTotal()\n {\n return $this->qty * $this->price;\n }", "public function get_cart_total_price()\n\t{\n\t\t$cart_contents = $this->cart_contents;\n\t\t\n\t\t$this->cart_total_price = 0;\n\t\t\n\t\tif( !$this->is_cart_empty() ) :\n\t\t\tforeach( $cart_contents as $item ) :\n\t\t\t\t$product_price = get_post_meta( $item['post_id'], '_product_price', true );\n\t\t\t\t$this->cart_total_price += $product_price;\n\t\t\tendforeach;\n\t\tendif;\n\n\t\t\n\t\treturn $this->cart_total_price;\n\t}", "function total_items()\n\t{\n\t\treturn $this->_cart_contents['total_items'];\n\t}", "public function total()\n {\n return (float)array_sum(\n array_map(function (CartItem $item) {\n return $item->getTotalPrice();\n }, $this->items)\n );\n }", "public function getTotalAmount() {\n\t\t$sumOfItems = array_sum(Arrays::transform($this->cart, true, \"amount\"));\n\t\t$this->totalAmount = $sumOfItems;\n\t\treturn $this->totalAmount;\n\t}", "function cart_subtotal()\n\t{\n\t\treturn $this->view_formatted_number($this->_calculate_subtotal());\n\t}", "public function totalCost()\n {\n return collect($this->currentCart())->sum('total_price');\n }", "public function totalPrice() {\n $total = 0;\n if (!empty($this->cart)) {\n foreach ($this->cart as $key => $item) {\n $tempprice = $item['product']->price;\n if ($item['product']->specialCode == 'b1g1f') {\n $tempprice = $item['product']->price / 2;\n }\n $total += ($item['quantity'] * $tempprice);\n }\n }\n return $total;\n }", "public function getTotal()\n {\n return $this->getQuantity()*$this->getItem()->getNetPrice();\n }", "public function total()\n {\n /* BENCHMARK */ $this->benchmark->mark('func_total_start');\n\n // get cart contents\n $cart=$this->cart->contents();\n\n // set everything to 0 in case it isn't initialised\n $total=array();\n $total['total']=0;\n $total['product']=0;\n $total['postage']=0;\n $total['voucher']=0;\n\n // iterate through the cart, adding values and also dealing with the 'voucher' and 'postage' rows\n foreach ($cart as $c)\n {\n if ('voucher'==$c['id'])\n {\n // if its a voucher row the don't add it to the total, but keep it in the voucher total\n $total['voucher']=$c['price'];\n }\n else\n {\n // other wise, all other cart items add to the total\n $total['total']+=($c['price']*$c['qty']);\n }\n\n // in the case of postage make sure the postage total is initialised\n if ('postage'==$c['id'])\n {\n $total['postage']=$c['price'];\n }\n }\n\n // the product total is the total minus the postage (before voucher adjustment)\n $total['product']=$total['total']-$total['postage'];\n\n // the total nv is equal to the total before voucher adjust - used to show the user how much they are saving more clearly\n $total['total_nv']=$total['total'];\n\n // then adjust with the voucher amount - total is the actual amount the user will pay for their order\n $total['total']-=$total['voucher'];\n\n return $total;\n\n /* BENCHMARK */ $this->benchmark->mark('func_total_end');\n }", "public function totalOrderAmount()\n {\n $cart = Cart::where('user_id', Auth::user()->id)->get();\n $subTotal = 0;\n foreach ($cart as $cartItem) {\n $subtotal += ($cartItem->product->price - $cartItem->product->discount_price) * ($cartItem->qty);\n }\n return $subtotal;\n }", "public function total()\n {\n return $this->priceTax()->multiply($this->qty);\n }", "protected function cartTotals()\n {\n if (! $this->existingCart()) {\n return;\n }\n\n return $this->customerIsSignedIn()\n ? $this->magentoCustomerToken()->api('cartTotals')->mine()->json()\n : (new Magento())->api('guestCarts')->totals(session('g_cart'))->json();\n }", "public function getTotalQuantity(): int\n {\n // echo '<pre>'; var_dump($this->items); echo '</pre>';\n\n $itemsInCart = 0;\n\n foreach($this->items as $item ) {\n $itemsInCart += $item->getQuantity();\n }\n\n return $itemsInCart;\n\n // return count($this->items);\n \n }", "public function GetCartSessionTotal()\n\t{\n\t\tsession_start();\n\t\t$totalqty = '';\n\t\t$totalcart = '';\n\t\t$totaldiscount = '';\n\t\t/* Check if session set then */\n\t\tif(isset($_SESSION[$this->CartName()]))\n\t\t{\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tforeach( $_SESSION[$this->CartName()] as $eachItem)\n\t\t\t{\n\t\t\t\t\t\n\t\t\t\t/* Get total quentity */\n\t\t\t\t$totalqty += $eachItem[\"qty\"];\n\t\t\t\t\n\t\t\t\t/* Get total amount */\n\t\t\t\t$totalcart += $eachItem[\"totalamount\"];\n\t\t\t\t\n\t\t\t\t/* Total discount */\n\t\t\t\t$totaldiscount += $eachItem[\"discount\"];\n\t\t\t}\n\t\t\t\n\t\t\t/* Set the data in array */\n\t\t\t$totalcalculation = [[\"totalqty\"=>$totalqty,\"totalcart\"=>$totalcart,\"totaldiscount\"=>$totaldiscount]];\n\t\t\t\n\t\t\treturn $totalcalculation;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function totalItems(){\r\n $items=\"SELECT SUM(qty) as total_items from cart\";\r\n return $this->query($items);\r\n }", "public static function getTotalQuantity()\n {\n return Cart::where('user_id', self::$user)->count();\n }", "public function total()\n\t{\n\t\tif (!isset($this->total))\n\t\t{\n\t\t\t$this->items();\n\t\t}\n\n\t\treturn $this->total;\n\t}", "public function totalItems()\n {\n return array_sum(\n array_map(function (CartItem $item) {\n return $item->quantity;\n }, $this->items)\n );\n }", "public static function GetTotalAmount()\n\t{\n\t\t$sql = 'CALL shopping_cart_get_total_amount(:cart_id)';\n\t\t$params = array (':cart_id' => self::GetCartId());\n\t\treturn DatabaseHandler::GetOne($sql, $params);\n\t}", "public function total()\n {\n $sum = '0.00';\n foreach ($this->items as $item) {\n $price = bcmul($item['item']->getPrice(), (string)$item['qty'], 2);\n $sum = bcadd($sum, $price, 2);\n }\n return $sum;\n }", "public function getTotalPrice(){\n $total = 0;\n foreach($this->items as $k=>$v){\n $total += ($v['price']*$v['qty']);\n };\n return $total;\n }", "public function total(): float\n {\n $total = 0;\n /* Boucle chaque element du panier, recupere le prix grace a la liaison product/Stock * quantité */\n foreach ($this->getFullCart() as $item) {\n $total += $item['stock']->getUnitPrice() * $item['quantity'];\n }\n return $total;\n }", "public function total()\n {\n return decimalFormat($this->products->sum(function ($product) {\n return $product->pivot->price_with_tax * $product->pivot->quantity;\n }, 0) + $this->carrier->price);\n }", "protected function get_cart_subtotal_for_order()\n {\n }", "public function getTotal() {\n\t\t$discAmount = $this->unit_price - ($this->unit_price * ($this->discount_rate / 100));\n\t\treturn $discAmount * $this->quantity;\n\t}", "function cart_subtotal () {\r\n $subtotal = 0;\r\n $cart = cart_get_items();\r\n foreach ($cart as $item) {\r\n $subtotal += $item['price'] * $item['quantity'];\r\n }\r\n return $subtotal;\r\n}", "public function totalItems($cart)\n {\n $totalItems = 0;\n if(is_array($cart))\n {\n foreach ($cart as $id=>$qty)\n {\n $totalItems +=$qty;\n }\n return $totalItems;\n }\n }", "public function get_total_cost()\n\t{\n\t\t$num = '0.00';\n\n\t\tif (isset($_SESSION['cart'])) // checks there are items to display\n\t\t{\n\t\t\t// get product id's\n\t\t\t$ids = $this->get_ids();\n\n\t\t\t//get products prices\n\t\t\tglobal $Products;\n\t\t\t$prices = $Products->get_prices($ids); // return array of prices set\n\n\t\t\t// loop through, adding cost of each item x the number of the item in the cart then add to $num\n\t\t\tif ($prices != NULL)\n\t\t\t{\n\t\t\t\tforeach ($prices as $price)\n\t\t\t\t{\n\t\t\t\t\t$num += doubleval($price['price'] * $_SESSION['cart'][$price['id']]); \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "public function testCartTotal() {\n \n $data['product_id'] = 1;\n $data['quantity'] = 2;\n\n $cartService = new ShoppingCartService();\n $this->assertTrue($cartService->addToCart($data));\n \n $this->assertEquals($cartService->getCartTotal(), 200);\n \n $data['product_id'] = 2;\n $data['quantity'] = 2;\n $this->assertTrue($cartService->addToCart($data));\n \n $this->assertEquals($cartService->getCartTotal(), 220.50);\n \n }", "function getTotalAmountDue()\n\t{\n\t\t// get the order object\n\t\t$order = $this->_order; // a TableOrders object (see constructor)\n\n\t\t$model = $this->getModel('carts');\n\t\t$view = $this->getView( 'carts', 'html' );\n\t\t$view->set( '_controller', 'carts' );\n\t\t$view->set( '_view', 'carts' );\n\t\t$view->set( '_doTask', true);\n\t\t$view->set( 'hidemenu', true);\n\t\t$view->setModel( $model, true );\n\t\t$view->assign( 'state', $model->getState() );\n\t\t$view->assign( 'order', $order );\n\t\t$orderitems = $order->order_total;\n\t\t$view->assign( 'orderitems', $orderitems );\n\n\t\t$view->setLayout( 'total' );\n\n\t\tob_start();\n\t\t$view->display();\n\t\t$html = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $html;\n\t}", "public function getCartTotalPriceAttribute()\n {\n return ($this->cart->count()) ? $this->cart->sum(function($cart) {\n return $cart->final_price * $cart->pivot->quantity;\n }) : 0;\n }", "public static function total_in_cart()\n {\n if (auth()->check()) {\n $user_cart = Cart::where('user_id', auth()->user()->id)->orderBy('created_at', 'desc')->first();\n if ($user_cart) {\n return count(json_decode($user_cart->cart_items, true));\n } else {\n return 0;\n }\n }\n return session('cart') ? count(session('cart')) : 0;\n }", "public function total(){\n $total = 0;\n foreach($this->items as $item){\n $total = $total + $item->total();\n }\n return $total;\n }", "public function subtotal()\n\t{\n\t\t$total \t\t\t= 0;\n\t\t$cartCollection = $this->getCartCollection();\n\n\t\tif(empty($cartCollection))\n\t\t{\n\t\t\treturn $total;\n\t\t}\n\n\t\tforeach($cartCollection as $row)\n\t\t{\n\t\t\t$total += $row->subtotal;\n\t\t}\n\n\t\treturn $total;\n\t}", "public function total()\n {\n return $this->total;\n }", "public function getItemsTotal()\n {\n return $this->itemsTotal;\n }", "public function get_cart_discount_total()\n {\n }", "public function totalQuantity(){\r\n //return $this->getCart()->totalQty;\r\n }", "public function totalQuantity(){\r\n //return $this->getCart()->totalQty;\r\n }", "public static function getSum()\n {\n $items = Cart::where('user_id', self::$user)->get();\n $sum = 0;\n foreach ($items as $item) {\n $product = self::getProduct($item->product_id);\n $sum += $item->count * $product->cost;\n }\n return $sum;\n }", "public function getTotalPrice()\n {\n return $this->getPrice() * $this->getQuantity();\n }", "function total_items($cart){\n\t\t$items = 0;\n\t\tif(is_array($cart)){\n\t\t\tforeach($cart as $id => $qty){\n\t\t\t\t$items += $qty;\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function total()\n {\n return round(static::subtotal() + static::tax() - static::discount());\n }", "public function TotalItems() {\n $total = 0;\n\n foreach($this->items as $item) {\n $total = $total + $item->Quantity;\n }\n\n return $total;\n }", "public function getPriceTotal()\n {\n return $this->priceTotal;\n }", "public function getTotal() {\n $total = 0;\n foreach ($this->items as $item) {\n $total += ($item->pivot->quantity * $item->pence_cost);\n }\n return $total;\n }", "public function getTotal_checkout()\n {\n return $this->total_checkout;\n }", "public function get_total(){\n\t\treturn $this->total;\n\t}", "public function getTotalQuantity()\n {\n $quantity = $this->getCartModel()->count(true);\n return $quantity;\n }", "public function getTotalQuantity()\n {\n $quantity = $this->getCartModel()->count(true);\n return $quantity;\n }", "function prixTotal(){\n $total=0;\n for($i=0,$il=count($this->itemList);$i<$il;$i++){\n $this->total += $this->itemList[$i]->prix;\n }\n return $this->total; // return le total de la commande (prix)\n }", "public function gettotal()\r\n {\r\n return $this->total;\r\n }", "public function getTotal()\n {\n return $this->total_items;\n }", "public function getQuantity()\n {\n return $this->cartItems->reduce(function($quantity, $item){\n return $quantity += $item->getQuantity();\n }, 0);\n }", "protected function calculateCartPrice()\n {\n return round($this->getContent()->get('items')->map(function ($item) {\n return $item->price;\n })->sum(), 2);\n }", "public function getTotal()\n {\n return $this->_total;\n }", "public function getTotal()\n {\n return $this->_total;\n }", "public function getTotal() {\n return $this->total;\n }", "public function getTotal()\n\t{\n\t\treturn $this->total;\n\t}", "public function getCachedContentsTotal()\n { \n $t = '';\n foreach($this->getCachedContents() as $prod)\n {\n $t += $prod->getPrice() * $prod->getQty();\n }\n\n return $t;\n }", "public static function totalCart()\n {\n $total = 0;\n $nbProducts = 0;\n foreach (session('cart') as $id => $quantity) {\n $product = Product::findOrFail($id);\n $total += ($quantity * $product->price_vat);\n $nbProducts += $quantity;\n }\n\n return [$total, $nbProducts];\n }", "public function get_total_price()\n\t{\n\t\t$cart_price\t= $this->get_cart_total_price();\n\t\t$promo_code\t= $this->get_promo_code();\n\t\t\n\t\t$this->total_price = $cart_price - $promo_code['amount'];\n\n\t\treturn $this->total_price;\n\t}", "function woocommerce_cart_totals()\n {\n }" ]
[ "0.88309443", "0.8807955", "0.8727991", "0.8711747", "0.87103444", "0.8638253", "0.82481617", "0.8215614", "0.81983477", "0.8192304", "0.81860197", "0.81468105", "0.8139706", "0.8136431", "0.8080457", "0.80510736", "0.80209416", "0.80186045", "0.79970706", "0.7980289", "0.7966971", "0.7959653", "0.7923298", "0.7915995", "0.79117686", "0.7905669", "0.78994566", "0.78436774", "0.78331065", "0.7819532", "0.78069973", "0.7794649", "0.7719836", "0.7708825", "0.7675512", "0.7668661", "0.7651731", "0.76399237", "0.7638439", "0.7603259", "0.7589852", "0.7577169", "0.75670546", "0.7560988", "0.75593626", "0.7547588", "0.7540989", "0.75368285", "0.75332415", "0.752807", "0.7521148", "0.7514592", "0.7513345", "0.7508282", "0.7507667", "0.74931234", "0.74836165", "0.74498296", "0.74480045", "0.74480045", "0.74467677", "0.74396133", "0.7409388", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.73955697", "0.7394649", "0.7385895", "0.73833495", "0.7382073", "0.7375893", "0.737581", "0.73593503", "0.73593503", "0.7358923", "0.73425937", "0.7333481", "0.7320389", "0.732001", "0.73189586", "0.73189586", "0.7317067", "0.7311013", "0.7309253", "0.730822", "0.7306268", "0.7299697" ]
0.8875874
0
Returns the cart contents.
Возвращает содержимое корзины.
public function contents() { // Get the cart contents. // $cart = $this->cart_contents[ $this->cart_name ]; // Remove these so they don't create a problem when showing the cart table. // unset($cart['total_items']); unset($cart['cart_total']); // Return the cart contents. // return $cart; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function contents()\n {\n return CartContents::collect(static::cart()->fresh()->contents);\n }", "function contents()\n\t{\n\t\treturn $this->_cart_contents['items'];\n\t}", "public function getCartContent()\n {\n $cartContent = $this->getCartModel()->content();\n return $cartContent;\n }", "public function getCartContent()\n {\n $cartContent = $this->getCartModel()->content();\n return $cartContent;\n }", "public function get_cart_contents()\n {\n }", "public function getCartContent(){\n\n\t\t$content = Cart::content();\n\t\t$cartString = \"<ul class='cd-cart-items'>\";\n\t\t$cartItem = \"\";\n\t\t$iterator = 0;\n\n\t\tforeach($content as $row)\n\t\t{\n\t\t\t $cartItem .= \"<li data-index='\".$iterator.\"'>\";\n\t\t\t $cartItem .= '<div class=\"user-cart-item-name\">'.$row->name.'</div>';\n\t\t\t $cartItem .= '<span data-product-id = \"'.$row->id.'\" class=\"cd-qty\"><span class=\"dec-button\"></span><input type=\"text\" class=\"user-cart-qty\" value=\"'.$row->qty.'\" /><span class=\"inc-button\"></span></span>';\n\t\t\t $cartItem .= '<div class=\"cd-price\">Rs '.$row->subtotal.'</div>';\n\t\t\t $cartItem .= '</li>';\n\t\t\t $iterator++;\n\t\t}\n\n if(empty($cartItem)){\n \t$cartString .= \"<span class='cart-empty'>Your cart is empty .</span>\";\n \t$cartString .= \"</ul>\";\n }\n else{\n \t $cartString .= $cartItem;\n \t $cartString .= \"</ul>\";\n \t $cartString .= '<div class=\"cd-cart-total\"><p>Total <span>Rs '.Cart::total().'</span></p></div>';\n $cartString .= '<a href=\"\" class=\"checkout-btn\">Checkout</a>';\n }\n\n\t\t return $cartString;\n\t}", "public function getContents()\n {\n $products = $this->cart->contents();\n\n return view('escritor::cart.all')->with('products', $products);\n }", "public function getContent()\n\t{\n\t\tif( ! $this->cart ){\n\t\t\t$this->cart = $this->session->has( $this->getInstance() ) ? $this->session->get( $this->getInstance() ) : new CartCollection([\n\t\t\t\t'items' => new CartCollection,\n\t\t\t\t'conditions' => new CartItemConditionsCollection\n\t\t\t]);\n\t\t}\n\n\t\treturn $this->cart;\n\t}", "public function getContent()\n {\n return $this->session->has($this->cartName)\n ? $this->session->get($this->cartName)\n : new Collection([\n 'totalPrice' => 0.0,\n 'sourcePrice' => 0.0,\n 'discounts' => new Collection(),\n 'items' => new Collection()\n ]);\n }", "public function contents(){\n // rearrange the newest first\n $cart = array_reverse($this->carrello);\n\n // remove these so they don't create a problem when showing the cart table\n unset($cart['numero_prodotti']);\n unset($cart['totale']);\n\n return $cart;\n }", "public function actionGetCart() {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n $session = Yii::$app->session;\n return ['items' => $session['scientific-object']];\n }", "public function content()\n\t{\n\t\t$cartCollection = $this->getCartCollection();\n\n\t\treturn (empty($cartCollection)) ? null : $cartCollection;\n\t}", "public function getContent() {\n $this->cartStatus = $this->session->db->prepare(\"SELECT cartId FROM user_info WHERE data = ?\");\n $this->cartStatus->bind_param(\"s\", $this->user);\n $this->cartStatus->execute();\n $this->cartStatus->store_result();\n $this->cartStatus->bind_result($cid);\n $this->cartStatus->fetch();\n\n // Get the product id and quantity in json form.\n $this->result = $this->session->db->prepare(\"SELECT productId, quantity FROM carts WHERE cartID = ?\");\n $this->result->bind_param(\"i\", $cid);\n $this->result->execute();\n $this->result->bind_result($p, $q);\n while ($this->result->fetch()) {\n $this->display[] = [\n \"pid\" => $p,\n \"qty\" => $q,\n ];\n }\n return $this->display;\n }", "public function contents(){ \r\n // rearrange the newest first \r\n $cart = array_reverse($this->cart_contents); \r\n \r\n // ukloni ih da ne bi pravili probleme pri kupovini \r\n unset($cart['total_items']); \r\n unset($cart['cart_total']); \r\n \r\n return $cart; \r\n }", "function cart_content() {\n\n $output = \"\";\n $cart = $_SESSION[\"cart\"];\n foreach ($cart as $cart_item) {\n $output .= $cart_item[\"size\"] . $cart_item[\"cut\"] . $cart_item[\"price\"] . $cart_item[\"quantity\"];\n }\n return $output;\n}", "public function getFullCart() {\n $items = $this->get('content');\n $items->discount = session('discount');\n $items->total = $this->get('total') - session('discount');\n\n return $items;\n }", "public function get_removed_cart_contents()\n {\n }", "public function getCart();", "public function getCart();", "protected function getCustomerCart()\n {\n return $this->magentoCustomerToken()->api('cartItems')->mine()->json();\n }", "public function cart() {\n return view('pages.client.cart', $this->data);\n }", "public function getCartContentMobile(){\n\n\t\t\n $content = Cart::content();\n $cartString = \"<ul class='cd-cart-items'>\";\n $cartItem = \"\";\n $iterator = 0;\n\n foreach($content as $row)\n {\n $cartItem .= \"<li data-index='\".$iterator.\"'>\";\n $cartItem .= '<div class=\"user-cart-item-name\">'.$row->name.'</div>';\n $cartItem .= '<span data-product-id = \"'.$row->id.'\" class=\"cd-qty\"><span class=\"dec-button\"></span><input type=\"text\" class=\"user-cart-qty\" value=\"'.$row->qty.'\" /><span class=\"inc-button\"></span></span>';\n $cartItem .= '<div class=\"cd-price\">Rs '.$row->subtotal.'</div>';\n $cartItem .= '</li>';\n $iterator++;\n }\n\n if(empty($cartItem)){\n $cartString .= \"<span class='cart-empty'>Your cart is empty .</span>\";\n $cartString .= \"</ul>\";\n }\n else{\n $cartString .= $cartItem;\n $cartString .= \"</ul>\";\n }\n\n return $cartString;\n\t}", "function getCart() ;", "public function returnCartItems(){\n $bookArray = $this->bookCtr->returnBooks($this->cartCookie->getCook());\n return $bookArray;\n }", "private function loadcartdetails(){\n\t\t$this->load->library(\"cart\");\n\t\t$count = 0;\n\t\tforeach($this->cart->contents() as $items){\n\t\t\t$count++;\n\t\t}\n\t\t$output=\"\n\t\t<img src='\".base_url().\"/assets/images/rupees.png'/>\n\t\t<span class='simpleCart_total'>\".$this->cart->total().\"</span> (<span class='simpleCart_quantity'>\".$count.\"</span> items)</div>\n\t\t\";\n\n\t\treturn $output;\n\t}", "public function getCart()\n {\n // ######## please do not alter the following code ########\n $products = [\n [ \"name\" => \"Sledgehammer\", \"price\" => 125.75 ],\n [ \"name\" => \"Axe\", \"price\" => 190.50 ],\n [ \"name\" => \"Bandsaw\", \"price\" => 562.131 ],\n [ \"name\" => \"Chisel\", \"price\" => 12.9 ],\n [ \"name\" => \"Hacksaw\", \"price\" => 18.45 ],\n ];\n // ########################################################\n\n //Image paths for product thumbnail images\n $images = [\n \"images/sledge.jpg\",\n \"images/axe.jpg\",\n \"images/bandsaw.jpg\",\n \"images/chisel.jpg\",\n \"images/hacksaw.jpg\"\n ];\n\n $productList = cartHelper::initProductList($products, $images);\n\n $cartItems = $this->cart->items();\n $cartTotal = $this->cart->totalPrice();\n\n //Display the shopping cart view with cart items and total populated\n return view('home.index', [\n \"cartItems\" => $cartItems,\n 'cartTotal' => $cartTotal,\n 'products' => $productList\n ]);\n }", "public function index()\n\t{\n return array_values(Cart::contents(true));\n\t}", "public function frontendCart()\n {\n// waLog::log(print_r($cart, true), '111logProds.log');\n\n\n\n $path = wa('shop')->getAppPath('plugins/postponedbasket/templates/cart.html');\n $view = wa()->getView();\n //$thisCountry = shopServicepluginPlugin::generateSelCountry();\n //$view->assign('row', $thisCountry);\n $html = $view->fetch($path);\n return $html;\n\n }", "public function getCart()\n {\n return $this->cart;\n }", "public function getCart(){\n\t\treturn cart::all();\n\t}", "public function getCart(){\n\t\treturn cart::all();\n\t}", "function getCart() {\n\t\treturn $this->cart;\n\t}", "function cartContents()\n{\n global $HTTP_SESSION_VARS;\n \n $display = array_slice($HTTP_SESSION_VARS['cart'], -3, 3);\n // we want them in reverse chronological order\n $display = array_reverse($display, true);\n \n $result = '';\n $counter = 0;\n \n // abbreviate the names if they are long\n foreach($display as $product)\n {\n if(strlen($product['name'])<=40)\n $result .= $product['name'].'<br />';\n else\n $result .= substr($product['name'], 0, 37).'...<br />';\n $counter++;\n } \n \n // add blank lines if the cart is nearly empty to keep the \n // display the same\n for(;$counter<3; $counter++) \n {\n $result .= '<br />';\n }\n return $result;\n}", "public function get_cart()\n {\n }", "public function getCart() {\n return $this->cart;\n }", "function getCart(){\n $cart_id = Session::get('carty.cart_id',false);\n\n if(!$cart_id) {\n $cart_id = $this->initCart();\n }\n else{\n $cart = Cart::find(Session::get('carty.cart_id'));\n\n if($cart == null){\n $cart_id = $this->initCart();\n }\n }\n\n try {\n $contents = DB::select(\"SELECT\nproduct_id,\nquantity,\n`name`,\nprice_per_unit\nFROM cart_contents\nINNER JOIN products ON product_id = products.id\nWHERE cart_id = ?\", array($cart_id));\n } catch(\\Exception $e){\n Log::error($e->getMessage(),array(__CLASS__,__FUNCTION__));\n Log::error($e->getTraceAsString(),array(__CLASS__,__FUNCTION__));\n\n return Response::json(array(\n 'success'=>false,\n 'message'=>\"error retrieving cart\"\n ), 500);\n }\n\n $cart_contents = array(\n 'success'=>true,\n 'cart_id'=>$cart_id,\n 'products'=>array(),\n 'subtotal'=>0,\n 'gst'=>0,\n 'pst'=>0,\n 'total'=>0\n );\n\n foreach($contents as $row){\n $total = $row->quantity*$row->price_per_unit;\n $product = array(\n 'id'=>$row->product_id,\n 'name'=>$row->name,\n 'quantity'=>$row->quantity,\n 'price_per_unit'=>number_format($row->price_per_unit,2),\n 'total'=> number_format($total,2)\n );\n\n $cart_contents['subtotal'] += $total;\n\n $cart_contents['products'][]=$product;\n }\n\n $cart_contents['gst'] = number_format(Config::get('carty::taxes.GST')*$cart_contents['subtotal'],2);\n $cart_contents['pst'] = number_format(Config::get('carty::taxes.PST')*$cart_contents['subtotal'],2);\n $cart_contents['total'] = number_format($cart_contents['subtotal'] + $cart_contents['gst'] + $cart_contents['pst'],2);\n\n $cart_contents['subtotal'] = number_format($cart_contents['subtotal'],2);\n\n return Response::json($cart_contents);\n }", "public function cart()\r\n {\r\n return $this->__cart;\r\n }", "protected function getCartData()\n {\n $cart = array();\n\n $items = $this->getItems();\n\n // If no cart (no item bag of items) has been set, then return.\n\n if (!isset($items)) {\n return $cart;\n }\n\n $item_count = $items->count();\n\n // Each item must be sequentially numbered.\n $item_number = 1;\n\n foreach ($items as $item) {\n //$item_id = $item->getParameter('sku');\n $item_description = $item->getName();\n $item_quantity = $item->getQuantity();\n $item_price = $item->getPrice();\n //$item_total = $item->getParameter('total');\n\n if (isset($item_id) && $item_id != '') {\n $cart['itemId' . $item_number] = $item_id;\n }\n\n if (isset($item_description)) {\n $cart['itemDescription' . $item_number] = $item_description;\n }\n\n // The Helcim API requires the quantity to be at least one (so 0.5kg is, in theory, invalid).\n // However, I believe it is the Helcim documentation that is incorrect here.\n if (isset($item_quantity)) {\n $cart['itemQuantity' . $item_number] = $item_quantity;\n }\n\n if (isset($item_price)) {\n $cart['itemPrice' . $item_number] = $item_price;\n }\n\n if (isset($item_total) && $item_total != '') {\n $cart['itemTotal' . $item_number] = $item_total;\n } else {\n // Calculate the item total, if possible, from the quantity and per-item cost.\n if (is_numeric($item_quantity) && is_numeric($item_price)) {\n $cart['itemTotal' . $item_number] = $item_quantity * $item_price;\n }\n }\n\n $item_number++;\n }\n\n return $cart;\n }", "public function getCartInfo(): array\n {\n return [\n 'cart' => Cart::content(),\n 'subtotal' => Cart::subtotal(2, '.', ','),\n 'tax' => Cart::tax(2, '.', ','),\n 'total' => Cart::total(2, '.', ',')\n ];\n }", "public function DisplayCart()\n\t{\tob_start();\n\t\tif ($cart = $this->GetCart())\n\t\t{\techo '<div class=\"orderDetails\"><h3>Cart started ', date('H:i:s', strtotime($cart->details['created'])), '</h3><table><tr><th></th><th>Item</th><th>Quantity<br />added/removed</th></tr>';\n\t\t\t$products = array();\n\t\t\tforeach ($cart->items as $item)\n\t\t\t{\tif (!$products[$prod_key = $item['ptype'] . '|' . $item['pid']])\n\t\t\t\t{\t$p = $this->GetProduct($item['pid'], $item['ptype']);\n\t\t\t\t\t$products[$prod_key] = array('desc'=>$item['ptype'] . ' - ' . $p->GetName(), 'qty'=>0);\n\t\t\t\t}\n\t\t\t\t$products[$prod_key]['qty'] += $item['qty'];\n\t\t\t\techo '<tr class=\"cartitem_', $item['qty'] > 0 ? 'plus' : 'minus', '\"><td>', date('H:i:s', strtotime($item['addtime'])), '</td><td>', $products[$prod_key]['desc'], '</td><td>', $item['qty'] > 0 ? '+' : '', $item['qty'], ' (', $products[$prod_key]['qty'], ')</td></tr>';\n\t\t\t}\n\t\t\techo '</table></div>';\n\t\t}\n\t\treturn ob_get_clean();\n\t}", "public function getCart()\n {\n $cart = json_decode(request()->cookie('cart'), true);\n\n return response()->json($cart, 200);\n }", "protected function getContentItems()\n\t{\n\t\t$content = $this->getContent();\n\n\t\treturn $content->get('items', new CartCollection([]));\n\t}", "public function getCartItems()\n {\n return $this->cartItems;\n }", "public function getCartItems()\n {\n return $this->cartItems;\n }", "public function renderCart() {\n $cartContent = $this->getCartContent();\n $cartViewData = $this->prepareCartView($cartContent);\n $currencySymbol = \\Config::get('appConstants.currency_sign');\n $cartTotal = $this->getTotal($addDriverCharges = true);\n $charges = $this->getCartModel()->getDeliveryCharges();\n $appliedCoupon = $this->getCartModel()->getCouponDetails();\n return view('customer.order-basket', compact('cartViewData', 'charges', 'currencySymbol', 'cartTotal', 'appliedCoupon'));\n }", "public function getCart(){\r\n\t\treturn Mage::getSingleton('checkout/cart');\r\n\t}", "public function getCartData()\n {\n $userid = \\Request::getClientIp(true);\n\n $usercartdatas = Cart::session($userid)->getContent();\n\n\n return view('frontend.include.ajaxview.mobile._cartheader', compact('usercartdatas'));\n }", "private function cart()\n {\n $cart = (new Cart)->tambahProduk(\n $this->produk(), \n $this->qty()\n );\n\n return $cart;\n }", "public function getShoppingCarts()\n {\n $url = \"/shopping-carts\";\n $req = $this->createRequest($url);\n $res = $this->doRequest($req);\n\n return $res[0];\n }", "public function get_cart_checkout()\n\t{\n\t\t$cart_contents = $this->cart_contents;\n\t\t\n\t\t$cart = array();\n\t\n\t\tif( !$this->is_cart_empty() ) :\n\t\t\tforeach( $cart_contents as $item ) :\n\t\t\t\t// Check Product ID if exists in Cart.\n\t\t\t\tif( !array_key_exists( $item['ID'], $cart ) ) :\n\t\t\t\t\t// Gravity Forms\n\t\t\t\t\t$gform = ( isset( $item['gform'] ) ) ? $item['gform'] : NULL;\n\t\t\t\t\n\t\t\t\t\t$cart[ $item['ID'] ] = array(\n\t\t\t\t\t\t'ID'\t\t\t=> $item['ID'],\n\t\t\t\t\t\t'post_id'\t\t=> $item['post_id'],\n\t\t\t\t\t\t'name'\t\t\t=> $item['name'],\n\t\t\t\t\t\t'price'\t\t\t=> $item['price'],\n\t\t\t\t\t\t'total_price'\t=> $item['price'],\n\t\t\t\t\t\t'quantity'\t\t=> 1,\n\t\t\t\t\t\t'gform'\t\t\t=> $gform,\n\t\t\t\t\t);\n\t\t\t\telse:\n\t\t\t\t\t$cart[ $item['ID'] ]['total_price'] += $item['price'];\n\t\t\t\t\t$cart[ $item['ID'] ]['quantity']++;\n\t\t\t\tendif;\n\t\t\n\t\t\t\t$this->cart_total_price += $item['price'];\n\t\t\n\t\t\tendforeach;\n\t\tendif;\n\n\t\treturn $cart;\n\t}", "public function get()\n {\n return [\n 'data' => $this->carts,\n ];\n }", "public function showCart() {\n $client = new ApiClient();\n $cartData = $client->getData();\n echo <<<HTML\n<html>\n<head><title>Your Cart</title></head>\n<body>\n\n<table>\n\n <tr><th>Item name</th><th>Quantity</th></tr>\n\n <tr>\n <td>{$cartData[0][\"item\"]}</td>\n <td>{$cartData[0][\"quantity\"]}</td>\n </tr>\n\n <tr>\n <td>{$cartData[1][\"item\"]}</td>\n <td>{$cartData[1][\"quantity\"]}</td>\n </tr>\n\n</table>\n\n</html>\nHTML;\n }", "public function items()\n\t{\n\t\t$cart = $this->getContentItems();\n\n\t\treturn (empty($cart)) ? NULL : $cart;\n\t}", "public function ListCarts(){\n\t\treturn OrderSource::ListCarts($this->api_user, $this->api_key);\n\t}", "protected function get_items_from_cart()\n {\n }", "public function getCart()\n {\n $this->products = session('cart', collect());\n\n return [\n 'total_sum' => $this->getTotalSum(),\n 'products_count' => $this->getProductsCount(),\n 'products' => array_values($this->products->toArray())\n ];\n }", "public function get_cart_contents_total()\n {\n }", "static function viewCartItems() {\n if (auth()->user()) {\n $user_id = auth()->user()->id;\n $carts = Cart::where('user_id', $user_id)->get();\n return $carts;\n }\n }", "public function getCart()\n {\n \tif (!Session::has('cart')) {\n \t\treturn view('shop.shoppingCart');\n \t}\n \t// otherwise, if we do have a cart \n \t$oldCart = Session::get('cart');\n \t$cart = new Cart($oldCart);\n \treturn view('shop.shoppingCart', ['products' => $cart->items, 'totalPrice' => $cart->totalPrice]);\n }", "public function cart()\n {\n // check if we don't have cart session, return cart page\n if(!Session::has('cart'))\n {\n return view('client.cart');\n }\n // check if we have a cart -> get it's data in session\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n // create an object from Caert class\n $cart = new Cart($oldCart);\n return view('client.cart', ['products' => $cart->items, 'sum' => 0]);\n }", "public function showCart() {\n return $this->cart->show_cart ();\n }", "public function getCart(){\n $this->request->type = 'get';\n $this->request->method = '/rest/cart';\n if (!is_null($this->cart->cartId))\n $this->request->method .= '/' . $this->cart->cartId;\n $this->doCall();\n $this->setCart();\n }", "public function getShoppingCart()\n {\n if (isset($_SESSION['shoppingCart'])) {\n return $_SESSION['shoppingCart'];\n } else {\n return [];\n }\n }", "public function getCartData()\n {\n $selectColumns = ['id', 'subtotal', 'discount', 'discount_percentage', 'coupon_id', 'shipping_charges', 'net_total', 'tax', 'total', 'round_off', 'payable'];\n\n $cartData = Cart::with($this->cartItemsQuery())\n ->where($this->cartIdentifier())\n ->first($selectColumns)\n ;\n\n // If there is no cart record for the logged in customer, try with cookie identifier\n if (! $cartData && Auth::guard(config('cart_manager.auth_guard'))->check()) {\n $cartData = Cart::with($this->cartItemsQuery())\n ->where($this->getCookieElement())\n ->first($selectColumns)\n ;\n\n if ($cartData) {\n $this->assignCustomerToCartRecord();\n }\n }\n\n if (! $cartData) {\n return [];\n }\n\n return $cartData->toArray();\n }", "public function loadCart()\n {\n $this->getCart()->load([\n 'items.inventory.product' => function ($product) {\n $product->joinPrice()->with('thumbnails');\n },\n 'items.inventory.optionValues.option',\n 'promotion',\n ]);\n\n return $this->cart;\n }", "public function getAllCarts(){\n return Cart::latest()->get();\n }", "public function cart();", "function display_cart() {\r\n\t\techo $this->build_cart($params);\r\n\t}", "public function getInvoiceCart();", "function ark_woocommerce_get__cart_menu_item__content() {\n\t\tob_start();\n\t\techo '<div class=\"navbar-actions-shrink shopping-cart\">';\n\n\t\t\techo '<a href=\"javascript:void(0);\" class=\"shopping-cart-icon-container ffb-cart-menu-item\">';\n\t\t\t\techo '<span class=\"shopping-cart-icon-wrapper\" title=\"' . WC()->cart->get_cart_contents_count() . '\">';\n\t\t\t\techo '<span class=\"shopping-cart-menu-title\">';\n\t\t\t\t\techo get_the_title( wc_get_page_id('cart') );\n\t\t\t\t\techo '&nbsp;';\n\t\t\t\techo '</span>';\n\t\t\t\techo '<i class=\"icon-shopping-cart\"></i> ';\n\t\t\t\techo '</span>';\n\t\t\techo '</a>';\n\n\t\t\techo '<div class=\"shopping-cart-menu-wrapper\">';\n\t\t\t\twc_get_template( 'cart/mini-cart.php', array('list_class' => ''));\n\t\t\techo '</div>';\n\n\t\techo '</div>';\n\t\treturn ob_get_clean();\n\t}", "public function currentCart()\n {\n $productService = app()->make(ProductService::class);\n return collect($this->cart)->map(\n function ($amount, $product_id) use ($productService) {\n\n if ($product = $productService->getProduct($product_id)) { //get each product and get amount and total cost\n $product['amount'] = $amount;\n $product['total_price'] = $amount * $product['price']; //get total cost\n return $product;\n }\n }\n )\n ->filter() // Filter null\n ->toArray();\n }", "public function get_cart_for_session()\n {\n }", "public static function get_cart()\n {\n if (auth()->check()) {\n $user_cart = Cart::where('user_id', auth()->user()->id)->orderBy('created_at', 'desc')->first();\n\n // $user_cart = auth()->user()->cart;\n if ($user_cart) {\n return json_decode($user_cart->cart_items, true);\n }\n return array();\n }\n if (session()->has('cart')) {\n return session('cart');\n } else {\n return array();\n }\n }", "public function get_cart()\n\t{\n\t\t$cart = '\n\t\t\t\t\t<table >\n\t\t\t\t\t\t<tbody>';\n\t\t\n\t\tforeach ($this->cart->contents() as $items): \n\n\t\t\t$cart_product_id = $items['id'];\n\t\t\t\n\t\t\t//get product details\n\t\t\t$product_details = $this->products_model->get_product($cart_product_id);\n\t\t\t\n\t\t\tif($product_details->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$product = $product_details->row();\n\t\t\t\t\n\t\t\t\t$product_thumb = $product->product_thumb_name;\n\t\t\t\t$total = number_format($items['qty']*$items['price'], 0, '.', ',');\n\t\t\t\n\t\t\t\t$cart .= '\n\t\t\t\t\t\t\t<tr class=\"miniCartProduct\">\n\t\t\t\t\t\t\t\t<td style=\"20%\" class=\"miniCartProductThumb\">\n\t\t\t\t\t\t\t\t\t<div> \n\t\t\t\t\t\t\t\t\t\t<a href=\"#\"> \n\t\t\t\t\t\t\t\t\t\t\t<img src=\"'.base_url().'assets/images/products/images/'.$product_thumb.'\" alt=\"'.$items['name'].'\"> \n\t\t\t\t\t\t\t\t\t\t</a> \n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td style=\"40%\">\n\t\t\t\t\t\t\t\t\t<div class=\"miniCartDescription\">\n\t\t\t\t\t\t\t\t\t\t<h4> <a href=\"#\"> '.$items['name'].' </a> </h4>\n\t\t\t\t\t\t\t\t\t\t<div class=\"price\"> <span> KES '.number_format($items['price'], 0, '.', ',').' </span> </div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td style=\"10%\" class=\"miniCartQuantity\"><a > X '.$items['qty'].' </a></td>\n\t\t\t\t\t\t\t\t<td style=\"15%\" class=\"miniCartSubtotal\"><span> KES '.$total.' </span></td>\n\t\t\t\t\t\t\t\t<td style=\"5%\" class=\"delete\"><a style=\"color:red;\" href='.$items['rowid'].' class=\"delete_cart_item\"> <i class=\"glyphicon glyphicon-trash\"></i> </a></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t';\n\t\t\t}\n\t\t\n\t\tendforeach; \n\t\t\n\t\t$cart .= '\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>';\n\t\t\n\t\treturn $cart;\n\t}", "public function display_cartPage()\n {\n $cart = $this->container->make(CartManager::class)->getHtmlData();\n }", "public function getProducts() {\n $this->calculateTotals();\n return $this->contents;\n}", "function getRightCartContent() {\r\n /* $objCore = new Core();\r\n $varCartTotal = 0;\r\n $varCartSubTotal = 0;\r\n $arrData['arrCartDetails'] = $this->myCartDetails();\r\n ?>\r\n <div class=\"my_cart\">\r\n <h5>My <span>Cart</span></h5>\r\n <div class=\"my_cart_inner\">\r\n <div <?php if(count($arrData['arrCartDetails']['Product'])+count($arrData['arrCartDetails']['Package'])+count($arrData['arrCartDetails']['GiftCard'])>LIST_CART_BOX_LIMIT) {?> class=\"scroll-pane\" <?php } ?>>\r\n <ul>\r\n <?php\r\n $i=0;\r\n foreach ($arrData['arrCartDetails']['Product'] as $kCart => $valCart) {\r\n $varCartSubTotal = $_SESSION['MyCart']['Product'][$valCart['pkProductID']][$i]['qty'] * $valCart['FinalPrice'];\r\n ?>\r\n <li id=\"cart<?php echo $valCart['pkProductID']; ?>\">\r\n <div class=\"bottom_border\">\r\n <?php\r\n if ($valCart['ImageName'] <> '') {\r\n $varSrc = UPLOADED_FILES_URL . '/images/products/70x70/' . $valCart['ImageName'];\r\n } else {\r\n $varSrc = UPLOADED_FILES_URL . '/images/products/70x70/no-image.jpeg';\r\n }\r\n ?>\r\n <div class=\"image\"><a href=\"<?php echo $objCore->getUrl('product.php',array('id'=>$valCart['pkProductID'],'name'=>$valCart['ProductName'],'refNo'=>$valCart['pkProductID']));?>\"><img src=\"<?php echo $varSrc; ?>\" alt=\"<?php echo $valCart['ProductName']; ?>\" width=\"40\" height=\"38\" /></a>\r\n\r\n </div>\r\n <div class=\"details\">\r\n <a href=\"<?php echo $objCore->getUrl('product.php',array('id'=>$valCart['pkProductID'],'name'=>$valCart['ProductName'],'refNo'=>$valCart['pkProductID']));?>\"><?php echo ucfirst($valCart['ProductName']); ?></a><br />\r\n <span class=\"amt_qty\"><?php echo $_SESSION['MyCart']['Product'][$valCart['pkProductID']][$i]['qty']; ?> x <?php echo $objCore->getPrice($valCart['FinalPrice']); ?></span>\r\n <h5><?php echo $objCore->getPrice($varCartSubTotal); ?></h5>\r\n </div></div>\r\n <div class=\"delete\"><a href=\"#\" onclick=\"RemoveProductFromCart(<?php echo $valCart['pkProductID']; ?>,<?php echo $_SESSION['MyCart']['Product'][$valCart['pkProductID']]['qty']; ?>);\"><img src=\"<?php echo IMAGE_FRONT_PATH_URL ;?>close.png\" alt=\"Close\" /></a></div>\r\n </li>\r\n <?php\r\n $varCartTotal += $varCartSubTotal;\r\n $i++;\r\n }\r\n\r\n\r\n foreach ($arrData['arrCartDetails']['Package'] as $kPKG => $vPKG) {\r\n $varCartSubTotal = $_SESSION['MyCart']['Package'][$vPKG['pkPackageId']]['qty'] * $vPKG['PackagePrice'];\r\n ?>\r\n <li id=\"cart<?php echo $vPKG['pkProductID']; ?>\">\r\n <div class=\"bottom_border\">\r\n <?php\r\n if(!empty($vPKG['PackageImage'])){$varPackageSrc = UPLOADED_FILES_URL . 'images/package/73x73/'.$vPKG['PackageImage'];}\r\n else{$varPackageSrc = UPLOADED_FILES_URL . 'images/package/73x73/no-image.jpeg';}\r\n ?>\r\n <div class=\"image\"><img src=\"<?php echo $varPackageSrc; ?>\" alt=\"<?php echo $vPKG['PackageName']; ?>\" width=\"40\" height=\"38\" />\r\n\r\n </div>\r\n <div class=\"details\">\r\n <a href=\"product.php?pid=<?php echo $vPKG['pkPackageId']; ?>\"><?php echo ucfirst($vPKG['PackageName']); ?></a><br />\r\n <span class=\"amt_qty\"><?PHP echo $_SESSION['MyCart']['Package'][$vPKG['pkPackageId']]['qty']; ?> x <?php echo $objCore->getPrice($vPKG['PackagePrice']); ?></span>\r\n <h5><?php echo $objCore->getPrice($varCartSubTotal); ?></h5>\r\n </div></div>\r\n <div class=\"delete\"><a href=\"#\" onclick=\"RemovePackageFromCart(<?php echo $vPKG['pkPackageId']; ?>,<?PHP echo $_SESSION['MyCart']['Package'][$vPKG['pkPackageId']]['qty']; ?>);\"><img src=\"<?php echo IMAGE_FRONT_PATH_URL ;?>close.png\" alt=\"Close\" /></a></div>\r\n </li>\r\n <?php\r\n $varCartTotal += $varCartSubTotal;\r\n }\r\n\r\n foreach($arrData['arrCartDetails']['GiftCard'] as $key => $valGiftCards){\r\n $varCartSubTotal = $valGiftCards['qty'] * $valGiftCards['amount'];\r\n ?>\r\n <li id=\"RemoveGiftCard<?php echo $key;?>\">\r\n <div class=\"bottom_border\">\r\n <?php\r\n $varSrc = UPLOADED_FILES_URL . 'images/package/73x73/no-image.jpeg';\r\n ?>\r\n <div class=\"image\"><img src=\"<?php echo $varSrc; ?>\" alt=\"<?php echo $valGiftCards['message']; ?>\" width=\"40\" height=\"38\" />\r\n\r\n </div>\r\n <div class=\"details\">\r\n <?php echo ucfirst($valGiftCards['message']);?><br />\r\n <span class=\"amt_qty\"><?php echo $valGiftCards['qty'];?> x <?php echo $valGiftCards['amount'];?></span>\r\n <h5><?php echo $objCore->getPrice($varCartSubTotal);?></h5>\r\n </div></div>\r\n <div class=\"delete\"><a href=\"javascript:void(0);\" onclick=\"RemoveGiftCardFromCart('<?php echo $key;?>');\"><img src=\"<?php echo IMAGE_FRONT_PATH_URL ;?>close.png\" alt=\"Close\" /></a></div>\r\n </li>\r\n <?php\r\n $varCartTotal += $varCartSubTotal;\r\n }\r\n ?>\r\n\r\n\r\n\r\n </ul>\r\n\r\n </div>\r\n </div>\r\n <div class=\"checkout_cart\">\r\n <div class=\"subtotal\">\r\n SUBTOTAL\r\n <span><?php echo $objCore->getPrice($varCartTotal); ?></span>\r\n </div>\r\n <a href=\"<?php echo $objCore->getUrl('shopping_cart.php')?>\" class=\"checkout_button\">Checkout</a>\r\n </div>\r\n </div>\r\n <?php */\r\n }", "public function getCart()\n {\n $authService = $this->auth;\n $customerID = $authService::getUserID();\n\n $result = array();\n\n $query = \"SELECT p.product_id, ci.customer_cart_id AS cart_id, \n\t\t p.product_name, p.product_image, p.product_rate, SUM(ci.customer_cart_item_count) as product_item_count \n\t\t FROM customer_carts cc\n\t\t JOIN customer_cart_items ci on (cc.customer_cart_id = ci.customer_cart_id)\n\t\t LEFT JOIN products p ON (ci.product_id = p.product_id)\n\t\t WHERE cc.customer_id = :customer_id\n GROUP BY p.product_id, ci.customer_cart_id\";\n \n if (!$rs = $this->query($query, array(\"customer_id\" => $customerID))) {\n $this->logger::warning(\"Query failed while trying to select the cart of the customer ($customerID)\");\n $this->setError(\"QUERY_FAILED\");\n return $result;\n }\n\n if (!$res = $rs->fetchAll(\\PDO::FETCH_ASSOC)) {\n $this->logger::warning(\"No rows found while trying to select the cart of the customer ($customerID)\");\n $this->setError(\"NO_ROWS_FOUND\");\n return $result;\n } else {\n $cartItems = array();\n \n foreach ($res as $k => $row) {\n $cart_id = $row[\"cart_id\"];\n unset($row[\"cart_id\"]);\n $cartItems[] = $this->validateResult($row, $this->dataSignature);\n }\n \n $result = array(\n \"cart_id\" => $cart_id,\n \"cart_discount\" => \"0.0\",\n \"cart_items\" => $cartItems\n );\n }\n\n return $result;\n }", "public function set_cart_contents()\n\t{\n\t\tif( $this->is_cart_set() ) :\n\t\t\t$this->cart_contents = $this->wp_session['pxp_cart']->toArray();\n\t\tendif;\n\t}", "public function getCart(Request $request)\n {\n /* $this->validation(\n $request->all(),\n [\n \"cartId\" => \"required\",\n ]\n ); */\n\n //$cartId = $request->input('cartId');\n $customerCart = CustomerCart::where(['customerId' => $this->userId])->first();\n if ($customerCart) {\n if (!empty($customerCart->cartContent)) {\n $customerCart->cartContent = unserialize($customerCart->cartContent);\n } else {\n $customerCart->cartContent = [];\n }\n $this->success('Cart Items.', $customerCart, $this->successStatus);\n } else {\n $this->error('Cart does not exist', []);\n }\n\n }", "public function getCartIndex()\n {\n if (!Session::has('cart'))\n {\n return view('monkcommerce::monkcommerce-storefront.shop.cart.cart-index');\n }\n // Get items\n $cart = Session::get('cart');\n return view('monkcommerce::monkcommerce-storefront.shop.cart.cart-index', ['products' => $cart->items, 'totalPrice' => $cart->totalPrice]);\n }", "public function index()\n {\n return new CartResource(Cart::content());\n }", "public function getCardContents()\n {\n return $this->card_contents;\n }", "public function getCart()\n {\n $cart = json_decode(request()->cookie('cart'), true);\n //mengirimkan kembali dalam bentuk json untuk ditampilkan dengan vuejs\n return response()->json($cart, 200);\n }", "protected function shoppingCartItems()\n {\n if (! $this->existingCart()) {\n return;\n }\n\n return ($this->customerIsSignedIn())\n ? $this->getCustomerCart()\n : $this->getGuestCart();\n }", "function getCart(){\n\t\tif(!isset($_SESSION[$this->cart_name]) || $_SESSION[$this->cart_name] == \"\"){\n\t\t\t$_SESSION[$this->cart_name] = array();\n\t\t}\n\t\treturn $_SESSION[$this->cart_name];\n\t}", "public function cart()\n {\n return view('client.cart.index',[\n 'categories' => category::query()->where('category_id','1')->get(),\n 'footerCategories' => category::query()->where('category_id','1')->take(4)->get(),\n 'footer' => Footer::query()->first()\n ]);\n }", "public function getCart() {\n\n if (!$this->cart) {\n // We eager load a lot of relations here because we know that these are probably going to be used by other methods when processing order.\n $this->cart = $this->cartRepository->getCart(['cartItems']);\n }\n return $this->cart;\n }", "public function get_cart_from_session()\n {\n }", "public function get_cart_from_session()\n {\n }", "public function mobileGetCartData()\n {\n $userid = \\Request::getClientIp(true);\n \n $usercartdatas = Cart::session($userid)->getContent();\n \n \n return view('frontend.include.ajaxview.mobile.mobile_menu_cart', compact('usercartdatas'));\n }", "function cart_content(){\n $ct_content = array();\n $id_sesi = session_id();\n $sql = mysql_query(\"SELECT * FROM os_keranjang WHERE id_sesi='$id_sesi'\");\n while ($r=mysql_fetch_array($sql)) {\n $ct_content[] = $r;\n }\n return $ct_content;\n}", "public function index()\n {\n $cartItems = Cart::content();\n $subtotal = Cart::subtotal();\n\n return view('cart.index',compact('cartItems'),compact('subtotal'));\n }", "public function index()\n {\n $content = Cart::getContent();\n $total = Cart::getTotal();\n return view('cart.index', compact('content', 'total'));\n }", "public function get_cart()\n\t{\n\t\t$cart_contents = $this->cart_contents;\n\t\t\n\t\t$cart = array();\n\t\n\t\tprint_r($cart_contents);\n\t\n\t\t$cart_page = get_option( 'pxp_cart_page' ); // Post ID of Cart Page.\n\t\n\t\tif( !$this->is_cart_empty() ) :\n\t\t\tforeach( $cart_contents as $item ) :\n\t\t\t\t// Check Product ID if exists in Cart.\n\t\t\t\tif( !array_key_exists( $item['ID'], $cart ) ) :\n\t\t\t\t\t$featured_img_url \t= wp_get_attachment_thumb_url( get_post_thumbnail_id( $item['post_id'] ) ); \n\n\t\t\t\t\t$encrypt_key \t= pxp_encrypt_decrypt_key( 'encrypt', 'product-' . $item['ID'] );\n\t\t\t\t\t$wp_nonce\t\t= wp_create_nonce( 'pxp-product' );\n\t\t\t\t\t$remove_url \t= rtrim( get_permalink( $cart_page ), \"/\" ) . '?remove_item=' . $encrypt_key . '&_wpnonce=' . $wp_nonce;\n\t\t\t\t\n\t\t\t\t\t$product_price = get_post_meta( $item['post_id'], '_product_price', true );\n\n\t\t\t\t\t// Gravity Forms\n\t\t\t\t\t$gform = ( isset( $item['gform'] ) ) ? $item['gform'] : NULL;\n\t\t\t\t\n\t\t\t\t\t$cart[ $item['ID'] ] = array(\n\t\t\t\t\t\t'ID'\t\t\t=> $item['ID'],\n\t\t\t\t\t\t'post_id'\t\t=> $item['post_id'],\n\t\t\t\t\t\t'name'\t\t\t=> $item['name'],\n\t\t\t\t\t\t'price'\t\t\t=> $product_price,\n\t\t\t\t\t\t'total_price'\t=> $product_price,\n\t\t\t\t\t\t'attachment_id'\t=> get_post_thumbnail_id( $item['post_id'] ),\n\t\t\t\t\t\t'featured_img'\t=> $featured_img_url,\n\t\t\t\t\t\t'quantity'\t\t=> 1,\n\t\t\t\t\t\t'gform'\t\t\t=> $gform,\n\t\t\t\t\t\t'remove_url'\t=> $remove_url\n\t\t\t\t\t);\n\t\t\t\telse:\n\t\t\t\t\t$cart[ $item['ID'] ]['total_price'] += $product_price;\n\t\t\t\t\t$cart[ $item['ID'] ]['quantity']++;\n\t\t\t\tendif;\n\t\t\n\t\t\t\t$this->cart_total_price += $item['price'];\n\t\t\n\t\t\tendforeach;\n\t\tendif;\n\n\t\treturn $cart;\n\t}", "function learn_press_get_checkout_cart() {\n\treturn apply_filters( 'learn_press_checkout_cart', LP()->cart );\n}", "public function getShowCart()\n {\n $data = Cart::getContent();\n //dd($data);\n return view('pages.giohang',['data'=>$data]);\n }", "protected function getGuestCart()\n {\n return (new Magento())->api('guestCarts')->items(session('g_cart'))->json();\n }", "public function index()\n {\n $cartItems=Cart::content(); // Fetch all cart items from Cart addItems function\n return view('cart.index',compact('cartItems'));\n }", "public function getDeliveryCart();" ]
[ "0.8553091", "0.8470064", "0.841108", "0.841108", "0.84053326", "0.81853104", "0.80116177", "0.7951375", "0.7608718", "0.75705624", "0.74552464", "0.7411101", "0.7406797", "0.7307238", "0.7261854", "0.7233571", "0.7214329", "0.71680105", "0.71680105", "0.70934814", "0.7084043", "0.7060416", "0.7053978", "0.70526785", "0.705122", "0.70060194", "0.699798", "0.69885725", "0.6983767", "0.69782805", "0.69782805", "0.6966478", "0.6959549", "0.6949616", "0.6941992", "0.69417256", "0.6940964", "0.6938098", "0.6914508", "0.688843", "0.6885916", "0.6883121", "0.686643", "0.686643", "0.68569577", "0.68565255", "0.6835262", "0.6817874", "0.680313", "0.6797998", "0.6795258", "0.6788374", "0.67871296", "0.67761475", "0.6767164", "0.6747303", "0.674146", "0.6741129", "0.67396116", "0.67180985", "0.67142636", "0.6709544", "0.67026013", "0.6700722", "0.6699533", "0.66857255", "0.6682675", "0.66605514", "0.6649132", "0.6647181", "0.6634864", "0.66009486", "0.6599514", "0.65745825", "0.6549686", "0.6534166", "0.65327054", "0.65261185", "0.6525282", "0.65173715", "0.65087485", "0.6493723", "0.6486404", "0.64848214", "0.6484029", "0.64807147", "0.6480289", "0.6472789", "0.64683026", "0.6468115", "0.646712", "0.64624923", "0.64572096", "0.64526224", "0.6451789", "0.6446777", "0.6442675", "0.6439223", "0.6434001", "0.642676" ]
0.8771198
0
Checks if an item has options. It returns 'true' if the rowid passed to this function correlates to an item that has options associated with it, otherwise returns 'false'.
Проверяет, имеет ли товар опции. Возвращает 'true', если rowid, переданный в эту функцию, соответствует товару, у которого есть связанные с ним опции, иначе возвращает 'false'.
public function has_options($rowid = null) { // Check if this product have options. // if ( ! isset($this->cart_contents[ $this->cart_name ][ $rowid ]['options']) or count($this->cart_contents[ $this->cart_name ][ $rowid ]['options']) === 0) { // We don't have options for this item. // return false; } // We have options for this product. // return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasOption();", "public function hasOption($key);", "function _item_in_cart($entry_id, $item_options = FALSE, $row_id = FALSE, $check_item_options = TRUE)\n\t{\n\t\t$this->_session_start();\n\n\t\t$items = $this->_get_items();\n\n\t\tif ($row_id !== FALSE && isset($items[$row_id]))\n\t\t{\n\t\t\treturn $row_id;\n\t\t}\n\n\t\tforeach ($items as $row_id => $item)\n\t\t{\n\t\t\tif ($entry_id == $item['entry_id'])\n\t\t\t{\n\t\t\t\tif ($item_options && is_array($item_options))\n\t\t\t\t{\n\t\t\t\t\tif (isset($item['item_options']) && $item['item_options'] === $item_options)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( ! $item['quantity'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($_SESSION['cartthrob']['items'][$row_id]);\n\t\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn $row_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif (empty($item['item_options']) || (is_array($item['item_options']) && implode('', $item['item_options']) == ''))\n\t\t\t\t{\n\t\t\t\t\tif ( ! $item['quantity'])\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($_SESSION['cartthrob']['items'][$row_id]);\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $row_id;\n\t\t\t\t}\n\t\t\t\telseif ( ! $check_item_options)\n\t\t\t\t{\n\t\t\t\t\treturn $row_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function hasOptions()\n\t{\n\t\treturn count($this->getRelated('stepOptions')) != 0;\n\t}", "public function hasOption($name);", "public function hasOption($name);", "public function hasOptions() {\n if ($this->getProduct ()->getTypeInstance ( true )->hasOptions ( $this->getProduct () )) {\n return true;\n }\n return false;\n }", "public function hasItem()\n {\n return $this->item !== null;\n }", "function isOption()\n {\n return $this->isShortOption() || $this->isLongOption();\n }", "function hasOption($name);", "public function hasOption(string $name);", "public function hasOpt(){\n return $this->_has(9);\n }", "public function hasOption(string $key): bool\n {\n }", "public function hasOptions()\n {\n $attributes = $this->getAllowAttributes();\n if (count($attributes)) {\n foreach ($attributes as $attribute) {\n /** @var Mage_Catalog_Model_Product_Type_Configurable_Attribute $attribute */\n if ($attribute->getData('prices')) {\n return true;\n }\n }\n }\n return false;\n }", "protected function _isMainOptionRow(array $rowData)\n {\n return !empty($rowData[self::COLUMN_TYPE]) || !empty($rowData[self::COLUMN_TITLE]);\n }", "public function hasMultipleItems()\n {\n if (!is_null($this->content) && !empty($this->content)) {\n $crawler = new Crawler($this->content);\n $selectOptions = $crawler->filterXPath(self::SELECT_OPTION_XPATH);\n $inputOptions = $crawler->filterXPath(self::INPUT_OPTION_XPATH);\n if ($selectOptions->count() > 0 || $inputOptions->count() > 0) {\n return true;\n }\n }\n return false;\n }", "public function hasOptions()\n {\n if ($this->getProduct()->getTypeInstance(true)->hasOptions($this->getProduct())) {\n return true;\n }\n return false;\n }", "public function hasOption(string $name): bool;", "private function _isOptionActive($item)\n {\n if (!empty($item['active_option'])) {\n $_op = Registry::get($item['active_option']);\n\n if (empty($_op) || $_op === 'N') {\n return false;\n }\n }\n\n return true;\n }", "public function hasOption( $sKey ) { return $this->m_oOptions->hasOption( $sKey ); }", "protected function _isRowWithCustomOption(array $rowData)\n {\n return !empty($rowData[self::COLUMN_TYPE]) ||\n !empty($rowData[self::COLUMN_TITLE]) ||\n !empty($rowData[self::COLUMN_ROW_TITLE]);\n }", "private function optionExists($key)\n {\n return array_key_exists($key, $this->getOptions());\n }", "public function hasItemId(){\n return $this->_has(1);\n }", "public function has_option( $name );", "public function hasRequiredOptions()\n {\n return $this->getProduct()->getTypeInstance(true)->hasRequiredOptions($this->getProduct());\n }", "public function has_options()\n {\n }", "public function has_options()\n {\n }", "public function isCustomOptionsExist()\n {\n return $this->mageworxOptionResource->isCustomOptionsExist();\n }", "public function has_item( $item_id ) {\n\t\t\treturn in_array( $item_id, array_column( $this->get_items(), 'id' ) );\n\t\t}", "public function hasRequiredOptions() {\n return $this->getProduct ()->getTypeInstance ( true )->hasRequiredOptions ( $this->getProduct () );\n }", "function have_options() {\n\n\t\tif ( isset( $this->options ) AND is_array( $this->options ) ) {\n\t\t\t$this->set( 'have_options', 1 );\n\t\t} else {\n\t\t\t$this->set( 'have_options', 0 );\n\t\t}\n\n\t\treturn $this->have_options;\n\n\t}", "function have_existing_options() {\n\n\t\tif ( isset( $this->existing_options ) AND is_array( $this->existing_options ) ) {\n\t\t\t$this->set( 'have_existing_options', 1 );\n\t\t} else {\n\t\t\t$this->set( 'have_existing_options', 0 );\n\t\t}\n\n\t\treturn $this->have_existing_options;\n\n\t}", "public function hasOption($key)\n {\n return array_key_exists($key, $this->options);\n }", "public function item_options($key = FALSE)\n\t{\n\t\tif ($key === FALSE)\n\t\t{\n\t\t\treturn $this->item_options;\n\t\t}\n\t\t\n\t\treturn (isset($this->item_options[$key])) ? $this->item_options[$key] : FALSE;\n\t}", "public function hasItemdata(){\n return $this->_has(12);\n }", "public function hasMenuOptions()\n {\n return (!empty($this->menuoptions));\n }", "function hasOptions() {\n return true;\n }", "public function hasItems();", "public function hasItems();", "public function itemIsSelected($item)\n {\n return isset($this->selectedItems[$item]);\n }", "public function has() {\n\t\treturn metadata_exists(\n\t\t\t'user',\n\t\t\t$this->user_options->get_user_id(),\n\t\t\t$this->user_options->get_meta_key( static::OPTION )\n\t\t);\n\t}", "public function itemExists()\r\n {\r\n return $this->_getResource()->itemExists($this);\r\n }", "public function hasOption($key) {\n return in_array(strtolower($key), $this->_optionKeys);\n }", "public function canShowOptions()\r\n {\r\n foreach ($this->getFilters() as $filter) {\r\n if ($filter->getItemsCount()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "function isOptions()\n {\n\n }", "function ItemsForm_Details_Should($item)\n {\n $value=$this->CGI_GETint($this->Args[ \"DetailsCGIVar\" ]);\n if (empty($value)) { $value=$this->Args[ \"DetailsDefault\" ]; }\n \n $res=TRUE;\n if ($value!=$item[ $this->Args[ \"DetailsItemVar\" ] ])\n {\n $res=FALSE;\n }\n \n foreach ($this->Args[ \"DetailsCGIVars\" ] as $key)\n {\n if ($this->CGI_GETint($key)!=$item[ $key ]) { $res=FALSE; }\n }\n\n return $res;\n }", "static function recordExistsValue($option_id)\n {\n global $objDatabase;\n\n $query = \"\n SELECT 1\n FROM \".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_option\n WHERE id=$option_id\";\n $objResult = $objDatabase->Execute($query);\n if ($objResult && $objResult->RecordCount()) return true;\n return false;\n }", "protected function itemHasEnabledOption($option)\n {\n foreach ($this->items as $item) {\n if (ArrayHelper::getValue($item, $option, false)) {\n return true;\n }\n }\n\n return false;\n }", "protected function itemHasEnabledOption($option)\n {\n foreach ($this->items as $item) {\n if (ArrayHelper::getValue($item, $option, false)) {\n return true;\n }\n }\n\n return false;\n }", "public function hasOptions(): bool\n {\n return false;\n }", "public function isMissingOptions()\n {\n if (!isset($this->options) || count($this->options) == 0) {\n return(true);\n } elseif (isset($this->options[\"h\"])) {\n return(true);\n } elseif (!isset($this->options[\"m\"]) && !isset($this->options[\"u\"]) &&\n !isset($this->options[\"c\"]) && !isset($this->options[\"p\"])\n && !isset($this->options[\"l\"]) && !isset($this->options[\"b\"]) &&\n !isset($this->options[\"o\"])) {\n return(true);\n }\n\n return (false);\n }", "public function extractOptions()\n {\n if ($this->hasMultipleItems()) {\n $items = [];\n foreach ($this->productInfo as $productOption) {\n $item = [];\n $item['variant'] = new \\stdClass();\n $item['variant']->text = $productOption->sku;\n $item['variant']->value = $productOption->sku;\n $items[] = $item;\n }\n $this->options = $items;\n return true;\n } else {\n return false;\n }\n }", "public function testHelperChecksIfOptionExists()\n {\n $this->assertTrue(option_exists('test-key'));\n $this->assertFalse(option_exists('bad-key'));\n }", "public function hasItems(){\n return $this->_has(2);\n }", "public function hasItems(){\n return $this->_has(2);\n }", "public function hasCustomOptions(): bool {\n return (!empty($this->options['alias'])\n || !empty($this->options['args'])\n || !empty($this->options['call'])\n || !empty($this->options['modify']));\n }", "public function has_multiple()\n\t{\n\t\treturn count($this->options) > 1;\n\t}", "public function hasOptionInBucket($optionId){\n $sql = sprintf('select id from orders_bucket_meals_options where bucketItemId = '.$this->getId().' and optionId='.$optionId.'LIMIT 1');\n return $this->getAdapter()->fetchRow($sql);\n }", "public function hasItemDatas(){\n return $this->_has(7);\n }", "public function pass()\n\t{\n\t\t$includeChildren = isset($this->params->inc_children) ? $this->params->inc_children : false;\n \t$includeNoItemID = isset($this->params->noitem) ? $this->params->noitem : false;\n \t// Pass if selection is empty or the itemid is missing\n \tif (!$this->itemID || empty($this->selection))\n {\n \treturn $includeNoItemID;\n }\n\n // return true if menu type is in selection\n\t\t$menutype = 'type.' . $this->getMenuType();\n\t\tif (in_array($menutype, $this->selection))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t// return true if menu is in selection and we are not including child items only\n\t\tif (in_array($this->itemID, $this->selection))\n\t\t{\n\t\t\treturn ($includeChildren != 2);\n\t\t}\n\n\t\t// Let's discover child items. \n\t\t// Obviously if the option is disabled return false.\n\t\tif (!$includeChildren)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get menu item parents\n\t\t$parent_ids = $this->getParentIds($this->itemID);\n\t\t$parent_ids = array_diff($parent_ids, array('1'));\n\n\t\tforeach ($parent_ids as $id)\n\t\t{\n\t\t\tif (!in_array($id, $this->selection))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasItems(){\n return $this->_has(1);\n }", "public function hasItems(){\n return $this->_has(1);\n }", "public function item_exists($item)\n\t{\n\t\t$item_array = $this->_analyze_item($item);\n\n\t\tif ($this->section_exists($item_array['section'])\n\t\t\t&& isset($this->config[$item_array['section']][$item_array['parameter']])\n\t\t) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function optionsAffectPrice() {\n $options = $this->getItem()->getProduct()->getOptions();\n\n foreach ($options as $option) {\n if ($option->hasPrice() && ((float) $option->getPrice() > 0)) {\n return true;\n }\n }\n\n return false;\n }", "public function valid()\n {\n return $this->position < $this->numOptions;\n }", "function __isCorrectEntityIDandOptionID($parent_entity,$entity_id,$option_id)\n {\n global $application;\n\n $tables = $this->getTables();\n $options = $tables['po_options']['columns'];\n\n $query = new DB_Select();\n $query->addSelectField($query->fCount($options['entity_id']), 'count_eid_oid');\n $query->WhereValue($options['parent_entity'], DB_EQ, $parent_entity);\n $query->WhereAND();\n $query->WhereValue($options['entity_id'], DB_EQ, $entity_id);\n $query->WhereAND();\n $query->WhereValue($options['option_id'], DB_EQ, $option_id);\n\n $result=$application->db->getDB_Result($query);\n if($result[0]['count_eid_oid']!=1)\n return false;\n\n return true;\n }", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function hasRowKey(){\n return $this->_has(1);\n }", "function hasDropDown() ;", "public function valid()\n {\n return isset($this->items[$this->index]);\n }", "protected function haveRequiredOptions()\n {\n foreach ($this->product->bundle_options as $option) {\n if ($option->is_required) {\n return true;\n }\n }\n\n return false;\n }", "public function hasOption(Model_Option $option) {\n\t\t$optionBlob = $this->_getOptionsMapper()->getProductOptionById($this->id, $option->id);\n\t\treturn (!empty($optionBlob) && count($optionBlob) > 0);\n\t}", "public function is_options() {\n return empty($this->module['use_model']);\n }", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function hasRowKey(){\n return $this->_has(2);\n }", "private function _isEmptyOptions()\n {\n if( \\Session::has('cart_item') )\n {\n # get Cart\n $cart = \\Session::get('cart_item');\n\n if( \n isset($cart['product'], $cart['paper_color'], $cart['paper_type'], $cart['paper_size']) && \n (\n !empty($cart['product']) && \n !empty($cart['paper_color']) && \n !empty($cart['paper_type']) && \n !empty($cart['paper_size'])\n ) \n )\n {\n return false;\n }\n }\n\n return true;\n }", "public function hasRow(){\n return $this->_has(1);\n }", "public function hasItemid(){\n return $this->_has(4);\n }", "public function valid()\n {\n return isset($this->items[$this->position]);\n }", "public function has_items() {\n\t\t\t$items = $this->get_items();\n\n\t\t\treturn ! empty( $items );\n\t\t}", "function hasItem($itemid,$playerid){\n\t\t\n\t\t\tif(isset($itemid) \n\t\t\t&& $this->FURY->validation->is_numeric($itemid) \n\t\t\t&& isset($playerid) \n\t\t\t&& $this->FURY->validation->is_numeric($playerid)):\n\t\t\t\n\t\t\t\treturn $this->FURY->db->query(\"SELECT * FROM inventory \n\t\t\t\tWHERE userid='$playerid' \n\t\t\t\tAND itemid='$itemid'\")->as_assoc();\n\t\t\t\n\t\t\tendif;\n\t\t\treturn false;\n\t\t}", "public function isOptions(){ }", "function kvoption_exists($key)\n {\n return app('kvoption')->exists($key);\n }", "public function isValidForOptions(): bool\n {\n $allowOptions = [\n 'Select',\n 'Radio',\n 'Checkbox'\n ];\n\n return in_array($this->type_saia, $allowOptions);\n }", "function have_option_group() {\n\n\t\tif ( isset( $this->option_group ) AND ! empty( $this->option_group ) ) {\n\t\t\t$this->set( 'have_option_group', 1 );\n\t\t} else {\n\t\t\t$this->set( 'have_option_group', 0 );\n\t\t}\n\n\t\treturn $this->have_option_group;\n\n\t}", "public function exists()\r\n { \r\n $pk = $this->model->primary_key();\r\n $pk_n_exists = $pk && !empty($this->data[$pk]) && !empty($this->selector);\r\n $pk_n_exists_wo_pk = !$pk && count($this->data) > 0 && !empty($this->selector);\r\n return $pk_n_exists || $pk_n_exists_wo_pk;\r\n }", "public function has_items() {\n\t\treturn !empty( $this->items );\n\t}", "public function hasChoices();", "public function exist($item) {\n return ($this->items[$item['product']['id']]) ? true : false;\n }", "public function valid() {\n return isset($this->items[$this->position]);\n }", "public function hasWidgetOptions()\n {\n return !!$this->getWidgetOptions();\n }", "public function hasItemModalDetail(): bool\n {\n return (bool)count($this->itemDetailsModal);\n }", "public function issetOption($key)\n {\n return array_key_exists($key, $this->options);\n }", "public function hasMultipleItems()\n {\n $this->__getProductInfo();\n if (!is_null($this->productInfo) && isset($this->productInfo->attributes) && count($this->productInfo->attributes) > 0) {\n return true;\n }\n return false;\n }", "protected function hasOption($name)\n {\n return array_key_exists($name, $this->getOptions());\n }", "public function hasItemsList()\n {\n return $this->items !== null;\n }", "function confirm__set__options() {\n\n\t\tif ( ! $this->have_options() ) {\n\n\t\t\t$this->options = get_option( $this->option_name );\n\t\t\t$this->have_options();\n\n\t\t}\n\n\t\treturn $this->have_options;\n\n\t}", "public function hasDropDown() {}" ]
[ "0.6800605", "0.67320704", "0.65432024", "0.6503272", "0.63940376", "0.63940376", "0.6333506", "0.6313647", "0.6289125", "0.6282007", "0.6274613", "0.62738925", "0.6271936", "0.62466043", "0.62394375", "0.62384474", "0.6228875", "0.62030125", "0.62019527", "0.6196848", "0.6172396", "0.6172116", "0.61690366", "0.61596113", "0.6150113", "0.6146501", "0.61459833", "0.61184615", "0.61079276", "0.6101244", "0.6083202", "0.6075359", "0.60605896", "0.6060008", "0.6059617", "0.60148257", "0.59976995", "0.5997243", "0.5997243", "0.59912777", "0.5978543", "0.5969031", "0.59500915", "0.5944731", "0.5941352", "0.5931665", "0.58999014", "0.5893928", "0.5893928", "0.58863986", "0.5871314", "0.58618754", "0.5851386", "0.5847061", "0.5847061", "0.584494", "0.58376527", "0.5802874", "0.5795747", "0.5793812", "0.5782321", "0.5782321", "0.5776641", "0.57754046", "0.5766989", "0.5765809", "0.575289", "0.575289", "0.575289", "0.57457775", "0.573936", "0.5731209", "0.5731053", "0.5724172", "0.57227063", "0.57227063", "0.57227063", "0.571882", "0.5718489", "0.5715394", "0.57144135", "0.56976044", "0.56858236", "0.5681068", "0.5680102", "0.5679895", "0.5676157", "0.5670621", "0.5668576", "0.5667217", "0.56669664", "0.565771", "0.56471276", "0.5644071", "0.56439435", "0.5640541", "0.56359625", "0.5634126", "0.56328416", "0.5632509" ]
0.7804017
0
Returns an array of options, for a particular product row ID.
Возвращает массив вариантов для определенного идентификатора строки продукта.
public function product_options($rowid = null) { // Check if this product have options. // if ( ! $this->has_options($rowid)) { // No options, return an empty array. // return array(); } // Return this product options. // return $this->cart_contents[ $this->cart_name ][ $rowid ]['options']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_option_by_id_all($product_id)\n {\n\n return $this->db->from($this->_stock)\n ->where('product_id', $product_id)\n ->join($this->option->table() . \" A \", \"A.id = $this->_stock.option_id\")\n ->join($this->option->table() . \" B \", \"B.id = $this->_stock.option_detail_id\")\n ->select(\"$this->_stock.* , A.title as color , B.title as size\")\n ->get()->result();\n }", "function GetExtraParametrs( $productID ){\r\n\r\n\tstatic $ProductsExtras = array();\r\n\tif(!is_array($productID)){\r\n\r\n\t\t$ProductIDs = array($productID);\r\n\t\t$IsProducts = false;\r\n\t}elseif(count($productID)) {\r\n\r\n\t\t$ProductIDs = &$productID;\r\n\t\t$IsProducts = true;\r\n\t}else {\r\n\r\n\t\treturn array();\r\n\t}\r\n\t$ProductIDsCached = array_keys($ProductsExtras);\r\n\t$ProductIDs = array_diff($ProductIDs,$ProductIDsCached);\r\n\tif(count($ProductIDs)){\r\n\t\t$sql = '\r\n\t\t\tSELECT pot.*, '.LanguagesManager::sql_constractSortField(PRODUCT_OPTIONS_TABLE, 'pot.name').', povt.*\r\n\t\t\tFROM ?#PRODUCT_OPTIONS_VALUES_TABLE as povt LEFT JOIN ?#PRODUCT_OPTIONS_TABLE as pot ON pot.optionID=povt.optionID \r\n\t\t\tWHERE povt.productID IN (?@) ORDER BY pot.sort_order, '.LanguagesManager::sql_getSortField(PRODUCT_OPTIONS_TABLE, 'pot.name').'\r\n\t\t';\r\n\t\t$Result = db_phquery($sql, $ProductIDs);\r\n\t\r\n\t\twhile ($_Row = db_fetch_assoc($Result)) {\r\n\t\r\n\t\t\tLanguagesManager::ml_fillFields(PRODUCT_OPTIONS_VALUES_TABLE, $_Row);\r\n\t\t\tLanguagesManager::ml_fillFields(PRODUCT_OPTIONS_TABLE, $_Row);\r\n\t\t\t$b=null;\r\n\t\t\tif (($_Row['option_type']==0 || $_Row['option_type']==NULL) && !LanguagesManager::ml_isEmpty('option_value', $_Row['option_value'])){\r\n\t\r\n\t\t\t\t$ProductsExtras[$_Row['productID']][] = $_Row;\r\n\t\t\t}\r\n\t\t\telse if ( $_Row['option_type']==1 ){\r\n\t\r\n\t\t\t\t//fetch all option values variants\r\n\t\t\t\t$sql = '\r\n\t\t\t\t\tSELECT povvt.*, '.LanguagesManager::sql_constractSortField(PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE, 'povvt.option_value').', post.price_surplus\r\n\t\t\t\t\tFROM '.PRODUCTS_OPTIONS_SET_TABLE.' as post\r\n\t\t\t\t\tLEFT JOIN '.PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE.' as povvt\r\n\t\t\t\t\tON povvt.variantID=post.variantID\r\n\t\t\t\t\tWHERE povvt.optionID='.$_Row['optionID'].' AND post.productID='.$_Row['productID'].' AND povvt.optionID='.$_Row['optionID'].' \r\n\t\t\t\t\tORDER BY povvt.sort_order, '.LanguagesManager::sql_getSortField(PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE, 'povvt.option_value').'\r\n\t\t\t\t';\r\n\t\r\n\t\t\t\t$q2=db_query($sql);\r\n\t\t\t\t$_Row['values_to_select']=array();\r\n\t\t\t\t$i=0;\r\n\t\t\t\twhile( $_Rowue = db_fetch_assoc($q2) ){\r\n\t\r\n\t\t\t\t\tLanguagesManager::ml_fillFields(PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE, $_Rowue);\r\n\t\t\t\t\t$_Row['values_to_select'][$i]=array();\r\n\t\t\t\t\t$_Row['values_to_select'][$i]['option_value'] = xHtmlSpecialChars($_Rowue['option_value']);\r\n\t\t\t\t\tif ( $_Rowue['price_surplus'] > 0 )$_Row['values_to_select'][$i]['option_value'] = $_Row['values_to_select'][$i]['option_value'].' (+ '.show_price($_Rowue['price_surplus']).')';\r\n\t\t\t\t\telseif($_Rowue['price_surplus'] < 0 )$_Row['values_to_select'][$i]['option_value'] = $_Row['values_to_select'][$i]['option_value'].' (- '.show_price(-$_Rowue['price_surplus']).')';\r\n\t\r\n\t\t\t\t\t$_Row['values_to_select'][$i]['option_valueWithOutPrice'] = $_Rowue['option_value'];\r\n\t\t\t\t\t$_Row['values_to_select'][$i]['price_surplus'] = show_priceWithOutUnit($_Rowue['price_surplus']);\r\n\t\t\t\t\t$_Row['values_to_select'][$i]['variantID']=$_Rowue['variantID'];\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t\t$ProductsExtras[$_Row['productID']][] = $_Row;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif(!$IsProducts){\r\n\r\n\t\tif(!count($ProductsExtras))return array();\r\n\t\telse {\r\n\t\t\treturn $ProductsExtras[$productID];\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $ProductsExtras;\r\n}", "public function getOptionSettings($product_option_id) {\n \n if (!$this->installed()) return array();\n \n $query = $this->db->query(\" SELECT PMOS.*, PS.product_option_id\n FROM \".DB_PREFIX.\"poip_main_option_settings PMOS, \".DB_PREFIX.\"product_option PS\n WHERE PS.product_option_id = \".(int)$product_option_id.\"\n AND PS.option_id = PMOS.option_id\n \");\n \n if ($query->num_rows) {\n return $query->row;\n }\n \n return array();\n \n }", "public function getProductOptionsWithValues($product_id) {\n\t\t\n\t\t$product_option_data = array();\n\t\t\n\t\t$sql = \"SELECT * FROM \" . DB_PREFIX . \"product_option po LEFT JOIN `\" . DB_PREFIX . \"option` o ON (po.option_id = o.option_id) LEFT JOIN \" . DB_PREFIX . \"option_description od ON (o.option_id = od.option_id) WHERE po.product_id = '\" . (int)$product_id . \"' AND od.language_id = '\" . (int)$this->config->get('config_language_id') . \"' ORDER BY o.sort_order\";\n\t\t$product_option_query = $this->db->query($sql);\n\n\t\tforeach ($product_option_query->rows as $product_option) {\n\t\t\t$product_option_value_data = array();\n\t\t\t\n\t\t\t$optionSql = \"SELECT * FROM \" . DB_PREFIX . \"product_option_value pov LEFT JOIN \" . DB_PREFIX . \"option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN \" . DB_PREFIX . \"option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_id = '\" . (int)$product_id . \"' AND pov.product_option_id = '\" . (int)$product_option['product_option_id'] . \"' AND ovd.language_id = '\" . (int)$this->config->get('config_language_id') . \"' ORDER BY ov.sort_order\";\n\t\t\t$product_option_value_query = $this->db->query($optionSql);\n\n\t\t\tforeach ($product_option_value_query->rows as $product_option_value) {\n\t\t\t\t$product_option_value_data[] = array(\n\t\t\t\t\t'product_option_value_id' => $product_option_value['product_option_value_id'],\n\t\t\t\t\t'option_value_id' => $product_option_value['option_value_id'],\n\t\t\t\t\t'name' => $product_option_value['name'],\n\t\t\t\t\t'image' => $product_option_value['image'],\n\t\t\t\t\t'quantity' => $product_option_value['quantity'],\n\t\t\t\t\t'subtract' => $product_option_value['subtract'],\n\t\t\t\t\t'price' => $product_option_value['price'],\n\t\t\t\t\t'price_prefix' => $product_option_value['price_prefix'],\n\t\t\t\t\t'weight' => $product_option_value['weight'],\n\t\t\t\t\t'weight_prefix' => $product_option_value['weight_prefix']\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$product_option_data[] = array(\n\t\t\t\t'product_option_id' => $product_option['product_option_id'],\n\t\t\t\t'product_option_value' => $product_option_value_data,\n\t\t\t\t'option_id' => $product_option['option_id'],\n\t\t\t\t'name' => $product_option['name'],\n\t\t\t\t'type' => $product_option['type'],\n\t\t\t\t'value' => $product_option['value'],\n\t\t\t\t'required' => $product_option['required']\n\t\t\t);\n\t\t}\n\n\t\treturn $product_option_data;\n\t}", "function productOptionList()\n\t{\n\t\t$url = $this->restApiUrl. 'productoption/'.$this->locale.'/'.$this->apiAuthKey.'/';\n\t\t$res = $this->call_rest($url,'','get');\n\t\treturn json_decode($res);\n\t}", "public function getProductOptions()\n {\n return $this->hasMany(ProductOption::className(), ['option_value_id' => 'id']);\n }", "public function VariantOption($product_id){\n return $this->getVariantItemOrder($product_id);\n }", "public function getProductSettings($product_id) {\n $query = $this->db->query(\"SELECT product_option_id FROM \".DB_PREFIX.\"product_option WHERE product_id = \".(int)$product_id.\" \");\n $poip_settings = array();\n foreach ($query->rows as $row) {\n $poip_settings[$row['product_option_id']] = $this->getProductOptionSettings($row['product_option_id']);\n }\n return $poip_settings;\n }", "public function getProductOptions($product_id) {\n\t\t$client = $this->client;\n\n\t\tif(empty($this->product_options)) {\n\t\t\ttry {\n\t\t\t\t$response = $client->get(\"products/$product_id/options\");\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$this->doException($e,'sku options');\n\t\t\t}\n\t\t\t\n\t\t\t$product_options = $response->json(array('object'=>TRUE));\n\t\t\tforeach($product_options as $option) {\n\t\t\t\t$this->product_options[$option->option_id] = $option;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->product_options;\n\n\t}", "function get_option($id,$return_cols='*') {\n\n $option = \\Model\\Itemoption::find($id);\n\n return db_return($option,$return_cols);\n }", "public function fetchOptions($productID)\n {\n return $this->productOptionLabel\n ->where('products_id', $productID)\n ->select('name')\n ->get();\n }", "public function getOptionList()\n {\n return $this->_bundleProductConfiguration->getOptions($this->getItem());\n }", "public function getOptionArray()\n {\n /** @var \\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection $collection */\n $collection = $this->collectionFactory->create()\n ->addAttributeToSelect('name')\n ->addAttributeToFilter('type_id', Fifty::TYPE_ID)\n ->addAttributeToFilter('fifty_status', ['in' => [FiftyStatus::STATUS_PROCESSING, FiftyStatus::STATUS_FINISHED]]);\n $result = [];\n /** @var Product $product */\n foreach ($collection as $product){\n $result[$product->getId()] = $product->getName();\n }\n return $result;\n }", "public function toOptionArray()\n {\n $cbProductsOptions = array();\n $cbProductsOptions[] = array(\n 'label' => __('--Please Select--'),\n 'value' => '',\n );\n\n try {\n $allCbProducts = $this->_prepareModel->getCbProducts();\n foreach ($allCbProducts as $cbProduct) {\n if ($cbProduct->id) {\n $options['label'] = $this->getTitle($cbProduct);\n $options['value'] = $cbProduct->id;\n $cbProductsOptions[] = $options;\n }\n }\n } catch (Exception $e) {\n $this->_logger->critical($e);\n $this->_messageManager->addErrorMessage(\n __('An error occurred while loading configbox products.')\n );\n }\n\n return $cbProductsOptions;\n }", "public function getQuoteOptions()\r\n {\r\n $item = $this->getItem();\r\n $product = $item->getProduct();\r\n $options = array();\r\n $buyRequest = json_decode($item->getBuyRequest(),true);\r\n $optionIds = array_keys($buyRequest['options']);\r\n if ($optionIds) {\r\n $options = array();\r\n foreach ($optionIds as $optionId) {\r\n $option = $product->getOptionById($optionId);\r\n if ($option) {\r\n $itemOption = $buyRequest['options'][$optionId];\r\n if(!$itemOption) continue;\r\n if(is_array($itemOption)) $itemOption = implode(\",\", $itemOption);\r\n $group = $option->groupFactory($option->getType())\r\n ->setOption($option)\r\n ->setConfigurationItem($item)\r\n ->setConfigurationItemOption($itemOption);\r\n if ('file' == $option->getType()) {\r\n $downloadParams = $item->getFileDownloadParams();\r\n if ($downloadParams) {\r\n $url = $downloadParams->getUrl();\r\n if ($url) {\r\n $group->setCustomOptionDownloadUrl($url);\r\n }\r\n $urlParams = $downloadParams->getUrlParams();\r\n if ($urlParams) {\r\n $group->setCustomOptionUrlParams($urlParams);\r\n }\r\n }\r\n }\r\n $options[] = array(\r\n 'label' => $option->getTitle(),\r\n 'value' => $group->getFormattedOptionValue($itemOption),\r\n 'print_value' => $group->getPrintableOptionValue($itemOption),\r\n 'option_id' => $option->getId(),\r\n 'option_type' => $option->getType(),\r\n 'custom_view' => $group->isCustomizedView()\r\n );\r\n }\r\n }\r\n }\r\n \r\n $addOptions = $item->getOptionByCode('additional_options');\r\n if ($addOptions) {\r\n $options = array_merge($options, unserialize($addOptions->getValue()));\r\n }\r\n \r\n return $options;\r\n }", "private function list_variant($product_id = 0){\n $variant = new Variant;\n $variant_meta = new VariantMeta;\n $variant_array = [];\n $variants = $variant-> Get_variant_id_order_by( $product_id );\n foreach ($variants as $variant) {\n $variant_item=$variant_meta-> Get_variant_meta_id($variant->variant_id);\n $option1 = isset($variant_item[0])? $variant_item[0] : [];\n $option2 = isset($variant_item[1])? $variant_item[1] : [];\n $option3 = isset($variant_item[2])? $variant_item[2] : [];\n array_push($variant_array,[\n 'variant_id'=>$variant->variant_id,\n 'variant_sku'=>$variant->sku,\n 'variant_price_old'=>$variant->price_old,\n 'variant_price'=>$variant->price_new,\n 'weight'=>$variant->weight,\n 'barcode'=>$variant->barcode,\n 'tracking_policy'=>$variant->tracking_policy,\n 'out_of_stock'=>$variant->out_of_stock,\n 'variant_quantity'=>$variant->quantity,\n 'inventory'=>$variant->inventory,\n 'ship'=>$variant->ship,\n 'image'=>$variant->image, \n 'option1'=>$option1,\n 'option2'=>$option2,\n 'option3'=>$option3\n ]);\n }\n return $variant_array;\n\n }", "public function optionValues()\n {\n return $this->hasMany(ProductOptionValue::class, 'product_option_labels_id', 'id')\n ->select('product_option_labels_id', 'id', 'name', 'addon_price', 'image_name');\n }", "public function getProductOptionSettings($product_option_id) {\n \n $option_settings = array();\n if (!$this->installed()) return $option_settings;\n \n $poip_settings = $this->config->get('poip_module');\n $poip_option_settings = $this->getOptionSettings($product_option_id);\n \n $query = $this->db->query(\"SELECT * FROM \".DB_PREFIX.\"poip_option_settings WHERE product_option_id = \".(int)$product_option_id.\" \");\n \n $settings_names = $this->getSettingsNames();\n \n foreach ($settings_names as $setting_name) {\n if ($query->row && isset($query->row[$setting_name]) && $query->row[$setting_name] != 0) {\n $option_settings[$setting_name] = $query->row[$setting_name]-1;\n \n } elseif (isset($poip_option_settings[$setting_name]) && $poip_option_settings[$setting_name] != 0) {\n $option_settings[$setting_name] = $poip_option_settings[$setting_name]-1;\n \n } elseif (isset($poip_settings[$setting_name])) {\n $option_settings[$setting_name] = $poip_settings[$setting_name];\n \n } else { \n $option_settings[$setting_name] = false;\n }\n }\n \n return $option_settings;\n \n }", "public function getOptionValues();", "public function getProduct(int $id):array\n {\n $stm=$this->db->prepare('select * from products where id=?');\n $stm->execute(array($id));\n return $stm->fetch(PDO::FETCH_ASSOC);\n }", "public function optionIdKeys()\n\t{\n\t\tif( $this->_optionIdKeys === NULL )\n\t\t{\n\t\t\t$this->_optionIdKeys = array();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$options = \\IPS\\Db::i()->select( 'opt_values', 'nexus_product_options', array( 'opt_package=?', $this->id ) )->first();\n\t\t\t\tif ( $options = json_decode( $options, TRUE ) )\n\t\t\t\t{\n\t\t\t\t\t$this->_optionIdKeys = array_keys( $options );\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch ( \\UnderflowException $e ) { }\n\t\t}\n\t\treturn $this->_optionIdKeys;\n\t}", "function getCustomisationOptions($id) {\n global $wpdb;\n \n $prepared = $wpdb->prepare(\"SELECT * FROM `wp_trench_cust_options` WHERE custID = '%s'\", $id);\n $result = $wpdb->get_results($prepared);\n \n foreach ($result as &$optionResult) { // RUN QUERY FOR OPTIONS\n \n echo \"<option value='\".trim($optionResult->optionName).\"' percent='\".trim($optionResult->pricePercentage).\"'>\".$optionResult->optionText.\"</option>\";\n \n }\n \n }", "function optGetOptionById($optionID){\r\n\t\r\n\t$q = db_phquery('SELECT * FROM ?#PRODUCT_OPTIONS_TABLE WHERE optionID=?',$optionID);\r\n\tif ( $row=db_fetch_row($q) ){\r\n\r\n\t\tLanguagesManager::ml_fillFields(PRODUCT_OPTIONS_TABLE, $row);\r\n\t\treturn $row;\r\n\t}else return null;\r\n}", "public function option()\n {\n return $this->hasMany(ProductOptionLabel::class, 'products_id', 'id')\n ->select('products_id', 'id', 'name');\n }", "public function toOptionArray() {\n return array(\n array(\n 'value' => self::CPRODUCT,\n 'label' => Mage::helper('flubit')->__('Create Product')),\n array(\n 'value' => self::UPRODUCT,\n 'label' => Mage::helper('flubit')->__('Update Product')),\n array(\n 'value' => self::DPRODUCT,\n 'label' => Mage::helper('flubit')->__('Delete Product')),\n array(\n 'value' => self::CFEED,\n 'label' => Mage::helper('flubit')->__('Check Feed Response')),\n array(\n 'value' => self::FORDER,\n 'label' => Mage::helper('flubit')->__('Fetch Order')),\n array(\n 'value' => self::DORDER,\n 'label' => Mage::helper('flubit')->__('Dispatch Order')),\n array(\n 'value' => self::CORDER,\n 'label' => Mage::helper('flubit')->__('Cancel Order')),\n array(\n 'value' => self::RORDER,\n 'label' => Mage::helper('flubit')->__('Refund Order')),\n array(\n 'value' => self::MORDER,\n 'label' => Mage::helper('flubit')->__('Create Order in Magento')),\n array(\n 'value' => self::CERROR,\n 'label' => Mage::helper('flubit')->__('Communication Error'))\n );\n }", "protected function getProductOptions( $min_id, $max_id ) {\n $language_id = $this->getDefaultLanguageId();\n\n // Opencart versions from 2.0 onwards use product_option.value instead of the older product_option.option_value\n $sql = \"SHOW COLUMNS FROM `\".DB_PREFIX.\"product_option` LIKE 'value'\";\n $query = $this->db->query( $sql );\n $exist_po_value = ($query->num_rows > 0) ? true : false;\n\n // DB query for getting the product options\n if ($exist_po_value) {\n $sql = \"SELECT p.product_id, po.option_id, po.value AS option_value, po.required, od.name AS `option` FROM \";\n } else {\n $sql = \"SELECT p.product_id, po.option_id, po.option_value, po.required, od.name AS `option` FROM \";\n }\n $sql .= \"( SELECT product_id \";\n $sql .= \" FROM `\".DB_PREFIX.\"product` \";\n if (isset($min_id) && isset($max_id)) {\n $sql .= \" WHERE product_id BETWEEN $min_id AND $max_id \";\n }\n $sql .= \" ORDER BY product_id ASC \";\n $sql .= \") AS p \";\n $sql .= \"INNER JOIN `\".DB_PREFIX.\"product_option` po ON po.product_id=p.product_id \";\n $sql .= \"INNER JOIN `\".DB_PREFIX.\"option_description` od ON od.option_id=po.option_id AND od.language_id='\".(int)$language_id.\"' \";\n $sql .= \"ORDER BY p.product_id ASC, po.option_id ASC\";\n $query = $this->db->query( $sql );\n return $query->rows;\n }", "protected function getAllPricesAndOptions($productId)\n {\n return ProductPriceAndOption::whereProductId($productId)->orderBy('id', 'DESC')->get();\n }", "public function optionList($id)\n {\n $products = ProductStock::where('warehouse_id', $id)->with('product')->with('warehouse')->get();\n return response($products, 200);\n }", "function GetProduct( $productID){\r\n\r\n\t$productID = (int)$productID;\r\n\t$q = db_query('SELECT * FROM '.PRODUCTS_TABLE.' WHERE productID='.$productID);\r\n\t\r\n\tif ( $product=db_fetch_assoc($q) ){\r\n\t\t\r\n\t\tLanguagesManager::ml_fillFields(PRODUCTS_TABLE, $product);\r\n\t\t$product[\"ProductIsProgram\"] = \t(trim($product[\"eproduct_filename\"]) != \"\");\r\n\t\t$sql = '\r\n\t\t\tSELECT pot.*,povt.* FROM '.PRODUCT_OPTIONS_VALUES_TABLE.' as povt\r\n\t\t\tLEFT JOIN '.PRODUCT_OPTIONS_TABLE.' as pot ON pot.optionID=povt.optionID \r\n\t\t\tWHERE productID='.$productID.'\r\n\t\t';\r\n\t\t$Result = db_query($sql);\r\n\t\t$product['option_values'] = array();\r\n\t\t\r\n\t\twhile ($_Row = db_fetch_assoc($Result)) {\r\n\r\n\t\t\tLanguagesManager::ml_fillFields(PRODUCT_OPTIONS_TABLE, $_Row);\r\n\t\t\tLanguagesManager::ml_fillFields(PRODUCT_OPTIONS_VALUES_TABLE, $_Row);\r\n\t\t\t$_Row['value'] = $_Row['option_value'];\r\n\t\t\t$product['option_values'][] = $_Row;\r\n\t\t}\r\n\t\tif($product['vkontakte_update_timestamp']>0){\r\n\t\t\t$product['vkontakte_update_timestamp']=Time::standartTime( $product['vkontakte_update_timestamp'] );\r\n\t\t}else{\r\n\t\t\t$product['vkontakte_update_timestamp'] = '';\r\n\t\t}\r\n\t\t$product['date_modified']=Time::standartTime( $product['date_modified'] );\r\n\t\t$product['date_added']=Time::standartTime( $product['date_added'] );\r\n\t\treturn $product;\r\n\t}\r\n\treturn false;\r\n}", "public function getProductAttributeOptions()\n\t{\n\t\t$attribute_id = JRequest::getInt('attribute_id', 0);\n\t\t$name = JRequest::getVar('select_name', 'parent');\n\t\t$id = JRequest::getVar('select_id', '0');\n\t\t\n\t\t$response = array();\n\t\t$response['msg'] = '';\n\t\t$response['error'] = '';\n\t\t\n\t\tif($attribute_id)\n\t\t{\n\t\t\tTienda::load('TiendaSelect', 'library.select');\n\t\t\t$response['msg'] = TiendaSelect::productattributeoptions($attribute_id, 0, $name.\"[\".$id.\"]\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response['msg'] = '<input type=\"hidden\" name=\"'.$name.\"[\".$id.\"]\".'\" />';\n\t\t}\n\t\t\n\t\techo json_encode($response);\n\t}", "protected function getRowsSelect(): array\n\t{\n\t\t$columns = array_column($this->getGridProvider()->getColumns(), 'id');\n\n\t\treturn array_filter($columns);\n\t}", "public function getAttributeOptionIds($attrId,$optionId){\n\t\t\n\t\t$resourceConnection = $this->ob('\\Magento\\Framework\\App\\ResourceConnection');\n\t\t$tableName = $this->getTableName('eav_attribute_option');\n\t\t$query = \"SELECT * FROM $tableName where attribute_id = $attrId AND option_id = $optionId\";\n\t\t/**\n\t\t * Execute the query and store the results in $results variable\n\t\t */\n\t\ttry{\n\t\t\t$results = $resourceConnection->getConnection()->fetchAll($query);\n\t\t}catch(\\Exception $ex){\n\t\t\t$results = array();\n\t\t}\n\t\treturn $results;\n\t}", "public function fetchOptionsDataTableSource($productID)\n {\n $dataTableConfig = [\n 'searchable' => [\n 'name',\n ],\n ];\n\n return $this->productOptionLabel\n ->where('products_id', $productID)\n ->select(\n 'id',\n 'name'\n )\n ->dataTables($dataTableConfig)\n ->toArray();\n }", "function getMenuOptions($id)\n{\n global $handler;\n \n $getMenu = $handler->prepare('SELECT menu_id, id, option_icon, option_text, action_menu_id\n FROM gossip_menu_option\n WHERE menu_id = :menu');\n $getMenu->bindValue(':menu', $id, PDO::PARAM_INT);\n $getMenu->execute();\n return $getMenu->fetchAll();\n}", "public function getOrderProductsOptionSensitive($order_id) {\n\t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"order_product WHERE order_id = '\" . (int)$order_id . \"'\");\n\n\t\treturn $query->rows;\n\t}", "protected function getOptionsFromRows($options, $selected = 0, $name_key = 'name', $id_key = 'id') {\n $return = array();\n foreach($options as $option) {\n $select = $selected == $option[$id_key] ? 'selected' : '';\n $return[] = \"<option value=\\\"{$option[$id_key]}\\\" $select>{$option[$name_key]}</option>\";\n }\n return $return;\n }", "public static function get_options_callback() {\n\t\t$products = array();\n\t\tforeach ( Woo::get_products() as $product ) {\n\t\t\t$name = $product->get_name();\n\t\t\t$products[] = array(\n\t\t\t\t'label' => $name,\n\t\t\t\t'id' => $name,\n\t\t\t);\n\t\t}\n\n\t\treturn $products;\n\t}", "public function get_product_options(Request $request,$id){\n $attr = Attribute::where('name',$request->option)->first();\n $data = ProductAttributeValue::where('attribute_id',$attr->id)->where('product_id',$id)\n ->where('count','>',0)->get();\n return $this->showAll('options',$data); \n }", "public function getOptionsByRequisitionListItemId(\n $itemId,\n \\Magento\\Catalog\\Api\\Data\\ProductInterface $product = null\n ) {\n $item = $this->getRequisitionListItem($itemId);\n return $this->getOptions($item, $product);\n }", "public function getProductOptions()\n {\n $data = $this->_getData('product_options');\n if (is_string($data)) {\n $data = $this->serializer->unserialize($data);\n }\n return $data;\n }", "private function getOptionItems()\n {\n $jobLevel = new JobLevelRepository();\n return [\n 'jobLevelItems' => ['' => __('crud.option.jobLevel_placeholder')] + $jobLevel->pluck()\n ];\n }", "private static function get_possible_product_type_options_ids()\n {\n }", "function getQuestionOptions($questionid){\n\t\t$stmt = $this->con->prepare(\"SELECT optionid, optionname, votecount, questionid FROM questionoption WHERE questionid = ?\");\n\t\t$stmt->bind_param(\"i\", $questionid);\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($optionid, $optionname, $votecount, $questionid);\n\t\t\n\t\t$options = array(); \n\t\t\n\t\twhile($stmt->fetch()){\n\t\t\t$option = array();\n\t\t\t$option['optionid'] = $optionid; \n\t\t\t$option['optionname'] = $optionname; \n\t\t\t$option['votecount'] = $votecount; \n\t\t\t$option['questionid'] = $questionid; \n\t\t\t\n\t\t\tarray_push($options, $option); \n\t\t}\n\t\t\n\t\treturn $options; \n\t}", "public function getOptions()\n {\n $attributeSetIds = array();\n $is_vpattribute = $this->manager->isEnabled('Ced_CsVendorProductAttribute');\n\n if ($is_vpattribute && $this->scopeConfig->getValue('ced_csmarketplace/general/vpattributes_activation', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE)) {\n $vendor = $this->registry->registry('vendor');\n $vendorId = $vendor['entity_id'];\n\n\n $ob = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $attributesetvalues = $ob->create('Ced\\CsVendorProductAttribute\\Model\\Attributeset')\n ->getCollection()->addFieldtoFilter('vendor_id', $vendorId)->getData();\n\n foreach ($attributesetvalues as $value) {\n $attributeSetIds[] = $value['attribute_set_id'];\n }\n }\n /** @var \\Magento\\Eav\\Model\\ResourceModel\\Entity\\Attribute\\Set\\Collection $collection */\n $collection = $this->attributeSetCollectionFactory->create();\n $collection->setEntityTypeFilter($this->locator->getProduct()->getResource()->getTypeId())\n ->addFieldToSelect('attribute_set_id', 'value')\n ->addFieldToSelect('attribute_set_name', 'label')\n ->setOrder(\n 'attribute_set_name',\n \\Magento\\Eav\\Model\\ResourceModel\\Entity\\Attribute\\Set\\Collection::SORT_ORDER_ASC\n );\n $attributesetIds = explode(',', $this->scopeConfig->getValue('ced_vproducts/general/set', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE));\n $attributesetids = array_merge($attributeSetIds, $attributesetIds);\n $collection->addFieldToFilter('attribute_set_id', array('in' => $attributesetids));\n return $collection->getData();\n }", "public function getProductTr()\n {\n return $this->getDi()->db->selectCol(\"\n SELECT value as ARRAY_KEY, id\n FROM ?_data\n WHERE `table` = 'product' AND `key`='am3:id'\n \");\n }", "public function getOptions() {\n return $this->table->getOptions();\n }", "function _importExtraOptionValues($row, $productID, $updated_extra_option)\n{\n\tfor ($j=0; $j<count($updated_extra_option); $j++)\n\t{\n\t\tif (isset($updated_extra_option[$j]) && $updated_extra_option[$j]) //a column which is an extra option\n\t\t{\n\t\t\t$optionID = $updated_extra_option[$j];\n\n\t\t\t$curr_value = $row[$j];\n\t\t\t$default_variantID = 0;\n\t\t\tif (strpos($curr_value,\"{\")===0 && strpos($curr_value,\"}\")==strlen($curr_value)-1) //is it a selectable value?\n\t\t\t{\n\t\t\t\t$curr_value = substr( $curr_value, 1, strlen($curr_value)-2);\n\t\t\t\t$values_options = explode(\",\",$curr_value);\n\t\t\t\t//delete all current product option configuration\n\t\t\t\tdb_query(\"delete from \".PRODUCT_OPTIONS_VALUES_TABLE.\n\t\t\t\t\t\" where optionID=$optionID and productID=$productID\");\n\t\t\t\tdb_query(\"delete from \".PRODUCTS_OPTIONS_SET_TABLE.\n\t\t\t\t\t\" where optionID=$optionID and productID=$productID\");\n\n\t\t\t\tforeach ($values_options as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (strstr($val,\"=\")) // current value is \"OPTION_NAME=SURCHARGE\", e.g. red=3, xl=1, s=-1, m=0\n\t\t\t\t\t{\n\t\t\t\t\t\t$a = explode(\"=\",$val);\n\t\t\t\t\t\t$val_name = $a[0];\n\t\t\t\t\t\t$val_surcharge = (float)$a[1];\n\t\t\t\t\t}\n\t\t\t\t\telse // current value is a option value name, e.g. red, xl, s, m\n\t\t\t\t\t{\n\t\t\t\t\t\t$val_name = $val;\n\t\t\t\t\t\t$val_surcharge = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t//search for a specified option value in the database\n\t\t\t\t\t$variantID = optOptionValueExists($optionID, $val_name);\n\t\t\t\t\tif ( !$variantID ) //does not exist => add new variant value\n\t\t\t\t\t{\n\t\t\t\t\t\t$variantID = optAddOptionValue($optionID, $val_name, 0);\n\t\t\t\t\t}\n\t\t\t\t\tif (!$default_variantID) $default_variantID = $variantID;\n\n\t\t\t\t\t//now append this variant value to the product\n\t\t\t\t\tdb_query(\"insert into \".PRODUCTS_OPTIONS_SET_TABLE.\n\t\t\t\t\t\t\" (productID, optionID, variantID, price_surplus) \".\n\t\t\t\t\t\t\" values ($productID, $optionID, $variantID, $val_surcharge);\");\n\t\t\t\t}\n\n\t\t\t\t//assign default variant ID - first option in the variants list is default\n\t\t\t\tif ($default_variantID)\n\t\t\t\t{\n\t\t\t\t\tdb_query(\"insert into \".PRODUCT_OPTIONS_VALUES_TABLE.\n\t\t\t\t\t\t\" (optionID, productID, option_type, option_show_times, variantID) \".\n\t\t\t\t\t\t\" values ($optionID, $productID, 1, 1, $default_variantID)\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse // a custom fixed value\n\t\t\t{\n\t\t\t\tdb_query(\"delete from \".PRODUCT_OPTIONS_VALUES_TABLE.\n\t\t\t\t\t\" where optionID=$optionID and productID=$productID\");\n\t\t\t\tdb_query(\"insert into \".PRODUCT_OPTIONS_VALUES_TABLE.\n\t\t\t\t\t\" (optionID, productID, option_value) \".\n\t\t\t\t\t\" values ($optionID, $productID, '\".TransformStringToDataBase($curr_value).\"')\");\n\t\t\t}\n\t\t}\n\t}\n}", "public function toOptionArray()\n {\n $optionArray = array();\n\n $this->searchCriteriaBuilder->addFilter(\n [$this->filterBuilder->setField('is_searchable')->setValue(1)->create()]\n );\n\n $attributes = $this->attributeRepository->getList(Product::ENTITY, $this->searchCriteriaBuilder->create());\n\n foreach ($attributes->getItems() as $attribute) {\n $optionArray[] = array(\n \"value\" => $attribute->getAttributeCode(),\n \"label\" => $attribute->getDefaultFrontendLabel()\n );\n }\n\n return $optionArray;\n }", "public function getSkuOptions($product_id,$variant_options) {\n\t\t$client = $this->client;\n\t\t$request_data = $this->request_data;\n\n\t\t// $options = $this->getOptions();\n\t\t// foreach ($options as $option) {\n\n\t\t// }\n\n\t\t$product_options = $this->getProductOptions($product_id);\n\t\t$options = $this->getOptions();\n\t\t// echo \"PRODUCT_OPTIONS: \".print_r($product_options,true).PHP_EOL;\n\t\t// echo \"OPTIONS: \".print_r($options,true).PHP_EOL;\n\n\t\t$sku_options = array();\n\n\t\tforeach($variant_options as $variant_opt_name => $variant_opt_value) {\n\t\t\t$sku_option = array();\n\t\t\t// echo \"VAR OPT: $variant_opt_name $variant_opt_value\".PHP_EOL;\n\t\t\tforeach($options as $option) {\n\t\t\t\t// echo \"OPT: {$option->name}\".PHP_EOL;\n\t\t\t\tif(strtoupper($variant_opt_name) == strtoupper($option->name)) {\n\t\t\t\t\t\n\t\t\t\t\tif(array_key_exists($option->id, $product_options)) {\n\t\t\t\t\t\t$sku_option['product_option_id'] = $product_options[$option->id]->id;\n\t\t\t\t\t}\n\t\t\t\t\t$values = $this->getOptionValues($option);\n\n\t\t\t\t\t// echo \"OPT VAL: \".print_r($values,true).PHP_EOL;\n\t\t\t\t\t\n\t\t\t\t\t$value_id = 0;\n\t\t\t\t\tif(count($values)) {\n\t\t\t\t\t\tforeach($values as $value) {\n\t\t\t\t\t\t\tif(strtoupper($variant_opt_value) == strtoupper($value->value)) {\n\t\t\t\t\t\t\t\t$value_id = $value->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!$value_id) {\n\n\t\t\t\t\t\t//we didn't find a value ID, so create the value for this option\n\t\t\t\t\t\t$new_value = $this->createOptionValue($option,$variant_opt_value);\n\t\t\t\t\t\t// echo \"CREATE VALUE: \".print_r($new_value,true).PHP_EOL;\n\t\t\t\t\t\t$value_id = $new_value->id;\n\t\t\t\t\t}\n\n\t\t\t\t\t$sku_option['option_value_id'] = $value_id;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($sku_option['product_option_id']) || empty($sku_option['option_value_id'])) {\n\t\t\t\t$this->deleteProduct($product_id);\n\t\t\t\t$this->doException(null,\"Could not match variant options against BigCommerce options. Check that the option names are not misspelt and that variant options names agree with master product option list.\");\n\t\t\t}\n\t\t\t// echo \"SKU OPT: \".print_r($sku_option,true).PHP_EOL;\n\t\t\t$sku_options[] = (object)$sku_option;\n\t\t}\n\n\t\t// foreach($product_options as $product_option) {\n\n\t\t// \t//If we haven't retrieved additional option info & values, do so\n\t\t// \tif(!$product_option->_processed) {\n\n\t\t// \t\t//Get additional option info from the main option object\n\t\t// \t\ttry {\n\t\t// \t\t\t$response = $client->get(\"options/\".$product_option->option_id);\n\t\t// \t\t} catch (\\Exception $e) {\n\t\t// \t\t\t$this->doException($e,'fetching option info');\n\t\t// \t\t}\n\t\t// \t\t$option = $response->json(array('object'=>TRUE));\n\t\t// \t\t$resource = substr($option->values->resource,1);\n\n\t\t// \t\t//get the option's values\n\t\t// \t\ttry {\n\t\t// \t\t\t$response = $client->get($resource);\n\t\t// \t\t} catch (\\Exception $e) {\n\t\t// \t\t\t$this->doException($e,'fetching option values');\n\t\t// \t\t}\n\n\t\t// \t\t$values = $response->json(array('object'=>TRUE));\n\n\t\t// \t\t$option->values = $values;\n\n\t\t// \t\t//merge addtional option info into the product_option\n\t\t// \t\t$product_option = (object) array_merge((array)$product_option,(array)$option);\n\n\t\t// \t\t//cache the additional data\n\t\t// \t\t$product_option->_processed = true;\n\t\t// \t\t$this->product_options[$product_option->option_id] = $product_option;\n\t\t// \t}\n\n\t\t// \t$sku_option = array();\n\t\t// \t//loop through the product options, match name\n\t\t// \tforeach($variant_options as $variant_opt_name => $variant_opt_value) {\n\t\t// \t\tif(strtoupper($variant_opt_name) == strtoupper($product_option->name)) {\n\n\t\t// \t\t\t$sku_option['product_option_id'] = $product_option->product_option_id;\n\n\t\t// \t\t\t//once found, loop through to match value\n\t\t// \t\t\tforeach($product_option->values as $opt_value) {\n\n\t\t// \t\t\t\tif(strtoupper($variant_opt_value) == strtoupper($opt_value->label)) {\n\t\t// \t\t\t\t\t$sku_option['option_value_id'] = $opt_value->id;\n\t\t// \t\t\t\t}\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t\t// \t}\n\t\t// \t$sku_options[] = (object)$sku_option;\n\t\t// }\n\t\t\n\t\treturn $sku_options;\n\t}", "public function getProductData($id = null)\r\n\t{\r\n\t\tif($id) {\r\n\t\t\t$sql = \"select * from products where id = ? ORDER BY id\";\r\n\t\t\t$query = $this->db->query($sql, array($id));\r\n\t\t\treturn $query->row_array();\r\n\t\t}\r\n\r\n\t\t$sql = \"select * from products ORDER BY id\";\r\n\t\t$query = $this->db->query($sql);\r\n\t\treturn $query->result_array();\r\n\t}", "public function getProductTechParams($product_id) {\r\n $product_techparam_data = array();\r\n\r\n $query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"product_techparam_value ptv LEFT JOIN \" . DB_PREFIX . \"techparam t ON (ptv.techparam_id = t.techparam_id) WHERE ptv.product_id = '\" . (int)$product_id . \"' ORDER BY t.sort_order\");\r\n\r\n return $query->rows;\r\n }", "public function getproduct($id='')\n {\n \treturn $this->db->where('id', $id)->get('product')->row();\n }", "public function options()\n {\n return $this->hasMany(\n 'AcronisCloud\\Model\\WHMCS\\ProductConfigOption',\n ProductConfigOption::COLUMN_GID\n );\n }", "protected function _getProductData(array $rowData, $productId)\n {\n $productData = [\n $this->getProductEntityLinkField() => $productId,\n 'has_options' => 1,\n 'required_options' => 0,\n 'updated_at' => $this->dateTime->date(null, null, false)->format('Y-m-d H:i:s'),\n ];\n\n if (!empty($rowData[self::COLUMN_IS_REQUIRED])) {\n $productData['required_options'] = 1;\n }\n\n return $productData;\n }", "public function find($id): array\n {\n return $this->transform(\n PriceOption::query()->with('foreignOption')->findOrFail($id)\n );\n }", "public function getPostedProductOptions($data)\r\n\t{\r\n\t\t$dataOptions = array();\r\n\t\r\n\t\tif (empty($data['ProductOption']))\r\n\t\t{\r\n\t\t\treturn $dataOptions;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($data['ProductOption'] as $k => $v)\r\n\t\t{\r\n\t\t\tif (strpos($k, '-') === false)\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$temp = explode('-', $k);\r\n\t\t\t$optionID = intval($temp[1]);\r\n\t\t\t$valueID = intval($v);\r\n\t\t\t\r\n\t\t\tif (empty($optionID) || empty($valueID))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$dataOptions[$optionID] = $valueID;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $dataOptions;\r\n\t\t\r\n\t}", "private function getTableOptions() {\n $rows = Queries::getTableRows($this->table, [$this->keyColumn, $this->descriptionColumn]);\n $options = collect();\n\n foreach ($rows as $row) {\n $options->push($this->createOption($row->{$this->keyColumn}, $row->{$this->descriptionColumn}));\n }\n\n return $options->toArray();\n }", "function tep_get_option_details($option_id) {\n\t$sel_option= tep_db_query(\"SELECT * FROM artwork_option WHERE artwork_option_id='\".$option_id.\"'\");\n\t$option = tep_db_fetch_array($sel_option);\t\n\treturn $option;\n}", "public function getProduct($id = false)\n {\n if($id === false){\n return $this->table('pemesanan_kamar')\n ->get()\n ->getResultArray();\n } else {\n return $this->table('pemesanan_kamar')\n ->where('pemesanan_id', $id)\n ->get()\n ->getRowArray();\n } \n }", "public function get_products_selected($id)\n {\n $this->db->select('product_variants');\n $this->db->from('voxy_kiemkho');\n $this->db->where(\"id\", $id);\n $query = $this->db->get();\n if ($query->result_array()) {\n foreach ($query->result() as $row) {\n return $row->product_variants;\n }\n } else {\n return false;\n }\n }", "function optGetOptions()\r\n{\r\n\t$name = LanguagesManager::sql_constractSortField(PRODUCT_OPTIONS_TABLE, 'name',true);\r\n\t$sort_name = LanguagesManager::sql_getSortField(PRODUCT_OPTIONS_TABLE, 'name');\r\n\t$sql = <<<SQL\r\n\tSELECT \r\n\t\t(\r\n\t\t\tSELECT COUNT(`?#PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE`.`variantID`) \r\n\t\t\tFROM `?#PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE` \r\n\t\t\tWHERE `?#PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE`.`optionID` = `?#PRODUCT_OPTIONS_TABLE`.`optionID`\r\n\t\t) as `count_variants`,\r\n\t\t`?#PRODUCT_OPTIONS_TABLE`.*,\r\n\t\t{$name} \r\n\t\t\r\n\tFROM `?#PRODUCT_OPTIONS_TABLE`\r\n\tORDER BY `?#PRODUCT_OPTIONS_TABLE`.`sort_order`, {$sort_name}\r\n\t\r\nSQL;\r\n/*\t$sql = <<<SQL\r\n\tSELECT `?#PRODUCT_OPTIONS_TABLE`.*, COUNT(1) AS `count_variants`, {$name}\r\n\tFROM `?#PRODUCT_OPTIONS_TABLE`\r\n\tLEFT JOIN `?#PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE`\r\n\tON (`?#PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE`.`optionID` = `?#PRODUCT_OPTIONS_TABLE`.`optionID`)\r\n\tGROUP BY `?#PRODUCT_OPTIONS_TABLE`.`optionID`\r\n\tORDER BY `?#PRODUCT_OPTIONS_TABLE`.`sort_order`, {$sort_name}\r\nSQL;*/\r\n\t$q = db_phquery($sql);\r\n\t\t\r\n\t$result=array();\r\n\twhile( $row=db_fetch_assoc($q) ){\r\n\t\tLanguagesManager::ml_fillFields(PRODUCT_OPTIONS_TABLE, $row);\r\n\t\t$row['optionID'] = intval($row['optionID']);\r\n\t\t$result[] = $row;\r\n\t}\r\n\treturn $result;\r\n\t//OLD CODE\r\n\t/*\r\n\t\t$q = db_query('\r\n\t\tSELECT *,'.LanguagesManager::sql_constractSortField(PRODUCT_OPTIONS_TABLE, 'name').' \r\n\t\tFROM '.PRODUCT_OPTIONS_TABLE.' ORDER BY sort_order, '.LanguagesManager::sql_getSortField(PRODUCT_OPTIONS_TABLE, 'name'));\r\n\r\n\t$result=array();\r\n\twhile( $row=db_fetch_row($q) ){\r\n\t\t$q1=db_phquery('SELECT COUNT(variantID) FROM ?#PRODUCTS_OPTIONS_VALUES_VARIANTS_TABLE WHERE optionID=?',$row[\"optionID\"]);\r\n\t\t$r1=db_fetch_row($q1);\r\n\t\t$row['count_variants']=$r1[0];\r\n\t\tLanguagesManager::ml_fillFields(PRODUCT_OPTIONS_TABLE, $row);\r\n\t\t$result[] = $row;\r\n\t}\r\n\treturn $result;*/\r\n}", "function get_option_by_product_id_option_group_id($product_id, $group_id)\n {\n\n $colors = $this->db->from($this->_stock)\n ->where('product_id', $product_id)\n ->join($this->option->table() . \" A \", \"A.id = $this->_stock.option_id\")\n ->select(\"$this->_stock.option_id, A.title , A.image \")\n ->where(' A.option_id ', $group_id)\n ->group_by('A.id')\n ->get()->result();\n\n foreach ($colors as $color) {\n $options[$color->option_id] =\n array(\n 'id' => $color->option_id,\n 'title' => $color->title,\n 'color_code' => $color->image,\n 'size' => $this->db->from($this->_stock)\n ->where('product_id', $product_id)\n ->join($this->option->table() . \" A \", \"A.id = $this->_stock.option_id\")\n ->join($this->option->table() . \" B \", \"B.id = $this->_stock.option_detail_id\")\n ->select(\"$this->_stock.* , A.title as color , B.title as size\")\n ->where(' A.option_id ', $group_id)\n ->where(' A.id ', $color->option_id)\n ->get()->result()\n );\n\n }\n\n return isset($options) ? $options : array();\n\n }", "public function options()\n\t{\n\t\treturn $this->hasMany(ProductOption::class);\n\t}", "public function extractOptions()\n {\n if ($this->hasMultipleItems()) {\n /*collecting product ids*/\n $productIds = [];\n foreach ($this->productInfo->attributes as $attribute) {\n $options = $attribute->options;\n foreach ($options as $option) {\n $products = $option->products;\n foreach ($products as $product) {\n if (!in_array($product, $productIds)) {\n $productIds[] = $product;\n }\n }\n }\n }\n\n $items = [];\n\n foreach ($productIds as $productId) {\n $item = [];\n foreach ($this->productInfo->attributes as $attribute) {\n foreach ($attribute->options as $option) {\n if (in_array($productId, $option->products)) {\n if (!isset($item[$attribute->label])) {\n $item[$attribute->label] = new \\stdClass();\n }\n $item[$attribute->label]->text = $option->label;\n $item[$attribute->label]->value = $option->id;\n break;\n }\n }\n }\n $items[] = $item;\n }\n $this->options = $items;\n\n return true;\n }\n return false;\n }", "public function getAllOptions()\n\t{\n\t\tif(is_null($this->_options))\n\t\t{\n\t\t\t$this->_options = array();\n\t\t\t$productAttributes = Mage::getResourceModel('catalog/product_attribute_collection');\n\t\t\tforeach($productAttributes as $productAttr)\n\t\t\t{\n\t\t\t\tif($productAttr->getIsFilterable())\n\t\t\t\t{\n\t\t\t\t\tarray_push($this->_options, array(\n\t\t\t\t\t\t'value' => $productAttr->getAttributeId(),\n\t\t\t\t\t\t'label' => $productAttr->getAttributeCode()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->_options;\n\t}", "public function extractOptions()\n {\n $this->__getProductInfo();\n if (!is_null($this->productInfo) && isset($this->productInfo->results)) {\n $items = [];\n foreach ($this->productInfo->results as $productInfo) {\n\n $item = [];\n $item[\"Variant\"] = new \\stdClass();\n $item[\"Variant\"]->text = $productInfo->sku_web_title;\n $item[\"Variant\"]->value = $productInfo->internalid;\n $items[] = $item;\n }\n $this->options = $items;\n }\n return true;\n }", "function option_price($id) {\n return $this->get_option($id,'price');\n }", "function getAttributeOption($pid, $valOptId) {\r\n $varQuery = \"SELECT AttributeOptionValue,OptionExtraPrice,AttributeOptionImage FROM \" . TABLE_PRODUCT_TO_OPTION . \" WHERE fkProductId='\" . $pid . \"' AND fkAttributeOptionId = '\" . $valOptId . \"'\";\r\n $arrPackRow = $this->getArrayResult($varQuery);\r\n return $arrPackRow[0];\r\n }", "public function fetchProductOptionValues($optionID)\n {\n return $this->productOptionValue\n ->where('product_option_labels_id', $optionID)\n ->get(['name', 'addon_price']);\n }", "public function getAttributeOptions($attributeId) {\n $sql = \"SELECT value from catalog_item_attribute where attribute_name_id = :attId GROUP BY value\";\n\n $res = $this->query($sql, array(\":attId\" => $attributeId));\n return $res;\n }", "function getConfiguredProductOptions($ags) {\n\t\t$product_id = $ags ['product_id'];\n\t\t$type = $ags ['type'];\n\t\t\n\t\t$array = array ();\n\t\t// return $array;\n\t\t/*\n\t\t * $sql = \"SELECT a.product_to_options_id,a.parent_option_id,\n\t\t * b.option_id,b.option_name,b.option_type\n\t\t * FROM zselex_product_to_options a\n\t\t * INNER JOIN zselex_product_options b ON b.option_id=a.option_id\n\t\t * WHERE a.product_id=$product_id ORDER BY b.sort_order ASC\";\n\t\t * // echo $sql;\n\t\t * $query = DBUtil::executeSQL($sql, '', '', false);\n\t\t * $result = $query->fetchAll();\n\t\t */\n\t\t\n\t\t$result = $this->entityManager->getRepository ( 'ZSELEX_Entity_ProductToOption' )->getProductToOptions ( array (\n\t\t\t\t'product_id' => $product_id \n\t\t) );\n\t\t// $array[]\n\t\t// echo \"<pre>\"; print_r($result); echo \"</pre>\"; exit;\n\t\t\n\t\tforeach ( $result as $key => $val ) {\n\t\t\t\n\t\t\t/*\n\t\t\t * $result[$key]['main_option_values'] = ModUtil::apiFunc('ZSELEX', 'user', 'getAll', array(\n\t\t\t * 'table' => 'zselex_product_options_values',\n\t\t\t * 'where' => \"option_id=$val[option_id]\",\n\t\t\t * 'fields' => array('option_value_id', 'option_value', 'sort_order'),\n\t\t\t * 'orderby' => \"sort_order ASC\"\n\t\t\t * ));\n\t\t\t */\n\t\t\t\n\t\t\t$result [$key] ['main_option_values'] = $this->entityManager->getRepository ( 'ZSELEX_Entity_ProductToOption' )->getProductOptionValues ( array (\n\t\t\t\t\t'option_id' => $val ['option_id'] \n\t\t\t) );\n\t\t\t\n\t\t\t// echo \"<pre>\"; print_r($result); echo \"</pre>\"; exit;\n\t\t\t$product_to_options_id = $val ['product_to_options_id'];\n\t\t\t$append = '';\n\t\t\t$qtySql = '';\n\t\t\t\n\t\t\tif ($type == 'front') {\n\t\t\t\t$qtySql = \" AND a.qty > 0 \";\n\t\t\t}\n\t\t\tif ($type == 'front') {\n\t\t\t\t$append = \" GROUP BY a.option_value_id \";\n\t\t\t}\n\t\t\t/*\n\t\t\t * $sql = \"SELECT a.product_to_options_value_id , a.option_value_id , a.parent_option_value_id ,a.price , a.qty ,a.parent_option_id,b.option_value\n\t\t\t * FROM zselex_product_to_options_values a\n\t\t\t * LEFT JOIN zselex_product_options_values b ON a.option_value_id=b.option_value_id\n\t\t\t * WHERE a.product_to_options_id=$product_to_options_id $qtySql\n\t\t\t * $append\n\t\t\t * ORDER BY b.sort_order ASC\";\n\t\t\t * // GROUP BY a.option_value_id\n\t\t\t * // echo $sql;\n\t\t\t * $query = DBUtil::executeSQL($sql, '', '', false);\n\t\t\t * $result[$key]['values'] = $query->fetchAll();\n\t\t\t */\n\t\t\t\n\t\t\t$result [$key] ['values'] = $this->entityManager->getRepository ( 'ZSELEX_Entity_ProductToOption' )->getProductToOptionValues ( array (\n\t\t\t\t\t'product_to_options_id' => $product_to_options_id,\n\t\t\t\t\t'append' => $append,\n\t\t\t\t\t'qtySql' => $qtySql \n\t\t\t) );\n\t\t}\n\t\t\n\t\t// echo \"<pre>\"; print_r($result); echo \"</pre>\"; exit;\n\t\t\n\t\treturn $result;\n\t}", "public function fetchAllAvailableOptionsForDevice ($id)\n {\n $devOptTableName = DeviceOptionMapper::getInstance()->getTableName();\n\n $sql = \"SELECT * FROM {$this->getTableName()} AS opt\n WHERE NOT EXISTS (\n SELECT * FROM {$devOptTableName} AS do\n WHERE do.masterDeviceId = ? AND do.optionId = opt.id\n )\n ORDER BY opt.name ASC\n \";\n\n $resultSet = $this->getDbTable()\n ->getAdapter()\n ->fetchAll($sql, $id);\n\n $entries = [];\n foreach ($resultSet as $row)\n {\n $object = new OptionModel($row);\n\n // Save the object into the cache\n $this->saveItemToCache($object);\n\n $entries [] = $object;\n }\n\n return $entries;\n }", "public function getProductDescriptions($productId, $options = []);", "public function get_option_list_by_question_id($question_id) {\n\t\t$this->db->where('question_id', $question_id);\n// $this->db->order_by('value', 'ASC');\n\t\treturn $this->db->get('question_option')->result_array();\n\t}", "private function getOptionsFromSQL()\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t$db->setQuery($this->value_source);\n \t\t$rows = $db->loadObjectList();\n\n\t\treturn $rows;\n\t}", "public function getProduct($id = false)\n {\n if($id === false){\n return $this->table('sewa_kendaraan')\n ->get()\n ->getResultArray();\n } else {\n return $this->table('sewa_kendaraan')\n ->where('kendaraan_id', $id)\n ->get()\n ->getRowArray();\n } \n }", "public function options()\n {\n // If we dont have product options, send NULL\n // PHP converts empty dictionaries to arrays\n // and with forceObject set, it breaks other things\n if (!$this->_configurableProduct()) {\n return NULL;\n }\n\n $attributes = $this->_attributes();\n $options = array();\n foreach ($attributes as $option) {\n $options += $this->_buildSelection($option);\n }\n\n return empty($options) ? NULL : $options;\n }", "public function getCatalogProductAttributesOptions()\n {\n return $this->hasMany(CatalogProductAttributesOption::className(), ['attribute_id' => 'id']);\n }", "public function getProductOptions() {\n if (isset($this->product_group)) {\n $products = $this->product_dao->getProductsInGroup($this->product_group->getID());\n } else {\n $products = $this->product_dao->getAllProducts();\n }\n $currentProductId = 0;\n if (isset($this->product)) {\n $currentProductId = $this->product->getID();\n }\n $productOptions = \"\";\n foreach ($products as $product) {\n $productOptions = $productOptions . \"<option value=\\\"\" . $product->getID() . \"\\\"\";\n if ($product->getID() == $currentProductId) {\n $productOptions = $productOptions . \"selected=\\\"selected\\\"\";\n }\n $productOptions = $productOptions . \">\" . $product->getName() . \"</option>\";\n }\n return $productOptions;\n }", "function getproducts($id = \"\"){\n if(!empty($id)){\n $query = $this->db->get_where('ts_product', array('id' => $id));\n return $query->row_array();\n }else{\n $query = $this->db->get('ts_product');\n return $query->result_array();\n }\n }", "protected function getOptions()\n\t{\n\t\t$this->import('Database');\n\t\t$this->loadDataContainer('tl_iso_attributes');\n\t\t$this->loadDataContainer('tl_iso_products');\n\t\t$this->loadLanguageFile('tl_iso_products');\n\n\t\t$arrAttributes = array();\n\t\t$arrDca = $GLOBALS['TL_DCA']['tl_iso_products']['fields'];\n\n\t\tforeach ($arrDca as $field => $arrData)\n\t\t{\n\t\t\tif (is_array($arrData['attributes']) && $arrData['attributes']['legend'] != '' && !in_array($field, $this->arrDisabledFields))\n\t\t\t{\n\t\t\t\t// Variant options are not available\n\t\t\t\tif ($this->variants && ($arrData['attributes']['variant_option'] || $arrData['attributes']['inherit']))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$arrAttributes[$arrData['attributes']['legend']][] = array\n\t\t\t\t(\n\t\t\t\t\t'label'\t\t=> (strlen($arrData['label'][0]) ? $arrData['label'][0] : $field),\n\t\t\t\t\t'value'\t\t=> $field,\n\t\t\t\t\t'disabled'\t=> ($this->variants ? $arrData['attributes']['variant_fixed'] : $arrData['attributes']['fixed']),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tuksort($arrAttributes, create_function('$a,$b', 'return (array_search($a, $GLOBALS[\"TL_DCA\"][\"tl_iso_attributes\"][\"fields\"][\"legend\"][\"options\"]) > array_search($b, $GLOBALS[\"TL_DCA\"][\"tl_iso_attributes\"][\"fields\"][\"legend\"][\"options\"])) ? 1 : -1;'));\n\n\t\treturn $arrAttributes;\n\t}", "public function getProductDetailsByProductId($id){\n\t\t// Query To Fetch Products Details\n\t\t$product_id = $id; \n\t\t$product_id_list = DB::select(DB::raw(\"SELECT Product_Name,Product_Description,Price,RefItemId,SKU,UnitWeight\n \tFROM products WHERE Product_Id =\".$product_id));\n\t\treturn $product_id_list;\n\t}", "public function getProductsByID($id)\n {\n $sql = \"SELECT * FROM `products` WHERE ID = $id\";\n // thuc thi cau truy van\n $result = self::$conn->query($sql);\n return $this->getData($result);\n }", "protected function _getProductOptions()\n {\n $block = Mage::app()->getLayout()->getBlockSingleton('catalog/product_view_type_configurable');\n $jsonConfig = $block->getJsonConfig();\n return Mage::helper('core')->jsonDecode($jsonConfig);\n }", "public function get_option_values($option_id=0)\n {\n $query = \"select * from `default_shop_item_option_values` where option_id={$this->db->escape($option_id)};\";\n $sql = $this->db->query($query);\n return $sql;\n }", "public function getOptions()\n {\n return $this->getTable()->getOptions();\n }", "private static function get_product_type_options()\n {\n }", "public function getOptionList()\n {\n return $this->_giftCardConfiguration->getOptions($this->getItem());\n }", "public function getOptionValueIds()\n {\n return $this\n ->getOptionValues()\n ->pluck('id')\n ->sort()\n ->all();\n }", "public function fetchOptionValues($optionID)\n {\n return $this->productOptionValue\n ->where('product_option_labels_id', $optionID)\n ->select(\n 'id',\n 'name',\n 'addon_price'\n )\n ->get();\n }", "public function getMaterialIdOptions()\n {\n //do whatever you want to do\n $result = [];\n $result[''] = '';\n foreach (Material::all() as $material) {\n $result[$material->id] = [$material->name];\n }\n return $result;\n }", "function getQuestionOption($optionid){\n\t\t$stmt = $this->con->prepare(\"SELECT optionid, optionname, votecount, questionid FROM questionoption WHERE optionid = ?\");\n\t\t$stmt->bind_param(\"i\", $optionid);\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($optionid, $optionname, $votecount, $questionid);\n\t\t\n\t\t$option = array();\n\t\t\n\t\tif($stmt->fetch()){\n\t\t\t$option['optionid'] = $optionid; \n\t\t\t$option['optionname'] = $optionname; \n\t\t\t$option['votecount'] = $votecount; \n\t\t\t$option['questionid'] = $questionid; \n\t\t}\n\t\t\n\t\treturn $option; \n\t}", "public function getProductArray($idOnly = false){\n return Product::getProductArray($this->configuration, $idOnly, $this->order->program->profession->id);\n\t}", "public function getOptions($entity_id, $field_name);", "public function getProducts()\n {\n return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('product_option', ['option_value_id' => 'id']);\n }", "static public function getAllOptions()\r\n {\r\n $res = array(\r\n array(\r\n 'value' => '',\r\n 'label' => Mage::helper('catalog')->__('-- Please Select --')\r\n )\r\n );\r\n foreach (self::getOptionSellerProductStatusArray() as $index => $value) {\r\n $res[] = array(\r\n 'value' => $index,\r\n 'label' => $value\r\n );\r\n }\r\n return $res;\r\n }", "function getFilterOptions($id) {\n global $wpdb;\n \n $prepared = $wpdb->prepare(\"SELECT * FROM `wp_trench_filter_options` WHERE compatOption = '%s'\", $id);\n $result = $wpdb->get_results($prepared);\n\n echo \"<option selected value='--'> Select Value... </option>\";\n foreach ($result as &$optionResult) { // RUN QUERY FOR OPTIONS\n \n echo \"<option value='\".trim($optionResult->optionID).\"'>\".$optionResult->optionText.\"</option>\";\n \n }\n \n }", "public function toOptionArray()\r\n {\r\n $attributes = $this->catalogResourceModelProductAttributeCollectionFactory->create()->getItems();\r\n \t$field = array();\r\n\t\t foreach ($attributes as $attribute){\r\n \t\t $code = $attribute->getAttributecode();\r\n \t\t $label = $attribute->getFrontendLabel();\r\n \t\t if(!empty($label) && !empty($code))\r\n \t\t array_push($field, array('value' => $code,'label'=> $label ));\r\n\t\t }\r\n\r\n return $field;\r\n }", "public function get_product($product_id) {\n $this->db->select('p.id,p.name,p.price');\n $this->db->from('product as p');\n $this->db->where('p.id', $product_id);\n $query = $this->db->get()->row_array();\n return $query;\n }", "function optionsbypollId($id)\n {\n // global $ado;\n $res = $this->exec(\"select * from options where ques_id = '$id'\");\n return $res;\n }" ]
[ "0.6880997", "0.67607695", "0.65427965", "0.6528778", "0.6519883", "0.6511004", "0.6315502", "0.62748325", "0.6228501", "0.6226408", "0.61687803", "0.6162693", "0.6143921", "0.6112737", "0.60949445", "0.6091967", "0.6082529", "0.6059203", "0.6052321", "0.6016377", "0.60140365", "0.59990746", "0.59746706", "0.59598154", "0.5959497", "0.59399086", "0.593164", "0.59227407", "0.59199655", "0.5911908", "0.59108794", "0.5889773", "0.5876009", "0.5851623", "0.5851323", "0.58340925", "0.5821138", "0.58203554", "0.5816145", "0.5812161", "0.5801245", "0.57884455", "0.57712376", "0.5764069", "0.5762565", "0.5748114", "0.5743965", "0.57427955", "0.5741252", "0.5729997", "0.5727896", "0.57217383", "0.5711939", "0.5704055", "0.5697774", "0.5682264", "0.5681788", "0.56805736", "0.5676291", "0.56653017", "0.5662777", "0.5658552", "0.56576693", "0.5657053", "0.5656277", "0.5652", "0.56488365", "0.56477636", "0.56476086", "0.5645852", "0.56395274", "0.56393313", "0.56379426", "0.5636962", "0.5631281", "0.56173277", "0.5615855", "0.56131965", "0.5611251", "0.560749", "0.5607254", "0.5599617", "0.5596087", "0.55830175", "0.5579094", "0.55763173", "0.5575647", "0.5575505", "0.55696785", "0.55688095", "0.5562623", "0.55528843", "0.55444825", "0.55363864", "0.553632", "0.55306953", "0.55299836", "0.55234814", "0.5516385", "0.5516099" ]
0.7599353
0
Returns Zend_Search_Lucene instance for given subroot every subroot has it's own instance
Возвращает экземпляр Zend_Search_Lucene для заданного подкорня, каждый подкорень имеет свой собственный экземпляр
public static function getInstance(Kwf_Component_Data $subroot) { while ($subroot) { if (Kwc_Abstract::getFlag($subroot->componentClass, 'subroot')) { break; } $subroot = $subroot->parent; } if (!$subroot) $subroot = Kwf_Component_Data_Root::getInstance(); static $instance = array(); if (!isset($instance[$subroot->componentId])) { $analyzer = new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive(); $analyzer->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_ShortWords(2)); //$stopWords = explode(' ', 'der dir das einer eine ein und oder doch ist sind an in vor nicht wir ihr sie es ich'); //$analyzer->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_StopWords($stopWords)); Zend_Search_Lucene_Analysis_Analyzer::setDefault($analyzer); Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('utf-8'); Zend_Search_Lucene_Storage_Directory_Filesystem::setDefaultFilePermissions(0666); $path = 'cache/fulltext'; $path .= '/'.$subroot->componentId; try { $instance[$subroot->componentId] = Zend_Search_Lucene::open($path); } catch (Zend_Search_Lucene_Exception $e) { $instance[$subroot->componentId] = Zend_Search_Lucene::create($path); } } return $instance[$subroot->componentId]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _initLucene() {\n\ttry {\n\t // load config\n\t $this->bootstrap('config');\n\n\t // get config\n\t $config = Knowledgeroot_Registry::get('config');\n\n\t try {\n\t\t// open lucene index\n\t\t$lucene = Zend_Search_Lucene::open($config->lucene->save_path);\n\t } catch (Zend_Search_Lucene_Exception $e) {\n\t\ttry {\n\t\t // create lucene index\n\t\t $lucene = Zend_Search_Lucene::create($config->lucene->save_path);\n\t\t} catch (Exception $e) {\n\t\t throw new Exception('Could not create index for lucene');\n\t\t}\n\t }\n\n\t // save object in registry\n\t Knowledgeroot_Registry::set('lucene', $lucene);\n\n\t return $lucene;\n\t} catch (Exception $e) {\n\t echo $e->getMessage();\n\t die('could not create search');\n\t}\n }", "function populateIndex(&$root) {\n\t\t$this->indexNode($root);\n\t\t$children = &$root->getChildren();\n\t\tforeach ($children as $child) {\n\t\t\t$this->populateIndex($child);\n\t\t}\n\t}", "static public function open()\n\t{\n\t\t$index_dir = Registry::get('search.index-directory');\n\t\ttry{\n\t\t\treturn new SearchIndex(Zend_Search_Lucene::open($index_dir));\n\t\t} catch(Zend_Search_Lucene_Exception $e) {\n\t\t\treturn SearchIndex::create($index_dir);\n\t\t}\n\t}", "public function getIndex()\n {\n if (!$this->index) {\n if (!file_exists($this->indexDir)) {\n mkdir($this->indexDir, 0777, true);\n chmod($this->indexDir, 0777);\n\n $this->index = Zend_Search_Lucene::create($this->indexDir);\n } elseif (!file_exists($this->indexDir.'/segments.gen')) {\n $this->index = Zend_Search_Lucene::create($this->indexDir);\n } else {\n $this->index = Zend_Search_Lucene::open($this->indexDir);\n }\n }\n return $this->index;\n }", "public static function indexDocument($id)\n\t{\n\t\tini_set(\"memory_limit\",\"2048M\");\n\t\ttry\n\t\t{\n\t\t\t$search_config_file = SF_ROOT_DIR.'/config/search.xml';\n\t\t\t$documents = simplexml_load_file($search_config_file);\n\t\t\t$document_instance = Document::getDocumentInstance($id);\n\t\t\t$document_name = get_class($document_instance);\n\t\t\t$search_index_path = SF_ROOT_DIR.'/cache/search/'.strtolower($document_name);\n\t\t\t$search_index = Zend_Search_Lucene::open($search_index_path);\n\t\t\t$common_field_val = \"\";\n\t\t\t$search_doc = new Zend_Search_Lucene_Document();\n\t\t\t$genDoc = Document::getGenericDocument($id);\n\t\t\tif ($genDoc) $date = $genDoc->getCreatedAt();\n\n\t\t\tforeach ($documents as $document)\n\t\t\t{\n\t\t\t\t$docClass = $document->attributes();\n\t\t\t\tif($document_name == $docClass)\n\t\t\t\t{\n\t\t\t\t\t$search_doc->addField(Zend_Search_Lucene_Field::Keyword('document_id', $id,'utf-8'));\n\t\t\t\t\t$search_doc->addField(Zend_Search_Lucene_Field::Keyword('document_date', $date,'utf-8'));\n\t\t\t\t\t$search_doc->addField(Zend_Search_Lucene_Field::Text('document_label', $document_instance->getLabel(),'utf-8'));\n\t\t\t\t\t$search_doc->addField(Zend_Search_Lucene_Field::Keyword('document_type', $document_name,'utf-8'));\n/*\t\t\t\t\tif(substr($document_name, -4) == \"I18n\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$search_doc->addField(Zend_Search_Lucene_Field::Keyword('Culture', $document_instance->getCulture(), 'utf-8'));\n\t\t\t\t\t}*/\n\n\t\t\t\t\tforeach ($document as $field_name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$attr = get_object_vars($field_name);\n\t\t\t\t\t\t$attributes = $attr['@attributes'];\n\t\t\t\t\t\t$getFunction = 'get'.$attributes['name'];\n\t\t\t\t\t\t$fieldContent = \"\";\n\n\t\t\t\t\t\tif($attributes['linked'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$getFunctionLinked = 'get'.$attributes['linked'];\n\t\t\t\t\t\t\t$linkedObj = Document::getDocumentInstance($document_instance->$getFunction());\n\t\t\t\t\t\t\tif($linkedObj) $fieldContent = $linkedObj->$getFunctionLinked();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fieldContent = $document_instance->$getFunction();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$search_doc->addField(Zend_Search_Lucene_Field::Text($attributes['name'], $fieldContent, 'utf-8'));\n\t\t\t\t\t}\n\n\t\t\t\t\t$search_index->addDocument($search_doc);\n\t\t\t\t\t$search_index->commit();\n\t\t\t\t\t//$search_index->optimize();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tFileHelper::Log(\"INDEXING > Error wile adding document \".$id.\" | \".$e->getMessage(), UtilsHelper::MSG_ERROR );\n\t\t\tthrow $e;\n\t\t}\n\n\t\t/*\n\t\ttry\n\t\t{\n\t\t$doc = Document::getDocumentInstance($id);\n\t\t$docClass = get_class($doc);\n\n\t\t$search_config_file = sfConfig::get('sf_root_dir').'/config/search.xml';\n\t\t$documents = simplexml_load_file($search_config_file);\n\n\t\t$index_path = sfConfig::get('sf_root_dir').'/cache/search/'.strtolower($docClass);\n\t\t$search_index = Zend_Search_Lucene::open($index_path);\n\n\t\t//if($doc && ($doc->getPublicationStatus() == UtilsHelper::STATUS_ACTIVE) && ($docClass == \"User\" && in_array($docFrontType, $userArr)))\n\t\t{\n\t\tforeach ($documents as $document)\n\t\t{\n\t\t$document_name = $document->attributes();\n\t\tif($document_name == $docClass)\n\t\t{\n\t\t$common_field_val = null;\n\t\t$profile = $profiles[$docFrontType];\n\t\t$search_doc = new Zend_Search_Lucene_Document();\n\t\t$search_doc->addField(Zend_Search_Lucene_Field::Keyword('document_id', $id,'utf-8'));\n\t\t$search_doc->addField(Zend_Search_Lucene_Field::Keyword('document_label', $doc->getLabel(),'utf-8'));\n\t\t$search_doc->addField(Zend_Search_Lucene_Field::Keyword('document_type', $document_name,'utf-8'));\n\t\t$search_doc->addField(Zend_Search_Lucene_Field::Text('Description', $doc->getDescription(), 'utf-8'));\n\t\t$search_doc->addField(Zend_Search_Lucene_Field::Keyword('document_url', \"\"));\n\n\t\tforeach ($document as $field_name)\n\t\t{\n\t\t$attr = get_object_vars($field_name);\n\t\t$attributes = $attr['@attributes'];\n\t\t$getFunction = 'get'.$attributes['name'];\n\t\t$fieldContent = null;\n\n\t\tif($attributes['linked'])\n\t\t{\n\t\t$getFunctionLinked = 'get'.$attributes['linked'];\n\t\t$linkedObj = self::getDocumentInstance($doc->$getFunction());\n\t\tif($linkedObj) $fieldContent = $linkedObj->$getFunctionLinked();\n\t\t}\n\t\telse\n\t\t{\n\t\t$fieldContent = $doc->$getFunction();\n\t\t}\n\n\t\tif($attributes['setTo'])\n\t\t{\n\t\t$common_field_val .= $fieldContent;\n\t\t}\n\t\telse\n\t\t{\n\t\t$search_doc->addField(Zend_Search_Lucene_Field::Text($attributes['name'], $fieldContent, 'utf-8'));\n\t\t}\n\t\t}\n\n\t\tif($attributes['setTo'])\n\t\t{\n\t\t$pattern1 = '/[^a-zA-Z0-9 ]/';\n\t\t$pattern2 = '/ .{1,2} /';\n\t\t$replacement = '';\n\t\t$replacement2 = ' ';\n\t\t$common_field_val = preg_replace($pattern1, $replacement, $common_field_val);\n\t\t$common_field_val = preg_replace($pattern2, $replacement2, $common_field_val);\n\t\t$search_doc->addField(Zend_Search_Lucene_Field::Text($attributes['setTo'], $common_field_val, 'utf-8'));\n\t\t}\n\n\t\t$search_index->addDocument($search_doc);\n\t\t}\n\t\t}\n\t\t}\n\n\t\t$search_index->commit();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\tFileHelper::Log(\"INDEXING -> Error wile adding document \".$id.\" | \".$e->getMessage(), UtilsHelper::MSG_ERROR );\n\t\t}*/\n\t}", "public static final function get_instance($path) {\n\t\t$xx = explode('/',$path);\n\t\t$curr = self::$root;\n\t\tif(is_object($curr) && $curr->get_node_id() != $xx[1]) {\n\t\t\t$x = null;\n\t\t\treturn $x;\n\t\t}\n\t\t$xx_count = count($xx);\n\t\tif($xx_count>2) {\n\t\t\t$curr = $curr->get_child($xx[2]);\n\t\t\tif(!$curr) return $curr;\n\t\t\t$xx_count--;\n\t\t\tfor($i=2; $i<$xx_count; $i++) {\n\t\t\t\tif($curr->get_node_id() == $xx[$i]) {\n\t\t\t\t\t$curr = $curr->get_child($xx[$i+1]);\n\t\t\t\t} else {\n\t\t\t\t\t$x = null;\n\t\t\t\t\treturn $x;\n\t\t\t\t}\n\t\t\t\tif(!$curr) return $curr;\n\t\t\t}\n\t\t}\n\t\treturn $curr;\n\t}", "public static function forge($root)\n {\n return new static($root);\n }", "public static function getInstance()\n {\n return new Sub();\n }", "function createDoc() {\n\t\t$this->currentDoc = new Zend_Search_Lucene_Document(); \n\t}", "static public function get_instance()\n {\n if (self::$instance == NULL)\n {\n self::$instance = new CmsSearch();\n }\n return self::$instance;\n }", "public static function getInstance()\n\t{\n\t\tif(!self::$search_obj)\n\t\t{\n\t\t\tself::$search_obj=new Search();\n\t\t}\n\n\t\treturn self::$search_obj;\n\t}", "public function testRecursiveChildSearchWithChildIndex(): void\n {\n $result = (new JSONPath($this->getData('example')))\n ->find('$..books[2].title');\n\n self::assertEquals(['Moby Dick'], $result->getData());\n }", "public static function &getInstance()\n {\n static $instance;\n\n if (is_null($instance))\n {\n $instance = new tsIndex();\n }\n return $instance;\n }", "static public function getLuceneIndex()\n {\n ProjectConfiguration::registerZend();\n\n $index = self::getLuceneIndexFilename();\n if (file_exists($index))\n {\n return Zend_Search_Lucene::open($index);\n }\n\n return Zend_Search_Lucene::create($index);\n }", "public function get_roots(){\n\t\t$query = array('$or' => array(array('id_parent' => ''), array('id_parent' => array('$exists' => false))));\n\t\treturn $this->_collection->find($query);\t\n\t}", "public function tree_get_root()\n\t{\n\t\t$query = $this->query()->where($this->configuration['left_field'], 1);\n\n\t\tif ( ! is_null($this->configuration['tree_field']))\n\t\t{\n\t\t\t$query->where($this->configuration['tree_field'], $this->tree_get_tree_id());\n\t\t}\n\n\t\t// return the ORM Model object\n\t\treturn $this->_get_one($query);\n\t}", "private function _getFilteredTree($params) {\n\n\t\t$matchDescr = $this->_getDescrLeafRelatedDoc($params);\n\t\t\n\t\tif(count($matchDescr) < 1) {\n\t\t\t\n\t\t\treturn $this->_getNoResultReponse();\n\t\t\tprint_r($matchDescr);exit;\n\t\t}\n\t\t\n\t\t// add uid of matching parent in rootline\n\t\t$this->_setFilteredRootline($matchDescr);\n\t\t\n\t\tif(isset($params->needle)) {\n\n\t\t\t$this->_setFilteredTreeNodes('root', NULL, $matchDescr);\n\n\t\t} else {\n\t\t\t// session\n\t\t\t$this->_setFilteredTreeNodes('root', NULL, $matchDescr, TRUE);\n\t\t}\n\t\treturn self::$_resultArTree;\n\t}", "public function getChildren() \n {\n\n global $DOCMGR;\n\n $opt = null;\n $opt[\"command\"] = \"docmgr_search_browse\";\n $opt[\"path\"] = $this->path;\n $opt[\"no_paginate\"] = 1;\n $arr = $DOCMGR->call($opt);\n\n $this->objects = $arr[\"object\"];\n $_SESSION[\"docmgr_objects\"] = $this->objects;\n \n $num = count($this->objects);\n $nodes = array();\n \n for ($i=0;$i<$num;$i++)\n {\n $nodes[] = $this->getChild($this->objects[$i][\"name\"],$this->objects[$i]);\n }\n\n\n return $nodes;\n\n }", "public static function saveSearchIndex()\n\t{\n\t\t$index = new Zend_Search_Lucene(sfConfig::get('sf_lib_dir').'/modules/search/tmp/lucene.user.index',true);\n\n\t\t$doc = new Zend_Search_Lucene_Document();\n\t\t$doc->addField(Zend_Search_Lucene_Field::Keyword('id', $this->pageDocument->getId()));\n\t\t$doc->addField(Zend_Search_Lucene_Field::Keyword('pageid', $this->pageDocument->getId()));\n\t\t$doc->addField(Zend_Search_Lucene_Field::Keyword('title', $this->pageDocument->getNavigationTitle()));\n\t\t$blobData = $this->pageDocument->getContent();\n\t\t// $blockContents = $blobData->__toString();\n\t\t$blockContents = $blobData;\n\t\t$doc->addField(Zend_Search_Lucene_Field::Unstored('contents', $blockContents.' '.$this->pageDocument->getNavigationTitle()));\n\n\t\t$index->addDocument($doc);\n\t\t$index->commit();\n\n\t\t$hits = $index->find(strtolower('maquette'));\n\t\tforeach ($hits as $hit)\n\t\t{\n//\t\t\techo $hit->score.'<br/>';\n//\t\t\techo $hit->id;\n//\t\t\techo $hit->contents.'<br/>';\n\t\t\techo $hit->pageid;\n\t\t}\n\t}", "static function search(string $query,?string $parent=null):array{\n\t\t// tree to array\n\t\tfunction tree_to_array(&$array,$parent=null){\n\t\t\tforeach(Document::list($parent) as $dir_fe){\n\t\t\t\t//wdf_dump($dir);\n\t\t\t\t$array[]=$dir_fe->path;\n\t\t\t\ttree_to_array($array,$dir_fe->path);\n\t\t\t}\n\t\t}\n\t\t// definitions\n\t\t$paths_array=array();\n\t\t$matches_array=array();\n\t\t$queries_array=explode(\" \",$query);\n\t\t// check for query or return the empty array\n\t\tif(!count($queries_array)){return $matches_array;}\n\t\t// get all documents directories recursively\n\t\ttree_to_array($paths_array,$parent);\n\t\t//wdf_dump($paths_array);\n\t\t// cycle all directories\n\t\tforeach($paths_array as $path_fe){\n\t\t\t// check if content file exist\n\t\t\tif(file_exists(DIR.\"datasets/documents/\".$path_fe.\"/content.md\")){\n\t\t\t\t// open file handle for read\n\t\t\t\t$handle=fopen(DIR.\"datasets/documents/\".$path_fe.\"/content.md\",\"r\");\n\t\t\t\tif($handle){\n\t\t\t\t\twhile(!feof($handle)){\n\t\t\t\t\t\t// get line in buffer\n\t\t\t\t\t\t$buffer=fgets($handle);\n\t\t\t\t\t\t// define a buffer id\n\t\t\t\t\t\t$buffer_id=md5($buffer.rand());\n\t\t\t\t\t\t// cycle all query words\n\t\t\t\t\t\tforeach($queries_array as $query_fe){\n\t\t\t\t\t\t\t// check for query word\n\t\t\t\t\t\t\tif(stripos($buffer,$query_fe)!==false){\n\t\t\t\t\t\t\t\t// highlight query word in buffer\n\t\t\t\t\t\t\t\t$buffer=str_ireplace($query_fe,\"<mark>\".$query_fe.\"</mark>\",$buffer);\n\t\t\t\t\t\t\t\t$matches_array[$path_fe][$buffer_id]=$buffer;\n\t\t\t\t\t\t\t\t// skip current file after 3 matches\n\t\t\t\t\t\t\t\tif(count($matches_array[$path_fe])>2){continue(3);}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfclose($handle);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $matches_array;\n\t}", "public static function get_content_for_index(&$instance) {\n global $DB;\n\n // Get context.\n $coursemodule = $DB->get_field('modules', 'id', array('name' => 'glossary'));\n $params = array('course' => $instance->course, 'module' => $coursemodule, 'instance' => $instance->id);\n $cm = $DB->get_record('course_modules', $params);\n $context = context_module::instance($cm->id);\n\n $documents = array();\n $entryids = array();\n\n // Index entries.\n $entries = $DB->get_records('glossary_entries', array('glossaryid' => $instance->id));\n if ($entries) {\n foreach ($entries as $entry) {\n $concepts[$entry->id] = $entry->concept;\n if (strlen($entry->definition) > 0) {\n $entryids[] = $entry->id;\n $arr = get_object_vars($entry);\n $documents[] = new GlossarySearchDocument($arr, $instance->course, $context->id);\n }\n }\n }\n\n // Index comments.\n $glossarycomments = search_get_comments('glossary', $instance->id);\n if (!empty($glossarycomments)) {\n foreach ($glossarycomments as $acomment) {\n if (strlen($acomment->content) > 0) {\n $acomment->concept = $concepts[$acomment->itemid]; // Get info for title.\n $acomment->glossaryid = $instance->id;\n $acomment->entryid = $acomment->itemid;\n $acomment->timemodified = $acomment->timecreated;\n $vars = get_object_vars($acomment);\n $documents[] = new GlossaryCommentSearchDocument($vars, $instance->course, $context->id);\n }\n }\n }\n return $documents;\n }", "function find_phrase($root)\n\t{\n\t\tglobal $ilance;\n\t\t$this->basedir = $root;\n\t\t$this->files = 0;\n\t\t$this->folders = array();\n\t\t$sql = $ilance->db->query(\"\n\t\t\tSELECT phraseid, varname\n\t\t\tFROM \" . DB_PREFIX . \"language_phrases\n\t\t\tWHERE phrasegroup != 'admincp_configuration'\n\t\t\t\tAND phrasegroup != 'admincp_permissions'\n\t\t\t\tAND phrasegroup != 'admincp_configuration_groups'\n\t\t\t\tAND ismaster = '1'\n\t\t\tORDER BY phraseid ASC\n\t\t\");\n\t\t$this->totalphrases = $ilance->db->num_rows($sql); \n\t\t$this->query = '';\n\t\t$this->__cache_files($root);\n\t\twhile ($res = $ilance->db->fetch_array($sql, DB_ASSOC))\n\t\t{\n\t\t\t$this->__search('', $res['varname']);\n\t\t\tif ($this->matches[$res['varname']] == 0)\n\t\t\t{\n\t\t\t\t$this->orphanphrases = $this->orphanphrases + 1;\n\t\t\t\t$this->query .= \"DELETE FROM \" . DB_PREFIX . \"language_phrases WHERE varname = '\" . $res['varname'] . \"';\" . LINEBREAK;\n\t\t\t}\n\t\t\tflush();\n\t\t}\n\t\treturn $this->query;\n\t}", "public function get_roots(){\n\t\t$query = array('$or' => array(array('id_parent' => ''), array('id_parent' => array('$exists' => false))));\n\t\treturn $this->_collection->find($query)->sort(array('ten' => -1));\t\n\t}", "public function freshenAllParentAndChildIndexes();", "public function getSubterms(){\n if ($this->subterms->isEmpty()){\n\t\t\t$this->subterms->get(array('parentID'=>$this->id));\n\t\t}\n\t\treturn $this->subterms;\n }", "function getList (&$tree, $root= 0)\r\n {\r\n foreach ($this->child[$root] as $key=>$id)\r\n {\r\n $tree[] = $id;\r\n\r\n if ($this->child[$id]) $this->getList($tree, $id);\r\n }\r\n }", "public function createRootNode() {\n G::$M->query(\"CALL `usp_Tree_insert`(0, '', 1)\");\n while (G::$M->more_results()) {\n G::$M->next_result();\n }\n\n return $this;\n }", "public function SubArticles()\n {\n $prefix = $this->getChildTreeFilter();\n return DataObject::get(\n \"KnowledgeBaseArticle\", \"(\n `KnowledgeBasePage`.`TreePosition` LIKE '$prefix.%'\n OR `KnowledgeBasePage`.`TreePosition` = '$prefix'\n )\", self::$default_article_order\n );\n }", "public function setRoot($root) {\n $this->root = $root;\n return $this;\n }", "function getInstance($id,$index){\r\n\t}", "protected function _getIndexer() {\n return Mage::getSingleton('solrsearch/solr');\n }", "public function search()\n\t{\n\t\t$criteria = $this -> giveTemporaryCriteria();\n\t\t$criteria -> compare('level',0);\n\t\t\n\t\t\n\t\t//$criteria=new CDbCriteria;\n\t\t\n\t\t\n\t\t$roots = self::model() -> findAll($criteria);\n\t\t$articles = array();\n\t\t\n\t\t$criteria = $this -> giveTemporaryCriteria();\n\t\t\n\t\tforeach($roots as $root){\n\t\t\t$articles = array_merge($articles, $root -> giveTree($criteria) );\n\t\t}\n\t\t//print_r($articles);\n\t\t/*$criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('verbiage',$this->verbiage,true);\n\t\t$criteria->compare('parent_id',$this->parent_id, true);\n\t\t$criteria->compare('text',$this->text,true);\n $criteria->compare('title',$this->title,true);\n $criteria->compare('clinic_card',$this->clinic_card,true);\n $criteria->compare('keywords',$this->keywords,true);\n $criteria->compare('description',$this->description,true);*/\n\t\t\n\t\t/*return new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));*/\n\t\t/**\n\t\t * Add the articles without a parent\n\t\t */\n\t\t\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria -> compare('parent_id','0');\n\t\t$criteria -> addNotInCondition('level', array(0));\n\t\t$errorArticles = Articles::model() -> findAll($criteria);\n\t\t$articles = array_merge($articles, $errorArticles);\n\t\treturn new CArrayDataProvider($articles);\n\t}", "public function run() {\n\t\tSubindex::create([\n\t\t\t'name' => '专业知识',\n\t\t\t'seq' => '1',\n\t\t\t'order' => 0,\n\t\t\t'score' => 4,\n\t\t\t'description' => '熟悉工作所需要的专业基本知识、法律法规、政策等',\n\t\t\t'index_id' => 1,\n\t\t]);\n\t\tSubindex::create([\n\t\t\t'name' => '工作效率',\n\t\t\t'seq' => '2',\n\t\t\t'order' => 1,\n\t\t\t'score' => 10,\n\t\t\t'description' => '(1)熟悉岗位业务,履责认真,工作有条理,办事流程公开,无失职、推诿现象。\n(2)与本部门其他同事有效沟通合作,同事之间关系融洽。\n(3)与校内外其他部门有效地沟通,主动配合其他部门工作,同事之间关系融洽。\n(4)校党委常委会、校长办公会、校领导工作协调会等会议精神以及学校督查、督办事项落实到位。\n(5)学校教代会提案办理和答复情况良好,积极采纳合理化建议,无工作推诿现象。评估整改工作完成情况。\n',\n\t\t\t'index_id' => 1,\n\t\t]);\n\t\tSubindex::create([\n\t\t\t'name' => '服务质量',\n\t\t\t'seq' => '3',\n\t\t\t'order' => 2,\n\t\t\t'score' => 6,\n\t\t\t'description' => '(1)服务意识好,热心、细心、耐心服务,服务对象满意度高。\n(2)形象良好,言行端庄,办公室干净整洁。\n(3)遵守服务承诺制、首问负责制,及时回复,限时办结。\n(4)服务对象的满意情况。\n',\n\t\t\t'index_id' => 1,\n\t\t]);\n\t}", "function __construct($r){\n\t\t\t$this->root=$r;\n\t\t}", "private function getInstance()\n {\n if (NULL === $this->_search) {\n $this->_search = new XS($this->_config['file']);\n $this->_search->setDefaultCharset($this->_config['charset']);\n }\n\n return $this;\n }", "abstract public function getRoot() ;", "abstract public function getRoot() ;", "public static function instance() {\n\t\tif ( ! isset( self::$instance ) ) {\n\t\t\tself::$instance = new Jetpack_Search();\n\n\t\t\tself::$instance->setup();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "protected function getTermForAllResources() {\r\n return new Zend_Search_Lucene_Index_Term('note', 'doctype');\r\n }", "abstract public function getSearchObject();", "function socialwiki_get_subwiki($swid) {\n global $DB;\n return $DB->get_record('socialwiki_subwikis', array('id' => $swid));\n}", "public function getChildDocuments(): array {}", "public function getChildDocuments(): array {}", "public function updateLuceneIndex()\n {\n aZendSearch::updateLuceneIndex(array('object' => $this, 'culture' => aTools::getUserCulture(),\n 'indexed' => $i = array(\n 'title' => $this->getName(),\n 'summary' => htmlspecialchars_decode($this->getDescription()),\n 'vendor' => $this->getVendor()->getName(),\n ),\n ));\n/*$founds = aZendSearch::searchLuceneWithValues($this->getTable(), $q = 'enduro', aTools::getUserCulture());\nvar_dump($this->getTable()->getTableName());\nvar_dump($q);\nvar_dump(aTools::getUserCulture());\nvar_dump($founds);die(__FILE__ .'::'. __LINE__);*/\n }", "function rootInvocation()\n {\n $root = $this;\n while (true) {\n if ($root->parentInvocation() == NULL) break;\n $root = $root->parentInvocation();\n }\n return $root;\n }", "protected static function _findDirEntry($subTree, $name) {\n\t\tforeach ($subTree->children as $child) {\n\t\t\tif ($child->dir->name == $name) return $child;\n\t\t}\n\t\t\n\t\t$newDir = $subTree->dir->createChildDir($name);\n\t\t\n\t\t$item = new stdClass();\n\t\t$item->dir = $newDir;\n\t\t$item->children = array();\n\t\t\n\t\t$subTree->children[] = $item;\n\t\t\n\t\treturn $item;\n\t}", "static function Search()\n {\n return new self('search');\n }", "public function tree_new_root()\n\t{\n\t\tif ( ! $this->is_new())\n\t\t{\n\t\t\tthrow new \\Exception('You can only use new_root() on a new model object.');\n\t\t}\n\n\t\t// set the left- and right pointers for the new root\n\t\t$this->{$this->configuration['left_field']} = 1;\n\t\t$this->{$this->configuration['right_field']} = 2;\n\n\t\t// multi-root tree?\n\t\tif ( ! is_null($this->configuration['tree_field']))\n\t\t{\n\t\t\t// insert the new object with a unique tree id\n\t\t\t$new_tree = $this->max($this->configuration['tree_field']) + 1;\n\t\t\t$max_errors = 5;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\t$this->{$this->configuration['tree_field']} = $new_tree++;\n\n\t\t\t\t// clumsy hack to hopefully capture a duplicate key error\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->save();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $e)\n\t\t\t\t{\n\t\t\t\t\t// if we have more errors, it's likely not to be a duplicate key...\n\t\t\t\t\tif (--$max_errors == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->save();\n\t\t}\n\n\t\t// return the ORM Model object\n\t\treturn $this;\n\t}", "public function createSearchIndexAndRunSphinx()\n {\n $container = $this->getContainer();\n\n $container->get('sphinx')->closeConnection();\n\n $dataDir = $container->getParameter('javer_sphinx.data_dir');\n if (!is_dir($dataDir)) {\n mkdir($dataDir, 0755, true);\n }\n\n $configPath = $dataDir . '/sphinx.conf';\n\n $daemon = $container->get('sphinx.daemon')->setConfigPath($configPath);\n $daemon->stop();\n\n $indexes = $container->get('sphinx.converter.mysql_to_realtime')\n ->convertConfig($container->getParameter('javer_sphinx.config_path'), $configPath);\n\n $daemon->start();\n\n $container->get('sphinx.loader.doctrine')->loadDataIntoIndexes($indexes);\n }", "public function buildTree($results)\n {\n if (!count($results)) {\n return;\n }\n\n $root = $results[0];\n $root->buildTree($results);\n\n return $root;\n }", "public function root() {\n if ( $this->pretext()->first() ){\n return $this->pretext()->root();\n Log::info($this['title'] . 'has a pretext');\n }\n else {\n return $this;\n Log::infof($this['title'] . 'is root');\n }\n }", "public function &getService(Zend_Config $config) {\n if (!$this->index) {\n //create the index object\n try {\n $this->index = new Zend_Search_Lucene(ZfApplication::$_data_path.$config->path);\n }\n catch (Zend_Search_Lucene_Exception $e) {\n // Index doesn't exist\n $this->index = new Zend_Search_Lucene(ZfApplication::$_data_path.$config->path, true);\n }\n\n $this->index->setMaxBufferedDocs($config->bufferedDocs);\n $this->index->setMergeFactor($config->mergeFactor);\n }\n return $this;\n }", "public function testRecursiveChildSearchAlt(): void\n {\n $result = (new JSONPath($this->getData('example')))\n ->find('$.store..price');\n\n self::assertEquals([8.95, 12.99, 8.99, 22.99, 19.95], $result->getData());\n }", "public static function addDocument()\n {\n // Search for documents with the same Key value.\n $term = new \\Zend_Search_Lucene_Index_Term(self::$_doc->Key, 'Key');\n $docIds = self::$_index->termDocs($term);\n \n // Delete any documents found.\n foreach ($docIds as $id) {\n self::$_index->delete($id);\n }\n \n if ( self::$_doc instanceof \\Zend_Search_Lucene_Document )\n self::$_index->addDocument(self::$_doc);\n }", "public function getRoot()\n\t{\n // Empty node, let's try to get the first available root, ie lft=1\n if(!$this->getId())\n {\n $this->load(array('lft' => 1));\n }\n\n // Sanity checks on current node position\n if($this->lft >= $this->rgt)\n {\n\t throw new TreeInvalidLftRgtCurrent;\n }\n\n\t\t// If this is a root node return itself (there is no such thing as the root of a root node)\n\t\tif ($this->isRoot())\n\t\t{\n\t\t\treturn $this;\n\t\t}\n\n\t\tif (empty($this->treeRoot) || !is_object($this->treeRoot) || !($this->treeRoot instanceof TreeModel))\n\t\t{\n\t\t\t$this->treeRoot = null;\n\n\t\t\t// First try to get the record with the minimum ID\n\t\t\t$db = $this->getDbo();\n\n\t\t\t$fldLft = $db->qn($this->getFieldAlias('lft'));\n\t\t\t$fldRgt = $db->qn($this->getFieldAlias('rgt'));\n\n\t\t\t$subQuery = $db->getQuery(true)\n\t\t\t\t->select('MIN(' . $fldLft . ')')\n\t\t\t\t->from($db->qn($this->tableName));\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$root = $this->getClone()->reset()\n\t\t\t\t\t->whereRaw($fldLft . ' = (' . (string)$subQuery . ')')\n\t\t\t\t\t->firstOrFail();\n\n\t\t\t\tif ($this->isDescendantOf($root))\n\t\t\t\t{\n\t\t\t\t\t$this->treeRoot = $root;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (\\RuntimeException $e)\n\t\t\t{\n\t\t\t\t// If there is no root found throw an exception. Basically: your table is FUBAR.\n\t\t\t\tthrow new TreeRootNotFound($this->tableName, $this->lft);\n\t\t\t}\n\n\t\t\t// If the above method didn't work, get all roots and select the one with the appropriate lft/rgt values\n\t\t\tif (is_null($this->treeRoot))\n\t\t\t{\n\t\t\t\t// Find the node with depth = 0, lft < our lft and rgt > our right. That's our root node.\n\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t->select(array(\n $db->qn('node') . '.' . $fldLft,\n\t\t\t\t\t\t'(COUNT(' . $db->qn('parent') . '.' . $fldLft . ') - 1) AS ' . $db->qn('depth')\n\t\t\t\t\t))\n\t\t\t\t\t->from($db->qn($this->tableName) . ' AS ' . $db->qn('node'))\n\t\t\t\t\t->join('CROSS', $db->qn($this->tableName) . ' AS ' . $db->qn('parent'))\n\t\t\t\t\t->where($db->qn('node') . '.' . $fldLft . ' >= ' . $db->qn('parent') . '.' . $fldLft)\n\t\t\t\t\t->where($db->qn('node') . '.' . $fldLft . ' <= ' . $db->qn('parent') . '.' . $fldRgt)\n\t\t\t\t\t->where($db->qn('node') . '.' . $fldLft . ' < ' . $db->q($this->lft))\n\t\t\t\t\t->where($db->qn('node') . '.' . $fldRgt . ' > ' . $db->q($this->rgt))\n\t\t\t\t\t->having($db->qn('depth') . ' = ' . $db->q(0))\n\t\t\t\t\t->group($db->qn('node') . '.' . $fldLft);\n\n\t\t\t\t// Get the lft value\n\t\t\t\t$targetLeft = $db->setQuery($query)->loadResult();\n\n\t\t\t\tif (empty($targetLeft))\n\t\t\t\t{\n\t\t\t\t\t// If there is no root found throw an exception. Basically: your table is FUBAR.\n\t\t\t\t\tthrow new TreeRootNotFound($this->tableName, $this->lft);\n\t\t\t\t}\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->treeRoot = $this->getClone()->reset()\n\t\t\t\t\t\t->whereRaw($fldLft . ' = ' . $db->q($targetLeft))\n\t\t\t\t\t\t->firstOrFail();\n\t\t\t\t}\n\t\t\t\tcatch (\\RuntimeException $e)\n\t\t\t\t{\n\t\t\t\t\t// If there is no root found throw an exception. Basically: your table is FUBAR.\n\t\t\t\t\tthrow new TreeRootNotFound($this->tableName, $this->lft);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->treeRoot;\n\t}", "public function getRoot();", "public function getRoot();", "public function getRoot();", "public function getRoot();", "public function addRootLevelFilter(){\n\t\t$this->addFieldToFilter('path', array('neq' => '1'));\n\t\t$this->addLevelFilter(1);\n\t\treturn $this;\n\t}", "function LooseSearch($indexedbyid=false){\n\t\treturn $this->Search($indexedbyid,true);\n\t}", "function LooseSearch($indexedbyid=false){\n\t\treturn $this->Search($indexedbyid,true);\n\t}", "function LooseSearch($indexedbyid=false){\n\t\treturn $this->Search($indexedbyid,true);\n\t}", "function LooseSearch($indexedbyid=false){\n\t\treturn $this->Search($indexedbyid,true);\n\t}", "function create() {\n\t\tglobal $wgDBtype, $wgDBmysql4, $wgSearchType;\n\t\tif( $wgSearchType ) {\n\t\t\t$class = $wgSearchType;\n\t\t} elseif( $wgDBtype == 'mysql' ) {\n\t\t\tif( $wgDBmysql4 ) {\n\t\t\t\t$class = 'SearchMySQL4';\n\t\t\t\trequire_once( 'SearchMySQL4.php' );\n\t\t\t} else {\n\t\t\t\t$class = 'SearchMysql3';\n\t\t\t\trequire_once( 'SearchMySQL3.php' );\n\t\t\t}\n\t\t} else if ( $wgDBtype == 'PostgreSQL' ) {\n\t\t\t$class = 'SearchTsearch2';\n\t\t\trequire_once( 'SearchTsearch2.php' );\n\t\t} else {\n\t\t\t$class = 'SearchEngineDummy';\n\t\t}\n\t\t$search = new $class( wfGetDB( DB_SLAVE ) );\n\t\t$search->setLimitOffset(0,0);\n\t\treturn $search;\n\t}", "function socialwiki_get_subwikis($wid) {\n global $DB;\n return $DB->get_records('socialwiki_subwikis', array('wikiid' => $wid));\n}", "public function testRecursiveChildSearchWithSliceFilter(): void\n {\n $result = (new JSONPath($this->getData('example')))\n ->find('$..books[-1:].title');\n\n self::assertEquals(['The Lord of the Rings'], $result->getData());\n }", "public function newSearch(): Search\n {\n return clone $this->baseSearch;\n }", "public function testSearchRoot()\n {\n $filter = array(array(\n 'field' => 'path', \n 'operator' => 'equals', \n 'value' => '/'\n ));\n $result = $this->_json->searchNodes($filter, array());\n \n $this->assertEquals(3, $result['totalcount']);\n $this->assertEquals('/' . Tinebase_Model_Container::TYPE_PERSONAL . '/' . Tinebase_Core::getUser()->accountLoginName, $result['results'][0]['path']);\n }", "public function setRoot($root)\n {\n $this->root = $root;\n\n return $this;\n }", "public function setRoot($root)\n {\n $this->root = $root;\n\n return $this;\n }", "public function getSearchParser(): Search\n {\n return new Search;\n }", "public function getRoot(): self;", "public function getRoot(): self;", "public function searchSubContent()\n\t{\n\t\t# Set tables to search to a variable.\n\t\t$tables=$this->getTables();\n\t\t# Set fields to search to a variable.\n\t\t$fields=$this->getFields();\n\t\t# Set branch to search to a variable.\n\t\t$branch=$this->getSearchBranch();\n\t\t# Set search terms to a variable.\n\t\t$search_terms=$this->getSearchTerms();\n\t\t# Perform search.\n\t\t$this->performSearch($search_terms, $tables, $fields, $branch);\n\t}", "public function __construct()\n {\n global $_INDEX;\n\n\t\tif (!$_INDEX = sessionxml_load_file(\"index.idx\"))\n\t $_INDEX = new simpleXmlElement(\"<index><root/></index>\");\n\n//\t\techoall($_INDEX);\n }", "public function launchSearch($search) {\r\n\t\t//Return empty array if empty query\r\n\t\tif($search == '')\r\n\t\t\treturn;\r\n\r\n\t\t//Opens the index\r\n\t\t$this->initialize();\r\n\r\n\t\t//To recognize numerics\r\n\t\t//Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive());\r\n\r\n\t\t//Remove the limitations of fuzzy and wildcard searches\r\n\t\tZend_Search_Lucene_Search_Query_Wildcard::setMinPrefixLength(0);\r\n\t\tZend_Search_Lucene_Search_Query_Fuzzy::setDefaultPrefixLength(0);\r\n\r\n\t\t\t\r\n\t\t$finalSearch=$this->fuzzySearch($search);\r\n\t\t$query = Zend_Search_Lucene_Search_QueryParser::parse($finalSearch);\r\n\t\t\t\r\n\t\t//We do the search and send it\r\n\t\ttry {\r\n\t\t\t//$hits can't be returned directly as is, because it's an array of Zend_Search_Lucene_Search_QueryHit\r\n\t\t\t//which has far more properties than those the client needs to know\r\n\t\t\t$hits = $this->index->find($query);\r\n\t\t\t//Ensure the fields are stored with the exact names you want them to be returned otherways this won't work\r\n\t\t\t$fields = $this->index->getFieldNames();\r\n\t\t\t$searchResults = array();\r\n\t\t\tforeach($hits as $hit){\r\n\t\t\t\t$searchResult = new stdClass();\r\n\t\t\t\tforeach($fields as $field){\r\n\t\t\t\t\tif($field == \"exerciseId\"){\r\n\t\t\t\t\t\t$searchResult->id = $hit->$field;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$searchResult->$field = $hit->$field;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($field == \"descriptors\")\r\n\t\t\t\t\t\t$searchResult->descriptors = $this->parseHitDescriptors($hit->$field);\r\n\t\t\t\t}\r\n\t\t\t\tarray_push($searchResults,$searchResult);\r\n\t\t\t}\r\n\t\t\treturn $this->conn->multipleRecast('ExerciseVO',$searchResults);\r\n\t\t}\r\n\t\tcatch (Zend_Search_Lucene_Exception $ex) {\r\n\t\t\tthrow new Exception($ex->getMessage());\r\n\t\t}\r\n\t}", "abstract protected function fillSearchTree(): void;", "function GetInstance()\r\n\t{\r\n\t\tstatic $obj;\r\n\t\t\r\n\t\tif(!isset($obj))\r\n\t\t{\r\n\t\t\t$obj = new document();\r\n\t\t}\r\n\t\t\r\n\t\treturn $obj;\r\n\t}", "public function root();", "public function root();", "private function xpathRegisterRoot(DOMNode $root)\n {\n $this->xpathRoot = $root;\n\n return $this;\n }", "public function setRoot($root);", "protected function getTermForAllResources() {\n return new Zend_Search_Lucene_Index_Term('unitresource', 'doctype');\n }", "static public function Get_Instance($sub_dir, $size_limit, $file_limit, $site_name, $rotate=\"\")\n\t{\n\t\tif ( !isset(self::$instance[$sub_dir]) )\n\t\t{\n\t\t\tnew OLP_Applog_Singleton($sub_dir, $size_limit, $file_limit, $site_name, $rotate);\n\t\t}\n\t\t\n\t\treturn self::$instance[$sub_dir];\n\t}", "public function SubCategories()\n {\n $prefix = $this->getChildTreeFilter();\n return DataObject::get(\n \"KnowledgeBaseCategory\", \"(\n `KnowledgeBasePage`.`TreePosition` LIKE '$prefix.%'\n OR `KnowledgeBasePage`.`TreePosition` = '$prefix'\n )\", self::$default_category_order\n );\n }", "private function searchLeaf($string) {\n if ($this->getVendor() == self::MYSQL) {\n\n $sql = \"SET NAMES utf8\";\n $this->q->fast($sql);\n }\n $sql = null;\n $data = array();\n\n if ($this->getVendor() == self::MYSQL) {\n\n $sql = \"\n SELECT `leaf`.`leafId`,\n `leaftranslate`.`leafNative`\n FROM `leaf`\n JOIN `leaftranslate`\n USING (`companyId`,`leafId`)\n JOIN `leafaccess`\n USING (`companyId`,`leafId`)\n\t\t\t\tJOIN\t`applicationaccess`\n\t\t\t\tUSING\t(`companyId`,`applicationId`)\n WHERE `leaf`.`companyId` \t\t\t\t= '\" . $this->getCompanyId() . \"'\n AND `leafaccess`.`staffId` \t\t\t\t= '\" . $this->getStaffId() . \"'\n\t\t\t\tAND `leafaccess`.`leafAccessReadValue`\t\t\t\t= '1'\n AND `leaf`.`isActive` \t\t\t\t= 1\n AND `leaftranslate`.`languageId` \t\t\t\t= '\" . $this->getLanguageId() . \"'\n\t\t\t\tAND `applicationaccess`.`roleId` \t\t\t\t= '\" . $this->getRoleId() . \"'\n\t\t\t\tAND `applicationaccess`.`applicationAccessValue` = '1'\n AND `leaftranslate`.`leafNative`\n LIKE '%\" . $this->strict($string, 'w') . \"%'\n \";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT [leaf].[leafId],\n [leafTranslate].[leafNative]\n FROM [leaf]\n JOIN [leafTranslate]\n ON [leaf].[companyId] = [leafTranslate].[companyId]\n AND [leaf].[leafId] = [leafTranslate].[companyId]\n JOIN [leafAccess]\n ON [leaf].[companyId] = [leafAccess].[companyId]\n AND [leaf].[leafId] = [leafAccess].[companyId]\n WHERE [leaf].[companyId] = '\" . $this->getCompanyId() . \"'\n AND [leafAccess].[staffId] = '\" . $this->getStaffId() . \"'\n AND [leaf].[isActive] = 1\n AND [leafTranslate].[languageId] = '\" . $this->getLanguageId() . \"'\n AND [leafTranslate].[leafNative]\n LIKE '%\" . $this->strict($string, 'w') . \"%'\n \";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT LEAFID,\n LEAFNATIVE\n FROM LEAF\n JOIN LEAFTRANSLATE\n ON LEAF.COMPANYID = LEAFTRANSLATE.COMPANYID\n AND LEAF.LEAFID = LEAFTRANSLATE.COMPANYID\n JOIN LEAFACCESS\n ON LEAF.COMPANYID = LEAFACCESS.COMPANYID\n AND LEAF.LEAFID = LEAFACCESS.COMPANYID\n WHERE LEAF.COMPANYID = '\" . $this->getCompanyId() . \"'\n AND LEAFACCESS.STAFFID = '\" . $this->getStaffId() . \"'\n AND LEAF.ISACTIVE = 1\n AND LEAFTRANSLATE.LANGUAGEID = '\" . $this->getLanguageId() . \"'\n AND LEAFTRANSLATE.LEAFNATIVE\n LIKE '%\" . $this->strict($string, 'w') . \"%'\";\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n header('Content-Type:application/json; charset=utf-8');\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n if ($this->q->numberRows($result, $sql) > 0) {\n while (($row = $this->q->fetchArray($result)) == true) {\n $data[] = $row;\n }\n }\n }\n return $data;\n }", "public static function getInstance($root = NULL, $routesPath = NULL){\n if(is_null(self::$_instance)){\n self::$_instance = new self();\n self::$_instance->routes = new Collection();\n if(!is_null($root)){\n self::$_instance->setRoot($root);\n }\n if(!is_null($routesPath)){\n self::$_instance->setRoutesPath($routesPath);\n self::$_instance->init();\n }\n }\n return self::$_instance;\n }", "public function setRoot ($root)\n {\n $this->_root = (string) $root;\n return $this;\n }", "public function getSubResults() {}", "function getAllSubDocuments($childgalleryIds = array(), $seedArray = array(), $sortby = \"createdon\", $sortdir = \"desc\", $descendentDepth = 1, $limit = 0, $showPublishedOnly = true, $seeThruUnpub = false, $tvNames = array()) {\r\n\t\tglobal $modx;\r\n\r\n\t\t// ---------------------------------------------------\r\n\t\t// Seed list of viable ids\r\n\t\t// ---------------------------------------------------\r\n\r\n\t\t$kids = array();\r\n\t\tforeach ($seedArray AS $seed) {\r\n\t\t\t$kids = $this->getChildIds($seed, $descendentDepth, $kids);\r\n\t\t}\r\n\t\t$kids = array_values($kids);\r\n\t\t\r\n\t\t$kids = array_merge($kids, $seedArray);\r\n\t\t\r\n\t\t$index = array_search($modx->documentIdentifier, $kids);\r\n\t\t\r\n\t\tif ($index) {\r\n\t\t\tunset($kids[$index]);\r\n\t\t}\r\n\r\n\t\t//remove id's that don't have gallery\r\n\t\t$kids = array_intersect($kids, $childgalleryIds);\r\n\t\t\r\n\t\t$resources = $modx->getDocuments($kids, $showPublishedOnly, 0, \"*\", '', $sortby, $sortdir);\r\n\t\t\r\n\t\tif ($limit != 0) {\r\n\t\t\t$resources = array_slice($resources, 0, $limit);\r\n\t\t}\r\n\t\t\r\n\t\tif(count($tvNames)>0){\r\n\t\t\t$resultIds = array();\r\n\t\t\tforeach ($resources as $res) {\r\n\t\t\t\t$resultIds[] = $res['id'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$allTvars = $this->getTVList();\r\n\t\t\t$tvValues = array();\r\n\t\t\tforeach ($tvNames as $tvName) {\r\n\t\t\t\tif (in_array($tvName, $allTvars)) {\r\n\t\t\t\t\t$tvValues = array_merge_recursive($this->appendTV($tvName,$resultIds),$tvValues);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//loop through the document array and add the tvar values to each document\r\n\t\t\tfor ($i=0;$i<count($resources);$i++) {\r\n\t\t\t\tif (array_key_exists(\"#{$resources[$i]['id']}\",$tvValues)) {\r\n\t\t\t\t\tforeach ($tvValues[\"#{$resources[$i]['id']}\"] as $tvName => $tvValue) {\r\n\t\t\t\t\t\t$resources[$i]['tv.'.$tvName] = $tvValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $resources;\r\n\r\n\t}", "function mapTree($root_id)\n\t{\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$db->setFetchMode(Zend_Db::FETCH_ASSOC);\n\t\t\t$select = $db->select()\n\t\t\t->from(array('s' => 'strony'), array('id', 'id_parent', 'nazwa', 'typ', 'tag', 'link'))\n\t\t\t->order('s.sort ASC');\n\t\t\t$pro = $db->fetchAll($select);\n\t\t \n\t\t\tforeach ( $pro as $item )\n\t\t\t$children[$item['id_parent']][] = $item;\n\t\t\t$loop = !empty( $children[$root_id] );\n\t\t\t$parent = $root_id;\n\t\t\t$parent_stack = array();\n\n\t\t\twhile ( $loop && ( ( $option = each( $children[$parent] ) ) || ( $parent > $root_id ) ) )\n\t\t\t{\n\t\t\t\t\tif ( $option === false )\n\t\t\t\t\t{\n\t\t\t\t\t\t\t$parent = array_pop( $parent_stack );\n\t\t\t\t\t}\n\t\t\t\t\telseif ( !empty( $children[$option['value']['id']] ) )\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$id_element = $option['value']['id'];\n\t\t\t\t\t\t\t$id_up = $option['value']['id'];\n\t\t\t\t\t\t\t$crumbs = Array();\n\t\t\t\t\t\t\t$c = count($pro);\n\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t$found = false;\n\t\t\t\t\t\t\t\tfor($i = 0; $i<$c; ++$i){\n\t\t\t\t\t\t\t\t\tif($pro[$i]['id'] == $id_element){\n\n\t\t\t\t\t\t\t\t\t\tif($pro[$i]['typ'] == 0){\n\t\t\t\t\t\t\t\t\t\t\t$url = $pro[$i]['tag'];\n\t\t\t\t\t\t\t\t\t\t\tarray_unshift($crumbs, empty($crumbs)?($pro[$i]['tag']):($url));\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$url = $pro[$i]['link'];\n\t\t\t\t\t\t\t\t\t\t\tarray_unshift($crumbs, empty($crumbs)?($pro[$i]['link']):($url));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$id_element = $pro[$i]['id_parent'];\n\t\t\t\t\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} while ($id_element != 0 AND $found); \n\t\t\t\t\t\t\t$uri = implode('/', $crumbs);\n\t\t\n\t\t\t\t\t\t\t$dataUri = array('uri' => $uri);\n\t\t\t\t\t\t\t$db->update('strony', $dataUri, 'id = '.$id_up);\n\n\t\t\t\t\t\t\tarray_push( $parent_stack, $option['value']['id_parent'] );\n\t\t\t\t\t\t\t$parent = $option['value']['id'];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t\t$id_element = $option['value']['id'];\n\t\t\t\t\t\t\t$id_up = $option['value']['id'];\n\t\t\t\t\t\t\t$crumbs = Array();\n\t\t\t\t\t\t\t$c = count($pro);\n\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t$found = false;\n\t\t\t\t\t\t\t\tfor($i = 0; $i<$c; ++$i){\n\t\t\t\t\t\t\t\t\tif($pro[$i]['id'] == $id_element){\n\n\t\t\t\t\t\t\t\t\t\tif($pro[$i]['typ'] == 0){\n\t\t\t\t\t\t\t\t\t\t\t$url = $pro[$i]['tag'];\n\t\t\t\t\t\t\t\t\t\t\tarray_unshift($crumbs, empty($crumbs)?($pro[$i]['tag']):($url));\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$url = $pro[$i]['link'];\n\t\t\t\t\t\t\t\t\t\t\tarray_unshift($crumbs, empty($crumbs)?($pro[$i]['link']):($url));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$id_element = $pro[$i]['id_parent'];\n\t\t\t\t\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} while ($id_element != 0 AND $found); \n\t\t\t\t\t\t\t$uri = implode('/', $crumbs);\n\t\t\n\t\t\t\t\t\t\t$dataUri = array('uri' => $uri);\n\t\t\t\t\t\t\t$db->update('strony', $dataUri, 'id = '.$id_up);\n\n\t\t\t\t\t}\n\t\t\t}\n\t}", "private function createChildInstance()\n {\n $instance = new self(...func_get_args());\n\n if (isset($this->document)) {\n $instance->setDomDocument($this->document);\n }\n\n if (isset($this->root_instance)) {\n $instance->root_instance = $this->root_instance;\n } else {\n $instance->root_instance = $this;\n }\n\n if (is_bool($this->xml_mode)) {\n $instance->xml_mode = $this->xml_mode;\n }\n\n if (isset($this->document) && $this->dom_xpath instanceof \\DOMXPath) {\n $instance->dom_xpath = $this->dom_xpath;\n }\n\n return $instance;\n }", "public static function getInstance() {\r\n\t\tif(!self::$instance) {\r\n\t\t\tself::$instance = self;\r\n\t\t\tself::getConfig();\r\n\t\t\tself::prepareZendSearch();\r\n\t\t}\r\n\t\treturn self::$instance;\r\n\t}", "function phorum_mod_subforums_index($index)\n{\n global $PHORUM;\n\n $map = array();\n $replaced = array();\n\n foreach ($index as $id => $item)\n {\n // Skip forums.\n if (empty($item['folder_flag'])) continue;\n\n // Skip the vroot folder.\n if ($item['forum_id'] == $item['vroot']) continue;\n\n // Skip folder if the index view is showing this folder\n // (in which case the folder is shown as a category header.)\n if ($item['forum_id'] == $PHORUM['forum_id']) continue;\n\n // Skip folders that have the (v)root at their parent. These\n // are the category folders.\n if ($item['parent_id'] == $item['vroot']) continue;\n\n // When we get here, then we are at a second level folder, for which\n // we will modify the index to show the first forum inside as the\n // main forum and the other forums inside as the subforums for that\n // forum.\n\n // Retrieve the forums inside the folder.\n $forums = phorum_api_forums_get(NULL, $item['forum_id']);\n\n // Create a replacement item for the folder item.\n unset($newitem); // prevent reusing a copy\n foreach ($forums as $forum)\n {\n // Just in case an admin put an extra level of folders in the\n // subforums grouping folder. This is not supported. We silently\n // ignore this folder.\n if ($forum['folder_flag']) continue;\n\n // Skip the forum if the user is not allowed to read it and\n // the hide forums feature is enabled.\n if ($PHORUM['hide_forums'] && !phorum_api_user_check_access(\n PHORUM_USER_ALLOW_READ, $forum['forum_id'])) continue;\n\n // The first forum in the folder is the main forum.\n if (!isset($newitem))\n {\n $newitem = subforums_format_forum($forum);\n $newitem['subforums'] = array();\n $map[$forum['forum_id']] =& $newitem;\n }\n // The rest of the forums are subforums.\n else\n {\n unset($subforum); // prevent reusing a copy\n $subforum = subforums_format_forum($forum);\n $newitem['subforums'][] =& $subforum;\n $map[$forum['forum_id']] =& $subforum;\n }\n }\n\n // If one or more visible forums were found in the folder, then\n // we replace the folder with the main forum.\n if (isset($newitem)) {\n $index[$id] =& $newitem;\n $replaced[] = $id;\n }\n // No visible forums were found in the folder. We can delete the\n // complete folder from the index.\n else {\n unset($index[$id]);\n }\n }\n\n // Do checks for new messages.\n // In a future version of this module, we will be able to make\n // use of the newflags API calls, but currently, these are still\n // under development.\n if ($PHORUM['DATA']['LOGGEDIN'] && !empty($map))\n {\n if ($PHORUM['show_new_on_index']==2)\n {\n $new_checks = phorum_db_newflag_check(array_keys($map));\n\n foreach ($new_checks as $forum_id => $checks) {\n if (!empty($checks)) {\n $map[$forum_id]['new_message_check'] = TRUE;\n } else {\n $map[$forum_id]['new_message_check'] = FALSE;\n }\n }\n }\n elseif ($PHORUM['show_new_on_index']==1)\n {\n $new_counts = phorum_db_newflag_count(array_keys($map));\n\n foreach ($new_counts as $forum_id => $counts)\n {\n $map[$forum_id]['new_messages'] = number_format(\n $counts['messages'], 0,\n $PHORUM['dec_sep'], $PHORUM['thous_sep']\n );\n $map[$forum_id]['new_threads'] = number_format(\n $counts['threads'], 0,\n $PHORUM['dec_sep'], $PHORUM['thous_sep']\n );\n }\n }\n }\n\n // Format the subforums. These are added to the description\n // of the main forum. The formatted code is based on the module's\n // \"index\" template.\n foreach ($replaced as $id)\n {\n if (!empty($index[$id]['subforums']))\n {\n $PHORUM['DATA']['SUBFORUMCOUNT'] = count($index[$id]['subforums']);\n $PHORUM['DATA']['SUBFORUMS'] = $index[$id]['subforums'];\n ob_start();\n include phorum_get_template('subforums::index');\n $append = ob_get_contents();\n ob_end_clean();\n\n $index[$id]['description'] .= $append;\n }\n }\n\n return $index;\n}", "public static function get($root, $data)\n {\n $self = new self;\n return $self->create($root, $data);\n }", "public static function getInstance()\n\t{\n\t\tif ( !isset ( self::$instance ) )\n\t\t{\n\t\t\tif ( Domains::getInstance()->getDevMode() !== true )\n\t\t\t{\n\t\t\t\tself::$instance = new Search;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tBootstrap::getClass( 'SearchDebug', false );\n\t\t\t\tself::$instance = new SearchDebug;\n\t\t\t}\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "function get_nested($table){\n $query = self::factory(\"{$table}\")\n ->join(\"{$this->_table_name}\",'left')->on(\"{$table}.id\",'=',\"{$this->_table_name}.id\")\n\t\t\t->where(\"{$this->_table_name}.lft\", '<=', $this->left())\n\t\t\t->where(\"{$this->_table_name}.rgt\", '>=', $this->right())\n\t\t\t->order_by('level', 'DESC')\n\t\t\t->find();\t\t\t\n return $query; \n }", "public static function esFind()\n {\n $instance = new static;\n $params = [\n 'index' => $instance->getEsIndexName(),\n 'type' => $instance->getEsTypeName(),\n 'id' => $instance->getEsId(),\n ];\n\n return Search::get($params);\n }", "static public function tree()\n {\n $dataTree = new static();\n\n return $dataTree;\n }" ]
[ "0.55061954", "0.53702766", "0.5304742", "0.52196866", "0.52154654", "0.5176434", "0.5167998", "0.5166824", "0.51657265", "0.51421714", "0.5084948", "0.50761884", "0.50166017", "0.49945903", "0.4993737", "0.49213934", "0.48415563", "0.48242822", "0.4822541", "0.48121575", "0.47893727", "0.47661048", "0.47614542", "0.47585437", "0.47248963", "0.47242478", "0.4720998", "0.47046447", "0.47031876", "0.47002852", "0.46950573", "0.4675257", "0.46585572", "0.46397835", "0.462676", "0.46176314", "0.46176314", "0.46152475", "0.4609688", "0.46052894", "0.4584975", "0.45792148", "0.45792148", "0.45771077", "0.4575705", "0.45728636", "0.45680243", "0.45647356", "0.45646128", "0.45564154", "0.4556196", "0.4553936", "0.45446563", "0.4542829", "0.4535268", "0.45346946", "0.45346946", "0.45346946", "0.45346946", "0.4521021", "0.4517655", "0.4517655", "0.4517655", "0.4517655", "0.45111763", "0.4509956", "0.4509315", "0.45047918", "0.4496657", "0.44893697", "0.44893697", "0.4479932", "0.4477396", "0.4477396", "0.44704667", "0.4462543", "0.44618452", "0.44577548", "0.44537294", "0.44455093", "0.44455093", "0.443811", "0.44361869", "0.4434014", "0.4429066", "0.44276813", "0.44242033", "0.4415594", "0.44093907", "0.4399423", "0.43921286", "0.43902093", "0.4380077", "0.43798268", "0.43742973", "0.4367332", "0.43663877", "0.43562442", "0.4350719", "0.43422213" ]
0.7263097
0
Crea un nuevo modelo PrioridadTarea.
Создай новый модель PrioridadTarea.
public function actionCrear() { $model = new PrioridadTarea(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['detalle', 'id' => $model->idPrioridadTarea]); } else { return $this->render('crear', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function trtarea_create()\n {\n\n //TODO you code here\n\t\t$this->load->model('district_model', null, true);\n\t\t$this->load->model('division_model', null, true); \t\n\t\t$this->load->model('area_model', null, true);\n\t\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->saveTRTArea())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('library_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'library_area');\n\n\t\t\t\tTemplate::set_message(lang('trtarea_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/trtarea/library/show_list');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('record_create_failure').$this->trtarea_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t$district_list \t\t\t\t= $this->district_model->find_all_by('is_deleted', 0);\n\t\t$division_list = $this->division_model->find_all_by('is_deleted', 0);\t\n\t\t$area_list \t\t\t\t\t= $this->area_model->find_all_by('is_deleted', 0);\n\t\t\n\t\t$sendData = array(\n\t\t\t'division_list' => $division_list,\n\t\t\t'district_list' => $district_list,\n\t\t\t'area_list' \t=> $area_list\t\n\t\t\t\n\t\t);\t\n\t\t\n\t\tTemplate::set('sendData', $sendData);\t\n\t\tTemplate::set('toolbar_title', lang(\"library_zone_trt_new\"));\n\t\tTemplate::set_view('zone/trtarea_create');\n\t\tTemplate::render();\n }", "function crearTarea($tarea){\n $this->tareas[] = $tarea;\n }", "public function create(Request $request)\n {\n //crear nueva tarea\n\n $tarea = new Tarea();\n $tarea->trabajo_id = $request->id;\n $tarea->descripcion = $request->descripcion;\n $tarea->estado = $request->estado;\n $tarea->save();\n return $tarea;\n }", "public function insertarTarea() {\n// \n// $fecha_inicio=isset($_POST[\"\"]) ? $_POST[\"nombre\"] : \"\";\n $tabla=\"tareas\";\n $campos=array(\"0\"=>\"Miriam\",\"1\"=>\"Ruiz\",\"2\"=> 1234,\"3\"=> \"miriam@gmail.com\",\"4\"=> 915555555); \n// echo(\"{nombre: \\\"miguel\\\"}\");\n// echo(\"{nombre: \\\"miguel\\\"}\");\n $model = new tareas_model;\n $model->insertarTarea($tabla, $campos); \n }", "public function actionCreate()\n {\n\n $id_usuario_actual=\\Yii::$app->user->id;\n $buscaConcursante = Concursante::find()->where(['id' => $id_usuario_actual])->one();\n\n $request = Yii::$app->request;\n $id_postulacion = $request->get('id_postulacion');\n\n $buscaPostulacion = Postulacion::find()->where(['and',['id_postulacion' => $id_postulacion],['id_concursante' => $buscaConcursante->id_concursante]])->one();\n\n if($buscaPostulacion != null){\n\n $model = new Tablacartagantt();\n\n if ($model->load(Yii::$app->request->post())) {\n if($model->save()){\n return $this->redirect(['/site/section6', 'id_postulacion' => $id_postulacion]);\n }else{\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n\n }else{\n throw new NotFoundHttpException('La página solicitada no existe.');\n } \n\n }", "public function create()\n\t{\n\t\treturn view('priorities.create');\n\t}", "public function create() {\n $contador = new Contadores($this->IDContador);\n $this->setNumeroPsto($contador->asignaContador());\n unset($contador);\n\n return parent::create();\n }", "public function create()\n {\n //\n $precarga = new TipoArea;\n return view('precargas.form',['titulo'=>$this->titulo, 'edit'=>false,'guardar'=>$this->guardar, 'precarga'=>$precarga]);\n }", "public function getPrioridade()\n {\n return $this->hasOne(Prioridade::className(), ['id' => 'id_prioridade']);\n }", "public function creating( Orcamento $orcamento ) {\n $orcamento->idprofissional = Auth::user()->profissional->idprofissional;\n\t}", "public function criarAction()\n {\n if($this->usuario['tp_id']==5){\n $this->_redirect('index');\n }\n $this->ModeloTipoRenda->insert($this->_getAllParams());\n\n $this->_redirect('tipo-renda/index');\n }", "public function create()\n {\n return view('admin.ticket.priorities.create');\n }", "public function create()\n {\n// $categoria_local = new CategoriaLocal;\n// $categoria_local->save($request->all());\n \n }", "public function create()\n {\n //\n/* $etiqueta = Etiqueta::orderBy('created_at', 'DESC')->limit(1)->first();\n\n $orden = $etiqueta->caja->orden_producto->orden;\n $lote = $orden->lote;\n\n $productos = $orden->productos->lists('fullName','producto_id');\n\n $producto = $etiqueta->caja->orden_producto->producto;\n\n $orden_id = $orden->orden_id;\n $lote_id = $lote->lote_id;\n $producto_id = $producto->producto_id;\n $producto_fullName = $producto->fullName;\n $peso_estandar = $producto->producto_peso;\n $caja_id = $etiqueta->caja->caja_id + 1;\n\n return view('almacenamiento.etiqueta.create', compact('lote_id', 'orden_id', 'producto_id',\n 'producto_fullName', 'caja_id', 'productos', 'peso_estandar'));*/\n \n $proxima_caja = Caja::withTrashed()->max('caja_id') + 1;\n\n return view('almacenamiento.etiqueta.create',compact('proxima_caja'));\n\n }", "public function agregar(){\n\n\t\tif ($_POST) {\n\t\t\t$tareas = $this->loadmodel(\"tarea\");\n\t\t\t$this->_view->tareas = $tareas->guardar($_POST);\n\t\t\t$this->redirect(array(\"controller\"=>\"tareas\"));\n\t\t}\n\n\t\t$categorias = $this->loadmodel(\"categoria\");\n\t\t$this->_view->categorias = $categorias->listarTodo();\n\n\t\t$this->_view->titulo = \"Agregar tarea\";\n\t\t$this->_view->renderizar(\"agregar\");\n\t}", "public function nuevaAction()\n {\n $area = new Area();\n $form = $this->createForm(new AreaType(), $area);\n\n return array(\n 'area' => $area,\n 'form' => $form->createView(),\n );\n }", "private static function crear()\n {\n\n $consecutivo = areacontroller::conse();\n\n try {\n $num = $_POST['anho'];\n $anho = \"\";\n for ($i = 0; $i < count($num); $i++) {\n $anho .= $num[$i];\n $anho .= \"-\";\n echo $anho;\n }\n\n $arrayarea = array();\n $arrayarea['Sede'] = $_POST['Sede'];\n $arrayarea['Area'] = $_POST['Area'];\n $arrayarea['Anho'] = $anho;\n $arrayarea['Asunto'] = $_POST['Asunto'];\n $arrayarea['Consecutivo'] = $consecutivo;\n $arrayarea['Estado'] = 'Activo';\n\n $area = new areaclass($arrayarea);\n $id = $area->insertar();\n\n // si guarda redirecciona a la vista dando un mensaje de error\n header('Location:../vista/areatrasferencia/addfile.php?respuesta=correcto&id=' . $id);\n } catch (Exception $e) {\n header('Location:../vista/areatrasferencia/creararea.php?respuesta=error');\n }\n }", "function agregar_trimestre()\n {\n $permiso = $this->permiso_administrador();\n\n $this->load->model('tpoadminv1/catalogos/Catalogos_model');\n\n $data['title'] = \"Agregar trimestre\";\n $data['heading'] = $this->session->userdata('usuario_nombre');\n $data['mensaje'] = \"\";\n $data['job'] = $this->session->userdata('usuario_job');\n $data['active'] = 'catalogos'; // solo active \n $data['subactive'] = 'otros_co'; // class=\"active\"\n $data['optionactive'] = \"busqueda_trimestres\"; // class=\"active\"\n $data['body_class'] = 'skin-blue';\n $data['main_content'] = 'tpoadminv1/catalogos/agregar_trimestre';\n\n \n $data['trimestre'] = array(\n 'trimestre' => '',\n 'active' => 'null'\n );\n \n\n $data['scripts'] = \"\";\n\n $this->load->view('tpoadminv1/includes/template', $data);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Trabajadores;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Trabajadores']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Trabajadores'];\n\t\t\tif($model->save()) {\n Yii::app()->user->setFlash('success', \"..La carga inicial se ha anulado!\");\n\t\t\t\t$this->redirect(array('update','id'=>$model->codigotra));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCrear()\n {\n $model = new CategoriasPremios();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->guardarImagen('');\n if ($model->save()) {\n return $this->redirect(['detalle', 'id' => $model->idCategoria]);\n } else {\n return $this->render('crear', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('crear', [\n 'model' => $model,\n ]);\n }\n }", "public function create(Tarea $tarea)\n {\n return view('comentarios.create', compact('tarea'));\n }", "public function agregar()\r\n {\r\n if ($_POST) {\r\n $tareas = $this->loadModel(\"tarea\");\r\n if ($tareas->guardar($_POST)) \r\n {\r\n $this->_messages->success(\r\n 'Tarea guardada correctamente', \r\n $this->redirect(array(\"controller\"=>\"tareas\"))\r\n );\r\n }\r\n /*echo \"<pre>\";\r\n print_r($_POST);*/ \r\n }\r\n $categorias=$this->loadModel(\"categoria\");\r\n $this->_view->categorias=$categorias->listarTodo();\r\n\r\n $this->_view->titulo=\"Agregar tarea\";\r\n $this->_view->renderizar(\"agregar\");\r\n }", "static function novoTentativaContato($id, $tipoContato){\n $cliente = ClientePotencia::find($id);\n //Cria uma nova tentativa de contato\n $tentativa = new TentativaContatos();\n //Define o tipo de contato que foi feito\n $tentativa->tipo_contato = $tipoContato;\n //Define a data do contato como a data atual\n $tentativa->data_contato = date('Y/m/d H:i:s');\n //Define o ID do cliente que foi feito a tentativa do contato\n $tentativa->cliente_potencia_id = $id;\n //Associa o cliente recebido anteriormente a tentativa de contato criada\n $tentativa->clientePotencia()->associate($cliente);\n //Salva os dados no banco de dados\n $tentativa->save();\n\n }", "private function nuevo_asiento_modelo130()\n {\n $continuar = true;\n\n $eje0 = $this->get_ejercicio($_POST['fecha']);\n if (!$eje0) {\n $continuar = false;\n }\n\n $div0 = $this->divisa->get($_POST['divisa']);\n if (!$div0) {\n $this->new_error_msg('Divisa no encontrada.');\n $continuar = false;\n }\n\n if ($this->duplicated_petition($_POST['petition_id'])) {\n $this->new_error_msg('Petición duplicada. Has hecho doble clic sobre el botón Guardar\n y se han enviado dos peticiones. Mira en <a href=\"' . $this->ppage->url() . '\">asientos</a>\n para ver si el asiento se ha guardado correctamente.');\n $continuar = false;\n }\n\n if ($continuar) {\n $meses = [\n '', 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio',\n 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'\n ];\n\n $codcaja = '5700000000';\n if (isset($_POST['banco130'])) {\n if ($_POST['banco130'] != '') {\n $codcaja = $_POST['banco130'];\n }\n }\n\n /// asiento de cuota\n $asiento = new asiento();\n $asiento->codejercicio = $eje0->codejercicio;\n $asiento->concepto = 'Pago modelo 130 ' . $meses[(int) date('m', strtotime($_POST['fecha']))];\n $asiento->fecha = $_POST['fecha'];\n $asiento->importe = (float) $_POST['modelo130'];\n\n if ($asiento->save()) {\n $subc = $this->subcuenta->get_by_codigo('4730000000', $eje0->codejercicio);\n if ($subc) {\n $partida = new partida();\n $partida->idasiento = $asiento->idasiento;\n $partida->coddivisa = $div0->coddivisa;\n $partida->tasaconv = $div0->tasaconv;\n $partida->concepto = $asiento->concepto;\n $partida->idsubcuenta = $subc->idsubcuenta;\n $partida->codsubcuenta = $subc->codsubcuenta;\n $partida->debe = $asiento->importe;\n $partida->save();\n } else {\n $this->new_error_msg('Subcuenta 4730000000 no encontrada.');\n $continuar = false;\n }\n\n $subc = $this->subcuenta->get_by_codigo($codcaja, $eje0->codejercicio);\n if ($subc) {\n $partida = new partida();\n $partida->idasiento = $asiento->idasiento;\n $partida->coddivisa = $div0->coddivisa;\n $partida->tasaconv = $div0->tasaconv;\n $partida->concepto = $asiento->concepto;\n $partida->idsubcuenta = $subc->idsubcuenta;\n $partida->codsubcuenta = $subc->codsubcuenta;\n $partida->haber = $asiento->importe;\n $partida->save();\n } else {\n $this->new_error_msg('Subcuenta ' . $codcaja . ' no encontrada.');\n $continuar = false;\n }\n\n if ($continuar) {\n $this->new_message(\"<a href='\" . $asiento->url() . \"'>Asiento de pago</a> guardado correctamente!\");\n } else {\n if ($asiento->delete()) {\n $this->new_error_msg(\"¡Error en alguna de las partidas! Se ha borrado el asiento.\");\n } else {\n $this->new_error_msg(\"¡Error en alguna de las partidas! Además ha sido imposible borrar el asiento.\");\n }\n }\n } else {\n $this->new_error_msg(\"¡Imposible guardar el asiento!\");\n }\n }\n }", "public function agregar() {\t\n\t\t\n\t\t\n\t\t$registro = array(\n\t\t \"id\" => \"\",\n\t\t\t\t\t\t\t \"tipo\"=> $this->uri->segment(3,\"\") ,\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \"capacidad\"=>\"\"\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t );\n\t\t\n $arrt = ( $this->db->query('select * from tipos'));\n $tipos = ($arrt->result_array());\t\t\n\t\t\n\t\t$tip = array();\n\t\tforeach ($tipos as $tipo) {\n\t\t\t$tip[$tipo[\"tipo\"]] = $tipo[\"descripcion\"];\n\t\t}\t\n\t\t\n\t\t$registro['tipos'] = $tip; \n\t\t\n\t\t\n\t\t$this->load->view('inicio/top1');\n\t\t//$this->load->view('inicio/menuinterior');\n\t\t$this->load->view('subtipos/detallesubtipo',$registro); \n\t\t$this->load->view('inicio/bottom1');\n\t\t\n\t}", "public function create()\n {\n \t$dep = Departamentos::all();\n return view(\"areas.create\",[\"departamentos\"=>$dep]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new SolicitudOc;\n $linea=new SolicitudOcLinea;\n $articulo = new Articulo;\n $config = ConfCo::model()->find();\n $i = 1;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['SolicitudOc']))\n\t\t{\n\t\t\t$model->attributes=$_POST['SolicitudOc'];\n \n\t\t\tif($model->save())\n if(isset($_POST['Nuevo'])){\n foreach ($_POST['Nuevo'] as $datos){\n $linea=new SolicitudOcLinea;\n $linea->SOLICITUD_OC = $_POST['SolicitudOc']['SOLICITUD_OC'];\n $linea->ARTICULO = $datos['ARTICULO'];\n $linea->DESCRIPCION = $datos['DESCRIPCION'];\n $linea->UNIDAD = $datos['UNIDAD'];\n $linea->CANTIDAD = $datos['CANTIDAD'];\n $linea->FECHA_REQUERIDA = $datos['FECHA_REQUERIDA'];\n $linea->COMENTARIO = $datos ['COMENTARIO'];\n $linea->SALDO = $datos ['SALDO'];\n $linea->LINEA_NUM = $i;\n $linea->ESTADO = $datos ['ESTADO'];\n $linea->save();\n $config->ULT_SOLICITUD = $_POST['SolicitudOc']['SOLICITUD_OC'];\n $config->save();\n $i++;\n }\n }\n\t\t\t\t$this->redirect(array('admin'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n 'linea'=>$linea,\n 'articulo'=>$articulo,\n 'config' => $config,\n \n\t\t));\n\t}", "public function area_create()\n {\n //TODO you code here\n $this->load->model('district_model', null, true);\n\t\t$this->load->model('division_model', null, true);\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->saveArea())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('library_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'bf_zone_area');\n\t\t\t\tTemplate::set_message(lang('area_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/area/library/show_list');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('record_create_failure').$this->area_model->error, 'error');\n\t\t\t}\n\t\t}\n\n\t\t$district_list \t\t\t\t= $this->district_model->find_all_by('is_deleted', 0);\n\t\t$division_list = $this->division_model->find_all_by('is_deleted', 0);\n\n\t\tTemplate::set('division_list', $division_list);\n\t\tTemplate::set('district_list', $district_list);\n\t\tTemplate::set('toolbar_title', lang(\"library_zone_area_new\"));\n\t\tTemplate::set_view('zone/area_create');\n\t\tTemplate::render();\n }", "public function create()\n {\n if ( ! Auth::user()->can(\"edit-priorities\")){\n return HomeController::returnError(403);\n }\n\n $user = Auth::user();\n $position = Position::where('position_id', '=', $user->position)->first();\n $periods = Period::where('company','LIKE',\"%\".$this->company.\"%\")->get();\n if(Auth::user()->hasRole('champion') || Auth::user()->hasRole('super-admin' ) || Auth::user()->hasRole('team_lead' )){\n $users = User::where('department', '=', $this->department)->get();\n }else{\n $users = [$user];\n }\n return view('pages.create_priority', ['id' => Uuid::generate(4), 'user' => Auth::user(), 'periods' => $periods, 'users' => $users ]);\n\n }", "public function actionCreate()\n\t{\n\t\tif(!Yii::app()->request->isAjaxRequest)\n\t\t\tthrow new CHttpException(403,\"Petición inválida, probablemente ha fallado el JavaScript de su navegador.\");\n\t\t\n\t\t$model=new LandingFeatures;\n\n\t\tif(isset($_POST['LandingFeatures']))\n\t\t{\n\t\t\t$model->attributes=$_POST['LandingFeatures'];\n\t\t\t$model->landing_pages_id=$_GET['landing_pages_id']; // en curso\n\t\t\t// In oreder to create chronologically asc \n\t\t\t//$last=LandingFeatures::model()->findAll();\n\t\t\t//$model->orden_id=count($last)+1;\n\t\t\t// In oreder to create chronologically desc \n\t\t\t$last=LandingFeatures::model()->findAll(array('order'=>'orden_id'));\n\t\t\t$i=2;\n\t\t\tforeach($last as $data)\n\t\t\t{\n\t\t\t\t$data->orden_id=$i++;\n\t\t\t\t$data->save(true,array('orden_id'));\n\t\t\t}\n\t\t\t$model->orden_id=1;\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\techo CJSON::encode($model);\n\t\t\t\tYii::app()->end();\n\t\t\t}\n\t\t\t$this->validateAjax($model);\n\t\t}\n\t}", "public function agregar()\n\t\t{\n\t\t\tif($_POST)\n\t\t\t{\n\t\t\t\t$categoria = $this->loadModel(\"categoria\");\n\t\t\t\t$categoria->add($_POST);\n\t\t\t\t$this->redirect(array(\"controller\"=>\"categorias\"));\n\t\t\t}\n\t\t\t$this->_view->titulo=\"Nueva Tarea\";\n\t\t\t$this->_view->renderizar(\"agregar\");\n\t\t}", "public function create()\n {\n\t\t$lang = \\App::getLocale(session('lang'));\n\t\tif(Gate::allows('administradores', Auth::user())){\n\t\t\treturn view('clinica.tipos_de_tratamientos.create-tipos_tratamientos');\n\t\t}else{\n\t\t\tif($lang == 'es'){\n\t\t\t\tSession::flash('mensaje_autorizacion', 'Su cuenta de usuario no estรก autorizada para introducir un nuevo tipo de tratamiento.');\t\n\t\t\t}else{\n\t\t\t\tSession::flash('mensaje_autorizacion', 'Your account does not have permission to create new treatments.');\t\n\t\t\t}\n\t\t\treturn redirect('tratamientos_tipos');\n\t\t} \n }", "private function create(){\n \n /*****\n * GET TABLE FIELDS\n ******/\n $table_fields = get_class_vars(get_class($this));\n \n /*****\n *GRAB PRIMARY TO BE RESET\n *****/\n $primaryId = $table_fields['field_options']['primary'];\n \n /****\n * UNSET SOME FIELDS\n ****/\n unset($table_fields['field_options']);\n \n /****\n * LOOP THROUGH THE TABLES AND CREATE DATA FOR QUERY CALL\n ****/\n foreach($table_fields as $field => $null){\n if(isset($this->{$field})){ \n $data[$field] = $this->{$field};\n }\n }\n \n /***\n * PUSH INTO DATABASE\n ****/\n $go = go::get_go();\n $res = $go->query->insert($data)->into(get_class($this))->go();\n\n /***\n *GET MOST RECENT\n ***/\n $res = $go->query->select('MAX(id) as id')->from(get_class($this))->go();\n\n /****\n *SET THE PRIMARY KEY BACK INTO THE INSTANTIATED MODEL\n ****/\n if( $res->result ){\n $this->get( $res->row['id'] ); \n }\n \n return $res->result;\n \n }", "public function creat(){\n\n $newCity_rabat = new City();\n\n $newCity_rabat->name = \"Rabat\";\n $newCity_rabat->slug = \"rabat\";\n $newCity_rabat->save();\n\n $newCity_casa = new City();\n $newCity_casa->name = \"Casa\";\n $newCity_casa->slug = \"casa\";\n $newCity_casa->save();\n\n $newCity_tanger = new City();\n $newCity_tanger->name = \"Tanger\";\n $newCity_tanger->slug = \"tanger\";\n $newCity_tanger->save();\n }", "public function actionCreate()\n {\n $model = new TipoOrganismo;\n try\n {\n if ($model->saveWithRelated($_POST))\n {\n return $this->redirect(Url::previous());\n } elseif (!\\Yii::$app->request->isPost)\n {\n $model->load($_GET);\n }\n } catch (\\Exception $e)\n {\n $msg = (isset($e->errorInfo[2])) ? $e->errorInfo[2] : $e->getMessage();\n $model->addError('_exception', $msg);\n }\n return $this->render('create', ['model' => $model,]);\n }", "public function crearTablas(){\n\n //selecciono la base de datos BaseDatos para utilizarla\n $this->db->select_db(\"TODOList\");\n \n //Tabla Asignatura\n $crearTablaAsignatura = \"CREATE TABLE IF NOT EXISTS Asignatura \n (id INT NOT NULL AUTO_INCREMENT, \n nombre VARCHAR(255) NOT NULL, \n codigo VARCHAR(255) NOT NULL UNIQUE, \n curso TINYINT UNSIGNED NOT NULL,\n PRIMARY KEY (id) )ENGINE=InnoDB\";\n\n //Tabla Tarea\n $crearTablaTarea = \"CREATE TABLE IF NOT EXISTS Tarea \n (id INT NOT NULL AUTO_INCREMENT, \n nombre VARCHAR(255) NOT NULL, \n categoria VARCHAR(255) NOT NULL, \n dificultad TINYINT UNSIGNED NOT NULL CHECK(dificultad BETWEEN 0 AND 10),\n deadline DATE NOT NULL,\n PRIMARY KEY (id))ENGINE=InnoDB\";\n\n //Tabla TODO\n $crearTablaTODO = \"CREATE TABLE IF NOT EXISTS TODO ( \n idAsignatura INT NOT NULL, \n idTarea INT NOT NULL UNIQUE, \n horasEstimadas TINYINT UNSIGNED NOT NULL,\n FOREIGN KEY (idAsignatura) REFERENCES Asignatura ( id ),\n FOREIGN KEY (idTarea) REFERENCES Tarea ( id ),\n PRIMARY KEY (idAsignatura, idTarea) \n )ENGINE=InnoDB\";\n\n //Creación de las tablas. No se necesita sentencia de preparación porque los metadatos son internos\n if($this->db->query($crearTablaAsignatura) === TRUE){\n echo \"<p>Tabla Asignatura creada con éxito </p>\";\n } else { \n echo \"<p>ERROR en la creación de la tabla. Error : \". $this->db->error . \"</p>\";\n exit();\n }\n\n if($this->db->query($crearTablaTarea) === TRUE){\n echo \"<p>Tabla Tarea creada con éxito </p>\";\n } else { \n echo \"<p>ERROR en la creación de la tabla. Error : \". $this->db->error . \"</p>\";\n exit();\n }\n\n if($this->db->query($crearTablaTODO) === TRUE){\n echo \"<p>Tabla TODO creada con éxito </p>\";\n } else { \n echo \"<p>ERROR en la creación de la tabla. Error : \". $this->db->error . \"</p>\";\n exit();\n }\n\n $this->popularTablas();\n }", "public static function crearOrdenTrabajo($idContrato,$fechaAlta)\n {\n $util=new util();\n\n $t_ordenes=array(\"ID_CONTRATO\",\"FECHA_ALTA\",\"ID_TIPO_ESTADO\",\"NUMERO\",\"ID_EMPRESA\");\n\n if($fechaAlta==null)\n $fechaAlta=date('Y-m-d h:i:s ');\n\n $nuevaOrden = intval($util->selectMax('ordenes', 'NUMERO','ID_EMPRESA ='.$_SESSION['REVENDEDOR']))+1;\n\n\n $values=array($idContrato,$fechaAlta,1,$nuevaOrden,$_SESSION['REVENDEDOR']);//TIPO DE ESTADO ES 1 DE APERTURA\n\n $resOrden= $util->insertInto('ordenes', $t_ordenes, $values);\n\n return $resOrden;\n\n }", "public function create($idTienda)\n {\n $data['id'] = 0;\n $data['update_data']['tienda_id'] = $idTienda;\n $this->load->view('Producto/create_Producto', $data);\n \n\n }", "public function create()\n {\n return view('workflow::admin.workflowpriorities.create');\n }", "public function create()\n {\n \n \treturn view ('rango_horario.create'); //carpeta paises - archivo create\n }", "public function store(Request $request){\n \n $this->validate($request, [\n 'id_proyecto'=>'required',\n 'id_desarrollador'=>'required',\n 'nombre' => 'required|string|max:50', \n 'descripcion' => 'required|string|max:100',\n\t\t\t\t\t\t'status' => 'required',\n\t\t\t\t\t\t'monto' => 'required'\n ]);\n\t\t\t \n\t\t\t\t return tareas::create([\n\t\t\t\t\t\t'id_proyecto'=> $request['id_proyecto'],\n 'id_desarrollador' => $request['id_desarrollador'],\n 'nombre' => $request['nombre'],\n 'descripcion' => $request['descripcion'],\n 'status' => $request['status'],\n 'monto' => $request['monto']\n ]);\n }", "public function create()\n\t{\n\t\t$this->layout->title = 'Nuevo Departamento';\n\t\t$this->layout->titulo = 'Mantenimiento';\n\t\t$this->layout->nest(\n\t\t\t'content',\n\t\t\t'departamentos.create',\n\t\t\tarray()\n\t\t);\n\t}", "public function create()\n {\n //\n return view('tarea.create');\n }", "public function add() {\n\t\n\t\t$CategoriaArray = $this->Categoria->find('all');\n\t\t$this->set('CategoriaArray', $CategoriaArray);\n\t\t\n\t\tif($this->request->is('post')) {\n\t\t\t$this->Tipordene->create();\n\t\t\t\n\t\t//\tdebug($this->request->data);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif ($this->Tipordene->saveAll($this->request->data)) {\n\t\t\t\t\t$this->Session->setFlash('El Tipo de orden ha sido creado satisfactoriamente','flash_custom');\n\t\t\t\t\t$this->redirect(array('action' => '/index'));\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash('El Tipo de orden no pudo ser creado Intente nuevamente', 'flash_error');\n\t\t\t\t} \n\t\t}\n\t\n\t}", "function NuevaAsistencia($id_usuario, $fecha, $observacion, $pausaActiva)\n{\n $reloj = reloj();\n $Asistencia = new Int_control_asistencia;\n $Asistencia->user_id = $id_usuario;\n $Asistencia->fecha = $fecha;\n $Asistencia->hora_entrada = $reloj['thora'];\n $Asistencia->hora_salida_almuerzo = '';\n $Asistencia->hora_entrada_almuerzo = '';\n $Asistencia->hora_salida = '';\n $Asistencia->evento = 'Entrada/';\n $Asistencia->observaciones = $observacion;\n $Asistencia->hora_diaria = '';\n $Asistencia->pausa_activa = $pausaActiva;\n $Asistencia->save();\n}", "public function create()\n { \n $matriculados = Matriculacion::with('tareas_individuales')->orderBy('id', 'ASC')->pluck('nombres');\n return view('tareasIndividuales.create', compact('matriculados'));\n }", "public function newAction($id_presupuesto,$id_proveedor)\n {\n $em = $this->getDoctrine()->getManager();\n\n //obtengo el id del proveedor segun el presupuesto\n $entity2 = $em->getRepository('ContenidosBundle:Presupuesto')->find($id_presupuesto);\n $prov = $entity2-> getIdProveedor();\n\n\n //DETERMINO EL TIPO DE MONEDA (DOLARES O EUROS)\n $dolares = $entity2->getMontoDolares();\n $euros = $entity2->getMontoEuros();\n \n if (($dolares == 0 || $dolares== NULL) && ($euros != 0 || $euros!=NULL))\n {\n $tipomoneda= '2';//moneda es EUROS\n }elseif(($euros == 0 || $euros==NULL) && (($dolares != 0 || $dolares!= NULL)))\n {\n $tipomoneda = '1';//moneda es DOLARES\n }elseif(($dolares == 0 || $dolares== NULL) && ($euros == 0 || $euros==NULL))\n {\n $tipomoneda = '3'; //moneda es Bs\n }\n\n //instancio la clase Contratacion\n $entity = new Contratacion();\n\n //asocio la clase al formulario\n $form = $this->createForm(new ContratacionType(), $entity);\n\n //obtengo el tipo de proveedor del proveedor de acuerdo a un ID\n $entity1 = $em->getRepository('ContenidosBundle:Datosproveedor')->find($id_proveedor);\n $tipoprov= $entity1->getIdTipoprov();\n\n //envio a la vista\n return $this->render('ContenidosBundle:Contratacion:new.html.twig', array(\n 'entity' => $entity,\n 'id_proveedor' => $id_proveedor,\n 'tipoprov' => $tipoprov,\n 'tipomoneda' => $tipomoneda,\n 'id_presupuesto'=> $id_presupuesto,\n 'form' => $form->createView(),\n ));\n\n }", "public function crear(){\n Utils::isAdmin();\n require_once 'views/categoria/crear.php';\n }", "protected function create(){\n\t\t$areaNames = [];\n $mentorAreas = MentorArea::all();\n if(is_object($mentorAreas) && false == $mentorAreas->isEmpty()){\n foreach($mentorAreas as $mentorArea){\n $areaNames[$mentorArea->id] = $mentorArea->name;\n }\n }\n $skill = new MentorSkill;\n\t\treturn view('mentorSkill.create', compact('areaNames','skill'));\n }", "function createLMTree()\n\t{\n\t\t$this->lm_tree =& new ilTree($this->getId());\n\t\t$this->lm_tree->setTreeTablePK(\"lm_id\");\n\t\t$this->lm_tree->setTableNames('lm_tree','lm_data');\n\t\t$this->lm_tree->addTree($this->getId(), 1);\n\t}", "public function create()\n {\n\n $tags = Tag::pluck('nom_tag', 'id_tag');\n $prioridades = Prioridad::pluck('nom_prioridad', 'id_prioridad');\n $subareas = Subarea::pluck('nom_subarea', 'id_subarea');\n\n return view('noticias.create', compact('subareas','tags', 'prioridades'));\n\n }", "private function create()\n {\n $this->entity = $this->model();\n }", "public function actionCreate()\n {\n if (Yii::$app->user->isGuest) {\n return $this->redirect([\"site/login\"]); \n }\n if(Permiso::requerirRol('administrador')){\n $this->layout='/main2';\n }elseif(Permiso::requerirRol('gestor')){\n $this->layout='/main3';\n }\n\n $idPregunta=$_REQUEST['idPregunta'];\n // echo '<pre>'; print_r(Yii::$app->request->post()); echo '</pre>';\n $model = new RespuestaTrivia();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $resp=$model->respTriviaValor;\n $idPregunta=$model->idPregunta;\n // echo '<br><br><br><br><pre>'; print_r($resp); echo '</pre>';\n foreach($resp as $valor){\n if (!$this->existeRespuesta($idPregunta,$valor)) {\n \n $laRespuesta=new RespuestaTrivia();\n $laRespuesta->respTriviaValor=$valor;\n $laRespuesta->idPregunta=$idPregunta;\n $laRespuesta->save();\n }\n }\n return $this->redirect(['respuesta-trivia/index', 'idPregunta' => $idPregunta]);\n }\n\n $model->idPregunta=$idPregunta;\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $usuario = Auth::user();\n $persona = $usuario->persona()->get()->last();\n $contratos = $persona->contrato()->with('estadoLaboral')->get()->all();\n \n //Creamos unos contenedores\n $empresas = collect([]);\n \n foreach ($contratos as $contrato) { \n if ( $contrato->estadoLaboral->last()->estado == 'alta' ) { \n $empresas->push($contrato->empresa); \n } \n }\n \n //Formateamos la respuesta para que la lea SELECT2\n $contenedor = []; \n \n foreach ($empresas as $empresa) {\n \n $contenedor[]= ['id' => $empresa->id, 'text' => $empresa->nombre]; \n }\n \n return response()->json($contenedor);\n }", "public function actionCrear($id, $tipo_pagina_id = 2)\n\t{\n\t\tif( !isset(Yii::app()->session['dirpa']) ) Yii::app()->session['dirpa'] = 'backgrounds/paginas/'. date('Y') . '/' . date('m') . '/';\n\t\t$micrositio = ($id)?Micrositio::model()->with('seccion')->findByPk($id)->id:0;\n\t\t$model = new Pagina;\n\t\t$model->micrositio_id = $micrositio;\n\t\t$ppc = TipoPagina::model()->findByPk($tipo_pagina_id)->tabla;\n\t\tif(!$ppc) throw new Exception(400, \"tipo_pagina_id incorrecto\");\n\t\t$contenido = new $ppc;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Pagina']))\n\t\t{\n\t\t\t$model->attributes = $_POST['Pagina'];\n\t\t\t$m = Micrositio::model()->with('seccion')->findByPk($_POST['Pagina']['micrositio_id']);\n\t\t\t$model->tipo_pagina_id = $tipo_pagina_id;\n\n\t\t\tif( isset(Yii::app()->session['dirpa']) ){\n\t\t\t\t$dirpa = Yii::app()->session['dirpa'];\n\t\t\t}\n\n\t\t\t$model->background = ($_POST['Pagina']['background'] != '')?$dirpa . $_POST['Pagina']['background']:NULL;\n\t\t\t$model->background_mobile = ($_POST['Pagina']['background_mobile'] != '')?$dirpa . $_POST['Pagina']['background_mobile']:NULL;\n\t\t\t$model->miniatura = ($_POST['Pagina']['miniatura'])?$dirpa . $_POST['Pagina']['miniatura']:NULL;\n\t\t\t\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\tif(isset($_POST['PgGenericaSt']))\n\t\t\t\t{\n\t\t\t\t\t$contenido->texto = $_POST['PgGenericaSt']['texto'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['PgArticuloBlog']))\n\t\t\t\t{\n\t\t\t\t\t$contenido->posicion \t= $_POST['PgArticuloBlog']['posicion'];\n\t\t\t\t\t$contenido->entradilla \t= $_POST['PgArticuloBlog']['entradilla'];\n\t\t\t\t\t$contenido->texto \t\t= $_POST['PgArticuloBlog']['texto'];\n\t\t\t\t\t$contenido->enlace \t\t= $_POST['PgArticuloBlog']['enlace'];\n\t\t\t\t\t$contenido->comentarios = $_POST['PgArticuloBlog']['comentarios'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['PgDocumental']))\n\t\t\t\t{\n\t\t\t\t\t$contenido = PgDocumental::model()->findByPk($_POST['PgDocumental']['id']);\n\t\t\t\t\t$contenido->titulo \t = $_POST['PgDocumental']['titulo'];\n\t\t\t\t\t$contenido->duracion = $_POST['PgDocumental']['duracion'];\n\t\t\t\t\t$contenido->anio \t = $_POST['PgDocumental']['anio'];\n\t\t\t\t\t$contenido->sinopsis = $_POST['PgDocumental']['sinopsis'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['PgFiltro']))\n\t\t\t\t{\n\t\t\t\t\t$contenido->descripcion = $_POST['PgFiltro']['descripcion'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['PgBloques']))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['PgEventos']))\n\t\t\t\t{\n\t\t\t\t\t$contenido->descripcion = $_POST['PgEventos']['descripcion'];\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['PgBlog']))\n\t\t\t\t{\n\t\t\t\t\t$contenido->ver_fechas \t= $_POST['PgBlog']['ver_fechas'];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(isset($_POST['PgFormularioJf']))\n\t\t\t\t{\n\t\t\t\t\t$contenido->formulario_id \t= $_POST['PgFormularioJf']['formulario_id'];\n\t\t\t\t}\n\t\t\t\t$contenido->estado = $_POST['Pagina']['estado'];\n\t\t\t\t$contenido->pagina_id = $model->getPrimaryKey();\n\t\t\t\tif($contenido->save())\n\t\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t\t\telse\n\t\t\t\t\t$model->delete();\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t$this->render('crear',array(\n\t\t\t'model'=>$model,\n\t\t\t'partial' => $ppc,\n\t\t\t'contenido' => $contenido,\n\t\t));\n\t}", "public function create(){\n $user = Auth::user()->empresa_id;\n $contatos = Contato::where('empresa_id', $user)->get();\n $produtos = Produto::where('empresa_id', $user)->where('status', 1)->get();\n $grupos = Grupo::where('empresa_id', $user)->with('empresa')->get();\n $config = $this->config->where('empresa_id', $user)->first();\n\n return view('pages.pedidos.balcao.novaTelaPedido', compact('contatos', 'produtos', 'grupos', 'config'));\n }", "public function store(Request $request)\n {\n //crear nueva tarea\n\n $tarea = new Tarea();\n $tarea->trabajo_id = $request->trabajo_id;\n $tarea->descripcion = $request->descripcion;\n $tarea->estado = 0;\n $tarea->save();\n return $tarea;\n }", "function agregar_procedimiento()\n {\n $permiso = $this->permiso_administrador();\n\n $this->load->model('tpoadminv1/catalogos/Catalogos_model');\n\n $data['title'] = \"Agregar procedimientos de contrataci&oacute;n\";\n $data['heading'] = $this->session->userdata('usuario_nombre');\n $data['mensaje'] = \"\";\n $data['job'] = $this->session->userdata('usuario_job');\n $data['active'] = 'catalogos'; // solo active \n $data['subactive'] = 'otros_co'; // class=\"active\"\n $data['optionactive'] = \"busqueda_procedimientos\"; // class=\"active\"\n $data['body_class'] = 'skin-blue';\n $data['main_content'] = 'tpoadminv1/catalogos/agregar_procedimiento';\n\n \n $data['procedimiento'] = array(\n 'nombre_procedimiento' => '',\n 'active' => 'null'\n );\n \n\n $data['scripts'] = \"\";\n\n $this->load->view('tpoadminv1/includes/template', $data);\n }", "public function run()\n {\n //\n $priorite= new Priorite();\n $priorite->id='1';\n $priorite->libelle='Urgent';\n $priorite->save();\n\n $priorite= new Priorite();\n $priorite->id='2';\n $priorite->libelle='Très urgent';\n $priorite->save();\n }", "public function create(){\n \n $areas = Area::all();\n\n return view('admin/oficinas/crear_oficina',compact('areas'));\n }", "public function create()\n {\n return view('tipo_tramites.create');\n }", "public function actionCreate()\n {\n $us = Yii::$app->user->identity;\n if ($us->rol !== 'C') {\n return $this->goHome();\n }\n $model = new Tutores();\n\n\n\n if ($model->load(Yii::$app->request->post())) {\n $model->colegio_id = $us->colegio_id;\n if ($model->save()) {\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $prioritats = PrioritatIncidencia::all();\n\n return view('gestio/incidencies/create', compact('prioritats'));\n }", "public function actionCreate()\n\t{\n $model=new $this->modelopadre;\n\t\t$model->valorespordefecto($this->documento);\n\t\t$model->iduser=Yii::app()->user->id;\n\t\tif(isset($_POST[$this->modelopadre]))\n\t\t{\n\t\t\t$model->attributes=$_POST[$this->modelopadre];\n\t\t\t$model->codestado='10';\n $model->codocu=$this->documento;\n\t\t\tif($model->save()){\n $model->refresh();\n $model->heredagastos();\n\t\t\t\t$this->redirect(array('update','id'=>$model->id));\n\t\t\t}\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function crearProceso()\n {\n $data = compobarSesion();\n // Notificaciones\n $data['notificaciones'] = $this->Notificaciones_model->listar_notificaciones($data['user_id']);\n $data['notificaciones_supervisor'] = $this->Notificaciones_model->listar_notificaciones_supervisor($data['rol']);\n $data['alertas'] = $this->Notificaciones_model->listar_alertas($data['user_id']);\n\n //Id de prospecto\n $data['segmento_p']=$this->uri->segment(3);\n\n //si no hay datos de prospecto\n if(!$data['segmento_p']){\n redirect('prospectos/prospectosList', 'refresh');\n }else{\n $data['prospectos'] = $this->Prospecto_model->ListarProspecto($data['segmento_p']);\n }\n\n $data['proyectos'] = $this->Admin_model->get_proyectos();\n $data['title'] = 'Creas Proceso';\n echo $this->templates->render('crear_proceso', $data);\n //$this->load->view('crear_proceso', $data);\n }", "public function crear()\n {\n $familias = Familia::lists('nombre', 'id');\n\n //Quitando los genero que esta por sinonimia que no tienen arbol taxonómico superior\n $genero = Genero::where('familia_id', '!=', -1)->select('id', 'nombre', 'familia_id')->get();\n $especifico = Especifico::select('id', 'nombre')->get();\n $varietal = Varietal::select('id', 'nombre')->get();\n $forma = Forma::select('id','nombre')->get();\n\n $autor = Autor::lists('nombre');\n\n\n\n $taxonomia = array( 'genero' => $genero, 'especifico' => $especifico, 'varietal' => $varietal, 'forma' => $forma, 'autor' => $autor);\n $taxonomia = json_encode($taxonomia);\n\n $cita_autores = Array(\n null => 'seleccione la cantidad de autores',\n '1'=> '1 autor',\n '2'=> '2 autores',\n '3'=> '3 o más autores',\n\n );\n\n $tipo_trabajos = Array(\n null => 'seleccione el tipo de trabajo',\n 'pregrado'=> 'Trabajos Especiales de Grado (Licenciatura), ',\n 'maestria'=> 'Tesis de Grado (Maestría)',\n 'doctorado'=> 'Tesis (Doctorado)',\n 'ascenso'=> 'Monografías de Trabajos de Ascenso',\n\n );\n\n//\n //fecha referencia\n $fecha_actual = date('Y');\n// $rango = range( 1800, $fecha_actual);\n $rango = range($fecha_actual, 1800);\n $fecha = array_combine($rango, $rango);\n $fecha[null]='seleccione una fecha';\n// ksort($fecha);\n\n\n //año enlace\n// $rango = range( 1980,$fecha_actual);\n $rango = range( $fecha_actual, 1980);\n $fecha_ano = array_combine($rango, $rango);\n $fecha_ano[null]='seleccione el año';\n// ksort($fecha_ano);\n\n\n //dia enlace\n $rango = range(1,31);\n $fecha_dia = array_combine($rango, $rango);\n $fecha_dia[null]='seleccione el día';\n ksort($fecha_dia);\n\n //mes enlace\n $fecha_mes = Array(\n null => 'seleccione el mes',\n 'Enero'=> 'Enero',\n 'Febrero'=> 'Febrero',\n 'Marzo'=> 'Marzo',\n 'Abril'=> 'Abril',\n 'Mayo'=> 'Mayo',\n 'Junio'=> 'Junio',\n 'Julio'=> 'Julio',\n 'Agosto'=> 'Agosto',\n 'Septiembre'=> 'Septiembre',\n 'Octubre'=> 'Octubre',\n 'Noviembre'=> 'Noviembre',\n 'Diciembre'=> 'Diciembre',\n );\n\n\n $especies = DB::table('especies')\n ->join('epitetos_especificos', 'especies.especifico_id', '=', 'epitetos_especificos.id')\n ->leftJoin('epitetos_varietales', 'especies.varietal_id', '=', 'epitetos_varietales.id')\n ->leftJoin('epitetos_formas', 'especies.forma_id', '=', 'epitetos_formas.id')\n ->join('generos', 'especies.genero_id', '=', 'generos.id')\n ->join('autores', 'especies.autor_id', '=', 'autores.id')\n ->select(DB::raw('especies.id, epitetos_especificos.nombre as especifico, epitetos_varietales.nombre as varietal, epitetos_formas.nombre as forma, generos.nombre as genero, autores.nombre as autor'))\n ->orderBy('genero')->orderBy('especifico')->orderBy('forma')->orderBy('varietal')\n ->get();\n\n// dd($especies);\n \n $lista_especies = Array();\n foreach($especies as $especie){\n\n $nombre = $especie->genero.' '.$especie->especifico;\n\n if($especie->varietal != null){\n $nombre = $nombre .' v. '.$especie->varietal;\n }\n if($especie->forma != null){\n $nombre = $nombre .' f. '.$especie->forma;\n }\n\n $nombre = $nombre.' '.$especie->autor;\n \n $lista_especies[$especie->id] = $nombre;\n }\n\n// dd($lista_especies);\n\n\n $entidades = Entidad::select('id', 'nombre')->get();\n $localidas = Localidad::select('id', 'nombre')->get();\n $lugares = Lugar::select('id', 'nombre')->get();\n $sitios = Sitio::select('id', 'nombre')->get();\n\n $geograficos = array('entidad' =>$entidades, 'localidad' =>$localidas, 'lugar' => $lugares, 'sitio' => $sitios);\n $geograficos = json_encode($geograficos);\n\n\n\n $sinonimias = DB::table('sinonimias')\n ->join('epitetos_especificos', 'sinonimias.especifico_id', '=', 'epitetos_especificos.id')\n ->leftJoin('epitetos_varietales', 'sinonimias.varietal_id', '=', 'epitetos_varietales.id')\n ->leftJoin('epitetos_formas', 'sinonimias.forma_id', '=', 'epitetos_formas.id')\n ->join('generos', 'sinonimias.genero_id', '=', 'generos.id')\n ->join('autores', 'sinonimias.autor_id', '=', 'autores.id')\n ->select(DB::raw('sinonimias.id, epitetos_especificos.nombre as especifico, epitetos_varietales.nombre as varietal, epitetos_formas.nombre as forma, generos.nombre as genero, autores.nombre as autor'))\n ->orderBy('genero')->orderBy('especifico')->orderBy('forma')->orderBy('varietal')\n ->get();\n// dd($sinonimias);\n\n\n\n $lista_sinonimias = Array();\n foreach($sinonimias as $sinonimia){\n\n $nombre = $sinonimia->genero.' '.$sinonimia->especifico;\n\n if($sinonimia->varietal != null){\n $nombre = $nombre .' v. '.$sinonimia->varietal;\n }\n if($sinonimia->forma != null){\n $nombre = $nombre .' f. '.$sinonimia->forma;\n }\n\n $nombre = $nombre.' '.$sinonimia->autor;\n\n $lista_sinonimias[$sinonimia->id] = $nombre;\n }\n\n// dd($lista_sinonimias);\n return view('catalogo.crear', compact('taxonomia', 'familias', 'fecha','fecha_ano', 'fecha_dia', 'fecha_mes', 'cita_autores', 'tipo_trabajos', 'lista_especies', 'lista_sinonimias', 'geograficos'));\n\n }", "public function __CONSTRUCT(){\n $this->model = new Pelicula();\n }", "public function actionCreate()\n {\n /*$model = new Emprestimo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }*/\n \n $model = new EmprestimoComTitulos();\n \n if ($model->load(Yii::$app->request->post())) {\n \n \n if ($model->save()) {\n $model->saveTitulos();\n if ($model->possuiBonus()){\n $model->valor = 0.0;\n $model->save();\n $model->diminuirBonus();\n \n Yii::$app->session->setFlash('msg', '\n <div class=\"alert alert-success alert-dismissable\">\n <button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">×</button>\n <strong>BONUS! </strong>Cliente completou 10 empréstimos, este é por conta da casa.</div>'\n );\n \n return $this->redirect(['view', 'id' => $model->id]);\n \n } else {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n }\n \n\n return $this->render('create', [\n 'model' => $model,\n 'titulos' => Titulo::getAvailableTitulos(),\n ]);\n \n /*\n return $this->render('create', [\n 'model' => $model,\n //'dataProvider' => $dataProvider,\n ]);\n * \n */\n }", "public function actionCreate()\n\t{\n\t\t$model=new TProgramacionsugeridadetalle;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TProgramacionsugeridadetalle']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TProgramacionsugeridadetalle'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->IdProgramacionSugeridaDetalle));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "protected function CreateObjects() {\n\t\t$this->txtAlternativaId = $this->mctAlternativa->txtAlternativaId_Create();\n\t\t$this->txtDescripcion = $this->mctAlternativa->txtDescripcion_Create();\n\t\t$this->lstPregunta = $this->mctAlternativa->lstPregunta_Create();\n\t\t$this->txtEsCorrecta = $this->mctAlternativa->txtEsCorrecta_Create();\n\t\t$this->txtOrden = $this->mctAlternativa->txtOrden_Create();\n\t\t$this->txtCreateby = $this->mctAlternativa->txtCreateby_Create();\n\t\t$this->calCreated = $this->mctAlternativa->calCreated_Create();\n\t\t$this->txtUpdateby = $this->mctAlternativa->txtUpdateby_Create();\n\t\t$this->calUpdated = $this->mctAlternativa->calUpdated_Create();\n\t\t$this->txtActive = $this->mctAlternativa->txtActive_Create();\n\t}", "public function actionCreate()\n {\n if((Yii::$app->user->can('view-admin'))||(Yii::$app->user->can('funcionario'))) {\n $model = new Pedido();\n $model2 = new Menu();\n\n\n\n //verificar validade da promoção\n $hoje = date('d-M-Y');\n $hojed=strtotime($hoje);\n $listapromo=Promocoes::find()\n ->all();\n \n foreach ($listapromo as $promos){\n if(($promos->data_inicio<=$hojed)&&($promos->data_fim>=$hojed)){\n $promocao[$promos->id]=$promos;\n }\n }\n\n if ($model2->load(Yii::$app->request->post()) && $model->load(Yii::$app->request->post())) {\n\n $precoH= Hamburguer::find()\n ->where(['id'=> $model2->id_hamburguer])\n ->sum('preco');\n\n $precoB= Produtos::find()\n ->where(['id'=> $model2->id_bebida])\n ->orWhere(['id'=> $model2->id_sobremesa])\n ->orWhere(['id'=> $model2->id_complemento])\n ->orWhere(['id'=> $model2->id_extra])\n ->sum('preco');\n\n $preco =$precoB+$precoH;\n \n \n\n\n //se selecionar uma promoçao, o valor que está indicado é subtraido ao valor normal do pedido\n if(!empty($model->promocao)){ \n $valorpromo=Promocoes::find()\n ->where(['id'=>$model->promocao])\n ->one();\n\n\n $preco=$preco-($valorpromo->valor);\n\n }\n\n //preço do menu\n $model2->preco=$preco;\n\n //preço do pedido\n $model->preco=$preco;\n\n $model2->save(false);\n\n $model->id_menu = $model2->id;\n\n $model->save(false);\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n\n\n\n\n $getM = Menu::find()->all();\n $getU = User::find()->all();\n\n $hamburguer = Hamburguer::find()->all();\n\n $bebida = Produtos::find()\n ->where(['categoria' => 7])\n ->all();\n\n $sobremesa = Produtos::find()\n ->where(['categoria' => 8])\n ->all();\n\n $complemento = Produtos::find()\n ->where(['categoria' => 9])\n ->all();\n\n $produtos =Produtos::find()->all();\n\n return $this->render('create', [\n 'model' => $model,\n 'getM' => ArrayHelper::map($getM, 'id','id'),\n 'getU' => ArrayHelper::map($getU, 'id','username'),\n 'model2'=> $model2,\n 'hamburguer' => ArrayHelper::map($hamburguer, 'id', 'nome'),\n 'bebida' => ArrayHelper::map($bebida, 'id', 'nome'),\n 'complemento' => ArrayHelper::map($complemento , 'id', 'nome'),\n 'sobremesa' => ArrayHelper::map($sobremesa, 'id', 'nome'),\n 'produtos' =>ArrayHelper::map($produtos, 'id', 'nome'),\n 'promocao' => ArrayHelper::map($promocao, 'id', 'nome'),\n ]);\n }\n else\n {\n throw new ForbiddenHttpException();\n }\n }", "public function create(){\n\t\t$this->auth->restrict('Tutores.Tutorias.Create');\n\n\t\tAssets::add_module_js('tutores', 'tutores.js');\n\n\t\tTemplate::set('toolbar_title', lang('tutores_create') . ' Tutores');\n\t\tTemplate::render();\n\t}", "function __construct(){\n $this->model_u=new universidad_model();\n }", "function agregar_presupuesto()\n {\n $permiso = $this->permiso_administrador();\n\n $this->load->model('tpoadminv1/catalogos/Catalogos_model');\n\n $data['title'] = \"Agregar partida presupuestar&iacute;a\";\n $data['heading'] = $this->session->userdata('usuario_nombre');\n $data['mensaje'] = \"\";\n $data['job'] = $this->session->userdata('usuario_job');\n $data['active'] = 'catalogos'; // solo active \n $data['subactive'] = 'otros_co'; // class=\"active\"\n $data['optionactive'] = \"busqueda_presupuestos\"; // class=\"active\"\n $data['body_class'] = 'skin-blue';\n $data['main_content'] = 'tpoadminv1/catalogos/agregar_presupuesto';\n\n \n $data['presupuesto'] = array(\n 'capitulo' => '',\n 'concepto' => '',\n 'partida' => '',\n 'denominacion' =>'',\n 'descripcion' => '',\n 'id_captura' => 'null',\n 'active' => 'null'\n );\n \n\n $data['scripts'] = \"\";\n\n $this->load->view('tpoadminv1/includes/template', $data);\n }", "public function create()\n { \n return view('admin.area.create',[\n 'area' => new Area(),\n ]);\n }", "public function criarTabela() {\n\t\tif (($comandoCriacaoTabela = $this->gerarComandoCriacaoTabela())) {\n\t\t\t$this->executarComando($comandoCriacaoTabela);\n\t\t}\n\t}", "public function create()\n\t{\n\t\treturn view('tiporenglon.crear');\n\t}", "public function __construct(){\n\t\t\t$this->personaModelo = $this->modelo('Persona');\n\t\t\t\n\n\t\t}", "public function create()\n {\n $provincias = Provincia::pluck('nombre','id');\n return view('resources.bronce.titulares.create', ['provincias' => $provincias]);\n }", "public function createModel();", "public function priority() {\n\n return $this->belongsTo('Priority');\t//Relación de las prioridades a tareas\n\n }", "public function create()\n {\n $actividad_titulacions = ActividadTitulacion::orderBy('id', 'ASC')\n ->pluck('nombre', 'id');\n\n $actividad_titulacions2 = ActividadTitulacion::orderBy('id', 'ASC')\n ->pluck('comision','id');\n\n $actividad_titulacions3 = ActividadTitulacion::orderBy('id', 'ASC')\n ->pluck('cant_estudiante','id');\n\n $academicos = Academico::orderBy('nombre', 'ASC')\n ->pluck('nombre','id');\n\n $rut_estudiantes = Estudiante::orderBy('id','ASC')\n ->pluck('rut', 'id',);\n\n $estudiantes = Estudiante::orderBy('id','ASC')\n ->pluck('nombre', 'id',);\n\n $estudiantes_apellido_paterno = Estudiante::orderBy('id','ASC')\n ->pluck('apellido_paterno', 'id',);\n\n $estudiantes_apellido_materno = Estudiante::orderBy('id','ASC')\n ->pluck('apellido_materno', 'id',);\n\n $organizaciones = OrganizacionExterna::orderBy('id','DESC')\n ->pluck('id','id');\n return view('admin.trabajo_titulacions.create', compact('organizaciones','rut_estudiantes','estudiantes_apellido_paterno','estudiantes_apellido_materno','actividad_titulacions','actividad_titulacions2','actividad_titulacions3','academicos','estudiantes'));\n }", "public function create()\n {\n $prefencia = \\Views::diccionario('idPreferencia');\n $reuniones = array();\n $cuota = array();\n $legal =array();\n\n $a_data_page = array(\n 'title' => 'Registro de paginas',\n 'reuniones' => $reuniones,\n 'cuota' => $cuota,\n 'legal' => $legal,\n 'prefencia' => $prefencia\n );\n\n return \\Views::admin('pagos.create',$a_data_page);\n }", "protected function agregar_empresa_modelo ($datos){\n\t\t$sql=mainModel::conectar()->prepare(\"INSERT INTO empresa (EmpresaCodigo,EmpresaNombre,EmpresaTelefono,EmpresaEmail,\tEmpresaDireccion,EmpresaDirector,EmpresaDirecTele,EmpresaYear) VALUES (:Codigo,:Nombre,:Telefono,:Email,:Direccion,:Director,:Telefono2,:Year)\");\n\t\t\n\t\t$sql->bindParam(\":Codigo\",$datos[\"Codigo\"]);\n\t\t$sql->bindParam(\":Nombre\",$datos[\"Nombre\"]);\n\t\t$sql->bindParam(\":Telefono\",$datos[\"Telefono\"]);\n\t\t$sql->bindParam(\":Email\",$datos[\"Email\"]);\n\t\t$sql->bindParam(\":Direccion\",$datos[\"Direccion\"]);\n\t\t$sql->bindParam(\":Director\",$datos[\"Director\"]);\n\t\t$sql->bindParam(\":Telefono2\",$datos[\"Telefono2\"]);\n\t\t$sql->bindParam(\":Year\",$datos[\"Year\"]);\n\t\t$sql->execute();\n\t\treturn $sql;\n\t}", "public function tipoDePrestacion()\n\t{\n\t\treturn $this->hasOne('App\\Models\\TipoPrestacion' , 'tipo_prestacion' , 'tipo');\t\n\t}", "public function newTipo()\n\t{\n\n\t\t// Carrega a view correspondende //\n\t\t$data['main_content'] = 'tipo/newTipo_view';\n\n\t\t// Envia todas as informações para tela //\t\t\t\n\t\t$this->parser->parse('template', $data);\n\t\t\n\t}", "public function create()\n {\n // return view('masters.masterCreate', [\n // 'title' => 'Создать мастера',\n // 'departments' => Department::all()->sortByDesc('rating'),\n // 'works' => TypeOfWork::all(),\n // ]);\n }", "public function __construct() {\n $this->adminTallaModelo = new adminTallaModelo();\n }", "public function actionCreate() {\n $model = new Servicio();\n\n if ($model->load(Yii::$app->request->post())) {\n $prioridad = Servicio::find()->where(['prioridad' => $model->prioridad])->all();\n if (count($prioridad) != 0) {\n Yii::$app->session->setFlash('error', 'Existe un servicio con esa prioridad desea reemplazarlo');\n\n return $this->redirect(['view', 'nom' => $model->nombre, 'pri' => $model->prioridad, 'ingles' => $model->ingles, 'frances' => $model->frances]);\n }\n \n $lis_servicio= Servicio::find()->orderBy('prioridad desc')->all();\n \n\n $num = $lis_servicio[0]->prioridad + 1;\n \n if ($model->prioridad > $num) {\n Yii::$app->session->setFlash('error', 'Por favor la prioridad para el nuevo servicio debe ser :'.$num);\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n $model->estado=0;\n $model->save();\n Yii::$app->session->setFlash('success', 'El servicio se ha creado correctamente');\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n //\n $lregion = DB::table('mtl_region')->get();\n $lsubregion = DB::table('mtl_subregion')->get();\n return view('master.area.create', compact('lregion'), compact('lsubregion'));\n }", "public function create()\n {\n return view(\"tipoObra.create\");\n }", "public function create()\n {\n\t\t//return view('flota::vehiculos.create');\n\t\t$estatus = Estatus_activo::all()->lists('descripcion', 'activo');\n\t\t$status = Status::all()->lists('descripcion', 'status');\n\t\t$site = Plaza::distinct('Oficina')->orderby('Oficina')->lists('Oficina','Oficina');\n return view('flota::vehiculos.create', compact('flotam','estatus','status','site'));\n\n }", "public function create()\n {\n\n // $mes = \\Views::diccionario('idMes');\n $treunion = \\Views::diccionario('idTipoReunion');\n\n\n $a_data_page = array(\n 'title' => 'Registro de paginas',\n // 'mes' => $mes,\n 'treunion'=> $treunion\n );\n\n return \\Views::admin('reunion.create',$a_data_page);\n }", "function create () {\n \n $pagina = $this->loadTemplate(\"New City\", $this->script);\n \n $tmp = new Departament(); \n \n ob_start(); \n $departaments = $tmp->getDepartaments();\n include Route::getViewPath(\"cities\", \"new\");//'app/views/cities/new.php';\n $datos = ob_get_clean();\n $html = $datos; \n \n\t$pagina = $this->replaceContent('/\\#CONTENIDO\\#/ms' , $html, $pagina);\n \n\t$this->viewPage($pagina);\n }", "public function actionCreate()\n {\n $modelCompra = new Compra();\n\n $mensagem = \"\"; //Informa ao usuário mensagens de erro na view\n $produtosValorAlterado = [];\n\n $conta = new Conta();\n\n $compraProduto = new Compraproduto();\n\n $produtos = ArrayHelper::map(Produto::find()->\n where(['isInsumo' => 1])->orderBy('nome ASC')->all(),\n 'idProduto', 'nome');\n\n //Recebe o valor total da compra\n $valorTotalDaCompra = 0;\n\n $categorias = ArrayHelper::map(\n Categoria::find()->all(),\n 'idCategoria', 'nome');\n\n $novoProduto = new Produto();\n\n $arrayFinal = [];\n\n $arrayIds = [];\n //Setando valor padrão para a compra\n $modelCompra->valor = 0;\n\n //Setando tipo de conta padrão para a compra\n $modelCompra->tipoConta = 'contasapagar';\n\n //Setando situação de pagamento padrão para a compra\n $modelCompra->situacaoPagamento = 1;\n\n //Setando o fuso horário\n date_default_timezone_set('America/Recife');\n\n if ((Yii::$app->request->post())) {\n\n $conta->tipoConta = 'contasapagar';\n\n $conta->descricao = 'Compra de ' . date('d/m/Y', strtotime(Yii::$app->request->post()['Compra']['dataCompra']));\n\n $conta->situacaoPagamento = 1;\n\n $compraprodutos = Yii::$app->request->post()['Compraproduto'];\n\n $valorescompraprodutos = Yii::$app->request->post()['compraproduto-valorcompra-disp'];\n\n\n\n //Inicia a transação:\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n //Tenta salvar um registro :\n\n if ($conta->save(false)) {\n\n $itensInseridos = true;\n\n $modelContasAPagar = new Contasapagar();\n\n $modelContasAPagar->idconta = $conta->idconta;\n\n $arrayIdsProdutoVenda = [];\n\n $indice = 0;\n\n $modelCompra->idconta = $conta->idconta;\n\n $modelCompra->dataCompra = Yii::$app->request->post()['Compra']['dataCompra'];\n\n\n if ($modelContasAPagar->save(false) && $modelCompra->save()) {\n $compraprodutos = Yii::$app->request->post()['Compraproduto'];\n\n $valorescompraprodutos = Yii::$app->request->post()['compraproduto-valorcompra-disp'];\n\n\n for ($i = 0; $i < count($compraprodutos['idProduto']); $i++) {\n\n\n $cp = new Compraproduto();\n\n $cp->idCompra = $modelCompra->idconta;\n\n $cp->idProduto = $compraprodutos['idProduto'][$i];\n\n $cp->quantidade = $compraprodutos['quantidade'][$i];\n\n $cp->valorCompra = $valorescompraprodutos[$i];\n\n $produto = Produto::findOne($cp->idProduto);\n\n $produto->quantidadeEstoque += $cp->quantidade;\n\n $produto->save();\n\n if ($cp->comparaPrecoProduto($cp)) {\n\n $lp = $novoProduto->getListaInsumos($cp->idProduto);\n\n foreach ($lp as $key) {\n\n $produto = Yii::$app->db->createCommand('SELECT idProduto, nome FROM produto WHERE idProduto = :id ', ['id' => $key['idprodutoVenda']])->queryOne();\n\n array_push($produtosValorAlterado, $produto);\n }\n }\n\n for ($j = 0; $j < count($produtosValorAlterado); $j++) {\n array_push($arrayIds, $produtosValorAlterado[$j]['idProduto']);\n }\n\n\n\n if (!$cp->save(false)) {\n $mensagem = \"Não foi possível salvar os dados\";\n $transaction->rollBack(); //desfaz alterações no BD\n $itensInseridos = false;\n break; //encerra o laço for\n } else {\n $valorTotalDaCompra += floatval($cp->valorCompra);\n }\n\n }\n\n $arrayIds = array_unique($arrayIds);\n\n foreach ($arrayIds as $id) {\n $produto = Yii::$app->db->createCommand('SELECT idProduto, nome FROM produto WHERE idProduto = :id ', ['id' => $id])->queryOne();\n\n array_push($arrayFinal, $produto);\n\n }\n\n $modelCompra->valor = $valorTotalDaCompra;\n\n if (!$modelCompra->save(false)) {\n\n $mensagem = \"Não foi possível salvar os dados \";\n\n $transaction->rollBack(); //desfaz alterações no BD\n\n $itensInseridos = false;\n } else {\n $conta->valor = $modelCompra->valor;\n if (!$conta->save(false)) {\n\n $mensagem = \"Não foi possível salvar os dados \";\n\n $transaction->rollBack(); //desfaz alterações no BD\n\n $itensInseridos = false;\n }\n }\n\n\n if ($itensInseridos) {\n $transaction->commit();\n\n $compraProdutos = Compraproduto::find()->where(['idCompra' => $modelCompra->idconta])->all();\n\n\n return $this->render('view', [\n 'modelCompra' => $this->findModel($modelCompra->idconta),\n 'compraProdutos' => $compraProdutos,\n 'produtosValorAlterado' => $arrayFinal\n ]);\n }\n\n } else {\n $transaction->rollBack();\n $mensagem = \"Ocorreu uma falha inesperada ao tentar salvar \";\n }\n\n\n } else {\n $transaction->rollBack();\n $mensagem = \"Ocorreu uma falha inesperada ao tentar salvar \";\n }\n } catch (\\Exception $exception) {\n $transaction->rollBack();\n\n $mensagem = \"Ocorreu uma falha inesperada ao tentar salvar \";\n }\n\n\n }\n $modelCompra->dataCompra = date('Y-m-d');\n\n return $this->render('create', [\n 'modelCompra' => $modelCompra,\n 'compraProduto' => $compraProduto,\n 'produtos' => $produtos,\n 'mensagem' => $mensagem,\n 'categorias' => $categorias,\n 'novoProduto' => $novoProduto,\n ]);\n }", "public function create()\n {\n return View::make('admin.priority.create');\n }", "public function create()\r\n {\r\n $edos = estados::all();\r\n return view('municipios.crear')->with(['estados'=>$edos,'active'=>3,'subm'=>4, 'subm2'=>2]); }", "function insertarOrdenTrabajo(){\n\t\t$this->procedimiento='gem.ft_orden_trabajo_ime';\n\t\t$this->transaccion='GEM_GEOOTT_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_plan_ini','fecha_plan_ini','date');\n\t\t$this->setParametro('fecha_eje_ini','fecha_eje_ini','date');\n\t\t$this->setParametro('tiempo_estimado','tiempo_estimado','numeric');\n\t\t$this->setParametro('num_oit','num_oit','varchar');\n\t\t$this->setParametro('nota_tecnico_equipo','nota_tecnico_equipo','varchar');\n\t\t$this->setParametro('observacion','observacion','varchar');\n\t\t$this->setParametro('acumulado','acumulado','numeric');\n\t\t$this->setParametro('codigo_oit','codigo_oit','varchar');\n\t\t$this->setParametro('id_funcionario_asig','id_funcionario_asig','int4');\n\t\t$this->setParametro('id_unidad_medida','id_unidad_medida','int4');\n\t\t$this->setParametro('descripcion','descripcion','varchar');\n\t\t$this->setParametro('id_funcionario_sol','id_funcionario_sol','int4');\n\t\t$this->setParametro('ubicacion_tecnica','ubicacion_tecnica','varchar');\n\t\t$this->setParametro('fecha_eje_fin','fecha_eje_fin','date');\n\t\t$this->setParametro('id_uni_cons_mant_predef','id_uni_cons_mant_predef','int4');\n\t\t$this->setParametro('id_tipo_mant','id_tipo_mant','int4');\n\t\t$this->setParametro('nota_tecnico_loc','nota_tecnico_loc','varchar');\n\t\t$this->setParametro('id_uni_cons','id_uni_cons','int4');\n\t\t$this->setParametro('cat_estado','cat_estado','varchar');\n\t\t$this->setParametro('cat_prior','cat_prior','varchar');\n\t\t$this->setParametro('cat_tipo','cat_tipo','varchar');\n\t\t$this->setParametro('id_localizacion','id_localizacion','int4');\n\t\t$this->setParametro('descripcion_lugar','descripcion_lugar','varchar');\n\t\t$this->setParametro('id_centro_costo','id_centro_costo','int4');\n\t\t$this->setParametro('especialidades','especialidades','varchar');\n\t\t$this->setParametro('id_funcionario_aprob','id_funcionario_aprob','int4');\n\t\t$this->setParametro('id_funcionario_recib','id_funcionario_recib','int4');\n\t\t$this->setParametro('comentarios','comentarios','varchar');\n\t\t$this->setParametro('accidentes','accidentes','varchar');\n\t\t$this->setParametro('reclamos','reclamos','varchar');\n\t\t$this->setParametro('otros','otros','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function agregar() {\n HandlerSession()->check_session(USER_DOC);\n\n $cuatrimestreModelo = new CuatrimestreModel();\n $cuatrimestre = $cuatrimestreModelo->get(1);\n\n $n = 0;\n foreach ($_POST['alumno'] as $key) {\n $data = array(\n 'cuatrimestre' => $cuatrimestre[0]['id'],\n 'curso' => $_POST['curso'],\n 'alumno' => $key,\n 'estado' => $_POST['estado'][$key] == 'normal' ? '' : $_POST['estado'][$key]);\n if ($this->modelo->set($data) == 'creado')\n $n++;\n //print_r($data);\n }\n $this->vista->agregar($n);\n }", "public function create(){\n $tiposHabito=TipoHabito::get();\n return view('admin.preguntaHabito.create')->with('tiposHabito',$tiposHabito);\n }" ]
[ "0.6047909", "0.60175437", "0.59310234", "0.5835964", "0.58259857", "0.5771132", "0.576105", "0.5755868", "0.57168806", "0.5678474", "0.56456345", "0.5622408", "0.56019163", "0.55501765", "0.55470896", "0.55455333", "0.55407774", "0.5520116", "0.5511797", "0.5458313", "0.5450439", "0.54393154", "0.5423175", "0.54177153", "0.54136014", "0.5407768", "0.5389082", "0.5381934", "0.5377153", "0.5370059", "0.53667825", "0.53513795", "0.5347681", "0.5345829", "0.53439015", "0.5340059", "0.5325843", "0.532129", "0.5318879", "0.531447", "0.53063273", "0.53039795", "0.52974206", "0.52757627", "0.5275681", "0.5269904", "0.5269025", "0.52676594", "0.52618533", "0.5261094", "0.525598", "0.5250453", "0.5237918", "0.5237547", "0.52340025", "0.5229318", "0.5228192", "0.5225931", "0.52195287", "0.5217866", "0.5217089", "0.521693", "0.52103966", "0.520997", "0.52002347", "0.51989543", "0.51944697", "0.51931494", "0.5184483", "0.5184025", "0.5179006", "0.51693577", "0.5157824", "0.5157631", "0.5155665", "0.5155125", "0.5153495", "0.5152341", "0.515127", "0.51502484", "0.5146217", "0.5144913", "0.5143926", "0.5142915", "0.51418996", "0.51382416", "0.51342213", "0.51323944", "0.51301306", "0.51292604", "0.512743", "0.5125505", "0.5124809", "0.5120874", "0.51205957", "0.51150167", "0.5112288", "0.511115", "0.5110974", "0.5109409" ]
0.72627914
0
/ params: $rel_path path of the image, relative to the site's root returns: associative array containing the keys: "color": html hex representation of the mean color "brightness" 0255 integer representation of the image's mean brightness basically it works like this: resample the image to a size of 1x1 pixel, so that the resizing algorithm averages the color for us. Then, read the color of that single pixel.
/ params: $rel_path путь изображения, относительно корня сайта, возвращает: ассоциативный массив, содержащий ключи: "color": html-представление в формате шестнадцатеричного кода среднего цвета "brightness" 0255 целочисленное представление средней яркости изображения в основном это работает так: пересэмплируйте изображение до размера 1x1 пиксель, чтобы алгоритм изменения размера усреднял цвет для нас. Затем прочтите цвет этого одного пикселя.
function imageMeanColor($rel_path) { global $docroot; $impath = $docroot . $rel_path; $image = imageCreateFromAny($impath); list($width, $height) = getimagesize($impath); $tmp_img = ImageCreateTrueColor(1,1); ImageCopyResampled($tmp_img,$image,0,0,0,0,1,1,$width,$height); $rgb = ImageColorAt($tmp_img,0,0); $red = ($rgb >> 16) & 0xFF; $green = ($rgb >> 8) & 0xFF; $blue = $rgb & 0xFF; $ret = array(); $ret["color"] = "#" . dechex($red) . dechex($green) . dechex($blue); $ret["brightness"] = brightness($red, $green, $blue); return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _get_image_color($im, $r, $g, $b) {\n\n $c = imagecolorexact($im, $r, $g, $b);\n\n if ($c != -1)\n return $c;\n\n $c = imagecolorallocate($im, $r, $g, $b);\n\n if ($c != -1)\n return $c;\n\n return imagecolorclosest($im, $r, $g, $b);\n }", "function fusion_get_brightness( $color ) {\n\t$color_obj = Fusion_Color::new_color( $color );\n\t// Returns brightness value from 0 to 255.\n\treturn intval( ( ( $color_obj->red * 299 ) + ( $color_obj->green * 587 ) + ( $color_obj->blue * 114 ) ) / 1000 );\n}", "function _get_image_color($im, $r, $g, $b) {\n\t\t$c=imagecolorexact($im, $r, $g, $b);\n\t\tif ($c!=-1) return $c;\n\t\t$c=imagecolorallocate($im, $r, $g, $b);\n\t\tif ($c!=-1) return $c;\n\t\treturn imagecolorclosest($im, $r, $g, $b);\n\t}", "public static function average_color($image_url){\n\n\t\t$mime = image_type_to_mime_type( exif_imagetype ( $image_url ) );\n\n\t\t//Get image based on mime and set to $im\n\t\tswitch($mime){\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$im = imagecreatefromjpeg($image_url);\n\t\t\tbreak;\n\t\t\n\t\t\tcase 'image/gif':\n\t\t\t\t$im\t= imagecreatefromgif($image_url);\n\t\t\tbreak;\n\t\t\n\t\t\tcase 'image/png':\n\t\t\t\t$im\t= imagecreatefrompng($image_url);\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'image/wbmp':\n\t\t\t\t$im\t= imagecreatefromwbmp($image_url);\n\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(\"An image of '$mime' mime type is not supported.\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t//Begin getting average\n\t\t$width\t= imagesx($im);\n\t\t$height\t= imagesy($im);\n\t\t\n\t\t$total = $r = $g = $b = $a = 0;\n\t\t\n\t\tfor($x = 0; $x < $width; $x++){\n\t\t for($y = 0; $y < $height; $y++){\n\t\t\t\t\n\t\t\t\t//get rgba array at index\n\t\t \t$index\t= imagecolorat($im, $x, $y);\n\t\t\t\t$rgba\t= imagecolorsforindex($im, $index);\n\t\t\t\t\n\t\t\t\t//add total for each color\n\t\t\t\t$r += $rgba['red'];\n\t\t\t\t$g += $rgba['green'];\n\t\t\t\t$b += $rgba['blue'];\n\t\t\t\t//$a += $rgba['alpha'];\n\t\t\t\t$total++;\n\t\t\t\t\n\t\t\t\tunset($index);\n\t\t\t\tunset($rgba);\n\t\t }// end for $y\n\t\t}// end for $x\n\t\t\n\t\tunset($im);\n\t\t\n\t\t$avg = array(\n\t\t\t\t\t'red'\t=> round($r / $total),\n\t\t\t\t\t'green'\t=> round($g / $total),\n\t\t\t\t\t'blue'\t=> round($b / $total),\n\t\t\t\t\t//'alpha'\t=> round($a / $total),\n\t\t\t\t);\n\n\t\t$avg = new Rgba($avg['red'], $avg['green'], $avg['blue']);\n\t\t\n\t\tunset($r); unset($g); unset($b); unset($a);\n\n\t\t// return (array)$avg;\n\t\treturn $avg;\n\t}", "function imagecolorresolve($image, $red, $green, $blue)\n{\n return 0;\n}", "function imagecolorresolve($image,$red,$green,$blue)\n{\n\treturn 0;\n}", "public function getImageRedPrimary () {}", "public function getImageMatteColor () {}", "function colorPalette($imageFile, $granularity = 5)\n{\n $granularity = max(1, abs((int)$granularity));\n $colorArray = array();\n $imageSize = @getimagesize($imageFile); // for more information about \"getimagesize\" see: https://www.geeksforgeeks.org/php-imagecolorsforindex-function/\n if($imageSize === false)\n {\n user_error(\"Unable to get image size data\");\n return false;\n }\n\n if ($imageSize[2]==1)\n $img = @imagecreatefromgif($imageFile); // for more information about \"imagecreatefromgif\" see: http://www.phptutorial.info/?imagecreatefromgif\n if ($imageSize[2]==2)\n $img = @imagecreatefromjpeg($imageFile);// for more information about \"imagecreatefromjpeg\" see: https://www.php.net/manual/de/function.imagecreatefromjpeg.php\n if ($imageSize[2]==3)\n $img = @imagecreatefrompng($imageFile);// for more information about \"imagecreatefrompng\" see: https://www.php.net/manual/de/function.imagecreatefrompng.php\n if(!$img)\n {\n user_error(\"Unable to open image file\");\n return false;\n }\n //filling the array with the amount of appearance of each color of the image file\n for($x = 0; $x < $imageSize[0]; $x += $granularity)\n {\n for($y = 0; $y < $imageSize[1]; $y += $granularity)\n {\n $thisColor = imagecolorat($img, $x, $y);// for more information about \"imagecolorat\" see: https://www.php.net/manual/de/function.imagecolorat.php\n $rgb = imagecolorsforindex($img, $thisColor);// for more information about \"imagecolorsforindex\" see: https://www.php.net/manual/de/function.imagecolorsforindex.php\n $red = round(round(($rgb['red'] / 0x33)) * 0x33);\n $green = round(round(($rgb['green'] / 0x33)) * 0x33);\n $blue = round(round(($rgb['blue'] / 0x33)) * 0x33);\n $thisRGB = sprintf('%02X%02X%02X', $red, $green, $blue);\n if(array_key_exists($thisRGB, $colorArray))\n {\n $colorArray[$thisRGB]++;\n }\n else\n {\n $colorArray[$thisRGB] = 1;\n }\n }\n }\n arsort($colorArray);\n return $colorArray;\n}", "function get_average_pixel($im,$average_type) {\n\t$width = imagesx($im);\n\t$height = imagesy($im);\n\tswitch($average_type) {\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\t\t$r = $g = $b = array();\n\t\t\tfor($i=0;$i<$width;$i++) {\n\t\t\t\tfor($j=0;$j<$height;$j++) {\n\t\t\t\t\t$rgb = rgb(imagecolorat($im, $i, $j));\n\t\t\t\t\t$r[] = $rgb[0];\n\t\t\t\t\t$g[] = $rgb[1];\n\t\t\t\t\t$b[] = $rgb[2];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn array(px_avg($r,$average_type),px_avg($g,$average_type),px_avg($b,$average_type));\n\t\tcase 5:\n\t\t\t$onepx = imagecreatetruecolor(1,1);\n\t\t\timagecopyresampled($onepx,$im,0,0,0,0,1,1,$width,$height);\n\t\t\t$rgb = imagecolorat($onepx,0,0);\n\t\t\timagedestroy($onepx);\n\t\t\treturn rgb($rgb);\n\t\tcase 6:\n\t\t\t$onepx = imagecreatetruecolor(1,1);\n\t\t\timagecopyresized($onepx,$im,0,0,0,0,1,1,$width,$height);\n\t\t\t$rgb = imagecolorat($onepx,0,0);\n\t\t\timagedestroy($onepx);\n\t\t\treturn rgb($rgb);\n\t}\n}", "public function getImageGreenPrimary () {}", "public function getImageColors () {}", "function colorByHash($hash, $lumCap=0.82){\n\n\n $f = 255; //luminance scale factor\n\n mt_srand(crc32($hash));\n\n $r = mt_rand(0,255)/255;\n $g = mt_rand(0,255)/255;\n $b = mt_rand(0,255)/255;\n\n $luminance = 0.2126*$r + 0.7152*$g + 0.0722*$b;\n\n //reducing by same percentage of lumCap (darker colors)\n if($luminance>$lumCap)\n $f=$lumCap*255;\n\n $r*=$f;\n $g*=$f;\n $b*=$f;\n\n return sprintf('#%02X%02X%02X', $r,$g,$b);\n}", "function imagecolorsforindex($image, $color)\n{\n return array();\n}", "private function getColor( $_color, $_step )\r\n {\r\n\t\treturn imagecolorallocate($this->image, $_color[0]+$_step, $_color[1]+$_step, $_color[2]+$_step);\r\n\t}", "public function brightness( $step )\n\t\t{\n\t\t\tif( ! is_numeric($step) ){\n\t\t\t\t$this->errors[] = 'Step must be a number';\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$rgb = $this->exploded_colour; //ff,00,00\n\t\t\t$rgb = $this->hexdecArr($rgb); //255,0,0\n\n\t\t\t$hsl = $this->rgbhsl($rgb);\n\n\t\t\t$hsl['l'] = $hsl['l'] * ($step / 100);\n\n\t\t\t$rgb = $this->hslrgb($hsl);\n\n\t\t\t$rgb = $this->dechexArr($rgb);\n\n\t\t\t$rgb = $this->implodeHex($rgb);\n\n\t\t\treturn $rgb;\n\t\t}", "public function getDominantColors($image){\r\n\t\tif( file_exists($image) ){\r\n\t\t\t$size = getimagesize($image);\r\n\t\t\t\r\n\t\t\t$scale=1;\r\n\t\t\tif( $size[0] > 0 ){\r\n\t\t\t\t$scale = min(150 / $size[0], 150 / $size[1]);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif( $scale < 1 ){\r\n\t\t\t\t$width = floor($scale * $size[0]);\r\n\t\t\t\t$height = floor($scale * $size[1]);\r\n\t\t\t}\telse {\r\n\t\t\t\t$width = $size[0];\r\n\t\t\t\t$height = $size[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$resizedImage = imagecreatetruecolor($width, $height);\r\n\t\t\t\r\n\t\t\tswitch( $size[2] ){\r\n\t\t\t\tcase IMAGETYPE_GIF:\r\n\t\t\t\t\t$originalImage = imagecreatefromgif($image);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase IMAGETYPE_JPEG:\r\n\t\t\t\t\t$originalImage = imagecreatefromjpeg($image);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase IMAGETYPE_PNG:\r\n\t\t\t\t\t$originalImage = imagecreatefrompng($image);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\timagecopyresized($resizedImage, $originalImage, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\r\n\t\t\t\r\n\t\t\t$hexArray = array();\r\n\t\t\tfor( $y=0; $y < imagesy($resizedImage); $y++ ){\r\n\t\t\t\tfor( $x=0; $x < imagesx($resizedImage); $x++ ){\r\n\t\t\t\t\t$index = imagecolorat($resizedImage, $x, $y);\r\n\t\t\t\t\t$colors = imagecolorsforindex($resizedImage, $index);\r\n\t\t\t\t\t$colors['red' ] = intval((($colors['red']) + 15) / 32) * 32;\r\n\t\t\t\t\t$colors['green'] = intval((($colors['green']) + 15) / 32) * 32;\r\n\t\t\t\t\t$colors['blue'] = intval((($colors['blue']) + 15) / 32) * 32;\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach( array('red', 'green', 'blue') as $colorName ){\r\n\t\t\t\t\t\tif( $colors[$colorName] >= 256 ){\r\n\t\t\t\t\t\t\t$colors[$colorName] = 240;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$hexArray[] = substr('0'.dechex($colors['red']), -2).substr('0'.dechex($colors['green']), -2).substr('0'.dechex($colors['blue']), -2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$hexArray = array_count_values($hexArray);\r\n\t\t\tnatsort($hexArray);\r\n\t\t\t$hexArray = array_reverse($hexArray, true);\r\n\t\t\t\r\n\t\t\treturn $hexArray;\r\n\t\t} else {\r\n\t\t\t$this->throwModuleException(__FUNCTION__.': io-error, file not found');\r\n\t\t}\r\n\t}", "function imagecolorsforindex($image,$color)\n{\n\treturn array();\n}", "function luminosity() {\n\t\treturn ($this->r*0.6+$this->g+$this->b*0.3)/1.9;\n\t}", "function ImageColorBrightness(\\raylib\\Image &$image, int $brightness): void { }", "function imagecolorstotal($image)\n{\n return 0;\n}", "public function modulateImage ($brightness, $saturation, $hue) {}", "public function imageRead();", "function kleo_calc_perceived_brightness($color, $compare = false) \n\t{\n\t\t$rgba = kleo_hex_to_rgb($color);\n\t\n\t\t$brighntess = sqrt(\n\t $rgba['r'] * $rgba['r'] * 0.241 + \n\t $rgba['g'] * $rgba['g'] * 0.691 + \n\t $rgba['b'] * $rgba['b'] * 0.068);\n\t \n\t\tif($compare)\n\t\t{\n\t\t\t$brighntess = $brighntess < $compare ? true : false;\n\t\t}\n\n\t\treturn $brighntess;\n\t}", "function imagecolorclosest($image,$red,$green,$blue)\n{\n\treturn 0;\n}", "function imagecolorclosesthwb($image,$red,$green,$blue)\n{\n\treturn 0;\n}", "function imagecolorclosest($image, $red, $green, $blue)\n{\n return 0;\n}", "function get_colors($image, $pixel_skip = 1)\n{\n $colors_arr = [];\n\n // took this method for php.net\n $size = getimagesize($image);\n $width = $size[0];\n $height = $size[1];\n\n // took this code from php.net i wanted to know how to support all the files\n $image = imagecreatefromstring(file_get_contents($image));\n \n for ($x = 0; $x < $size[0]; $x += $pixel_skip) {\n\n for ($y = 0; $y < $size[1]; $y += $pixel_skip) {\n\n // learned this two methods from php.net\n $pixel_color = imagecolorat($image, $x, $y);\n $index_of_color = imagecolorsforindex($image, $pixel_color);\n\n $color_value_hexa = convert_rgb($index_of_color);\n\n // i'm checking that the hex color is in the the arr since we defined it as a key we use the array_key_exists\n if (array_key_exists($color_value_hexa, $colors_arr)) {\n $colors_arr[$color_value_hexa]++;\n } else {\n $colors_arr[$color_value_hexa] = 1;\n }\n }\n }\n arsort($colors_arr);\n return $colors_arr;\n}", "public function imageColor($image,$num_results = 10, $reduce_brightness = true, $reduce_gradients = true, $delta = 10 )\r\n {\r\n\r\n $getmostcommoncolors = new GetMostCommonColors();\r\n $colors = $getmostcommoncolors->Get_Color($image, $num_results, $reduce_brightness, $reduce_gradients, $delta);\r\n $keys = array_keys($colors);\r\n\r\n return $keys;\r\n }", "public function getBrightnessCalc($color) {\n $rgb = $this->getRGBArray($color);\n return (($rgb['r'] * 299) + ($rgb['g'] * 587) + ($rgb['b'] * 114)) / 1000;\n }", "function imagecolorclosesthwb($image, $red, $green, $blue)\n{\n return 0;\n}", "function get_color($temp,$saturation,$brightness)\n{\n\n\t// Calculate the color Hue\n\t// based on ocean temp\n\t// \n\t// Range = 32 (low) -> 78 (high)\n\t// 46 color values\n\t// 78 should be 1 (red)\n\t// 32 should be 270 (blue)\n\t\n\t$temp_mod = 49 - ($temp - 32);\n\t$hue = round((270 * $temp_mod)/49);\n\tif ($hue <= 0) $hue = 1;\n\t//$saturation = .75;\n\t// Set brightness to 100%\n\t//$brightness = .75;\n\t\n\t// echo \"Hue:\" . $hue . \"<br>\";\n\t\n\t// Calculate the HEX color\n\t$hex = hsv2hex ($hue, $saturation, $brightness);\n\n\treturn $hex;\n\n}", "function luminance_generate_attachment_metadata( $attachment_metadata ) {\n\n\t/*Get thumbnail */\n\t$file = wp_upload_dir();\n\t$file = trailingslashit( $file['path'] ).$attachment_metadata['sizes']['thumbnail']['file'];\n\n\t/* Resample it to 1x1px*/\n\tlist( $orig_w, $orig_h, $orig_type ) = @getimagesize( $file );\n\t$img = imagecreatefromstring( file_get_contents( $file ) );\n\t$tmp_img = imagecreatetruecolor( 1, 1 );\n\timagecopyresampled( $tmp_img, $img, 0, 0, 0, 0, 1, 1, $orig_w, $orig_h ); // or ImageCopyResized\n\n\n\t/*Get the color */\n\t$rgb = imagecolorat( $tmp_img, 0, 0 );\n\t$r = ( $rgb >> 16 ) & 0xFF;\n\t$g = ( $rgb >> 8 ) & 0xFF;\n\t$b = $rgb & 0xFF;\n\n\n\t/*Calculate Color Hex*/\n\t$attachment_metadata['image_meta']['median_color'] = \"#\".dechex( $r ).dechex( $g ).dechex( $b );\n\t/*Calculate luminance*/\n\t$attachment_metadata['image_meta']['luminance'] = ( 0.2126*$r ) + ( 0.7152*$g ) + ( 0.0722*$b );\n\treturn $attachment_metadata;\n}", "function colorPalette($imageFile, $numColors= 6, $granularity = 5) { \n $granularity = max(1, abs((int)$granularity)); \n $colors = array(); \n $size = @getimagesize($imageFile); \n if($size === false) { \n user_error(\"Unable to get image size data\"); \n return false; \n }\n $imgData = file_get_contents($imageFile);\n $img = @imagecreatefromstring($imgData);\n unset($imgData);\n if(!$img) { \n user_error(\"Unable to open image file\"); \n return false; \n } \n for($x = 0; $x < $size[0]; $x += $granularity) { \n for($y = 0; $y < $size[1]; $y += $granularity) { \n $thisColor = imagecolorat($img, $x, $y); \n $rgb = imagecolorsforindex($img, $thisColor); \n $red = round(round(($rgb['red'] / 0x33)) * 0x33); \n $green = round(round(($rgb['green'] / 0x33)) * 0x33); \n $blue = round(round(($rgb['blue'] / 0x33)) * 0x33); \n $thisRGB = sprintf('%02X%02X%02X', $red, $green, $blue); \n if(array_key_exists($thisRGB, $colors)) { \n $colors[$thisRGB]++; \n } else { \n $colors[$thisRGB] = 1; \n } \n } \n } \n arsort($colors); \n return array_slice(array_keys($colors), 0, $numColors); \n}", "public function colorMeanValue($i)\n\t{\n\t\t$colorList = array();\n\t\t$colorSum = 0;\n\t\tfor($a = 0;$a<8;$a++)\n\t\t{\n\t\t\n\t\t\tfor($b = 0;$b<8;$b++)\n\t\t\t{\n\t\t\t\n\t\t\t\t$rgb = imagecolorat($i, $a, $b);\n\t\t\t\t$colorList[] = $rgb & 0xFF;\n\t\t\t\t$colorSum += $rgb & 0xFF;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn array($colorSum/64,$colorList);\n\t}", "function getGd($image) {\n\t\tif ($image instanceof ImageResource) {\n\t\t\t$image=$image->getResource();\n\t\t}\n\t\treturn imagecolorallocatealpha($image, $this->r*255, $this->g*255, $this->b*255, (1-$this->a)*127 );\n\t}", "function genesis_sample_color_contrast( $color ) {\n\n\t$hexcolor = str_replace( '#', '', $color );\n\t$red = hexdec( substr( $hexcolor, 0, 2 ) );\n\t$green = hexdec( substr( $hexcolor, 2, 2 ) );\n\t$blue = hexdec( substr( $hexcolor, 4, 2 ) );\n\n\t$luminosity = ( ( $red * 0.2126 ) + ( $green * 0.7152 ) + ( $blue * 0.0722 ) );\n\n\treturn ( $luminosity > 128 ) ? '#333333' : '#ffffff';\n\n}", "function biurnal_hsb_to_rgb($color) {\n list($n_hue, $n_saturation, $n_brightness) = $color;\n\n // Scale the brightness from a range of 0.0 thru 1.0\n // to a range of 0.0 thru 255.0\n // Then truncate to integer.\n // Store it into a local variable, so we don't affect\n // the value back in the caller.\n $n_brightness2 = round(min($n_brightness * 256.0, 255.0));\n\n if ($n_saturation == 0.0) {\n // Grayscale because there is no saturation\n $n_red = $n_brightness2;\n $n_green = $n_brightness2;\n $n_blue = $n_brightness2;\n }\n else {\n // Make hue angle be within a single rotation.\n // If the hue is > 1.0 or < 0.0, then it has\n // \"gone around the color wheel\" too many times.\n // For example, a value of 1.2 means that it has\n // gone around the wheel 1.2 times, which is really\n // the same ending angle as 0.2 trips around the wheel.\n // Scale it back into the 0.0 to 1.0 range.\n $n_hue2 = $n_hue;\n if ($n_hue2 > 1.0) {\n $n_hue2 = $n_hue2 - round($n_hue2);\n }\n elseif ( $n_hue2 < 0.0 ) {\n $n_hue2 = abs($n_hue2);\n if ($n_hue2 > 1.0) {\n $n_hue2 = $n_hue2 - round($n_hue2);\n }\n $n_hue2 = 1.0 - $n_hue2;\n }\n\n // Rescale hue to a range of 0.0 to 6.0.\n $n_hue2 = $n_hue2 * 6.0;\n\n // Separate hue into int and fractional parts\n $i_hue = round($n_hue2);\n $f_hue = $n_hue2 - $i_hue;\n\n // If Hue is even\n if ($i_hue % 2 == 0) {\n $f_hue = 1.0 - $f_hue;\n }\n\n $m = $n_brightness2 * (1.0 - $n_saturation);\n $n = $n_brightness2 * (1.0 - ($n_saturation * $f_hue));\n\n switch ($i_hue) {\n case 1:\n $n_red = $n;\n $n_green = $n_brightness2;\n $n_blue = $m;\n break;\n case 2:\n $n_red = $m;\n $n_green = $n_brightness2;\n $n_blue = $n;\n break;\n case 3:\n $n_red = $m;\n $n_green = $n;\n $n_blue = $n_brightness2;\n break;\n case 4:\n $n_red = $n;\n $n_green = $m;\n $n_blue = $n_brightness2;\n break;\n case 5:\n $n_red = $n_brightness2;\n $n_green = $m;\n $n_blue = $n;\n break;\n default:\n $n_red = $n_brightness2;\n $n_green = $n;\n $n_blue = $m;\n break;\n }\n }\n\n return array($n_red, $n_green, $n_blue);\n}", "function imagecolorstotal($image)\n{\n\treturn 0;\n}", "public function getRGB()\n {\n return $this->value->rgb;\n }", "private function color($value){ \n $rgb = $this->hex2rgb($value); \n return ImageColorAllocate($this->image, $rgb['r'], $rgb['g'], $rgb['b']); \n }", "function shoestrap_get_brightness( $hex ) {\n // returns brightness value from 0 to 255\n // strip off any leading #\n $hex = str_replace( '#', '', $hex );\n \n $c_r = hexdec( substr( $hex, 0, 2 ) );\n $c_g = hexdec( substr( $hex, 2, 2 ) );\n $c_b = hexdec( substr( $hex, 4, 2 ) );\n \n return ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000;\n}", "public function getBrightness(): float\n {\n return (($this->colors['r'] * 299) + ($this->colors['g'] * 587) + ($this->colors['b'] * 114)) / 1000;\n }", "function mulamula_get_avg_luminance($filename, $num_samples=10) {\n $img = imagecreatefromjpeg($filename);\n\n $width = imagesx($img);\n $height = imagesy($img);\n\n $x_step = intval($width/$num_samples);\n $y_step = intval($height/$num_samples);\n\n $total_lum = 0;\n\n $sample_no = 1;\n\n for ($x=0; $x<$width; $x+=$x_step) {\n for ($y=0; $y<$height; $y+=$y_step) {\n\n $rgb = imagecolorat($img, $x, $y);\n $r = ($rgb >> 16) & 0xFF;\n $g = ($rgb >> 8) & 0xFF;\n $b = $rgb & 0xFF;\n\n // choose a simple luminance formula from here\n // http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color\n $lum = ($r+$r+$b+$g+$g+$g)/6;\n\n $total_lum += $lum;\n\n // debugging code\n // echo \"$sample_no - XY: $x,$y = $r, $g, $b = $lum<br />\";\n $sample_no++;\n }\n }\n\n // work out the average\n $avg_lum = $total_lum/$sample_no;\n\n return $avg_lum;\n}", "public function getImageGamma () {}", "function rgb_to_hsl( $rgb ){\n\t\n\t\n\t\t$clrR = $rgb['red'];\n\t\t$clrG = $rgb['green'];\n\t\t$clrB = $rgb['blue'];\n\t\t\n\t\t$clrMin = min($clrR, $clrG, $clrB);\n\t\t$clrMax = max($clrR, $clrG, $clrB);\n\t\t$deltaMax = $clrMax - $clrMin;\n\t\t\n\t\t$L = ($clrMax + $clrMin) / 510;\n\n\t\tif (0 == $deltaMax){\n\t\t\t$H = 0;\n\t\t\t$S = 0;\n\t\t}else{\n\t\t\tif (0.5 > $L)\n\t\t\t $S = $deltaMax / ($clrMax + $clrMin);\t\n\t\t\telse\n\t\t\t $S = $deltaMax / (510 - $clrMax - $clrMin);\n\t\t\t\n\t\t\tif ($clrMax == $clrR)\n\t\t\t $H = ($clrG - $clrB) / (6.0 * $deltaMax);\n\t\t\telseif ($clrMax == $clrG)\n\t\t\t $H = 1/3 + ($clrB - $clrR) / (6.0 * $deltaMax);\n\t\t\telse\n\t\t\t $H = 2 / 3 + ($clrR - $clrG) / (6.0 * $deltaMax);\n\n\t\t\tif (0 > $H) $H += 1;\n\t\t\tif (1 < $H) $H -= 1;\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn array( 'hue' => $H, 'saturation' => $S, 'lightness' => $L );\n\t}", "public function find_histogram($image_url){\n\t$photo = imagecreatefrompng($image_url);\n\t# create array (may be Histogram)\n\t$histogram = array();\n\t# we have to initialize the histogram to all ZERO\n\tfor($i = 0 ; $i< 256; $i++){\n\t\t$histogram[$i] = 0 ;\n\t}\n\t# get the size of gray scale image \n\t# we need to know how many time we should loop\n\tlist($width, $height, $type, $attr) = getimagesize($image_url);\n\tfor($i = 0 ; $i<$width ; $i++){\n\t\tfor($j = 0; $j<$height; $j++){\n\t\t\t# find the pixel value\n\t\t\t# may be between 0 to 255 \n\t\t\t$gray_value = imagecolorat($photo, $i, $j);\n\t\t\t$gray_decimal = ($gray_value >> 16) & 0xFF;\n\t\t\t$histogram[$gray_decimal]++;\n\t\t}\n\t}\n\treturn $histogram;\n}", "function biurnal_rgb_to_hsb($color) {\n list($n_red, $n_green, $n_blue) = $color;\n $n_min = min($n_red, $n_green, $n_blue);\n $n_max = max($n_red, $n_green, $n_blue);\n\n if ($n_min == $n_max) {\n // Grayscale\n $n_hue = 0.0;\n $n_saturation = 0.0;\n $n_brightness = $n_max;\n }\n else {\n if ($n_red == $n_min) {\n $d = $n_green - $n_blue;\n $h = 3.0;\n }\n elseif ($n_green == $n_min) {\n $d = $n_blue - $n_red;\n $h = 5.0;\n }\n else {\n $d = $n_red - $n_green;\n $h = 1.0;\n }\n\n $n_hue = ($h - ($d / ($n_max - $n_min))) / 6.0;\n $n_saturation = ($n_max - $n_min) / $n_max;\n $n_brightness = $n_max / 255.0;\n }\n\n return array($n_hue, $n_saturation, $n_brightness);\n}", "public static function rgb2hsl($rgb){\n\t\t\tif( (!is_array($rgb)) || (!isset($rgb['red'])) || (!isset($rgb['green'])) || (!isset($rgb['blue']))) { \n\t\t\t\treturn array('hue' => 0, 'saturation' => 0, 'lightness' => 0);\n\t\t\t}\n\t\t\t$var_R=($rgb['red']/255);\n\t\t\t$var_G=($rgb['green']/255);\n\t\t\t$var_B=($rgb['blue']/255);\n\t\t\t$var_Min=min($var_R,$var_G,$var_B);\n\t\t\t$var_Max=max($var_R,$var_G,$var_B);\n\t\t\t$del_Max=$var_Max-$var_Min;\n\t\t\t$l=($var_Max+$var_Min)/2;\n\t\t\tif ($del_Max==0) {\n\t\t\t\t$h=0;\n\t\t\t\t$s=0;\n\t\t\t}else{\n\t\t\t\tif ($l<0.5){\n\t\t\t\t\t$s=$del_Max/($var_Max+$var_Min);\n\t\t\t\t}else{\n\t\t\t\t\t$s=$del_Max/(2-$var_Max-$var_Min);\n\t\t\t\t}\n\t\t\t\t$del_R=((($var_Max-$var_R)/6)+($del_Max/2))/$del_Max;\n\t\t\t\t$del_G=((($var_Max-$var_G)/6)+($del_Max/2))/$del_Max;\n\t\t\t\t$del_B=((($var_Max-$var_B)/6)+($del_Max/2))/$del_Max;\n\n\t\t\t\tif ($var_R==$var_Max){\n\t\t\t\t\t$h=$del_B-$del_G;\n\t\t\t\t}elseif ($var_G==$var_Max){\n\t\t\t\t\t$h=(1/3)+$del_R-$del_B;\n\t\t\t\t}elseif ($var_B==$var_Max){\n\t\t\t\t\t$h=(2/3)+$del_G-$del_R;\n\t\t\t\t}\n\t\t\t\tif ($h<0){\n\t\t\t\t\t$h+=1;\n\t\t\t\t}\n\t\t\t\tif ($h>1){\n\t\t\t\t\t$h-=1;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn array('hue' => $h, 'saturation' => $s, 'lightness' => $l); //each component between 0..1\n\t\t}", "function imageistruecolor($image)\n{\n}", "public function getAverageColor() {\n $im = $this->_getImage();\n $width = imagesx($im);\n $height = imagesy($im);\n $ret = 0;\n $total_points = $width*$height;\n for ($i=0; $i<$width; $i++) {\n for ($j=0; $j<$height; $j++) {\n $ret += imagecolorat($im, $i, $j)/$total_points;\n }\n }\n return $ret;\n }", "public function getImageBluePrimary () {}", "function fusion_adjust_brightness( $color, $steps ) {\n\t\t$color_obj = Fusion_Color::new_color( $color );\n\t\t$lightness = absint( round( $color_obj->lightness + ( $steps / 2.55 ) ) );\n\t\t$lightness = max( 0, min( $lightness, 100 ) );\n\t\treturn $color_obj->get_new( 'lightness', $lightness )->to_css( $color_obj->mode );\n\t}", "function color2RGB($color)\n {\n if (is_array($color)) {\n if (!is_numeric($color[0])) {\n return null; // error\n }\n if (count($color) == 3) { // assume RGB-color\n\n // 255 = alpha-value; full opaque\n return array((int) $color[0],\n (int) $color[1],\n (int) $color[2],\n 255);\n }\n if (count($color) == 4) { // assume RGBA-color\n\n // 255 = alpha-value; full opaque\n return array((int) $color[0],\n (int) $color[1],\n (int) $color[2],\n (int) $color[3]);\n }\n return null; // error\n } elseif (is_string($color)) {\n $alphaPos = strpos($color, '@');\n if ($alphaPos === false) {\n $alpha = 255;\n } else {\n $alphaFloat = (float) substr($color, $alphaPos+1);\n // restrict to range 0..1\n $alphaFloat = max(min($alphaFloat, 1), 0);\n $alpha = (int) round((float) 255 * $alphaFloat);\n $color = substr($color, 0, $alphaPos);\n }\n if ($color[0] == '#') { // hex-color given, e.g. #FFB4B4\n $tempColor = parent::hex2rgb($color);\n return array((int) $tempColor[0],\n (int) $tempColor[1],\n (int) $tempColor[2],\n $alpha);\n }\n if (strpos($color,'%') !== false) {\n $tempColor = parent::percentageColor2RGB($color);\n return array((int) $tempColor[0],\n (int) $tempColor[1],\n (int) $tempColor[2],\n $alpha);\n } else {\n $tempColor = parent::namedColor2RGB($color);\n return array((int) $tempColor[0],\n (int) $tempColor[1],\n (int) $tempColor[2],\n $alpha);\n }\n } else {\n return null; // error\n }\n }", "function load_color ($value) {\n\n global $conf;\n\n $scaled_load = $value / $conf['load_scale'];\n if ($scaled_load>1.00) {\n $color = $conf['load_colors'][\"100+\"];\n }\n else if ($scaled_load>=0.75) {\n $color = $conf['load_colors'][\"75-100\"];\n }\n else if ($scaled_load >= 0.50) {\n $color = $conf['load_colors'][\"50-75\"];\n }\n else if ($scaled_load>=0.25) {\n $color = $conf['load_colors'][\"25-50\"];\n }\n else if ($scaled_load < 0.0)\n $color = $conf['load_colors'][\"down\"];\n else {\n $color = $conf['load_colors'][\"0-25\"];\n }\n\n return $color;\n}", "public function rgb($color, $brightness = 0) \n {\n //If the color was specified as an hex value pass it as is to mix.\n return self::mix(strpos($color, '#') === 0 ? $color : $this->colors[$color], (100 - abs($brightness)) / 100, $brightness > 0 ? 255 : 0, 'rgb');\n }", "public function getImageColorspace () {}", "function quadro_get_brightness($hex) {\n\t// Strip off any leading #\n\t$hex = str_replace('#', '', $hex);\n\n\t$c_r = hexdec(substr($hex, 0, 2));\n\t$c_g = hexdec(substr($hex, 2, 2));\n\t$c_b = hexdec(substr($hex, 4, 2));\n\n\treturn (($c_r * 299) + ($c_g * 587) + ($c_b * 114)) / 1000;\n}", "function Extract($srcImage, $count = 10, $reduceBrightness = true, $reduceGradients = true, $delta = 16, $niceNumbers = false) {\n // Make sure the image can be opened, then scale it down as we only want the colors that are more prevalaent.\n if (is_readable($srcImage)) {\n if ($delta > 2) {\n $halfOfDelta = $delta / 2 - 1;\n } else {\n $halfOfDelta = 0;\n }\n $size = GetImageSize($srcImage);\n $scale = 1;\n if ($size[0] > 0)\n $scale = min($this->SampleWidth / $size[0], $this->SampleHeight / $size[1]);\n if ($scale < 1) {\n $width = floor($scale * $size[0]);\n $height = floor($scale * $size[1]);\n } else {\n $width = $size[0];\n $height = $size[1];\n }\n $image_resized = imagecreatetruecolor($width, $height);\n if ($size[2] == 1)\n $image_orig = imagecreatefromgif($srcImage);\n if ($size[2] == 2)\n $image_orig = imagecreatefromjpeg($srcImage);\n if ($size[2] == 3)\n $image_orig = imagecreatefrompng($srcImage);\n imagecopyresampled($image_resized, $image_orig, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n $im = $image_resized;\n $imgWidth = imagesx($im);\n $imgHeight = imagesy($im);\n $total_pixel_count = 0;\n for ($y = 0; $y < $imgHeight; $y++) {\n for ($x = 0; $x < $imgWidth; $x++) {\n $total_pixel_count++;\n $index = imagecolorat($im, $x, $y);\n $colors = imagecolorsforindex($im, $index);\n // Now we check for neighboring colors to cut out duplicate colors\n if ($delta > 1) {\n $colors['red'] = intval((($colors['red']) + $halfOfDelta) / $delta) * $delta;\n $colors['green'] = intval((($colors['green']) + $halfOfDelta) / $delta) * $delta;\n $colors['blue'] = intval((($colors['blue']) + $halfOfDelta) / $delta) * $delta;\n if ($colors['red'] >= 256) {\n $colors['red'] = 255;\n }\n if ($colors['green'] >= 256) {\n $colors['green'] = 255;\n }\n if ($colors['blue'] >= 256) {\n $colors['blue'] = 255;\n }\n }\n $hex = substr(\"0\" . dechex($colors['red']), -2) . substr(\"0\" . dechex($colors['green']), -2) . substr(\"0\" . dechex($colors['blue']), -2);\n if (!isset($hexarray[$hex])) {\n $hexarray[$hex] = 1;\n } else {\n $hexarray[$hex]++;\n }\n }\n }\n // Reduce color gradients if requested\n if ($reduce_gradients) {\n arsort($hexarray, SORT_NUMERIC);\n $gradients = array();\n foreach ($hexarray as $hex => $num) {\n if (!isset($gradients[$hex])) {\n // This is where we check neighbors for a color match based on the delta value, this will cut down on the amount of repeat colors.\n $new_hex = $this->_near_color($hex, $gradients, $delta);\n $gradients[$hex] = $new_hex;\n } else {\n $new_hex = $gradients[$hex];\n }\n if ($hex != $new_hex) {\n $hexarray[$hex] = 0;\n $hexarray[$new_hex] += $num;\n }\n }\n }\n // Remove brightness color variation\n if ($reduce_brightness) {\n arsort($hexarray, SORT_NUMERIC);\n $brightness = array();\n foreach ($hexarray as $hex => $num) {\n if (!isset($brightness[$hex])) {\n // This is where we check neighbors for a color match based on the delta value, this will cut down on the amount of repeat colors.\n $new_hex = $this->_convertN($hex, $brightness, $delta);\n $brightness[$hex] = $new_hex;\n } else {\n $new_hex = $brightness[$hex];\n }\n if ($hex != $new_hex) {\n $hexarray[$hex] = 0;\n $hexarray[$new_hex] += $num;\n }\n }\n }\n arsort($hexarray, SORT_NUMERIC);\n // Convert the count of the color pixels into a percentage\n foreach ($hexarray as $key => $value) {\n // Check if number formatting is set to TRUE and return a round percentage if so\n if ($niceNumbers == true) {\n $hexarray[$key] = round(((float) $value / $total_pixel_count), 2);\n } else {\n $hexarray[$key] = (float) $value / $total_pixel_count;\n }\n }\n if ($count > 0) {\n $arr = array();\n foreach ($hexarray as $key => $value) {\n if ($count == 0) {\n break;\n }\n $count--;\n $arr[$key] = $value;\n }\n return $arr;\n } else {\n return $hexarray;\n }\n } else {\n $this->error = \"Image \" . $srcImage .\n \" could not be found or read, please make sure the image is present!\";\n return false;\n }\n }", "function getAverageLuminance($imageUrl, $samplesNumber=IMAGE_SAMPLE_NUMBER) {\n $fileName = imagecreatefromjpeg($imageUrl);\n $imageWidth = imagesx($fileName);\n $imageHeight = imagesy($fileName);\n $imageXStep = intval($imageWidth/$samplesNumber);\n $imageYStep = intval($imageHeight/$samplesNumber);\n $totalLuminance = INTEGER_ZERO;\n $sampleNumber = FILE_CONTENTS_TRUE_VALUE;\n for ($imageXAxis=INTEGER_ZERO; $imageXAxis<$imageWidth; $imageXAxis+=$imageXStep) {\n for ($imageYAxis=INTEGER_ZERO; $imageYAxis<$imageHeight; $imageYAxis+=$imageYStep) {\n $imagesRedGreenBlue = imagecolorat($fileName, $imageXAxis, $imageYAxis);\n $imageRedValue = ($imagesRedGreenBlue >> RED_COLOR_VALUE) & 0xFF;\n $imageGreenValue = ($imagesRedGreenBlue >> GREEN_COLOR_VALUE) & 0xFF;\n $imageBlueValue = $imagesRedGreenBlue & 0xFF;\n $imageLuminance = ($imageRedValue+$imageRedValue+$imageBlueValue+$imageGreenValue+$imageGreenValue+$imageGreenValue)/IMAGE_BRIGHTNESS_DIVISION_VALUE;\n $totalLuminance += $imageLuminance;\n $sampleNumber++;\n }\n }\n return $averageLuminance = $totalLuminance/$sampleNumber;\n }", "function re_hue_image($path,$seed,$source_theme,$also_s_and_v=false,$invert=false)\n{\n\tlist($ocportal_h,$ocportal_s,$ocportal_v)=rgb_to_hsv(find_theme_seed($source_theme));\n\tlist($seed_h,$seed_s,$seed_v)=rgb_to_hsv($seed);\n\t$hue_dif=$seed_h-$ocportal_h;\n\t$sat_dif=$seed_s-$ocportal_s;\n\t$val_dif=$seed_v-$ocportal_v;\n\n\tif (is_string($path))\n\t{\n\t\tif ((function_exists('imagecreatefromgif')) && (substr($path,-4)=='.gif'))\n\t\t{\n\t\t\t$_image=@imagecreatefromgif($path);\n\t\t} elseif (substr($path,-4)=='.jpg')\n\t\t{\n\t\t\t$_image=@imagecreatefromjpeg($path);\n\t\t} else\n\t\t{\n\t\t\t$_image=@imagecreatefrompng($path);\n\t\t}\n\t\tif ($_image===false) warn_exit(do_lang_tempcode('CORRUPT_FILE',escape_html($path)));\n\t} else\n\t{\n\t\t$_image=$path;\n\t}\n\t$width=imagesx($_image);\n\t$height=imagesy($_image);\n\tif (function_exists('imageistruecolor'))\n\t{\n\t\tif (function_exists('imagecreatetruecolor'))\n\t\t{\n\t\t\tif (!imageistruecolor($_image))\n\t\t\t{\n\t\t\t\t$trans_colour=imagecolortransparent($_image);\n\t\t\t\t$image=imagecreatetruecolor($width,$height);\n\t\t\t\timagecopy($image,$_image,0,0,0,0,$width,$height);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$image=$_image;\n\t\t\t\t$trans_colour=NULL;\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\t$image=$_image;\n\t\t\t$trans_colour=imagecolortransparent($_image);\n\t\t}\n\t} else\n\t{\n\t\t$image=$_image;\n\t\t$trans_colour=imagecolortransparent($_image);\n\t}\n\timagealphablending($image,false);\n\timagesavealpha($image,true);\n\n\tfor ($y=0;$y<$height;$y++)\n\t{\n\t\tfor ($x=0;$x<$width;$x++)\n\t\t{\n\t\t\t$_existing_colour=imagecolorat($image,$x,$y);\n\t\t\t$existing_colour=imagecolorsforindex($image,$_existing_colour);\n\t\t\tif (!is_null($trans_colour))\n\t\t\t{\n\t\t\t\t$__existing_colour=imagecolorat($_image,$x,$y);\n\t\t\t\tif ($__existing_colour==$trans_colour) $existing_colour['alpha']=127;\n\t\t\t}\n\n\t\t\t$r=$existing_colour['red'];\n\t\t\t$g=$existing_colour['green'];\n\t\t\t$b=$existing_colour['blue'];\n\t\t\t$a=$existing_colour['alpha'];\n\n\t\t\tlist($h,$s,$v)=rgb_to_hsv(str_pad(dechex($r),2,'0',STR_PAD_LEFT).str_pad(dechex($g),2,'0',STR_PAD_LEFT).str_pad(dechex($b),2,'0',STR_PAD_LEFT));\n\t\t\tif ($invert)\n\t\t\t{\n\t\t\t\t$v=255-$v;\n\t\t\t\t$v=min($v*3,255); // Because it's harder to see deviations of black\n\t\t\t}\n\t\t\tif ($seed_s<10) $s=$seed_s; // To stop red colours for gray-scale images\n\t\t\tif ($also_s_and_v)\n\t\t\t{\n\t\t\t\t$sat_dif=0; // Actually causes weirdness\n\t\t\t\t$result=hsv_to_rgb(floatval(fix_colour($h+$hue_dif,true)),floatval(fix_colour($s+$sat_dif)),floatval(fix_colour($v+$val_dif)));\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$result=hsv_to_rgb(floatval(fix_colour($h+$hue_dif,true)),floatval($s),floatval($v));\n\t\t\t}\n\n\t\t\t$new_colour_r=hexdec(substr($result,0,2));\n\t\t\t$new_colour_g=hexdec(substr($result,2,2));\n\t\t\t$new_colour_b=hexdec(substr($result,4,2));\n\n\t\t\tif (function_exists('imagecolorallocatealpha'))\n\t\t\t{\n\t\t\t\t$target_colour=imagecolorallocatealpha($image,$new_colour_r,$new_colour_g,$new_colour_b,$a);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$target_colour=imagecolorallocate($image,$new_colour_r,$new_colour_g,$new_colour_b);\n\t\t\t}\n\t\t\timagesetpixel($image,$x,$y,$target_colour);\n\t\t}\n\t}\n\n\treturn $image;\n}", "function pickcolor($img, $data_array, $row, $col)\r\n{\r\n $d = $data_array[$row][$col+1]; // col+1 skips over the row's label\r\n if ($d >= $_GET[\"r2\"]) return 0;\r\n if ($d >= $_GET[\"r1\"]) return 1;\r\n return 2;\r\n}", "function colourBrightness($hex, $percent) {\r\n $hash = '';\r\n if (stristr($hex, '#')) {\r\n $hex = str_replace('#', '', $hex);\r\n $hash = '#';\r\n }\r\n /// HEX TO RGB\r\n $rgb = array(hexdec(substr($hex, 0, 2)), hexdec(substr($hex, 2, 2)), hexdec(substr($hex, 4, 2)));\r\n //// CALCULATE\r\n for ($i = 0; $i < 3; $i++) {\r\n // See if brighter or darker\r\n if ($percent > 0) {\r\n // Lighter\r\n $rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1 - $percent));\r\n } else {\r\n // Darker\r\n $positivePercent = $percent - ($percent * 2);\r\n $rgb[$i] = round($rgb[$i] * $positivePercent) + round(0 * (1 - $positivePercent));\r\n }\r\n // In case rounding up causes us to go to 256\r\n if ($rgb[$i] > 255) {\r\n $rgb[$i] = 255;\r\n }\r\n }\r\n //// RBG to Hex\r\n $hex = '';\r\n for ($i = 0; $i < 3; $i++) {\r\n // Convert the decimal digit to hex\r\n $hexDigit = dechex($rgb[$i]);\r\n // Add a leading zero if necessary\r\n if (strlen($hexDigit) == 1) {\r\n $hexDigit = \"0\" . $hexDigit;\r\n }\r\n // Append to the hex string\r\n $hex .= $hexDigit;\r\n }\r\n return $hash . $hex;\r\n}", "function ColorBrightness(\\raylib\\Color $color, float $factor): \\raylib\\Color { return new \\raylib\\Color; }", "private function calculateAveragePixelColors($image, $width, $height) {\n\t\t// http://stackoverflow.com/questions/6962814/average-of-rgb-color-of-image\n\t\t$tmp_img = ImageCreateTrueColor(1,1);\n\t\tImageCopyResampled($tmp_img,$image,0,0,0,0,1,1,$width,$height); // or ImageCopyResized\n\t\t\n\t\t// The remaining pixel contains the average color of the image.\n\t\t$rgb = ImageColorAt($tmp_img,0,0);\n\t\t$colors = imagecolorsforindex($tmp_img, $rgb);\n\t\t\n\t\t// Free temporary image memory.\n\t\timagedestroy($tmp_img);\n\n\t\treturn $colors;\n\t}", "function get_brightness($hex) {\n\t$hex\t\t\t= str_replace('#', '', $hex);\n\t$color_red\t\t= hexdec(substr($hex, 0, 2));\n\t$color_green\t= hexdec(substr($hex, 2, 2));\n\t$color_blue\t\t= hexdec(substr($hex, 4, 2));\n\treturn (($color_red * 299) + ($color_green * 587) + ($color_blue * 114)) / 1000;\n}", "function imagecolorclosestalpha($image,$red,$green,$blue,$alpha)\n{\n\treturn 0;\n}", "function colorBrightness($hex, $percent) {\n\t// Work out if hash given\n\t$hash = '';\n\tif (stristr($hex,'#')) {\n\t\t$hex = str_replace('#','',$hex);\n\t\t$hash = '#';\n\t}\n\t/// HEX TO RGB\n\t$rgb = array(hexdec(substr($hex,0,2)), hexdec(substr($hex,2,2)), hexdec(substr($hex,4,2)));\n\t//// CALCULATE\n\tfor ($i=0; $i<3; $i++) {\n\t\t// See if brighter or darker\n\t\tif ($percent > 0) {\n\t\t\t// Lighter\n\t\t\t$rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1-$percent));\n\t\t} else {\n\t\t\t// Darker\n\t\t\t$positivePercent = $percent - ($percent*2);\n\t\t\t$rgb[$i] = round($rgb[$i] * $positivePercent) + round(0 * (1-$positivePercent));\n\t\t}\n\t\t// In case rounding up causes us to go to 256\n\t\tif ($rgb[$i] > 255) {\n\t\t\t$rgb[$i] = 255;\n\t\t}\n\t}\n\t//// RBG to Hex\n\t$hex = '';\n\tfor($i=0; $i < 3; $i++) {\n\t\t// Convert the decimal digit to hex\n\t\t$hexDigit = dechex($rgb[$i]);\n\t\t// Add a leading zero if necessary\n\t\tif(strlen($hexDigit) == 1) {\n\t\t$hexDigit = \"0\" . $hexDigit;\n\t\t}\n\t\t// Append to the hex string\n\t\t$hex .= $hexDigit;\n\t}\n\t// Check if shorthand hex value given (eg. #FFF instead of #FFFFFF)\n\tif(strlen($hex) == 3) {\n\t\t$hex = str_repeat(substr($hex,0,1), 2) . str_repeat(substr($hex,1,1), 2) . str_repeat(substr($hex,2,1), 2);\n\t}\n\treturn $hash.$hex;\n}", "function imagecolorresolvealpha($image,$red,$green,$blue,$alpha)\n{\n\treturn 0;\n}", "public function get($color, $brightness = 0) \n {\n //If the color was specified as an hex value pass it as is to mix.\n return self::mix(strpos($color, '#') === 0 ? $color : $this->colors[$color], (100 - abs($brightness)) / 100, $brightness > 0 ? 255 : 0);\n }", "function colourBrightness($hex, $percent) {\n\t// Work out if hash given\n\t$hash = '';\n\tif (stristr($hex,'#')) {\n\t\t$hex = str_replace('#','',$hex);\n\t\t$hash = '#';\n\t}\n\t/// HEX TO RGB\n\t$rgb = array(hexdec(substr($hex,0,2)), hexdec(substr($hex,2,2)), hexdec(substr($hex,4,2)));\n\t//// CALCULATE \n\t\n\tfor ($i=0; $i<3; $i++) {\n\t\t// See if brighter or darker\n\t\tif ($percent > 0) {\n\t\t\t// Lighter\n\t\t\t$rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1-$percent));\n\t\t\t\n\t\t} else {\n\t\t\t// Darker\n\t\t\t$positivePercent = $percent - ($percent*2);\n\t\t\t$rgb[$i] = round($rgb[$i] * $positivePercent) + round(0 * (1-$positivePercent));\n\t\t}\n\t\t// In case rounding up causes us to go to 256\n\t\tif ($rgb[$i] > 255) {\n\t\t\t$rgb[$i] = 255;\n\t\t}\n\t}\n\t\n\t//// RBG to Hex\n\t$hex = '';\n\tfor($i=0; $i < 3; $i++) {\n\t\t// Convert the decimal digit to hex\n\t\t$hexDigit = dechex($rgb[$i]);\n\t\t// Add a leading zero if necessary\n\t\tif(strlen($hexDigit) == 1) {\n\t\t$hexDigit = \"0\" . $hexDigit;\n\t\t}\n\t\t// Append to the hex string\n\t\t$hex .= $hexDigit;\n\t}\n\t\n\treturn $hash.$hex;\n}", "private function conv2hsl($rgb) {\n\t$red = $rgb[0] / 255;\n\t$grn = $rgb[1] / 255;\n\t$blu = $rgb[2] / 255;\n\n $min = min($red, $grn, $blu);\n $max = max($red, $grn, $blu);\n\n $dif = $max - $min; if ($dif == 0) return array(0, 0, 0);\n\t$sum = $max + $min;\n $lum = $this->chkParm($sum / 2);\n $sat = $dif / (2 - $sum); if ($lum < 0.5) $sat = $dif / $sum;\n\n $xxr = ((($max - $red) / 6) + ($dif / 2)) / $dif;\n $xxg = ((($max - $grn) / 6) + ($dif / 2)) / $dif;\n $xxb = ((($max - $blu) / 6) + ($dif / 2)) / $dif;\n\n\tswitch ($max) {\n\t\tcase $red: $hue = (0 / 3) + $xxb - $xxg; break;\n\t\tcase $grn: $hue = (1 / 3) + $xxr - $xxb; break;\n\t\tcase $blu: $hue = (2 / 3) + $xxg - $xxr; break;\n\t}\n\t$hue = $this->chkParm($hue);\n\t$sat = $this->chkParm($sat);\n\t$lum = $this->chkParm($lum);\n\n\treturn array($hue, $sat, $lum);\n}", "public function toRgbArray()\n {\n if ($this->cmp_saturation == 0) {\n return array(\n 'red' => $this->cmp_lightness,\n 'green' => $this->cmp_lightness,\n 'blue' => $this->cmp_lightness,\n 'alpha' => $this->cmp_alpha\n );\n }\n if ($this->cmp_lightness < 0.5) {\n $valb = ($this->cmp_lightness * (1 + $this->cmp_saturation));\n } else {\n $valb = (($this->cmp_lightness + $this->cmp_saturation) - ($this->cmp_lightness * $this->cmp_saturation));\n }\n $vala = ((2 * $this->cmp_lightness) - $valb);\n return array(\n 'red' => $this->convertHuetoRgb($vala, $valb, ($this->cmp_hue + (1 / 3))),\n 'green' => $this->convertHuetoRgb($vala, $valb, $this->cmp_hue),\n 'blue' => $this->convertHuetoRgb($vala, $valb, ($this->cmp_hue - (1 / 3))),\n 'alpha' => $this->cmp_alpha\n );\n }", "public function getHash($filepath)\n {\n $scale = 8;//todo, allow scale specification\n try\n {\n $img = imagecreatefrompng($filepath);\n }\n catch (exception $e)\n {\n try\n {\n $img = imagecreatefromjpeg($filepath);\n }\n catch (exception $f)\n {\n return 'Image could not be processed. Only JPG/PNG supported';\n }\n }\n $averageValue = 0;\n for ($y = 0; $y < $scale; $y++)\n {\n for ($x = 0; $x < $scale; $x++)\n {\n // get the rgb value for current pixel\n $rgb = ImageColorAt($img, $x, $y);\n // extract each value for r, g, b\n $red = ($rgb & 0xFF0000) >> 16;\n $green = ($rgb & 0x00FF00) >> 8;\n $blue = ($rgb & 0x0000FF);\n $gray = $red + $blue + $green;\n $gray /= 12;\n $gray = floor($gray);\n $grayscale[$x + ($y * $scale)] = $gray;\n $averageValue += $gray;\n }\n }\n $averageValue /= ($scale * $scale);\n $averageValue = floor($averageValue);\n $hash = 0;\n\n $phash = array();\n for ($i = 0; $i < ($scale * $scale); $i++)\n {\n $rgb = $grayscale[$i];\n if ($rgb >= $averageValue)\n {\n $this->leftShift($phash, 1, (63 - $i));\n }\n }\n $p1 = $this->bin2dec($phash);\n $pluscarry = $this->string_add($p1, \"1\");\n return $pluscarry;\n }", "function GetImageColor(\\raylib\\Image $image, int $x, int $y): \\raylib\\Color { return new \\raylib\\Color; }", "public function brightness( $level )\n\t{\n\t\treturn imagefilter( $this->image->getResource(), IMG_FILTER_BRIGHTNESS, $level );\n\t}", "function imagecolorclosestalpha($image, $red, $green, $blue, $alpha)\n{\n}", "private function getRGB($color = '000000') {\r\n $color = str_replace('#', '', $color);\r\n $r = hexdec(substr($color, 0, 2));\r\n $g = hexdec(substr($color, 2, 2));\r\n $b = hexdec(substr($color, 4, 2)); \r\n return array($r, $g, $b); \r\n }", "function hsl_to_rgb( $hsl ){\n\n\t\t$h = $hsl['hue'];\n\t\t$s = $hsl['saturation'];\n\t\t$l = $hsl['lightness'];\n\n\t\tif ($s == 0) {\n\t\t\t$r = $l * 255;\n\t\t\t$g = $l * 255;\n\t\t\t$b = $l * 255;\n\t\t} else {\n\t\t\tif ($l < 0.5)\n\t\t\t\t$var_2 = $l * (1 + $s);\n\t\t\telse\n\t\t\t\t$var_2 = ($l + $s) - ($s * $l);\n\t\t\t\n\n\t\t\t$var_1 = 2 * $l - $var_2;\n\t\t\t$r = 255 * $this->_hue_to_rgb( $var_1, $var_2, $h + (1 / 3) );\n\t\t\t$g = 255 * $this->_hue_to_rgb( $var_1, $var_2, $h );\n\t\t\t$b = 255 * $this->_hue_to_rgb( $var_1, $var_2, $h - (1 / 3) );\n\t\t};\n\t\t\n\t\treturn array( 'red' => $r, 'green' => $g, 'blue' => $b );\n\t\t\n\t}", "function mogo_color_rgb($hex) {\n $hex = preg_replace(\"/^#(.*)$/\", \"$1\", $hex);\n $rgb = array();\n $rgb['r'] = hexdec(substr($hex, 0, 2));\n $rgb['g'] = hexdec(substr($hex, 2, 2));\n $rgb['b'] = hexdec(substr($hex, 4, 2));\n return $rgb;\n}", "function convertColor($color){\n #convert hexadecimal to RGB\n if(!is_array($color) && preg_match(\"/^[#]([0-9a-fA-F]{6})$/\",$color)){\n $hex_R = substr($color,1,2);\n $hex_G = substr($color,3,2);\n $hex_B = substr($color,5,2);\n $RGB = array(hexdec($hex_R),hexdec($hex_G),hexdec($hex_B));\n return $RGB;\n }\n }", "function genesis_sample_color_brightness( $color, $change ) {\n\n\t$hexcolor = str_replace( '#', '', $color );\n\n\t$red = hexdec( substr( $hexcolor, 0, 2 ) );\n\t$green = hexdec( substr( $hexcolor, 2, 2 ) );\n\t$blue = hexdec( substr( $hexcolor, 4, 2 ) );\n\n\t$red = max( 0, min( 255, $red + $change ) );\n\t$green = max( 0, min( 255, $green + $change ) );\n\t$blue = max( 0, min( 255, $blue + $change ) );\n\n\treturn '#' . dechex( $red ) . dechex( $green ) . dechex( $blue );\n\n}", "function luminance($R, $G, $B)\n {\n return (.299 * $R) + (.587 * $G) + (.114 * $B);\n }", "public function contrastImage ($sharpen) {}", "private function get_series_color($color, $alpha = false) {\n\n\t\t$rgb\t= graphit::trans_hex2RGB($color);\n\n\t\t$rgb[3] = ($rgb[0] >= 30) ? $rgb[0] - 30 : 0;\n\t\t$rgb[4] = ($rgb[1] >= 30) ? $rgb[1] - 30 : 0;\n\t\t$rgb[5] = ($rgb[2] >= 30) ? $rgb[2] - 30 : 0;\n\n\t\t$color\t\t\t= is_integer($alpha) ? imagecolorallocatealpha($this->img, $rgb[0], $rgb[1], $rgb[2], $alpha)\n\t\t\t\t\t\t\t\t\t \t\t : imagecolorallocate($this->img, $rgb[0], $rgb[1], $rgb[2]);\n\t\t$shadow\t\t\t= is_integer($alpha) ? imagecolorallocatealpha($this->img, $rgb[3], $rgb[4], $rgb[5], $alpha)\n\t\t\t\t\t\t\t\t\t\t\t : imagecolorallocate($this->img, $rgb[3], $rgb[4], $rgb[5]);\n\t\treturn array('normal' => $color, 'shadow' => $shadow);\n\t}", "private function rgbhsl(array $rgb)\n\t\t{\n\n\t\t\t// make rgb percetages\n\t\t\tforeach($rgb as &$v){\n\t\t\t\t$v /= 255;\n\t\t\t}\n\n \t\t// Arrange the rgb values numerically\n\t\t\tasort($rgb,SORT_NUMERIC);\n\n\t\t\t// To access the values numerically yet maintain an associative array, we need to create another array that maps numeric indexes to the associative keys\n\t\t\t$keys = array_keys($rgb);\n\n\n \t\t$hsl = array(\n \t\t\t'h' => ($rgb[$keys[2]] + $rgb[$keys[0]]) / 2,\n \t\t\t's' => ($rgb[$keys[2]] + $rgb[$keys[0]]) / 2,\n \t\t\t'l' => ($rgb[$keys[2]] + $rgb[$keys[0]]) / 2\n \t\t);\n\n \t\t//\n\t\t if($rgb[$keys[2]] == $rgb[$keys[0]]){\n\n\t\t $hsl['h'] = 0;\n\t\t $hsl['s'] = 0; // achromatic\n\n\t\t }else{\n\n\t\t \t// calculate chroma as $d (chroma = max(rgb) - min(rgb))\n\t\t $d = $rgb[$keys[2]] - $rgb[$keys[0]];\n\n\t\t if( $hsl['l'] > 0.5 )\n\t\t {\n\t \t\t$hsl['s'] = $d / (2 - $rgb[$keys[2]] - $rgb[$keys[0]]);\n\t \t}else{\n\t \t\t$hsl['s'] = $d / ($rgb[$keys[2]] + $rgb[$keys[0]]);\n\t \t}\n\n\t \t// calculate hue using some mathey stuff (http://en.wikipedia.org/wiki/HSL_color_space)\n\t\t switch($rgb[$keys[2]]){\n\t\t case $rgb['r']: $hsl['h'] = ($rgb['g'] - $rgb['b']) / $d + ($rgb['g'] < $rgb['b'] ? 6 : 0); break;\n\t\t case $rgb['g']: $hsl['h'] = ($rgb['b'] - $rgb['r']) / $d + 2; break;\n\t\t case $rgb['b']: $hsl['h'] = ($rgb['r'] - $rgb['g']) / $d + 4; break;\n\t\t }\n\t\t $hsl['h'] /= 6;\n\t\t }\n\n\t\t $hsl['h'] *= 360; // express hue as degrees\n\t\t $hsl['h'] = $hsl['h'] > 360 ? 360 : $hsl['h'];\n\t\t $hsl['s'] *= 100; // express saturation as percentage\n\t\t $hsl['s'] = $hsl['s'] > 100 ? 100 : $hsl['s'];\n\t\t $hsl['l'] *= 100; // express lightness as percentage\n\t\t $hsl['l'] = $hsl['l'] > 100 ? 100 : $hsl['l'];\n\n\t\t return $hsl;\n\t\t}", "protected function readImageDescriptor()\n {\n $this->readBytes(9);\n $screen = $this->buffer;\n\n $this->currentFrame->setOffset(new Point(\n $this->getUnsignedShort($screen, 0),\n $this->getUnsignedShort($screen, 2)\n ));\n\n $this->currentFrame->setSize(new Rectangle(\n $this->getUnsignedShort($screen, 4),\n $this->getUnsignedShort($screen, 6)\n ));\n\n\n $gctFlag = ($screen[8] & 0x80) == 0x80;\n if ($gctFlag) {\n $code = $screen[8] & 0x07;\n $sort = $screen[8] & 0x20 ? 1 : 0;\n } else {\n $code = $this->gctSize;\n $sort = $this->sortFlag;\n }\n $size = 2 << $code;\n $this->screen[4] &= 0x70;\n $this->screen[4] |= 0x80;\n $this->screen[4] |= $code;\n if ($sort) {\n $this->screen[4] |= 0x08;\n }\n\n /**\n * GIF Data Begin\n */\n $stream = $this->currentFrame->getStream();\n $stream->writeString(\n $this->currentFrame->isTransparent() ? \"GIF89a\" : \"GIF87a\"\n );\n\n $stream->writeBytes($this->screen);\n $color = $this->currentFrame->getTransparentColor();\n if ($gctFlag) {\n $this->readBytes(3 * $size);\n if ($this->currentFrame->isTransparent()) {\n $color->red = $this->buffer[3 * $color->index + 0];\n $color->green = $this->buffer[3 * $color->index + 1];\n $color->blue = $this->buffer[3 * $color->index + 2];\n }\n $stream->writeBytes($this->buffer);\n } else {\n if ($this->currentFrame->isTransparent()) {\n $color->red = $this->globalColorTable[3 * $color->index + 0];\n $color->green = $this->globalColorTable[3 * $color->index + 1];\n $color->blue = $this->globalColorTable[3 * $color->index + 2];\n }\n $stream->writeBytes($this->globalColorTable);\n }\n\n if ($this->currentFrame->isTransparent()) {\n $stream->writeString(\"!\\xF9\\x04\\x1\\x0\\x0\".chr($color->index).\"\\x0\");\n }\n\n $stream->writeBytes([0x2C]);\n $screen[8] &= 0x40;\n $stream->writeBytes($screen);\n\n $this->readBytes(1);\n $stream->writeBytes($this->buffer);\n\n $srcPhpStream = $this->stream->getPhpStream();\n $dstPhpStream = $stream->getPhpStream();\n\n $blockSize = null;\n $blockSizeRaw = null;\n while (true) {\n $blockSizeRaw = fread($srcPhpStream, 1);\n $blockSize = ord($blockSizeRaw);\n fwrite($dstPhpStream, $blockSizeRaw);\n if ($blockSize == 0x00) {\n break;\n }\n\n fwrite($dstPhpStream, fread($srcPhpStream, $blockSize));\n }\n\n $stream->writeBytes([0x3B]);\n }", "public function getImageBackgroundColor () {}", "function worx_hex2rgb( $color ) {\n\n\t$color = trim( $color, '#' );\n\t\n\tif( strlen( $color ) == 3 ) {\n\n\t\t$r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) );\n\t\t$g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) );\n\t\t$b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) );\n\n\t} elseif( strlen( $color ) == 6 ) {\n\n\t\t$r = hexdec( substr( $color, 0, 2 ) );\n\t\t$g = hexdec( substr( $color, 2, 2 ) );\n\t\t$b = hexdec( substr( $color, 4, 2 ) );\n\n\t} else {\n\n\t\treturn array();\n\n\t}\n\n\treturn array( 'r' => $r, 'g' => $g, 'b' => $b );\n\n}", "function imagecolorresolvealpha($image, $red, $green, $blue, $alpha)\n{\n return 0;\n}", "public function getColor();", "public function getColor();", "public function allocateColor($name)\n {\n list($r, $g, $b) = Horde_Image::getRGB($name);\n return array('red' => $r, 'green' => $g, 'blue' => $b, 'alpha' => 255);\n }", "private function loadImage()\n {\n return $this->mfr->get(false);\n }", "public function toRGB()\n {\n $hue = $this->hue / 360;\n $saturation = $this->saturation / 100;\n $value = $this->value / 100;\n if ($saturation == 0) {\n $red = $value * 255;\n $green = $value * 255;\n $blue = $value * 255;\n } else {\n $var_h = $hue * 6;\n $var_i = floor($var_h);\n $var_1 = $value * (1 - $saturation);\n $var_2 = $value * (1 - $saturation * ($var_h - $var_i));\n $var_3 = $value * (1 - $saturation * (1 - ($var_h - $var_i)));\n\n if ($var_i == 0) {\n $var_r = $value;\n $var_g = $var_3;\n $var_b = $var_1;\n } elseif ($var_i == 1) {\n $var_r = $var_2;\n $var_g = $value;\n $var_b = $var_1;\n } elseif ($var_i == 2) {\n $var_r = $var_1;\n $var_g = $value;\n $var_b = $var_3;\n } elseif ($var_i == 3) {\n $var_r = $var_1;\n $var_g = $var_2;\n $var_b = $value;\n } else {\n if ($var_i == 4) {\n $var_r = $var_3;\n $var_g = $var_1;\n $var_b = $value;\n } else {\n $var_r = $value;\n $var_g = $var_1;\n $var_b = $var_2;\n }\n }\n\n $red = round($var_r * 255);\n $green = round($var_g * 255);\n $blue = round($var_b * 255);\n }\n return new RGB($red, $green, $blue);\n }", "public function lightnessMax(){\n return RGB::create('255,255,255')->lightness();\n }", "public function getImageColormapColor ($index) {}", "public function fromImg($file)\n {\n $im = imagecreatefrompng($file);\n $d = array();\n for ($w=0;$w<25;$w++) {\n $x = (int) ($w%5);\n $y = (int) ($w/5);\n\n $c = imagecolorsforindex($im,imagecolorat($im,$x,$y));\n $c = $c['red'];\n if ($c>0) {\n $d = array_merge(\n $d,\n array_fill_keys(\n range(0,$c-1),\n $w\n )\n );\n }\n }\n\n return $d;\n }", "function imagecolorclosestalpha($image, $red, $green, $blue, $alpha)\n{\n return 0;\n}", "public function getImageColorUrl()\r\n {\r\n $uploadDir = $this->getUploadDir();\r\n if ($this->getImgUrl() != \"\" && file_exists($uploadDir . $this->getImgUrl()))\r\n {\r\n return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'mps/colormanager/' . $this->getImgUrl() ;\r\n }\r\n return '';\r\n }" ]
[ "0.599479", "0.5992528", "0.5942956", "0.5891563", "0.57784736", "0.57676184", "0.57611865", "0.5747022", "0.5597607", "0.55519325", "0.55215794", "0.549637", "0.5485878", "0.5480925", "0.547564", "0.54725766", "0.5469894", "0.5398446", "0.5391531", "0.53799665", "0.5365435", "0.53592795", "0.5336513", "0.533502", "0.53314656", "0.5326633", "0.531849", "0.53094125", "0.53002673", "0.52785856", "0.5264221", "0.5263543", "0.5255434", "0.5237914", "0.5211443", "0.5205913", "0.51968455", "0.5196786", "0.51924086", "0.5191294", "0.51911694", "0.5181102", "0.5176254", "0.5175207", "0.5169896", "0.5167098", "0.51520175", "0.5126139", "0.51196456", "0.5102713", "0.5100978", "0.5097933", "0.50885653", "0.50820345", "0.5049501", "0.5045546", "0.5044892", "0.5037234", "0.5035563", "0.502561", "0.50235426", "0.50032026", "0.50029427", "0.4997647", "0.4996377", "0.49914154", "0.49700615", "0.4966481", "0.49664328", "0.4949816", "0.49497592", "0.49483138", "0.49440175", "0.4942391", "0.49414757", "0.4930562", "0.49301827", "0.49290708", "0.4925758", "0.4925498", "0.49171925", "0.49109817", "0.49104786", "0.49076504", "0.48959935", "0.48955813", "0.48929086", "0.48925838", "0.48906615", "0.4890437", "0.48834997", "0.48834997", "0.48814252", "0.48789513", "0.4876084", "0.48712784", "0.48711395", "0.48659366", "0.4865122", "0.48620436" ]
0.81209016
0
Check if First Letter is in array $vowels
Проверьте, находится ли первая буква в массиве $vowels
protected function isFirstInVowels($word) { $latin_word = $this->getArrayFromLatinWord($word); $first_element = $this->getArrFirstLetterOfLatinWord($latin_word); return in_array($first_element[0], $this->vowels); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function isVowel($word, $index);", "private function isVowel($char)\n {\n return in_array(strtolower($char), self::$vowel);\n }", "function in_array_insensetive($nedle,$haystack)\n{\n\treturn in_array(strtolower($needle),array_map('strtolower',$haystack));\n}", "function is_chaine_alpha($chaine){\n for ($i=0; $i <taille($chaine) ; $i++) { \n if (!is_car_alpha($chaine[$i])) {\n return false;\n }\n }\n return true;\n}", "function is_car_present_in_chaine($car,$chaine){\n if (is_chaine_alpha($chaine)) {\n if (is_car_alpha($car)) {\n for ($i=0; $i < taille($chaine) ; $i++) { \n if ($chaine[$i]==$car) {\n return true;\n }\n }\n }\n }\n return false;\n}", "function user_exists($uname){\n $users = ['ObiWan', 'MasterSkywalker66', 'GandalfTheWhite'];\n return in_array(strtolower($uname), array_map(function ($element){\n return strtolower($element);\n }, $users));\n}", "function is_chaine_alpha($strg){\n\n for($i = 0; $i<long_chaine($strg); $i++){\n if(!is_car_alpha($strg[$i])) return false;\n }\n return true;\n}", "function subsumed_in($vector,$ele)\n{\n\t$subsumed=false;\n\t$ele=strtolower(trim($ele));\n\t\n\tif (!is_array($vector)) ;\n\telse if (count($vector))\n\t{\n\t\tforeach($vector as $v)\t\n\t\t{\n\t\t\t$v = strtolower(trim($v));\n\t\t\t$subsumed = strstr($v,$ele) || strstr($ele,$v);\n\t\t\tif ($subsumed) break;\n\t\t}\n\t}\n\t\n\treturn $subsumed;\n}", "function in_arrayi($needle, $haystack)\n{\n for($h = 0 ; $h < count($haystack) ; $h++)\n {\n $haystack[$h] = strtolower($haystack[$h]);\n }\n return in_array(strtolower($needle),$haystack);\n}", "function in_array_icase( $needle, array $haystack ) {\n foreach( $haystack as $item ) {\n if( strcasecmp($needle, $item) == 0 )\n return true;\n }\n\n return false;\n}", "function isupper($car){\n $UPPER = [\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];\n for($i=0; $i<26; $i++){\n if($car==$UPPER[$i]){\n return TRUE;\n }\n }\n return FALSE;\n}", "function check_lowercase_alfabetic_char_present($stringa) {\n\treturn present(\t$stringa,\n\t\t\t\t\t\t\t\"qwertyuioplkjhgfdsazxcvbnm\");\n}", "function check_alfabetic_char_present($stringa) {\n\treturn present(\t$stringa,\n\t\t\t\t\t\t\t\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\");\n}", "function countVowels($string)\n{\n #echo(substr_count($string, 'a'));\n return substr_count($string, 'a')+ substr_count($string, 'e')+substr_count($string, 'i')+ substr_count($string, 'o')+ substr_count($string, 'u');\n}", "private function esVocal( $char ) {\n \t$char= $this->convertirMayusculas($char);\n return ($char=='A' || $char=='E' || $char=='I' || $char=='O' || $char=='U') ? true : false;\n }", "public static function IsVowel($string, $pos){\n\t\treturn preg_match(\"/[AEIOUY]/\", substr($string, $pos, 1));\n\t}", "private static function vowel(): string {\n\t\tif (rand(0, 1) === 1) {\n\t\t\tif (self::$wordCount === 0) {\n\t\t\t\t$vowels = self::$doubleVowelsFirst[rand(0, count(self::$doubleVowelsFirst) - 1)];\n\t\t\t} else {\n\t\t\t\t$vowels = self::$doubleVowelsAnywhere[rand(0, count(self::$doubleVowelsAnywhere) - 1)];\n\t\t\t}\n\t\t} else {\n\t\t\t$vowels = self::$vowels[rand(0, count(self::$vowels) - 1)];\n\t\t}\n\n\t\tif (self::$rareCharactersChance < 100 && is_array(self::$rareCharacters) && count(self::$rareCharacters) > 0) {\n\t\t\tforeach (mb_str_split($vowels) as $letter) {\n\t\t\t\tif (in_array($letter, self::$rareCharacters) && rand(1, 100) > self::$rareCharactersChance) {\n\t\t\t\t\treturn self::vowel();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $vowels;\n\t}", "public function isLetter($value)\n\t{\n\t\tif (in_array($value, $this->alphabet))\n\t\t\treturn true;\n\t\t\t\n\t\treturn false;\n\t}", "private function getVowel()\r\n\t\t{\r\n\t\t\treturn $this->isGoodChance() ?\r\n\t\t\t\t$this->_diphthongs[$this->getRandom($this->_diphthongs_length)] :\r\n\t\t\t\t$this->_vowels[$this->getRandom($this->_vowels_length)];\r\n\t\t}", "private static function isLetter( $u )\n {\n return ( ($u >= 65 && $u <= 90) //uppercase\n || ($u >= 97 && $u <= 122) ); //lowercase\n }", "function check_uppercase_alfabetic_char_present($stringa) {\n\treturn present(\t$stringa,\n\t\t\t\t\t\t\t\"QWERTYUIOPLKJHGFDSAZXCVBNM\");\n}", "function iin_array($needle,array $haystack,$strict=false)\n{\n\treturn in_array(strtolower($needle),array_map('strtolower',$haystack),$strict);\n}", "private function endsWithVowel()\n {\n if (in_array($this->endingChars(1), $this->vowels)) {\n return true;\n }\n\n return false;\n }", "function countVowels($username)\n{\n\t$vowelCount = 0;\n\n\t// logic to count no of vowels\n\tfor($i=0; $i < 4; $i++)\n\t{\n\t\t$ch = $username[$i];\n\t\tif( $ch==='a' || $ch==='e' || $ch==='i' || $ch==='o' || $ch==='u')\n\t\t{\n\t\t\t$vowelCount++;\n\t\t}\n\t}\n\t\n\treturn $vowelCount;\n}", "function cs_in_array($string,$object) {\n\n\t$string = strtolower($string);\n\n\t$returnValue = null;\n\n\tfor ($row=0;$row<count($object);$row++) {\n\n\t\t$tempValue = strtolower($object[$row]);\n\n\t\tif ($tempValue == $string) {\n\t\t $returnValue = $tempValue; \n\t\t break;\n }\n \n\t}\n\n\tif ($returnValue) return $returnValue;\n\telse return false;\n\n}", "function movies_exsist($movies){\n $movies = ['sw', 'lotr', 'mcu', 'shrek'];\n return array_in_array($movies, $movies);\n}", "function criteria_exist($possible, $letter) {\n\t//print_r($possible);\n\t$crit = 0;\n\tforeach ($possible as $key=>$val) {\n\t\tif ( substr($key, 0, 1) == $letter ) $crit++;\n\t}\n\tif ($crit==0) return false;\n\treturn true;\n}", "function removeVowels (string myString) {\n\t\tvowels = ['a', 'e','i','o','u'];\n\t\tstring noVowels = '';\n\t\tforeach (character in myString) {\n\t\t\tif(!(character in vowels)){\n\t\t\t\tnoVowels = noVowels + character;\n\t\t\t\t}\n\t\t\t}", "function is_car_present_in_chaine($st,$strg){\n\n for($i = 0; $i<long_chaine($strg); $i++){\n if(($strg[$i])== $st) return true;\n }\n return false;\n}", "public function checkForWin() {\n // array_intersect compares the values of two or more arrays and returns the matches\n // Compare the selected array to the getletterarray\n $resultArray = array_intersect($this->phrase->selected,$this->phrase->getLetterArray());\n // If the number of items in the return array matches the get letter array\n if(count($resultArray) == count($this->phrase->getLetterArray())) {\n return true;\n } else {\n return false;\n }\n}", "private function continuousLetter(){\r\n\t\tforeach(str_split($this->exp) as $key => $str)\r\n\t\t\tif ($key == 0) continue;\r\n\t\t\tif (preg_match('/^[a-zA-Z]+$/', $str) == 1 && preg_match('/^[a-zA-Z]+$/', str_split($this->exp)[$key-1]) == 1) {\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function in_arrayi($needle, $haystack, $strict = false)\n {\n return in_array(strtolower($needle), array_map('strtolower', $haystack), $strict);\n }", "function in_arrayi($needle, $haystack, $strict = false)\n {\n return in_array(strtolower($needle), array_map('strtolower', $haystack), $strict);\n }", "function Valid_Username($username){\r\n\tglobal $db, $_conf_vars;\r\n\t$char_arr = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_');\r\n\t$flag = 1;\r\n\tfor($s=0; $s < strlen($username); $s++){\r\n\t\t$char = $username.substr($s, 1);\r\n\t\tif(!in_array(+$char, $char_arr)){//echo $char.\"<br />\";\r\n\t\t\t$flag = 0;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif($flag == 0) return false;\r\n\telse return true;\r\n}", "function array_key_existsi($needle, $haystack) {\n\t$needle = strtolower($needle);\n\t\n\tforeach( $haystack as $key=>$value ) {\n\t\tif ( strtolower($key) == $needle ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\treturn false;\n}", "function addVowels($answer)\n{\n $stringLength = str_split($answer);\n\n foreach ($stringLength as $letter) {\n $vowelCount += countVowels($letter);\n }\n return $vowelCount;\n}", "function check_word($letter){\n\t\t\t$acierto = false;\n\t\t\tforeach ($this->word as $key => $value) {\n\n\t\t\t\t\tif($value['char']==ucfirst($letter)||$value['char']==strtolower($letter)){\n\t\t\t\t\t\t$this->word[$key]['is_check'] = 1;\n\t\t\t\t\t\t$acierto = true;\n\t\t\t\t\t}\n\t\t\t\t\tif($this->word[$key]['is_check'] !=1){\n\t\t\t\t\t\t$completada = false;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($acierto == false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn $this->word;\n\t\t}", "function validSelectWText($array, $input){\n if(!isset($input)){\n return true;\n }\n $valid = true;\n foreach($input as $interest){\n if(!in_array($interest,$array)){\n $valid = false;\n }\n }\n return $valid;\n}", "function isvoyelle($lettre)\n{ \n $voyelle= false;\n\n //vérifier si la variable $lettre est une chaine (is-string) ou pas .\n\n if ( is_string($lettre) && strlen($lettre)==1 ) {\n\n // echo \"vérification de la lettre effectuée \\n\";\n $lettre = strtoupper($lettre); //ecrire les variables en majuscule.\n\n if ( \n ($lettre=='A') ||\n ($lettre=='E') ||\n ($lettre=='U') ||\n ($lettre=='I') ||\n ($lettre=='O') ||\n ($lettre=='Y')\n ) {\n $voyelle=true; \n }\n\n } else {\n var_dump($lettre);\n echo \"parametre erroné \\n\" ; \n } \n \n return($voyelle); \n}", "public function startsWithLetter()\n {\n return !!preg_match(\"/^[a-zA-Z]/i\", $this->value);\n }", "function getVowel($inputString = null)\n {\n $getCountVowel = preg_match_all('/[aeiou]/i', $inputString);\n\n echo \"Number of Vowels in the string: \" . $getCountVowel . \" \\nin: \" . \n $inputString;\n }", "function SearchArray($str, $arr)\n{\n\n foreach ($arr as $item) {\n $pattern = '/\\W' . $item . '\\W/i';\n $result = preg_match($pattern, $str);\n if ($result == 1) return true;\n }\n return false;\n}", "public static function getDoubleVowelsFirst(): array {\n\t\treturn self::$doubleVowelsFirst;\n\t}", "function indexOf($array, $word) {\n foreach($array as $value){\n if(substr_count($value, $word) > 0 ) return 1;\n } \n return -1;\n}", "public function validChar()\n {\n $validCharac = array();\n $alpha = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n\n foreach ($alpha as $char) {\n $sql = \"SELECT * FROM author WHERE author LIKE '$char%'\";\n $query = mysqli_query($this->con, $sql);\n if (mysqli_num_rows($query) !== 0) {\n array_push($validCharac, $char);\n }\n }\n return $validCharac;\n\n }", "public static function setVowels($vowels): void {\n\t\tif ($vowels && !is_array($vowels)) {\n\t\t\t$vowels = mb_str_split($vowels);\n\t\t}\n\t\tself::$vowels = $vowels;\n\t}", "public static function in_array_nocase($needle, $haystack)\n {\n // use much faster method for ascii\n if (self::is_ascii($needle)) {\n foreach ((array) $haystack as $value) {\n if (strcasecmp($value, $needle) === 0) {\n return true;\n }\n }\n }\n else {\n $needle = mb_strtolower($needle);\n foreach ((array) $haystack as $value) {\n if ($needle === mb_strtolower($value)) {\n return true;\n }\n }\n }\n\n return false;\n }", "private static function startsWithLetter($var)\n {\n if ( preg_match('/^\\p{L}/iu', $var) ) {\n return true;\n } else return false;\n }", "function TrovaLettera ($lettera, $parola, $scelte, $alfabeto) {\r\n $alfabeto = array_flip ($alfabeto);\r\n $lettera = substr ($lettera, 0, 1);\r\n $lettera = strtr ($lettera, $alfabeto);\r\n $scelte.= $lettera;\r\n if (ereg ($lettera, $parola)) {\r\n $controllo = true;\r\n }\r\n else {\r\n $controllo = false;\r\n }\r\n $risposta = array ($scelte, $controllo);\r\n return $risposta;\r\n}", "function is_car_alpha($alpha){\n if(long_chaine($alpha)==1 && ($alpha >='a'&& $alpha <='z')|| ($alpha >='A'&& $alpha <='Z'))\n return true;\n return false;\n }", "private static function returnVowel ( $v )\n {\n return $v[ rand( 0, count( $v ) - 1 ) ];\n }", "function detect_any_lowercase($string) {\n return strtoupper($string) != $string;\n}", "public function isLetter(string $letter) : bool;", "public function checkLetter($letter){\n return strpos($this->currentPhrase, $letter) !== false;\n\n }", "function _s_has_letters( $string ) {\n\treturn preg_match( '/[a-zA-Z]/', $string );\n}", "public static function alpha($value,$len=3)\n\t{\n\t\tif($len == 2){\n\t\t\treturn Helper::searchArray($value,self::$countries_array,1);\n\t\t}\n\t\t\n\t\treturn Helper::searchArray($value,self::$countries_array,2);\n\t}", "protected function isVowelDetected($root){\n $pattern = '/.*?è.*?/';\n if (preg_match($pattern, $root)){\n return 'è';\n }\n $pattern = '/.*?ò.*?/';\n if (preg_match($pattern, $root)){\n return 'ò';\n }\n $pattern = '/.*?à.*?/';\n if (preg_match($pattern, $root)){\n return 'à';\n }\n }", "function dietCheck($diet){\n $key = array_search($diet, DIETS);\n if($key === false){\n return false;\n } else {\n return true;\n }\n}", "public static function getVowels(): array {\n\t\treturn self::$vowels;\n\t}", "function check_strings_in_array($arr){\r\n return array_sum(array_map(\"is_string\", $arr)) == count($arr);\r\n}", "function checkLetters($word, $guessed)\n{\n $len = strlen($word);\n $guessWord = str_repeat(\"_ \", $len);\n\n for ($i = 0; $i < $len; $i++)\n {\n $x = $word[$i];\n\n if (strstr($guessed, $x))\n {\n $position = 2 * $i;\n $guessWord[$position] = $x;\n }\n }\n return $guessWord;\n}", "function searchArray($arr=null, $index='', $str=''){\n\t$result = array();\n\tforeach ($arr as $key => $value) {\n\t\tif(strcasecmp($value[$index], $str)==0){\n\t\t\t$result[] = $value;\n\t\t}\n\t}\n\treturn $result;\n}", "function has_uppercase_letter($password)\n {\n /* \n Ideja je transformisati sifru u sifru zapisanu malim slovima i uporediti da se razlikuje od originalne.\n Na primer, ako je zadata sifra Abc123 njeg ekvivalent je sifra abc123 koja se razlikuje i na osnovu\n toga mozemo da zakljucimo da pocetna sifra sadrzi barem jedno veliko slovo. Ako je zadata sifra abc123, njen\n ekvivalent ostaje sifra abc123 pa mozemo da zakljucimo da ne sadrzi ni jedno veliko slovo.\n */\n\n $lowercased_password = strtolower($password);\n if ($lowercased_password != $password) {\n return TRUE;\n }\n\n return FALSE;\n }", "function detect_any_uppercase($string) {\n return strtolower($string) != $string;\n}", "function _is_devider($char)\n {\n return in_array($char, Strings::_word_deviders());\n }", "function is_car_alpha($car){\n while ((($car>='a' && $car<='z') || ($car>='A' && $car<='Z')) && (taille($car)==1)) {\n return true;\n }\n return false;\n}", "function isIsogramLoopInarray(string $str): bool\n{\n $chars = normalize($str);\n\n $been_found = [];\n foreach ($chars as $char) {\n if (in_array($char, $been_found, true)) {\n return false;\n }\n $been_found[] = $char;\n }\n return true;\n}", "function pangramCheck($sentence) {\n $sentArr = array_flip(str_split(strtolower($sentence)));\n foreach (range(\"a\", \"z\") as $step) {\n //echo $step;\n if (!isset($sentArr[$step])) {\n return false;\n }\n }\n return true;\n}", "function exists_in_array($val, $arr) {\n\tforeach ($arr as $key)\n\t{\n\t\t$key = strtolower($key);\n\t\t$val = strtolower($val);\n\t\t\n\t\tif ($key == $val)\n\t\t\treturn true;\n\t}\t\n}", "function my_in_array($j,$arrString)\n {\n $arrlength = count($arrString);\n for($i = 0;$i<$arrlength;$i++)\n {\n\n if($j == $arrString[$i])\n {\n\n return true;\n }\n else\n {\n\n return false;\n }\n\n }\n\n }", "private function has_lower($args){\n if(preg_match(\"/[a-z]/\", $args['value'])){\n return true;\n } else {\n $this->_warnings .= ucfirst($args['var']) . \" must contain at least one lowercase letter.<br/>\\r\\n\";\n return false;\n }\n }", "function formatCheck($array, $input){\n $valid = true;\n\n for($i = 0; $i < count($array); $i++){\n if(strpos($input,$array[$i]) !== false){\n $valid = false;\n }\n }\n\n return $valid;\n}", "function instr($haystack,$needle,$ignoreCase=false,$oneMatchOnly=false)\r\n{\r\n \r\n // 1. MULTIVERGLEICH STRING MIT ARRAY\r\n if (is_array($needle))\r\n {\r\n $anz = count($needle);\r\n \r\n for ($i=0;$i<$anz;$i++)\r\n {\r\n // EVERY ITEM NECESSARY\r\n if (!$oneMatchOnly) { \r\n if (!(instr($haystack,$needle[$i],$ignoreCase,$oneMatchOnly))) return false; }\r\n \r\n // ONE PARTLY MATCH ENOUGH\r\n else { \r\n if ( (instr($haystack,$needle[$i],$ignoreCase,$oneMatchOnly))) return true; } \r\n }\r\n \r\n if (!$oneMatchOnly) return true; // HAETTE SCHON FALSE ZURUECKGEGEBEN\r\n else return false; // WENN EINE MATCH GEFUNDEN WAERE, HATTE SCHON TRUE ZURUECKGEGEBEN\r\n }\r\n else\r\n {\r\n // 2. EINZELVERGLEICH STRING MIT STRING\r\n \r\n if ( (strlen($haystack)>0) and (strlen($needle)>0) )\r\n {\r\n if ($ignoreCase)\t$pos = stripos($haystack, $needle);\r\n else\t\t$pos = strpos($haystack, $needle);\r\n\r\n if ($pos === false) return false;\r\n else return true;\r\n }\r\n\r\n return false;\r\n }\r\n \r\n}", "private function alphabetical(string $value): bool\n {\n return preg_match('/^[ äöüèéàáíìóòôîêÄÖÜÈÉÀÁÍÌÓÒÔÊa-z]+$/i', $value);\n }", "function isSpecialChar($char){\n if(strtolower($char) === strtoupper($char)){\n return true;\n } else {\n return false;\n }\n}", "function Es_string($string){\n\tif (preg_match('/[^a-zA-Z]/',$string)){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n}", "function _o( $word ){\n if ( strlen($word) >= 3 ) {\n if ( $this->is_consonant($word, -1) && !$this->is_consonant($word, -2) &&\n $this->is_consonant($word, -3) ) {\n $last_char = substr($word, -1);\n if ( $last_char == 'w' || $last_char == 'x' || $last_char == 'y' ) {\n return false;\n }\n return true;\n }\n }\n return false;\n }", "function evaluateWord($arrayA, $b){\n $arrayB = str_split($b);\n\n for($i = 0; $i < strlen($arrayA) ; $i++){\n $char = $arrayA[$i];\n $index = strpos(implode($arrayB), $char);\n if($index !== FALSE){\n array_splice($arrayB, $index,1);\n }\n }\n if(strlen(implode($arrayB)) === 0){\n return TRUE;\n }else{\n return FALSE;\n }\n}", "public function testGetFirstLetterUmlaut() {\n\n\t\t$actual = $this->object->getFirstLetter('Öffentlichkeit');\n\n\t\t$expected = \"Ö\";\n\t\t$unexpected = \"o\";\n\t\t$this->assertEquals($expected, $actual);\n\t\t$this->assertNotEquals($unexpected, $actual);\n\t}", "function countVowels( $str )\n{\n $vowels = ['a','u','o','i','e'];\n // The following statement performs the following tasks:\n // Removes all vowels from the input text $str\n // Returns the subtraction of $str length - $str without vowels which is the number of vowels in a string.\n return strlen($str) - strlen(str_replace($vowels, \"\", strtolower($str)));\n}", "function getMarca($str)\n{\n $marques = array(\"SEAT\", \"VOLVO\",\"FORD\",\"NISSAN\",\"VOLKSWAGEN\",\"CADILLAC\");\n $str = strtoupper($str);\n return (in_string($marques, $str, \"any\"));\n \n}", "function verificarSoloLetras($cadena){ \n \t\treturn (ctype_alpha($cadena) or ($cadena == \"-\"));\n }", "public static function checkAlphabetic(string $value) {\n\t\treturn preg_match(self::CHCK_ALPHA_REG, $value);\n\t}", "public function testIsAlphamericBadCases() {\n $alphmericBadCases = array('#$&%^@-', '');\n\n foreach ($alphmericBadCases as $alphmericBadCase) {\n $result = $this->fieldObject->isAlphameric($alphmericBadCase);\n $this->assertEquals(false, $result);\n }\n }", "public function isLowerAssocCase();", "function verif_mdp($mdp) {\n $tableau = array(\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\");\n $test = 0;\n foreach ($tableau as $chiffre) {\n \n if(strpos($mdp,$chiffre) !== false) {\n $test = 1;\n }\n \n }\n if (strlen($mdp) < 8){\n return(false);\n }\n elseif($test == 0) {\n return (false);\n }\n elseif (is_numeric($mdp)) {\n return(false);\n }\n elseif (strtolower($mdp) == $mdp) {\n return(false);\n }\n elseif (strtoupper($mdp) == $mdp) {\n return(false);\n }\n else {\n return(true);\n }\n\n}", "public function testIsAlphamericGoodCases() {\n $alphmericGoodCases = array(\n 'ASDFGH123', 'ASFGH1234', '1234567', '555 abcdf', ' 89899999',\n '0000000000', 'ABCDEFGH'\n );\n\n foreach ($alphmericGoodCases as $alphmericGoodCase) {\n $result = $this->fieldObject->isAlphameric($alphmericGoodCase);\n $this->assertEquals(true, $result);\n }\n }", "function str_contains($str, array $chars)\n{\n\tforeach ($chars as $char)\n\t{\n\t\tif (strpos($str, $char) !== FALSE)\n\t\t\treturn (TRUE);\n\t}\n\treturn (FALSE);\n}", "public function caseCheck($data = [])\n {\n if (!is_array($data))\n die(\"Data you submitted is not using the correct type. Please check and try again.\");\n\n if (empty($data))\n die(\"You have submitted an empty data, please check your submission and try again.\");\n\n echo \"Q: Please write a production-ready PHP function that determines if a string starts with an upper-case letter A-Z✱\".PHP_EOL;\n\n return $this->runData($data);\n }", "public function is_alphabet($value)\n\t{\n\t\tif($this->is_empty($value) || preg_match('/^[a-zA-Z]+$/', trim($value))) \n\t\t{\n\t\t \treturn true;\n\t\t}\n\t\t return false;\n\t}", "function is_Char_Only($Invoer)\n{\n return (bool)(preg_match(\"/^[a-zA-Z ]*$/\", $Invoer)) ;\n}", "function DuplicateCheck($array, $value){\nfor ($i=0; $i < count($array); $i++)\n\t{\n\t\tif (trim(strtolower($array[$i])) == trim(strtolower($value))){\n\t\t\treturn $i;\n\t\t\tbreak;\n\t\t}\n\t}\nreturn -1;\n}", "public function testLetters()\n {\n $this->assertEquals('n h', Pinyin::letter('您好'));\n $this->assertEquals('n-h', Pinyin::letter('您好', array('delimiter' => '-')));\n $this->assertEquals('N-H', Pinyin::letter('您好', array('delimiter' => '-', 'uppercase' => true)));\n $this->assertEquals('c q', Pinyin::letter('重庆'));\n $this->assertEquals('z y', Pinyin::letter('重要'));\n $this->assertEquals('nh', Pinyin::letter('您好', array('delimiter' => '')));\n $this->assertEquals('kxll', Pinyin::letter('康熙来了', array('delimiter' => '')));\n $this->assertEquals('A B Z Z Q Z Z Z Z', Pinyin::letter(\"阿坝藏族羌族自治州\", array('uppercase' => true)));\n $this->assertEquals('d z x w q l x b d d z d g m h', Pinyin::letter('带着希望去旅行,比到达终点更美好'));\n $this->assertEquals('z q s l z w z w', Pinyin::letter('赵钱孙李 周吴郑王'));\n $this->assertEquals('l x', Pinyin::letter('旅行'));\n\n // issue #27\n $this->assertEquals('d l d n r', Pinyin::letter('独立的女人'));\n $this->assertEquals('n', Pinyin::letter('女'));\n $this->assertEquals('n r', Pinyin::letter('女人'));\n }", "function dos_in_array ($needle, $haystack) {\n\n $flipped_haystack = array_flip($haystack);\n if (isset($flipped_haystack[$needle])) {\n return true;\n }\n\n return false;\n\n}", "function find_missing_letter(array $array): string {\n \n $lettersInput = $array;\n $letters = range('a','z');\n if(ctype_upper($lettersInput[0]))\n $letters = range('A','Z');\n \n $new = array();\n foreach($lettersInput as $key=>$letter){\n $key = array_search($letter,$letters);\n $new[$key] = $letter;\n }\n \n \n $keys = array_keys($new);\n $prevKey = \"\";\n foreach($keys as $counter=>$key){\n \n if($counter == 0){\n $prevKey = $key;\n }else{\n if($key-$prevKey > 1)\n return $letters[$key-1];\n else\n $prevKey = $key;\n }\n }\n}", "private function searchShortSyllabe($from, $nbLetters)\n {\n $length = UTF8::strlen($this->word);\n\n if ($from < 0) {\n $from = $length + $from;\n }\n if ($from < 0) {\n $from = 0;\n }\n\n // (a) is just for beginning of the word\n if ( ($nbLetters == 2) && ($from != 0) ) {\n return false;\n }\n\n $first = UTF8::substr($this->word, $from, 1);\n $second = UTF8::substr($this->word, ($from+1), 1);\n\n if ($nbLetters == 2) {\n if ( (in_array($first, self::$vowels)) && (!in_array($second, self::$vowels)) ) {\n return true;\n }\n }\n\n $third = UTF8::substr($this->word, ($from+2), 1);\n\n if ( (!in_array($first, self::$vowels)) && (in_array($second, self::$vowels))\n && (!in_array($third, array_merge(self::$vowels, array('x', 'Y', 'w'))))) {\n return true;\n }\n\n return false;\n }", "public function matchAphabetic($subject){\r\n return (preg_match('/^[a-zA-Z]*$/', $subject) == 1) ? true : false;\r\n }", "function procura ($agulha, $arranjo) {\n\tif(in_array($agulha, $arranjo)) {\n\t\t\techo \"achei!\";\n\t\t} \n\t\telse {\n\t\t\techo \"nao achei...\";\n\t\t}\n\t}", "protected function isAsciiChars(array $chars)\n\t{\n\t\treturn ([1] === array_unique(array_map('strlen', $chars)));\n\t}", "function strpos_array($input, $needles, $offset=0)\n{\n\t$chr = array();\n\tforeach($needles as $needle) {\n\t\t$res = strpos($input, $needle, $offset);\n\t\tif ($res !== FALSE) $chr[$needle] = $res;\n\t}\n\n\tif (empty($chr)) {\n\t\treturn FALSE;\n\t}\n\n\treturn min($chr);\n\n}" ]
[ "0.6685009", "0.636366", "0.6308498", "0.62676716", "0.6139225", "0.61003196", "0.6054081", "0.5964238", "0.5953456", "0.5896216", "0.5890642", "0.58479", "0.58409274", "0.5822704", "0.58186316", "0.5815572", "0.58079344", "0.57829255", "0.57469803", "0.57341003", "0.5687168", "0.56594545", "0.5655552", "0.56528974", "0.56292623", "0.5616369", "0.56026894", "0.55427456", "0.5535661", "0.55353427", "0.5505318", "0.5473013", "0.5473013", "0.54682475", "0.54666954", "0.5430826", "0.541027", "0.5407562", "0.5395385", "0.5374867", "0.53545076", "0.5342004", "0.53293484", "0.53061336", "0.52958727", "0.5282864", "0.5276287", "0.5245772", "0.5223515", "0.5220869", "0.5215403", "0.52145326", "0.51629186", "0.5140462", "0.51361215", "0.5133362", "0.51315176", "0.51063263", "0.5104847", "0.50936586", "0.50920737", "0.50769705", "0.50766957", "0.5072871", "0.5066755", "0.50647527", "0.50607216", "0.5059958", "0.5053383", "0.5047433", "0.50378203", "0.50328785", "0.50305146", "0.5028013", "0.5027534", "0.50257325", "0.50172204", "0.5016979", "0.50129765", "0.50111043", "0.50016904", "0.5000392", "0.49977145", "0.49919853", "0.49801072", "0.4979275", "0.49789092", "0.4956583", "0.49378118", "0.49339724", "0.49336517", "0.49212146", "0.4913874", "0.4913097", "0.49037954", "0.49023855", "0.48957935", "0.48957145", "0.48920184", "0.48884168" ]
0.7071427
0
Determine first phase of word is Consonant or Cluster
Определите первую фазу слова — согласный или группа согласных
protected function isFirstIsConsonantOrCluster($word) { $latin_word = $this->getArrayFromLatinWord($word); if (count($this->getArrayFromLatinWord($word)) > 2) { if (!in_array($latin_word[0], $this->vowels) && !in_array($latin_word[1], $this->vowels) && in_array($latin_word[2], $this->vowels)) { return 'Cluster'; } elseif (!in_array($latin_word[0], $this->vowels) && in_array($latin_word[1], $this->vowels)) { return 'Consonant'; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_consonant( $word, $pos ){\n // Sanity checking $pos\n if ( abs($pos) > strlen($word) ) {\n if ( $pos < 0 ) {\n // Points \"too far back\" in the string. Set it to beginning.\n $pos = 0;\n } else {\n // Points \"too far forward.\" Set it to end.\n $pos = -1;\n }\n }\n $char = substr($word, $pos, 1);\n switch ( $char ) {\n case 'a':\n case 'e':\n case 'i':\n case 'o':\n case 'u':\n return false;\n case 'y':\n if ( $pos == 0 || strlen($word) == -$pos ) {\n // Check second letter of word.\n // If word starts with \"yy\", return true.\n if ( substr($word, 1, 1) == 'y' ) {\n return true;\n }\n return !($this->is_consonant($word, 1));\n } else {\n return !($this->is_consonant($word, $pos - 1));\n }\n default:\n return true;\n }\n }", "function count_vc( $word ){\n $m = 0;\n $length = strlen($word);\n $prev_c = false;\n for ( $i = 0; $i < $length; $i++ ) {\n $is_c = $this->is_consonant($word, $i);\n if ( $is_c ) {\n if ( $m > 0 && !$prev_c ) {\n $m += 0.5;\n }\n } else {\n if ( $prev_c || $m == 0 ) {\n $m += 0.5;\n }\n }\n $prev_c = $is_c;\n }\n $m = floor($m);\n return $m;\n }", "private function conjugatePerfect(string $word): string\n {\n $w = $this->orig;\n $nos = $this->nbr_of_sylls;\n $secondfirst = mb_substr($this->sylls[$nos-2], 0, 1);\n $secondlast = mb_substr($this->sylls[$nos-2], -1);\n if ($nos >= 3) {\n $thirdlast = mb_substr($this->sylls[$nos-3], -1);\n } else {\n $thirdlast = \"\";\n }\n\n switch ($this->last_syllabus) {\n case \"taa\": // tää\n $w[$nos-1] = mb_substr($w[$nos-1], 0, -1) . $this->ender;\n break;\n case \"da\": // dä\n $w[$nos-1] = $this->ender;\n break;\n case \"la\": // lä\n $w[$nos-1] = \"l\" . mb_substr($this->ender, 1);\n break;\n case \"ta\": // tä\n if ($this->isVerbClass72($word)) {\n $w[$nos-1] = \"\";\n $w = $this->taVerb72ForPerfect($word, $w, $nos, $secondfirst, $secondlast, $thirdlast);\n // if last is wovel then nnut, else nut\n if (in_array(mb_substr($w[$nos-2], -1), $this->wovels)) {\n $w[$nos-1] = \"n\".$this->ender;\n } else {\n $w[$nos-1] = mb_substr($this->ender, 1);\n }\n } else { // verb class 74\n // kontata, rynnätä\n $w[$nos-1] = \"n\".$this->ender;\n }\n break;\n case \"a\": // ä\n $w[$nos-1] = $this->ender;\n break;\n case \"paa\": // lappaa, nappaa\n $w[$nos-1] = mb_substr($w[$nos-1], 0, -1).$this->ender;\n break;\n case \"na\": // mennä\n $w[$nos-1] = \"n\" . mb_substr($this->ender, 1);\n break;\n case \"ra\": // purra\n $w[$nos-1] = \"r\" . mb_substr($this->ender, 1);\n break;\n case \"kaa\": // alkaa, jakaa, purkaa\n $w[$nos-1] = mb_substr($w[$nos-1], 0, -1).$this->ender;\n break;\n case \"jaa\": // ajaa\n case \"nee\": // tarkenee\n case \"laa\": // palaa\n default: // jaksaa, maksaa, jauhaa, kalvaa, nauraa, painaa\n $w[$nos-1] = mb_substr($w[$nos-1], 0, -1) . $this->ender;\n break;\n }\n\n return $this->buildWord($w);\n }", "private static function consonant(): string {\n\t\tif (rand(0, 1) === 1) {\n\t\t\tif (self::$wordCount === 0) {\n\t\t\t\t$cons = self::$doubleConsonantsFirst[rand(0, count(self::$doubleConsonantsFirst) - 1)];\n\t\t\t} else {\n\t\t\t\t$cons = self::$doubleConsonantsAnywhere[rand(0, count(self::$doubleConsonantsAnywhere) - 1)];\n\t\t\t}\n\t\t} else {\n\t\t\t$cons = self::$consonants[rand(0, count(self::$consonants) - 1)];\n\t\t}\n\n\t\tif (self::$rareCharactersChance < 100 && is_array(self::$rareCharacters) && count(self::$rareCharacters) > 0) {\n\t\t\tforeach (mb_str_split($cons) as $letter) {\n\t\t\t\tif (in_array($letter, self::$rareCharacters) && rand(1, 100) > self::$rareCharactersChance) {\n\t\t\t\t\treturn self::consonant();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $cons;\n\t}", "private function conjugatePreesensWithGradation(string $word, string $a): string\n {\n $w = $this->orig;\n $nos = $this->nbr_of_sylls;\n // aak-kos-taa\n // $secondlast = aakko(s)taa\n // $secondfirst = aak(k)ostaa\n // thirdlast = aa(k)kostaa\n if ($nos >= 3) {\n $thirdlast = mb_substr($this->sylls[$nos-3], -1);\n } else {\n $thirdlast = \"\";\n }\n $secondfirst = mb_substr($this->sylls[$nos-2], 0, 1);\n $secondlast = mb_substr($this->sylls[$nos-2], -1);\n\n switch ($this->last_syllabus) {\n case \"taa\": // tää\n $w = $this->taaVerb($w, $nos, $secondlast, $a);\n $w[$nos-1] .= $this->ender;\n break;\n case \"da\": // dä\n if ($secondlast == \"h\") { // tehdä, nähdä\n $w[$nos-2] = mb_substr($w[$nos-2], 0, -1);\n $w[$nos-1] = self::E.$this->ender;\n } else {\n $w[$nos-1] = $this->ender;\n }\n break;\n case \"la\": // lä\n $w = $this->laVerb($w, $nos, $secondfirst, $thirdlast);\n $w[$nos-1] = self::E.$this->ender;\n break;\n case \"ta\": // tä\n // verb match class 72\n if ($this->isVerbClass72($word)) {\n $w[$nos-1] = \"\";\n $w = $this->taVerb72($word, $w, $nos, $secondfirst, $secondlast, $thirdlast);\n \n // if last is wovel then nen, else en\n if (in_array(mb_substr($w[$nos-2], -1), $this->wovels)) {\n $w[$nos-1] = \"n\".self::E.$this->ender;\n } else {\n $w[$nos-1] = self::E.$this->ender;\n }\n } else { // verb class 74\n $w = $this->taVerb74($word, $w, $nos, $secondfirst, $secondlast, $thirdlast);\n $w[$nos-1] = $a.$this->ender;\n }\n break;\n case \"a\": // ä\n $w = $this->aVerb($w, $nos, $secondfirst, $thirdlast);\n $w[$nos-1] = $this->ender;\n break;\n case \"paa\": // lappaa, nappaa\n $w[$nos-1] = $a.$this->ender;\n break;\n case \"na\": // mennä\n case \"ra\": // purra\n $w[$nos-1] = self::E.$this->ender;\n break;\n case \"kaa\": // alkaa, jakaa\n if (in_array($secondlast, array(\"l\", \"a\", \"r\"))) { // alkaa, jakaa, purkaa\n $w[$nos-1] = mb_substr($w[$nos-1], 1, -1).$this->ender;\n } else { // jatkaa\n $w[$nos-1] = mb_substr($w[$nos-1], 0, -1).$this->ender;\n }\n break;\n case \"jaa\": // ajaa\n case \"nee\": // tarkenee\n case \"laa\": // palaa\n default: // jaksaa, maksaa, jauhaa, kalvaa, nauraa, painaa\n $w[$nos-1] = mb_substr($w[$nos-1], 0, -1).$this->ender;\n break;\n }\n \n return $this->buildWord($w);\n }", "function _o( $word ){\n if ( strlen($word) >= 3 ) {\n if ( $this->is_consonant($word, -1) && !$this->is_consonant($word, -2) &&\n $this->is_consonant($word, -3) ) {\n $last_char = substr($word, -1);\n if ( $last_char == 'w' || $last_char == 'x' || $last_char == 'y' ) {\n return false;\n }\n return true;\n }\n }\n return false;\n }", "function getConnotationScore($text) {\n\t\t$score = 0;\n\t\t$text = strtolower($text);\n\t\t//Recently found positvie words in posts that I feel reflected positive connotations\n\t\t$posArray = array(1 => 'good', 2 => 'great', 3 => 'thank', 4 => 'happ', 5 => 'lov', \n\t\t\t\t\t\t\t6 => 'luck', 7 => 'inspir', 8 => 'satisf', 9 => 'support' , 10 => 'dream');\n\t\t//Recently found profanity and/or negative words in posts that I feel reflected negative connotations\n\t\t$negArray = array(1 => 'bad', 2 => 'wors', 3 => 'never', 4 => 'hate', 5 => 'horribl', \n\t\t\t\t\t\t\t6 => 'terribl', 7 => 'shit', 8 => 'stupid', 9 => 'fuck' , 10 => 'suck');\n\t\tforeach ($posArray as $value) {\n\t\t\t$score += substr_count($text, $value);\n\t\t}\n\t\tforeach ($negArray as $value) {\n\t\t\t$score -= substr_count($text, $value);\n\t\t}\n\t\tif ($score > 0) {\n\t\t\treturn \"\".$score.\" (Positive)\";\n\t\t}\n\t\telseif ($score < 0) {\n\t\t\treturn \"\".$score.\" (Negative)\";\n\t\t}\n\t\treturn \"\".$score.\" (Neutral)\";\n\t}", "function classify($word)\n{\n return CString::classify($word);\n}", "public function hasClusterOp(){\n return $this->_has(2);\n }", "public function testCalculateWordFirstQuestion()\n {\n $challenge = new Challenge(\"Joe Savage\");\n $answer = $challenge->calculateWordQuestion(\"trusting\", 2, \"first\");\n $this->tester->assertEquals(\"tr\", $answer);\n }", "private static function isClustered($string)\n {\n return $string[0] === '-' && $string[1] != '-' && strlen($string) > 2;\n }", "function is_initial($word) {\n return ((strlen($word) == 1) || (strlen($word) == 2 && $word[1] == \".\"));\n}", "private static function classical($word) {\n\t\t\tforeach(self::$classical_inflections as $inflection=>$inflected_form) {\n\t\t\t\t$inflection_root = substr($inflection, 1);\n\t\t\t\t$inflection = \".*{$inflection_root}\";\n\t\t\t\t$inflected_form = substr($inflected_form, 1);\n\t\t\t\tif(preg_match(\"/{$inflection}$/\", $word) == 1) {\n\t\t\t\t\t// print \"Warning: classical inflection detected ({$word})\\n\";\n\t\t\t\t\treturn str_replace($inflection_root, $inflected_form, $word); // if the word matches the regex (once), then return the word\n\t\t\t\t}\n\t\t\t}\n\t\t\t// now for singular form\n\t\t\tforeach(self::$classical_inflections as $inflected_form=>$inflection) {\n\t\t\t\t$inflection_root = substr($inflection, 1);\n\t\t\t\t$inflection = \".*{$inflection_root}\";\n\t\t\t\t$inflected_form = substr($inflected_form, 1);\n\t\t\t\tif(preg_match(\"/{$inflection}$/\", $word) == 1) {\n\t\t\t\t\t// print \"Warning: classical inflection detected ({$word})\\n\";\n\t\t\t\t\treturn str_replace($inflection_root, $inflected_form, $word); // if the word matches the regex (once), then return the word\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}", "function isAnnkissam($inputSpaceSeparatedString) {\n\n $nouns = [\"abcd\", \"c\", \"def\", \"h\", \"ij\", \"cde\"];\n $verbs = [\"bc\", \"fg\", \"g\", \"hij\", \"bcd\"];\n $articles = [\"a\", \"ac\", \"e\"];\n\n $arrayOfWords = explode(\" \", $inputSpaceSeparatedString);\n\n $numberOfNouns = 0;\n $numberOfVerbs = 0;\n $numberOfArticles = 0;\n\n $correctSentence = false;\n\n foreach ($arrayOfWords as $currentString) {\n if (in_array($currentString, $nouns)) {\n $numberOfNouns = $numberOfNouns + 1;\n }\n if (in_array($currentString, $verbs)) {\n $numberOfVerbs = $numberOfVerbs + 1;\n }\n if (in_array($currentString, $articles)) {\n $numberOfArticles = $numberOfArticles + 1;\n }\n }\n\n if ($numberOfVerbs >= 1 && ($numberOfNouns >= 1 || $numberOfArticles >= 2) && (($numberOfNouns + $numberOfVerbs + $numberOfArticles) == count($arrayOfWords))) {\n $correctSentence = true;\n }\n\n return $correctSentence;\n\n }", "function cologne_phone($_word)\n {\n /**\n * @param string $_word string to be analyzed\n * @return string $value represents the K?lner Phonetik value\n * @access public\n */\n\n //prepare for processing\n $_word = strtolower($_word);\n $substitution = array(\n '?'=>'a',\n '?'=>'o',\n '?'=>'u',\n '?'=>'ss',\n 'ph'=>'f'\n );\n\n foreach($substitution as $letter => $substitution)\n $_word = str_replace($letter, $substitution, $_word);\n \n $len = strlen($_word);\n \n //Rule for exeptions\n $exceptionsLeading = array(\n 4=>array('ca','ch','ck','cl','co','cq','cu','cx'),\n 8=>array('dc','ds','dz','tc','ts','tz')\n );\n \n $exceptionsFollowing = array('sc','zc','cx','kx','qx');\n \n //Table for coding\n $codingTable = array(\n 0 => array('a','e','i','j','o','u','y'),\n 1 => array('b','p'),\n 2 => array('d','t'),\n 3 => array('f','v','w'),\n 4 => array('c','g','k','q'),\n 48 => array('x'),\n 5 => array('l'),\n 6 => array('m','n'),\n 7 => array('r'),\n 8 => array('c','s','z')\n );\n \n for($i=0; $i < $len; $i++)\n {\n $value[$i] = '';\n \n //Exceptions\n if($i==0 AND $len > 1 AND $_word[$i].$_word[$i+1] == 'cr')\n $value[$i] = 4;\n \n if($i < ($len - 1))\n {\n foreach($exceptionsLeading as $code=>$letters)\n {\n if(in_array($_word[$i].$_word[$i+1],$letters))\n $value[$i] = $code;\n }\n }\n \n if($i AND in_array($_word[$i-1].$_word[$i], $exceptionsFollowing))\n $value[$i] = 8;\n \n //Normal encoding\n if($value[$i] == '')\n {\n foreach($codingTable as $code => $letters)\n {\n if(in_array($_word[$i], $letters))\n $value[$i] = $code;\n }\n }\n }\n\n //delete double values\n $len=count($value);\n\n for($i=1;$i<$len;$i++)\n {\n if($value[$i] == $value[$i-1])\n $value[$i] = '';\n }\n\n //delete vocals\n for ($i=1;$i>$len;$i++)\n {\n //omitting first characer code and h\n if($value[$i] == 0)\n $value[$i] = '';\n }\n\n\n $value = array_filter($value);\n $value = implode('', $value);\n\n return $value;\n }", "public function getSingularNoun();", "public function isConstruct()\n\t\t{\n\t\t\treturn $this->_Type==TLV_TYPE_CONSTRUCTED;\n\t\t}", "public static function getDoubleConsonantsFirst(): array {\n\t\treturn self::$doubleConsonantsFirst;\n\t}", "function isStronglyConnected();", "private function primeraConsonanteInterna( $cadena ) {\n \tfor ($index = 1; $index < strlen($cadena); $index++) {\n \t\tif (!$this->esVocal($cadena[$index])){ return $cadena[$index]; }\n \t}\n }", "public function getCctbconfterms01()\n {\n return $this->cctbconfterms01;\n }", "function categorize($document) {\n\t\t$scores = array();\n\t\t$categories = $this->nbs->getCategories();\n\n\t\t$tokens = $this->_getTokens($document);\n\t\t// calculate the score in each category\n\t\t$total_words = 0;\n\t\t$ncat = 0;\n\t\twhile (list($category, $data) = each($categories)) {\n\t\t\t$total_words += $data['wordcount'];\n\t\t\t$ncat++;\n\t\t}\n\t\treset($categories);\n\t\twhile (list($category, $data) = each($categories)) {\n\t\t\t$scores[$category] = $data['probability'];\n\t\t\t//debug: print_r($scores);\n\t\t\t// small probability for a word not in the category\n\t\t\t// maybe putting 1.0 as a 'no effect' word can also be good\n\t\t\t$small_proba = 1.0 / ($data['wordcount'] * 2);\n\t\t\treset($tokens);\n\t\t\twhile (list($token, $count) = each($tokens)) {\n\t\t\t\t//debug: echo \"<br/>$token; $count \";\n\t\t\t\tif ($this->nbs->wordExists($token)) {\n\t\t\t\t\t//debug: echo \"$category = known $small_proba wordcount: \";\n\t\t\t\t\t$word = $this->nbs->getWord($token, $category);\n\t\t\t\t\t//debug: echo $word['wordcount'];\n\t\t\t\t\tif ($word['wordcount']) $proba = $word['wordcount']/$data['wordcount'];\n\t\t\t\t\telse $proba = $small_proba;\n\t\t\t\t\t$newval = $scores[$category] * pow($proba, $count)*pow($total_words/$ncat, $count);\n\t\t\t\t\tif (is_finite($newval)) {\n\t\t\t\t\t\t$scores[$category] = $newval;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} // while (list () )\n\t\treturn $this->_rescale($scores);\n\t}", "function stem($word)\n{\n $step2list = array('ational'=>'ate',\n 'tional'=>'tion',\n 'enci'=>'ence',\n 'anci'=>'ance',\n 'izer'=>'ize',\n 'iser'=>'ise',\n 'bli'=>'ble',\n 'alli'=>'al',\n 'entli'=>'ent',\n 'eli'=>'e',\n 'ousli'=>'ous',\n 'ization'=>'ize',\n 'isation'=>'ise',\n 'ation'=>'ate',\n 'ator'=>'ate',\n 'alism'=>'al',\n 'iveness'=>'ive',\n 'fulness'=>'ful',\n 'ousness'=>'ous',\n 'aliti'=>'al',\n 'iviti'=>'ive',\n 'biliti'=>'ble',\n 'logi'=>'log');\n\n $step3list = array('icate'=>'ic',\n 'ative'=>'',\n 'alize'=>'al',\n 'alise'=>'al',\n 'iciti'=>'ic',\n 'ical'=>'ic',\n 'ful'=>'',\n 'ness'=>'');\n\n $c = \"[^aeiou]\"; # consonant\n $v = \"[aeiouy]\"; # vowel\n $C = \"${c}[^aeiouy]*\"; # consonant sequence\n $V = \"${v}[aeiou]*\"; # vowel sequence\n\n $mgr0 = \"^(${C})?${V}${C}\"; # [C]VC... is m>0\n $meq1 = \"^(${C})?${V}${C}(${V})?\" . '$'; # [C]VC[V] is m=1\n $mgr1 = \"^(${C})?${V}${C}${V}${C}\"; # [C]VCVC... is m>1\n $_v = \"^(${C})?${v}\"; # vowel in stem\n\n if (strlen($word)<3) return $word;\n\n $word=preg_replace(\"/^y/\", \"Y\", $word);\n\n // Step 1a\n $word=preg_replace(\"/(ss|i)es$/\", \"\\\\1\", $word); // sses-> ss, ies->es\n $word=preg_replace(\"/([^s])s$/\", \"\\\\1\", $word); // ss->ss but s->null\n\n // Step 1b\n if (preg_match(\"/eed$/\", $word))\n {\n $stem=preg_replace(\"/eed$/\", \"\", $word);\n if (ereg(\"$mgr0\", $stem))\n {\n $word=preg_replace(\"/.$/\", \"\", $word);\n }\n }\n elseif (preg_match(\"/(ed|ing)$/\", $word))\n {\n $stem=preg_replace(\"/(ed|ing)$/\", \"\", $word);\n if (preg_match(\"/$_v/\", $stem))\n {\n $word=$stem;\n\n if (preg_match(\"/(at|bl|iz|is)$/\", $word))\n {\n $word=preg_replace(\"/(at|bl|iz|is)$/\", \"\\\\1e\", $word);\n }\n elseif (preg_match(\"/([^aeiouylsz])\\\\1$/\", $word))\n {\n $word=preg_replace(\"/.$/\", \"\", $word);\n }\n elseif (preg_match(\"/^${C}${v}[^aeiouwxy]$/\", $word))\n {\n $word.=\"e\";\n }\n }\n }\n\n // Step 1c (weird rule)\n if (preg_match(\"/y$/\", $word))\n {\n $stem=preg_replace(\"/y$/\", \"\", $word);\n if (preg_match(\"/$_v/\", $stem))\n {\n $word=$stem.\"i\";\n }\n }\n\n // set up our stupidly long re's here\n $step2RE = \"/(ational|tional|enci|anci|izer|iser|bli|alli|entli|eli|ousli|ization|isation|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/\";\n $step3RE = \"/(icate|ative|alize|alise|iciti|ical|ful|ness)$/\";\n $step4RE = \"/(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize|ise)$/\";\n\n // Step 2: get ready for some long regexps\n if (preg_match($step2RE, $word, $matches))\n {\n $stem = preg_replace($step2RE, \"\", $word);\n $suffix = $matches[1];\n if (preg_match(\"/$mgr0/\", $stem))\n {\n $word = $stem.$step2list[$suffix];\n }\n }\n\n // Step 3\n if (preg_match($step3RE, $word, $matches))\n {\n $stem=preg_replace($step3RE, \"\", $word);\n $suffix=$matches[1];\n if (preg_match(\"/$mgr0/\", $stem))\n {\n $word=$stem.$step3list[$suffix];\n }\n }\n\n // Step 4\n if (preg_match($step4RE, $word, $matches))\n {\n $stem=preg_replace($step4RE, \"\", $word);\n $suffix=$matches[1];\n if (preg_match(\"/$mgr1/\", $stem))\n {\n $word=$stem;\n }\n }\n elseif (preg_match(\"/(s|t)ion$/\", $word))\n {\n $stem=preg_replace(\"/(s|t)ion$/\", \"\\\\1\", $word);\n if (preg_match(\"/$mgr1/\", $stem)) $word=$stem;\n }\n\n // Step 5\n if (preg_match(\"/e$/\", $word, $matches))\n {\n $stem=preg_replace(\"/e$/\", \"\", $word);\n if (preg_match(\"/$mgr1/\", $stem) ||\n (preg_match(\"/$meq1/\", $stem) &&\n ~preg_match(\"/^${C}${v}[^aeiouwxy]$/\", $stem)))\n {\n $word = $stem;\n }\n }\n\n if (preg_match(\"/ll$/\", $word) & preg_match(\"/$mgr1/\", $word))\n {\n $word = preg_replace(\"/.$/\", \"\", $word);\n }\n\n // and turn initial Y back to y\n preg_replace(\"/^Y/\", \"y\", $word);\n\n return $word;\n}", "public function c_value_yes() {\r\n $pattern = \"/(?:(?<=\\s)|(?<=^))\" . preg_quote($this->string2, '/') . \"(?:(?=\\s)|(?=$))/i\";\r\n // Match the pattern to check if the word exists in the string.\r\n $exists = preg_match($pattern, $this->string1, $matches, PREG_OFFSET_CAPTURE, $this->initial_pos);\r\n // If the word exists, return its first occurence.\r\n if ($exists) {\r\n $string_position = $matches[0][1];\r\n }\r\n else {\r\n $string_position = 'No Worries';\r\n }\r\n return $string_position;\r\n }", "public function csc_match() {\n\n\t\treturn $this->get_csc_result() === self::CSC_MATCH;\n\t}", "public static function getConsonants(): array {\n\t\treturn self::$consonants;\n\t}", "public function getClustersCenter();", "public function getConector()\n {\n return $this->conector;\n }", "public function isCooperative()\n {\n return false;\n }", "public function singular(string $word): string;", "private function translateConsonants($word)\n {\n $body = '';\n $suffix = '';\n\n foreach (str_split($word) as $index => $char)\n {\n if ($this->isVowel($char) || ($char == 'y' && $index > 0))\n {\n $body = substr($word, $index);\n break;\n }\n\n $suffix .= $char;\n }\n\n return $body . $suffix . self::$endWith;\n }", "public function isSentenceCase() {\n return PortableStringProcesser::isSentenceCase($this->_s, $this->_encoding);\n }", "protected function getCderTransmission()\n {\n $words = implode('|', $this->autoTransmissionWords);\n $isAutomatic = preg_match( \"/\\b($words)\\b/i\", $this->excelRow->transmission);\n return $isAutomatic ? 'A' : 'M';\n }", "private function isConjunction($word)\n {\n return in_array($word, Conjunction::getConjunctions());\n }", "public function isWord(): bool\n {\n return ($this->token_type == self::WORD);\n }", "function singularize($word)\n{\n return CString::singularize($word);\n}", "public function generate_challenge() {\n\t\t// Load words from the current language and randomize them\n\t\t$words = Kohana::lang ( 'captcha.words' );\n\t\tshuffle ( $words );\n\t\t\n\t\t// Loop over each word...\n\t\tforeach ( $words as $word ) {\n\t\t\t// ...until we find one of the desired length\n\t\t\tif (abs ( Captcha::$config ['complexity'] - strlen ( $word ) ) < 2)\n\t\t\t\treturn strtoupper ( $word );\n\t\t}\n\t\t\n\t\t// Return any random word as final fallback\n\t\treturn strtoupper ( $words [array_rand ( $words )] );\n\t}", "protected function rv()\n {\n $length = UTF8::strlen($this->word);\n\n $this->rv = '';\n $this->rvIndex = $length;\n\n if ($length < 3) {\n return true;\n }\n\n $first = UTF8::substr($this->word, 0, 1);\n $second = UTF8::substr($this->word, 1, 1);\n\n // If the second letter is a consonant, RV is the region after the next following vowel,\n if (!in_array($second, static::$vowels)) {\n for ($i=2; $i<$length; $i++) {\n $letter = UTF8::substr($this->word, $i, 1);\n if (in_array($letter, static::$vowels)) {\n $this->rvIndex = $i + 1;\n $this->rv = UTF8::substr($this->word, ($i+1));\n return true;\n }\n }\n }\n\n // or if the first two letters are vowels, RV is the region after the next consonant,\n if ( (in_array($first, static::$vowels)) && (in_array($second, static::$vowels)) ) {\n for ($i=2; $i<$length; $i++) {\n $letter = UTF8::substr($this->word, $i, 1);\n if (! in_array($letter, static::$vowels)) {\n $this->rvIndex = $i + 1;\n $this->rv = UTF8::substr($this->word, ($i+1));\n return true;\n }\n }\n }\n\n // and otherwise (consonant-vowel case) RV is the region after the third letter.\n if ( (! in_array($first, static::$vowels)) && (in_array($second, static::$vowels)) ) {\n $this->rv = UTF8::substr($this->word, 3);\n $this->rvIndex = 3;\n return true;\n }\n }", "function Coche(){\n\t\t\t$this->rueda = 4;\n\t\t\t$this->color = \"\";\n\t\t\t$this->motor = 1.8;\n\t\t}", "public function singular( $word ){\n\t\t$length = strlen( $word );\n\t\t$last_letter = substr( $word, $length - 1 );\n\t\t$last_2_letters = substr( $word, $length - 2 );\n\t\t$last_3_letters = substr( $word, $length - 3 );\n\t\tif( $last_3_letters == \"ies\" ){\n\t\t\treturn substr( $word, 0, $length - 3 ) . \"y\";\n\t\t} elseif( $last_2_letters == \"es\" ){\n\t\t\treturn substr( $word, 0, $length - 2 ) . \"e\";\n\t\t} elseif( $last_letter == \"s\" ){\n\t\t\treturn substr( $word, 0, $length - 1 );\n\t\t} else {\n\t\t\treturn $word;\n\t\t}\n\t}", "public function getIsOcContinuation()\n {\n return isset($this->IsOcContinuation) ? $this->IsOcContinuation : null;\n }", "final protected function isCensoredByDefault()\n {\n return $this->i__censor_default;\n }", "function extract_cont($word_list) {\r\n\t$n = count($word_list);\r\n\t$last = \"\";\r\n\t$num_ems = 0;\r\n\tfor ($h=1;$h<$n;$h++) {\r\n\t\t$primo = key($word_list);\r\n\t\tnext($word_list);\r\n\t\t$secondo = key($word_list);\r\n\t\t$dist = $secondo - $primo;\r\n\t\tif ($dist>1) {\r\n\t\t\tif ($last<>\"continuos\") {\r\n\t\t\t\t$word_list[$primo] = \"\";\r\n\t\t\t}\r\n\t\t\t$last = \"\";\r\n\t\t}\r\n\t\telse { $last = \"continuos\"; }\r\n\r\n\t}\r\n\t// CANCELLA L'ULTIMO ELEMENTO SE DISCONTINUO\r\n\tif ($dist>1) { $word_list[$secondo] = \"\"; }\r\n\t$word_list = array_diff($word_list,array(\"\"));\r\n\r\n\tif (swd($word_list)<>0) {\r\n\t\t// echo \"CA N CE STA NIENT A FA\\n\";\r\n\t\t$word_list = false;\r\n\t}\r\n\treturn $word_list;\r\n}", "function sample_train($cl) {\r\n\t$cl->train('Nobody owns the water.', 'good');\r\n\t$cl->train('the quick rabbit jumps fences', 'good');\r\n\t$cl->train('buy pharmaceuticals now', 'bad');\r\n\t$cl->train('make quick money at the online casino', 'bad');\r\n\t$cl->train('the quick brown fox jumps', 'good');\r\n}", "protected function isFirstY($word)\n {\n $first_element = $this->getArrFirstLetterOfLatinWord(\n $this->getArrayFromLatinWord(\n $word\n )\n );\n if (strtolower($first_element[0]) == 'y') {\n return true;\n }\n return false;\n }", "public function isCaseSensitive()\n {\n return (string)$this->captchaData->getConfig('case_sensitive');\n }", "public function getPrimaryTactic()\n {\n return $this->primary_tactic;\n }", "static function singularise($word)\n\t{\n\t\tif (substr($word, -3) == 'ies')\n\t\t\tif (strlen($word) > 4)\n\t\t\t\treturn substr($word, 0, -3) . 'y';\n\t\t\t\t\n\t\t// e.g. faxes -> fax\n\t\tif (substr($word, -3) == 'xes' && strlen($word) > 4)\n\t\t\treturn substr($word, 0, -2);\n\t\t\n\t\t// e.g. banjoes -> banjo\n\t\tif (substr($word, -3) == 'oes' && strlen($word) > 4)\n\t\t\treturn substr($word, 0, -2);\n\t\t\t\n\t\t// e.g. dogs -> dog\n\t\tif (substr($word, -1) == 's')\n\t\t\treturn substr($word, 0, -1);\n\t\t\n\t\t// not plural\n\t\treturn $word;\n\t}", "function singularize($params) {\n if (is_string($params)) {\n $word = $params;\n } else if (!$word = $params['word']) {\n return false;\n }\n\n $singular = array (\n '/(quiz)zes$/i' => '\\\\1',\n '/(matr)ices$/i' => '\\\\1ix',\n '/(vert|ind)ices$/i' => '\\\\1ex',\n '/^(ox)en/i' => '\\\\1',\n '/(alias|status)es$/i' => '\\\\1',\n '/([octop|vir])i$/i' => '\\\\1us',\n '/(cris|ax|test)es$/i' => '\\\\1is',\n '/(shoe)s$/i' => '\\\\1',\n '/(o)es$/i' => '\\\\1',\n '/(bus)es$/i' => '\\\\1',\n '/([m|l])ice$/i' => '\\\\1ouse',\n '/(x|ch|ss|sh)es$/i' => '\\\\1',\n '/(m)ovies$/i' => '\\\\1ovie',\n '/(s)eries$/i' => '\\\\1eries',\n '/([^aeiouy]|qu)ies$/i' => '\\\\1y',\n '/([lr])ves$/i' => '\\\\1f',\n '/(tive)s$/i' => '\\\\1',\n '/(hive)s$/i' => '\\\\1',\n '/([^f])ves$/i' => '\\\\1fe',\n '/(^analy)ses$/i' => '\\\\1sis',\n '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\\\\1\\\\2sis',\n '/([ti])a$/i' => '\\\\1um',\n '/(n)ews$/i' => '\\\\1ews',\n '/s$/i' => ''\n );\n\n $irregular = array(\n 'person' => 'people',\n 'man' => 'men',\n 'child' => 'children',\n 'sex' => 'sexes',\n 'move' => 'moves'\n );\n\n $ignore = array(\n 'equipment',\n 'information',\n 'rice',\n 'money',\n 'species',\n 'series',\n 'fish',\n 'sheep',\n 'press',\n 'sms',\n );\n\n $lower_word = strtolower($word);\n\n foreach ($ignore as $ignore_word) {\n if (substr($lower_word, (-1 * strlen($ignore_word))) == $ignore_word)\n {\n return $word;\n }\n }\n\n foreach ($irregular as $singular_word => $plural_word) {\n if (preg_match('/('.$plural_word.')$/i', $word, $arr)) {\n return preg_replace('/('.$plural_word.')$/i', substr($arr[0],0,1).substr($singular_word,1), $word);\n }\n }\n\n foreach ($singular as $rule => $replacement) {\n if (preg_match($rule, $word)) {\n return preg_replace($rule, $replacement, $word);\n }\n }\n return $word;\n }", "public function isSeguimientoSCC(){ return false; }", "function get_caverphone_code($word)\n\t{\n\t\t// Convert to lowercase\n\t\t$word = strtolower($word);\n\n\t\t// Remove anything not in the standard alphabet (typically a-z)\n\t\t// NOTE: This may vary if the set of letters includes characters such as æ, ā, or ø\n\t\t$word = preg_replace('/[^a-z]/', '', $word);\n\n\t\t// Remove \"final e\"\n\t\t$word = preg_replace('/e$/', '', $word);\n\n\t\t// If the word \"starts with cough\", make it \"cou2f\"\n\t\t$word = preg_replace('/^cough/', 'cou2f', $word);\n\n\t\t// If the word \"starts with rough\", make it \"rou2f\"\n\t\t$word = preg_replace('/^rough/', 'rou2f', $word);\n\n\t\t// If the word \"starts with tough\", make it \"tou2f\"\n\t\t$word = preg_replace('/^tough/', 'tou2f', $word);\n\n\t\t// If the word \"starts with enough\", make it \"enou2f\"\n\t\t$word = preg_replace('/^enough/', 'enou2f', $word);\n\n\t\t// If the word \"starts with trough\", make it \"trou2f\"\n\t\t$word = preg_replace('/^trough/', 'trou2f', $word);\n\n\t\t// If the word \"starts with gn\", make it \"2n\"\n\t\t$word = preg_replace('/^gn/', '2n', $word);\n\n\t\t// If the word \"ends with mb\", make it \"m2\"\n\t\t$word = preg_replace('/mb$/', 'm2', $word);\n\n\t\t// Replace \"cq\" with \"2q\"\n\t\t$word = str_replace('cq', '2q', $word);\n\n\t\t// Replace \"ci\" with \"si\"\n\t\t$word = str_replace('ci', 'si', $word);\n\n\t\t// Replace \"ce\" with \"se\"\n\t\t$word = str_replace('ce', 'se', $word);\n\n\t\t// Replace \"cy\" with \"sy\"\n\t\t$word = str_replace('cy', 'sy', $word);\n\n\t\t// Replace \"tch\" with \"2ch\"\n\t\t$word = str_replace('tch', '2ch', $word);\n\n\t\t// Replace \"c\" with \"k\"\n\t\t$word = str_replace('c', 'k', $word);\n\n\t\t// Replace \"q\" with \"k\"\n\t\t$word = str_replace('q', 'k', $word);\n\n\t\t// Replace \"x\" with \"k\"\n\t\t$word = str_replace('x', 'k', $word);\n\n\t\t// Replace \"v\" with \"f\"\n\t\t$word = str_replace('v', 'f', $word);\n\n\t\t// Replace \"dg\" with \"2g\"\n\t\t$word = str_replace('dg', '2g', $word);\n\n\t\t// Replace \"tio\" with \"sio\"\n\t\t$word = str_replace('tio', 'sio', $word);\n\n\t\t// Replace \"tia\" with \"sia\"\n\t\t$word = str_replace('tia', 'sia', $word);\n\n\t\t// Replace \"d\" with \"t\"\n\t\t$word = str_replace('d', 't', $word);\n\n\t\t// Replace \"ph\" with \"fh\"\n\t\t$word = str_replace('ph', 'fh', $word);\n\n\t\t// Replace \"b\" with \"p\"\n\t\t$word = str_replace('b', 'p', $word);\n\n\t\t// Replace \"sh\" with \"s2\"\n\t\t$word = str_replace('sh', 's2', $word);\n\n\t\t// Replace \"z\" with \"s\"\n\t\t$word = str_replace('z', 's', $word);\n\n\t\t// Replace an \"initial vowel\" with an \"A\"\n\t\t// NOTE: Vowels are normally a,e,i,o,u but depending on the data might include characters such as æ, ā, or ø\n\t\t$word = preg_replace('/^[aeiou]/', 'A', $word);\n\n\t\t// Replace \"all other vowels\" with a \"3\"\n\t\t$word = preg_replace('/[aeiou]/', '3', $word);\n\n\t\t// Replace \"j\" with \"y\"\n\t\t$word = str_replace('j', 'y', $word);\n\n\t\t// Replace an \"initial y3\" with \"Y3\"\n\t\t$word = preg_replace('/^y3/', 'Y3', $word);\n\n\t\t// Replace an \"initial y\" with \"A\"\n\t\t$word = preg_replace('/^y/', 'A', $word);\n\n\t\t// Replace \"y\" with \"3\"\n\t\t$word = str_replace('y', '3', $word);\n\n\t\t// Replace \"3gh3\" with \"3kh3\"\n\t\t$word = str_replace('3gh3', '3kh3', $word);\n\n\t\t// Replace \"gh\" with \"22\"\n\t\t$word = str_replace('gh', '22', $word);\n\n\t\t// Replace \"g\" with \"k\"\n\t\t$word = str_replace('g', 'k', $word);\n\n\t\t// Replace \"groups of the letter s\" with a \"S\"\n\t\t$word = preg_replace('/s{1,}/', 'S', $word);\n\n\t\t// Replace \"groups of the letter t\" with a \"T\"\n\t\t$word = preg_replace('/t{1,}/', 'T', $word);\n\n\t\t// Replace \"groups of the letter p\" with a \"P\"\n\t\t$word = preg_replace('/p{1,}/', 'P', $word);\n\n\t\t// Replace \"groups of the letter k\" with a \"K\"\n\t\t$word = preg_replace('/k{1,}/', 'K', $word);\n\n\t\t// Replace \"groups of the letter f\" with a \"F\"\n\t\t$word = preg_replace('/f{1,}/', 'F', $word);\n\n\t\t// Replace \"groups of the letter m\" with a \"M\"\n\t\t$word = preg_replace('/m{1,}/', 'M', $word);\n\n\t\t// Replace \"groups of the letter n\" with a \"N\"\n\t\t$word = preg_replace('/n{1,}/', 'N', $word);\n\n\t\t// Replace \"w3\" with \"W3\"\n\t\t$word = str_replace('w3', 'W3', $word);\n\n\t\t// Replace \"wh3\" with \"Wh3\"\n\t\t$word = str_replace('wh3', 'Wh3', $word);\n\n\t\t// If the word \"ends in w\", replace the \"final w\" with \"3\"\n\t\t$word = preg_replace('/w$/', '3', $word);\n\n\t\t// Replace \"w\" with \"2\"\n\t\t$word = str_replace('w', '2', $word);\n\n\t\t// Replace an \"initial h\" with an \"A\"\n\t\t$word = preg_replace('/^h/', 'A', $word);\n\n\t\t// Replace \"all other occurrences of h\" with a \"2\"\n\t\t$word = preg_replace('/h/', '2', $word);\n\n\t\t// Replace \"r3\" with \"R3\"\n\t\t$word = str_replace('r3', 'R3', $word);\n\n\t\t// If the word \"ends in r\", replace the replace \"final r\" with \"3\"\n\t\t$word = preg_replace('/r$/', '3', $word);\n\n\t\t// Replace \"r\" with \"2\"\n\t\t$word = str_replace('r', '2', $word);\n\n\t\t// Replace \"l3\" with \"L3\"\n\t\t$word = str_replace('l3', 'L3', $word);\n\n\t\t// If the word \"ends in l\", replace the replace \"final l\" with \"3\"\n\t\t$word = preg_replace('/l$/', '3', $word);\n\n\t\t// Replace \"l\" with \"2\"\n\t\t$word = str_replace('l', '2', $word);\n\n\t\t// Remove all \"2\"s\n\t\t$word = str_replace('2', '', $word);\n\n\t\t// If the word \"ends in 3\", replace the \"final 3\" with \"A\"\n\t\t$word = preg_replace('/3$/', 'A', $word);\n\n\t\t// Remove all \"3\"s\n\t\t$word = str_replace('3', '', $word);\n\n\t\t// Put ten \"1\"s on the end\n\t\t$word = str_pad($word, 10, '1');\n\n\t\t// Take the first ten characters as the code\n\t\t$word = substr($word, 0, 10);\n\n\t\treturn $word;\n\t}", "public function detect(string $str): LanguageResult\n {\n $str = \\mb_strtolower($str);\n\n $samples = $this->getNgrams($str);\n\n $result = [];\n\n if (\\count($samples) > 0)\n {\n foreach ($this->tokens as $lang => $value)\n {\n $index = $sum = 0;\n\n foreach ($samples as $v)\n {\n if (isset($value[$v]))\n {\n $x = $index++ - $value[$v];\n $y = $x >> (PHP_INT_SIZE * 8);\n $sum += ($x + $y) ^ $y;\n continue;\n }\n\n $sum += $this->maxNgrams;\n ++$index;\n }\n\n $result[$lang] = 1 - ($sum / ($this->maxNgrams * $index));\n }\n\n \\arsort($result, SORT_NUMERIC);\n }\n\n return new LanguageResult($result);\n }", "public function getController()\n\t{\n\t\treturn ucfirst($this->getSegment(1));\n\t}", "private function isShort()\n {\n $length = UTF8::strlen($this->word);\n return ( ($this->searchShortSyllabe(-3, 3) || $this->searchShortSyllabe(-2, 2)) && ($length == $this->r1Index) );\n }", "function contiene($cads, $c) {\n\t$contiene = false;\n\n\tfor ($i = 0; $i < count($cads); $i++) {\n\t\tif (strcmp($cads[$i] -> getC(), $c) == 0) {\n\t\t\t$cads[$i] -> setF($cads[$i] -> getF() + 1);\n\t\t\t$contiene = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn $contiene;\n}", "public static function singularize($word);", "public static function classify($word)\n {\n return Inflector::classify($word);\n }", "public function getCfirst()\n\t{\n\t\treturn $this->cfirst;\n\t}", "function isPositief($message) {\n\t\tif(0 < count(array_intersect(array_map('strtolower', explode(' ', $message)), $words_positief))) {\n\t\t\t//woord komt voor in de array nog controleren of er negative woorden voorkomen\n\t\t\tif(0 < count(array_intersect(array_map('strtolower', explode(' ', $message)), $words_negatief))) {\n\t\t\t\t\t//woord komt voor in de array dus het bericht is negatief\n\t\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\t//woord komt niet voor in de array dus het bericht is positief\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t} else if(0 < count(array_intersect(array_map('strtolower', explode(' ', $message)), $words_negatief))) {\n\t\t\t//woord komt voor in de array dus het bericht is negatief\n\t\t\treturn 0;\n\t\t} else {\n\t\t\t// geen van de woorden gevonden dus het bericht is neutraal\t\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}", "public function isMemberInStem();", "public function testConsignmentAlgorithmContent(): void\n {\n $ancConsignmentNoAlgorithm = function() : string\n {\n $randomNumber = date('Ymd').\"\";\n for ($i = 0; $i < 6; $i++) {\n $randomNumber .= strval(rand(0,9));\n }\n return $randomNumber;\n };\n $ANC = new Courier(\"ANC\", \"email\", [], $ancConsignmentNoAlgorithm);\n $this->assertStringStartsWith(date('Ymd'), \n $ANC->getConsignmentNumber());\n }", "function is_compound_lname($word) {\n $word = strtolower($word);\n // these are some common prefixes that identify a compound last names - what am I missing?\n $words = array('vere','von','van','de','del','della','di','da','pietro','vanden','du','st.','st','la','ter');\n return array_search($word,$words);\n}", "public static function camelize($word, $lower_first_char = false)\n {\n return Inflector::camelize($word, $lower_first_char);\n }", "function CheckContest($log) {\n // Extract the CONTEST Cabrillo record - there SHOULD be one\n if (preg_match(\"/^CONTEST:(.*?)\\n.*$/ms\", $log, $m)) {\n // $m[1] contains the CONTEST name\n if (preg_match(\"/CA|CQP|NCCC/i\", $m[1])) {\n return TRUE;\n }\n }\n return FALSE;\n}", "function isCsw(): bool {\n return ($this->conformsTo == 'http://www.opengis.net/def/serviceType/ogc/csw');\n }", "private function step3()\n {\n // ational+: replace by ate\n if ($this->searchIfInR1(array('ational')) !== false) {\n $this->word = preg_replace('#(ational)$#u', 'ate', $this->word);\n return true;\n }\n\n // tional+: replace by tion\n if ($this->searchIfInR1(array('tional')) !== false) {\n $this->word = preg_replace('#(tional)$#u', 'tion', $this->word);\n return true;\n }\n\n // alize: replace by al\n if ($this->searchIfInR1(array('alize')) !== false) {\n $this->word = preg_replace('#(alize)$#u', 'al', $this->word);\n return true;\n }\n\n // icate iciti ical: replace by ic\n if ($this->searchIfInR1(array('icate', 'iciti', 'ical')) !== false) {\n $this->word = preg_replace('#(icate|iciti|ical)$#u', 'ic', $this->word);\n return true;\n }\n\n // ful ness: delete\n if ( ($position = $this->searchIfInR1(array('ful', 'ness'))) !== false) {\n $this->word = UTF8::substr($this->word, 0, $position);\n return true;\n }\n\n // ative*: delete if in R2\n if ( (($position = $this->searchIfInR1(array('ative'))) !== false) && ($this->inR2($position)) ) {\n $this->word = UTF8::substr($this->word, 0, $position);\n return true;\n }\n\n return false;\n }", "function cosineSim($query,$doc) {\n\t $result = 0;\n\t $numerator=0;\n\t foreach($query as $term_id => $tfidf) {\n\t \tif (array_key_exists($term_id,$doc)){\n\t $numerator += $tfidf * $doc[$term_id];\n\t \t}\n\t }\n\t $denominator =$this->length($query)*$this->length($doc);\n\t if ($denominator != 0) {\n\t \t$result=$numerator/$denominator;\n\t }\n\t return $result;\n\t}", "function simpleStem($relation){\n\t$relation = removePrefix($relation);\n\t\r\n\tswitch (strtolower($relation)) {\r\n\t\tcase 'cause':\r\n\t\t\treturn 'caus';\r\n\t\tcase 'location':\r\n\t\t\treturn 'locat';\r\n\t\tcase 'diagnose':\r\n\t\t\treturn 'diagnos';\r\n\t}\r\n\r\n\treturn $relation;\r\n}", "public function isNewConstructor(): bool\n {\n // NOTE: This is normalized to lowercase by canonicalName\n return $this->name === '__construct';\n }", "public function getAccuracyConst($str)\n\t{\n\t\t$str = strtolower($str);\n\t\t$lookup = array_flip($this->accuracy_strings);\n\t\treturn (isset($lookup[$str])) ? $lookup[$str] : 0;\n\t}", "function isCoherent()\n {\n $value = false;\n\n if( $this->State_ == \"coherent\" )\n {\n $value = true;\n }\n \n #echo \"isCoherent is: \" . $this->State_ . \"<br>\";\n #echo \"isCoherent returns: $value<br>\";\n \n return $value;\n }", "function isSelfDescribing($line) {\n $num_array = str_split($line);\n\n foreach($num_array as $index => $num) {\n $num_count = substr_count($line, $index);\n if ($num_count != $num) {\n return 0;\n }\n }\n return 1;\n\n}", "function singularize ($word)\n {\n $singular_rules = array(\n '/(s)tatuses$/' => '\\1\\2tatus',\n '/(matr)ices$/' =>'\\1ix',\n '/(vert|ind)ices$/' => '\\1ex',\n '/^(ox)en/' => '\\1',\n '/(alias)es$/' => '\\1',\n '/([octop|vir])i$/' => '\\1us',\n '/(cris|ax|test)es$/' => '\\1is',\n '/(shoe)s$/' => '\\1',\n '/(o)es$/' => '\\1',\n '/(bus)es$/' => '\\1',\n '/([m|l])ice$/' => '\\1ouse',\n '/(x|ch|ss|sh)es$/' => '\\1',\n '/(m)ovies$/' => '\\1\\2ovie',\n '/(s)eries$/' => '\\1\\2eries',\n '/([^aeiouy]|qu)ies$/' => '\\1y',\n '/([lr])ves$/' => '\\1f',\n '/(tive)s$/' => '\\1',\n '/(hive)s$/' => '\\1',\n '/([^f])ves$/' => '\\1fe',\n '/(^analy)ses$/' => '\\1sis',\n '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/' => '\\1\\2sis',\n '/([ti])a$/' => '\\1um',\n '/(p)eople$/' => '\\1\\2erson',\n '/(m)en$/' => '\\1an',\n '/(c)hildren$/' => '\\1\\2hild',\n '/(n)ews$/' => '\\1\\2ews',\n '/s$/' => ''\n );\n\n foreach ($singular_rules as $rule => $replacement)\n {\n if (preg_match($rule, $word))\n {\n return preg_replace($rule, $replacement, $word);\n }\n }\n // should not return false is not matched\n return $word;//false;\n }", "public function getBrownCluster($str) {\n\t\tif (isset($this->map[$str])) {\n\t\t\treturn $this->map[$str];\n\t\t}\n\t\telse {\n\t\t\treturn NULL;\n\t\t}\n\t}", "private static function m($str)\n\t {\n\t $c = self::$regex_consonant;\n\t $v = self::$regex_vowel;\n\n\t $str = preg_replace(\"#^$c+#\", '', $str);\n\t $str = preg_replace(\"#$v+$#\", '', $str);\n\n\t preg_match_all(\"#($v+$c+)#\", $str, $matches);\n\n\t return count($matches[1]);\n\t }", "public function setCctbconfterms01($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cctbconfterms01 !== $v) {\n $this->cctbconfterms01 = $v;\n $this->modifiedColumns[ConfigCcTableMap::COL_CCTBCONFTERMS01] = true;\n }\n\n return $this;\n }", "function PCC($a, $b) {\r\n $mean_a = array_sum($a)/count($a);\r\n\t$mean_b = array_sum($b)/count($b);\r\n\t$sum_ab = 0;\r\n $sum_a = 0;\r\n $sum_b = 0;\r\n $sum_a_sqr = 0;\r\n $sum_b_sqr = 0;\r\n //$n = min(array(count($a), count($b)));\r\n for ($i = 0; $i < count($a); $i++) {\r\n if (!isset($a[$i]) || !isset($b[$i])) { continue; }\r\n $sum_ab += ($a[$i]-$mean_a) * ($b[$i]-$mean_b);\r\n $sum_a += $a[$i]-$mean_a;\r\n $sum_b += $b[$i]-$mean_b;\r\n $sum_a_sqr += pow($a[$i]-$mean_a, 2);\r\n $sum_b_sqr += pow($b[$i]-$mean_b, 2);\r\n }\r\n\tif((sqrt($sum_a_sqr) * sqrt($sum_b_sqr))!=0){\r\n\t\treturn $sum_ab / (sqrt($sum_a_sqr) * sqrt($sum_b_sqr));\t\t\r\n\t}else{\r\n\t\treturn -1;// not similar\r\n\t}\r\n\t\r\n}", "public function testIsCCW()\n\t{\n\t\t$this->assertEquals(1, $this->isCCW($this->right, $this->up, $this->front));\n\t\t$this->assertEquals(1, $this->isCCW($this->up, $this->front, $this->right));\n\t\t$this->assertEquals(1, $this->isCCW($this->front, $this->right, $this->up));\n\t\t$this->assertEquals(-1, $this->isCCW($this->front, $this->up, $this->right));\n\t\t$this->assertEquals(-1, $this->isCCW($this->up, $this->right, $this->front));\n\t\t$this->assertEquals(-1, $this->isCCW($this->right, $this->front, $this->up));\n\t}", "public function isTc(): bool;", "function get_first_word($sentance){\n\t$wordArr = explode(' ', $sentance);\n\t$first_word = trim($wordArr[0]);\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"Sentance: $sentance. First word:$first_word\",4);\n\treturn $first_word;\n}", "public function is_cont() {\n\t\treturn $this->cont;\n\t}", "public function camelize($word);", "public function isCategorical() : bool\n {\n return $this->code === self::CATEGORICAL;\n }", "public function isConstructor(): bool\n {\n return strtolower($this->name) === '__construct';\n }", "public function countCoSim(){\n\n $sumDP = array_fill(0,$this->num_d, 0);\n $sumVL = array_fill(0,$this->num_d+1, 0);\n\n foreach ($this->DotProd as $k => $subArray) {\n foreach ($subArray as $v => $value) {\n $sumDP[$v]+=$value;\n }\n }\n\n foreach ($this->VectorLength as $k => $subArray) {\n foreach ($subArray as $v => $value) {\n $sumVL[$v]+=$value;\n }\n }\n\n $sqrt_sum = array_map(function($var){ return sqrt($var);}, $sumVL);\n\n foreach ($sumDP as $item => $val) {\n\n// TODO : potentially division by zero, solved.\n\n $cossim[] = number_format($this->division($val , ($sqrt_sum[0]*$sqrt_sum[$item+1])*100), 4);\n\n }\n\n if (!empty($cossim)) {\n foreach ($cossim as $k => $v){\n $rank[] = $v;\n }\n // Sort Result Ascending\n arsort($rank, SORT_NUMERIC);\n\n $this->cos_sim = $rank;\n\n }\n\n return null;\n\n }", "public function isSingular(): bool\n {\n $│A│ = $this->det();\n\n if (Support::isZero($│A│, $this->ε)) {\n return true;\n }\n\n return false;\n }", "function find_clusters_edit_dist($strings, $threshold = 1)\n{\n\t$n = count($strings);\n\t\t\n\t$map = array();\n\t$inverse_map = array();\n\t\n\t$count = 0;\n\tforeach ($strings as $k => $v)\n\t{\n\t\t$map[$k] = $count;\n\t\t$inverse_map[$count] = $k;\n\t\t\n\t\t$count++;\n\t}\n\n\t// Create adjacency matrix and fill with 0's\n\t$X = array();\n\tfor ($i = 0; $i < $n; $i++)\n\t{\n\t\t$X[$i] = array();\n\t\t\n\t\tfor ($j = 0; $j < $n; $j++)\n\t\t{ \n\t\t\t$X[$i][$j] = 0;\n\t\t}\n\t}\n\t\n\t$nodes = '';\n\t$edges = '';\n\t\n\t// Compare names using string edit\n\t$i = 0;\n\tforeach ($strings as $k1 => $v1)\n\t{\n\t\t$nodes .= $k1 . \" [label=\\\"\" . join(' ', $v1) . \"\\\"];\\n\";\n\t\t\n\t\tif ($i < $n-1)\n\t\t{\n\t\t\t$j = 0;\n\t\t\tforeach ($strings as $k2 => $v2)\n\t\t\t{\n\t\t\t\tif (($j > $i) && ($j < $n))\n\t\t\t\t{\n\t\t\t\t\t$d = compare_taxon_names($v1, $v2);\n\t\t\t\t\t\n\t\t\t\t\tif ($d <= $threshold)\n\t\t\t\t\t{\n\t\t\t\t\t\t// sanity check, if we have authors are they the same?\n\t\t\t\t\t\tif (1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t$X[$map[$k1]][$map[$k2]] = 1;\n\t\t\t\t\t\t$X[$map[$k2]][$map[$k1]] = 1;\t\n\t\t\t\t\t\t$edges .= $inverse_map[$i] . \" -- \" . $inverse_map[$j] . \" [label=\\\"\" . $d . \"\\\"];\\n\";\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$j++;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t}\n\t\n\tif (1)\n\t{\n\t\t$graph = \"graph G {\\n\" . $nodes . $edges . \"}\\n\";\n\t\t\n\t\techo $graph;\n\t\t\n\t\t$keys = array_keys($strings);\n\t\t$filename = $keys[0];\n\t\t\n\t\tfile_put_contents('tmp/' . $filename . '.dot', $graph);\n\t}\n\t\n\t// Get components of adjacency matrix\n\t$c = get_components($X);\n\t\n\t// Ensure nodes are labelled with ids\n\tforeach ($c as $component => $nodes)\n\t{\n\t\tforeach ($nodes as $k => $v)\n\t\t{\n\t\t\t$c[$component][$k] = $inverse_map[$v];\n\t\t}\n\t}\t\n\n\t\n\tif (0)\n\t{\n\t\tprint_r($c);\n\t}\n\t\n\treturn $c;\n}", "public function isLowerAssocCase();", "public function setClustersCenter($value);", "function studentc($isFirstYear = TRUE)\n {\n if ($term == 3) {\n // if term is summer . get the students enrolled in last 2nd sem.\n if($isFirstYear)\n $acam = $current_academicterm - 2;\n else\n $acam = $current_academicterm - 1;\n\n $e = $this->edp_classallocation->getStudEnrol($cid, $acam);\n } else {\n // if not get the students in enrolled in current academicterm\n $e = $this->edp_classallocation->getStudEnrol($cid, $current_academicterm);\n }\n\n foreach ($e as $stud) {\n $yearlevel = $this->api->yearLevel($stud['student'], $course);\n\n // API return curriculum not found if the course does not have a curriculum\n if ($yearlevel != CUR_NOT_FOUND) {\n if ($isFirstYear) {\n if ($yearlevel == 1)\n $this->yearL[0] += 1;\n } else {\n if($yearlevel > 1)\n $this->yearL[$yearlevel - 1] += 1;\n }\n }\n }\n }", "private function continuousLetter(){\r\n\t\tforeach(str_split($this->exp) as $key => $str)\r\n\t\t\tif ($key == 0) continue;\r\n\t\t\tif (preg_match('/^[a-zA-Z]+$/', $str) == 1 && preg_match('/^[a-zA-Z]+$/', str_split($this->exp)[$key-1]) == 1) {\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function verClase()\r\n {\r\n return($this->divid);\r\n }", "function check_word($letter){\n\t\t\t$acierto = false;\n\t\t\tforeach ($this->word as $key => $value) {\n\n\t\t\t\t\tif($value['char']==ucfirst($letter)||$value['char']==strtolower($letter)){\n\t\t\t\t\t\t$this->word[$key]['is_check'] = 1;\n\t\t\t\t\t\t$acierto = true;\n\t\t\t\t\t}\n\t\t\t\t\tif($this->word[$key]['is_check'] !=1){\n\t\t\t\t\t\t$completada = false;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($acierto == false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn $this->word;\n\t\t}", "function find_fact_in_str($fact, $str)\n{\n\t$len = strlen($str);\n\tfor ($cnt = 0; $cnt < $len; $cnt++)\n\t{\n\t\t$char = substr($str, $cnt, 1);\n\t\tif ($char === $fact)\n\t\t{\n\t\t\tif ($cnt > 0 && $cnt < ($len - 1))\n\t\t\t{\n\t\t\t\tif ((ctype_upper($str[($cnt - 1)]) === FALSE) &&\n\t\t\t\t\t(ctype_upper($str[$cnt + 1]) === FALSE))\n\t\t\t\t{\n\t\t\t\t\treturn ($cnt);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($cnt === 0)\n\t\t\t{\n\t\t\t\tif (ctype_upper($str[($cnt + 1)]) === FALSE)\n\t\t\t\t\treturn ($cnt);\n\t\t\t}\n\t\t\telse if ($cnt === ($len - 1))\n\t\t\t{\n\t\t\t\tif (ctype_upper($str[($cnt - 1)]) === FALSE)\n\t\t\t\t\treturn ($cnt);\n\t\t\t}\n\t\t}\n\t}\n\treturn (FALSE);\n}", "public function isConstructor() {\n return $this->isConstructor;\n }", "private function processCN($value){\n\n\t\t\t$terms\t= explode(\" \", $value);\n\t\t\t$output = NULL;\n\n\t\t\tforeach ($terms as $term){\n\n\t\t\t\t$output .= \" \";\n\t\t\t\n\t\t\t\tfor ($i = 0; $i < strlen($term); $i++){\n\t\t\t\t\n\t\t\t\t\tif (ord($term[$i]) >= 65 && ord($term[$i]) <= 90)\n\t\t\t\t\t\t$output .= \" \";\n\t\t\t\t\t$output .= $term[$i];\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn trim($output);\n\n\t\t}", "private function pakeisti($s){\n // galima viesai prieiti\n return ucfirst(strtolower($s));\n\n }", "public function isTridiagonal(): bool\n {\n if (!$this->isSquare()) {\n return false;\n }\n\n if (!$this->isUpperHessenberg() || !$this->isLowerHessenberg()) {\n return false;\n }\n\n return true;\n }", "function gs_get_category_class() {\n $category = get_the_category(); \n if ( $category[0] ) {\n if ( $category[0]->slug == 'news' ) {\n return 'is-info';\n } else if ( $category[0]->slug == 'work' ) {\n return 'is-dark';\n }\n }\n return 'is-info';\n}", "public function tipo_c($frase)\n {\n //Caracteristica de Dentro/Fuera\n $database = new Conocimiento;\n $hannibal = new Lector($frase);\n //echo \"\\ntipo_c:\".$hannibal->frase();\n $propiedad = \"\";\n $lugar=\"\";\n $valor = 0.75;\n //comienza con 1, osea que tiene la totalidad de la propiedad\n do {\n $palabra = $hannibal->siguiente_palabra();\n switch ($palabra[1]) {\n case 'T_ADJETIVO':\n $propiedad = $palabra[0];\n break;\n case 'T_ADVERBIO':\n $multiplicador = $database->obtener_valor($palabra[0]);\n $valor = min($valor , $multiplicador);\n break;\n case 'T_PREPOSICION':\n //si hay una preposicion\n //la siguiente palabra es un adverbio\n //y este adverbio indica el lugar\n $palabra = $hannibal->siguiente_palabra();\n $lugar = $palabra[0];\n break;\n }\n } while (!is_null($palabra));\n if ($lugar==\"dentro\") {\n $propiedad.=\"_\".$lugar;\n }\n if (array_key_exists($propiedad, $this->propiedades)) {\n $this->propiedades[$propiedad] = min($this->propiedades[$propiedad] , $valor);\n }else{\n //si no existe la propiedad la crea añadiendo el valor\n $this->propiedades[$propiedad] = $valor;\n }\n }" ]
[ "0.632722", "0.58893317", "0.5600285", "0.54505897", "0.5361748", "0.53586555", "0.5193345", "0.5038151", "0.49807808", "0.48125523", "0.47904193", "0.4778717", "0.47571638", "0.47564518", "0.47456846", "0.47074765", "0.46514973", "0.4631337", "0.4619039", "0.46116024", "0.45978206", "0.45856842", "0.45821634", "0.45819595", "0.45545924", "0.45206997", "0.45015872", "0.45012406", "0.44968784", "0.44724923", "0.44569406", "0.4443837", "0.44233167", "0.4407671", "0.4406886", "0.44033086", "0.4390645", "0.43812945", "0.43651178", "0.43609276", "0.4356936", "0.43424225", "0.43334225", "0.43300503", "0.4324415", "0.43230227", "0.4321703", "0.43030474", "0.43022197", "0.42919528", "0.42914855", "0.42879477", "0.42870843", "0.42817512", "0.42723417", "0.42642024", "0.42489153", "0.424816", "0.42447004", "0.42399874", "0.42300934", "0.42289546", "0.4228687", "0.42274517", "0.4227234", "0.42242008", "0.4217106", "0.42166942", "0.4209926", "0.42095396", "0.42093197", "0.4203821", "0.42036718", "0.41948575", "0.41886696", "0.4187904", "0.41873565", "0.41851035", "0.41825035", "0.4181512", "0.41791317", "0.41746145", "0.41733363", "0.41728383", "0.41703743", "0.4165991", "0.4165457", "0.416242", "0.41570914", "0.41553837", "0.41516018", "0.41514474", "0.41405258", "0.4138763", "0.41308662", "0.4130353", "0.4120774", "0.41182342", "0.41113177", "0.41096386" ]
0.79805315
0
Determine first letter is Y or not
Определить, является ли первая буква Y или нет
protected function isFirstY($word) { $first_element = $this->getArrFirstLetterOfLatinWord( $this->getArrayFromLatinWord( $word ) ); if (strtolower($first_element[0]) == 'y') { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getbool($str)\n{\n\t$c1 = strtoupper(substr($str, 0, 1));\n\t$c2 = strtoupper(substr($str, 1, 1));\n\tif ($c1 == 'Y' || $c1 == 'T' || $c1 == '1' || $c2 == 'N' || $c1 == 'A')\n\t\treturn 1;\n\treturn 0;\n}", "public static function yn2tf($a_yn)\n\t{\n\t\tif(strtolower($a_yn) == \"y\")\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function isContainsY($word)\n {\n $latin_word = $this->getArrayFromLatinWord($word);\n\n if (count($this->getArrayFromLatinWord($word)) == 2 && $latin_word[1] == 'y') {\n $suffix = $latin_word[0] . 'ay';\n array_shift($latin_word);\n $latin_word = implode('', $latin_word);\n return print_r($latin_word . '-' . $suffix);\n }\n\n if (!in_array($latin_word[0], $this->vowels) && !in_array($latin_word[1], $this->vowels)) {\n if (in_array($latin_word[2], $this->vowels) || $latin_word[2] === 'y') {\n return true;\n }\n }\n return false;\n }", "private function continuousLetter(){\r\n\t\tforeach(str_split($this->exp) as $key => $str)\r\n\t\t\tif ($key == 0) continue;\r\n\t\t\tif (preg_match('/^[a-zA-Z]+$/', $str) == 1 && preg_match('/^[a-zA-Z]+$/', str_split($this->exp)[$key-1]) == 1) {\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function Test(){\n\n\t\t\t\tif (1>0) { \n\n\t\t\t\t\treturn 'Y';\n\t\t\t\t}\t\t\n\t\t\t\telse {\n\n\t\t\t\t\treturn 'N';\n\t\t\t\t\n\t\t\t\t}\n\n\t\t}", "function ask_y_or_n($question){\n echo \"$question (y or n): \";\n $input_str = my_fgets();\n echo \"\\n\";\n\n if($input_str === \"y\") return true;\n else if($input_str === \"n\") return false;\n else{\n echo \"Your input is invalid.\\n\";\n exit(1);\n }\n}", "public static function getYN() {\n return array('Y' => 'Yes', 'N' => 'No');\n }", "private static function checkActiveOrHistoricCurrencyCode($ccy)\n {\n $ccy = strtoupper($ccy);\n\n if (preg_match('/^[A-Z]{3}$/', $ccy))\n return $ccy;\n else\n return false;\n }", "public function getYesNo(string $prompt): bool\n\t{\n\t\t//Keep asking till we get something starting in a y or n\n\t\twhile(!in_array($answer = strtolower(readline($prompt)[0]), ['y', 'n']));\n\t\treturn $answer == 'y';\n\t}", "public function startsWithLetter()\n {\n return !!preg_match(\"/^[a-zA-Z]/i\", $this->value);\n }", "function _o( $word ){\n if ( strlen($word) >= 3 ) {\n if ( $this->is_consonant($word, -1) && !$this->is_consonant($word, -2) &&\n $this->is_consonant($word, -3) ) {\n $last_char = substr($word, -1);\n if ( $last_char == 'w' || $last_char == 'x' || $last_char == 'y' ) {\n return false;\n }\n return true;\n }\n }\n return false;\n }", "function is_initial($word) {\n return ((strlen($word) == 1) || (strlen($word) == 2 && $word[1] == \".\"));\n}", "private function stringToBoolean($string)\r\n {\r\n return ($string == 'Y' || $string == 'y' ? true : false);\r\n }", "function is_car_alpha($alpha){\n if(long_chaine($alpha)==1 && ($alpha >='a'&& $alpha <='z')|| ($alpha >='A'&& $alpha <='Z'))\n return true;\n return false;\n }", "function isvoyelle($lettre)\n{ \n $voyelle= false;\n\n //vérifier si la variable $lettre est une chaine (is-string) ou pas .\n\n if ( is_string($lettre) && strlen($lettre)==1 ) {\n\n // echo \"vérification de la lettre effectuée \\n\";\n $lettre = strtoupper($lettre); //ecrire les variables en majuscule.\n\n if ( \n ($lettre=='A') ||\n ($lettre=='E') ||\n ($lettre=='U') ||\n ($lettre=='I') ||\n ($lettre=='O') ||\n ($lettre=='Y')\n ) {\n $voyelle=true; \n }\n\n } else {\n var_dump($lettre);\n echo \"parametre erroné \\n\" ; \n } \n \n return($voyelle); \n}", "function isKenyan() {\n \treturn $this->getCountry() == 'KE' ? true : false; \n }", "function is_nom($nom) //good\n{\n $masque='#^[A-Z][a-z]{2,}[a-z]$#';\n if(preg_match($masque ,$nom))\n {\n return true;\n \n }\n else\n {\n return false;\n }\n}", "function check_word($letter){\n\t\t\t$acierto = false;\n\t\t\tforeach ($this->word as $key => $value) {\n\n\t\t\t\t\tif($value['char']==ucfirst($letter)||$value['char']==strtolower($letter)){\n\t\t\t\t\t\t$this->word[$key]['is_check'] = 1;\n\t\t\t\t\t\t$acierto = true;\n\t\t\t\t\t}\n\t\t\t\t\tif($this->word[$key]['is_check'] !=1){\n\t\t\t\t\t\t$completada = false;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($acierto == false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn $this->word;\n\t\t}", "function notNounOrVerbSST($s) {\r\n\t$parts = explode('|', $s);\r\n\t$sst = $parts[1];\r\n\tif (preg_match('/^([A-Z ]+|[a-z]+)$/', $sst))\r\n\t\treturn false;\r\n\treturn true;\r\n}", "public static function ies($count) {\n\t return ($count == 1 ? 'y' : 'ies');\n\t}", "function is_chaine_alpha($strg){\n\n for($i = 0; $i<long_chaine($strg); $i++){\n if(!is_car_alpha($strg[$i])) return false;\n }\n return true;\n}", "function set_team_letter($letter){\n\tswitch($letter){\n\t\tcase 'F':\n\t\t\t$r = 'Freshman';\n\t\t\tbreak;\n\t\tcase 'J':\n\t\t\t$r = 'Junior Varsity';\n\t\t\tbreak;\n\t\tcase 'Y':\n\t\t\t$r = 'Youth';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$r = 'Varsity';\n\t}\n\treturn $r;\n}", "function is_salutation($word) {\n // ignore periods\n $word = str_replace('.','',strtolower($word));\n // returns normalized values\n if ($word == \"mr\" || $word == \"master\" || $word == \"mister\")\n return \"Mr.\";\n else if ($word == \"mrs\")\n return \"Mrs.\";\n else if ($word == \"miss\" || $word == \"ms\")\n return \"Ms.\";\n else if ($word == \"dr\")\n return \"Dr.\";\n else if ($word == \"rev\")\n return \"Rev.\";\n else if ($word == \"fr\")\n return \"Fr.\";\n else\n return false;\n}", "function isTerritory($territory)\n {\n \treturn preg_match('/\\A[A-Za-z\\s]+\\Z/', $territory);\n }", "function Check_Initiative_Char() {\r\n\t\tglobal $roll;\r\n\t\t$init = $roll->d20() + $_SESSION['modifiers']['dex'];\r\n\t\treturn $init;\r\n\t}", "function fe_demo_phil_no( $str ) {\n\treturn 'No, ' . $str;\n}", "public static function tf2yn($a_tf)\n\t{\n\t\tif($a_tf)\n\t\t{\n\t\t\treturn \"y\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"n\";\n\t\t}\n\t}", "public function shipcomplete() {\n\t\treturn strtoupper($this->credithold) == self::YN_TRUE;\n\t}", "public function c_value_yes() {\r\n $pattern = \"/(?:(?<=\\s)|(?<=^))\" . preg_quote($this->string2, '/') . \"(?:(?=\\s)|(?=$))/i\";\r\n // Match the pattern to check if the word exists in the string.\r\n $exists = preg_match($pattern, $this->string1, $matches, PREG_OFFSET_CAPTURE, $this->initial_pos);\r\n // If the word exists, return its first occurence.\r\n if ($exists) {\r\n $string_position = $matches[0][1];\r\n }\r\n else {\r\n $string_position = 'No Worries';\r\n }\r\n return $string_position;\r\n }", "public function matchAphabetic($subject){\r\n return (preg_match('/^[a-zA-Z]*$/', $subject) == 1) ? true : false;\r\n }", "function displayOW( $KEY ) {\n \n\t\tswitch ( true ) {\n\t\t\tcase ( is_numeric( strpos($KEY, 'OW1') ) ) :\n\t\t\t\techo \"No\";\n\t\t\t\tbreak;\n\t\t\tcase ( is_numeric ( strpos($KEY, 'OW2') ) ) :\n\t\t\t\techo \"Yes\" ;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\techo \"Make sure you selected somthing OR This Combination Does Not Exist\";\n\t\t}\n }", "function is_chaine_alpha($chaine){\n for ($i=0; $i <taille($chaine) ; $i++) { \n if (!is_car_alpha($chaine[$i])) {\n return false;\n }\n }\n return true;\n}", "function is_consonant( $word, $pos ){\n // Sanity checking $pos\n if ( abs($pos) > strlen($word) ) {\n if ( $pos < 0 ) {\n // Points \"too far back\" in the string. Set it to beginning.\n $pos = 0;\n } else {\n // Points \"too far forward.\" Set it to end.\n $pos = -1;\n }\n }\n $char = substr($word, $pos, 1);\n switch ( $char ) {\n case 'a':\n case 'e':\n case 'i':\n case 'o':\n case 'u':\n return false;\n case 'y':\n if ( $pos == 0 || strlen($word) == -$pos ) {\n // Check second letter of word.\n // If word starts with \"yy\", return true.\n if ( substr($word, 1, 1) == 'y' ) {\n return true;\n }\n return !($this->is_consonant($word, 1));\n } else {\n return !($this->is_consonant($word, $pos - 1));\n }\n default:\n return true;\n }\n }", "function yesNo($type)\n\t{\n\t\treturn $type ? __('Yes') : __('No');\n\t}", "public static function is_personal_name($string) {\t\t\n\t\t$regEx = \"/^((([A-Z]{1}(\\'[A-Za-z])?([a-z]+)\\ )|(([yY]|(de)|(DE))\\ )){1,})([A-Z]{1}(\\'[A-Za-z])?([a-z]+))$/\";\n\t\treturn preg_match($regEx, $string);\n\t}", "function has_valid_code($value){\n return preg_match(\"/^[A-Z]+$/ \", $value);\n }", "function desalternar($word) {\n// if (strlen($word) > 1 and !ctype_lower($word) and !ctype_upper($word) and !(ctype_upper($word[0]) and ctype_lower(substr($word,1)))) {\n// return strtolower($word);\n// }\n\n\n if (strlen($word) > 1 and !(ctype_upper($word[0]) and ctype_lower(substr($word,1)))) {\n return strtolower($word);\n }\n else {\n return $word;\n }\n\n }", "function check_uppercase_alfabetic_char_present($stringa) {\n\treturn present(\t$stringa,\n\t\t\t\t\t\t\t\"QWERTYUIOPLKJHGFDSAZXCVBNM\");\n}", "function labelCheck($str){\n if(preg_match(\"/^([\\w_\\-$&%*!?]+)$/\", $str)){\n decho(\" labelCheck \\e[32mGOOD\\e[0m [$str]\\n\");\n return true;\n }\n decho(\" labelCheck \\e[31mFAIL\\e[0m [$str]\\n\");\n return false;\n}", "public function testGetFirstLetter() {\n\n\t\t$actual = $this->object->getFirstLetter('SUB');\n\n\t\t$expected = \"S\";\n\t\t$unexpected = \"s\";\n\t\t$this->assertEquals($expected, $actual);\n\t\t$this->assertNotEquals($unexpected, $actual);\n\t}", "function getUserInput() {\n $handle = fopen(\"php://stdin\", \"r\");\n $userInput = trim(fgets($handle));\n fclose($handle);\n \n $bool = $userInput === '' || strtolower($userInput) === 'y' || strtolower($userInput) === 'yes';\n return $bool;\n}", "public function hasUpperCase()\n {\n return $this->matchesPattern('.*[[:upper:]]');\n }", "function _is_devider($char)\n {\n return in_array($char, Strings::_word_deviders());\n }", "public function isLetter(string $letter) : bool;", "function verificarSoloLetras($cadena){ \n \t\treturn (ctype_alpha($cadena) or ($cadena == \"-\"));\n }", "private static function startsWithLetter($var)\n {\n if ( preg_match('/^\\p{L}/iu', $var) ) {\n return true;\n } else return false;\n }", "function has_uppercase_letter($password)\n {\n /* \n Ideja je transformisati sifru u sifru zapisanu malim slovima i uporediti da se razlikuje od originalne.\n Na primer, ako je zadata sifra Abc123 njeg ekvivalent je sifra abc123 koja se razlikuje i na osnovu\n toga mozemo da zakljucimo da pocetna sifra sadrzi barem jedno veliko slovo. Ako je zadata sifra abc123, njen\n ekvivalent ostaje sifra abc123 pa mozemo da zakljucimo da ne sadrzi ni jedno veliko slovo.\n */\n\n $lowercased_password = strtolower($password);\n if ($lowercased_password != $password) {\n return TRUE;\n }\n\n return FALSE;\n }", "function check_sex($sex)\r\n\t\t\t{\r\n\t\t\t\tif($sex == \"male\")\r\n\t\t\t\t\t$sex = \"He\";\r\n\t\t\t\t\t\r\n\t\t\t\telse\r\n\t\t\t\t\t$sex = \"She\";\r\n\t\t\t\t\t\r\n\t\t\t\treturn $sex;\t\r\n\t\t\t}", "private static function isLetter( $u )\n {\n return ( ($u >= 65 && $u <= 90) //uppercase\n || ($u >= 97 && $u <= 122) ); //lowercase\n }", "static function confirmSelect() {\r\n Utils::logMessage(self::fq_name, \" Please type [Y] or [1] to proceed: \");\r\n $select = Utils::read_stdin();\r\n if ($select == 'Y' or $select == '1') {\r\n return true;\r\n } else\r\n return false;\r\n }", "public function isUpperCase()\n {\n return $this->matchesPattern('^[[:upper:]]*$');\n }", "public function checkLetter($letter){\n return strpos($this->currentPhrase, $letter) !== false;\n\n }", "public function testLetters()\n {\n $this->assertEquals('n h', Pinyin::letter('您好'));\n $this->assertEquals('n-h', Pinyin::letter('您好', array('delimiter' => '-')));\n $this->assertEquals('N-H', Pinyin::letter('您好', array('delimiter' => '-', 'uppercase' => true)));\n $this->assertEquals('c q', Pinyin::letter('重庆'));\n $this->assertEquals('z y', Pinyin::letter('重要'));\n $this->assertEquals('nh', Pinyin::letter('您好', array('delimiter' => '')));\n $this->assertEquals('kxll', Pinyin::letter('康熙来了', array('delimiter' => '')));\n $this->assertEquals('A B Z Z Q Z Z Z Z', Pinyin::letter(\"阿坝藏族羌族自治州\", array('uppercase' => true)));\n $this->assertEquals('d z x w q l x b d d z d g m h', Pinyin::letter('带着希望去旅行,比到达终点更美好'));\n $this->assertEquals('z q s l z w z w', Pinyin::letter('赵钱孙李 周吴郑王'));\n $this->assertEquals('l x', Pinyin::letter('旅行'));\n\n // issue #27\n $this->assertEquals('d l d n r', Pinyin::letter('独立的女人'));\n $this->assertEquals('n', Pinyin::letter('女'));\n $this->assertEquals('n r', Pinyin::letter('女人'));\n }", "function test_name($data){\n if(preg_match(\"/[a-zA-Z]{2,}$/\", $data)){\n return true;\n }else{\n return false;\n }\n}", "public function yik($inputText) \n\t{ \n\t\t$inputText = $this->valide($inputText);\n\t\t$arr1 = preg_split('#(?<!^)(?!$)#u', $inputText);\n\t\t$count = count($arr1)-1;\n\n\t\tif(in_array($arr1[$count], $this->glux)) {\n\t\t\t$result = $inputText.\"к\".$this->ocon($inputText);\n\t\t}\n\t\telse {\n\t\t\tfor($i = 0; $i<=count($arr1); $i++) {\t\n\t\t\t\tif(in_array($arr1[$i], $this->sog)||(in_array($arr1[$count], $this->nos))) {\n\t\t\t\t\t$result = $inputText.\"г\".$this->ocon($inputText);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$result = $inputText.\"к\".$this->ocon($inputText);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "private function getUserInput() {\n\t\tprint(\"Would you like lemon with your tea (y/n)? \");\n\n\t\t$fr = fopen(\"php://stdin\", \"r\");\n\t\t$answer = rtrim(fgets($fr, 255));\n\t\tfclose($fr);\n\n\t\treturn $answer;\n\t}", "function labCtrl($label) {\r\n $lab = preg_match('/\\A(_|-|\\$|&|%|\\*|!|\\?|[a-zA-Z])(_|-|\\$|&|%|\\*|!|\\?|[a-zA-Z0-9])*\\z/', $label);\r\n if ($lab) {\r\n return true;\r\n }\r\n else {\r\n errorPrint(ERROR_LEXSYN);\r\n }\r\n}", "private function esVocal( $char ) {\n \t$char= $this->convertirMayusculas($char);\n return ($char=='A' || $char=='E' || $char=='I' || $char=='O' || $char=='U') ? true : false;\n }", "function ValidateSingleCharacter($string)\n{\n $string = trim($string);\n\t$lenght = strlen($string); \n\t \n if($lenght == 1 and ValidateIsCharacter($string) == \"False\")\n {\n $flag = \"False\";\n }\n else\n {\n $flag = \"True\";\n }\n\treturn $flag;\n}", "function check_alfabetic_char_present($stringa) {\n\treturn present(\t$stringa,\n\t\t\t\t\t\t\t\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\");\n}", "function isupper($car){\n $UPPER = [\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];\n for($i=0; $i<26; $i++){\n if($car==$UPPER[$i]){\n return TRUE;\n }\n }\n return FALSE;\n}", "public function testCalculateWordFirstQuestion()\n {\n $challenge = new Challenge(\"Joe Savage\");\n $answer = $challenge->calculateWordQuestion(\"trusting\", 2, \"first\");\n $this->tester->assertEquals(\"tr\", $answer);\n }", "public function yolo(): bool\n {\n return $this->yolo;\n }", "public function latinMode();", "function is_car_alpha($car){\n while ((($car>='a' && $car<='z') || ($car>='A' && $car<='Z')) && (taille($car)==1)) {\n return true;\n }\n return false;\n}", "function yesANDno($value, $word) {\r\n if ($value == 0) {\r\n return \"<span class='Yes yn'>$word: Yes</span>\";\r\n } elseif ($value == 1){\r\n return \"<span class='No yn'>$word: No</span>\";\r\n }\r\n}", "function tttWhoIsX($whois_x){\n\tif ($whois_x == \"\" || $whois_x == \"Player 1\") {\n\t\treturn \"Player 2\";\n\t} elseif ($whois_x == \"Player 2\") {\n\t\treturn \"Player 1\";\n\t}\n}", "function detect_any_uppercase($string) {\n return strtolower($string) != $string;\n}", "public function isBasicLatin($input);", "public function syarat_sandi($str)\n\t{\n\t\t// radiisi berarti tidak sandi tidak diubah\n\t\tif (preg_match('/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$/', $str) or $str == 'radiisi')\n\t\t\treturn TRUE;\n\t\telse\n\t\t\treturn FALSE;\n\t}", "public function isYouth()\n {\n return strtolower($this->getXml()->getElementsByTagName('IsYouth')->item(0)->nodeValue) == 'true';\n }", "function isPalindrome( $str ) \n{\n $str = strtolower($str);\n return $str == strrev($str) ? 'Yes' : 'No';\n}", "function getFirstLetterNormalized($str) {\n $letter = papaya_strings::substr($str, 0, 1);\n $letter = papaya_strings::normalizeString($letter);\n $letter = substr($letter, 0, 1);\n $letter = strtoupper($letter);\n return $letter;\n }", "function validFirstName ($name) {\n\tif (preg_match(\"/^[A-Z]{1}[a-z]*$/\", $name)) {return true;}\n\telse {return false;}\n}", "function checkcategoryName($categoryName) {\n $pattern = '/^[A-Z][a-z]{2,}$/';\n return preg_match($pattern, $categoryName);\n}", "private function isUpper($string = false)\n {\n $countWords = str_word_count($string);\n\n if ($countWords > 1) {\n $words = explode(\" \", $string);\n\n // Use if you wanted to check first letter to be upper-case\n // $first = str_split($words[0]);\n }\n else {\n die(\"Some data inconsistencies has been detected. Please check your data entry and try again.\");\n }\n\n $case = ctype_upper($words[0]); // or strtolower != strtolower\n return ($case == true) ? 'true' : 'false';\n }", "public static function yesno() {\n\t\treturn array( array('Y', 'Yes'), array('N', 'No') );\n\t}", "public static function str2Bool($string)\r\n {\r\n $string = strtolower($string);\r\n\r\n if ($string == 'y' || $string == 'yes' || $string == 't' || $string == 'true')\r\n {\r\n return true;\r\n }\r\n else if ($string == 'n' || $string == 'no' || $string == 'f' || $string == 'false')\r\n {\r\n return false;\r\n }\r\n else if (is_numeric($string))\r\n {\r\n if (floatval($string) == 0)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }", "protected function shouldUppercase(): bool\n {\n return $this->uppercase ?? self::$globalUppercase;\n }", "static function parse_texting($texting) {\n\t\treturn ($texting == '1') ? 'Yes' : 'No';\n\t}", "function isNameStartChar($aChar) {\r\n \t\tif ($this->Logger->TimeProfiling) $this->Logger->TimeStart('isNameStartChar()');\r\n\t\t\t\r\n\t\t\t\r\n \t\tif ($this->Logger->TimeProfiling) $this->Logger->TimeStart('uniord()');\r\n $ord = uniord($aChar);\r\n \t\tif ($this->Logger->TimeProfiling) $this->Logger->TimeStop('uniord()');\r\n\t\t\t\r\n\t\t\t$return = false;\r\n if ($ord==ord(':')) { $return = true; } else \r\n if ($ord==ord('_')) { $return = true; } else \r\n if ($ord>=ord('A') && $ord<=ord('Z')) { $return = true; } else \r\n if ($ord>=ord('a') && $ord<=ord('z')) { $return = true; } else \r\n if ($ord>=0xC0 && $ord<=0xD6) { $return = true; } else \r\n if ($ord>=0xD8 && $ord<=0xF6) { $return = true; } else \r\n if ($ord>=0xF8 && $ord<=0x2FF) { $return = true; } else \r\n if ($ord>=0x370 && $ord<=0x37D) { $return = true; } else \r\n if ($ord>=0x37F && $ord<=0x1FFF) { $return = true; } else \r\n if ($ord>=0x200C && $ord<=0x200D) { $return = true; } else \r\n if ($ord>=0x2070 && $ord<=0x218F) { $return = true; } else \r\n if ($ord>=0x2C00 && $ord<=0x2C00) { $return = true; } else \r\n if ($ord>=0x3001 && $ord<=0xD7FF) { $return = true; } else \r\n if ($ord>=0xF900 && $ord<=0xFDCF) { $return = true; } else \r\n if ($ord>=0xFDF0 && $ord<=0xFFFD) { $return = true; } \r\n\r\n \t\tif ($this->Logger->TimeProfiling) $this->Logger->TimeStop('isNameStartChar()');\r\n return $return;\r\n }", "public function alphaNumericLine()\n {\n return !!preg_match('/^[a-zA-Z0-9-_]+$/', (string) $this->value);\n }", "public function testGetFirstLetterUmlaut() {\n\n\t\t$actual = $this->object->getFirstLetter('Öffentlichkeit');\n\n\t\t$expected = \"Ö\";\n\t\t$unexpected = \"o\";\n\t\t$this->assertEquals($expected, $actual);\n\t\t$this->assertNotEquals($unexpected, $actual);\n\t}", "public function isHappy(){\n return !$this->is_hugry && !$this->is_thirsty ? 'happy':'not happy';\n }", "function get_team_type($v){\n\t$r = '';\n\tswitch($v){\n\t\tcase 'Y':\n\t\t\t$r='Youth';\n\t\t\tbreak;\n\t\tcase 'F':\n\t\t\t$r='Freshman';\n\t\t\tbreak;\n\t\tcase 'J':\n\t\t\t$r='JV';\n\t\t\tbreak;\n\t\tcase 'V':\n\t\t\t$r='Varsity';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$r = $v;\n\t\t\tbreak;\n\t}\n\treturn $r;\n}", "function wordDisplayFormat ($row) {\r\n\t$echo = (getCheckbox ('lettersonly') || $row['whole'] != 'Y') ? $row['word'] : $row['entry'];\r\n\t$ascii = preg_match (\"/^[-a-z' 0-9]*$/i\", $echo);\r\n\tswitch ($_GET['wordcase']) {\r\n\t\tcase 'U':\r\n\t\tif ($ascii) {\r\n\t\t\t$echo = strtoupper ($echo); // works fine for ASCII-128 stuff\r\n\t\t} else {\r\n\t\t\t$echo = \"<span style='text-transform: uppercase'>$echo</span>\"; // better for accented characters than strtoupper\r\n\t\t}\r\n\t\tbreak;\r\n\r\n\t\tcase 'L':\r\n\t\tif ($ascii) {\r\n\t\t\t$echo = strtolower ($echo);\r\n\t\t} else {\r\n\t\t\t$echo = \"<span style='text-transform: lowercase'>$echo</span>\";\r\n\t\t}\r\n\t\tbreak;\r\n\t}\r\n\treturn $echo;\r\n}", "function isNameChar($aChar) {\r\n \t\tif ($this->Logger->TimeProfiling) $this->Logger->TimeStart('isNameChar()');\r\n\r\n \t\tif ($this->Logger->TimeProfiling) $this->Logger->TimeStart('uniord()');\r\n $ord = uniord($aChar);\r\n \t\tif ($this->Logger->TimeProfiling) $this->Logger->TimeStop('uniord()');\r\n\r\n\t\t\t$return = false;\r\n if ($ord==ord(':')) { $return = true; } else \r\n if ($ord==ord('_')) { $return = true; } else \r\n if ($ord==ord('-')) { $return = true; } else \r\n if ($ord==ord('@')) { $return = true; } else \r\n if ($ord==ord('.')) { $return = true; } else \r\n if ($ord==0xB7) { $return = true; } else \r\n if ($ord>=ord('0') && $ord<=ord('9')) { $return = true; } else \r\n if ($ord>=ord('A') && $ord<=ord('Z')) { $return = true; } else \r\n if ($ord>=ord('a') && $ord<=ord('z')) { $return = true; } else \r\n if ($ord>=0xC0 && $ord<=0xD6) { $return = true; } else \r\n if ($ord>=0xD8 && $ord<=0xF6) { $return = true; } else \r\n if ($ord>=0xF8 && $ord<=0x2FF) { $return = true; } else \r\n if ($ord>=0x370 && $ord<=0x37D) { $return = true; } else \r\n if ($ord>=0x37F && $ord<=0x1FFF) { $return = true; } else \r\n if ($ord>=0x0300 && $ord<=0x036F) { $return = true; } else \r\n if ($ord>=0x200C && $ord<=0x200D) { $return = true; } else \r\n if ($ord>=0x203F && $ord<=0x2040) { $return = true; } else \r\n if ($ord>=0x2070 && $ord<=0x218F) { $return = true; } else \r\n if ($ord>=0x2C00 && $ord<=0x2C00) { $return = true; } else \r\n if ($ord>=0x3001 && $ord<=0xD7FF) { $return = true; } else \r\n if ($ord>=0xF900 && $ord<=0xFDCF) { $return = true; } else \r\n if ($ord>=0xFDF0 && $ord<=0xFFFD) { $return = true; } \r\n\r\n \t\tif ($this->Logger->TimeProfiling) $this->Logger->TimeStop('isNameChar()');\r\n return $return;\r\n }", "function check_lowercase_alfabetic_char_present($stringa) {\n\treturn present(\t$stringa,\n\t\t\t\t\t\t\t\"qwertyuioplkjhgfdsazxcvbnm\");\n}", "public function isAlpha()\n {\n return $this->matchesPattern('^[[:alpha:]]*$');\n }", "function is_palindrome($letters) {\n\treturn strrev($letters) == $letters;\n}", "private function has_upper($args){\n if(preg_match(\"/[A-Z]/\", $args['value'])){\n return true;\n } else {\n $this->_warnings .= ucfirst($args['var']) . \" must contain at least one uppercase letter.<br/>\\r\\n\";\n return false;\n }\n }", "function akhir_nashob_fathah($kata){\n if (mb_substr($kata, -1, 1) == 'َ' || \n \tmb_substr($kata, -1, 1) == 'ى' ) \n {\n return true;\n }\n }", "function _s_has_letters( $string ) {\n\treturn preg_match( '/[a-zA-Z]/', $string );\n}", "public function isFirstPartOfStrReturnsFalseForNotMatchingFirstPartDataProvider() {}", "function usingFlags(string $char, array $flags): string\n{\n\n /*\n * this function does sort chars according to categories 'letter', 'punctuation' or 'symbol'\n */\n\n switch ($char) {\n case (ctype_alpha($char)):\n if (in_array('-L', $flags)) {\n return 'letter';\n }\n break;\n case (in_array($char, str_split(\"',;.?!`'\"))):\n if (in_array('-P', $flags)) {\n return 'punctuation';\n }\n break;\n case (!in_array($char, str_split(\"',;.?!`'\")) && !ctype_alpha($char)):\n if (in_array('-S', $flags)) {\n return 'symbol';\n }\n break;\n default:\n die('Something went wrong...');\n }\n\n}", "function surname($str)\n\t{\n\t\treturn ( ! preg_match(\"/^([-a-z\\'0-9_-])+$/i\", $str)) ? FALSE : TRUE;\n\t}", "function first_letter_capital($str){\n\n $output = preg_replace_callback('/([.!?])\\s*(\\w)/', function ($str) {\n return strtoupper($str[1] . ' ' . $str[2]);\n }, ucfirst(strtolower($str)));\n return $output;\n\n }", "function is_compound_lname($word) {\n $word = strtolower($word);\n // these are some common prefixes that identify a compound last names - what am I missing?\n $words = array('vere','von','van','de','del','della','di','da','pietro','vanden','du','st.','st','la','ter');\n return array_search($word,$words);\n}", "public function alpha($str){\n\t\t\treturn !!preg_match('/^[a-z0-9]+$/i', $str);\n\t\t}", "public function existCase($x1,$y1){\n if($this->isCase($x1,$y1)>=0){\n return true;\n }else{\n return false;\n }\n }" ]
[ "0.6462798", "0.6338597", "0.6027323", "0.5888245", "0.56753266", "0.5578977", "0.5567908", "0.5534994", "0.5523784", "0.54916567", "0.54546213", "0.5398437", "0.537488", "0.5369887", "0.53574955", "0.53156656", "0.5248382", "0.524761", "0.52406114", "0.52391016", "0.52347344", "0.52128386", "0.5211489", "0.5205297", "0.5201461", "0.5200447", "0.5184401", "0.51843065", "0.51680136", "0.5156127", "0.5119901", "0.51115656", "0.5106018", "0.5094745", "0.5058191", "0.50561523", "0.5051063", "0.5030413", "0.5025237", "0.5013857", "0.50077194", "0.50075114", "0.50058436", "0.5004597", "0.5001877", "0.49972072", "0.49922702", "0.49817148", "0.498156", "0.49765638", "0.4957172", "0.49374372", "0.49272814", "0.49141717", "0.48983148", "0.48698035", "0.48695132", "0.486007", "0.48596683", "0.48563364", "0.48526266", "0.4828284", "0.4825337", "0.48168752", "0.48123613", "0.48014572", "0.4797053", "0.478994", "0.4789469", "0.47833908", "0.4776345", "0.4776243", "0.4775056", "0.47746348", "0.47676098", "0.47662997", "0.47618684", "0.47535864", "0.4742055", "0.47393963", "0.4734036", "0.47289926", "0.47234967", "0.47206116", "0.47155458", "0.47121677", "0.47120708", "0.47109067", "0.47088677", "0.4705914", "0.4704604", "0.4693279", "0.4690042", "0.46897888", "0.4678776", "0.46784884", "0.46700376", "0.466921", "0.46652323", "0.4664691" ]
0.7162396
0
Determine word is contains Y or not
Определить, содержит ли слово Y или нет
protected function isContainsY($word) { $latin_word = $this->getArrayFromLatinWord($word); if (count($this->getArrayFromLatinWord($word)) == 2 && $latin_word[1] == 'y') { $suffix = $latin_word[0] . 'ay'; array_shift($latin_word); $latin_word = implode('', $latin_word); return print_r($latin_word . '-' . $suffix); } if (!in_array($latin_word[0], $this->vowels) && !in_array($latin_word[1], $this->vowels)) { if (in_array($latin_word[2], $this->vowels) || $latin_word[2] === 'y') { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function containsWord($str, $word){\n\treturn !!preg_match('#\\\\b' . preg_quote($word, '#') . '\\\\b#i', $str);\n}", "protected function isFirstY($word)\n {\n $first_element = $this->getArrFirstLetterOfLatinWord(\n $this->getArrayFromLatinWord(\n $word\n )\n );\n if (strtolower($first_element[0]) == 'y') {\n return true;\n }\n return false;\n }", "function containsWord($word, $sentence){\n // if $word or $sentence param is blank\n if(strlen($word) === 0 || strlen($sentence) === 0) {\n echo \"Supplied word or sentence is blank. Please check your input\";\n return false;\n }\n\n // 1. remove punctuation\n $strippedSentence = str_replace(array('.', ','), array(''), $sentence);\n // 2. explode str into array\n $sentenceArray = explode(\" \", $strippedSentence);\n\n foreach($sentenceArray as $str) {\n // 3. compare binary value of strings\n if(strcasecmp($str, $word) === 0) {\n return true;\n }\n }\n\n return false;\n }", "static function containsWord($text, $wholeWordToFind){ return !!preg_match('#\\\\b' . preg_quote($wholeWordToFind, '#') . '\\\\b#i', $text); }", "public function c_value_yes() {\r\n $pattern = \"/(?:(?<=\\s)|(?<=^))\" . preg_quote($this->string2, '/') . \"(?:(?=\\s)|(?=$))/i\";\r\n // Match the pattern to check if the word exists in the string.\r\n $exists = preg_match($pattern, $this->string1, $matches, PREG_OFFSET_CAPTURE, $this->initial_pos);\r\n // If the word exists, return its first occurence.\r\n if ($exists) {\r\n $string_position = $matches[0][1];\r\n }\r\n else {\r\n $string_position = 'No Worries';\r\n }\r\n return $string_position;\r\n }", "function _o( $word ){\n if ( strlen($word) >= 3 ) {\n if ( $this->is_consonant($word, -1) && !$this->is_consonant($word, -2) &&\n $this->is_consonant($word, -3) ) {\n $last_char = substr($word, -1);\n if ( $last_char == 'w' || $last_char == 'x' || $last_char == 'y' ) {\n return false;\n }\n return true;\n }\n }\n return false;\n }", "function acf_str_exists($needle, $haystack) {}", "function matchesMultipleWords(string $string) : bool\n{\n return preg_match('/hideous|shadowy|infernal/', $string) === 1;\n}", "function matchesWordCaseInsensitive(string $string) : bool\n{\n return preg_match(\"/word/i\", $string) === 1;\n}", "function matchesDystopiaOrUtopia(string $string) : bool\n{\n // positive lookbehind\n return preg_match('/(?<=dys|u)topia/', $string) === 1;\n}", "private static function does_not_inflect($word) {\n\t\t\tforeach(self::$words_that_do_not_inflect_in_the_plural as $noninflector) {\n\t\t\t\tif(substr($noninflector, 0, 1) == '-') $noninflector = '.*' . substr($noninflector, 1);\n\t\t\t\tif(preg_match(\"/{$noninflector}/\", $word) == 1) {\n\t\t\t\t\t// print \"Warning: noninflector detected ({$word})\\n\";\n\t\t\t\t\treturn true; // if the word matches the regex (once), then return the word\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}", "function check_inputs($string,$words) {\n $returnable = TRUE;\n \n foreach($words AS $word) {\n if(stripos($string, $word)!==false){\n $returnable = FALSE;\n }\n }\n \n return $returnable;\n}", "function str_match($str, $target)\n {\n return strpos( $str, \"$target\") !== FALSE;\n }", "public function contains($str)\r\n {\r\n $a1 = strtolower($this->getTitle());\r\n $b1 = strtolower($str);\r\n return strlen(strpos($a1,$b1)) > 0 ? 1 : 0;\r\n }", "function findWord($string, $searchWord)\n{\n\t$WordArray = myExplode($string);\n\t$lenght = myLenght($WordArray);\n\t$iterator = 0;\n\t$flag = \"Not Found\";\n\t \n\twhile($iterator != $lenght)\n\t{\n\t\tif($WordArray[$iterator] == $searchWord)\n\t\t{\n\t\t\t$flag = \"Found\";\n\t\t}\n\t\t $iterator += 1;\n\t}\n\t \n\treturn $flag;\n}", "function findatStartorEnd($string,$word){\n echo \"The string is \\\"$string\\\" and the word is \\\"$word\\\".<br />\";\n $array=explode(\" \",$string);\n $firstword= array_shift($array);\n $lastword= array_pop($array);\n if (strcmp($firstword,$word)==0 || strcmp($lastword,$word)==0){\n return true;\n }\n else\n return false;\n }", "function fw_has( $source, $term ) {\n\treturn \n\t( empty( $source ) || empty( $term ) ) ? \n\t\tfalse : ( false !== \\strpos( $source, $term ) );\n}", "function is_suffix($word) {\n // ignore periods\n $word = str_replace('.','',$word);\n // these are some common suffixes - what am I missing?\n $suffix_array = array('I','II','III','IV','V','Senior','Junior','Jr','Sr','PhD','APR','RPh','PE','MD','MA','DMD','CME');\n foreach ($suffix_array as $suffix) {\n if (strtolower($suffix) == strtolower($word))\n return $suffix;\n }\n return false;\n}", "public function testContains()\n {\n $this->assertFalse(StringHelper::contains($this->text,'Test'));\n $this->assertFalse(StringHelper::contains($this->text,''));\n $this->assertTrue(StringHelper::contains($this->text,'as survived not only f'));\n $this->assertFalse(StringHelper::contains($this->text,array()));\n $this->assertFalse(StringHelper::contains($this->text,array('-','+','=')));\n $this->assertTrue(StringHelper::contains($this->text,array('versions','essentially','...')));\n }", "function textHas( $source, string $term ) : bool {\n\treturn \n\t( empty( $source ) || empty( $term ) ) ? \n\t\tfalse : ( false !== \\strpos( ( string ) $source, $term ) );\n}", "public function isWord(): bool\n {\n return ($this->token_type == self::WORD);\n }", "function _no_bad_words($haystack){\n \n $needle = array(\n 'anus', 'arse', 'ass', 'bag', 'bait', 'bimbo', 'bitch', 'bite', 'blow', 'bollo', 'boner', 'boob', 'butt', 'chinc', 'chink', 'chode', 'clit', 'cock', 'coon', 'cum', 'cunt', 'damn', 'dick', 'dike', 'dildo', 'dooch', 'douche', 'dumb', 'dyke', 'fag', 'fck', 'fcuk', 'flame', 'fuck', 'fuk', 'gay', 'hate', 'hoe', 'hole', 'hump', 'jap', 'lips', 'lord', 'love', 'mofo', 'munch', 'nigg', 'paki', 'penis', 'piss', 'poon', 'porn', 'prick', 'pussy', 'queef', 'queer', 'renob', 'rimjob', 'ruski', 'sex', 'shit', 'skank', 'skeet', 'skull', 'slit', 'slow', 'slut', 'spic', 'spik', 'tard', 'teet', 'tit', 'twat', 'twit', 'vagina', 'vaj', 'wad', 'wank', 'weed', 'whore', 'wit'\n );\n \n $regex = '/' . implode('|', array_map('preg_quote', $needle)) . '/i';\n \n return (preg_match($regex, $haystack) === 0);\n }", "function verifyWord($raw_word,$enter_word){\r\n if(!preg_match('/^[\\x{4e00}-\\x{9fa5}]{4}$/u',$enter_word)) return [\r\n 'ok'=>false,\r\n 'error'=>'成语不合法!'\r\n ];\r\n if($this->query(\"select * from 'dictonary' where wholeWord='\".$enter_word.\"'\")->fetchArray()){\r\n mb_internal_encoding('UTF-8'); \r\n if(mb_substr($raw_word,mb_strlen($raw_word,\"utf-8\")-1,1)!=mb_substr($enter_word,0,1)) return [\r\n 'ok'=>false,\r\n 'error'=>'新成语首字和提交成语最后一字不相同!'\r\n ];\r\n $count_of_words = $this->query(\"select count(*) from 'dictonary' where firstWord='\".mb_substr($enter_word,mb_strlen($enter_word,\"utf-8\")-1,1).\"' ;\")->fetchArray()[0];\r\n if($count_of_words<1) return [\r\n 'ok'=>true,\r\n 'new'=>null\r\n ];\r\n return [\r\n 'ok'=>ture,\r\n 'new'=>$this->query(\"select * from 'dictonary' where firstWord='\".mb_substr($enter_word,mb_strlen($enter_word,\"utf-8\")-1,1).\"' limit 1 offset \".mt_rand(0,$count_of_words-1))->fetchArray()['wholeWord']\r\n ];\r\n }else return [\r\n 'ok'=>false,\r\n 'error'=>'成语不存在!'\r\n ];\r\n }", "function exist($string, $word) {\n if(substr_count($string, $word) > 0 ) return 1;\n return -1;\n}", "private function isVerbClass72(string $word): bool\n {\n if (preg_match(\"/(hap|par|mad)ata/\", $word) ||\n // exclude fex. lanata\n preg_match(\"/(.*)(l|n|p|h|y|s|a|ai|aj|av|am|ed|ev|hk|hm|hv|id|ii|im|ir|iu|lm|lv|oj|or|nk|rj|rm|rk|yk|uj|ur)eta/\", $word) ||\n // kyetä, paeta, norjeta, ranketa, edetä\n preg_match(\"/(.*)(aks|eik|eud)ota/\", $word) ||\n // heikota\n preg_match(\"/(.*)(al|ir|in|ja|lk|ll|lo|om|sa|rk|rv|uk|va)ita/\", $word) ||\n // ansaita, harkita, hallita, häiritä, iloita, lukita, mainita\n preg_match(\"/(.*)(aa|ai|uo|ou|pe|pi)sta/\", $word) ||\n // ehkäistä\n preg_match(\"/(.*)(arv|arj|eik|iev|imm|iuk|oiv|orj|ouk|urj|umm|ust|uum|val|yhj)eta/\", $word) ||\n // himmetä, norjeta, tyhjetä\n preg_match(\"/(.*)(aks)uta/\", $word)) {\n return true;\n }\n return false;\n }", "function string_contains_all_words( $string, $array ) {\n\t$missed = false;\n\n\tforeach ( $array as $word ) {\n\t\tif ( strpos( $string, $word ) !== false ) {\n\t\t\tcontinue;\n\t\t} else {\n\t\t\t$missed = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn ! $missed;\n}", "function IsNegated($wordToTest, $include_nt=true){\r\n\t\t\r\n\t\tif(in_array($wordToTest,NEGATE)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif ($include_nt) {\r\n\t\t\tif (strpos($wordToTest,\"n't\")){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "private function hasWord(string $word, string $txt) : int\n {\n $pattern = \"/(?:^|[^a-zA-Z])\" . preg_quote($word, '/') . \"(?:$|[^a-zA-Z])/i\";\n\n return preg_match($pattern, $txt);\n }", "public function inclusion_of($value, $words)\n\t{\n\t\treturn mb_strstr($words, $value);\n\t\t\n\t}", "function in_string ($words, $string, $option)\n{\n $marca=\"\";\n if ($option == \"all\") {\n $isFound = true;\n foreach ($words as $value) {\n $isFound = $isFound && (stripos($string, $value) !== false); // returns boolean false if nothing is found, not 0\n if ($isFound) {\n $marca=$value;\n break; // if a word was found, there is no need to continue\n }\n }\n } else {\n $isFound = false;\n foreach ($words as $value) {\n $isFound = $isFound || (stripos($string, $value) !== false);\n if ($isFound) {\n $marca=$value;\n break; // if a word was found, there is no need to continue\n }\n }\n }\n return $marca;\n}", "function is_compound_lname($word) {\n $word = strtolower($word);\n // these are some common prefixes that identify a compound last names - what am I missing?\n $words = array('vere','von','van','de','del','della','di','da','pietro','vanden','du','st.','st','la','ter');\n return array_search($word,$words);\n}", "public static function yn2tf($a_yn)\n\t{\n\t\tif(strtolower($a_yn) == \"y\")\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "abstract protected function searchForWords();", "function is_salutation($word) {\n // ignore periods\n $word = str_replace('.','',strtolower($word));\n // returns normalized values\n if ($word == \"mr\" || $word == \"master\" || $word == \"mister\")\n return \"Mr.\";\n else if ($word == \"mrs\")\n return \"Mrs.\";\n else if ($word == \"miss\" || $word == \"ms\")\n return \"Ms.\";\n else if ($word == \"dr\")\n return \"Dr.\";\n else if ($word == \"rev\")\n return \"Rev.\";\n else if ($word == \"fr\")\n return \"Fr.\";\n else\n return false;\n}", "function checkwords ($String, $TestOnly)\r\n{\r\n\r\n\t// You can add the words you don't want users to use in the $BadWords array bellow. As an eregi\r\n\t// function is called to find them in strings, you may use valid POSIX 1003.2 regular expressions\r\n\t// (see second line of the array for an example).\r\n\t// Note that search is not case sensitive, except for special characters such as accentued ones.\r\n\r\n\t$BadWords = array (\r\n\t\t\t\t\"shit\",\r\n\t\t\t\t\"fuck([[:alpha:]]*)\"\r\n\t);\r\n\r\n\t$ReplaceString = \"@#$*!\";\t// String that will replace \"swear words\"\r\n\r\n\r\n\t// Don't modify lines bellow \r\n\r\n\t$Found = false;\r\n\tfor (reset($BadWords); $ToFind = current($BadWords); next($BadWords))\r\n\t{\r\n\t\t$Found = eregi(addslashes($ToFind), $String);\r\n\t\tif ($Found)\r\n\t\t{\r\n\t\t\tif ($TestOnly)\r\n\t\t\t{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$String = eregi_replace(addslashes($ToFind), $ReplaceString, $String);\r\n\t\t\t};\r\n\t\t};\r\n\t};\r\n\r\n\tunset($BadWords);\r\n\treturn ($TestOnly ? $Found : $String);\r\n}", "function str_contains($choice, $query) {\n return strpos($choice, $query) !== false;\n }", "function is_word_in_dictionary( $word)\n{\n\tglobal $dict;\n\treturn isset($dict[$word]);\n}", "function str_has(string $string, string|array $search, bool $icase = false): bool\n{\n if (is_array($search)) {\n foreach ($search as $search) {\n if (str_has($string, (string) $search, $icase)) {\n return true;\n }\n }\n return false;\n }\n\n return !$icase ? str_contains($string, $search) : (\n mb_stripos($string, $search) !== false\n );\n}", "function evaluateWord($arrayA, $b){\n $arrayB = str_split($b);\n\n for($i = 0; $i < strlen($arrayA) ; $i++){\n $char = $arrayA[$i];\n $index = strpos(implode($arrayB), $char);\n if($index !== FALSE){\n array_splice($arrayB, $index,1);\n }\n }\n if(strlen(implode($arrayB)) === 0){\n return TRUE;\n }else{\n return FALSE;\n }\n}", "function is_language_text ($TEXT) {\n if (preg_match(\"/[a-z]{2}_[A-Z]{2}/\", $TEXT ) === 1) {\n return true;\n } else {\n return false;\n }\n}", "function yesANDno($value, $word) {\r\n if ($value == 0) {\r\n return \"<span class='Yes yn'>$word: Yes</span>\";\r\n } elseif ($value == 1){\r\n return \"<span class='No yn'>$word: No</span>\";\r\n }\r\n}", "function searchWord($board, $str)\n{\n $isUnique = getIsUniqueLetter($board);\n\n if ($isUnique) {\n $string = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);\n return existLetterAdjacent($board,$string);\n }else{\n return $isUnique;\n }\n\n}", "function notNounOrVerbSST($s) {\r\n\t$parts = explode('|', $s);\r\n\t$sst = $parts[1];\r\n\tif (preg_match('/^([A-Z ]+|[a-z]+)$/', $sst))\r\n\t\treturn false;\r\n\treturn true;\r\n}", "protected function wordRemnant($word)\r\n {\r\n for ($i = 0; $i < strlen($word); $i++) {\r\n if (stripos(static::VOWELS, $word[$i]) !== false) {\r\n $this->syllables_count++;\r\n }\r\n }\r\n }", "function getbool($str)\n{\n\t$c1 = strtoupper(substr($str, 0, 1));\n\t$c2 = strtoupper(substr($str, 1, 1));\n\tif ($c1 == 'Y' || $c1 == 'T' || $c1 == '1' || $c2 == 'N' || $c1 == 'A')\n\t\treturn 1;\n\treturn 0;\n}", "function str_contains_words($string, array $words)\n {\n $explodedString = explode(' ', strtolower($string));\n\n return collect($words)->filter(function ($word) use ($explodedString) {\n return in_array($word, $explodedString);\n })->count() > 0;\n }", "function str_contains(string $haystack, string $needle)\n{\n return strpos($haystack, $needle) !== false;\n}", "function _lookup_dictionary_word($target)\n\t{\n\t\tif ($this->CI->config->item('allow_dictionary_pw') == 'y' OR $this->CI->config->item('name_of_dictionary_file') == '')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$path = reduce_double_slashes(PATH_DICT.$this->CI->config->item('name_of_dictionary_file'));\n\n\t\tif ( ! file_exists($path))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$word_file = file($path);\n\n\t\tforeach ($word_file as $word)\n\t\t{\n\t\t \tif (trim(strtolower($word)) == $target)\n\t\t \t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function is_consonant( $word, $pos ){\n // Sanity checking $pos\n if ( abs($pos) > strlen($word) ) {\n if ( $pos < 0 ) {\n // Points \"too far back\" in the string. Set it to beginning.\n $pos = 0;\n } else {\n // Points \"too far forward.\" Set it to end.\n $pos = -1;\n }\n }\n $char = substr($word, $pos, 1);\n switch ( $char ) {\n case 'a':\n case 'e':\n case 'i':\n case 'o':\n case 'u':\n return false;\n case 'y':\n if ( $pos == 0 || strlen($word) == -$pos ) {\n // Check second letter of word.\n // If word starts with \"yy\", return true.\n if ( substr($word, 1, 1) == 'y' ) {\n return true;\n }\n return !($this->is_consonant($word, 1));\n } else {\n return !($this->is_consonant($word, $pos - 1));\n }\n default:\n return true;\n }\n }", "function str_contains($haystack, $needles)\n {\n foreach ((array) $needles as $needle) {\n if ($needle !== '' && mb_strpos($haystack, $needle) !== false) {\n return true;\n }\n }\n\n return false;\n }", "function wordExists($word) {\n\t\t$rs = sql_query(\"SELECT count(*) as amount FROM \".$this->table_wf.\" WHERE word='\". mysql_real_escape_string($word).\"'\");\n\t\t$obj = mysql_fetch_object($rs);\n\t\tif ($obj->amount == 0) return false;\n\t\telse return true;\n\t}", "public function match( $string );", "public static function textHas( $source, string $term ) : bool {\n\t\treturn \n\t\t( empty( $source ) || empty( $term ) ) ? \n\t\t\tfalse : ( false !== \\strpos( ( string ) $source, $term ) );\n\t}", "function getMarca($str)\n{\n $marques = array(\"SEAT\", \"VOLVO\",\"FORD\",\"NISSAN\",\"VOLKSWAGEN\",\"CADILLAC\");\n $str = strtoupper($str);\n return (in_string($marques, $str, \"any\"));\n \n}", "public function hasWords(){\n return $this->_has(3);\n }", "function labelCheck($str){\n if(preg_match(\"/^([\\w_\\-$&%*!?]+)$/\", $str)){\n decho(\" labelCheck \\e[32mGOOD\\e[0m [$str]\\n\");\n return true;\n }\n decho(\" labelCheck \\e[31mFAIL\\e[0m [$str]\\n\");\n return false;\n}", "function matchesWordsPrefixedWithMidExceptMidnight(string $string) : bool\n{\n // negative lookahead\n return preg_match('/mid(?!night)/', $string) === 1;\n}", "static function contains( $str, $val ) {\n\t\treturn ( strpos( $str, $val ) !== false );\n\t}", "function search($word) {\n $node = $this->searchPrefix($word);\n return $node != null && $node->isEnd;\n }", "function check_for_blacklist_words( $content ) {\n\n\t\tif ( empty( $content ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the moderation keys.\n\t\t$blacklist_words = yz_option( 'yz_moderation_keys' );\n\n\t\t// Bail if blacklist is empty.\n\t\tif ( ! empty( $blacklist_words ) ) {\n\n\t\t\t// Get words separated by new lines.\n\t\t\t// $words = explode( \"\\n\", $blacklist );\n\n\t\t\t// Loop through words.\n\t\t\tforeach ( $blacklist_words as $word ) {\n\n\t\t\t\t// Trim the whitespace from the word.\n\t\t\t\t$word = trim( $word );\n\n\t\t\t\t// Skip empty lines.\n\t\t\t\tif ( empty( $word ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Do some escaping magic so that '#' chars in the\n\t\t\t\t// spam words don't break things.\n\t\t\t\t$word = preg_quote( $word, '#' );\n\t\t\t\t$pattern = \"#$word#i\";\n\n\t\t\t\t// Check each user data for current word.\n\t\t\t\tif ( preg_match( $pattern, $content ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function contains($message, $str){\n return (strpos($message, $str) !== false);\n}", "function check_in_string($str_to_check, $keywords, $delimiter = ',')\n{\n $words = explode($delimiter, $keywords);\n $words = array_map(function ($word) {\n return trim($word);\n }, $words);\n\n foreach ($words as $word) {\n if ($word && strpos($str_to_check, $word) !== false) {\n return true;\n }\n }\n\n return false;\n}", "function check_word($letter){\n\t\t\t$acierto = false;\n\t\t\tforeach ($this->word as $key => $value) {\n\n\t\t\t\t\tif($value['char']==ucfirst($letter)||$value['char']==strtolower($letter)){\n\t\t\t\t\t\t$this->word[$key]['is_check'] = 1;\n\t\t\t\t\t\t$acierto = true;\n\t\t\t\t\t}\n\t\t\t\t\tif($this->word[$key]['is_check'] !=1){\n\t\t\t\t\t\t$completada = false;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($acierto == false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn $this->word;\n\t\t}", "public function checkStringForWords($string, $arrayOfWords)\n {\n // If $arrayOfWords is a string, convert it to array\n if(!is_array($arrayOfWords)) $arrayOfWords = [$arrayOfWords];\n\n // Loop and check\n foreach($arrayOfWords as $word){\n if(strpos($string, $word) !== false) {\n return true;\n }\n }\n\n return false;\n }", "function inString($str1, $str2) {\n $str1 = strtolower($str1);\n $str2 = strtolower($str2);\n if (strpos($str2, $str1) === false) {\n return false;\n } else {\n return true;\n }\n}", "function input_moderation_analysis($text)\n{\n\t$text = strtolower($text);\n\t$blacklist = array(\n\t\t\"specification\",\n\t\t\"assignment\",\n\t\t\"assessment\",\n\t\t\"logbook\",\n\t\t\"collusion\",\n\t\t\"deadline\",\n\t\t\"unmoderated\",\n\t\t\"moderated\",\n\t);\n\tforeach ($blacklist as $cWord)\n\t{\n\t\tif (strpos($text, $cWord) !== FALSE)\n\t\t\treturn true;\n\t}\n\treturn false;\n}", "public function like($x, $y)\n {\n return $this->comparison($x, 'LIKE', $y);\n }", "public function getValidWords();", "function stringContains($haystack, $needle)\n{\n\treturn strpos($haystack, $needle) !== false;\n}", "function str_contains($haystack, $needles)\n {\n foreach ((array) $needles as $needle)\n {\n if ($needle != '' && strpos($haystack, $needle) !== false) return true;\n }\n return false;\n }", "function mailchimp_string_contains($haystack, $needles)\n{\n foreach ((array) $needles as $needle) {\n if ($needle != '' && mb_strpos($haystack, $needle) !== false) {\n return true;\n }\n }\n\n return false;\n}", "public function is_value_word () {\n\t\tif ($this->value) {\n\t\t\treturn @preg_match(\"/^[A-Za-z_]+/\", $this->value);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function countWordsPluralOK()\n {\n return preg_match_all(\"/\\b($this->word+?)(s\\b|\\b)/i\", $this->sentence, $matched);\n }", "function w_starts_with ( $str, $test ) {\n return 0 === strpos( $str, $test );\n}", "function string_contains($string, $match) {\n return strpos($string, $match) !== false;\n }", "function str_contains($haystack, $needles)\n\t{\n\t\treturn Str::contains($haystack, $needles);\n\t}", "function mlike($s, $magica, $magicb = NULL)\r\n{\r\n if (is_null($magicb))\r\n return (substr($s, 0, strlen($magica)) === $magica);\r\n else\r\n return (substr($s, 0, strlen($magica)) === $magica) || (substr($s, 0, strlen($magicb)) === $magicb);\r\n}", "private function hasGoodText( $good_text, $any_or_all, $tweet_text, $default )\r\n\t{\r\n\t\tif ( empty( $good_text ) ) { // don't factor in the includewords if there aren't any\r\n\t\t\treturn $default;\r\n\t\t} else {\r\n\t\t\t$encoded_text = ' ' . str_replace( array( '+', '%0A' ), ' ', urlencode( str_replace( array( '#', '@' ), array( ' HASHTAG', ' MENTION' ), strtolower( $tweet_text ) ) ) ) . ' ';\r\n\r\n\t\t\tif ( $any_or_all == 'any' ) {\r\n\t\t\t\t// as soon as we find any of the includewords, stop searching and return true\r\n\t\t\t\tforeach ( $good_text as $good ) {\r\n\t\t\t\t\t$converted_includeword = trim( str_replace('+', ' ', urlencode( str_replace( array( '#', '@' ), array( ' HASHTAG', ' MENTION' ), strtolower( $good ) ) ) ) );\r\n\t\t\t\t\tif ( preg_match('/\\b'.$converted_includeword.'\\b/i', $encoded_text, $matches ) ) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// if foreach finishes without finding any matches\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\t// to make sure all of the includewords are present, keep a count of\r\n\t\t\t\t// how many of the words are detected and compare it to the number that's needed\r\n\t\t\t\t$good_text_matches = 0;\r\n\t\t\t\t$number_of_good_text_to_look_for = count( $good_text );\r\n\t\t\t\tforeach ( $good_text as $good ) {\r\n\t\t\t\t\t$converted_includeword = trim( str_replace('+', ' ', urlencode( str_replace( array( '#', '@' ), array( ' HASHTAG', ' MENTION' ), strtolower( $good ) ) ) ) );\r\n\r\n\t\t\t\t\tif ( preg_match('/\\b'.$converted_includeword.'\\b/i', $encoded_text, $matches ) ) {\r\n\t\t\t\t\t\t$good_text_matches++;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tif ( $good_text_matches >= $number_of_good_text_to_look_for ) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "function isAnnkissam($inputSpaceSeparatedString) {\n\n $nouns = [\"abcd\", \"c\", \"def\", \"h\", \"ij\", \"cde\"];\n $verbs = [\"bc\", \"fg\", \"g\", \"hij\", \"bcd\"];\n $articles = [\"a\", \"ac\", \"e\"];\n\n $arrayOfWords = explode(\" \", $inputSpaceSeparatedString);\n\n $numberOfNouns = 0;\n $numberOfVerbs = 0;\n $numberOfArticles = 0;\n\n $correctSentence = false;\n\n foreach ($arrayOfWords as $currentString) {\n if (in_array($currentString, $nouns)) {\n $numberOfNouns = $numberOfNouns + 1;\n }\n if (in_array($currentString, $verbs)) {\n $numberOfVerbs = $numberOfVerbs + 1;\n }\n if (in_array($currentString, $articles)) {\n $numberOfArticles = $numberOfArticles + 1;\n }\n }\n\n if ($numberOfVerbs >= 1 && ($numberOfNouns >= 1 || $numberOfArticles >= 2) && (($numberOfNouns + $numberOfVerbs + $numberOfArticles) == count($arrayOfWords))) {\n $correctSentence = true;\n }\n\n return $correctSentence;\n\n }", "function str_contains(string $haystack, string $needle): bool {\n\t\treturn strpos($haystack, $needle) !== false;\n\t}", "public static function contains($str, $needle, $i = true) {\n if($i) {\n $str = static::lower($str);\n $needle = static::lower($needle);\n }\n return strstr($str, $needle) ? true : false;\n }", "private function _guess_is_word($guess)\n {\n if ($guess === $this->_word) {\n $this->correct_positions = str_split($guess);\n } else {\n $this->misses[] = $guess;\n }\n }", "function str_contains_str(string $haystack, string $needle): bool\n{\n return strpos($haystack, $needle) !== false;\n}", "function strContain($A, $B)\n {\n $hash = $this->hash($A);\n foreach ($B as $alpha) {\n $tmp = 1 << (ord($alpha) - ord('A'));\n if (($hash & $tmp) == 0) {\n return 0;\n }\n }\n\n return 1;\n }", "public function has(string $needle): bool\n {\n $needle = $this->inputConv($needle);\n\n return str_contains($this->str, $needle);\n }", "public function matches($str, $field) {\n if (!isset($GetPost[$field])) {\n return FALSE;\n }\n\n $field = $GetPost[$field];\n\n return ($str !== $field) ? FALSE : TRUE;\n }", "function matchesAnyCharacterAndAWordCharacter(string $string) : bool\n{\n // note that \\w is equivalent to [a-zA-Z0-9_]\n return preg_match('/.\\w/', $string) === 1;\n}", "public abstract function find($sWord);", "function matchesPluralOptionally(string $string) : bool\n{\n return preg_match(\"/{$string}s?/\", $string) === 1;\n}", "public static function generous_match($passageword,$transcriptword,$language){\n $lang = substr($language,0,2);\n switch($lang){\n case 'en':\n if(self::mb_strequals($passageword . 's', $transcriptword)){return true;}\n if(self::mb_strequals($passageword . 'ed', $transcriptword)){return true;}\n break;\n default:\n return false;\n }\n return false;\n }", "static function has_terms($content, $include, $exclude)\n {\n $found = false;\n // Check for include list:\n foreach ($include as $term) {\n if (preg_match('/\\b' . $term . '\\b/', $content) == 1) {\n $found = true;\n }\n }\n // Check for exclude list:\n foreach ($exclude as $term) {\n if (stristr($content, $term) !== false) {\n $found = false;\n }\n }\n\n return $found;\n }", "protected function verify_word_pair($word_pair) {\n\t\t//Maybe build-in sanitizer functions here? as this probably will mostly check input from $_GET\n\t\treturn preg_match(\"|[\" . self::$chars . \"]+|\", $word_pair);\n\t}", "private function _matchStringLoose($str1, $str2)\n {\n return strcasecmp(\n $this->_transformString($str1),\n $this->_transformString($str2)\n );\n }", "private function _have_verbocity_flag($name)\r\n {\r\n return strstr($this->parameters['verbocity'], $name) !== false;\r\n }", "public static function are_different_words($word1,$word2){\n return \\mod_readaloud\\diff::cleanText( \\core_text::strtolower($word1)) !==\n \\mod_readaloud\\diff::cleanText( \\core_text::strtolower($word2));\n }", "public function looselyMatches($token, $needle)\n {\n if (!$this->loose || strlen($token) >= 255 || strlen($needle) >= 255) {\n return false;\n }\n\n // Unify casing\n $token = strtolower($token);\n $needle = strtolower($needle);\n\n // Unify quotes\n $token = str_replace('\"', \"'\", $token);\n $needle = str_replace('\"', \"'\", $needle);\n\n // Compute Levenshtein distance\n $distance = levenshtein($needle, $token);\n if ($distance > 3) {\n return false;\n }\n\n // Affect usage\n $this->usage -= ($distance * 0.1);\n\n return true;\n }", "protected static function isTrueStrExt($str)\n {\n return (static::isTrueStr($str) || $str === 'on' || $str === 'yes' || $str === 'y');\n }", "public function matchStr( $test, $target ) {\n\t\t\n\t\tif ( $test === $target ) return true;\n\t\t\t\n\t\tif ( substr($test,0,1) === '*' ) {\n\t\t\t\n\t\t\t$test = substr($test,1,strlen($test));\n\t\t\t\n\t\t\tif ( strpos($target,$test) !== false ) return true;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public function beginsWithReturnsFalseForNotMatchingFirstPartDataProvider() {}", "function multiWordMatch($exploded, $needle)\n{\n if(!$needle)\n return FALSE;\n\n $needle = array_filter(explode(\" \", $needle));\n\n if(!$needle || count($needle) == 0)\n return FALSE;\n\n // word indices of the first word of the needle in the haystack\n $isect = array_keys($exploded, $needle[0]);\n\n $nl = count($needle);\n\n // if a one word needle and there are multiple matches, return the first index\n if($nl == 1 && count($isect) > 0)\n return $isect[0];\n\n\n // loop on partial matches of first word of the needle\n foreach($isect as $val)\n {\n // if the $nl array elements of the haystack starting at the partial match\n // match the needle, return the location\n if(count(array_diff(array_slice($exploded, $val, $nl), $needle)) == 0)\n return $val;\n }\n\n return FALSE;\n}" ]
[ "0.63991773", "0.6274501", "0.6160698", "0.60720336", "0.59992266", "0.59829533", "0.59457296", "0.59297067", "0.58712304", "0.5857863", "0.5851435", "0.58004314", "0.5768476", "0.57288396", "0.5699529", "0.56853384", "0.5685154", "0.5670127", "0.5669659", "0.5639016", "0.56359804", "0.56353277", "0.56141365", "0.5611517", "0.55934024", "0.5592116", "0.5577741", "0.55586267", "0.554708", "0.5540957", "0.5523124", "0.5508999", "0.5505642", "0.5489405", "0.5486443", "0.54602104", "0.5450677", "0.54469675", "0.54271823", "0.5419406", "0.5415796", "0.54086494", "0.5401958", "0.54014695", "0.53944796", "0.5362455", "0.5356121", "0.5355346", "0.5350059", "0.53391457", "0.53316396", "0.5274634", "0.5274091", "0.5264029", "0.5259098", "0.525716", "0.5252841", "0.52463084", "0.52421445", "0.52406716", "0.52325565", "0.52122784", "0.5205461", "0.52046984", "0.51990676", "0.5179269", "0.5178304", "0.51741135", "0.5171031", "0.51660645", "0.51539296", "0.51436293", "0.51413316", "0.5140701", "0.51364297", "0.5125533", "0.5116574", "0.511173", "0.5102811", "0.5102809", "0.5096475", "0.5092931", "0.5089787", "0.50786716", "0.50740355", "0.50522053", "0.5049597", "0.5048361", "0.5036905", "0.5035511", "0.5023741", "0.5014662", "0.5011718", "0.5009351", "0.5005834", "0.50035596", "0.4998563", "0.49975452", "0.499678", "0.4994443" ]
0.7310507
0
Register all themes with activating them
Зарегистрировать все темы с активацией их
private function registerAllThemes($active_theme = null) { $directories = $this->app['files']->directories(config('cms.themes.paths')); foreach ($directories as $directory) { if(preg_match('/'.$active_theme.'/',$directory)) { Appearances::registerPath($directory, true); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activate_theme() {\n \n // Activate theme\n (new MidrubBaseAdminCollectionUserHelpers\\Themes)->activate();\n \n }", "function activate_core_themes()\n{\n include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');\n $themes = new themes();\n foreach ($themes->fs_themes as $theme_id => $fs_theme)\n {\n if (in_array($theme_id, array('modus', 'smartpocket')))\n {\n $themes->perform_action('activate', $theme_id);\n }\n }\n}", "public function activate( $theme );", "private function setActiveTheme()\n {\n\t\t$installed = true;\n\t\ttry{\n\t\t $check = \\DB::table('cms_installs')->get();\n\t\t}catch(\\Exception $e){\n\t\t $installed = false;\n\t\t}\n\t\t\n\t\tif($installed) {\t\t\n\t\t\t$admin_prefix = config('cms.admin.prefix', 'p4n3lb04rd');\n\t\t\t$active_theme = setting('site.frontend_theme');\n\t\t\tif($active_theme){\n $this->registerAllThemes($active_theme);\n if(!preg_match('/'.$admin_prefix.'/',\\Request::path())) {\n Appearances::activate($active_theme, true);\n }\n }\n\n\t\t}\n\n return true;\n }", "public function changeTheme();", "function ajan_setup_theme() {\n\tdo_action ( 'ajan_setup_theme' );\n}", "function ajan_register_theme_packages() {\n\tdo_action( 'ajan_register_theme_packages' );\n}", "public static function get_themes()\n {\n }", "function hook_themes_to_enable() {\n $themes = array(\n 'seven',\n 'mysite',\n 'mysite_mobile',\n );\n return $themes;\n}", "public function theme_installer()\n {\n }", "function wp_get_active_and_valid_themes()\n{\n}", "function get_themes()\n{\n}", "public function setup_theme()\n {\n }", "private static function add_theme()\n\t{\n\t\t\n\t\t// get the active theme\n\t\t$theme = Themes::get_active_data( true );\n\t\t\n\t\t// name and version are required in the XML file, make sure GUID is set\n\t\tif ( isset( $theme['info']->guid ) ) {\n\t\t\tUpdate::add( $theme['info']->name, $theme['info']->guid, $theme['info']->version );\n\t\t}\n\t\t\n\t}", "public function setupThemes(){\n\t\treturn $this->theme_setup = array(\n\t\t\t'asset_path' \t=> $this->getAdminAssets(),\n\t\t\t'view_path' \t=> $this->getAdminView(),\n\t\t\t'master_view' \t=> $this->getAdminView() . '.layout'\n\t\t);\n\t}", "public function track_activated_theme()\n {\n }", "function cws_multitheme_register_required_plugins() {\n $plugins = array(\n // This is an example of how to include a plugin from the WordPress Plugin Repository.\n array(\n 'name' => 'CMB2',\n 'slug' => 'cmb2',\n 'required' => true,\n ),\n array(\n 'name' => 'CMB2 Typography',\n 'slug' => 'cmb2-typography-master',\n 'required' => true,\n ),\n );\n\n $config = array(\n 'id' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA.\n 'default_path' => '', // Default absolute path to bundled plugins.\n 'menu' => 'tgmpa-install-plugins', // Menu slug.\n 'parent_slug' => 'themes.php', // Parent menu slug.\n 'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with\n // the parent menu used.\n 'has_notices' => true, // Show admin notices or not.\n 'dismissable' => true, // If false, a user cannot dismiss the nag message.\n 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.\n 'is_automatic' => false, // Automatically activate plugins after installation or not.\n 'message' => '', // Message to output right before the plugins table.\n\n );\n\n tgmpa( $plugins, $config );\n}", "public function registerTheme($name){\n $this->model->registerTheme($name);\n }", "function wpTheme_enqueue_skins()\n {\n $defaults = wpTheme_get_theme_defaults ();\n //Fetch options from the database table\n $options = get_option ('wpTheme_options');\n //Information of the current active theme\n $theme = wp_get_theme ();\n /* CREATE AN ARRAY WITH ALL THE SKINS TO REGISTER */\n $skins = array(\n 'cerulean' => __( 'Cerulean', 'wpTheme' ),\n 'cosmo' => __( 'Cosmo', 'wpTheme' ),\n 'cyborg' => __( 'Cyborg', 'wpTheme' ),\n 'darkly' => __( 'Darkly', 'wpTheme' ),\n 'flatly' => __( 'Flatly', 'wpTheme' ),\n 'journal' => __( 'Journal', 'wpTheme' ),\n 'litera' => __( 'Litera', 'wpTheme' ),\n 'lumen' => __( 'Lumen', 'wpTheme' ),\n 'lux' => __( 'Lux', 'wpTheme' ),\n 'materia' => __( 'Materia', 'wpTheme' ),\n 'minty' => __( 'Minty', 'wpTheme' ),\n 'pulse' => __( 'Pulse', 'wpTheme' ),\n 'sandstone' => __( 'Sandstone', 'wpTheme' ),\n 'simplex' => __( 'Simplex', 'wpTheme' ),\n 'sketchy' => __( 'Sketchy', 'wpTheme' ),\n 'slate' => __( 'Slate', 'wpTheme' ),\n 'solar' => __( 'Solar', 'wpTheme' ),\n 'spacelab' => __( 'Spacelab', 'wpTheme' ),\n 'superhero' => __( 'Superhero', 'wpTheme' ),\n 'united' => __( 'United', 'wpTheme' ),\n 'yeti' => __( 'Yeti', 'wpTheme' ),\n );\n\n\n /* Register each style */\n foreach ($skins as $handle => $value)\n {\n\n $src = get_template_directory_uri() . '/assets/bootswatch/'. $handle .'.css';\n $deps = false;\n $ver = $theme['version'];\n $media = 'all';\n wp_register_style( $handle, $src, $deps, $ver, $media );\n }\n // echo ('<pre>');\n // print_r ($skins);\n // echo ('</pre>');\n foreach ($skins as $handle => $value)\n {\n if (isset ($options['skins']))\n {\n if ( $handle === $options['skins'] )\n {\n wp_enqueue_style( $handle );\n }\n }\n\n }\n\n }", "function install_themes_feature_list()\n{\n}", "public function setThemes(iterable $themes): self;", "public function load_theme()\n {\n do_action('vimeography/load-theme', __FILE__);\n }", "public function iActivateDefaultTheme() {\n\t\t$defaultTheme = 'Twenty Sixteen';\n\t\t$this->iActivateTheme( $defaultTheme );\n\t}", "public function handle_load_themes_request()\n {\n }", "public function load_theme() {\n do_action('vimeography/load-theme', __FILE__);\n }", "function oxy_activate_theme( $theme ) {\n // if no swatches are installed then install the default swatches\n // remove old default swatches\n $swatches = get_posts( array(\n 'post_type' => 'oxy_swatch',\n 'meta_key' => THEME_SHORT . '_default_swatch',\n 'posts_per_page' => '-1'\n ));\n\n if( empty( $swatches ) ) {\n update_option( THEME_SHORT . '_install_swatches', true );\n }\n\n $catalog = array(\n 'width' => '700',\n 'height' => '',\n 'crop' => 0\n );\n\n $single = array(\n 'width' => '700',\n 'height' => '',\n 'crop' => 0\n );\n\n $thumbnail = array(\n 'width' => '90',\n 'height' => '',\n 'crop' => 0\n );\n\n // Image sizes\n update_option( 'shop_catalog_image_size', $catalog ); // Product category thumbs\n update_option( 'shop_single_image_size', $single ); // Single product image\n update_option( 'shop_thumbnail_image_size', $thumbnail ); // Image gallery thumbs\n}", "function install_themes_dashboard()\n{\n}", "public function register()\n {\n // Register parent themes first\n foreach (array_reverse($this->getParents()) as $parent) {\n /** @var Theme $parent */\n $parent->register();\n }\n\n if (file_exists($this->getBasePath() . '/css/theme.css')) {\n $mtime = filemtime($this->getBasePath() . '/css/theme.css');\n Yii::$app->view->registerCssFile($this->getBaseUrl() . '/css/theme.css?v=' . $mtime, ['depends' => AppAsset::class]);\n }\n\n }", "public function afterSetupThemeAction()\n {\n add_theme_support($this->feature, ...$this->args);\n }", "public function all()\n \t{\n \t\t\n \t\t$this->ui->theme->set_shop_id( $this->data['shop']['shop_id'] );\n \t\t$themenames = $this->ui->theme->all_themes();\n \t\t$themes = array();\n \t\tforeach( $themenames as $name )\n \t\t{\n \t\t\t$theme = $this->ui->theme->get_theme_info( $name );\n \t\t\t$themes[$name] = $theme;\t\n \t\t}\n \t\t$this->render('themes' , $themes );\n \t}", "function ajan_after_setup_theme() {\n\tdo_action ( 'ajan_after_setup_theme' );\n}", "public static function load_theme() {\n do_action('vimeography/load-theme', __FILE__);\n }", "function plastical_switch_theme() {\n\tswitch_theme(WP_DEFAULT_THEME);\n\tunset($_GET['activated']);\n\tadd_action('admin_notices', 'plastical_upgrade_notice');\n}", "public function themes() {\r\r\n $model = SCallbackThemesQuery::create()\r\r\n ->joinWithI18n(\\MY_Controller::defaultLocale(), Criteria::LEFT_JOIN)\r\r\n ->orderByPosition()\r\r\n ->find();\r\r\n\r\r\n $this->render('themes_list', array(\r\r\n 'model' => $model,\r\r\n 'locale' => $this->defaultLanguage['identif'],\r\r\n ));\r\r\n }", "function wp_using_themes()\n{\n}", "function wp_ajax_install_theme()\n{\n}", "public function registerAssetBundle()\n {\n call_user_func([$this->theme, 'register'], $this->view);\n }", "function wp_theme_scripts()\n{\n /**\n * @var \\WPackio\\Enqueue\n */\n global $enqueue;\n $enqueue->enqueue('theme', 'main', []);\n}", "public function register_theme_packages() {\n\n\t\t// Register the default theme compatibility package\n\t\tajan_register_theme_package( array(\n\t\t\t'id' => 'legacy',\n\t\t\t'name' => __( 'ActivityNotifications Default', 'ajency-activity-and-notifications' ),\n\t\t\t'version' => ajan_get_version(),\n\t\t\t'dir' => trailingslashit( $this->themes_dir . '/ajan-legacy' ),\n\t\t\t'url' => trailingslashit( $this->themes_url . '/ajan-legacy' )\n\t\t) );\n\n\t\t// Register the basic theme stack. This is really dope.\n\t\tajan_register_template_stack( 'get_stylesheet_directory', 10 );\n\t\tajan_register_template_stack( 'get_template_directory', 12 );\n\t\tajan_register_template_stack( 'ajan_get_theme_compat_dir', 14 );\n\t}", "private function loadTheme()\n {\n $themes = $this->container->get('themes');\n $theme = $themes->getTheme(\n $this->container->get('config')->get('theme')\n );\n\n $this->container->get('twig')->getLoader()\n ->setPaths(array_unique(array($theme->getPath())))\n ;\n }", "public function register() {\n\t\t// Filter must be added as soon as possible since once wp_get_themes() is called, the results are cached.\n\t\tadd_filter( 'extra_theme_headers', [ $this, 'filter_extra_headers' ] );\n\t}", "public function default_theme_compat() {\n\n\t\t\t$plugins_wizard = $this->get_wizard();\n\n\t\t\tif ( ! $plugins_wizard ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_filter( 'ttw_activate_theme_response', array( $this, 'add_install_wizard_step' ), 10, 2 );\n\n\t\t\tadd_action( 'wp_ajax_tm_theme_wizard_install_plugins_wizard', array( $this, 'install_plugins_wizard' ) );\n\t\t\tadd_action( 'ttw_skip_child_installation', array( $this, 'install_plugins_wizard' ) );\n\n\t\t\tadd_action( 'wp_ajax_tm_theme_wizard_get_success_redirect_link', array( $this, 'get_success_redirect' ) );\n\t\t}", "public function switch_theme() {\n\t\t\tupdate_option( 'job_manager_enable_categories', 1 );\n\t\t\tupdate_option( 'job_manager_enable_types', 1 );\n\t\t\tupdate_option( 'resume_manager_enable_categories', 1 );\n\t\t\tupdate_option( 'resume_manager_enable_skills', 1 );\n\t\t}", "function wporg_themes_setup() {\n\tglobal $themes_allowedtags;\n\n\tload_theme_textdomain( 'wporg-themes' );\n\n\tadd_theme_support( 'html5', array(\n\t\t'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'\n\t) );\n\n\tadd_theme_support( 'title-tag' );\n\n\t// No need for canonical lookups\n\tremove_action( 'template_redirect', 'redirect_canonical' );\n\tremove_action( 'template_redirect', 'wp_old_slug_redirect' );\n\n\tadd_action( 'template_redirect', 'wporg_themes_canonical_redirects' );\n\n\tadd_theme_support( 'wp4-styles' );\n}", "public function theme_on_activation() {\n\t\tglobal $pagenow;\n\n\t\tif ( $pagenow == 'themes.php' && isset( $_REQUEST['activated'] ) ) {\n\n\t\t\tif ( method_exists( $this, 'on_activation' ) ) {\n\t\t\t\t$this->on_activation();\n\t\t\t}\n\n\t\t}\n\t}", "function wp_ajax_query_themes()\n{\n}", "private function addons_shortcode_themes() {\n\t\tglobal $Site;\n\t\tob_start();\n\t\t$template = PATH_THEMES.$Site->theme().DS.'index.php';\n\t\tShortcode::parse( $template );\n\t\t$template = ob_get_contents();\n\t\tob_end_clean();\t\n\t}", "public static function get_allowed_themes()\n {\n }", "function appthemes_init() {\n\t/**\n\t * This hook runs after all theme files have been included, but before\n\t * anything else is loaded into the theme.\n\t */\n\tdo_action( 'appthemes_init' );\n}", "function get_theme_mods()\n{\n}", "function _maybe_update_themes()\n{\n}", "private function scanThemes()\n {\n $themeDirectories = glob($this->basePath.'/*', GLOB_ONLYDIR);\n $themes = collect();\n\n if(count($themeDirectories)){\n foreach ($themeDirectories as $key => $themePath) {\n\n $themeConfigPath = $themePath.'/'.config('theme.config.name');\n $themeChangelogPath = $themePath.'/'.config('theme.config.changelog');\n\n if (file_exists($themeConfigPath)) {\n\n $t = json_decode(file_get_contents($themeConfigPath), true);\n\n $themeConfig = $t;\n $themeConfig = $this->checkInDatabase($themeConfig, $key);\n\n $c = json_decode(file_get_contents($themeChangelogPath), true);\n $themeConfig['changelog'] = $c;\n $themeConfig['path'] = $themePath;\n\n if (array_has($themeConfig, 'theme')) {\n $themes[data_get($themeConfig, 'theme')] = collect($themeConfig);\n }\n }\n }\n }\n\n $this->themes = $themes;\n }", "function ajan_register_theme_directory() {\n\tdo_action( 'ajan_register_theme_directory' );\n}", "public function getThemes(): array;", "function load() {\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup' );\n}", "function load() {\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup' );\n}", "function load() {\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup' );\n}", "function setup_theme() {\n\t\\do_action( 'gnist/setup_theme' );\n}", "function theme_init() {\n global $conf, $base_path, $base_theme_name, $base_theme_info;\n\n $base_theme_name = !$GLOBALS['user']->theme ? $conf['default_theme'] : $GLOBALS['user']->theme;\n \n $base_theme_info = $conf['themes'][$base_theme_name];\n\n $conf['base_theme'] = $base_path . $base_theme_info['path'];\n $conf['base_logo'] = $base_path . ($base_theme_info['logo'] ? $base_theme_info['logo'] : 'misc/images/logo.png');\n $conf['base_favicon'] = $base_path . ($base_theme_info['favicon'] ? $base_theme_info['favicon'] : 'misc/images/favicon.ico');\n\n if (is_file(DIDA_ROOT .'/'. $base_theme_info['path'] . '/template.php')) {\n require_once DIDA_ROOT .'/'. $base_theme_info['path'] . '/template.php';\n }\n\n if (empty($base_theme_info['styles_remove']['misc/dida.css'])) {\n dd_add_css('misc/dida.css', 'theme');\n }\n \n if (empty($base_theme_info['styles'])) {\n dd_add_css($base_theme_info['path'].'/css/style.css', 'theme');\n } else {\n foreach ($base_theme_info['styles'] as $style) {\n dd_add_css($base_theme_info['path'].'/'. $style, 'theme');\n }\n }\n \n if ($base_theme_info['scripts']) {\n foreach ($base_theme_info['scripts'] as $script) {\n dd_add_js($base_theme_info['path'].'/'. $script, 'theme');\n }\n }\n\n dd_add_js('misc/jquery.js', 'core');\n dd_add_js('misc/dida.js', 'core');\n dd_add_js('misc/jquery.dida.js', 'core');\n}", "public static function register_assets() {\n\t\t\tself::loop_assets( self::$style, 'wp_register_style', 'all' );\n\t\t\tself::loop_assets( self::$scripts, 'wp_register_script', 'all' );\n\t\t}", "function init__themewizard()\n{\n\tglobal $THEME_WIZARD_IMAGES_CACHE,$THEME_SEED_CACHE,$THEME_DARK_CACHE;\n\t$THEME_WIZARD_IMAGES_CACHE=array();\n\t$THEME_SEED_CACHE=array();\n\t$THEME_DARK_CACHE=array();\n\n\tglobal $THEME_WIZARD_IMAGES,$THEME_WIZARD_IMAGES_NO_WILD;\n\t$THEME_WIZARD_IMAGES=array();\n\t$THEME_WIZARD_IMAGES_NO_WILD=array();\n\tif (function_exists('imagecreatefromgif'))\n\t{\n\t\t$THEME_WIZARD_IMAGES[]='';\n\t}\n\n\t$hooks=find_all_hooks('modules','admin_themewizard');\n\tforeach (array_keys($hooks) as $hook)\n\t{\n\t\trequire_code('hooks/modules/admin_themewizard/'.filter_naughty_harsh($hook));\n\t\t$ob=object_factory('Hook_admin_themewizard_'.filter_naughty_harsh($hook),true);\n\t\tif (is_null($ob)) continue;\n\t\t$results=$ob->run();\n\t\tif (is_null($results)) continue;\n\t\tlist($a,$b)=$results;\n\t\t$THEME_WIZARD_IMAGES=array_merge($THEME_WIZARD_IMAGES,$a);\n\t\t$THEME_WIZARD_IMAGES_NO_WILD=array_merge($THEME_WIZARD_IMAGES_NO_WILD,$b);\n\t}\n}", "public function switchTheme()\n {\n switch_theme(WP_DEFAULT_THEME, WP_DEFAULT_THEME);\n unset($_GET['activated']);\n add_action('admin_notices', [$this, 'upgradeNotice']);\n }", "public function initTheme()\n {\n $timber = new \\Timber\\Timber();\n if (!class_exists('Timber')) {\n add_action('admin_notices', function () {\n print '<div class=\"error\">';\n print '<p>' . __('Timber library is not activated. Be sure to install composer or install Timber Plugin', LANG_DOMAIN) . '</p>';\n print '</div>';\n });\n } else {\n // Start Website with TimberSite Configuration\n $starter = new Starter();\n // Override Templating hierarchy to use MVC pattern\n $currentController = $this->overrideTemplateHierarchy();\n if (is_object($currentController)) {\n // Render loaded controller\n $currentController->render();\n }\n }\n }", "function slan_theme_styles(){\r\n\r\n\r\n\t// Registrar los estilos\r\n\twp_register_style('fontawesome', THEMEROOT . '/css/fontawesome.css', '', '5.1.1', 'all');\r\n\twp_register_style('slan-styles', get_stylesheet_uri(), array('fontawesome'), '1.0', 'all');\r\n\r\n\t// Cargar estilos\r\n\twp_enqueue_style('slan-styles');\r\n\r\n\r\n}", "public function init()\n {\n add_action('after_setup_theme', [$this, 'registerMenus']);\n }", "public function scanThemes()\r\n {\r\n\r\n $parentThemes = [];\r\n\r\n foreach ($this->loadThemesJson() as $data) {\r\n\r\n // Create theme\r\n $theme = new Theme($data['name'], $data['views-path']);\r\n\r\n // Has a parent theme? Store parent name to resolve later.\r\n if ($data['extends']) {\r\n $parentThemes[$theme->name] = $data['extends'];\r\n }\r\n\r\n // Load the rest of the values as theme Settings\r\n $theme->loadSettings($data);\r\n }\r\n\r\n // All themes are loaded. Now we can assign the parents to the child-themes\r\n foreach ($parentThemes as $childName => $parentName) {\r\n $child = $this->find($childName);\r\n\r\n if (SemokTheme::exists($parentName)) {\r\n $parent = $this->find($parentName);\r\n } else {\r\n $parent = new Theme($parentName);\r\n }\r\n\r\n $child->setParent($parent);\r\n }\r\n }", "function omniana2_theme_setup() {\n add_action('wp_enqueue_scripts', 'omniana_add_styles');\n}", "function add_theme_caps(){\n}", "function display_themes()\n{\n}", "public function bootAllBackend()\n {\n $theme = CmsTheme::getActiveTheme();\n if (!$theme) {\n return;\n }\n\n $langPath = $theme->getPath() . '/lang';\n if (is_dir($langPath)) {\n Lang::addJsonPath($langPath);\n Lang::addNamespace(\"theme.{$theme->getId()}\", $langPath);\n }\n\n if ($parent = $theme->getParentTheme()) {\n $langPath = $parent->getPath() . '/lang';\n if (is_dir($langPath)) {\n Lang::addJsonPath($langPath);\n Lang::addNamespace(\"theme.{$parent->getId()}\", $langPath);\n }\n }\n }", "function clf_theme_setup(){\n add_theme_support('menus');\n\n register_nav_menu('accessoires','Accessoires');\n register_nav_menu('carterie','Carterie');\n register_nav_menu('papeterie','Papeterie');\n}", "function get_allowed_themes()\n{\n}", "function woothemes_more_themes_setup() {\n\n add_menu_page(\"WooThemes\", \"WooThemes\", 'edit_themes', 'more-woothemes', 'woothemes_more_themes_page', 'http://www.woothemes.com/favicon.ico');\n\n}", "function install_theme_information()\n{\n}", "public function setup_theme() {\n\n\t\t// Bail if something already has this under control\n\t\tif ( ! empty( $this->theme_compat->theme ) )\n\t\t\treturn;\n\n\t\t// Setup the theme package to use for compatibility\n\t\tajan_setup_theme_compat( ajan_get_theme_package_id() );\n\t}", "public function after_setup_theme()\n {\n }", "public function activate_booking_theme() {\n if ( !current_user_can( 'switch_themes' ) || !current_user_can( 'edit_theme_options' ) )\n throw new Exception( __( 'Sorry, you are not allowed to switch themes for this site.', 'yith-booking-for-woocommerce' ) );\n\n $theme = $this->get_booking_theme();\n if ( !$theme || !$theme->exists() || !$theme->is_allowed() )\n throw new Exception( __( 'The requested theme does not exist.', 'yith-booking-for-woocommerce' ) );\n\n switch_theme( $theme->get_stylesheet() );\n }", "public function on_activation(){\n\t\t$http = new AisisCore_Http_Http();\n\t\tif(is_admin() && $http->get_current_url() == admin_url('themes.php?activated=true')){\n\t\t\tif(!$this->create_components($this->_options, 0755)){\n\t\t\t\t$this->_notices['mk_dir'] = 'Could not create the custom folder or appropriate sub folders. Please check your permissions.';\n\t\t\t}\n //Request the custom functions.php if it exists\n if(!file_exists(CUSTOM . 'functions.php')){\n $this->_notice['file_not_found'] = 'Could not find the functions.php file in the custom folder. \n By default we do not create this. Consider creating one for custom modifications.';\n }else{\n require_once(CUSTOM . 'functions.php'); \n }\n add_action('admin_notices', array($this, 'check_for_errors'));\n\t\t\tadd_action('admin_notices', array($this, 'check_for_notices'));\n\t\t}\n\t}", "function az_theme_setup() {\n\n add_theme_support( 'html5', array(\n 'search-form',\n 'comment-form',\n 'comment-list',\n 'gallery',\n 'caption',\n 'style',\n 'script'\n ) );\n\n }", "public function register_assets(){\r\n\r\n wp_enqueue_style( 'better-mag-woocommerce', get_template_directory_uri() . '/css/woocommerce.css');\r\n\r\n if( is_rtl() ){\r\n wp_enqueue_style( 'better-mag-woocommerce-rtl', get_template_directory_uri() . '/css/woocommerce-rtl.css');\r\n }\r\n\r\n }", "public function setup()\n {\n $theme = wp_get_theme();\n\n if ('SP MDL' == $theme->name || 'sp-mdl' == $theme->template) {\n //add_filter('sp_localize_array', array($this, 'localize_array'));\n add_action('wp_enqueue_scripts', array($this, 'public_scripts'), 10);\n\n add_action('sp_mdl_share_buttons_top', array($this, 'get_share_buttons_top'), 10);\n add_action('sp_mdl_share_buttons_footer', array($this, 'get_share_buttons_footer'), 10);\n add_action('wp_footer', array($this, 'get_share_buttons_floating'), 10);\n\n // if (is_admin()) {\n // add_action('admin_enqueue_scripts', array($this, 'admin_scripts'), 999);\n // }\n\n $this->_kirki_customizer();\n }\n }", "function after_setup_theme() {\n\n\t\t//\n\n\t}", "public function track_initial_theme()\n {\n }", "public static function tweak_theme_features()\n {\n }", "protected function screen_wordpress_themes() {\n\t\tif( $this->get_current_screen_id() != 'themes' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->notices_compilation_introduction();\n\t}", "public function theme_activation() {\n\t\t$activated = (bool) @ $_GET[ 'activated' ];\n\t\tif ( ! $activated )\n\t\t\treturn;\n\t\tif ( ! $this->theme_activation_function )\n\t\t\treturn;\n\t\t// Looks like the theme might just have been activated, call the registered function\n\t\t$this->{$this->theme_activation_function}();\n\t}", "public function register()\n {\n OmegaTheme::setThemePath(resource_path() . '/theme/main');\n OmegaTheme::setInstallerPath('install/install.php');\n OmegaTheme::setTemplateRegisterPath('template/register.php');\n }", "function wp_update_themes($extra_stats = array())\n{\n}", "function child_theme_setup1() {\n\tadd_action( 'wp_enqueue_scripts', 'child_theme_register_styles' );\n\n\t// Enqueue site styles and scripts\n\tadd_action( 'wp_enqueue_scripts', 'child_theme_enqueue_styles' );\n\n\tadd_filter( 'hybopress_menu_caret', 'child_theme_menu_caret' );\n}", "function sapiat_theme_assets() {\n wp_register_style( 'wpb-google-fonts', 'https://fonts.googleapis.com/css?family=Nunito:300,400,700&display=swap', false );\n wp_register_style( 'wpb-google-fonts-2', 'https://fonts.googleapis.com/css?family=Raleway&display=swap', false );\n wp_enqueue_style( 'wpb-google-fonts' );\n wp_enqueue_style( 'wpb-google-fonts-2' );\n wp_register_script( 'sapiat-download', get_template_directory_uri() . '/vendor/multi-download/browser.js', array ( 'jquery' ), NULL, true);\n wp_enqueue_script( 'sapiat-download' );\n wp_register_script( 'sapiat-base', get_template_directory_uri() . '/scripts/theme.js', array( 'jquery' ), NULL, false );\n wp_enqueue_script( 'sapiat-base' );\n wp_register_script( 'sapiat-featherlight', get_template_directory_uri() . '/vendor/featherlight/release/featherlight.min.js', array( 'jquery' ), NULL, false );\n wp_enqueue_script( 'sapiat-featherlight' );\n wp_register_style( 'sapiat-featherlight-css', get_template_directory_uri() . '/vendor/featherlight/release/featherlight.min.css', false );\n wp_enqueue_style( 'sapiat-featherlight-css' );\n wp_register_style( 'sapiat-featherlight-gallery-css', get_template_directory_uri() . '/vendor/featherlight/release/featherlight.gallery.min.css', false );\n wp_enqueue_style( 'sapiat-featherlight-gallery-css' );\n }", "function theme_register_assets() {\r\n // Déclarer jQuery\r\n wp_deregister_script( 'jquery' ); // On annule l'inscription du jQuery de WP\r\n wp_enqueue_script( \r\n 'jquery', \r\n 'https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js', \r\n false, \r\n '3.3.1', \r\n true \r\n );\r\n \r\n // Déclarer popper.js pour Bootstrap\r\n wp_enqueue_script( \r\n 'popper', \r\n 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js', \r\n false, \r\n '1.14.7', \r\n true \r\n );\r\n \r\n // Déclarer Bootstrap\r\n wp_enqueue_script( \r\n 'bootstrap', \r\n 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js', \r\n false, \r\n '4.3.1', \r\n true \r\n );\r\n \r\n wp_enqueue_style( \r\n 'bootstrap', \r\n 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css',\r\n array(), \r\n '4.3.1'\r\n );\r\n \r\n // Déclarer FontAwesome\r\n wp_enqueue_script( \r\n 'fontawesome', \r\n 'https://kit.fontawesome.com/f7123b557f.js'\r\n );\r\n \r\n // Déclarer Animate.css\r\n wp_enqueue_style( \r\n 'animate', \r\n get_template_directory_uri() . '/assets/css/animate.css', \r\n array(), \r\n '4.3.1'\r\n );\r\n \r\n // Déclarer Wow\r\n\twp_enqueue_script( \r\n 'wow', \r\n 'https://cdnjs.cloudflare.com/ajax/libs/wow/1.1.2/wow.min.js', \r\n array(), \r\n '1.1.2', \r\n true\r\n );\r\n \r\n // Déclarer le JS\r\n\twp_enqueue_script( \r\n 'type', \r\n get_template_directory_uri() . '/assets/js/custom.js', \r\n array(), \r\n '1.0', \r\n true\r\n );\r\n \r\n // Déclarer style.css à la racine du thème\r\n wp_enqueue_style( \r\n 'type',\r\n get_stylesheet_uri(), \r\n array(), \r\n '1.0'\r\n );\r\n}", "protected function registerMenus()\n {\n /** @var PromiseManager $promiseManager */\n $promiseManager = Core::get(PromiseManager::class);\n\n $promiseManager->addPromise('after_setup_theme', function () {\n ;\n });\n }", "public function theme_installer_single($theme)\n {\n }", "function additional_theme_functions() {\r\n return array();\r\n }", "public function after_switch_theme() {\n\t\t\t$thim_core = $this->get_thim_core();\n\t\t\tif ( $thim_core->get_status() != 'active' ) {\n\t\t\t\tset_transient( 'thim_core_installer', true );\n\t\t\t}\n\t\t}", "public static function theme_support() {\n\t\t$features = apply_filters('cnp_theme_features', static::$theme_features);\n\t\tforeach($features as $feature => $args) {\n\t\t\tif (is_array($args)) add_theme_support($feature, $args);\n\t\t\telseif($args) add_theme_support($feature);\n\t\t}\n\t}", "function wpks_icontheme_styles(){\n\n // Registrando los estilos\n wp_register_style('normalize', $src = get_template_directory_uri() . '/css/normalize.css', $deps = array(), $ver = 'v7.0.0' );\n wp_register_style('google_fonts', $src = 'https://fonts.googleapis.com/css?family=Open+Sans|Raleway:400,700,900', $deps = array(), $ver = 'v1.0.0');\n wp_register_style('fontawesome', $src = get_template_directory_uri() . '/css/font-awesome.min.css', $deps = array('normalize'), $ver = 'v4.7.0' );\n wp_register_style('style', $src = get_template_directory_uri() . '/style.css', $deps = array('normalize'), $ver = 'v1.0.0' );\n\n // Llamando a los estilos\n wp_enqueue_style('normalize');\n wp_enqueue_style('google_fonts');\n wp_enqueue_style('fontawesome');\n wp_enqueue_style('style');\n\n // Registrando JS\n wp_register_script('scripts', $src = get_template_directory_uri() . '/js/scripts.js', $deps = array(), $ver = 'v1.0.0', $in_footer = true );\n\n // Llamando a los scripts\n wp_enqueue_script('jquery');\n wp_enqueue_script('scripts');\n}", "public function register_theme_directory() {\n\t\tif ( ! ajan_do_register_theme_directory() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregister_theme_directory( $this->old_themes_dir );\n\t}", "public function widgets_init() {\n // Setup and filter the theme widgets\n $widgets = VF_Theme::apply_filters('vf/widgets/unregister', array());\n if (is_array($widgets)) {\n foreach ($widgets as $name) {\n if (is_string($name)) {\n unregister_widget($name);\n }\n }\n }\n // Setup and filter the theme sidebars\n $sidebars = VF_Theme::apply_filters('vf/widgets/sidebars', array());\n if (is_array($sidebars)) {\n foreach ($sidebars as $sidebar) {\n if (is_array($sidebar)) {\n register_sidebar($sidebar);\n }\n }\n }\n }", "public function register()\n {\n $this->registerMakeTheme();\n }" ]
[ "0.71521544", "0.70318204", "0.6673933", "0.6640615", "0.66394246", "0.66029996", "0.6547205", "0.65251297", "0.6515663", "0.6432725", "0.6431247", "0.64055985", "0.63847804", "0.6381736", "0.63790756", "0.63773584", "0.63731456", "0.63690525", "0.6360842", "0.633835", "0.63147146", "0.6313284", "0.63129616", "0.6307173", "0.63027567", "0.6298805", "0.62861884", "0.62807775", "0.6271672", "0.6246561", "0.6237189", "0.62347543", "0.6233748", "0.62300146", "0.6219773", "0.6218142", "0.61993253", "0.61895114", "0.6188581", "0.6182113", "0.61767006", "0.61744034", "0.6171511", "0.6146681", "0.6146054", "0.6143886", "0.61435014", "0.61260843", "0.6124526", "0.61222667", "0.61160254", "0.6108399", "0.6103934", "0.60973346", "0.6095399", "0.6095399", "0.6095399", "0.6094761", "0.60861754", "0.60836196", "0.60719895", "0.6071368", "0.6068915", "0.60622615", "0.604369", "0.6040744", "0.60346645", "0.6032794", "0.60261", "0.60176104", "0.60135424", "0.6012976", "0.5991477", "0.598909", "0.5987405", "0.59870845", "0.59838104", "0.5980921", "0.5977579", "0.5974707", "0.5974306", "0.59685034", "0.5965309", "0.59610534", "0.595794", "0.59492433", "0.5945465", "0.59367764", "0.5936395", "0.59335256", "0.5931861", "0.59311074", "0.5921959", "0.5919799", "0.59169", "0.5916595", "0.5910336", "0.590082", "0.589872", "0.58874804" ]
0.7598052
0
Sets mail Plain text Body
Наборы электронной почты Текстовое тело
public function setBody($body){ $this->_mail->Body = $body; $this->_mail->AltBody = ''; $this->_mail->IsHtml(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMailBody() \n {\n // Building html-mail\n if ( $this->mailTextContentPersonal && $this->personalization ) \n {\n $plainText = new ezcMailText( $this->mailTextContentPersonal, $this->charset );\n } \n else \n {\n $plainText = new ezcMailText( $this->mailTextContent, $this->charset );\n }\n \n $plainText->subType = 'plain';\n\n if ( $this->mailHtmlContentPersonal && $this->personalization ) \n {\n $htmlText = new ezcMailText( $this->mailHtmlContentPersonal, $this->charset );\n } \n else \n {\n $htmlText = new ezcMailText( $this->mailHtmlContent, $this->charset );\n }\n \n $htmlText->subType = 'html';\n\n $this->bothParts = new ezcMailMultipartAlternative( $plainText, $htmlText );\n\n // Building text-mail\n if ( $this->mailTextContentPersonal && $this->personalization ) \n {\n $this->plainTextOnly = new ezcMailText( $this->mailTextContentPersonal, $this->charset );\n } \n else \n {\n $this->plainTextOnly = new ezcMailText( $this->mailTextContent, $this->charset );\n }\n\n $this->plainTextOnly->subType = 'plain';\n }", "public function setMailBody($text) {\n return $this->mimer->setTXTBody($text);\n }", "public function setBody(string $text = null);", "public function setTextBody($body)\n {\n $this->textBody = $body;\n }", "public function setBody(string $bodyText): void\n {\n $this->mail->Body = $bodyText;\n }", "public function setBodyText($bodyText) {\n\t\t$this->bodyText = $bodyText;\n\t}", "function setBody($body_in){\n $this->bodyText->setBody($body_in);\n }", "public function setBody($bodyPlain, $bodyHTML = NULL) {\n $this->_bodyPlain = $bodyPlain;\n if($bodyHTML !== NULL) $this->_bodyHTML = $bodyHTML;\n else $this->_bodyHTML = str_replace(\"\\n\", \"<br />\", $bodyPlain);\n return $this;\n }", "public function textBody($plain)\n {\n $this->textBody = $plain;\n\n return $this;\n }", "public function setBodyText($txt){\n $this->description = $txt;\n }", "public function setMailBody(MimeMessage $mailBody);", "public function setBody($s) {$this->_body = $s;}", "public function setBody($s) {$this->_body = $s;}", "public function setMIMEBody($body)\n\t{\n\t\t$this->MIMEBody = $body;\n\t}", "public function altBody($body) \n {\n $this->emailer->AltBody = $body;\n }", "public function set_body($message, $alt_message = '')\n {\n $this->phpmailer->Body = $message;\n $this->phpmailer->AltBody = $alt_message;\n $this->body = $message;\n }", "public function setBodyText($bodyText)\n {\n $this->setContentType('text/plain');\n $this->_bodyText = (string)$bodyText;\n\n return $this;\n }", "protected function setMessagePlainText()\n {\n if ($this->tokenizationEnabled && $this->plainTextSet) {\n // No need to find and replace since tokenization happens at the transport level\n\n return;\n }\n\n if ($this->plainTextSet) {\n $children = (array) $this->message->getChildren();\n\n /** @var \\Swift_Mime_MimeEntity $child */\n foreach ($children as $child) {\n $childType = $child->getContentType();\n if ($childType == 'text/plain' && $child instanceof \\Swift_MimePart) {\n $child->setBody($this->plainText);\n\n break;\n }\n }\n } else {\n $this->message->addPart($this->plainText, 'text/plain');\n $this->plainTextSet = true;\n }\n }", "function setBody($content)\n\t{\n\t\t$this->Body = $this -> cleanText( $content );\n\t}", "public function setTextBody($string = '') {\n\t\t\tif (is_string($string)) {\n\t\t\t\t$this->_textBody = $string;\n\t\t\t} else {\n\t\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t\t'Email::setTextBody expects a string.'\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function setBodyTextOfEmailToUser($text)\r\n\t{\r\n\t\t$this->_bodyTextOfEmailToUser = $text;\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function setBody($body)\n {\n $body = preg_replace('/[\\s\\t\\r\\n]+/i', ' ', $body);\n \n parent::setBody($body);\n }", "public function set_alt_body(&$phpmailer) {\n\n if (is_object($phpmailer))\n $phpmailer->AltBody = $this->_make_text_body($this->current_body);\n }", "function setBody($body);", "public function setAlternativeBody(string $body)\n {\n $this->message->setAlternativeBody($body);\n }", "function bodytext($text) {\n // 7bit encoding is simple ASCII characters, this is default.\n $this->textbody = \"\\n--\" . $this->boundary . \"\\n\";\n $this->textbody .= \"Content-Type: text/plain\\n\";\n $this->textbody .= \"Content-Transfer-Encoding: 7bit\\n\\n\";\n $this->textbody .= $text;\n }", "function setBody($value) {\n\t\treturn $this->setColumnValue('body', $value, BaseModel::COLUMN_TYPE_VARCHAR);\n\t}", "public function setBodyTextOfEmailToAdmin($text)\r\n\t{\r\n\t\t$this->_bodyTextOfEmailToAdmin = $text;\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function setBody($body);", "public function setBody($body);", "public function setBody($body);", "public function setBody($body);", "public function setBodyText($text)\n {\n $this->body_text = trim($text);\n\n return $this;\n }", "public function setHTMLBody($body, $altBody = ''){\n $this->_mail->Body = $body;\n $this->_mail->AltBody = $altBody;\n $this->_mail->IsHtml(true);\n }", "public function setBody($body, $is_html=false, array $replacements=array()) {\r\r\n\t\t\r\r\n\t\t$this->message->setBody($this->replaceTags($body, $replacements), ($is_html ? 'text/html' : 'text/plain'));\r\r\n\t}", "function bodyText() {\r\n ob_start();\r\n $temp_layout = $this->controller->layout;\r\n $this->controller->layout = ''; // Turn off the layout wrapping\r\n $this->controller->render($this->template . '_text'); \r\n $mail = ob_get_clean();\r\n $this->controller->layout = $temp_layout; // Turn on layout wrapping again\r\n return $mail;\r\n }", "private function compilePlainBody():MailMultipartContent {\n\t\t\t$content = new MailMultipartContent('text/plain; charset=UTF-8');\n\t\t\t$content->setTransferEncoding($this->plainContent->getEncoding());\n\t\t\t$content->setContentDisposition('inline');\n\t\t\t$content->setContent($this->plainContent, false);\n\t\t\treturn $content;\n\t\t}", "public function setBody ($body)\n {\n $this->_values['body'] = $body;\n }", "public function setBodyText($bodyText)\n {\n $this->bodyText = StringUtil::getTextFromHtml($bodyText);\n return $this;\n }", "public function setBody($body){\n $this->body = $body;\n }", "public function setBody($body)\n {\n //sanitize the body\n $body = Utility::sanitizeTextEditorInput($body);\n $this->body = $body;\n\n return $this;\n }", "function setBody($body, $charset='iso-8859-1', $contentType='text/plain', $transferEncoding='8bit') \n { \n $this->body =\"Content-type: {$contentType}; charset={$charset}\\nContent-transfer-encoding: {$transferEncoding}\\n\\n{$body}\"; \n $this->body = trim($this->body); \n }", "public function set_body($body)\n\t{\n\t\t\t$this->body = $body;\n\t}", "public function setBody($body)\n {\n $this->body = $body;\n }", "public function setBody($body)\n {\n $this->_body = $body;\n }", "public function setBody($body)\n {\n $this->_body = $body;\n }", "public function setBody($body)\n {\n $this->_body = $body;\n }", "public function setBodyText ($bodyText, $charset = 'utf-8')\n {\n $this->bodyText = $bodyText;\n $this->charset = $charset;\n }", "public function setTextBody($textBody)\n {\n $this->textBody = $textBody;\n return $this;\n }", "public function set_body($body)\n\t{\n\t\t$this->body = $body;\n\t}", "public function setBody(string $body)\n {\n }", "public function getMailBody();", "protected function setBody($body) {\n\t\t$this->body = $body;\n\t}", "function _setBody () {\r\n // do we need to encode??\r\n $encode = (empty($this->htmlbody) && empty($this->attachments)) ? false : true;\r\n\r\n // if yes...\r\n if ($encode) {\r\n\r\n\t\t\t\t$this->fullBody = \"This is a multi-part message in MIME format.\\n\\n\";\r\n\t\t\t\t$this->fullBody .= '--'.$this->boundary.\"\\nContent-Type: multipart/alternative;\\n\\tboundary=\\\"\".$this->boundary_alt.\"\\\"\\n\\n\\n\";\r\n\t\t\t\t$body_boundary = $this->boundary_alt;\r\n\t\t\t\t$this->xheaders['Content-Type'] = \"multipart/mixed;\\n\\tboundary=\\\"\".$this->boundary.'\"';\r\n\r\n if (!empty($this->body)) {\r\n $this->fullBody .= '--'.$body_boundary.\"\\nContent-Type: text/plain; charset=\".$this->charset.\"\\nContent-Transfer-Encoding: \".$this->ctencoding.\"\\n\\n\".$this->body.\"\\n\\n\";\r\n }\r\n if (!empty($this->htmlbody)) {\r\n $this->fullBody .= '--'.$body_boundary.\"\\nContent-Type: text/html; charset=\".$this->htmlcharset.\"\\nContent-Transfer-Encoding: \".$this->htmlctencoding.\"\\n\\n\".$this->htmlbody.\"\\n\\n\";\r\n }\r\n\r\n \t$this->fullBody .= '--'.$body_boundary.\"--\\n\\n\";\r\n\r\n if (!empty($this->attachments)) {\r\n $this->_build_attachments();\r\n }\r\n $this->fullBody .= '--'.$this->boundary.'--'; // ends the last boundary\r\n }\r\n // else we just send plain text.\r\n else {\r\n if (!empty($this->body)) {\r\n $this->fullBody = $this->body;\r\n }\r\n else {\r\n vlibMimeMailError::raiseError('VM_ERROR_NOBODY', FATAL);\r\n }\r\n }\r\n }", "function getEmailBodyText() {\n\t\treturn $this->getTransportCredentials()->getParam(transportCredentials::PARAM_MESSAGE_BODY_TEXT);\n\t}", "public function body(string $body, bool $isHTML = false, string $alternativeText = null): CommonMailAdapter\n {\n $this->body = $body;\n $this->isHTML = $isHTML;\n $this->alternativeText = $alternativeText;\n return $this;\n }", "public function setBodyAttribute($value)\n {\n $this->attributes['body'] = clean($value);\n }", "public function setBody(string $body) : void;", "public function setBody($body)\n {\n $this->body = $body;\n }", "public function setBody($body)\n {\n $this->body = $body;\n }", "public function setBody($body)\n {\n $this->body = $body;\n }", "public function setBody($var)\n {\n GPBUtil::checkString($var, True);\n $this->body = $var;\n\n return $this;\n }", "public function setBody($var)\n {\n GPBUtil::checkString($var, True);\n $this->body = $var;\n\n return $this;\n }", "public function setAltBody($body, array $replacements=array()) {\r\r\n\r\r\n\t\t$this->message->addPart($this->replaceTags($body, $replacements), 'text/plain');\r\r\n\t}", "public function generatePlainPartFromBody()\n {\n $plainPart = $this->findPlainPart();\n if ($plainPart) {\n $this->getSwiftMessage()->detach($plainPart);\n }\n unset($plainPart);\n\n $this->getSwiftMessage()->addPart(\n EmailUtils::convert_html_to_text($this->getBody()),\n 'text/plain',\n 'utf-8'\n );\n\n return $this;\n }", "public function setBody(string $body)\n {\n $this->body = $body;\n }", "public function setBody($newBody) {\n $this->body = $newBody;\n }", "protected function setBody($body)\n {\n $this->body = $body;\n }", "function set_text($text){\n\t\tif (!empty($text)){\n\t\t\t$this->mail_text = $text;\n\t\t}\n\t}", "function setBody($data) {\n\t\t\t$this->body = $data;\n\t\t}", "protected function writePlainText() {\n if ($this->isBodyEmptyOrSizeUnknown()) {\n $this->body->write($this->plainContent);\n $this->body->rewind(); \n }\n }", "private function setText($aText)\r\r\n {\r\r\n $this->html_body = $aText['body'];\r\r\n $this->subject = $aText['subject'];\r\r\n }", "public function setBody($var)\n {\n GPBUtil::checkString($var, False);\n $this->Body = $var;\n\n return $this;\n }", "function SetPostBody($id, $body){\n\t}", "public function setBody($body)\n {\n $this->set('body', $body);\n }", "public function setBody(string $body): void\n {\n $this->body = $body;\n }", "public function getBodyText()\n {\n return $this->_bodyText;\n }", "public function setHTMLBody($body)\n {\n $this->htmlBody = $body;\n }", "public function setBody($html){\n $this->html = $html;/*.\"<p><br><br>Gracias,<br>El equipo de <a href='http://www.arriendas.cl'>Arriendas.cl</a></p><p><i>Nota: Para evitar posibles problemas con la recepcion de este correo le aconsejamos nos agregue a su libreta de contactos.</i></p>\";*/\n }", "public function getBodyText()\n {\n return $this->bodyText;\n }", "public function setHtmlBody($body) {\n $this->html_body = $body;\n }", "public function set_body($body){\n\t\t$node = $this->get_body(false);\n\t\tif(!$node){\n\t\t\t$node = $this->createElement('body');\n\t\t\t$this->doc->appendChild($node);\n\t\t}\n\t\t$node->nodeValue = htmlspecialchars($body);\n\t}", "function SendPlain($to = '', $plainbody = '')\n\t{\t\n\t\t$this->SetHeadersPlain();\n\t\tif ($this->FlagFileSet('logemails'))\n\t\t{\t$this->LogMailBody($plainbody, $to);\n\t\t}\n\t//\tif (SITE_TEST)\n\t//\t{\t//echo $body;\n\t//\t} else\n\t//\t{\t\n\t\t\tmail($to, $this->subject, $plainbody, implode(\"\\n\", $this->headers));\n\t//\t}\n\t\treturn true;\n\t}", "public function getBodyText ()\n {\n return $this->bodyText;\n }", "public function setBody($texto, $tipo='text/html')\n {\n $this->messageBody = $texto;\n $this->messageType = $tipo;\n return $this;\n }", "public function setBody(?string $value)\n {\n $this->body = $value;\n }", "public function addBody($body)\n {\n return $this->addData(\"EmailContent\", $body);\n }", "public function content (string $subject, string $body, string $altBody, ?bool $isHTML = true) : self\n {\n $this->mail->isHTML($isHTML);\n $this->mail->Subject = $subject;\n $this->mail->Body = $body;\n $this->mail->AltBody = $altBody;\n\n return $this;\n }", "protected function _setBody()\n {\n if(!$this->body) return null;\n $this->_contents[] = $this->_stringTemplate->format('body', ['body'=>$this->body]);\n }", "public function addBody($body)\n {\n return $this->owner->addData(\"EmailContent\", $body);\n }", "public function setBody($body) {\n assert(is_string($body));\n\n $this->body = $body;\n return $this;\n }", "public function appendToTextBody($body)\n {\n $this->textBody .= $body;\n }", "public function setBody($body)\n {\n $this->body = (string) $body;\n return $this;\n }", "public function setBody($value)\n {\n $this->_body = (string) $value;\n\n return $this;\n }", "public function getBodyText() {\n\t\tif ($this->bodyText != null) {\n\t\t\treturn $this->bodyText;\n\t\t} elseif ($this->autocreateMissingText == true) {\n\t\t\treturn $this->removeHtml($this->getBodyHtml());\n\t\t}\n\t}", "public function setBody(string $body) : self\n {\n $this->initialized['body'] = true;\n $this->body = $body;\n return $this;\n }", "public function setBody(string $body) : self\n {\n $this->initialized['body'] = true;\n $this->body = $body;\n return $this;\n }", "public function setBody(string $body) : self\n {\n $this->initialized['body'] = true;\n $this->body = $body;\n return $this;\n }", "public function setDocumentBody($body) {\n //3.0.0 - 3.1.9\n if(version_compare($this->cms_version, '3.2.0') < 0) {\n if(class_exists('JResponse')) {\n JResponse::setBody($body);\n }\n }\n\n //3.2.0+\n if(version_compare($this->cms_version, '3.2.0') >= 0) {\n if(class_exists('JFactory')) {\n JFactory::getApplication()->setBody($body);\n }\n }\n }", "public function body(string $body): LightKitAdminNotification\n {\n $this->body = $body;\n return $this;\n }" ]
[ "0.8097379", "0.78846174", "0.76360154", "0.76169884", "0.7595197", "0.747418", "0.74006903", "0.7175785", "0.7163024", "0.713228", "0.709707", "0.709047", "0.709047", "0.7076703", "0.7049094", "0.70488477", "0.7035497", "0.7033428", "0.70248795", "0.69967896", "0.6978508", "0.6957186", "0.69379526", "0.6849363", "0.6848128", "0.68259686", "0.6824376", "0.68231577", "0.682008", "0.682008", "0.682008", "0.682008", "0.6796805", "0.6782829", "0.6768202", "0.67680925", "0.6748168", "0.6728341", "0.6727207", "0.67043066", "0.66734904", "0.6664204", "0.6662042", "0.66558266", "0.66549265", "0.66549265", "0.66549265", "0.6646353", "0.66459733", "0.6641556", "0.6635187", "0.66312325", "0.6630353", "0.6610079", "0.6603527", "0.6592146", "0.65856075", "0.6582065", "0.6574905", "0.6574905", "0.6574905", "0.65678084", "0.65678084", "0.6561801", "0.6554779", "0.65484494", "0.65448457", "0.6525783", "0.65192825", "0.6515184", "0.65095794", "0.65042627", "0.64957756", "0.6486606", "0.643585", "0.6416701", "0.6399577", "0.6391551", "0.6390283", "0.638729", "0.6342315", "0.63323313", "0.6332289", "0.6322204", "0.63045776", "0.6293994", "0.628975", "0.62653285", "0.6258557", "0.6251916", "0.625124", "0.62496823", "0.6235584", "0.62092716", "0.6205995", "0.62038755", "0.62038755", "0.62038755", "0.6194793", "0.6191838" ]
0.7992079
1
Determine whether a 'term_order' field is present
Определите, присутствует ли поле 'term_order'
public function tableHasTermOrderField() { if (!is_null(self::$_tableHasTermOrder)) { return self::$_tableHasTermOrder; } try { self::$_tableHasTermOrder = $this->_getReadAdapter() ->fetchOne('SHOW COLUMNS FROM ' . $this->getMainTable() . ' WHERE Field = \'term_order\'') !== false; } catch (Exception $e) { self::$_tableHasTermOrder = false; } return self::$_tableHasTermOrder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasOrder()\r\n {\r\n return !empty($this->fields['Order']['value']);\r\n }", "function hasOrder() {\n\t\treturn $this->_order !== null;\n\t}", "public function hasTerm(){\r\n return $this->_has(1);\r\n }", "public function isOrdered()\r\n\t{\r\n\t\tif ($this->ordered !== false) {\r\n\t\t\tif (isset($this->ordered['field'])) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\t$this->addMessage(sprintf($this->__('Ordering field not defined for entity %s'), $this->name), self::NOTICE);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function has_term_meta($term_id)\n{\n}", "public function search_orders($term)\n {\n }", "function wc_is_order_status($maybe_status)\n {\n }", "function isOrderWithDynamicTax()\n {\n return get_option(GootenWCOptionNames::ORDER_DYNAMIC_TAX) === '1';\n }", "private function validate_node_order_type( $order )\n {\n if(($order == 'title') || ($order == 'rank'))\n {\n return true;\n }\n return false;\n }", "public static function term_ordering()\n {\n }", "public function search_orders($term);", "private function isCorrectOrderField($field)\n {\n $attribute = $this->attributeRepositoryInterface->get('catalog_product', $field);\n if (!$attribute || $attribute->getAttributeCode() !== $field) {\n return false;\n }\n\n return true;\n }", "function isOrderFormHeaderEntry ($desc = null)\n\t{\n\t\t$cleanDescription = addslashes($desc);\n\t\t$stmt = \"SELECT ctcatn from $this->orderFormsTbl \".\n\t\t \"WHERE Description = '$cleanDescription'\";\n\t\t// echo \"SQL: $stmt<br />\\r\\n\";\n\t\t\n\t\t$result = $this->dbi->query($stmt);\n\n\t\tif ($result->numRows() > 0)\n\t\t{\n\t\t\t$this->isOrderFormHeaderEntry = true;\n\t\t} else {\n\t\t\t$this->isOrderFormHeaderEntry = false;\n\t\t}\n\t\treturn $this->isOrderFormHeaderEntry;\n\t}", "public static function isTerm()\n {\n\t//$timeslot = self::getCurrentTimeslot($time, $filter);\n return true;\n return (!empty(self::getTerms(true)));\n }", "public function isOrdersGiven()\n {\n if ($this->getXml()->getElementsByTagName('OrdersGiven')->length) {\n return strtolower($this->getXml()->getElementsByTagName('OrdersGiven')->item(0)->nodeValue) == \"true\";\n }\n return null;\n }", "public function isOrder(string $name): bool;", "public function has_order( $column )\n {\n return array_key_exists( $column, $this->order_list );\n }", "public function haveTermRelationshipInDatabase($object_id, $term_taxonomy_id, $term_order = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('haveTermRelationshipInDatabase', func_get_args()));\n }", "function agreement_is_installed()\n{\n global $db;\n\n if ($db->field_exists(\"new_terms\", \"users\") && $db->field_exists(\"new_terms_date\", \"users\")) {\n return true;\n } else {\n return false;\n }\n}", "function has_existing_order()\n{\n\t$customer_orders = new WP_Query( array(\n\t\t'posts_per_page ' => 1,\n\t\t'meta_key' => '_customer_user',\n\t\t'meta_value' => get_current_user_id(),\n\t\t'post_type' => wc_get_order_types(),\n\t\t'post_status' => array_keys( wc_get_order_statuses() ),\n\t\t'date_query' => array(\n\t\t\tarray(\n\t\t\t\t'year' => date('Y'),\n\t\t\t\t'month' => date('m')\n\t\t\t),\n\t\t),\n\t\t\n\t));\n\t\n\treturn count( $customer_orders->posts );\n}", "function has_term($term = '', $taxonomy = '', $post = \\null)\n{\n}", "public function isOrderable(): bool\n {\n return $this->request->input('order') && count((array) $this->request->input('order')) > 0;\n }", "function acf_isset_termmeta($taxonomy = '') {}", "public function getTermsIncludeLowerBound(): bool {}", "public function getTermsIncludeLowerBound(): bool {}", "function mmg_design_data_order_exists( $order_id = 0 ) {\n\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . DD_TABLE;\n\n\t$result = $wpdb->get_results( \"SELECT id FROM {$table_name} WHERE order_number = {$order_id}\" );\n\treturn ( count( $result ) > 0 );\n\n}", "private function isValidOrder()\n {\n return in_array($this->sortRequest[1], $this->sortOrders);\n }", "private function _isPlaceOrder()\n {\n $info = $this->getInfoInstance();\n if ($info instanceof Mage_Sales_Model_Quote_Payment) {\n return false;\n } elseif ($info instanceof Mage_Sales_Model_Order_Payment) {\n return true;\n }\n }", "public function getTerms(): bool {}", "public function getTerms(): bool {}", "public static function canQueryOrder()\n {\n return !is_null(static::modelOrderByFieldAttribute(static::newModel()));\n }", "public function is_tax($taxonomy = '', $term = '')\n {\n }", "public function isSetOrderId()\n {\n return !is_null($this->_fields['OrderId']['FieldValue']);\n }", "public function hasOrderMethods() {\n return !empty($this->orderMethods);\n }", "function get_terms_in_order ($args = array()) {\n $this->refesh_terms($args);\n if (get_transient($this->_transient) == false)\n $this->refesh_terms();\n $this->_term_in_order = get_transient($this->_transient);\n return $this->_term_in_order;\n }", "function is_term($term, $taxonomy = '', $parent = 0)\n{\n}", "protected function _isPlaceOrder()\n {\n $info = $this->getInfoInstance();\n if ($info instanceof Mage_Sales_Model_Quote_Payment) {\n return false;\n } elseif ($info instanceof Mage_Sales_Model_Order_Payment) {\n return true;\n }\n }", "public function havePostWithTermInDatabase($post_id, $term_id, $term_order = 0)\n {\n if (!is_int($post_id) or !is_int($term_id) or !is_int($term_order)) {\n throw new \\BadMethodCallException(\"Post ID, term ID and term order must be strings\", 1);\n }\n $this->maybeCheckPostExistsInDatabase($post_id);\n $this->maybeCheckTermExistsInDatabase($term_id);\n // add the relationship in the database\n $tableName = $this->getPrefixedTableNameFor('term_relationships');\n $this->haveInDatabase($tableName, array('object_id' => $post_id,\n 'term_taxonomy_id' => $term_id,\n 'term_order' => $term_order\n ));\n }", "public function hasOrderBy()\n {\n return !empty($this->orderBy);\n }", "function is_product_tag($term = '')\n {\n }", "public function hasTaxes()\n {\n return !empty($this->calculatedTaxInfo);\n }", "public function isTermsConditions()\n {\n return $this->_isTermsConditions;\n }", "public function terms(string $namespace, string $field, string $order = 'asc', bool $missing_bucket = false): array\n {\n $terms = [\n $namespace => [\n 'terms' => [\n 'field' => $field\n ]\n ]\n ];\n\n if(!empty($order)){\n $terms[$namespace]['terms']['order'] = $order;\n }\n\n if(!empty($missing_bucket) || is_int($missing_bucket)){\n $terms[$namespace]['terms']['missing_bucket'] = $missing_bucket;\n }\n\n return $terms;\n }", "public function hasReturnTerms()\n {\n return $this->termsReturned;\n }", "function is_product_taxonomy()\n {\n }", "protected function order_contains_pre_order( $order_id ) {\r\n return class_exists( 'WC_Pre_Orders_Order' ) && WC_Pre_Orders_Order::order_contains_pre_order( $order_id );\r\n }", "public function hasQuote(){\n return $this->_has(1);\n }", "function acf_get_valid_terms($terms = \\false, $taxonomy = 'category') {}", "function cart_has_tax() {\n\treturn ( 0.0 !== (float) edd_get_cart_tax() );\n}", "static public function isOrderExists( $order_id ) {\r\n\r\n global $wpdb;\r\n\r\n $table_name = $wpdb->prefix . 'ce_orders';\r\n\r\n $order = $wpdb->get_var( $wpdb->prepare(\"SELECT id FROM {$table_name} WHERE order_id = %s\", $order_id) );\r\n\r\n if ( ! $order ) {\r\n return false;\r\n }\r\n\r\n return true;\r\n\r\n }", "private function is_free_order( $order ) {\n\n\t\t$is_free = true;\n\n\t\t// easy check: order total\n\t\tif ( $order->get_total() > 0 ) {\n\t\t\t$is_free = false;\n\t\t}\n\n\t\t// free order\n\t\treturn (bool) apply_filters( 'wc_sequential_order_numbers_is_free_order', $is_free, $order->get_id() );\n\t}", "public function initStep(Order $order): bool\n {\n return $order->IsSubmitted();\n }", "function isQuoted( $fieldName )\n\t{\n\t\tif ($this->_hasQuoted) {\n\t\t\treturn in_array( $fieldName, $this->_quoted );\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function hasAcceptedTerms();", "function hay_ordenamiento()\n\t{\n\t\treturn (! empty($this->_info_orden_col));\n\t}", "function wpsc_is_in_tag( $term = '' ) {\n\n\treturn is_tax( 'product_tag', $term );\n\n}", "public function canSeePostWithTermInDatabase($post_id, $term_taxonomy_id, $term_order = null, $taxonomy = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\ConditionalAssertion('seePostWithTermInDatabase', func_get_args()));\n }", "function zen_check_url_get_terms() {\n global $db;\n $zp_sql = \"select * from \" . TABLE_GET_TERMS_TO_FILTER;\n $zp_filter_terms = $db->Execute($zp_sql);\n $zp_result = false;\n while (!$zp_filter_terms->EOF) {\n if (isset($_GET[$zp_filter_terms->fields['get_term_name']]) && zen_not_null($_GET[$zp_filter_terms->fields['get_term_name']])) $zp_result = true;\n $zp_filter_terms->MoveNext();\n }\n return $zp_result;\n }", "public function order_exists($order_id) : bool\n {\n }", "private function isValidField()\n {\n $fields = array_keys($this->sortFields);\n\n return in_array($this->sortRequest[0], $fields);\n }", "function isValidTerm($term){\r\n $query =\"select * from academic_term where academic_term.academic_term = ?\";\r\n return ($this->makeParamExecute($query,array( $term))==1?'true':'false');\r\n }", "public function validateSo($order);", "function is_listing_tag( $term = '' ) {\r\n\t\treturn is_tax( 'listing_tag', $term );\r\n\t}", "public function willAddIsLocalizedOrder() {\n return $this->addIsLocalizedOrder;\n }", "function has_acf_field( $field ) {\r\n\r\n $term = get_queried_object();\r\n\r\n $id = isset( $term->taxonomy )\r\n ? $term->term_id\r\n : get_the_ID();\r\n\r\n $value = get_post_meta( $id, $field );\r\n\r\n if ( is_array( $value ) )\r\n $value = array_filter( $value );\r\n\r\n\t\tif ( isset( $value ) && ! empty( $value ) )\r\n\t\t\treturn true;\r\n\r\n return false;\r\n\t}", "function customSectionOrderingExists($issueId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT COUNT(*) FROM custom_section_orders WHERE issue_id = ?',\n\t\t\t$issueId\n\t\t);\n\t\t$returner = isset($result->fields[0]) && $result->fields[0] == 0 ? false : true;\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "function is_tax( $taxonomy = '', $term = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_tax( $taxonomy, $term );\n}", "public function getTermsIncludeUpperBound(): bool {}", "public function getTermsIncludeUpperBound(): bool {}", "function is_product_category($term = '')\n {\n }", "public static function is_multiple_terms_query() {\n\t\tglobal $wp_query;\n\n\t\tif ( ! is_tax() && ! is_tag() && ! is_category() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$term = get_queried_object();\n\t\t$queried_terms = $wp_query->tax_query->queried_terms;\n\n\t\tif ( empty( $queried_terms[ $term->taxonomy ]['terms'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn count( $queried_terms[ $term->taxonomy ]['terms'] ) > 1;\n\t}", "public static function isCorporateCrmOrder($order)\n {\n return (is_array($order) || $order instanceof ArrayAccess)\n && isset($order['customer'])\n && isset($order['customer']['type'])\n && $order['customer']['type'] == 'customer_corporate';\n }", "public function checkOrders(){\n include '../dbcon/init.php';\n $query = \"SELECT * FROM ORDERS WHERE Order_Complete='N';\";\n $result = $sqli->query($query);\n return $result->num_rows == 0 ? FALSE : TRUE;\n }", "function gnj_term_has_child( $term, $taxonomy ) {\n $count = 0;\n $child_terms = gnj_wp_get_terms( array( 'taxonomy' => $taxonomy, 'child_of' => $term->term_id ) );\n\n if( ! is_wp_error( $child_terms ) ){\n\n foreach ( $child_terms as $child_term ) {\n $_products_in_term = get_objects_in_term( $child_term->term_id, $taxonomy );\n $count += sizeof( array_intersect( $_products_in_term, Ganje_Ajax_Filter::getInstance()->frontend->layered_nav_product_ids ) );\n }\n }\n\n return empty( $count ) ? false : true;\n}", "function taxonomy_is_product_attribute($name)\n {\n }", "private function shouldSplit($order)\n {\n $discount = $order->getDiscountAmount();\n $taxAmount = $order->getTaxAmount();\n $extraAmount = $discount + $taxAmount;\n\n $totalAmount = 0;\n foreach ($this->getAllVisibleItems($order) as $item) {\n $totalAmount += $item->getRowTotal();\n }\n return (abs($extraAmount) == $totalAmount);\n }", "public function processOrder(Order $order): bool\n { \n return true;\n }", "function wp_check_term_meta_support_prefilter($check)\n{\n}", "public function hasQuote()\n {\n return isset($this->_quote);\n }", "public function isApplicable(Order $order): bool;", "public function isRequiredService(TermInterface $service_term) {\n // Check a service to see if it is required.\n $required = $service_term->get('field_vet_center_required_servic')->value;\n\n return $required;\n }", "public function hasIncludeQuote(){\n return $this->_has(4);\n }", "function saveTaxonomyAiDisplayOrderFunc($term_id, $tt_id, $taxonomy, $update)\n{\n if ($update) {\n return;\n }\n\n $order = get_term_meta($term_id, 'ai_display_order', true);\n if (empty($order)) {\n add_term_meta($term_id, 'ai_display_order', 0);\n }\n}", "public function isOrder()\n {\n return ($this->state === $this::STATE_ORDERED_PENDING ? true : false);\n }", "public function search_orders( $term ) {\n\t\tglobal $wpdb;\n\n\t\t/**\n\t\t * Searches on meta data can be slow - this lets you choose what fields to search.\n\t\t * 2.7.0 added _billing_address and _shipping_address meta which contains all address data to make this faster.\n\t\t * This however won't work on older orders unless updated, so search a few others (expand this using the filter if needed).\n\t\t * @var array\n\t\t */\n\t\t$search_fields = array_map( 'wc_clean', apply_filters( 'woocommerce_shop_order_search_fields', array(\n\t\t\t'_billing_address_index',\n\t\t\t'_shipping_address_index',\n\t\t\t'_billing_last_name',\n\t\t\t'_billing_email',\n\t\t) ) );\n\t\t$order_ids = array();\n\n\t\tif ( is_numeric( $term ) ) {\n\t\t\t$order_ids[] = absint( $term );\n\t\t}\n\n\t\tif ( ! empty( $search_fields ) ) {\n\t\t\t$order_ids = array_unique( array_merge(\n\t\t\t\t$order_ids,\n\t\t\t\t$wpdb->get_col(\n\t\t\t\t\t$wpdb->prepare( \"SELECT DISTINCT p1.post_id FROM {$wpdb->postmeta} p1 WHERE p1.meta_key IN ('\" . implode( \"','\", array_map( 'esc_sql', $search_fields ) ) . \"') AND p1.meta_value LIKE '%%%s%%';\", wc_clean( $term ) )\n\t\t\t\t),\n\t\t\t\t$wpdb->get_col(\n\t\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\t\tSELECT order_id\n\t\t\t\t\t\tFROM {$wpdb->prefix}woocommerce_order_items as order_items\n\t\t\t\t\t\tWHERE order_item_name LIKE '%%%s%%'\n\t\t\t\t\t\t\",\n\t\t\t\t\t\t$term\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t) );\n\t\t}\n\n\t\treturn $order_ids;\n\t}", "function wc_get_order($the_order = \\false)\n {\n }", "function gnj_term_is_parent( $term ) {\n\n return ( isset( $term->parent ) && $term->parent == 0 ) ? true : false;\n}", "function hasRun() {\n\t\t$hasRun = TRUE;\n\t\t\n\t\t// check for section_page_order field in section table\n\t\t$query = \"\n\t\tDESCRIBE\n\t\t\tsection section_page_order\n\t\t\";\n\t\t$r = db_query($query);\n\t\tif (db_num_rows($r)) {\n\t\t\t$this->field01Exists = TRUE;\n\t\t} else {\n\t\t\t$hasRun = FALSE;\n\t\t\tprint \"\\n Needs section_page_order field in section table.<br />\";\n\t\t}\n\t\t\t\t\t\t\t\n\t\treturn $hasRun;\t\n\t}", "public static function is_order($order_id, $types = array('shop_order'))\n {\n }", "protected function is_first_order_clause($query)\n {\n }", "protected function is_first_order_clause($query)\n {\n }", "public function is_taxonomy()\n {\n }", "public function hasOrderBy() : bool;", "public function hasTaxRules();", "public function isMissingLowerFileTaxonomy()\n {\n return !empty($this->_missingSections) || $this->isMissingPages(); \n }", "function activate() {\n\t\tglobal $wpdb;\n\t\t\n\t\t// Test if the \"term_order\" field already exists or not\n\t\t$query = $wpdb->query( \"SHOW COLUMNS FROM $wpdb->term_taxonomy LIKE 'term_order'\" );\n\t\n\t\t// Add the column if needed\n\t\tif ( $query == 0 )\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->term_taxonomy ADD `term_order` INT(4) NULL DEFAULT '0'\" );\n\t}", "public function canPlaceOrder(){\n return false;\n }", "function svbk_rcp_require_one_tax_field( $posted ) {\n\tif( is_user_logged_in() ) {\n\t\treturn;\n\t}\n\t\n\tif( empty( $posted['rcp_tax_id'] ) && empty( $posted['rcp_tax_code'] ) ) { \n\t rcp_errors()->add( 'tax_parameter_required', __( 'Please enter your tax id or tax code', 'svbk-rcp-company-details' ), 'register' );\n\t}\n}", "abstract protected function getOrderFields();", "public function cart_has_order()\n\t{\n\t\tif ($order_id = $this->session->userdata('order_id'))\n\t\t{\n\t\t\t// Load the orders model if its not already loaded\n\t\t\t$this->load->model('orders_m');\n\n\t\t\t$order = $this->orders_m->get_order_by_id($order_id);\n\n\t\t\t// Are there any items in the order?\n\t\t\tif (empty($order['items']))\n\t\t\t{\n\t\t\t\t// Nope, delete the order.\n\t\t\t\t$this->orders_m->delete_order($order_id);\n\n\t\t\t\t// Remove the order id from session.\n\t\t\t\t$this->session->unset_userdata('order_id');\n\n\t\t\t\t// Return FALSE, we have no order now.\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t// Is the order unpaid?\n\t\t\tif ($order['order_status']['key'] == 1)\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\t// Remove the order id from session.\n\t\t\t\t$this->session->unset_userdata('order_id');\n\n\t\t\t\t// Return FALSE, we have no order.\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}" ]
[ "0.6938512", "0.6267192", "0.6235622", "0.62037444", "0.60186124", "0.5869115", "0.58380276", "0.58215725", "0.57941335", "0.57880855", "0.5774876", "0.57607836", "0.5740578", "0.5712532", "0.5701701", "0.5697885", "0.5687974", "0.5685638", "0.5682309", "0.56706864", "0.5664782", "0.5653335", "0.5647162", "0.5622431", "0.5622431", "0.5572808", "0.5551915", "0.5513014", "0.5506763", "0.5506763", "0.54472965", "0.54467523", "0.54380804", "0.541536", "0.5409882", "0.5396026", "0.5395337", "0.5380264", "0.53772306", "0.53721005", "0.53647137", "0.5361388", "0.535007", "0.5348016", "0.5310228", "0.5273385", "0.5273346", "0.5269363", "0.52671784", "0.52535945", "0.52494574", "0.5248454", "0.5243501", "0.5242265", "0.52215147", "0.52194715", "0.52167755", "0.5215714", "0.51961505", "0.5184758", "0.5180041", "0.5179045", "0.5176523", "0.51643634", "0.51563394", "0.5149426", "0.51365197", "0.51251125", "0.51251125", "0.5119882", "0.51081985", "0.510636", "0.51060504", "0.51032054", "0.50813186", "0.5080605", "0.5078455", "0.5075196", "0.50723517", "0.50698674", "0.5055034", "0.5052831", "0.5051149", "0.50378746", "0.5030182", "0.50244343", "0.50190234", "0.5017772", "0.5016124", "0.50159883", "0.5015506", "0.5011646", "0.50073445", "0.5004703", "0.49985978", "0.49921992", "0.49912143", "0.49873912", "0.4986971", "0.49773097" ]
0.78021985
0
Units_GetUnitByCode get unit by Name
Units_GetUnitByCode получает единицу по имени
function Units_GetUnitByCode($vCode, $vAllInfo = false) { return(Units_GetUnitByName(Units_GetNameByCode($vCode), $vAllInfo)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUnit()\n {\n \treturn $this->get(['unit_code','unit_symbol']);\n }", "public function getUnitName();", "public function getUnitsOf(string $featureCode);", "public function getUnitOf(string $className): Unit\n {\n return $this->units[$className];\n }", "public function getUnitCode()\n {\n return $this->unitCode;\n }", "public function getUnit(): string;", "public function getUnit(): string;", "abstract public function getUnit();", "public function getUnit()\n {\n return substr($this->getInwardCode(), 1, 2);\n }", "private function getUnit($own_id) {\r\n\t\t$UnitSize = 1;\r\n\t\t$IdUnit = dechex($own_id);\r\n\t\tif (strlen($IdUnit) == 7) {\r\n\t\t\t$UnitSize = 2;\r\n\t\t}\r\n\t\t$Unit = hexdec(substr($IdUnit, -$UnitSize));\r\n\t\treturn ($Unit);\r\n\t}", "function getByName($name) {\r\n\t\t$cond = new Criteria();\r\n\t\t$cond->add(UnitPeer::NAME, $name);\r\n\t\t$cond->setIgnoreCase(true);\r\n\t\t$alls = UnitPeer::doSelect($cond);\r\n\t\treturn $alls[0];\r\n }", "function Units_GetUnitByName($vName, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name=\"' . $vName . '\"';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','className','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name='$vName'\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = $vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['field']] = $vRow['content'];\n\t}\n\treturn(@$vReturn);\n}", "public function getUnitName()\n {\n return $this->unitName;\n }", "public function getUnitName()\n {\n return $this->unitName;\n }", "public function getUnit(): string\n\t{\n\t\treturn $this->unit;\n\t}", "public function getUnitName()\n {\n $value = $this->get(self::UNITNAME);\n return $value === null ? (string)$value : $value;\n }", "public function unitCode($unitCode)\n {\n return $this->setProperty('unitCode', $unitCode);\n }", "public function getUnit()\n {\n $value = $this->get(self::UNIT);\n return $value === null ? (string)$value : $value;\n }", "function getUnit() {return $this->_unit; }", "public function getByCode(string $code);", "public function getUnit()\n {\n return $this->unit;\n }", "public function getUnit()\n {\n return $this->unit;\n }", "public function getUnit()\n {\n return $this->unit;\n }", "public function getUnit(): ?string\n {\n if ($this->unit == 'celsius' || $this->unit == 'metric') {\n return \"C\";\n } elseif ($this->unit == 'fahrenheit') {\n return 'F';\n } else {\n return $this->unit;\n }\n }", "public function unit(): string\n\t{\n\t\treturn $this->unitId;\n\t}", "public function getUnit()\n {\n return $this->_unit;\n }", "public function getUnits() {\n $var = 'units_' . $this->current_unit_system;\n return $this->$var;\n }", "function getUnitID() {\n\t\treturn $this->iUnitID;\n\t}", "public function getUnitName(): ?string\n {\n return $this->unitName;\n }", "public function getTransUnitById($id);", "public function getByCode($code);", "public function getUnitById (int $unitId, string $lang = \"de\"): UnitName\n\t{\n\t\treturn $this->unitNameRepository->findOne($unitId, $lang);\n\t}", "function getUnits($kind, $uid)\n{\n \treturn \\dal\\unit\\getUnits($kind, $uid);\n}", "public function setUnitCode($unitCode)\n {\n $this->unitCode = $unitCode;\n return $this;\n }", "public function getUnitById( Request $request ){\n try{\n if( !$request->input('unit_id'))\n throw new Exception(\"Unit Id required for retrive unit\");\n\n $unit = Unit::find($request->input('unit_id'));\n if( !$unit )\n throw new Exception(\"Unit not found with this ID\");\n\n return ['success'=>true ,'data'=>$unit, 'message'=>\"Found unit\"];\n }catch (Exception $e){\n return ['success'=>false, 'message'=>$e->getMessage()];\n }\n }", "public function get_unit(){\n\t\treturn $this->v_unit;\n\t}", "public function getUnit() {\n return $this->getParameter('unit');\n }", "public function getUnit()\n {\n return $this->hasOne(Unit::className(), ['unit_id' => 'unit_id']);\n }", "protected function getUnit(string $unit, ?int $number = null): string\n {\n $words = $this->getVocabulary();\n\n if ($number === null) {\n if ($this->translator !== null) {\n return $this->translator->translate($words[$unit][0]);\n } else {\n return $words[$unit][0];\n }\n }\n\n if ($this->translator !== null) {\n return $this->translator->translate($words[$unit][1], $number);\n }\n\n if (abs($number) < 2) {\n return $words[$unit][1];\n } else {\n return $words[$unit][2];\n }\n }", "function get_unit($id_unit)\n {\n return $this->db->get_where('unit',array('id_unit'=>$id_unit))->row_array();\n }", "public function getUnits()\n {\n\n $query=$this->db->get('unit');\n return $query->result();\n }", "public function unitName($unit){\n $translator = Zend_Registry::get('Zend_Translate'); \n if ($unit == '%') return \"<span style=\\\"font-style: italic; color: grey;\\\">\".$translator->_('Percent').\"</span>\";\n if ($unit == 'hrs') return \"<span style=\\\"font-style: italic; color: grey;\\\">\".$translator->_('Hours').\"</span>\";\n return \"<span style=\\\"font-style: italic; color: grey;\\\">\".$translator->_($this->conversions[$unit][$this->selected[$unit]][0]).\"</span>\";\n }", "private function get_unit( $input ) {\n\t\tif ( $input && ! is_numeric( $input ) ) {\n\t\t\t$non_numeric_string = preg_replace( '/[^0-9.]/', '', $input );\n\t\t\t$unit = str_replace( $non_numeric_string, '', $input );\n\t\t\treturn trim( $unit );\n\t\t}\n\t}", "public function Get($strName);", "public function name($code) \n {\n foreach ($this->countries as $countryObj) {\n if ($countryObj->alpha_two_code == $code) {\n return $countryObj->name;\n }\n }\n }", "private function getDistanceUnit($units) {\n return strpos($units, 'mile') !== FALSE\n ? self::DISTANCE_PER_DEG_MILES\n : self::DISTANCE_PER_DEG_KM;\n }", "public function setUnit($var)\n {\n GPBUtil::checkString($var, True);\n $this->unit = $var;\n\n return $this;\n }", "function get_unit($unit_id)\n {\n return $this->db->get_where('tbl_unit',array('unit_id'=>$unit_id))->row_array();\n }", "public function get($code);", "public function getUnit()\n {\n return $this->db->select('*')\n ->from('unit u')\n ->join('category c','c.unit=u.id')\n ->where('c.delete_status',0)\n ->get()\n ->result();\n }", "public function setUnitName($value)\n {\n return $this->set(self::UNITNAME, $value);\n }", "function get_data_unit($idunit){\n\t\tglobal $config_bd2;\n\t\t$conexion = mysqli_connect($config_bd2['host'],$config_bd2['user'],$config_bd2['pass'],$config_bd2['bname']);\n\t\tif($conexion){\t\t\n\t\t\t $sql = \"SELECT CONCAT(PLAQUE,'_',DESCRIPTION) AS UNIDAD\n\t\t\t\t\tFROM SAVL1120 \n\t\t\t\t\tWHERE COD_ENTITY = \".$idunit.\"\n\t\t\t\t\tLIMIT 1\";\t\t\t\t\t\n\t\t\t$query = mysqli_query($conexion, $sql);\t\n\t\t\t$row = @mysqli_fetch_array($query);\n\t\t\t$count = @mysqli_num_rows($query);\t\t\t\n\t\t\tif($count > 0){\n\t\t\t\t$unidad = str_replace('/','_',$row['UNIDAD']); \n\t\t\t\treturn $unidad;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tmysqli_close($conexion);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function lookupMetroCode($code){\n\t\tif( !isset($this->_metroCodes) ){\n\t\t\t$this->_metroCodes = parse_ini_file(dirname( __FILE__ ).'/ini/metroCodes.ini');\n\t\t}\n\t\treturn $this->_metroCodes[$code];\n\t}", "public function unit()\n {\n return Lang::get('quantities.'.$this->entity->unit);\n }", "public function unitofm_purchase($code) {\n\t\treturn Codes\\Min\\Umm::instance()->exists($code);\n\t}", "public function get_from_name();", "public function testGetNameWithUnknownLocaleCode()\n {\n $this->currency->getName('foobar');\n }", "function find_faculty_by_name($name) {\n\t$code = mysql_fetch_row(db_query(\"SELECT code FROM faculte\n\t\tWHERE name = '$name'\"));\n\tif (!$code) {\n\t\treturn FALSE;\n\t} else {\n\t\treturn $code[0];\n\t}\n}", "protected function findUnitOfMeasureByNameOrAlias($unit) {\r\n $unit = strtolower($unit);\r\n foreach ($this->unitDefinitions as $unitOfMeasure) {\r\n if ($unit === $unitOfMeasure->getName() || $unitOfMeasure->isAliasOf($unit)) {\r\n return $unitOfMeasure;\r\n }\r\n }\r\n\r\n trigger_error(\"Unknown unit of measure ($unit)\");\r\n }", "public function setUnitCode($unitCode) {\n $this->properties['unitCode'] = $unitCode;\n\n return $this;\n }", "public function setUnitCode($unitCode) {\n $this->properties['unitCode'] = $unitCode;\n\n return $this;\n }", "public function getUnitsForType($type);", "public function getUnit(bool $ati = false);", "function get_unit($id)\n {\n return $this->db->get_where('units',array('id'=>$id))->row_array();\n }", "function getCategoryByCode() {\n\t\t$fs_table = FSFactory::getClass ( 'fstable' );\n\t\t$ccode = FSInput::get ( 'ccode' );\n\t\tif (! $ccode)\n\t\t\treturn;\n\t\t$query = \" SELECT id,name, alias,vat\n\t\t\t\t\t\tFROM \" . $fs_table->getTable ( 'fs_products_categories' ) . \" \n\t\t\t\t\t\tWHERE alias = '$ccode' \";\n\t\tglobal $db;\n\t\t$sql = $db->query ( $query );\n\t\t$result = $db->getObject ();\n\t\treturn $result;\n\t}", "public function getIdUnit()\n {\n return $this->idUnit;\n }", "public function getName($code)\n {\n return $this->get($code)->name;\n }", "public function unitofm_sale($code) {\n\t\treturn Codes\\Min\\Umm::instance()->exists($code);\n\t}", "public function getSubUnit();", "public function getUnits($unit){\n\t\t//check that unit exists\n\t\tif(array_key_exists($unit, $this->units)){\n\t\t\t//find base unit\n\t\t\t$baseUnit = $this->units[$unit][\"base\"];\n\n\t\t\t$unitList = array();\n\t\t\t//find all units that are linked to the base unit\n\t\t\tforeach ($this->units as $key => $values) {\n\t\t\t\tif($values[\"base\"] == $baseUnit){\n\t\t\t\t\tarray_push($unitList, $key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $unitList;\n\t\t}else{\n\t\t\tthrow new Exception(\"Unit Does Not Exist\");\n\t\t}\n\t}", "public function getCodeName(): string;", "protected function resolveName($unit, $name)\n {\n return $this->resolve($unit, $name);\n }", "public function show(Unit $Unit)\n {\n //\n }", "public function findUnit($id) {\n $sql = \"SELECT * FROM $this->tabela WHERE id = :id\";\n $stm = DB::prepare($sql);\n $stm->bindParam(':id', $id, PDO::PARAM_INT);\n $stm->execute();\n return $stm->fetch();\n }", "public function testFindOneByCode()\n {\n $result = $this\n ->getRepository()\n ->findOneByCode(LoadSkuData::CODE)\n ;\n $this->assertNotNull($result);\n $this->assertEquals(LoadSkuData::PROJECT, $result->getProject());\n $this->assertEquals(LoadSkuData::TYPE, $result->getForeignType());\n $this->assertEquals(LoadSkuData::OBJECT_ID, $result->getForeignId());\n }", "function getUnits() {\n\t\tglobal $DB_LINK, $db_table_units;\n\t\t$units = array();\n\t\t$sql = \"SELECT unit_id, unit_desc, unit_abbr FROM $db_table_units\";\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\t\twhile (!$rc->EOF) {\n\t\t\t$id = $rc->fields['unit_id'];\n\t\t\t$units[$id] = array( $rc->fields['unit_desc'], $rc->fields['unit_abbr'] );\n\t\t\t$rc->MoveNext();\n\t\t}\n\t\treturn $units;\n\t}", "public static function resolveUnit(string $unit): UnitType\n {\n $unitRule = config(\"mongez.testing.units.$unit\");\n return new $unitRule;\n }", "public function show($id)\n {\n \t$unit = Unit::findOrFail($id);\n\n \treturn $unit;\n }", "public function getByName($name);", "public function getByName($name);", "public function getByName($name);", "function get_unit_map() {\n global $mysqli;\n $sql_query = \"\n SELECT name, unit_id\n FROM units\";\n $result = $mysqli->query($sql_query);\n if ($result == false) {\n echo ($mysqli->error);\n exit();\n }\n $return_map = array();\n while ($row = $result->fetch_assoc()) {\n $return_map[$row[\"name\"]] = $row[\"unit_id\"];\n }\n return $return_map;\n }", "public function getBaseUnit()\n\t{\n\t\treturn static::baseUnit();\n\t}", "abstract public function convertToUnit(string $unit): float;", "static function getName(int $code): ?string\n {\n return self::CODES[$code] ?? null;\n }", "public function get_unit_name($id, $unit = FALSE)\n\t{\n\t\tif ($unit === false) {\n\t\t\t$query = $this->db->get_where('unit', array('id' => $id));\n\t\t\t$query = $query->row_array();\n\t\t} else {\n\t\t\t$query = $unit;\n\t\t}\n\t\treturn (isset($query['associatedunit']) && $query['associatedunit'] !== '0' ) ? $query['associatedunit'].' '.$query['associatednumber'].' ('.$query['unittype'].' '.$query['number'].')': $query['unittype'].' '.$query['number'];\n\t}", "public static function speciesFromCode( $code ) {\n\t\t$org = Organism::getByCode( $code );\n\t\tif ( $org ) {\n\t\t\treturn $org->getLatinName();\n\t\t}\n\t}", "public static function get_unit( $value, $unit_used = '' ) {\n\n\t\t// Trim the value.\n\t\t$value = trim( $value );\n\n\t\t// The array of valid units.\n\t\t$units = array( 'px', 'rem', 'em', '%', 'vmin', 'vmax', 'vh', 'vw', 'ex', 'cm', 'mm', 'in', 'pt', 'pc', 'ch' );\n\n\t\tforeach ( $units as $unit ) {\n\n\t\t\t// Find what unit we're using.\n\t\t\tif ( false !== strpos( $value, $unit ) ) {\n\t\t\t\t$unit_used = $unit;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $unit_used;\n\t}", "public function show(Unit $unit)\n {\n //\n }", "public function getUnitId(): int\n {\n if ($this->unitId === null) {\n $this->unitId = $this->unitService->getOfficialUnit()->getId();\n }\n\n return $this->unitId;\n }", "public static function create(string $key)\n {\n if (array_key_exists($key, self::$_units)) {\n return self::$_units[$key];\n } else {\n return (self::$_units[$key] = new self($key));\n }\n }", "public function getProductUnit(Request $request)\n {\n $productUnitName = Product::find($request->id)->unitDetails->name;\n return response()->json($productUnitName);\n }", "public function getUnitType()\n {\n if (is_null($this->unitType)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_UNIT_TYPE);\n if (is_null($data)) {\n return null;\n }\n $this->unitType = (string) $data;\n }\n\n return $this->unitType;\n }", "public function setUnitName($unitName)\n {\n $this->unitName = $unitName;\n return $this;\n }", "public static function get_unit( $value ) {\n\n\t\t$unit_used = '';\n\n\t\t// Trim the value.\n\t\t$value = trim( $value );\n\n\t\t// The array of valid units.\n\t\t$units = [ 'px', 'rem', 'em', '%', 'vmin', 'vmax', 'vh', 'vw', 'ex', 'cm', 'mm', 'in', 'pt', 'pc', 'ch' ];\n\n\t\tforeach ( $units as $unit ) {\n\n\t\t\t// Find what unit we're using.\n\t\t\tif ( false !== strpos( $value, $unit ) ) {\n\t\t\t\t$unit_used = $unit;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $unit_used;\n\n\t}", "public static function getCode( $code ) {\n\t\tglobal $wgLang, $wgBabelLanguageCodesCdb;\n\n\t\t$mediawiki = $wgLang->getLanguageName( $code );\n\t\tif ( $mediawiki !== '' ) {\n\t\t\treturn $code;\n\t\t}\n\n\t\t$codes = CdbReader::open( $wgBabelLanguageCodesCdb );\n\t\treturn $codes->get( $code );\n\t}", "public function renderUnitField($name, $value = null)\n {\n $units = array(\n array('value' => 'px', 'label' => __('pixels', 'pronamic_google_maps')),\n array('value' => '%', 'label' => __('percent', 'pronamic_google_maps')),\n );\n\n ?>\n <select id=\"<?php echo $this->get_field_id($name); ?>\" name=\"<?php echo $this->get_field_name($name); ?>\">\n <?php foreach ($units as $unit) : ?>\n <option value=\"<?php echo $unit['value']; ?>\"\n <?php if ($value == $unit['value']) : ?>selected=\"selected\"<?php endif ?>>\n <?php echo $unit['label']; ?>\n </option>\n <?php endforeach; ?>\n </select>\n <?php\n }", "public function setUnit($value) {\n return $this->setParameter('unit', $value);\n }", "public function speedUnit()\n\t{\n\t\t// laut = knot, darat/udara/linud/marinir = kmph\n\t\tif (preg_match('/_laut$/', static::$_durasiColumn)) {\n\t\t\treturn 'knot';\n\t\t} else {\n\t\t\treturn 'kmph';\n\t\t}\n\t}", "public static function getProductByCode($code);" ]
[ "0.70069975", "0.69446075", "0.6647489", "0.6592802", "0.6512683", "0.63970023", "0.63970023", "0.63681424", "0.63337463", "0.6250142", "0.62349063", "0.61735165", "0.61597025", "0.61597025", "0.6075952", "0.6067038", "0.6043559", "0.5782657", "0.575548", "0.5735797", "0.5733185", "0.5733185", "0.5733185", "0.57323855", "0.5729645", "0.570669", "0.5706252", "0.56722873", "0.5587428", "0.5565639", "0.5535565", "0.5532118", "0.55295604", "0.5510021", "0.55071557", "0.54928905", "0.5486817", "0.5483952", "0.5449677", "0.5449194", "0.5418413", "0.54143417", "0.5400006", "0.53895533", "0.5382201", "0.5378604", "0.53776866", "0.53653747", "0.5328761", "0.5292832", "0.52923363", "0.52906257", "0.5285728", "0.52794874", "0.5274821", "0.5269799", "0.52512676", "0.524025", "0.5234542", "0.52287436", "0.52287436", "0.52219546", "0.5220753", "0.52045023", "0.5196703", "0.5186496", "0.51841843", "0.5169509", "0.51639384", "0.5160642", "0.51566213", "0.515097", "0.5136853", "0.5127873", "0.5124454", "0.51169825", "0.5110774", "0.51029116", "0.5090903", "0.5090903", "0.5090903", "0.50905603", "0.5086181", "0.5086087", "0.50795054", "0.50750244", "0.50743896", "0.5068519", "0.50673956", "0.5066314", "0.5065082", "0.50581944", "0.5042808", "0.5035083", "0.5032234", "0.50274444", "0.5012466", "0.4989489", "0.4986168", "0.4985329" ]
0.8292479
0
Units_GetAll get all units
Units_GetAll получает все единицы измерения
function Units_GetAll($vAllInfo = false) { if ($vAllInfo) { $vSQL = 'select * from units'; } else { $vSQL = "select * from units where field in ('name','type','code','buyable','className','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc')"; } $vResult = @$_SESSION['vDataDB']->query($vSQL); while ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC)) { $vReturn[$vRow['name']][$vRow['field']] = $vRow['content']; } return($vReturn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_all_units($params = array())\n {\n $this->db->order_by('unit_name', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('tbl_unit')->result_array();\n }", "function get_all_units()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('units')->result_array();\n }", "public function getUnits()\n {\n\n $query=$this->db->get('unit');\n return $query->result();\n }", "function getUnits() {\n\t\tglobal $DB_LINK, $db_table_units;\n\t\t$units = array();\n\t\t$sql = \"SELECT unit_id, unit_desc, unit_abbr FROM $db_table_units\";\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\t\twhile (!$rc->EOF) {\n\t\t\t$id = $rc->fields['unit_id'];\n\t\t\t$units[$id] = array( $rc->fields['unit_desc'], $rc->fields['unit_abbr'] );\n\t\t\t$rc->MoveNext();\n\t\t}\n\t\treturn $units;\n\t}", "function get_all_unit()\n {\n $this->db->order_by('id_unit', 'desc');\n return $this->db->get('unit')->result_array();\n }", "public function showAllUnitsAction()\n {\n //Gets the Unit entity and queries for all equipment\n $em = $this->getEM()->getRepository('AppBundle:Unit');\n $unit = $em->findAll();\n\n //Sends an equipment variable to the view containing all rows in the Equipment Table\n return [\n 'units' => $unit\n ];\n }", "public function getAllUnit(){\n try{\n $companies = Unit::all();\n return ['success'=>true, 'data'=>$companies,'message'=>\"All units\"];\n }catch (Exception $e){\n return ['success'=>false, 'message'=>$e->getMessage()];\n }\n\n }", "function getAll() {\r\n\t\t$cond = new Criteria();\r\n\t\t$alls = UnitPeer::doSelect($cond);\r\n\t\treturn $alls;\r\n }", "public function getUnitsAction()\n {\n // get action from id in url\n $actionChosen = $this->params()->fromRoute('id', 0);\n \n // get units for that action\n if ($actionChosen == 'View'){\n $results = $this->getGenericQueries()->getUnits();\n }\n else{\n $results = $this->getGenericQueries()->getUnitsByPrivId($this->userID);\n }\n \n // iterate through results forming a php array\n foreach ($results as $result){\n $unitData[] = $result;\n }\n \n // encode results as json object\n $jsonData = new JsonModel($unitData);\n return $jsonData;\n }", "function get_all_units_count()\n {\n $this->db->from('tbl_unit');\n return $this->db->count_all_results();\n }", "function getLocalUnits() {\n\t\tglobal $db_table_units, $alpha_sort_units, $DB_LINK, $LangUI;\n\t\t$localUnits = array();\n\t\t$unitSystem = Units::getLocalSystem();\n\t\t$localIDs = Units::getLocalUnitIDs($unitSystem);\n\t\t\n\t\t// Select all of the units from the database\n\t\t$sql = \"SELECT unit_id,unit_desc FROM $db_table_units\";\n\t\t// Sorting option\n\t\tif ($alpha_sort_units)\n\t\t\t$sql .=\" ORDER BY unit_desc\";\n\t\t\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, $LangUI->_('There was an error selecting the unit_id'), $sql);\n\t\twhile (!$rc->EOF) {\n\t\t\tif (in_array($rc->fields['unit_id'], $localIDs)) {\n\t\t\t\t$id = $rc->fields['unit_id'];\n\t\t\t\t$localUnits[$id] = $rc->fields['unit_desc'];\n\t\t\t}\n\t\t\t$rc->MoveNext();\n\t\t}\n\t\t// Returns an associative array with id->desc\n\t\treturn $localUnits;\n\t}", "public static function getUnits()\r\n\t{\r\n\t\treturn Website_Model_MysqlTable::getEnumValues('component','unit');\r\n\t}", "public function units() # For demo purposes\n {\n global $DATA;\n # Side menu ID that should be highlighted\n $DATA[\"current_menu\"] = \"Units\";\n # Displayed in on the begining of the page\n $DATA[\"page_header\"] = \"All Units\";\n # Name of the tab in browser\n $DATA[\"page_title\"] = $DATA[\"page_header\"] .BLIO_TITLE;\n\n\n $districts = new DistrictModel();\n $ud = new UnitDistModel();\n $session = \\Config\\Services::session();\n\n # Find a District of a Manager\n $district = $districts->getDistrictByUser($DATA[\"user\"]->id);\n\n # Get all units associated with the district\n $units = $ud->getUnitsFromDistrict($district[\"id\"]);\n $DATA[\"units_all\"] = $units;\n $DATA[\"flashdata\"] = $session->getFlashdata();\n\n # Displaying Header\n echo view(\"dashboard/header\", $DATA);\n echo view(\"dashboard/units\", $DATA);\n echo view(\"dashboard/footer\", $DATA);\n }", "function available_units(){\n\t\t$db = get_data();\n\t\ttry{\n\t\t\t$results = $db->query(\"SELECT * FROM units_info WHERE TotalVacant!=0\");\n\t\t\t// $results->bindParam(0,$width);\n\t\t\t// $results->bindParam(1,$length);\n\t\t\t$data = $results->fetchAll();\n\t\t}\tcatch(Exception $e){\n\t\t\techo \"could not query the database\";\n\t\t\texit;\n\t\t}\n\t\treturn $data;\n\t}", "public function getUnitValues()\n {\n /*$measures = ArrayHelper::map(Measurement::find()->all(), 'short_name',\n function(Measurement $data) use (&$results){\n $results[$data->type][$data->short_name] = $data->name;\n return $data->name;\n });*/\n $results = [\n 'Pack'=>[\n 'CS'=>'Case',\n 'EA'=>'Each',\n ],\n ];\n\n $this->getMeasurementItems()->indexBy(function(MeasurementItem $data) use (&$results){\n $results['Alternative']['alt:'.$data->id] = $data->name;\n })->all();\n\n Measurement::find()->indexBy(function(Measurement $data) use (&$results){\n $results[$data->type][$data->id] = $data->name;\n })->all();\n\n return $results;\n }", "function Units_GetUnitByName($vName, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name=\"' . $vName . '\"';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','className','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name='$vName'\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = $vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['field']] = $vRow['content'];\n\t}\n\treturn(@$vReturn);\n}", "public function getUnits() {\n $var = 'units_' . $this->current_unit_system;\n return $this->$var;\n }", "public function getMyUnits(){\r\n try{\r\n $db = new Database();\r\n $conn = $db->connection();\r\n if(gettype($conn) !== \"object\"){\r\n return [];\r\n }\r\n $sql = \"SELECT * FROM units where course = ? and year_of_study=? and semester=?\";\r\n $query = $conn->prepare($sql);\r\n $course = $this->course;\r\n $year = $this->year_of_study;\r\n $sem = $this->semester;\r\n if(!$query){\r\n return [];\r\n }\r\n $query->execute(array($course, $year, $sem));\r\n $records = $query->fetchAll(PDO::FETCH_CLASS, \"Unit\");\r\n if(zero($records)){\r\n return [];\r\n }\r\n $res = [];\r\n foreach($records as $record){\r\n if(zero($record->getLecturer())){\r\n continue;\r\n }\r\n array_push($res, $record);\r\n }\r\n return $res;\r\n }catch(Exception $ex){\r\n return [];\r\n }\r\n }", "function getUnits($kind, $uid)\n{\n \treturn \\dal\\unit\\getUnits($kind, $uid);\n}", "public function index()\n {\n $data['row'] = $this->units_m->get();\n $this->template->load('template', 'product/unit/unit_data', $data);\n }", "public function index()\n {\n $units = Unit::all();\n \n return UnitResource::collection($units);\n }", "public function units()\r\n {\r\n\r\n // DEFINES PAGE TITLE\r\n $data['title'] = 'Unit list';\r\n\r\n // DEFINES NAME OF TABLE HEADING\r\n $data['table_name'] = 'Unit list :';\r\n\r\n // DEFINES WHICH PAGE TO RENDER\r\n $data['main_view'] = 'units';\r\n\r\n // DEFINES THE TABLE HEAD\r\n $data['table_heading_names_of_coloums'] = array(\r\n 'Name',\r\n 'Symbol',\r\n 'Action'\r\n );\r\n\r\n $result = $this->Crud_model->fetch_record('mp_units', NULL);\r\n $data['unit_list'] = $result;\r\n\r\n // DEFINES GO TO MAIN FOLDER FOND INDEX.PHP AND PASS THE ARRAY OF DATA TO THIS PAGE\r\n $this->load->view('main/index.php', $data);\r\n }", "function getConnectedUnits()\n\t\t{\n\n\t\t\t$returnUnit = array();\n\n\t\t\t// Ensure the db connection has been established\n\t\t\t$this->init();\n\n\t\t\t// Get all unit datasets\n\t\t\t$units = $this->db->select(\"SELECT * FROM units\");\n\n\t\t\t// Filter units\n\t\t\tforeach($units as $k => $unit)\n\t\t\t\tif(isSizedString($unit['unit_secret']) && (bool)$unit['unit_isHub'] === false)\n\t\t\t\t\tarray_push($returnUnit, $unit);\n\n\t\t\treturn $returnUnit;\n\n\t\t}", "private function getSMSUnits(){\n return \\Cake\\DataSource\\ConnectionManager::get('default')->execute(\"SELECT units FROM companies_sms where location_id = :id\",['id'=>$_SESSION['Auth']['User']['location_id']])->fetch('assoc')['units'];\n }", "function get_unit($id)\n {\n return $this->db->get_where('units',array('id'=>$id))->row_array();\n }", "function get_all_measure() {\n\n return array(\n 'kg', 'm', 'm kb', 'gr', 'pcs', 'unit'\n );\n}", "public function get_all_units(Request $request)\n {\n\n $offset=$request->offset_id;\n $user_id=$request->user_id;\n if (auth()->user()->id == $user_id)\n $units = Unit::where('user_id', $user_id)->skip($offset)->take(10)->get();\n else\n $units= Unit::where('user_id',$user_id)->where('activation_admin', 'active')->where('activation_user', 'active')->orderBy('created_at', 'desc')->skip($offset)->take(10)->get();\n return UnitCollection::collection($units);\n }", "public function jsonUnits() {\n $units = [];\n foreach($this->units as $unit) {\n $units[$unit->id] = $unit->name;\n }\n return json_encode($units);\n }", "static public function unitTypes(){\n $tmp = Steam_MeasurementSystem::getInstance();\n return $tmp->unitTypes;\n }", "public function index()\n {\n $unites=$this->unitRepository->getAllUnites();\n return view('backend.constants.units.all_unites',compact('unites'));\n }", "public function index()\n {\n $units = Unit::all();\n return $this->success($units);\n }", "public function getUnitQueries() {\n if (!$this->unittableResults) {\n $this->unittableResults = $this->getServiceLocator()\n ->get('Admin\\Model\\UnitTable');\n }\n return $this->unittableResults;\n }", "public function getUnits()\n{\n return $this->Units;\n}", "public function units()\n {\n return $this->hasMany(ItemUnit::class);\n }", "public function getUnits()\n\t{\n\t\treturn $this->units;\n\t}", "public function getUnits()\n\t{\n\t\treturn $this->units;\n\t}", "public function get_units() {\r\n $response[\"result\"] = \"RESPONSE_ERROR\";\r\n\t\t//echo \"<pre>\"; print_r($this->session->userdata()); echo \"</pre>\"; die();\r\n $logged_in_userdata = $this->session->userdata('logged_in');\r\n $logged_in_userdata_ID = $logged_in_userdata['ID'];\r\n\t\t$user_related_to_id_array = $this->User_model->get_related_to_ID($logged_in_userdata_ID);\r\n\t\t\r\n\t\t\t$user_related_to_id = $user_related_to_id_array[\"response_data\"][\"related_to_ID\"][0]['RelatedTo'];\r\n\t\t\tif ($user_related_to_id_array[\"result\"] == \"RESPONSE_OK\") {\r\n\t\t}else{\r\n\t\t\t$user_related_to_id = '';\r\n\t\t}\r\n $units_request = $this->Units_model->get_units($user_related_to_id);\r\n if ($units_request[\"result\"] == \"RESPONSE_OK\") {\r\n $containers = $units_request[\"response_data\"];\r\n if (is_array($containers)) {\r\n $indexed_units = array();\r\n foreach ($containers as $key => $value) {\r\n $indexed_units[$value[\"SerialNo\"]] = $key;\r\n }\r\n }\r\n $response[\"result\"] = \"RESPONSE_OK\";\r\n $response[\"response_data\"][\"units\"] = $containers;\r\n $response[\"response_data\"][\"indexed_units\"] = $indexed_units;\r\n } else {\r\n $response[\"description\"] = $units_request[\"description\"];\r\n }\r\n echo json_encode($response);\r\n }", "public function unitsProvider()\n {\n return array(\n array(5, 2, 0, -10, 1, 3, -5),\n array(0, 0, 0, 0, 0, 0, 3600),\n array(1, 0, 0, 0, 0, 0, 0),\n array(0, 0, 0, 0, 0, 0, 0),\n array(0, 0, 1, 0, 0, 0, 0),\n array(-1, -1, -1, -1, -1, -1, -1),\n array(rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100)),\n );\n }", "public function getSubunits();", "public function units()\n {\n return $this->hasMany(Unit::class);\n }", "public function getUnits($unit){\n\t\t//check that unit exists\n\t\tif(array_key_exists($unit, $this->units)){\n\t\t\t//find base unit\n\t\t\t$baseUnit = $this->units[$unit][\"base\"];\n\n\t\t\t$unitList = array();\n\t\t\t//find all units that are linked to the base unit\n\t\t\tforeach ($this->units as $key => $values) {\n\t\t\t\tif($values[\"base\"] == $baseUnit){\n\t\t\t\t\tarray_push($unitList, $key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $unitList;\n\t\t}else{\n\t\t\tthrow new Exception(\"Unit Does Not Exist\");\n\t\t}\n\t}", "public function getNewUnits(): array {\n return $this->newUnits;\n }", "public function index()\n {\n $unitMeasureRoomCatalogue = $this->getEnums(QUERY::UNIT_MEASURE_ROOM_ENUM);\n $unitMeasureRoomCatalogue = $this ->getCollection($unitMeasureRoomCatalogue);\n\n return $this->showAll($unitMeasureRoomCatalogue);\n }", "function getUnites($idJoueur){\n\t\tinclude(\"connBdd.php\");\n\t\t$query = \"SELECT unites FROM joueurs WHERE idJoueur='$idJoueur'\";\n\t\t$result = mysql_query($query) or die(\"Query error dans getUnites: \". mysql_error());\n\t\tif(mysql_num_rows($result) != 0){\n\t\t\t$unitesNS = mysql_result($result,0);\n\t\t\t$unites = unserialize($unitesNS);\n\t\t\tif ($unites == \"\"){\n\t\t\t\t$unites = array();\n\t\t\t}\n\t\t}else{\n\t\t\t$unites = array();\n\t\t}\n\t\treturn($unites);\n\t}", "public function index()\n {\n return Unit::with('amenities', 'availability', 'images', 'details', 'rates', 'searchCriteria')->get();\n }", "public function index()\n {\n return view('units', [\n 'units' => Unit::orderBy('name')->get()\n ]);\n }", "public function getUnitsForType($type);", "public function index()\n\t{\n\n\t\tif (!$this->ion_auth->logged_in())\n\t\t{\n\t\t\t// redirect them to the login page\n\t\t\tredirect('auth/login', 'refresh');\n\t\t}\n\t\t$data['unit'] = $this->Unit_model->getUnits();\n\t\t/*print_r($data);\n\t\texit();*/\n\t\t$this->load->view('unit/list',$data);\n\t}", "public function getUnits()\n {\n return view('administrator.' . $this->data['module'] . '.' . 'index', ['data' => $this->data]);\n }", "public function getUnit()\n {\n return $this->db->select('*')\n ->from('unit u')\n ->join('category c','c.unit=u.id')\n ->where('c.delete_status',0)\n ->get()\n ->result();\n }", "public function getAllUnitFlag()\n {\n return isset($this->AllUnitFlag) ? $this->AllUnitFlag : null;\n }", "public function outputAllUnits(): string\n {\n $html = '';\n $units = $this->_modelConverter->getRates();\n\n foreach ($units as $unit) {\n $html .= $this->_getForm($unit);\n }\n\n return $html;\n }", "public function SIUnitNameList()\n{\n$sim['res'][0]=['base'=>'ShortTokenType'];\n// Represents a dimensionless unit.\n$sim['res'][0]['opt'][]=['1'];\n// Represents the SI unit \"meter\".\n$sim['res'][0]['opt'][]=['m'];\n// Represents the SI unit \"kilogram\".\n$sim['res'][0]['opt'][]=['kg'];\n// Represents the SI unit \"second\".\n$sim['res'][0]['opt'][]=['s'];\n// Represents the SI unit \"ampere\".\n$sim['res'][0]['opt'][]=['A'];\n// Represents the SI unit \"kelvin\".\n$sim['res'][0]['opt'][]=['K'];\n// Represents the SI unit \"mol\".\n$sim['res'][0]['opt'][]=['mol'];\n// Represents the SI unit \"candela\".\n$sim['res'][0]['opt'][]=['cd'];\nreturn $sim;\n}", "function Units_GetByType($vType, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name in (select name from units where field=\"type\" and content=\"' . $vType . '\")';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','class','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name in (select name from units where field='type' and content='\" . $vType . \"')\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['name']][$vRow['field']] = $vRow['content'];\n\t}\n\treturn($vReturn);\n}", "public function getUnit()\n {\n \treturn $this->get(['unit_code','unit_symbol']);\n }", "public function getUnitOfMeasurement() { \n //initialize dummy value.. no content header.pure html \n $sql=null; \n $str=null; \n $items=array(); \n if($this->getVendor()==self::MYSQL) { \n $sql =\" \n SELECT `unitOfMeasurementId`,\n\t\t `unitOfMeasurementCode`,\n `unitOfMeasurementDescription`\n FROM `unitofmeasurement`\n WHERE `isActive` = 1\n AND `companyId` = '\".$this->getCompanyId().\"'\n ORDER BY `isDefault`;\"; \n } else if ($this->getVendor()==self::MSSQL) { \n $sql =\" \n SELECT [unitOfMeasurementId],\n\t\t [unitOfMeasurementCode],\n [unitOfMeasurementDescription]\n FROM [unitOfMeasurement]\n WHERE [isActive] = 1\n AND [companyId] = '\".$this->getCompanyId().\"'\n ORDER BY [isDefault]\"; \n } else if ($this->getVendor()==self::ORACLE) { \n $sql =\" \n SELECT UNITOFMEASUREMENTID AS \\\"unitOfMeasurementId\\\",\n\t\t UNITOFMEASUREMENTCODE AS \\\"unitOfMeasurementCode\\\",\n UNITOFMEASUREMENTDESCRIPTION AS \\\"unitOfMeasurementDescription\\\"\n FROM UNITOFMEASUREMENT \n WHERE ISACTIVE = 1\n AND COMPANYID = '\".$this->getCompanyId().\"'\n ORDER BY ISDEFAULT\"; \n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n try {\n $result =$this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if($result) { \n $d=1;\n while(($row = $this->q->fetchArray($result))==TRUE) { \n if($this->getServiceOutput()=='option'){\n $str.=\"<option value='\".$row['unitOfMeasurementId'].\"'>\".$row['unitOfMeasurementCode'].\". \".$row['unitOfMeasurementDescription'].\"</option>\";\n } else if ($this->getServiceOutput()=='html') { \n $items[] = $row; \n }\n $d++;\n }\n unset($d);\n }\n if($this->getServiceOutput()=='option'){\n if (strlen($str) > 0) {\n $str = \"<option value=''>\".$this->t['pleaseSelectTextLabel'].\"</option>\" . $str; \n } else {\n $str= \"<option value=''>\".$this->t['notAvailableTextLabel'].\"</option>\";\n }\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\"=>true,\"message\"=>\"complete\",\"data\"=>$str));\n exit();\n } else if ($this->getServiceOutput()=='html') { \n return $items; \n }\n return false; \n }", "public function getAllForAdminList()\n {\n $columns = ['id', 'name', 'units'];\n\n $result = $this->startCondition()\n ->select($columns)\n ->toBase()\n ->get();\n\n return $result;\n }", "public function listAllUnits($propertyId)\n {\n $request = new ListAllUnitsRequest($propertyId);\n return $this->send($request);\n }", "public function getUnitCollection()\n{\n return $this->UnitCollection;\n}", "function getCookingUnits(){\n\t$Units = array();\n\t\n\t$Units[] = \"teaspoon\"; \n\t$Units[] = \"t\"; \n\t$Units[] = \"tsp.\"; \n\t\n\t$Units[] = \"ounce\";\n\t$Units[] = \"oz\";\n\t$Units[] = \"oz.\";\n\t \n\t\n\t\n\t$Units[] = \"pounds\";\n\t$Units[] = \"pound\"; \n\t$Units[] = \"lb\"; \n\t$Units[] = \"lbs\"; \n\t$Units[] = \"lb.\"; \n\t$Units[] = \"lbs.\"; \n\t\n\t$Units[] = \"tablespoon\"; \n\t$Units[] = \"T\"; \n\t$Units[] = \"tbl.\"; \n\t$Units[] = \"tbs.\"; \n\t$Units[] = \"tbsp.\"; \n\t\n\t$Units[] = \"fluid ounce\"; \n\t$Units[] = \"fl oz\";\n\t \n\t$Units[] = \"gill\"; \n\t\n\t$Units[] = \"cup\"; \n\t$Units[] = \"c\"; \n\t$Units[] = \"c.\"; \n\t\n\t$Units[] = \"pint\"; \n\t$Units[] = \"p\"; \n\t$Units[] = \"pt\"; \n\t$Units[] = \"fl pt\"; \n\t$Units[] = \"\"; \n\t\n\t$Units[] = \"quart\"; \n\t$Units[] = \"q\"; \n\t$Units[] = \"qt\"; \n\t$Units[] = \"fl\"; \n\t$Units[] = \"qt\";\n\t \n\t$Units[] = \"gallon\"; \n\t$Units[] = \"g\"; \n\t$Units[] = \"gal\"; \n\t\n\t$Units[] = \"ml\"; \n\t$Units[] = \"milliliter\"; \n\t$Units[] = \"millilitre\"; \n\t$Units[] = \"cc\"; \n\t$Units[] = \"mL\"; \n\t\n\t$Units[] = \"l\"; \n\t$Units[] = \"liter\"; \n\t$Units[] = \"litre\"; \n\t$Units[] = \"L\"; \n\t\n\treturn $Units;\t\n}", "public function units()\n {\n return $this->units;\n }", "public function getTransUnitList(array $locales = null, $rows = 20, $page = 1, array $filters = null);", "public function statpriceunits(){\n\t\t$searchDate_start = $this->request->getParameterNoException('searchDate_start');\n\t\t$searchDate_end = $this->request->getParameterNoException('searchDate_end');\n\t\t$unit_id = $this->request->getParameterNoException('unit');\n\t\t$responsible_id = $this->request->getParameterNoException('responsible');\n\t\t$export_type = $this->request->getParameterNoException('export_type');\n\t\t\n\t\t// get the selected unit\n\t\t$selectedUnitId = 0;\n\t\tif ($unit_id != \"\"){\n\t\t\t$selectedUnitId = $unit_id; \n\t\t}\n\t\t\n\t\t// get the responsibles for this unit\n\t\t$responsiblesList = array();\n\t\tif ($selectedUnitId > 0){\n\t\t\t$modeluser = new User();\n\t\t\t$responsiblesList = $modeluser->getResponsibleOfUnit($selectedUnitId);\n\t\t}\n\t\t\n\t\t// test if it needs to calculate output\n\t\t$errorMessage = '';\n\t\tif ($selectedUnitId != 0 && $responsible_id != ''){\n\t\t\t\n\t\t\t// test the dates\n\t\t\t$testPass = true;\n\t\t\tif ( $searchDate_start == ''){\n\t\t\t\t$errorMessage = \"Please set a start date\";\n\t\t\t\t$testPass = false;\n\t\t\t}\n\t\t\tif ( $searchDate_end == ''){\n\t\t\t\t$errorMessage = \"Please set an end date\";\n\t\t\t\t$testPass = false;\n\t\t\t}\n\t\t\tif ( $searchDate_end < $searchDate_start){\n\t\t\t\t$errorMessage = \"The start date must be before the start date\";\n\t\t\t\t$testPass = false;\n\t\t\t}\n\t\t\t\n\t\t\t// if the form is correct, calculate the output\n\t\t\tif ($testPass){\n\t\t\t\tif ($export_type > 0 && $export_type < 4 ){\n\t\t\t\t\t$this->output($export_type, $searchDate_start, $searchDate_end, $selectedUnitId, $responsible_id);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// get units list\n\t\t$modelUnit = new Unit();\n\t\t$unitsList = $modelUnit->unitsIDName();\n\t\t\n\t\t$navBar = $this->navBar();\n\t\t$this->generateView ( array (\n\t\t\t\t'navBar' => $navBar,\n\t\t\t\t'selectedUnitId' => $selectedUnitId,\n\t\t\t\t'responsiblesList' => $responsiblesList,\n\t\t\t\t'unitsList' => $unitsList,\n\t\t\t\t'errorMessage' => $errorMessage,\n\t\t\t\t'searchDate_start' => $searchDate_start,\n\t\t\t\t'searchDate_end' => $searchDate_end\n\t\t) );\n\t}", "function get_unit_map() {\n global $mysqli;\n $sql_query = \"\n SELECT name, unit_id\n FROM units\";\n $result = $mysqli->query($sql_query);\n if ($result == false) {\n echo ($mysqli->error);\n exit();\n }\n $return_map = array();\n while ($row = $result->fetch_assoc()) {\n $return_map[$row[\"name\"]] = $row[\"unit_id\"];\n }\n return $return_map;\n }", "public function getUnits($select){\n\t\t$options='';\n\t\tforeach($this->unitModel->getUnits() as $key => $value){\n\t\t\tif($select == $key){\n\t\t\t\t$options .= '<option value=\"'.$key.'\" selected>'.$key.'</option>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$options .= '<option value=\"'.$key.'\">'.$key.'</option>';\n\t\t\t}\t\t\n\t\t}\n\t\treturn $options;\n\t}", "public function getUnits($select){\n\t\t$options='';\n\t\tforeach($this->unitModel->getUnits() as $key => $value){\n\t\t\tif($select == $key){\n\t\t\t\t$options .= '<option value=\"'.$key.'\" selected>'.$key.'</option>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$options .= '<option value=\"'.$key.'\">'.$key.'</option>';\n\t\t\t}\t\t\n\t\t}\n\t\treturn $options;\n\t}", "function get_unit($id_unit)\n {\n return $this->db->get_where('unit',array('id_unit'=>$id_unit))->row_array();\n }", "public function units()\n {\n return $this->belongsToMany('App\\Models\\Unit');\n }", "public function index(Request $request)\n {\n\n \tif ($request->name){\n \t\t$units = UnitService::getUnitsByName($request->name);\n\t\t}\n\n\t\tif ($request->category){\n\t\t\t$units = UnitService::getUnitsByCategoryName($request->category);\t\n\t\t}\n\n\t\tif ($request->min_amount || $request->max_amount){\n\t\t\t$units = UnitService::getUnitsByAmount($request->min_amount ?? 0, $request->max_amount);\n\t\t}\n\n\t\tif (isset($request->published)){\n\t\t\t$units = UnitService::getPublishedUnits($request->published);\n\t\t}\n\n\t\tif ($request->undeleted == 1){\n\t\t\t$units = UnitService::getUndeletedUnits();\n\t\t}\n\n\t\n\t\tif (!isset($units)){\n\t\t\treturn response()->json('Error: Request value is not correct', Response::HTTP_UNPROCESSABLE_ENTITY);\n\t\t}\n\n\n\n\n return response()->json($units, Response::HTTP_OK);\n }", "public function index()\n {\n return view('units.index',[\n 'units'=>Unit::all()\n ]);\n }", "public function units()\n {\n return $this->hasMany('App\\Unit');\n }", "public function index()\n {\n return view('measurements.compound_units_list');\n }", "public function getall()\n {\n }", "public function index()\n {\n $units = Unit::all();\n return view('units.index', compact('units'));\n }", "public function index()\n {\n $units = Unit::all();\n return view('units.index', compact('units'));\n }", "function defineUnits(){\n\n\t\t$this->units = array(\n\t\t///////Units Of Length///////\n\t\t\"m\"=>array(\"base\"=>\"m\", \"conversion\"=>1), //meter - base unit for distance\n\t\t\"km\"=>array(\"base\"=>\"m\", \"conversion\"=>1000), //kilometer\n\t\t\"dm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.1), //decimeter\n\t\t\"cm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.01), //centimeter\n\t\t\"mm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.001), //milimeter\n\t\t\"μm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.000001), //micrometer\n\t\t\"nm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.000000001), //nanometer\n\t\t\"pm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.000000000001), //picometer\n\t\t\"in\"=>array(\"base\"=>\"m\", \"conversion\"=>0.0254), //inch\n\t\t\"ft\"=>array(\"base\"=>\"m\", \"conversion\"=>0.3048), //foot\n\t\t\"yd\"=>array(\"base\"=>\"m\", \"conversion\"=>0.9144), //yard\n\t\t\"mi\"=>array(\"base\"=>\"m\", \"conversion\"=>1609.344), //mile\n\t\t\"h\"=>array(\"base\"=>\"m\", \"conversion\"=>0.1016), //hand\n\t\t\"ly\"=>array(\"base\"=>\"m\", \"conversion\"=>9460730472580800), //lightyear\n\t\t\"au\"=>array(\"base\"=>\"m\", \"conversion\"=>149597870700), //astronomical unit\n\t\t\"pc\"=>array(\"base\"=>\"m\", \"conversion\"=>30856775814913672.789139379577965), //parsec\n\n\n\t\t///////Units Of Area///////\n\t\t\"m2\"=>array(\"base\"=>\"m2\", \"conversion\"=>1), //meter square - base unit for area\n\t\t\"km2\"=>array(\"base\"=>\"m2\", \"conversion\"=>1000000), //kilometer square\n\t\t\"cm2\"=>array(\"base\"=>\"m2\", \"conversion\"=>0.0001), //centimeter square\n\t\t\"mm2\"=>array(\"base\"=>\"m2\", \"conversion\"=>0.000001), //milimeter square\n\t\t\"ft2\"=>array(\"base\"=>\"m2\", \"conversion\"=>0.092903), //foot square\n\t\t\"mi2\"=>array(\"base\"=>\"m2\", \"conversion\"=>2589988.11), //mile square\n\t\t\"ac\"=>array(\"base\"=>\"m2\", \"conversion\"=>4046.86), //acre\n\t\t\"ha\"=>array(\"base\"=>\"m2\", \"conversion\"=>10000), //hectare\n\n\t\t///////Units Of Volume///////\n\t\t\"l\"=>array(\"base\"=>\"l\", \"conversion\"=>1), //litre - base unit for volume\n\t\t\"ml\"=>array(\"base\"=>\"l\", \"conversion\"=>0.001), //mililitre\n\t\t\"m3\"=>array(\"base\"=>\"l\", \"conversion\"=>1), //meters cubed\n\t\t\"pt\"=>array(\"base\"=>\"l\", \"conversion\"=>0.56826125), //pint\n\t\t\"gal\"=>array(\"base\"=>\"l\", \"conversion\"=>4.405), //gallon\n\n\t\t///////Units Of Weight///////\n\t\t\"kg\"=>array(\"base\"=>\"kg\", \"conversion\"=>1), //kilogram - base unit for weight\n\t\t\"g\"=>array(\"base\"=>\"kg\", \"conversion\"=>0.001), //gram\n\t\t\"mg\"=>array(\"base\"=>\"kg\", \"conversion\"=>0.000001), //miligram\n\t\t\"N\"=>array(\"base\"=>\"kg\", \"conversion\"=>9.80665002863885), //Newton (based on earth gravity)\n\t\t\"st\"=>array(\"base\"=>\"kg\", \"conversion\"=>6.35029), //stone\n\t\t\"lb\"=>array(\"base\"=>\"kg\", \"conversion\"=>0.453592), //pound\n\t\t\"oz\"=>array(\"base\"=>\"kg\", \"conversion\"=>0.0283495), //ounce\n\t\t\"t\"=>array(\"base\"=>\"kg\", \"conversion\"=>1000), //metric tonne\n\t\t\"ukt\"=>array(\"base\"=>\"kg\", \"conversion\"=>1016.047), //UK Long Ton\n\t\t\"ust\"=>array(\"base\"=>\"kg\", \"conversion\"=>907.1847), //US short Ton\n\n\t\t//////Units Of Speed///////\n\t\t\"mps\"=>array(\"base\"=>\"mps\", \"conversion\"=>1), //meter per seond - base unit for speed\n\t\t\"kph\"=>array(\"base\"=>\"mps\", \"conversion\"=>0.44704), //kilometer per hour\n\t\t\"mph\"=>array(\"base\"=>\"mps\", \"conversion\"=>0.277778), //kilometer per hour\n\n\t\t///////Units Of Rotation///////\n\t\t\"deg\"=>array(\"base\"=>\"deg\", \"conversion\"=>1), //degrees - base unit for rotation\n\t\t\"rad\"=>array(\"base\"=>\"deg\", \"conversion\"=>57.2958), //radian\n\n\t\t///////Units Of Temperature///////\n\t\t\"k\"=>array(\"base\"=>\"k\", \"conversion\"=>1), //kelvin - base unit for distance\n\t\t\"c\"=>array(\"base\"=>\"k\", \"conversion\"=>function($val, $tofrom){return $tofrom ? $val - 273.15 : $val + 273.15;}), //celsius\n\t\t\"f\"=>array(\"base\"=>\"k\", \"conversion\"=>function($val, $tofrom){return $tofrom ? ($val * 9/5 - 459.67) : (($val + 459.67) * 5/9);}), //Fahrenheit\n\n\t\t///////Units Of Pressure///////\n\t\t\"pa\"=>array(\"base\"=>\"Pa\", \"conversion\"=>1), //Pascal - base unit for Pressure\n\t\t\"kpa\"=>array(\"base\"=>\"Pa\", \"conversion\"=>1000), //kilopascal\n\t\t\"mpa\"=>array(\"base\"=>\"Pa\", \"conversion\"=>1000000), //megapascal\n\t\t\"bar\"=>array(\"base\"=>\"Pa\", \"conversion\"=>100000), //bar\n\t\t\"mbar\"=>array(\"base\"=>\"Pa\", \"conversion\"=>100), //milibar\n\t\t\"psi\"=>array(\"base\"=>\"Pa\", \"conversion\"=>6894.76), //pound-force per square inch\n\n\t\t///////Units Of Time///////\n\t\t\"s\"=>array(\"base\"=>\"s\", \"conversion\"=>1), //second - base unit for time\n\t\t\"year\"=>array(\"base\"=>\"s\", \"conversion\"=>31536000), //year - standard year\n\t\t\"month\"=>array(\"base\"=>\"s\", \"conversion\"=>18748800), //month - 31 days\n\t\t\"week\"=>array(\"base\"=>\"s\", \"conversion\"=>604800), //week\n\t\t\"day\"=>array(\"base\"=>\"s\", \"conversion\"=>86400), //day\n\t\t\"hr\"=>array(\"base\"=>\"s\", \"conversion\"=>3600), //hour\n\t\t\"min\"=>array(\"base\"=>\"s\", \"conversion\"=>30), //minute\n\t\t\"ms\"=>array(\"base\"=>\"s\", \"conversion\"=>0.001), //milisecond\n\t\t\"μs\"=>array(\"base\"=>\"s\", \"conversion\"=>0.000001), //microsecond\n\t\t\"ns\"=>array(\"base\"=>\"s\", \"conversion\"=>0.000000001), //nanosecond\n\n\t\t///////Units Of Power///////\n\t\t\"j\"=>array(\"base\"=>\"j\", \"conversion\"=>1), //joule - base unit for energy\n\t\t\"kj\"=>array(\"base\"=>\"j\", \"conversion\"=>1000), //kilojoule\n\t\t\"mj\"=>array(\"base\"=>\"j\", \"conversion\"=>1000000), //megajoule\n\t\t\"cal\"=>array(\"base\"=>\"j\", \"conversion\"=>4184), //calorie\n\t\t\"Nm\"=>array(\"base\"=>\"j\", \"conversion\"=>1), //newton meter\n\t\t\"ftlb\"=>array(\"base\"=>\"j\", \"conversion\"=>1.35582), //foot pound\n\t\t\"whr\"=>array(\"base\"=>\"j\", \"conversion\"=>3600), //watt hour\n\t\t\"kwhr\"=>array(\"base\"=>\"j\", \"conversion\"=>3600000), //kilowatt hour\n\t\t\"mwhr\"=>array(\"base\"=>\"j\", \"conversion\"=>3600000000), //megawatt hour\n\t\t\"mev\"=>array(\"base\"=>\"j\", \"conversion\"=>0.00000000000000016), //mega electron volt\n\t\t);\n}", "public function get_units($unit=FALSE,$relational=FALSE)\n\t{\n\t\tif ($unit === false) {\n\t\t\t$query = $this->db->get('unit');\n\t\t\tif ($relational === false) {\n\t\t\t\treturn $query->result_array();\n\t\t\t} else {\n\t\t\t\t$temp = $query->result_array();\n\t\t\t\t$units = array();\n\t\t\t\tforeach ($temp as $u) { $units[$u['id']] = $u;}\n\t\t\t}\n\t\t\treturn $units;\n\t\t} else {\n\t\t\t$query = $this->db->get_where('unit', array('id' => $unit));\n\t\t\treturn $query->row_array();\n\t\t}\n\t}", "public function index()\n {\n $units = Unit::orderBy('name','ASC')->get();\n return view('pages.units.index',[\n 'title' => 'Data Unit',\n 'units' => $units\n ]);\n }", "public static function getAll()\n {\n }", "function get_unit($unit_id)\n {\n return $this->db->get_where('tbl_unit',array('unit_id'=>$unit_id))->row_array();\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM va_measurement';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function get_all_get(){\n $result = $this->location_model->get_all();\n $this->response($result); \n\n }", "public function get_all_data(){\n $this->benchmark->mark('code_start');\n \n $this->db->order_by('no_dummy','asc');\n $this->db->where('unit', $this->session->userdata('unit'));\n $query = $this->db->get('tbl_metdum_stok');\n return $result = $query->result_array();\n $this->benchmark->mark('code_end');\n \n\t\t}", "function Units_GetByClass($vClass, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name in (select name from units where field=\"className\" and content=\"' . $vClass . '\")';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','class','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name in (select name from units where field='className' and content='\" . $vClass . \"')\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['name']][$vRow['field']] = $vRow['content'];\n\t}\n\treturn($vReturn);\n}", "public function index()\n {\n $data = array (\n 'title' => 'АДМИН - Паркетный мир - Единицы измерения',\n 'units' => Unit::get()\n );\n\n return view('admin.units.index', $data);\n }", "public final function get_all()\n {\n }", "public function index()\n {\n $data = array();\n $data['title'] = $this->lang->line('title');\n $data['title_tab'] = $this->lang->line('unit_all_unit_list');\n $data['get_unit'] = get_list(UNIT_LEVEL,'unit_id',null);\n $data['view_file'] = \"admin_unit\";\n $data['module_name'] = \"admin_unit\";\n $this->template->index($data);\n }", "public function testInventoryUnitOfMeasuresGETManyRequestInventoryIDUnitOfMeasuresGet()\n {\n }", "function getEntryUnits($eid)\n {\n $DB = DB::singleton(dsn());\n $SQL = SQL::newSelect('column');\n $SQL->addWhereOpr('column_entry_id', $eid);\n $all = $DB->query($SQL->get(dsn()), 'all');\n\n if ( empty($all) ) return false;\n\n $units = array();\n foreach ( $all as $row ) {\n $Unit = new ACMS_Model_Unit();\n $Unit->setFields($row);\n $units[] = $Unit;\n }\n\n return $units;\n }", "public function index()\n {\n $units = $this->unit->all();\n return view('admin.unit.index', compact('units'));\n }", "public function getSupportedUnits($withAliases = false) {\r\n $supportedUnits = array();\r\n foreach ($this->unitDefinitions as $unitOfMeasure) {\r\n $supportedUnits[] = $unitOfMeasure->getName();\r\n if ($withAliases) {\r\n foreach ($unitOfMeasure->getAliases() as $alias) {\r\n $supportedUnits[] = $alias;\r\n }\r\n }\r\n }\r\n\r\n return $supportedUnits;\r\n }", "public function getAll(){}", "public function index()\n {\n $data = array (\n 'units' => Unit::orderBy('unit', 'ASC')->get(),\n );\n return view('admin.units.index', $data);\n }", "public function getAll(){\n\t\t\treturn $this->allItem;\n\t\t}", "public function listAll() {\n $sql = \"SELECT * FROM tempo\";\n $result = $this->connection->database->Execute($sql);\n while ($registry = $result->FetchNextObject()) {\n $dataTime = new TimeModel();\n $dataTime->__constructOverload($registry->ID_TEMPO, $registry->ANO, $registry->MES);\n $resultOfTime[] = $dataTime;\n }\n return $resultOfTime; \n }", "function getAll()\n {\n }", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getUnits($space)\n {\n return $space->units()->publishedOrSoldOut()->get()->transform(function ($unit){\n return [\n 'photo' => asset($unit->getFirstMediaUrl('photo')),\n 'price' => $unit->periods()->first() ? Money::toDollars($unit->periods()->first()->pivot->unit_price) : 'N/A',\n 'unit' => $unit,\n 'published' => $unit->isPublished(),\n ];\n });\n }" ]
[ "0.7698332", "0.76940584", "0.7528187", "0.746539", "0.74345464", "0.71901417", "0.7129855", "0.712592", "0.6855366", "0.68028647", "0.67811847", "0.67464316", "0.6694531", "0.666126", "0.66591054", "0.6656574", "0.66551715", "0.6649815", "0.65884024", "0.6581372", "0.65611684", "0.65336156", "0.6528525", "0.65048844", "0.6470559", "0.64594054", "0.6459012", "0.64432955", "0.6436487", "0.6395851", "0.63686115", "0.63612103", "0.6313601", "0.6299415", "0.6227322", "0.6227322", "0.6225188", "0.6218633", "0.6213072", "0.61830825", "0.6182421", "0.6159412", "0.6146943", "0.61339843", "0.6116796", "0.61121595", "0.61103415", "0.61016315", "0.60653967", "0.6061678", "0.60578656", "0.6049386", "0.60459644", "0.6043959", "0.60311437", "0.6010758", "0.6008875", "0.60014665", "0.5996593", "0.5969471", "0.5960389", "0.5960383", "0.59570783", "0.59379643", "0.59311336", "0.59311336", "0.5910469", "0.59096026", "0.59040195", "0.59031826", "0.59028184", "0.5900271", "0.5896785", "0.5874762", "0.5874762", "0.58703357", "0.5860886", "0.5857256", "0.5847828", "0.58261406", "0.58257014", "0.5824115", "0.58197397", "0.58184505", "0.58152264", "0.58151555", "0.5814117", "0.5810696", "0.5800288", "0.57750267", "0.57706696", "0.5765253", "0.5752704", "0.57400525", "0.5726712", "0.57231677", "0.5710705", "0.5710705", "0.5710705", "0.5704078" ]
0.7751292
0
Units_GetByType get all units of type $vType
Units_GetByType получает все единицы типа $vType
function Units_GetByType($vType, $vAllInfo = false) { if ($vAllInfo) { $vSQL = 'select * from units where name in (select name from units where field="type" and content="' . $vType . '")'; } else { $vSQL = "select * from units where field in ('name','type','code','buyable','class','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name in (select name from units where field='type' and content='" . $vType . "')"; } $vResult = @$_SESSION['vDataDB']->query($vSQL); while ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC)) { $vReturn[$vRow['name']][$vRow['field']] = $vRow['content']; } return($vReturn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUnitsForType($type);", "static public function unitTypes(){\n $tmp = Steam_MeasurementSystem::getInstance();\n return $tmp->unitTypes;\n }", "function getUnits($kind, $uid)\n{\n \treturn \\dal\\unit\\getUnits($kind, $uid);\n}", "function Units_GetByField($vField, $vType, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name in (select name from units where field=\"' . $vField . '\" and content=\"' . $vType . '\")';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','class','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name in (select name from units where field='\" . $vField . \"' and content='\" . $vType . \"')\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['name']][$vRow['field']] = $vRow['content'];\n\t}\n\treturn($vReturn);\n}", "public static function getUnitPlugins($type) {\n $manager = self::unitPluginManager();\n $units = [];\n\n foreach ($manager->getDefinitions() as $id => $plugin) {\n if ($plugin['type'] == $type) {\n $units[$id] = $manager->createInstance($id, $plugin);\n }\n }\n\n return $units;\n }", "public static function defaultUnits($type = false){\n $defaultUnits = array(\n 'Imperial' => array(\n 'pressure' => 'psig', \n 'vacuum' => 'psia', \n 'temperature' => 'F', \n 'specificEnthalpy' => 'btu/lbm', \n 'specificEntropy' => 'btu/lbm/R', \n 'massflow' => 'klb/hr', \n 'energyflow' => 'MMBtu/hr', \n 'energy' => 'MMBtu',\n 'power' => 'kW',\n 'electricity' => 'kWh',\n 'volume' => 'gal', \n 'volumeflow' => 'gpm', \n 'density' => 'lb/ft3',\n 'specificVolume' => 'ft3/lb',\n ), \n 'SI' => array(\n 'pressure' => 'barg', \n 'vacuum' => 'bara', \n 'temperature' => 'C', \n 'specificEnthalpy' => 'kJ/kg', \n 'specificEntropy' => 'kJ/kg/K', \n 'massflow' => 't/hr', \n 'energyflow' => 'kW',\n 'energy' => 'Nm3',\n 'power' => 'kW',\n 'electricity' => 'kWh',\n 'volume' => 'l', \n 'volumeflow' => 'lpm', \n 'density' => 'g/m3',\n 'specificVolume' => 'm3/kg',\n ), \n 'Chinese' => array(\n 'pressure' => 'barg', \n 'vacuum' => 'bara', \n 'temperature' => 'C', \n 'specificEnthalpy' => 'kJ/kg', \n 'specificEntropy' => 'kJ/kg/K', \n 'massflow' => 't/hr', \n 'energyflow' => 'TCE/hr',\n 'energy' => 'TCE',\n 'power' => 'kW',\n 'electricity' => 'kWh',\n 'volume' => 'l', \n 'volumeflow' => 'lpm', \n 'density' => 'g/m3',\n 'specificVolume' => 'm3/kg',\n ), \n 'testSystem' => array(\n 'pressure' => 'test:pressure', \n 'vacuum' => 'test:vacuum', \n 'temperature' => 'test:temperature', \n 'specificEnthalpy' => 'test:specificEnthalpy', \n 'specificEntropy' => 'test:specificEntropy', \n 'massflow' => 'test:massflow', \n 'energyflow' => 'test:energyflow',\n 'energy' => 'test:energy',\n 'power' => 'test:power',\n 'electricity' => 'test:elec',\n 'volume' => 'test:volume', \n 'volumeflow' => 'test:volumeflow', \n 'density' => 'test:density',\n 'specificVolume' => 'm3/kg',\n )\n );\n unset($defaultUnits['testSystem']);\n if ($type){\n return $defaultUnits[$type];\n }\n return $defaultUnits;\n }", "public function getSystemList($type);", "function Units_GetUnitByName($vName, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name=\"' . $vName . '\"';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','className','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name='$vName'\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = $vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['field']] = $vRow['content'];\n\t}\n\treturn(@$vReturn);\n}", "function Units_GetAll($vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','className','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc')\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['name']][$vRow['field']] = $vRow['content'];\n\t}\n\treturn($vReturn);\n}", "public function excelUnits($unitType){\n if ($unitType == 'temperature') return $this->conversions[$unitType][$this->selected[$unitType]][5];\n if ($unitType == 'specificVolume') return $this->conversions[$unitType][$this->selected[$unitType]][0];\n if ($unitType == 'density') return $this->conversions[$unitType][$this->selected[$unitType]][0];\n if ($unitType == 'volume' or $unitType == 'volumeflow') return $this->conversions[$unitType][$this->selected[$unitType]][0];\n return $this->conversions[$unitType][$this->selected[$unitType]][3];\n }", "public function getUnitValues()\n {\n /*$measures = ArrayHelper::map(Measurement::find()->all(), 'short_name',\n function(Measurement $data) use (&$results){\n $results[$data->type][$data->short_name] = $data->name;\n return $data->name;\n });*/\n $results = [\n 'Pack'=>[\n 'CS'=>'Case',\n 'EA'=>'Each',\n ],\n ];\n\n $this->getMeasurementItems()->indexBy(function(MeasurementItem $data) use (&$results){\n $results['Alternative']['alt:'.$data->id] = $data->name;\n })->all();\n\n Measurement::find()->indexBy(function(Measurement $data) use (&$results){\n $results[$data->type][$data->id] = $data->name;\n })->all();\n\n return $results;\n }", "public function getAllWithType($type);", "public function getUnits()\n {\n\n $query=$this->db->get('unit');\n return $query->result();\n }", "function getLocalUnitIDs($system) {\n\t\tglobal $g_rb_units;\n\t\t$units = array();\n\t\tforeach ($g_rb_units['static'] as $key) $units[] = $key;\t\t// Unit types\n\t\tif (isset($g_rb_units[$system][\"wet\"])) foreach ($g_rb_units[$system][\"wet\"] as $key=>$val) $units[] = $key;\t// Wet volume units\n\t\tif (isset($g_rb_units[$system][\"dry\"])) foreach ($g_rb_units[$system][\"dry\"] as $key=>$val) $units[] = $key;\t// Dry volume units\n\t\tif (isset($g_rb_units[$system][\"volume\"])) foreach ($g_rb_units[$system][\"volume\"] as $key=>$val) $units[] = $key;\t// volume units\n\t\tforeach ($g_rb_units[$system][\"mass\"] as $key=>$val) $units[] = $key;\t// Mass units\n\t\t$units = array_unique($units);\t// remove duplicates (dry/wet units could be duplicated in the units structure\n\t\treturn $units;\n\t}", "public function getUnits() {\n $var = 'units_' . $this->current_unit_system;\n return $this->$var;\n }", "function getUnits() {\n\t\tglobal $DB_LINK, $db_table_units;\n\t\t$units = array();\n\t\t$sql = \"SELECT unit_id, unit_desc, unit_abbr FROM $db_table_units\";\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\t\twhile (!$rc->EOF) {\n\t\t\t$id = $rc->fields['unit_id'];\n\t\t\t$units[$id] = array( $rc->fields['unit_desc'], $rc->fields['unit_abbr'] );\n\t\t\t$rc->MoveNext();\n\t\t}\n\t\treturn $units;\n\t}", "public function getUnits($select){\n\t\t$options='';\n\t\tforeach($this->unitModel->getUnits() as $key => $value){\n\t\t\tif($select == $key){\n\t\t\t\t$options .= '<option value=\"'.$key.'\" selected>'.$key.'</option>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$options .= '<option value=\"'.$key.'\">'.$key.'</option>';\n\t\t\t}\t\t\n\t\t}\n\t\treturn $options;\n\t}", "public function getUnits($select){\n\t\t$options='';\n\t\tforeach($this->unitModel->getUnits() as $key => $value){\n\t\t\tif($select == $key){\n\t\t\t\t$options .= '<option value=\"'.$key.'\" selected>'.$key.'</option>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$options .= '<option value=\"'.$key.'\">'.$key.'</option>';\n\t\t\t}\t\t\n\t\t}\n\t\treturn $options;\n\t}", "public static function getUnits()\r\n\t{\r\n\t\treturn Website_Model_MysqlTable::getEnumValues('component','unit');\r\n\t}", "function get_all_units($params = array())\n {\n $this->db->order_by('unit_name', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('tbl_unit')->result_array();\n }", "function getAllByType($type) {\n $dataModel = $this->valueModels[$type];\n return $this->$dataModel->find('all');\n }", "function available_units(){\n\t\t$db = get_data();\n\t\ttry{\n\t\t\t$results = $db->query(\"SELECT * FROM units_info WHERE TotalVacant!=0\");\n\t\t\t// $results->bindParam(0,$width);\n\t\t\t// $results->bindParam(1,$length);\n\t\t\t$data = $results->fetchAll();\n\t\t}\tcatch(Exception $e){\n\t\t\techo \"could not query the database\";\n\t\t\texit;\n\t\t}\n\t\treturn $data;\n\t}", "function unitPrices($kind)\n{\n\t$sql = '\n\t\tSELECT * FROM dw_costs_u\n\t\tWHERE kind = '.\\util\\mysql\\sqlval($kind).'\n\t';\n\treturn \\util\\mysql\\query($sql);\n}", "function Units_GetByClass($vClass, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name in (select name from units where field=\"className\" and content=\"' . $vClass . '\")';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','class','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name in (select name from units where field='className' and content='\" . $vClass . \"')\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['name']][$vRow['field']] = $vRow['content'];\n\t}\n\treturn($vReturn);\n}", "public function getUnits($unit){\n\t\t//check that unit exists\n\t\tif(array_key_exists($unit, $this->units)){\n\t\t\t//find base unit\n\t\t\t$baseUnit = $this->units[$unit][\"base\"];\n\n\t\t\t$unitList = array();\n\t\t\t//find all units that are linked to the base unit\n\t\t\tforeach ($this->units as $key => $values) {\n\t\t\t\tif($values[\"base\"] == $baseUnit){\n\t\t\t\t\tarray_push($unitList, $key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $unitList;\n\t\t}else{\n\t\t\tthrow new Exception(\"Unit Does Not Exist\");\n\t\t}\n\t}", "function getDevicesByType($type){\n\n $sql = 'select * from devices\n\t\t\t\twhere devicetype=\"'.$type.'\" and status = \"1\"';\n\n $r = $this->db->query($sql);\n\n return $r;\n }", "public function index()\n {\n $type_units = $this->type_unit->all();\n return response([\n 'status' => true,\n 'typeUnits' => $type_units\n ], 200);\n }", "function getLocalUnits() {\n\t\tglobal $db_table_units, $alpha_sort_units, $DB_LINK, $LangUI;\n\t\t$localUnits = array();\n\t\t$unitSystem = Units::getLocalSystem();\n\t\t$localIDs = Units::getLocalUnitIDs($unitSystem);\n\t\t\n\t\t// Select all of the units from the database\n\t\t$sql = \"SELECT unit_id,unit_desc FROM $db_table_units\";\n\t\t// Sorting option\n\t\tif ($alpha_sort_units)\n\t\t\t$sql .=\" ORDER BY unit_desc\";\n\t\t\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, $LangUI->_('There was an error selecting the unit_id'), $sql);\n\t\twhile (!$rc->EOF) {\n\t\t\tif (in_array($rc->fields['unit_id'], $localIDs)) {\n\t\t\t\t$id = $rc->fields['unit_id'];\n\t\t\t\t$localUnits[$id] = $rc->fields['unit_desc'];\n\t\t\t}\n\t\t\t$rc->MoveNext();\n\t\t}\n\t\t// Returns an associative array with id->desc\n\t\treturn $localUnits;\n\t}", "public function getAll($mgr, $type){\n switch ($type){\n case \"boeken\":\n $lijst = BoekService::getBoekenOverzicht($mgr);\n break;\n case \"films\":\n $lijst = FilmService::getFilmOverzicht($mgr);\n break;\n default :\n $lijst = ProductDao::getAll($mgr); \n break;\n }\n return $lijst;\n }", "public function getLibraryStats($type);", "private function ___getItemsByType_() {\n return array();\n }", "function get_items($type) {\n $this->cache[$type] = isset($this->cache[$type]) ? $this->cache[$type] : array();\n if (empty($this->cache[$type])) {\n foreach ($this->items as $item) {\n if ($item->is_type($type)) {\n $this->cache[$type][] = $item;\n }\n }\n }\n return $this->cache[$type];\n }", "public function listUnitTypeRestrictions($unitTypeId, \\DateTime $dateFrom, \\DateTime $dateTo)\n {\n $request = new ListUnitTypeRestrictionsRequest($unitTypeId);\n $request->setDateFrom($dateFrom->format('Y-m-d'));\n $request->setDateTo($dateTo->format('Y-m-d'));\n return $this->send($request);\n }", "public function getPurchaseItemUnitPrice($type, $id, array $attributeValues);", "public static function getUnits($status){\n \n global $DB;\n \n if (!in_array($status, array('active', 'inactive'))){\n return false;\n }\n \n $statusSQL = ($status == 'active') ? 'IS NOT NULL' : 'IS NULL';\n \n $obj = new \\GT\\Statistics();\n \n $records = $DB->get_records_sql(\"SELECT DISTINCT CONCAT(s.id, '_', u.id) as id, s.name, u.id as unitid\n FROM {bcgt_qual_structures} s\n INNER JOIN {bcgt_units} u ON u.structureid = s.id\n LEFT JOIN {bcgt_qual_units} qu ON qu.unitid = u.id\n WHERE s.deleted = 0 AND u.deleted = 0\n AND qu.id {$statusSQL}\n ORDER BY s.name, u.name\"); \n \n $obj->setRecords($records);\n \n return $obj;\n \n }", "public function testGetTypesByOrgUnit()\r\n {\r\n $grouptype_ouid = $this->config['phpunit']['live']['group_type']['ouid'];\r\n $offering_ouid = $this->config['phpunit']['live']['course_offering']['ouid'];\r\n \r\n $objGroupTypes = $this->service->getTypesByOrgUnitID($offering_ouid);\r\n $this->assertInternalType('array', $objGroupTypes);\r\n $this->assertContainsOnly('D2LWS_OrgUnit_Group_Type_Model', $objGroupTypes);\r\n $this->assertArrayHasKey($grouptype_ouid, $objGroupTypes);\r\n \r\n return $objGroupTypes;\r\n }", "public function get_cuputypes() {\r\n $response[\"result\"] = \"RESPONSE_OK\";\r\n $this->db->select(\"CUPU_types.*\");\r\n $this->db->from('CUPU_types');\r\n\r\n $units_query = $this->db->get();\r\n $units_array = $units_query->result_array();\r\n $response[\"response_data\"] = $units_array;\r\n return $response;\r\n }", "function getCookingUnits(){\n\t$Units = array();\n\t\n\t$Units[] = \"teaspoon\"; \n\t$Units[] = \"t\"; \n\t$Units[] = \"tsp.\"; \n\t\n\t$Units[] = \"ounce\";\n\t$Units[] = \"oz\";\n\t$Units[] = \"oz.\";\n\t \n\t\n\t\n\t$Units[] = \"pounds\";\n\t$Units[] = \"pound\"; \n\t$Units[] = \"lb\"; \n\t$Units[] = \"lbs\"; \n\t$Units[] = \"lb.\"; \n\t$Units[] = \"lbs.\"; \n\t\n\t$Units[] = \"tablespoon\"; \n\t$Units[] = \"T\"; \n\t$Units[] = \"tbl.\"; \n\t$Units[] = \"tbs.\"; \n\t$Units[] = \"tbsp.\"; \n\t\n\t$Units[] = \"fluid ounce\"; \n\t$Units[] = \"fl oz\";\n\t \n\t$Units[] = \"gill\"; \n\t\n\t$Units[] = \"cup\"; \n\t$Units[] = \"c\"; \n\t$Units[] = \"c.\"; \n\t\n\t$Units[] = \"pint\"; \n\t$Units[] = \"p\"; \n\t$Units[] = \"pt\"; \n\t$Units[] = \"fl pt\"; \n\t$Units[] = \"\"; \n\t\n\t$Units[] = \"quart\"; \n\t$Units[] = \"q\"; \n\t$Units[] = \"qt\"; \n\t$Units[] = \"fl\"; \n\t$Units[] = \"qt\";\n\t \n\t$Units[] = \"gallon\"; \n\t$Units[] = \"g\"; \n\t$Units[] = \"gal\"; \n\t\n\t$Units[] = \"ml\"; \n\t$Units[] = \"milliliter\"; \n\t$Units[] = \"millilitre\"; \n\t$Units[] = \"cc\"; \n\t$Units[] = \"mL\"; \n\t\n\t$Units[] = \"l\"; \n\t$Units[] = \"liter\"; \n\t$Units[] = \"litre\"; \n\t$Units[] = \"L\"; \n\t\n\treturn $Units;\t\n}", "public function getVehicleMainTyres($busId,$typeId) {\n \n $query = \"\t\n\t\t\t\t\tSELECT \n\t\t\t\t\t\t\t\ttm.tyreId,\n\t\t\t\t\t\t\t\ttm.tyreNumber\n\t\t\t\t\tFROM\t\ttyre_master tm, tyre_history th\n\t\t\t\t\tWHERE\t\ttm.tyreId = th.tyreId\n\t\t\t\t\tAND\t\t\ttm.isActive = 1\n\t\t\t\t\tAND\t\t\tth.busId = $busId\n\t\t\t\t\tAND\t\t\tth.usedAsMainTyre = $typeId\";\n\n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }", "function pokemonsByType($number) {\n // instantiate TypesManager to call the findByType function\n $typesManager = new \\Project\\Pokedex\\Model\\TypesManager;\n $datas = $typesManager->findByType($number);\n\n // the results will be received by the view to render pokemons depend on the choosen type\n require('view/homeView.php');\n}", "public function getUnit()\n {\n \treturn $this->get(['unit_code','unit_symbol']);\n }", "function get_unit($id)\n {\n return $this->db->get_where('units',array('id'=>$id))->row_array();\n }", "public function getUnitOf(string $className): Unit\n {\n return $this->units[$className];\n }", "public function unitsProvider()\n {\n return array(\n array(5, 2, 0, -10, 1, 3, -5),\n array(0, 0, 0, 0, 0, 0, 3600),\n array(1, 0, 0, 0, 0, 0, 0),\n array(0, 0, 0, 0, 0, 0, 0),\n array(0, 0, 1, 0, 0, 0, 0),\n array(-1, -1, -1, -1, -1, -1, -1),\n array(rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100)),\n );\n }", "public static function getAllTypes(){\n \n global $DB;\n return $DB->get_records(\"bcgt_qoe_types\", null, \"lvl ASC, name ASC\");\n \n }", "public function getSlotsByType();", "function Units_GetUnitByCode($vCode, $vAllInfo = false)\n{\n\treturn(Units_GetUnitByName(Units_GetNameByCode($vCode), $vAllInfo));\n}", "function load_dashboard($utype) {\n\t//echo \"select * from \".$GLOBALS['table_prefix'].\"usertypes where typeid='\".$utype.\"'\";\n\t$usertype_rs = mysql_query(\"select * from \".$GLOBALS['table_prefix'].\"usertypes where gkey_typeid='\".$utype.\"'\") or die(mysql_error()) ;\n\treturn mysql_result($usertype_rs,0,'type_slug');\n}", "public function getCountByType();", "public function getVehicleSpareTyres($busId,$typeId) {\n \n $query = \"\t\n\t\t\t\t\tSELECT \n\t\t\t\t\t\t\t\ttm.tyreId,\n\t\t\t\t\t\t\t\ttm.tyreNumber\n\t\t\t\t\tFROM\t\ttyre_master tm, tyre_history th\n\t\t\t\t\tWHERE\t\ttm.tyreId = th.tyreId\n\t\t\t\t\tAND\t\t\ttm.isActive = 1\n\t\t\t\t\tAND\t\t\tth.busId = $busId\n\t\t\t\t\tAND\t\t\tth.usedAsMainTyre = $typeId\";\n\n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }", "public function index(AccommodationUnitTypeListRequest $request, AccommodationUnitType $unitType)\n {\n $unitType = $unitType->withTranslation()->paginate(50);\n\n return view('accommodation::accommodation.unit.type.list', compact('unitType'));\n }", "public function findByType(string $type): array;", "public function getAllTypes()\n {\n return $this->fetchAll('SELECT * FROM room_type');\n }", "function fetchItemsByType($type,$userid){\n\t\t\t\n\t\t\tif(isset($type) && isset($userid)):\n\t\t\t\n\t\t\t\treturn $this->FURY->db->query(\"\n\t\t\t\t\tSELECT inventory.*,it.name,it.type FROM inventory \n\t\t\t\t\tINNER JOIN items it \n\t\t\t\t\tON it.id=inventory.itemid \n\t\t\t\t\tWHERE it.type='$type' \n\t\t\t\t\tAND inventory.userid='$userid'\n\t\t\t\t\tORDER BY inventory.quantity DESC\n\t\t\t\t\t\")->rows();\n\t\t\t\n\t\t\tendif;\n\t\t\t\n\t\t}", "public function listAllUnitTypes($propertyId)\n {\n $request = new ListAllUnitTypesRequest($propertyId);\n return $this->send($request);\n }", "public function getUnitsAction()\n {\n // get action from id in url\n $actionChosen = $this->params()->fromRoute('id', 0);\n \n // get units for that action\n if ($actionChosen == 'View'){\n $results = $this->getGenericQueries()->getUnits();\n }\n else{\n $results = $this->getGenericQueries()->getUnitsByPrivId($this->userID);\n }\n \n // iterate through results forming a php array\n foreach ($results as $result){\n $unitData[] = $result;\n }\n \n // encode results as json object\n $jsonData = new JsonModel($unitData);\n return $jsonData;\n }", "function getUnites($idJoueur){\n\t\tinclude(\"connBdd.php\");\n\t\t$query = \"SELECT unites FROM joueurs WHERE idJoueur='$idJoueur'\";\n\t\t$result = mysql_query($query) or die(\"Query error dans getUnites: \". mysql_error());\n\t\tif(mysql_num_rows($result) != 0){\n\t\t\t$unitesNS = mysql_result($result,0);\n\t\t\t$unites = unserialize($unitesNS);\n\t\t\tif ($unites == \"\"){\n\t\t\t\t$unites = array();\n\t\t\t}\n\t\t}else{\n\t\t\t$unites = array();\n\t\t}\n\t\treturn($unites);\n\t}", "public function listUnitTypeAvailability($unitTypeId, \\DateTime $dateFrom, \\DateTime $dateTo)\n {\n $request = new ListUnitTypeAvailabilityRequest($unitTypeId);\n $request->setDateFrom($dateFrom->format('Y-m-d'));\n $request->setDateTo($dateTo->format('Y-m-d'));\n return $this->send($request);\n }", "function get_all_measure() {\n\n return array(\n 'kg', 'm', 'm kb', 'gr', 'pcs', 'unit'\n );\n}", "public function typeIndex()\n {\n $types = Type::where('estatud',\"=\",'1')->get();\n return $types;\n }", "public function showUserTypes(){\n\t\t\t$query = (\"SELECT * FROM tbl_usertypes\");\n\t\t\t$result = $this->con->query($query);\n\t\t\treturn $result;\n\t\t}", "private function getMetricUnitTypesByName($name = null) {\n\t\t$clientChecklist = new clientChecklist($this->db);\n\t\t$metricUnitTypes = $clientChecklist->getMetricUnitTypesByName($name);\n\n\t\t//Error Reporting\n\t\t//(!is_null($company_name) && empty($clients)) ? $this->reportError($this->messages->invalidIdentifier, $company_name, 'company_name') : null;\n\n\t\t$this->result->metricUnitTypes = $metricUnitTypes;\n\t\t$this->returnJsonResponse($this->result);\n\n\t\treturn;\n\t}", "function get_all_unit()\n {\n $this->db->order_by('id_unit', 'desc');\n return $this->db->get('unit')->result_array();\n }", "function getTrainingUnits($uid, $city, $kind)\n{\n\t$sql = '\n\t\tSELECT count FROM dw_build_unit\n\t\tWHERE uid = '.\\util\\mysql\\sqlval($uid).'\n\t\t\tAND city = '.\\util\\mysql\\sqlval($city).'\n\t\t\tAND kind = '.\\util\\mysql\\sqlval($kind).'\n\t';\n\treturn \\util\\mysql\\query($sql);\n}", "protected function statisticsType()\n {\n $countTotalEuropeana = $this->get('dsg_model.dsgenerator')->queryCountEuropeana('*', null)[0];\n\n $types = array(\"IMAGE\", \"TEXT\", \"SOUND\", \"VIDEO\", \"3D\");\n\n /* -- COUNT COUNTRY -- */\n $typeReturn = array();\n $typeCountTotal = 0;\n foreach($types as $type) {\n $query = 'TYPE:\"'.strtoupper($type).'\"';\n $queryFacet = null;\n $responseArray = $this->get('dsg_model.dsgenerator')->queryCountEuropeana($query, $queryFacet);\n $typeCountTotal += $responseArray[0];\n $typeReturn[$type] = $responseArray[0];\n }\n\n return [$countTotalEuropeana, $typeReturn, $typeCountTotal];\n }", "public function getUIDs(){\n\t\n\t\treturn $this->find( 'list', [\n\t\t\t\t'fields' => 'UnitType.uid'\t\t\n\t\t\t]);\n\t\t\n\t}", "public function testGetTypesByOrgUnitWhichDoesNotExist()\r\n {\r\n $objGroupType = $this->service->getTypesByOrgUnitID('9999999');\r\n }", "public function get_weather($type,$woeid,$name,$unit){\r\n\t\t\r\n\t\t//Get weather information dependent from Slider options\r\n\t\t$revslider_weather = RevAddOnWeatherYahoo::get_weather_infos($type,$woeid,$name,$unit);\r\n\t\treturn $revslider_weather;\r\n\r\n\t}", "public function get_unit(){\n\t\treturn $this->v_unit;\n\t}", "public function getByType()\n\t{\n\t\treturn $this->by_type;\t \n\t}", "public function getByTypeName($type_name);", "protected function getTypes() {}", "public function getUnit()\n {\n return $this->db->select('*')\n ->from('unit u')\n ->join('category c','c.unit=u.id')\n ->where('c.delete_status',0)\n ->get()\n ->result();\n }", "function getVacanciesByType($typeid){\r\n $query = $this->db->get_where('vacancy', array('typeid' => $typeid),0, 0);\r\n return $query->result_array();\r\n }", "function getTypeList()\n\t{\n\t\t$url = '/transfers/v1/types';\n\t\t$url = $this->_client->_make_url($url);\n\t\t$req = $this->_client->_curl_init($url);\n\t\t$res = $this->_client->_curl_exec($req);\n\t\treturn $res;\n\t}", "public static function GetStatsForType( $sType )\n {\n // initialize return value\n $aTypeStats = array();\n\n // set params for the request\n $aParams = array();\n $aParams[ 'c_token' ] = self::$sConsumerToken;\n $aParams[ 'app' ] = self::$sConsumerToken;\n $aParams[ 'type' ] = $sType;\n\n // send the request\n $oRequest = new cRequest( 'curl' );\n $sResponse = $oRequest->Get( self::$sTypeStatsApi . '?' . http_build_query( $aParams ) );\n\n // if the body was valid json, save the array\n $aTempStats = json_decode( $sResponse, true );\n if( is_array( $aTempStats ) )\n {\n $aTypeStats = $aTempStats;\n }\n\n return $aTypeStats;\n }", "function get_unit($id_unit)\n {\n return $this->db->get_where('unit',array('id_unit'=>$id_unit))->row_array();\n }", "public static function names($type)\r\n {\r\n $symbol = '';\r\n $name = '';\r\n switch ($type)\r\n {\r\n case self::MINUTES:\r\n $symbol = __('min');\r\n $name = __('minutos');\r\n break;\r\n case self::UNITS:\r\n $symbol = __('pza');\r\n $name = __('piezas');\r\n break;\r\n case self::PERCENT:\r\n $symbol = __('%');\r\n $name = __('porcentaje');\r\n break;\r\n }\r\n return array('symbol' => $symbol, 'name' => $name);\r\n }", "function get_all_units()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('units')->result_array();\n }", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "function search($length,$width,$rent_type){\n\t\t//============================== CONNECT TO DATABASE ========\n\t\t$db = get_data();\n\n\t\tif($rent_type==\"monthly\"){\n\t\t\t$rent_param=\"dcStdRate\";\n\t\t}\n\t\telse{\n\t\t\t$rent_param=\"dcStdWeeklyRate\";\n\t\t}\n\t\t//================ EXECUTE QUERY WITH PARAMS ========================\n\t\t//PARAMETERS:\tsUnitName ,dcWidth ,dcLength ,\".$rent_param.\" ,bPower ,bClimate bAlarm, bRent\n\t\ttry{\t\n\t\t\t$results = $db->prepare(\"SELECT * FROM UNITS WHERE dcWidth=? AND dcLength=? AND bRented=\\\"TRUE\\\"\");\n\t\t\t//bind paramaters on the back end to prevent MySQL injection\n\t\t\t$results->bindParam(1,$width);\n\t\t\t$results->bindParam(2,$length);\n\t\t\t$results->execute();\n\t\t\t$data = $results->fetchAll();\n\t\t}\tcatch(Exception $e){\n\t\t\techo \"could not query the database\";\n\t\t\texit;\n\t\t}\n\t\treturn $data;\n\t}", "public function get_Cuputypes() {\r\n $response[\"result\"] = \"RESPONSE_ERROR\";\r\n\r\n $units_request = $this->Cuputypes_model->get_cuputypes();\r\n\r\n if ($units_request[\"result\"] == \"RESPONSE_OK\") {\r\n $containers = $units_request[\"response_data\"];\r\n if (is_array($containers)) {\r\n $indexed_units = array();\r\n foreach ($containers as $key => $value) {\r\n $indexed_units[$value[\"HardwareCode\"]] = $key;\r\n }\r\n }\r\n $response[\"result\"] = \"RESPONSE_OK\";\r\n $response[\"response_data\"][\"cuputypes\"] = $containers;\r\n $response[\"response_data\"][\"indexed_units\"] = $indexed_units;\r\n } else {\r\n $response[\"description\"] = $units_request[\"description\"];\r\n }\r\n echo json_encode($response);\r\n }", "public function getUnit(bool $ati = false);", "private function findMembers($type) {\n switch ($type) {\n case 'collections':\n return $this->findMemberCollections();\n case 'objects':\n return $this->findMemberObjects();\n case 'all':\n default:\n return $this->findAllMembers();\n }\n }", "public function get( $sFieldIDPrefix='', $sUnitType='category' ) {\n \n $_aFields = array(\n array(\n 'field_id' => $sFieldIDPrefix. 'width',\n 'type' => 'number',\n 'title' => __( 'Width', 'amazon-auto-links' ),\n 'default' => 100,\n ), \n array(\n 'field_id' => $sFieldIDPrefix .'width_unit',\n 'type' => 'select',\n 'show_title_column' => false,\n // 'title' => __( 'Width Unit', 'amazon-auto-links' ),\n 'label' => array(\n 'px' => 'px', \n '%' => '%', \n 'em' => 'em'\n ), \n 'default' => '%',\n 'description' => __( 'Set 0 for no limit.', 'amazon-auto-links' ), \n ),\n array(\n 'field_id' => $sFieldIDPrefix . 'height',\n 'type' => 'number',\n 'title' => __( 'Height', 'amazon-auto-links' ),\n 'default' => 400,\n ), \n array(\n 'field_id' => $sFieldIDPrefix . 'height_unit',\n 'type' => 'select',\n 'show_title_column' => false,\n // 'title' => __( 'Height Unit', 'amazon-auto-links' ),\n 'label' => array(\n 'px' => 'px', \n '%' => '%', \n 'em' => 'em'\n ), \n 'default' => 'px',\n 'description' => __( 'Set 0 for no limit.', 'amazon-auto-links' ), \n ), \n array(\n 'field_id' => $sFieldIDPrefix . 'available_page_types',\n 'type' => 'checkbox',\n 'title' => __( 'Available Page Types', 'amazon-auto-links' ),\n 'label' => array(\n 'home' => __( 'The home page.', 'amazon-auto-links' ),\n 'front' => __( 'The front page.', 'amazon-auto-links' ),\n 'singular' => __( 'Single pages.', 'amazon-auto-links' ),\n 'post_type_archive' => __( 'Post type archive pages.', 'amazon-auto-links' ),\n 'taxonomy' => __( 'Taxonomy archive pages.', 'amazon-auto-links' ),\n 'date' => __( 'Date archive pages.', 'amazon-auto-links' ),\n 'author' => __( 'Author pages.', 'amazon-auto-links' ),\n 'search' => __( 'Search result pages.', 'amazon-auto-links' ),\n '404' => __( 'The 404 page.', 'amazon-auto-links' ),\n ),\n 'default' => array(\n 'home' => false,\n 'front' => false,\n 'singular' => true,\n 'post_type_archive' => false,\n 'taxonomy' => false,\n 'date' => false,\n 'author' => false,\n 'search' => false,\n '404' => false,\n ),\n ), \n array()\n );\n\n \n return $_aFields;\n \n }", "public function listUserTypeData()\n {\n $userinfo = \\Modules\\Admin\\Services\\Helper\\UserInfoHelper::getAuthUserInfo();\n $user_type_id = $userinfo->user_type_id;\n $usertypeinfo = $this->getUserTypeById($user_type_id);\n $priority = (int) $usertypeinfo->priority;\n \n //For flush all cache admin users Priority permissions\n Cache::tags(UserType::table())->flush();\n \n $cacheKey = str_replace(['\\\\'], [''], __METHOD__);\n //Cache::tags not suppport with files and Database\n $response = Cache::tags(UserType::table())->remember($cacheKey, $this->ttlCache, function() use($priority) {\n\n return UserType::where('priority', '>=', $priority)->orderBY('id')->lists('name', 'id');\n });\n\n return $response;\n }", "private function listTestCasesByType($type)\n {\n $result = array();\n $testscases = $this->listTestCases();\n if ($type == 'all') {\n return $testscases;\n }\n\n foreach ($testscases as $case) {\n if ($case->type == $type) {\n array_push($result, $case);\n }\n }\n return $result;\n }", "public function listUnitTypeRates($unitTypeId, \\DateTime $dateFrom, \\DateTime $dateTo)\n {\n $request = new ListUnitTypeRatesRequest($unitTypeId);\n $request->setDateFrom($dateFrom->format('Y-m-d'));\n $request->setDateTo($dateTo->format('Y-m-d'));\n return $this->send($request);\n }", "public function getOptionsByType($type){\n\t\tif (empty($this->_optionsValues)){\n\n\t\t\t$query = Yii::app()->db->createCommand();\n\t\t\t$query->select = 'type,value';\n\t\t\t$query->from = ParamountAvailableOption::model()->tableName();\n\t\t\t$query->where('version = :version',[':version'=>self::CURRENT_VERSION]);\n\n\t\t\t$rows = $query->queryAll();\n\n\t\t\tforeach ($rows as $row) {\n\t\t\t\tif (!isset($this->_optionsValues[$row['type']]))\n\t\t\t\t\t$this->_optionsValues[$row['type']] = [];\n\n\t\t\t\t$this->_optionsValues[$row['type']][] = $row['value'];\n\t\t\t}\n\t\t}\n\n\t\tif (isset($this->_optionsValues[$type])){\n\t\t\treturn $this->_optionsValues[$type];\n\t\t}\n\n\t\treturn [];\n\t}", "public function medicine_search_type($type=null)\n\t{\n\t\t$this->db->select(\"a.*,d.*\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('manufacturer_information d','d.manufacturer_id = a.manufacturer_id','left');\n\t\t$this->db->where('a.product_model',$type);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$query = $this->db->get();\n\n\t\treturn $stok_report = $query->result_array();\n\t}", "function get_unit($unit_id)\n {\n return $this->db->get_where('tbl_unit',array('unit_id'=>$unit_id))->row_array();\n }", "public function get_all_user_type(){\n\t\t return DB::table('usertype')->where(array('status'=>0))->get();\n\t\n\t}", "private function getTypes() { return $this->types; }", "public function get($type, $pageID = -1)\n {\n $data = array();\n foreach (Redis::smembers('Statistics:' . $type) as $statisticsType) {\n if ($pageID === -1) {\n $key = 'Statistics:' . $type . ':' . $statisticsType;\n } else {\n $key = 'Statistics:Page:' . $pageID . ':' . $type . ':' . $statisticsType;\n }\n\n $data[$statisticsType]['name'] = $statisticsType;\n $data[$statisticsType]['hits'] = Redis::get($key . ':hits') ?? 0;\n $data[$statisticsType]['ipUnique'] = Redis::get($key . ':ipUnique') ?? 0;\n $data[$statisticsType]['cookieUnique'] = Redis::get($key . ':cookieUnique') ?? 0;\n }\n\n return $data;\n }", "private function getItems($getType)\n\t{\t\n\t\tglobal $DATABASE;\n\t\t$result = $DATABASE->select(\n\t\t\t\"travel_item\", \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Db name\n\t\t\tarray('[><]travel_' . $getType . '_items_join' => array('id' => 'fk_item')),\t//Join \n\t\t\tarray('travel_item.id', 'travel_' . $getType . '_items_join.quantity'),\t\t\t//Select keys\n\t\t\tarray('travel_' . $getType . '_items_join.fk_request' => $this->getID())\t\t//Where\n\t\t);\n\t\t\n\t\t$resultArray = array();\n\t\t\n\t\tforeach($result as $row)\n\t\t{\n\t\t\t$resultArray[$row['id']] = $row['quantity'];\n\t\t}\n\t\treturn $resultArray;\n\t}", "abstract public function getUnit();" ]
[ "0.7739074", "0.66070384", "0.6543", "0.6506052", "0.63696206", "0.61130166", "0.60831445", "0.59381413", "0.5909027", "0.59076774", "0.575064", "0.5681736", "0.5655733", "0.5604453", "0.56002635", "0.5597028", "0.5574626", "0.5574626", "0.556618", "0.55199015", "0.54974", "0.54657954", "0.5439678", "0.53895074", "0.5380276", "0.537263", "0.53625643", "0.5343238", "0.5303593", "0.5291668", "0.52857935", "0.5275648", "0.5273103", "0.526554", "0.5233103", "0.52305967", "0.5205142", "0.5183904", "0.5179285", "0.5169205", "0.51662076", "0.51566327", "0.5156225", "0.51482385", "0.5128343", "0.51239246", "0.5104944", "0.5104573", "0.5101067", "0.50987846", "0.509859", "0.5095293", "0.5083512", "0.5082433", "0.5080131", "0.5063461", "0.5057006", "0.5055981", "0.5040163", "0.5024983", "0.502484", "0.50178546", "0.50177085", "0.5000908", "0.4992056", "0.49883786", "0.49816495", "0.4977549", "0.49745116", "0.49640074", "0.49469575", "0.4945242", "0.49404073", "0.49366215", "0.4927594", "0.49220192", "0.49206936", "0.49201247", "0.4904669", "0.4903218", "0.4903218", "0.4903218", "0.4903218", "0.4903218", "0.49016702", "0.4900333", "0.49000472", "0.48946878", "0.48785952", "0.48759592", "0.48712912", "0.48672006", "0.48639026", "0.48610196", "0.4857938", "0.48524117", "0.4851292", "0.48474455", "0.48415434", "0.4820633" ]
0.7840672
0
Units_GetByClass get all units of type $vType
Units_GetByClass получает все единицы типа $vType
function Units_GetByClass($vClass, $vAllInfo = false) { if ($vAllInfo) { $vSQL = 'select * from units where name in (select name from units where field="className" and content="' . $vClass . '")'; } else { $vSQL = "select * from units where field in ('name','type','code','buyable','class','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name in (select name from units where field='className' and content='" . $vClass . "')"; } $vResult = @$_SESSION['vDataDB']->query($vSQL); while ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC)) { $vReturn[$vRow['name']][$vRow['field']] = $vRow['content']; } return($vReturn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUnitsForType($type);", "function Units_GetByType($vType, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name in (select name from units where field=\"type\" and content=\"' . $vType . '\")';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','class','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name in (select name from units where field='type' and content='\" . $vType . \"')\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['name']][$vRow['field']] = $vRow['content'];\n\t}\n\treturn($vReturn);\n}", "public function getUnitOf(string $className): Unit\n {\n return $this->units[$className];\n }", "static public function unitTypes(){\n $tmp = Steam_MeasurementSystem::getInstance();\n return $tmp->unitTypes;\n }", "function getUnits($kind, $uid)\n{\n \treturn \\dal\\unit\\getUnits($kind, $uid);\n}", "public static function getUnitPlugins($type) {\n $manager = self::unitPluginManager();\n $units = [];\n\n foreach ($manager->getDefinitions() as $id => $plugin) {\n if ($plugin['type'] == $type) {\n $units[$id] = $manager->createInstance($id, $plugin);\n }\n }\n\n return $units;\n }", "public function getUnits() {\n $var = 'units_' . $this->current_unit_system;\n return $this->$var;\n }", "function Units_GetByField($vField, $vType, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name in (select name from units where field=\"' . $vField . '\" and content=\"' . $vType . '\")';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','class','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name in (select name from units where field='\" . $vField . \"' and content='\" . $vType . \"')\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['name']][$vRow['field']] = $vRow['content'];\n\t}\n\treturn($vReturn);\n}", "public function getUnits()\n {\n\n $query=$this->db->get('unit');\n return $query->result();\n }", "public function unitClassGetUnits($web_id, $selected_fields = null)\r\n {\r\n list($response) = $this->unitClassGetUnitsWithHttpInfo($web_id, $selected_fields);\r\n return $response;\r\n }", "public static function getUnits($status){\n \n global $DB;\n \n if (!in_array($status, array('active', 'inactive'))){\n return false;\n }\n \n $statusSQL = ($status == 'active') ? 'IS NOT NULL' : 'IS NULL';\n \n $obj = new \\GT\\Statistics();\n \n $records = $DB->get_records_sql(\"SELECT DISTINCT CONCAT(s.id, '_', u.id) as id, s.name, u.id as unitid\n FROM {bcgt_qual_structures} s\n INNER JOIN {bcgt_units} u ON u.structureid = s.id\n LEFT JOIN {bcgt_qual_units} qu ON qu.unitid = u.id\n WHERE s.deleted = 0 AND u.deleted = 0\n AND qu.id {$statusSQL}\n ORDER BY s.name, u.name\"); \n \n $obj->setRecords($records);\n \n return $obj;\n \n }", "public static function getUnits()\r\n\t{\r\n\t\treturn Website_Model_MysqlTable::getEnumValues('component','unit');\r\n\t}", "public static function defaultUnits($type = false){\n $defaultUnits = array(\n 'Imperial' => array(\n 'pressure' => 'psig', \n 'vacuum' => 'psia', \n 'temperature' => 'F', \n 'specificEnthalpy' => 'btu/lbm', \n 'specificEntropy' => 'btu/lbm/R', \n 'massflow' => 'klb/hr', \n 'energyflow' => 'MMBtu/hr', \n 'energy' => 'MMBtu',\n 'power' => 'kW',\n 'electricity' => 'kWh',\n 'volume' => 'gal', \n 'volumeflow' => 'gpm', \n 'density' => 'lb/ft3',\n 'specificVolume' => 'ft3/lb',\n ), \n 'SI' => array(\n 'pressure' => 'barg', \n 'vacuum' => 'bara', \n 'temperature' => 'C', \n 'specificEnthalpy' => 'kJ/kg', \n 'specificEntropy' => 'kJ/kg/K', \n 'massflow' => 't/hr', \n 'energyflow' => 'kW',\n 'energy' => 'Nm3',\n 'power' => 'kW',\n 'electricity' => 'kWh',\n 'volume' => 'l', \n 'volumeflow' => 'lpm', \n 'density' => 'g/m3',\n 'specificVolume' => 'm3/kg',\n ), \n 'Chinese' => array(\n 'pressure' => 'barg', \n 'vacuum' => 'bara', \n 'temperature' => 'C', \n 'specificEnthalpy' => 'kJ/kg', \n 'specificEntropy' => 'kJ/kg/K', \n 'massflow' => 't/hr', \n 'energyflow' => 'TCE/hr',\n 'energy' => 'TCE',\n 'power' => 'kW',\n 'electricity' => 'kWh',\n 'volume' => 'l', \n 'volumeflow' => 'lpm', \n 'density' => 'g/m3',\n 'specificVolume' => 'm3/kg',\n ), \n 'testSystem' => array(\n 'pressure' => 'test:pressure', \n 'vacuum' => 'test:vacuum', \n 'temperature' => 'test:temperature', \n 'specificEnthalpy' => 'test:specificEnthalpy', \n 'specificEntropy' => 'test:specificEntropy', \n 'massflow' => 'test:massflow', \n 'energyflow' => 'test:energyflow',\n 'energy' => 'test:energy',\n 'power' => 'test:power',\n 'electricity' => 'test:elec',\n 'volume' => 'test:volume', \n 'volumeflow' => 'test:volumeflow', \n 'density' => 'test:density',\n 'specificVolume' => 'm3/kg',\n )\n );\n unset($defaultUnits['testSystem']);\n if ($type){\n return $defaultUnits[$type];\n }\n return $defaultUnits;\n }", "function unitPrices($kind)\n{\n\t$sql = '\n\t\tSELECT * FROM dw_costs_u\n\t\tWHERE kind = '.\\util\\mysql\\sqlval($kind).'\n\t';\n\treturn \\util\\mysql\\query($sql);\n}", "public function getUnit()\n {\n return $this->db->select('*')\n ->from('unit u')\n ->join('category c','c.unit=u.id')\n ->where('c.delete_status',0)\n ->get()\n ->result();\n }", "function Units_GetAll($vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','className','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc')\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['name']][$vRow['field']] = $vRow['content'];\n\t}\n\treturn($vReturn);\n}", "function get_all_units($params = array())\n {\n $this->db->order_by('unit_name', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('tbl_unit')->result_array();\n }", "public function units()\n {\n return $this->hasMany(Unit::class);\n }", "public function excelUnits($unitType){\n if ($unitType == 'temperature') return $this->conversions[$unitType][$this->selected[$unitType]][5];\n if ($unitType == 'specificVolume') return $this->conversions[$unitType][$this->selected[$unitType]][0];\n if ($unitType == 'density') return $this->conversions[$unitType][$this->selected[$unitType]][0];\n if ($unitType == 'volume' or $unitType == 'volumeflow') return $this->conversions[$unitType][$this->selected[$unitType]][0];\n return $this->conversions[$unitType][$this->selected[$unitType]][3];\n }", "function Units_GetUnitByName($vName, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name=\"' . $vName . '\"';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','className','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name='$vName'\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = $vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['field']] = $vRow['content'];\n\t}\n\treturn(@$vReturn);\n}", "public function getUnitValues()\n {\n /*$measures = ArrayHelper::map(Measurement::find()->all(), 'short_name',\n function(Measurement $data) use (&$results){\n $results[$data->type][$data->short_name] = $data->name;\n return $data->name;\n });*/\n $results = [\n 'Pack'=>[\n 'CS'=>'Case',\n 'EA'=>'Each',\n ],\n ];\n\n $this->getMeasurementItems()->indexBy(function(MeasurementItem $data) use (&$results){\n $results['Alternative']['alt:'.$data->id] = $data->name;\n })->all();\n\n Measurement::find()->indexBy(function(Measurement $data) use (&$results){\n $results[$data->type][$data->id] = $data->name;\n })->all();\n\n return $results;\n }", "public function getSystemList($type);", "public function getUnitsAction()\n {\n // get action from id in url\n $actionChosen = $this->params()->fromRoute('id', 0);\n \n // get units for that action\n if ($actionChosen == 'View'){\n $results = $this->getGenericQueries()->getUnits();\n }\n else{\n $results = $this->getGenericQueries()->getUnitsByPrivId($this->userID);\n }\n \n // iterate through results forming a php array\n foreach ($results as $result){\n $unitData[] = $result;\n }\n \n // encode results as json object\n $jsonData = new JsonModel($unitData);\n return $jsonData;\n }", "public function units()\n {\n return $this->hasMany(ItemUnit::class);\n }", "public function getUnits($unit){\n\t\t//check that unit exists\n\t\tif(array_key_exists($unit, $this->units)){\n\t\t\t//find base unit\n\t\t\t$baseUnit = $this->units[$unit][\"base\"];\n\n\t\t\t$unitList = array();\n\t\t\t//find all units that are linked to the base unit\n\t\t\tforeach ($this->units as $key => $values) {\n\t\t\t\tif($values[\"base\"] == $baseUnit){\n\t\t\t\t\tarray_push($unitList, $key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $unitList;\n\t\t}else{\n\t\t\tthrow new Exception(\"Unit Does Not Exist\");\n\t\t}\n\t}", "public function getUnits($select){\n\t\t$options='';\n\t\tforeach($this->unitModel->getUnits() as $key => $value){\n\t\t\tif($select == $key){\n\t\t\t\t$options .= '<option value=\"'.$key.'\" selected>'.$key.'</option>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$options .= '<option value=\"'.$key.'\">'.$key.'</option>';\n\t\t\t}\t\t\n\t\t}\n\t\treturn $options;\n\t}", "public function getUnits($select){\n\t\t$options='';\n\t\tforeach($this->unitModel->getUnits() as $key => $value){\n\t\t\tif($select == $key){\n\t\t\t\t$options .= '<option value=\"'.$key.'\" selected>'.$key.'</option>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$options .= '<option value=\"'.$key.'\">'.$key.'</option>';\n\t\t\t}\t\t\n\t\t}\n\t\treturn $options;\n\t}", "public function getUnits()\n{\n return $this->Units;\n}", "public function getUnit()\n {\n \treturn $this->get(['unit_code','unit_symbol']);\n }", "public function index()\n {\n $type_units = $this->type_unit->all();\n return response([\n 'status' => true,\n 'typeUnits' => $type_units\n ], 200);\n }", "public function getAllWithType($type);", "public function units() # For demo purposes\n {\n global $DATA;\n # Side menu ID that should be highlighted\n $DATA[\"current_menu\"] = \"Units\";\n # Displayed in on the begining of the page\n $DATA[\"page_header\"] = \"All Units\";\n # Name of the tab in browser\n $DATA[\"page_title\"] = $DATA[\"page_header\"] .BLIO_TITLE;\n\n\n $districts = new DistrictModel();\n $ud = new UnitDistModel();\n $session = \\Config\\Services::session();\n\n # Find a District of a Manager\n $district = $districts->getDistrictByUser($DATA[\"user\"]->id);\n\n # Get all units associated with the district\n $units = $ud->getUnitsFromDistrict($district[\"id\"]);\n $DATA[\"units_all\"] = $units;\n $DATA[\"flashdata\"] = $session->getFlashdata();\n\n # Displaying Header\n echo view(\"dashboard/header\", $DATA);\n echo view(\"dashboard/units\", $DATA);\n echo view(\"dashboard/footer\", $DATA);\n }", "function get_all_unit()\n {\n $this->db->order_by('id_unit', 'desc');\n return $this->db->get('unit')->result_array();\n }", "public function get_unit(){\n\t\treturn $this->v_unit;\n\t}", "function get_unit($id)\n {\n return $this->db->get_where('units',array('id'=>$id))->row_array();\n }", "public function getPurchaseItemUnitPrice($type, $id, array $attributeValues);", "function getUnits() {\n\t\tglobal $DB_LINK, $db_table_units;\n\t\t$units = array();\n\t\t$sql = \"SELECT unit_id, unit_desc, unit_abbr FROM $db_table_units\";\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\t\twhile (!$rc->EOF) {\n\t\t\t$id = $rc->fields['unit_id'];\n\t\t\t$units[$id] = array( $rc->fields['unit_desc'], $rc->fields['unit_abbr'] );\n\t\t\t$rc->MoveNext();\n\t\t}\n\t\treturn $units;\n\t}", "public function listAllUnitTypes($propertyId)\n {\n $request = new ListAllUnitTypesRequest($propertyId);\n return $this->send($request);\n }", "private function parseIdsToUnitRefunds(array $units, RefundType $refundType, string $unitRefundClass): array\n {\n $refundUnits = [];\n foreach ($units as $id => $unit) {\n $total = $this\n ->unitRefundTotalCalculator\n ->calculateForUnitWithIdAndType($id, $refundType, $this->getAmount($unit))\n ;\n\n $refundUnits[] = new $unitRefundClass((int) $id, $total);\n }\n\n return $refundUnits;\n }", "protected function buildUnit($key, $unitClass)\n {\n $configs = $this->app['config']->get(\"units.$key\", []);\n\n return new $unitClass(\n 0, Arr::get($configs, 'default'), Arr::except($configs, ['default'])\n );\n }", "public function get_cuputypes() {\r\n $response[\"result\"] = \"RESPONSE_OK\";\r\n $this->db->select(\"CUPU_types.*\");\r\n $this->db->from('CUPU_types');\r\n\r\n $units_query = $this->db->get();\r\n $units_array = $units_query->result_array();\r\n $response[\"response_data\"] = $units_array;\r\n return $response;\r\n }", "public function units()\n {\n return $this->hasMany('App\\Unit');\n }", "function get_all_units()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('units')->result_array();\n }", "public function unitsProvider()\n {\n return array(\n array(5, 2, 0, -10, 1, 3, -5),\n array(0, 0, 0, 0, 0, 0, 3600),\n array(1, 0, 0, 0, 0, 0, 0),\n array(0, 0, 0, 0, 0, 0, 0),\n array(0, 0, 1, 0, 0, 0, 0),\n array(-1, -1, -1, -1, -1, -1, -1),\n array(rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100), rand(0, 100)),\n );\n }", "function model()\n {\n return GoodsUnit::class;\n }", "function available_units(){\n\t\t$db = get_data();\n\t\ttry{\n\t\t\t$results = $db->query(\"SELECT * FROM units_info WHERE TotalVacant!=0\");\n\t\t\t// $results->bindParam(0,$width);\n\t\t\t// $results->bindParam(1,$length);\n\t\t\t$data = $results->fetchAll();\n\t\t}\tcatch(Exception $e){\n\t\t\techo \"could not query the database\";\n\t\t\texit;\n\t\t}\n\t\treturn $data;\n\t}", "public function testGetTypesByOrgUnit()\r\n {\r\n $grouptype_ouid = $this->config['phpunit']['live']['group_type']['ouid'];\r\n $offering_ouid = $this->config['phpunit']['live']['course_offering']['ouid'];\r\n \r\n $objGroupTypes = $this->service->getTypesByOrgUnitID($offering_ouid);\r\n $this->assertInternalType('array', $objGroupTypes);\r\n $this->assertContainsOnly('D2LWS_OrgUnit_Group_Type_Model', $objGroupTypes);\r\n $this->assertArrayHasKey($grouptype_ouid, $objGroupTypes);\r\n \r\n return $objGroupTypes;\r\n }", "public function getMyUnits(){\r\n try{\r\n $db = new Database();\r\n $conn = $db->connection();\r\n if(gettype($conn) !== \"object\"){\r\n return [];\r\n }\r\n $sql = \"SELECT * FROM units where course = ? and year_of_study=? and semester=?\";\r\n $query = $conn->prepare($sql);\r\n $course = $this->course;\r\n $year = $this->year_of_study;\r\n $sem = $this->semester;\r\n if(!$query){\r\n return [];\r\n }\r\n $query->execute(array($course, $year, $sem));\r\n $records = $query->fetchAll(PDO::FETCH_CLASS, \"Unit\");\r\n if(zero($records)){\r\n return [];\r\n }\r\n $res = [];\r\n foreach($records as $record){\r\n if(zero($record->getLecturer())){\r\n continue;\r\n }\r\n array_push($res, $record);\r\n }\r\n return $res;\r\n }catch(Exception $ex){\r\n return [];\r\n }\r\n }", "function get_unit($id_unit)\n {\n return $this->db->get_where('unit',array('id_unit'=>$id_unit))->row_array();\n }", "function getAllByType($type) {\n $dataModel = $this->valueModels[$type];\n return $this->$dataModel->find('all');\n }", "public function getUIDs(){\n\t\n\t\treturn $this->find( 'list', [\n\t\t\t\t'fields' => 'UnitType.uid'\t\t\n\t\t\t]);\n\t\t\n\t}", "function getAll() {\r\n\t\t$cond = new Criteria();\r\n\t\t$alls = UnitPeer::doSelect($cond);\r\n\t\treturn $alls;\r\n }", "public function getAll($mgr, $type){\n switch ($type){\n case \"boeken\":\n $lijst = BoekService::getBoekenOverzicht($mgr);\n break;\n case \"films\":\n $lijst = FilmService::getFilmOverzicht($mgr);\n break;\n default :\n $lijst = ProductDao::getAll($mgr); \n break;\n }\n return $lijst;\n }", "public function getUnits()\n {\n return view('administrator.' . $this->data['module'] . '.' . 'index', ['data' => $this->data]);\n }", "function getUnit() {return $this->_unit; }", "function Units_GetUnitByCode($vCode, $vAllInfo = false)\n{\n\treturn(Units_GetUnitByName(Units_GetNameByCode($vCode), $vAllInfo));\n}", "public function unitClassGet($web_id, $selected_fields = null)\r\n {\r\n list($response) = $this->unitClassGetWithHttpInfo($web_id, $selected_fields);\r\n return $response;\r\n }", "public function unitClassGetByPath($path, $selected_fields = null)\r\n {\r\n list($response) = $this->unitClassGetByPathWithHttpInfo($path, $selected_fields);\r\n return $response;\r\n }", "abstract public function getUnit();", "public function getUnitCollection()\n{\n return $this->UnitCollection;\n}", "public function listUnitTypeRestrictions($unitTypeId, \\DateTime $dateFrom, \\DateTime $dateTo)\n {\n $request = new ListUnitTypeRestrictionsRequest($unitTypeId);\n $request->setDateFrom($dateFrom->format('Y-m-d'));\n $request->setDateTo($dateTo->format('Y-m-d'));\n return $this->send($request);\n }", "function get_unit($unit_id)\n {\n return $this->db->get_where('tbl_unit',array('unit_id'=>$unit_id))->row_array();\n }", "function defineUnits(){\n\n\t\t$this->units = array(\n\t\t///////Units Of Length///////\n\t\t\"m\"=>array(\"base\"=>\"m\", \"conversion\"=>1), //meter - base unit for distance\n\t\t\"km\"=>array(\"base\"=>\"m\", \"conversion\"=>1000), //kilometer\n\t\t\"dm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.1), //decimeter\n\t\t\"cm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.01), //centimeter\n\t\t\"mm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.001), //milimeter\n\t\t\"μm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.000001), //micrometer\n\t\t\"nm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.000000001), //nanometer\n\t\t\"pm\"=>array(\"base\"=>\"m\", \"conversion\"=>0.000000000001), //picometer\n\t\t\"in\"=>array(\"base\"=>\"m\", \"conversion\"=>0.0254), //inch\n\t\t\"ft\"=>array(\"base\"=>\"m\", \"conversion\"=>0.3048), //foot\n\t\t\"yd\"=>array(\"base\"=>\"m\", \"conversion\"=>0.9144), //yard\n\t\t\"mi\"=>array(\"base\"=>\"m\", \"conversion\"=>1609.344), //mile\n\t\t\"h\"=>array(\"base\"=>\"m\", \"conversion\"=>0.1016), //hand\n\t\t\"ly\"=>array(\"base\"=>\"m\", \"conversion\"=>9460730472580800), //lightyear\n\t\t\"au\"=>array(\"base\"=>\"m\", \"conversion\"=>149597870700), //astronomical unit\n\t\t\"pc\"=>array(\"base\"=>\"m\", \"conversion\"=>30856775814913672.789139379577965), //parsec\n\n\n\t\t///////Units Of Area///////\n\t\t\"m2\"=>array(\"base\"=>\"m2\", \"conversion\"=>1), //meter square - base unit for area\n\t\t\"km2\"=>array(\"base\"=>\"m2\", \"conversion\"=>1000000), //kilometer square\n\t\t\"cm2\"=>array(\"base\"=>\"m2\", \"conversion\"=>0.0001), //centimeter square\n\t\t\"mm2\"=>array(\"base\"=>\"m2\", \"conversion\"=>0.000001), //milimeter square\n\t\t\"ft2\"=>array(\"base\"=>\"m2\", \"conversion\"=>0.092903), //foot square\n\t\t\"mi2\"=>array(\"base\"=>\"m2\", \"conversion\"=>2589988.11), //mile square\n\t\t\"ac\"=>array(\"base\"=>\"m2\", \"conversion\"=>4046.86), //acre\n\t\t\"ha\"=>array(\"base\"=>\"m2\", \"conversion\"=>10000), //hectare\n\n\t\t///////Units Of Volume///////\n\t\t\"l\"=>array(\"base\"=>\"l\", \"conversion\"=>1), //litre - base unit for volume\n\t\t\"ml\"=>array(\"base\"=>\"l\", \"conversion\"=>0.001), //mililitre\n\t\t\"m3\"=>array(\"base\"=>\"l\", \"conversion\"=>1), //meters cubed\n\t\t\"pt\"=>array(\"base\"=>\"l\", \"conversion\"=>0.56826125), //pint\n\t\t\"gal\"=>array(\"base\"=>\"l\", \"conversion\"=>4.405), //gallon\n\n\t\t///////Units Of Weight///////\n\t\t\"kg\"=>array(\"base\"=>\"kg\", \"conversion\"=>1), //kilogram - base unit for weight\n\t\t\"g\"=>array(\"base\"=>\"kg\", \"conversion\"=>0.001), //gram\n\t\t\"mg\"=>array(\"base\"=>\"kg\", \"conversion\"=>0.000001), //miligram\n\t\t\"N\"=>array(\"base\"=>\"kg\", \"conversion\"=>9.80665002863885), //Newton (based on earth gravity)\n\t\t\"st\"=>array(\"base\"=>\"kg\", \"conversion\"=>6.35029), //stone\n\t\t\"lb\"=>array(\"base\"=>\"kg\", \"conversion\"=>0.453592), //pound\n\t\t\"oz\"=>array(\"base\"=>\"kg\", \"conversion\"=>0.0283495), //ounce\n\t\t\"t\"=>array(\"base\"=>\"kg\", \"conversion\"=>1000), //metric tonne\n\t\t\"ukt\"=>array(\"base\"=>\"kg\", \"conversion\"=>1016.047), //UK Long Ton\n\t\t\"ust\"=>array(\"base\"=>\"kg\", \"conversion\"=>907.1847), //US short Ton\n\n\t\t//////Units Of Speed///////\n\t\t\"mps\"=>array(\"base\"=>\"mps\", \"conversion\"=>1), //meter per seond - base unit for speed\n\t\t\"kph\"=>array(\"base\"=>\"mps\", \"conversion\"=>0.44704), //kilometer per hour\n\t\t\"mph\"=>array(\"base\"=>\"mps\", \"conversion\"=>0.277778), //kilometer per hour\n\n\t\t///////Units Of Rotation///////\n\t\t\"deg\"=>array(\"base\"=>\"deg\", \"conversion\"=>1), //degrees - base unit for rotation\n\t\t\"rad\"=>array(\"base\"=>\"deg\", \"conversion\"=>57.2958), //radian\n\n\t\t///////Units Of Temperature///////\n\t\t\"k\"=>array(\"base\"=>\"k\", \"conversion\"=>1), //kelvin - base unit for distance\n\t\t\"c\"=>array(\"base\"=>\"k\", \"conversion\"=>function($val, $tofrom){return $tofrom ? $val - 273.15 : $val + 273.15;}), //celsius\n\t\t\"f\"=>array(\"base\"=>\"k\", \"conversion\"=>function($val, $tofrom){return $tofrom ? ($val * 9/5 - 459.67) : (($val + 459.67) * 5/9);}), //Fahrenheit\n\n\t\t///////Units Of Pressure///////\n\t\t\"pa\"=>array(\"base\"=>\"Pa\", \"conversion\"=>1), //Pascal - base unit for Pressure\n\t\t\"kpa\"=>array(\"base\"=>\"Pa\", \"conversion\"=>1000), //kilopascal\n\t\t\"mpa\"=>array(\"base\"=>\"Pa\", \"conversion\"=>1000000), //megapascal\n\t\t\"bar\"=>array(\"base\"=>\"Pa\", \"conversion\"=>100000), //bar\n\t\t\"mbar\"=>array(\"base\"=>\"Pa\", \"conversion\"=>100), //milibar\n\t\t\"psi\"=>array(\"base\"=>\"Pa\", \"conversion\"=>6894.76), //pound-force per square inch\n\n\t\t///////Units Of Time///////\n\t\t\"s\"=>array(\"base\"=>\"s\", \"conversion\"=>1), //second - base unit for time\n\t\t\"year\"=>array(\"base\"=>\"s\", \"conversion\"=>31536000), //year - standard year\n\t\t\"month\"=>array(\"base\"=>\"s\", \"conversion\"=>18748800), //month - 31 days\n\t\t\"week\"=>array(\"base\"=>\"s\", \"conversion\"=>604800), //week\n\t\t\"day\"=>array(\"base\"=>\"s\", \"conversion\"=>86400), //day\n\t\t\"hr\"=>array(\"base\"=>\"s\", \"conversion\"=>3600), //hour\n\t\t\"min\"=>array(\"base\"=>\"s\", \"conversion\"=>30), //minute\n\t\t\"ms\"=>array(\"base\"=>\"s\", \"conversion\"=>0.001), //milisecond\n\t\t\"μs\"=>array(\"base\"=>\"s\", \"conversion\"=>0.000001), //microsecond\n\t\t\"ns\"=>array(\"base\"=>\"s\", \"conversion\"=>0.000000001), //nanosecond\n\n\t\t///////Units Of Power///////\n\t\t\"j\"=>array(\"base\"=>\"j\", \"conversion\"=>1), //joule - base unit for energy\n\t\t\"kj\"=>array(\"base\"=>\"j\", \"conversion\"=>1000), //kilojoule\n\t\t\"mj\"=>array(\"base\"=>\"j\", \"conversion\"=>1000000), //megajoule\n\t\t\"cal\"=>array(\"base\"=>\"j\", \"conversion\"=>4184), //calorie\n\t\t\"Nm\"=>array(\"base\"=>\"j\", \"conversion\"=>1), //newton meter\n\t\t\"ftlb\"=>array(\"base\"=>\"j\", \"conversion\"=>1.35582), //foot pound\n\t\t\"whr\"=>array(\"base\"=>\"j\", \"conversion\"=>3600), //watt hour\n\t\t\"kwhr\"=>array(\"base\"=>\"j\", \"conversion\"=>3600000), //kilowatt hour\n\t\t\"mwhr\"=>array(\"base\"=>\"j\", \"conversion\"=>3600000000), //megawatt hour\n\t\t\"mev\"=>array(\"base\"=>\"j\", \"conversion\"=>0.00000000000000016), //mega electron volt\n\t\t);\n}", "public static function build($class='')\n {\n if ($class) {\n $list = DataObject::get($class);\n $count = $list->count();\n for ($i = 0; $i < $count; $i += 10) {\n $chunk = $list->limit(10, $i);\n//\t\t\t\tif (Controller::curr() instanceof TaskRunner) echo \"Processing VFI #$i...\\n\";\n foreach ($chunk as $rec) {\n $rec->rebuildVFI();\n }\n }\n } else {\n foreach (self::get_classes_with_vfi() as $c) {\n self::build($c);\n }\n }\n }", "public static function get_items($class, $page = 1)\n {\n return static::inst()->getItems($class, $page);\n }", "public function get_all_units(Request $request)\n {\n\n $offset=$request->offset_id;\n $user_id=$request->user_id;\n if (auth()->user()->id == $user_id)\n $units = Unit::where('user_id', $user_id)->skip($offset)->take(10)->get();\n else\n $units= Unit::where('user_id',$user_id)->where('activation_admin', 'active')->where('activation_user', 'active')->orderBy('created_at', 'desc')->skip($offset)->take(10)->get();\n return UnitCollection::collection($units);\n }", "public function getSubunits();", "function getCookingUnits(){\n\t$Units = array();\n\t\n\t$Units[] = \"teaspoon\"; \n\t$Units[] = \"t\"; \n\t$Units[] = \"tsp.\"; \n\t\n\t$Units[] = \"ounce\";\n\t$Units[] = \"oz\";\n\t$Units[] = \"oz.\";\n\t \n\t\n\t\n\t$Units[] = \"pounds\";\n\t$Units[] = \"pound\"; \n\t$Units[] = \"lb\"; \n\t$Units[] = \"lbs\"; \n\t$Units[] = \"lb.\"; \n\t$Units[] = \"lbs.\"; \n\t\n\t$Units[] = \"tablespoon\"; \n\t$Units[] = \"T\"; \n\t$Units[] = \"tbl.\"; \n\t$Units[] = \"tbs.\"; \n\t$Units[] = \"tbsp.\"; \n\t\n\t$Units[] = \"fluid ounce\"; \n\t$Units[] = \"fl oz\";\n\t \n\t$Units[] = \"gill\"; \n\t\n\t$Units[] = \"cup\"; \n\t$Units[] = \"c\"; \n\t$Units[] = \"c.\"; \n\t\n\t$Units[] = \"pint\"; \n\t$Units[] = \"p\"; \n\t$Units[] = \"pt\"; \n\t$Units[] = \"fl pt\"; \n\t$Units[] = \"\"; \n\t\n\t$Units[] = \"quart\"; \n\t$Units[] = \"q\"; \n\t$Units[] = \"qt\"; \n\t$Units[] = \"fl\"; \n\t$Units[] = \"qt\";\n\t \n\t$Units[] = \"gallon\"; \n\t$Units[] = \"g\"; \n\t$Units[] = \"gal\"; \n\t\n\t$Units[] = \"ml\"; \n\t$Units[] = \"milliliter\"; \n\t$Units[] = \"millilitre\"; \n\t$Units[] = \"cc\"; \n\t$Units[] = \"mL\"; \n\t\n\t$Units[] = \"l\"; \n\t$Units[] = \"liter\"; \n\t$Units[] = \"litre\"; \n\t$Units[] = \"L\"; \n\t\n\treturn $Units;\t\n}", "public function get( $sFieldIDPrefix='', $sUnitType='category' ) {\n \n $_aFields = array(\n array(\n 'field_id' => $sFieldIDPrefix. 'width',\n 'type' => 'number',\n 'title' => __( 'Width', 'amazon-auto-links' ),\n 'default' => 100,\n ), \n array(\n 'field_id' => $sFieldIDPrefix .'width_unit',\n 'type' => 'select',\n 'show_title_column' => false,\n // 'title' => __( 'Width Unit', 'amazon-auto-links' ),\n 'label' => array(\n 'px' => 'px', \n '%' => '%', \n 'em' => 'em'\n ), \n 'default' => '%',\n 'description' => __( 'Set 0 for no limit.', 'amazon-auto-links' ), \n ),\n array(\n 'field_id' => $sFieldIDPrefix . 'height',\n 'type' => 'number',\n 'title' => __( 'Height', 'amazon-auto-links' ),\n 'default' => 400,\n ), \n array(\n 'field_id' => $sFieldIDPrefix . 'height_unit',\n 'type' => 'select',\n 'show_title_column' => false,\n // 'title' => __( 'Height Unit', 'amazon-auto-links' ),\n 'label' => array(\n 'px' => 'px', \n '%' => '%', \n 'em' => 'em'\n ), \n 'default' => 'px',\n 'description' => __( 'Set 0 for no limit.', 'amazon-auto-links' ), \n ), \n array(\n 'field_id' => $sFieldIDPrefix . 'available_page_types',\n 'type' => 'checkbox',\n 'title' => __( 'Available Page Types', 'amazon-auto-links' ),\n 'label' => array(\n 'home' => __( 'The home page.', 'amazon-auto-links' ),\n 'front' => __( 'The front page.', 'amazon-auto-links' ),\n 'singular' => __( 'Single pages.', 'amazon-auto-links' ),\n 'post_type_archive' => __( 'Post type archive pages.', 'amazon-auto-links' ),\n 'taxonomy' => __( 'Taxonomy archive pages.', 'amazon-auto-links' ),\n 'date' => __( 'Date archive pages.', 'amazon-auto-links' ),\n 'author' => __( 'Author pages.', 'amazon-auto-links' ),\n 'search' => __( 'Search result pages.', 'amazon-auto-links' ),\n '404' => __( 'The 404 page.', 'amazon-auto-links' ),\n ),\n 'default' => array(\n 'home' => false,\n 'front' => false,\n 'singular' => true,\n 'post_type_archive' => false,\n 'taxonomy' => false,\n 'date' => false,\n 'author' => false,\n 'search' => false,\n '404' => false,\n ),\n ), \n array()\n );\n\n \n return $_aFields;\n \n }", "function get_items($type) {\n $this->cache[$type] = isset($this->cache[$type]) ? $this->cache[$type] : array();\n if (empty($this->cache[$type])) {\n foreach ($this->items as $item) {\n if ($item->is_type($type)) {\n $this->cache[$type][] = $item;\n }\n }\n }\n return $this->cache[$type];\n }", "public function servings_unit() {\n\t\treturn $this->meta( 'wprm_servings_unit', '' );\n\t}", "public function getUnits()\n\t{\n\t\treturn $this->units;\n\t}", "public function getUnits()\n\t{\n\t\treturn $this->units;\n\t}", "function getUnites($idJoueur){\n\t\tinclude(\"connBdd.php\");\n\t\t$query = \"SELECT unites FROM joueurs WHERE idJoueur='$idJoueur'\";\n\t\t$result = mysql_query($query) or die(\"Query error dans getUnites: \". mysql_error());\n\t\tif(mysql_num_rows($result) != 0){\n\t\t\t$unitesNS = mysql_result($result,0);\n\t\t\t$unites = unserialize($unitesNS);\n\t\t\tif ($unites == \"\"){\n\t\t\t\t$unites = array();\n\t\t\t}\n\t\t}else{\n\t\t\t$unites = array();\n\t\t}\n\t\treturn($unites);\n\t}", "public function statpriceunits(){\n\t\t$searchDate_start = $this->request->getParameterNoException('searchDate_start');\n\t\t$searchDate_end = $this->request->getParameterNoException('searchDate_end');\n\t\t$unit_id = $this->request->getParameterNoException('unit');\n\t\t$responsible_id = $this->request->getParameterNoException('responsible');\n\t\t$export_type = $this->request->getParameterNoException('export_type');\n\t\t\n\t\t// get the selected unit\n\t\t$selectedUnitId = 0;\n\t\tif ($unit_id != \"\"){\n\t\t\t$selectedUnitId = $unit_id; \n\t\t}\n\t\t\n\t\t// get the responsibles for this unit\n\t\t$responsiblesList = array();\n\t\tif ($selectedUnitId > 0){\n\t\t\t$modeluser = new User();\n\t\t\t$responsiblesList = $modeluser->getResponsibleOfUnit($selectedUnitId);\n\t\t}\n\t\t\n\t\t// test if it needs to calculate output\n\t\t$errorMessage = '';\n\t\tif ($selectedUnitId != 0 && $responsible_id != ''){\n\t\t\t\n\t\t\t// test the dates\n\t\t\t$testPass = true;\n\t\t\tif ( $searchDate_start == ''){\n\t\t\t\t$errorMessage = \"Please set a start date\";\n\t\t\t\t$testPass = false;\n\t\t\t}\n\t\t\tif ( $searchDate_end == ''){\n\t\t\t\t$errorMessage = \"Please set an end date\";\n\t\t\t\t$testPass = false;\n\t\t\t}\n\t\t\tif ( $searchDate_end < $searchDate_start){\n\t\t\t\t$errorMessage = \"The start date must be before the start date\";\n\t\t\t\t$testPass = false;\n\t\t\t}\n\t\t\t\n\t\t\t// if the form is correct, calculate the output\n\t\t\tif ($testPass){\n\t\t\t\tif ($export_type > 0 && $export_type < 4 ){\n\t\t\t\t\t$this->output($export_type, $searchDate_start, $searchDate_end, $selectedUnitId, $responsible_id);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// get units list\n\t\t$modelUnit = new Unit();\n\t\t$unitsList = $modelUnit->unitsIDName();\n\t\t\n\t\t$navBar = $this->navBar();\n\t\t$this->generateView ( array (\n\t\t\t\t'navBar' => $navBar,\n\t\t\t\t'selectedUnitId' => $selectedUnitId,\n\t\t\t\t'responsiblesList' => $responsiblesList,\n\t\t\t\t'unitsList' => $unitsList,\n\t\t\t\t'errorMessage' => $errorMessage,\n\t\t\t\t'searchDate_start' => $searchDate_start,\n\t\t\t\t'searchDate_end' => $searchDate_end\n\t\t) );\n\t}", "public function index()\n {\n $units = Unit::all();\n \n return UnitResource::collection($units);\n }", "public static function valuesOf($type) {\n $reflect= $type instanceof XPClass ? $type->reflect() : XPClass::forName($type)->reflect();\n\n if ($reflect->isSubclassOf(self::class)) {\n $r= [];\n foreach ($reflect->getStaticProperties() as $prop) {\n $prop instanceof self && $reflect->isInstance($prop) && $r[]= $prop;\n }\n return $r;\n } else if ($reflect->isSubclassOf(\\UnitEnum::class)) {\n return $reflect->getMethod('cases')->invoke(null);\n }\n\n throw new IllegalArgumentException('Argument class must be an enum');\n }", "public function getCourseUnits($course_id)\n {\n $course_units_sql = \"SELECT DISTINCT course_units.* \n FROM course_units JOIN course_to_unit AS ctu \n ON ctu.course_id = $course_id\";\n\n\n $stmt = $this->db->query($course_units_sql);\n\n $course_units = [];\n\n while ($row = $stmt->fetch()) {\n $course_units[] = new CourseUnit($row);\n }\n return $course_units;\n }", "function getLocalUnitIDs($system) {\n\t\tglobal $g_rb_units;\n\t\t$units = array();\n\t\tforeach ($g_rb_units['static'] as $key) $units[] = $key;\t\t// Unit types\n\t\tif (isset($g_rb_units[$system][\"wet\"])) foreach ($g_rb_units[$system][\"wet\"] as $key=>$val) $units[] = $key;\t// Wet volume units\n\t\tif (isset($g_rb_units[$system][\"dry\"])) foreach ($g_rb_units[$system][\"dry\"] as $key=>$val) $units[] = $key;\t// Dry volume units\n\t\tif (isset($g_rb_units[$system][\"volume\"])) foreach ($g_rb_units[$system][\"volume\"] as $key=>$val) $units[] = $key;\t// volume units\n\t\tforeach ($g_rb_units[$system][\"mass\"] as $key=>$val) $units[] = $key;\t// Mass units\n\t\t$units = array_unique($units);\t// remove duplicates (dry/wet units could be duplicated in the units structure\n\t\treturn $units;\n\t}", "public function jsonUnits() {\n $units = [];\n foreach($this->units as $unit) {\n $units[$unit->id] = $unit->name;\n }\n return json_encode($units);\n }", "function get_all_units_count()\n {\n $this->db->from('tbl_unit');\n return $this->db->count_all_results();\n }", "function getTrainingUnits($uid, $city, $kind)\n{\n\t$sql = '\n\t\tSELECT count FROM dw_build_unit\n\t\tWHERE uid = '.\\util\\mysql\\sqlval($uid).'\n\t\t\tAND city = '.\\util\\mysql\\sqlval($city).'\n\t\t\tAND kind = '.\\util\\mysql\\sqlval($kind).'\n\t';\n\treturn \\util\\mysql\\query($sql);\n}", "public function units()\n {\n return $this->belongsToMany('App\\Models\\Unit');\n }", "public function run()\n {\n $dados = [\n \t[\n \t\t'prop_unit_type_id' => '1',\n \t\t'language_id' => '1',\n \t\t'name' => 'kg',\n 'updated_by' => '1',\n 'deleted_by' => NULL\n \t],\n \t[\n \t\t'prop_unit_type_id' => '2',\n \t\t'language_id' => '1',\n \t\t'name' => 'mg',\n 'updated_by' => '1',\n 'deleted_by' => NULL\n \t],\n \t[\n \t\t'prop_unit_type_id' => '3',\n \t\t'language_id' => '1',\n \t\t'name' => 'cm',\n 'updated_by' => '1',\n 'deleted_by' => NULL\n \t],\n \t[\n \t\t'prop_unit_type_id' => '4',\n \t\t'language_id' => '1',\n \t\t'name' => 'm',\n 'updated_by' => '1',\n 'deleted_by' => NULL\n \t],\n [\n 'prop_unit_type_id' => '5',\n 'language_id' => '1',\n 'name' => '€',\n 'updated_by' => '1',\n 'deleted_by' => NULL\n ],\n ];\n\n foreach ($dados as $value) {\n PropUnitTypeName::create($value);\n }\n }", "private function listTestCasesByType($type)\n {\n $result = array();\n $testscases = $this->listTestCases();\n if ($type == 'all') {\n return $testscases;\n }\n\n foreach ($testscases as $case) {\n if ($case->type == $type) {\n array_push($result, $case);\n }\n }\n return $result;\n }", "private function findMembers($type) {\n switch ($type) {\n case 'collections':\n return $this->findMemberCollections();\n case 'objects':\n return $this->findMemberObjects();\n case 'all':\n default:\n return $this->findAllMembers();\n }\n }", "public function units()\n {\n return $this->units;\n }", "public static function create(string $key)\n {\n if (array_key_exists($key, self::$_units)) {\n return self::$_units[$key];\n } else {\n return (self::$_units[$key] = new self($key));\n }\n }", "public function get_Cuputypes() {\r\n $response[\"result\"] = \"RESPONSE_ERROR\";\r\n\r\n $units_request = $this->Cuputypes_model->get_cuputypes();\r\n\r\n if ($units_request[\"result\"] == \"RESPONSE_OK\") {\r\n $containers = $units_request[\"response_data\"];\r\n if (is_array($containers)) {\r\n $indexed_units = array();\r\n foreach ($containers as $key => $value) {\r\n $indexed_units[$value[\"HardwareCode\"]] = $key;\r\n }\r\n }\r\n $response[\"result\"] = \"RESPONSE_OK\";\r\n $response[\"response_data\"][\"cuputypes\"] = $containers;\r\n $response[\"response_data\"][\"indexed_units\"] = $indexed_units;\r\n } else {\r\n $response[\"description\"] = $units_request[\"description\"];\r\n }\r\n echo json_encode($response);\r\n }", "private function getItems($getType)\n\t{\t\n\t\tglobal $DATABASE;\n\t\t$result = $DATABASE->select(\n\t\t\t\"travel_item\", \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Db name\n\t\t\tarray('[><]travel_' . $getType . '_items_join' => array('id' => 'fk_item')),\t//Join \n\t\t\tarray('travel_item.id', 'travel_' . $getType . '_items_join.quantity'),\t\t\t//Select keys\n\t\t\tarray('travel_' . $getType . '_items_join.fk_request' => $this->getID())\t\t//Where\n\t\t);\n\t\t\n\t\t$resultArray = array();\n\t\t\n\t\tforeach($result as $row)\n\t\t{\n\t\t\t$resultArray[$row['id']] = $row['quantity'];\n\t\t}\n\t\treturn $resultArray;\n\t}", "public function getUnitPrice();", "public function getUnitPrice();", "public function setUnit($value) {\n return $this->setParameter('unit', $value);\n }", "public function index()\n {\n $tv = new TypeOfVendor;\n return $tv->getAll();\n }", "public function index()\n {\n // $Unit = Unit::where('type', 'unit')->get();\n // return view('Unit' , compact('Unit'));\n }", "function pokemonsByType($number) {\n // instantiate TypesManager to call the findByType function\n $typesManager = new \\Project\\Pokedex\\Model\\TypesManager;\n $datas = $typesManager->findByType($number);\n\n // the results will be received by the view to render pokemons depend on the choosen type\n require('view/homeView.php');\n}", "public function unitClassGetUnitsWithHttpInfo($web_id, $selected_fields = null)\r\n {\r\n // verify the required parameter 'web_id' is set\r\n if ($web_id === null) {\r\n throw new \\InvalidArgumentException('Missing the required parameter $web_id when calling unitClassGetUnits');\r\n }\r\n // parse inputs\r\n $resourcePath = \"/unitclasses/{webId}/units\";\r\n $httpBody = '';\r\n $queryParams = [];\r\n $headerParams = [];\r\n $formParams = [];\r\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'text/json', 'text/html', 'application/x-ms-application']);\r\n if (!is_null($_header_accept)) {\r\n $headerParams['Accept'] = $_header_accept;\r\n }\r\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]);\r\n\r\n // query params\r\n if ($selected_fields !== null) {\r\n $queryParams['selectedFields'] = $this->apiClient->getSerializer()->toQueryValue($selected_fields);\r\n }\r\n // path params\r\n if ($web_id !== null) {\r\n $resourcePath = str_replace(\r\n \"{\" . \"webId\" . \"}\",\r\n $this->apiClient->getSerializer()->toPathValue($web_id),\r\n $resourcePath\r\n );\r\n }\r\n // default format to json\r\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\r\n\r\n \r\n // for model (json/xml)\r\n if (isset($_tempBody)) {\r\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\r\n } elseif (count($formParams) > 0) {\r\n $httpBody = $formParams; // for HTTP post (form)\r\n }\r\n // make the API Call\r\n try {\r\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\r\n $resourcePath,\r\n 'GET',\r\n $queryParams,\r\n $httpBody,\r\n $headerParams,\r\n '\\PIWebAPI\\Client\\Model\\Unit',\r\n '/unitclasses/{webId}/units'\r\n );\r\n\r\n return [$this->apiClient->getSerializer()->deserialize($response, '\\PIWebAPI\\Client\\Model\\Unit', $httpHeader), $statusCode, $httpHeader];\r\n } catch (ApiException $e) {\r\n switch ($e->getCode()) {\r\n case 200:\r\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\PIWebAPI\\Client\\Model\\Unit', $e->getResponseHeaders());\r\n $e->setResponseObject($data);\r\n break;\r\n }\r\n\r\n throw $e;\r\n }\r\n }", "public function SIUnitNameList()\n{\n$sim['res'][0]=['base'=>'ShortTokenType'];\n// Represents a dimensionless unit.\n$sim['res'][0]['opt'][]=['1'];\n// Represents the SI unit \"meter\".\n$sim['res'][0]['opt'][]=['m'];\n// Represents the SI unit \"kilogram\".\n$sim['res'][0]['opt'][]=['kg'];\n// Represents the SI unit \"second\".\n$sim['res'][0]['opt'][]=['s'];\n// Represents the SI unit \"ampere\".\n$sim['res'][0]['opt'][]=['A'];\n// Represents the SI unit \"kelvin\".\n$sim['res'][0]['opt'][]=['K'];\n// Represents the SI unit \"mol\".\n$sim['res'][0]['opt'][]=['mol'];\n// Represents the SI unit \"candela\".\n$sim['res'][0]['opt'][]=['cd'];\nreturn $sim;\n}", "protected function getMultipleOfType($url,$type){\n $response = $this->get($url);\n\n $type = __NAMESPACE__ . \"\\\\\" . $type;\n\n $rawRecords = $response->body->{$type::$plural};\n\n $records = [];\n foreach($rawRecords as $key=>$params){\n $records[] = new $type($params,$this);\n }\n\n return $records;\n }", "function findAllOf($class)\n{\n require_once('Base/' . $class . '.php');\n require_once('Base/' . $class . 'Query.php');\n require_once($class . 'Query.php');\n require_once($class . '.php');\n require_once('Map/' . $class . 'TableMap.php');\n\n $queryClass = ($class . 'Query');\n $q = new $queryClass;\n $elements = $q->find()->getData();\n return $elements;\n}" ]
[ "0.7059892", "0.659642", "0.62141323", "0.61442274", "0.59435654", "0.5794101", "0.5789185", "0.5698698", "0.566271", "0.54908067", "0.5423575", "0.5402741", "0.5358051", "0.5316368", "0.530263", "0.5274898", "0.5252853", "0.5217043", "0.5201021", "0.51953804", "0.514778", "0.5119311", "0.5102837", "0.5087177", "0.50837505", "0.50599426", "0.50599426", "0.5034782", "0.50200707", "0.50118834", "0.5007951", "0.5003959", "0.49983656", "0.49917063", "0.49606043", "0.4939066", "0.49249315", "0.49181065", "0.48929396", "0.4888944", "0.4885913", "0.4883696", "0.48523644", "0.48494893", "0.48307797", "0.48282808", "0.4806742", "0.48042208", "0.47998622", "0.47988594", "0.47899938", "0.47842073", "0.47489873", "0.47479543", "0.47468045", "0.4742498", "0.4732347", "0.47313318", "0.47266334", "0.47224587", "0.47070125", "0.4702454", "0.46949995", "0.46820053", "0.467893", "0.46730962", "0.46727756", "0.4672762", "0.46719438", "0.4652251", "0.46407026", "0.4637651", "0.4637651", "0.46231145", "0.46170047", "0.46159905", "0.4611829", "0.46057558", "0.46026275", "0.46024856", "0.45972934", "0.45965955", "0.4596137", "0.45791432", "0.45658702", "0.4558659", "0.45564368", "0.45532033", "0.45525154", "0.45508152", "0.45464504", "0.45464504", "0.45441478", "0.45310572", "0.45292252", "0.45277697", "0.45211887", "0.4518263", "0.45169306", "0.4515668" ]
0.70633674
0
Crafts_GetByCode get all crafts of code $vCode
Crafts_GetByCode получает все крафты по коду $vCode
function Crafts_GetByCode($vCode) { $vSQL = "select * from crafting where name in (select name from crafting where field='id' and content='" . $vCode . "')"; $vResult = @$_SESSION['vDataDB']->query($vSQL); while ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC)) { if (isset($vReturn[$vRow['field']])) { $vReturn[$vRow['field']] = $vReturn[$vRow['field']] . ':' . $vRow['content']; } else { $vReturn[$vRow['field']] = $vRow['content']; } } return($vReturn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Quests_GetByCode($vCode)\n{\n\t$vSQL = \"select * from quests where name in (select name from quests where field='id' and content='\" . $vCode . \"')\";\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\tif (isset($vReturn[$vRow['field']])) {\n\t\t\t$vReturn[$vRow['field']] = $vReturn[$vRow['field']] . ':' . $vRow['content'];\n\t\t} else {\n\t\t\t$vReturn[$vRow['field']] = $vRow['content'];\n\t\t}\n\t}\n\treturn($vReturn);\n}", "public function get_craftitems($version){\n\t\t$query = $this->db->query('\n\t\t\tselect items.itemsName, tabs.tabName from craftable_items\n\t\t\tjoin items on items.id = craftable_items.itemId\n\t\t\tjoin tabs on tabs.id = craftable_items.tab\n\t\t\twhere version <= '.$version.';\n\t\t\torder by tabs.id;\n\t\t');\n\t\treturn $query->result();\t\n\t}", "public function showAllCodes()\n {\n return Code::all();\n }", "public function getByClientCode($code);", "function get_clip_by_code($code)\n {\n $query = 'SELECT * FROM lib_clips WHERE code=?';\n $list = $this->db->query($query, array($code))->result_array();\n $this->get_keywords_sections($list[0]['id'], $list[0]);\n return $list[0];\n }", "public function getByCode(string $code);", "public function getByCode($code);", "public function getCodes();", "public function getCodes();", "public function get($code);", "function getCategoryByCode() {\n\t\t$fs_table = FSFactory::getClass ( 'fstable' );\n\t\t$ccode = FSInput::get ( 'ccode' );\n\t\tif (! $ccode)\n\t\t\treturn;\n\t\t$query = \" SELECT id,name, alias,vat\n\t\t\t\t\t\tFROM \" . $fs_table->getTable ( 'fs_products_categories' ) . \" \n\t\t\t\t\t\tWHERE alias = '$ccode' \";\n\t\tglobal $db;\n\t\t$sql = $db->query ( $query );\n\t\t$result = $db->getObject ();\n\t\treturn $result;\n\t}", "function getGovCleareanceList() \n\t\t{\n\t\t\tAPP::import('Model','Code');\n\t\t\t$this->Code = new Code(); \n\t\t\treturn $this->Code->find('list',array('fields'=>array('code_id','code_descr'),'order'=>array('code_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('code_name'=>'Security Clearance','visible'=>'Y','code_descr !=\"Security Clearance\"'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order'=>'code_descr ASC'));\n\t\t}", "public function index()\n {\n $codes = Code::all();\n return $codes;\n }", "public function get_items_with_codes($station) {\n\n $inv_items = DB::table('inventory_items')\n ->join('items', 'inventory_items.item_id', '=', 'items.id')\n ->select('inventory_items.id', 'item_id', 'name', 'item_code', 'serial_no', 'category_id', 'status')\n ->where('current_station', $station)\n ->where('status', '<>', 'Discarded')\n ->orderBy('item_id')\n ->get();\n\n return $this->process_instance_info($inv_items);\n\n }", "public function get_by_code( $code )\n\t{\n\t\t$this->db->where( 'v.code', $code );\n\t\t$_result = $this->get_all( FALSE );\n\n\t\t// --------------------------------------------------------------------------\n\n\t\tif ( ! $_result )\n\t\t\treturn FALSE;\n\n\t\t// --------------------------------------------------------------------------\n\n\t\treturn $_result[0];\n\t}", "private function get_info_warehouse($fcode){\n $rs = array();\n $arrWhere = array();\n \n $arrWhere = array('fcode'=>$fcode);\n \n //Parse Data for cURL\n $rs_data = send_curl($arrWhere, $this->config->item('api_list_warehouse'), 'POST', FALSE);\n $rs = $rs_data->status ? $rs_data->result : array();\n \n $data = array();\n foreach ($rs as $r) {\n $row['code'] = filter_var($r->fsl_code, FILTER_SANITIZE_STRING);\n $row['name'] = filter_var($r->fsl_name, FILTER_SANITIZE_STRING);\n $row['location'] = filter_var($r->fsl_location, FILTER_SANITIZE_STRING);\n $row['nearby'] = filter_var($r->fsl_nearby, FILTER_SANITIZE_STRING);\n $row['pic'] = stripslashes($r->fsl_pic) ? filter_var($r->fsl_pic, FILTER_SANITIZE_STRING) : \"-\";\n $row['phone'] = stripslashes($r->fsl_phone) ? filter_var($r->fsl_phone, FILTER_SANITIZE_STRING) : \"-\";\n $row['spv'] = filter_var($r->fsl_spv, FILTER_SANITIZE_STRING);\n \n $data[] = $row;\n }\n \n return $data;\n }", "public function code($value) {\n \n $builderCode = clone $this->builder;\n $builderDesc = clone $this->builder;\n\n if (!$this->requestAllData($value)) { \n\n if($builderCode->where('code', 'like', '%'.$value.'%')->count() > 0){ \n return $this->builder->where('code', 'like', '%'.$value.'%');\n }\n\n /* Use if there is 3rd or more parameter to be a search term */\n if($builderDesc->where('description', 'like', '%'.$value.'%')->count() > 0){ \n return $this->builder->where('description', 'like', '%'.$value.'%');\n }\n\n $typeSportIds = TypeSport::where('name', 'like', '%'.$value.'%')->pluck('id');\n return $this->builder->whereIn('typesport_id', $typeSportIds);\n }\n\n\n }", "public function getItems()\n\t{\n\t\t$this->connect();\n\t\t\n\t\t//handle the extended method with gems and enchants\n\t\tswitch ($this->getEmulatorString())\n\t\t{\n\t\t\tcase 'skyfire':\n\t\t\tcase 'trinity':\n\t\t\tcase 'trinity_cata':\n\t\t\tcase 'arkcore':\n\t\t\t\t$query = $this->connection->query(\"\tSELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`character_inventory`.`slot`, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`character_inventory`.`item`, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`item_instance`.`itemEntry`, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`item_instance`.`enchantments` \n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `character_inventory`, `item_instance` \n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `character_inventory`.`item` = `item_instance`.`guid` AND `character_inventory`.`slot` >= 0 AND `character_inventory`.`slot` <= 18 AND `character_inventory`.`guid` = ? AND `character_inventory`.`bag` = 0;\", \n\t\t\t\t\t\t\t\t\t\t\t\tarray($this->id));\n\t\t\t\tbreak;\n\t\t\tcase 'mangos':\n\t\t\tcase 'mangosr2':\n\t\t\t\t$query = $this->connection->query(\"\tSELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`character_inventory`.`slot`, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`character_inventory`.`item`, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`character_inventory`.`item_template` AS itemEntry,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`item_instance`.`data` AS enchantments \n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `character_inventory` \n\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN `item_instance` ON `character_inventory`.`item` = `item_instance`.`guid` \n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `character_inventory`.`slot` >= 0 AND `character_inventory`.`slot` <= 18 AND `character_inventory`.`guid` = ? AND `character_inventory`.`bag` = 0;\", \n\t\t\t\t\t\t\t\t\t\t\t\tarray($this->id));\n\t\t\t\tbreak;\n\t\t\tcase 'arcemu':\n\t\t\t\t$query = $this->connection->query(\"\tSELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tslot, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tguid AS item, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tentry AS itemEntry, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchantments \n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM playeritems \n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE slot >= 0 AND slot <= 18 AND ownerguid = ?;\", \n\t\t\t\t\t\t\t\t\t\t\t\tarray($this->id));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$query = $this->connection->query(query(\"get_inventory_item\", $this->realmId), array($this->id));\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif($query && $query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->result_array();\n\t\t\t\n\t\t\treturn $row;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function getReservations($code) {\n\t\t//Create a new database connection\n\t\t$mySforceconnection = Database::login();\n\t\t\n\t\t try {\n\t\t\t$query = \"Select ID FROM Group__c WHERE Name = '\" . addslashes($code) . \"'\";\n\t\t\t\n\t\t\t$results = $mySforceconnection->query(($query));\n\t\t\t$records = $results->records;\n\t\t\t\n\t\t\t$id = $records[0]->Id;\n\t\t\t \n\t\t\t //Query String for All Menu Items\t\t\n\t\t\t$query = \"Select ID, Name FROM Attendee__c WHERE Group__c = '\" . $id . \"'\";\n\t\t\t\n\t\t\t//Query the database\n\t\t\t$results = $mySforceconnection->query(($query));\n\t\t\t$records = $results->records;\n\t\t\t\n\t\t\t//Query until all records are queried\n\t\t\twhile($results->done == false) {\n\t\t\t\t\n\t\t\t\t$results = $mySforceconnection->querymore($response->queryLocator);\t\n\t\t\t\tarray_push($records, $results->records);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Logout of the database\n\t\t\tDatabase::logout($mySforceconnection);\n\t\t\t\n\t\t\tif(sizeof($records) > 0) {\n\t\t\t\n\t\t\t\treturn json_encode($records);\n\t\t\t}\n\t\t\t\n\t\t\t//Put the results in an array and return the array\n\t\t\treturn \"Sorry, this code doesn't match any guests on our guest list. Please try again.\";\n\t\t\t \n\t\t } catch(Exception $e) {\n\t\t\t $error = $e->getMessage();\n\t\t\t Database::logout($mySforceconnection);\n\t\t\t return $e->getMessage();\n\t\t }\t \n\t\n\t}", "public function getContentByCode($code, Request $request)\n {\n // Get web module id from codfe\n $contentModuleData = DB::table('WEB_MODULE')\n ->where('code', $code)\n ->where('isActive', true)\n ->first();\n //Response formate\n if (!isset($contentModuleData)) {\n return view('templates/web-content/content-detail')->with([\"contentDetail\" => null]);\n } else {\n $contentData = DB::table('WEB_MODULE_CONTENT')\n ->where('webModuleId', $contentModuleData['_id'])\n ->orderBy('sequence')\n ->get();\n\n $contentModuleData['contents'] = $contentData;\n return view('templates/web-content/content-detail')->with([\"contentDetail\" => $contentModuleData]);\n }\n }", "public function showFromCode($code)\n {\n $item = Room::where('code', $code)->firstOrFail();\n event(new RoomViewed($item));\n return $this->response->item($item, new RoomTransformer);\n }", "public function getGame($code = null)\n {\n\n $url = $url = config('app.api') . 'game?mod=list_game_admin';\n $result = $this->getListData($url);\n\n if (isset($result['data'])) {\n foreach ($result['data'] as $key => $game) {\n\n if ($code == $game['Code']) {\n return $game;\n }\n }\n }\n\n return [];\n }", "public function getCommuneByCode($code)\r\n {\r\n \treturn $this->fetchAll(array(\r\n \t\t'CODECOM = ?' => ''.$code\r\n \t))->toArray();\r\n }", "function getCode();", "function twe_get_currencies_values($code) {\n global $db;\n $currency_values = \"select * from \" . TABLE_CURRENCIES . \" where code = '\" . $code . \"'\";\n $currencie_data=$db->Execute(\n $currency_values);\n return $currencie_data;\n }", "public function findByCode($code);", "public function findByCode($code);", "public function findByCode($code);", "public function getInventory();", "public function findAll()\n {\n $codes = Code::all();\n\n return $codes;\n }", "protected function getStockItems( $code )\n\t{\n\t\t$manager = \\Aimeos\\MShop\\Factory::createManager( $this->getContext(), 'stock' );\n\n\t\t$search = $manager->createSearch();\n\t\t$search->setConditions( $search->compare( '==', 'stock.productcode', $code ) );\n\n\t\treturn $manager->searchItems( $search );\n\t}", "public function search_code($code){\n \t\n\n \t$conexion = new Database();\n \t$db = $conexion ->conectar();\n\n \t$query = \"SELECT productoID, categoriaID, nombre, precio, iva, cantidad FROM productos WHERE productoID = ?\";\n\t\t$stmt = $db->prepare($query);\n $stmt->bind_param('s', $code); \n $stmt->execute();\n $stmt->store_result();\n $stmt->bind_result($id, $categoriaID, $nombre, $precio, $iva, $cantidad);\n\n //Este bucle solo se recorrera una vez, solo hay un producto con cada id\n while($stmt->fetch()) {\n \t//Rellenar atributos de clase con el producto recuperado\n \t$this->code = $id;\n\t\t\t$this->product = $nombre;\n $this->category = $categoriaID;\n\t\t\t$this->price = $precio;\n $this->iva = $iva;\n\t\t\t$this->stock = $cantidad;\n\n }\n \n\t\t$stmt->free_result();\n $db->close();\n \n \t}", "public function compileSolidity(string $code): array\n {\n $response = $this->_send($this->_request(__FUNCTION__, [$code]));\n return ! empty($response) ? $response : [];\n }", "public function showFromCode($code)\n {\n $item = MobileCarrier::where('code', $code)->firstOrFail();\n return $this->response->item($item, new MobileCarrierTransformer);\n }", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function get_code_by_id($id);", "public function viewitemidbycode($item_code) {\n $result = DB::query(\"select * from tbl_items where item_code = '$item_code' and status = '1'\");\n return $result;\n }", "function affichercode(){\n\t\t$sql=\"SElECT * From code\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function show($code)\n {\n $set = Set::with('cards.users')->find($code);\n\n return view('sets.show')->with(compact('set'));\n }", "public function codes();", "public function getByCode($code) {\n\n\t\t$itemtotal = $this->_db->select()\n\t\t\t->from(array('checkoutitem' => 'checkoutitem'), array('checkout_code', 'checkout_item_total' => new Zend_Db_Expr('SUM(IFNULL(price.price_amount, 0))')))\n\t\t\t->joinLeft(array('price' => 'price'), 'price.price_code = checkoutitem.price_code', array())\n\t\t\t->where('checkoutitem_deleted = 0 and price_deleted = 0')\n\t\t\t->group('checkoutitem.checkout_code');\n\n\t\t$select = $this->_db->select()\n\t\t\t->from(array('checkout' => 'checkout'))\n\t\t\t->joinLeft(array('checkoutitem' => $itemtotal), 'checkoutitem.checkout_code = checkout.checkout_code', array('checkout_item_total'))\n\t\t\t->joinInner(array('participant' => 'participant'), 'participant.participant_code = checkout.participant_code')\n\t\t\t->joinInner(array('areapost' => 'areapost'), 'areapost.areapost_code = checkout.areapost_code')\n\t\t\t->joinInner(array('areapostregion' => 'areapostregion'), 'areapostregion.areapostregion_code = areapost.areapostregion_code')\n\t\t\t->where('checkout_deleted = 0')\n\t\t\t->where('checkout.checkout_code = ?', $code)\n\t\t\t->limit(1);\n\n\t $result = $this->_db->fetchRow($select);\n return ($result == false) ? false : $result = $result;\n\t}", "public function getAllCardTypesByCode()\n {\n $typesCartes = $this->entityManager->getRepository(TypeCarte::class)->findAll();\n $typesCartesByCode = [];\n /** @var TypeCarte $typeCarte */\n foreach($typesCartes as $typeCarte) {\n $typesCartesByCode[$typeCarte->getTypeCode()] = $typeCarte;\n }\n\n return $typesCartesByCode;\n }", "public function selectCodeFunction(){\n\t\t$sql = $this->_refCod->select()\n\t\t->from( $this->_refCod,array('*'))\n\t\t->where('ref_Num=?','USR005');\n\t\treturn $this->_refCod->fetchAll ( $sql )->toArray ();\n\t}", "public function setCodeTva(?string $codeTva): Clients {\n $this->codeTva = $codeTva;\n return $this;\n }", "public function show($code)\n {\n //dd($code);\n $division = Division::all()->where('code', $code);\n return response()->json($division);\n }", "public function getProduct($code): array;", "public function getModelByCodigo($code = '')\n\t{\n //realizamos la consulta de todos los segmentos\n $consulta = $this->db->prepare(\"\n SELECT \n A.COD_MODEL\n , A.COD_MODEL_SUFFIX\n , A.COD_GBU\n , A.COD_CATEGORY\n , A.COD_BU\n , A.COD_SEGMENT\n , A.COD_SUB_SEGMENT\n , A.COD_MICRO_SEGMENT\n , A.COD_BRAND\n , A.COD_ESTADO\n FROM t_product A\n WHERE a.COD_MODEL LIKE '%$code%'\n OR A.COD_MODEL_SUFFIX LIKE '%$code%'\n \");\n\n $consulta->execute();\n\n //devolvemos la coleccion para que la vista la presente.\n return $consulta;\n\t}", "public static function getByTentamenCode($code){\n $conn = static::connection();\n \n $sql = \"SELECT *\"\n . \" FROM Evaluatie\"\n . \" WHERE tentamenCode = '{$conn->real_escape_string($code)}';\";\n $result = $conn->query($sql);\n $returns = array();\n while($obj = $result->fetch_object()){\n $returns[] = new Evaluatie($obj);\n } \n return $returns;\n }", "public function setClientVcCode($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->client_vc_code !== $v) {\n $this->client_vc_code = $v;\n $this->modifiedColumns[] = DemandeIdentifiantPeer::CLIENT_VC_CODE;\n }\n\n\n return $this;\n }", "public function setCodeVentilCompta(?string $codeVentilCompta): Clients {\n $this->codeVentilCompta = $codeVentilCompta;\n return $this;\n }", "function get_activos_by_code ($value='') {\t\t\t\n\t\t\t$frm_data = $this->input->post();\n\t\t\t$codigo = $frm_data['codigo'];\n\t\t\t$codigo = $this->Model_general->desencriptar($codigo);\n\t\t\t$data = $this->db->query(\"SELECT\n\t\t\t\t\t\t\t\t\t\t\ta.descripcion nombre,\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\ta.estado,\n\t\t\t\t\t\t\t\t\t\t\tca.nombre cate_activo,\n\t\t\t\t\t\t\t\t\t\t\tca.codigo code_categoria\n\t\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\t\t\t`activos` a\n\t\t\t\t\t\t\t\t\tINNER JOIN categoria_activos ca on ca.codigo = a.categoria_activo_code AND ca.eliminado = 0\n\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\ta.eliminado = 0 AND a.codigo = '$codigo'\")->result_array();\n\n\t\t\tforeach ($data as $key => $value) {\n\t \t\t\t\t$data[$key]['code_categoria'] = $this->Model_general->encriptar($value['code_categoria']);\n\t \t\t}\n\t\t\treturn $data;\n\n\t\t}", "public function find($code);", "public static function getProductByCode($code);", "abstract function getCode();", "public function getByCode($code)\n {\n $this->filter['CODE'] = $code;\n\n return $this->first();\n }", "public function getByCode($code)\n {\n $this->filter['CODE'] = $code;\n\n return $this->first();\n }", "public function get($code) {\n return $this->getModel()->get($code);\n }", "public function getCategory($code): array;", "function get_categorias_activos_by_code ($value='') {\n\t\t\t\n\t\t\t$frm_data = $this->input->post();\n\t\t\t$codigo = $frm_data['codigo'];\n\t\t\t$codigo = $this->Model_general->desencriptar($codigo);\n\t\t\t$data = $this->db->query(\"SELECT c.nombre, c.estado FROM `categoria_activos` c WHERE c.codigo = '$codigo'\")->result_array();\n\t\t\treturn $data;\n\t\t}", "public function getInventorySourceBySourceCode($sourceCode)\n {\n\n // query whether or not the inventory source is available\n if (isset($this->inventorySources[$sourceCode])) {\n return $this->inventorySources[$sourceCode];\n }\n\n // throw a new exception\n throw new \\Exception(\n $this->appendExceptionSuffix(\n sprintf('Can\\'t load inventory source with code \"%s\"', $sourceCode)\n )\n );\n }", "function Units_GetUnitByCode($vCode, $vAllInfo = false)\n{\n\treturn(Units_GetUnitByName(Units_GetNameByCode($vCode), $vAllInfo));\n}", "public function show($code)\n\t{\n\t\treturn Product::where('code', $code)->get();\n\t}", "public function get_mats($item_name, $version){\n\t\t$query = $this->db->query('\n\t\t\tselect quantity, items.itemsName as material from materials\n\t\t\tjoin items\n\t\t\ton material = items.id\n\t\t\twhere craftableid = (select id from items where itemsName = \"'.$item_name.'\")\n\t\t\tand (materials.version = '.$version.' or materials.version = 0)'\n\t\t);\t\n\t\treturn $query->result();\t\n\t}", "public function index()\n {\n // showing Handi Craft items in front-end\n $handiCrafts = HandiCraft::orderBy('id', 'desc')->get();\n return view('handiCraft.handi_craft')->with('handiCrafts', $handiCrafts);\n }", "public static function getSourceByCode($code)\n\t{\n\t\treturn self::getSourceByField('CODE', $code);\n\t}", "public function get_for_client($data)\n\t{\n\t\t$response = $this->db->select(\"cli_id, per_ced, per_nom||' '||per_ape as nombres, mar_id, mar_nom, mod_id, mod_nom , veh_pla, veh_col, veh_id, mod.cat_id, cat_nom\")\n\t\t\t\t\t\t ->from('vehiculo')\n\t\t\t\t\t\t ->join('cliente', 'id_cli = cli_id')\n\t\t\t\t\t\t ->join('modelo as mod', 'id_modelo = mod.mod_id')\n\t\t\t\t\t\t ->join('marca', 'id_marca = mar_id')\n\t\t\t\t\t\t ->join('categoria as cat', 'cat.cat_id = mod.cat_id')\n\t\t\t\t\t\t ->order_by('per_nom asc, per_ape asc')\n\t\t\t\t\t\t ->where($data)->get()->result_array();\n\t\treturn $response;\n\t}", "public function actionCompanyInfoByVatCode()\n {\n $user = new User(['scenario' => User::SCENARIO_SIGN_UP_CLIENT]);\n $post = Yii::$app->request->post();\n $user->vatCodeLegal = isset($post['vatCode']) ? $post['vatCode'] : '';\n if (!User::isVatCodeLengthValid($user->vatCodeLegal) || !$user->validate(['vatCodeLegal'])) {\n return json_encode(['address' => '', 'companyName' => '', 'valid' => false]);\n }\n\n list($code, $number) = User::splitVatCode($user->vatCodeLegal, User::VAT_CODE_MIN_LENGTH);\n $response = User::getInfoFromECByVatCode($code, $number);\n return json_encode([\n 'address' => $response['address'],\n 'companyName' => $response['name'],\n 'valid' => $response['valid'],\n ]);\n }", "public function inventoryCode()\n {\n return \"MS/CM/\" . $this->id;\n }", "public function getCode() {}", "public function getList()\n {\n return Mpc::with('mpcRegion')->get(); \n }", "public function get_shortcodes();", "public function get_ablerecipes($item_name, $version){\n\t\t$query = $this->db->query('\n\t\t\tselect itemsName \n\t\t\tfrom materials \n\t\t\tjoin items\n\t\t\ton items.id = materials.craftableId\n\t\t\twhere material = (select id from items where itemsName = \"'.$item_name.'\")\n\t\t\tand items.version <= '.$version.'\n\t\t\tgroup by craftableId;\n\t\t');\n\t\t\n\t\t$results = array();\n\t\t\n\t\tforeach($query->result() as $row){\n\t\t\t\n\t\t\t$itemarr = array(\"itemsName\"=>$row->itemsName);\n\t\t\t\n\t\t\t$matsquery = $this->db->query('\n\t\t\t\tselect quantity, items.itemsName as material from materials\n\t\t\t\tjoin items\n\t\t\t\ton material = items.id\n\t\t\t\twhere craftableid = (select id from items where itemsName = \"'.$row->itemsName.'\")\n\t\t\t\tand (materials.version = '.$version.' or materials.version = 0)'\n\t\t\t);\n\t\t\t$mats = $matsquery->result();\n\t\t\tforeach($mats as $matsrow){\n\t\t\t\t$matsarr = array(\"material\"=>$matsrow->material, \"quantity\"=>$matsrow->quantity);\n\t\t\t\tarray_push($itemarr ,$matsarr);\n\t\t\t};\n\t\t\tarray_push($results, $itemarr);\n\t\t}\n\t\treturn $results;\n\t}", "function get_project_by_code($code)\n\t{\n\t\t$this->db->where('code', $code);\n\t\t$return = $this->db->get('projects')->row_array();\n\t\t\n\t\tif(!$return)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$return['product_list'] = $this->get_product_ids($return['id']);\n\t\treturn $return;\n\t}", "public function show($code)\n {\n $d = $this->getResponseBack($code);\n $code = trim($code);\n $json = \\GuzzleHttp\\json_decode($d);\n $lat = $json->result->latitude;\n $long = $json->result->longitude;\n $postcodes = DB::table('location')->select()->get();\n $collect= collect();\n foreach ($postcodes as $key=> $postcode) {\n $d2 = $this->getResponseBack(trim($postcode->postcode));\n $json2 = \\GuzzleHttp\\json_decode($d2);\n $lat2 = $json2->result->latitude;\n $long2 = $json2->result->longitude;\n $distance = Distance::toMiles($lat, $long, $lat2, $long2);\n if($distance <= 50) {\n $collect->add($postcode) ;\n }\n }\n return $collect;\n }", "function get_cities() {\n\t\t$code = $_GET['code'];\n\t\t$id = WCIS_Data::get_province_id($code);\n\n\t $settings = get_option('woocommerce_wcis_settings');\n\n\t $api = new WCIS_API($settings['key']);\n\t $response = $api->get_cities($id);\n\t echo json_encode($response);\n\n\t\twp_die();\n\t}", "public function get_list_info_wh($fcode){\n $rs = array();\n $arrWhere = array();\n \n $arrWhere = array('fcode'=>$fcode);\n \n //Parse Data for cURL\n $rs_data = send_curl($arrWhere, $this->config->item('api_list_warehouses'), 'POST', FALSE);\n $rs = $rs_data->status ? $rs_data->result : array();\n \n $data = array();\n foreach ($rs as $r) {\n $row['code'] = filter_var($r->fsl_code, FILTER_SANITIZE_STRING);\n $row['name'] = filter_var($r->fsl_name, FILTER_SANITIZE_STRING);\n $row['location'] = filter_var($r->fsl_location, FILTER_SANITIZE_STRING);\n $row['nearby'] = filter_var($r->fsl_nearby, FILTER_SANITIZE_STRING);\n $row['pic'] = stripslashes($r->fsl_pic) ? filter_var($r->fsl_pic, FILTER_SANITIZE_STRING) : \"-\";\n $row['phone'] = stripslashes($r->fsl_phone) ? filter_var($r->fsl_phone, FILTER_SANITIZE_STRING) : \"-\";\n \n $data[] = $row;\n }\n \n return $data;\n }", "function buscarVendaCindice($cod)\n {\n $venda = new Vendas();\n $result = $venda->buscaVendaIndices($cod);\n return $result;\n }", "abstract function getMinCode();", "public function getChannel($code): array;", "public function getsymbolsforcode($cpt_code,$table)\n\t{\n\t\t\t\t\t\t\n\t\t\t\t$icd_codes = new Icd_codes();\t\n\t\t\t\t\t\n\t\t\t\t$row=$this->get_icd_range_code($cpt_code,$table);\n\t\t\t\t$data['gender'] = getICDGenderResult($cpt_code);\n\t\t\t\t$data['code_status'] = $row->code_status;\n\t\t\t\t$data['pdx_code'] = $icd_codes->check_pdx_code($cpt_code);\n\t\t\t\t$data['cc_mcc'] = $icd_codes->check_cc_mcc($cpt_code);\n\t\t\t\t$data['cc_exclusion'] = $icd_codes->get_cc_exclusion($cpt_code);\n\t\t\t\t$data['no_poa'] = $icd_codes->get_icd_meta($row->id,'POA_Exempt');\n\t\t\t\t$html=$this->CI->load->view('modules/symbols/symbols',$data,true);\n\t\t\t\treturn $html;\n\t\t\t\t//return $data;\n\t\t\t\n\t\t\t\n\t\t\t\n\t}" ]
[ "0.5808289", "0.55889297", "0.5380916", "0.53076124", "0.52356076", "0.51551944", "0.51136774", "0.5041568", "0.5041568", "0.501496", "0.4972714", "0.49316314", "0.49037185", "0.477347", "0.4728488", "0.46645188", "0.46524274", "0.46376663", "0.4624236", "0.46099454", "0.4597813", "0.45916468", "0.45913336", "0.4581225", "0.45799628", "0.4579936", "0.4579936", "0.4579936", "0.4576767", "0.45671266", "0.4566687", "0.4565159", "0.45319217", "0.45140576", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4508139", "0.4503465", "0.44965357", "0.4466112", "0.44580078", "0.44556528", "0.4452118", "0.44457468", "0.4441895", "0.44349545", "0.44262505", "0.4422014", "0.44156453", "0.44135013", "0.44110787", "0.44097504", "0.44078758", "0.440308", "0.4394542", "0.4388973", "0.4383959", "0.4383959", "0.4382738", "0.43792102", "0.4364158", "0.43603864", "0.4357609", "0.43575075", "0.43540928", "0.4354034", "0.43511862", "0.43411934", "0.43357313", "0.4332628", "0.43273747", "0.43273717", "0.4318723", "0.43172517", "0.43075183", "0.42989025", "0.4296332", "0.42849717", "0.42819253", "0.42802885", "0.42793328", "0.42694813" ]
0.7541058
0
Storage_GetByName get all storage of code $vName
Storage_GetByName получает все хранилища кода $vName
function Storage_GetByName($vName) { $vSQL = "select * from storage where name in (select name from storage where field='name' and content='" . $vName . "')"; $vResult = @$_SESSION['vDataDB']->query($vSQL); while ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC)) { if (isset($vReturn[$vRow['field']])) { $vReturn[$vRow['field']] = $vReturn[$vRow['field']] . ':' . $vRow['content']; } else { $vReturn[$vRow['field']] = $vRow['content']; } } return($vReturn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStorage() ;", "public function getStorage();", "public function getStorage();", "public function getStorage();", "public function getStorage();", "public function getStorage();", "public static function getStorage() {}", "public function getStorage() {}", "public function getStorage() {}", "public function getStorage() {}", "public function getStorages()\n {\n $storages = array();\n foreach ( $this->_storages as $name => $storage )\n {\n $storages[$name] = $storage['object'];\n }\n\n return $storages;\n }", "public function readStorage()\n {\n $list = $this->getList();\n \n $result = array();\n foreach ($list as $name) {\n $template = $this->readAddonDir($name);\n if (is_array($template) && isset($template['name'])) {\n $result[] = $template;\n }\n }\n \n return $result;\n }", "public function getFileStorages() {}", "public static function getStorageEngine();", "public function getStorage(): array\n {\n return $this->getArrayValue(['storage'], []);\n }", "public function getStorages()\n {\n return $this->storages;\n }", "public function storages()\n {\n return StorageCollection::collection(Storage::all());\n }", "public function getStorage( $name )\n {\n if ( isset($this->_storages[$name]) ) {\n return $this->_storages[$name]['object'];\n }\n \n return false;\n }", "public function storage_region_list(){\n $api = new JxcapiController();\n $storageList = json_decode($api->getAllStorage(),TRUE);\n foreach ($storageList as $k=>$v){\n $regionName = M(\"storage_region sr\")\n ->where(\"sr.storage_id = \".$v[\"id\"])\n ->join(\"LEFT JOIN tp_region r ON sr.region_id=r.id\")\n ->field(\"r.name\")\n ->select();\n $storageList[$k][\"regions\"] = $regionName;\n }\n $this->assign('list',$storageList);\n $this->display();\n }", "public function listObjectStorage()\n {\n return $this->api->makeAPICall('GET', $this->api::OBJECT_STORAGE_URL);\n }", "public function getStorage() {\n static $cache = [];\n $theme = $this->getName();\n if (!isset($cache[$theme])) {\n $cache[$theme] = new Storage($theme);\n }\n return $cache[$theme];\n }", "function acf_get_local_store($name = '') {}", "public function getStorageProviderServiceName();", "protected function getStorage()\n {\n return json_decode(file_get_contents($this->storagePath), true);\n }", "public function viewStorage()\n {\n $variables = array();\n $variables['can_remove'] = true;\n if( count($this->settings['storage_details']) <= 1 )\n {\n $variables['can_remove'] = false;\n }\n \n $variables['errors'] = $this->errors;\n $variables['available_storage_engines'] = $this->services['backup']->getStorage()->getAvailableStorageDrivers();\n $variables['storage_details'] = $this->settings['storage_details'];\n $variables['menu_data'] = $this->backup_lib->getSettingsViewMenu();\n $variables['section'] = 'storage';\n $variables['view_helper'] = $this->view_helper;\n $variables['url_base'] = $this->url_base;\n $variables['theme_folder_url'] = plugin_dir_url(self::name);\n $template = 'admin/views/storage';\n $this->renderTemplate($template, $variables);\n }", "public function getStorage($entity_type_id);", "public function all()\n {\n return $this->storage;\n }", "public function get($name)\n\t{\n\t\treturn $this->storage()->get($name);\n\t}", "public function getStorage(): string\n {\n return $this->availableStorages[$this->enabledStorage];\n }", "function fn_get_storage_data($key)\n{\n if (!Registry::isExist('storage_data.' . $key)) {\n Registry::set('storage_data.' . $key, db_get_field('SELECT `data` FROM ?:storage_data WHERE `data_key` = ?s', $key));\n }\n\n return Registry::get('storage_data.' . $key);\n}", "public function index() {\n $storage = new Storage;\n // get current user\n $user = Auth::user();\n\n // using relation for get user storages\n $storages = $user->storages;\n\n return view('storage.index')\n ->with('storages', $storages);\n }", "function GetObjectsByName($name = '') {\n\t$objectsstr = fBGetDataStore('objects');\n\t$objects = unserialize($objectsstr);\n\tif ($name) {\n\t\t$resobjects = array();\n\t\tforeach ($objects as $object)\n\t\tif ($object['itemName'] == $name)\n\t\t$resobjects[] = $object;\n\t\treturn $resobjects;\n\t} else {\n\t\treturn $objects; //return all objects\n\t}\n}", "public function list(): array\n {\n return array_keys($this->storage);\n }", "public function getStorageProvisioner($name = null)\n {\n return $this->resolveStorage($name);\n }", "function get_list() {\n\t\t$query = \"select fai_volume_id, fai_volume_name from \".$this->_db_table.\" order by fai_volume_id ASC\";\n\t\t$fai_volume_name_array = array();\n\t\t$fai_volume_name_array = htvcenter_db_get_result_double ($query);\n\t\treturn $fai_volume_name_array;\n\t}", "public function getStorage(): string\n {\n return $this->storageId;\n }", "public function getBlockStorages()\n\t{\n\t\treturn $this->block_storages;\n\t}", "public function getVolume($name) {\n $response = $this->request(\"volumes?name={$name}&per_page=1&page=1\");\n\n return (empty($response) || empty($response->volumes) ? NULL : $response->volumes[0]);\n }", "public function view_storage()\n {\n $variables = array();\n $variables['can_remove'] = true;\n if( count($this->settings['storage_details']) <= 1 )\n {\n $variables['can_remove'] = false;\n }\n \n $variables['errors'] = $this->errors;\n $variables['available_storage_engines'] = $this->services['backup']->getStorage()->getAvailableStorageDrivers();\n $variables['storage_details'] = $this->settings['storage_details'];\n $variables['menu_data'] = ee()->backup_pro->get_settings_view_menu();\n $variables['section'] = 'storage';\n ee()->view->cp_page_title = $this->services['lang']->__('storage_bp_settings_menu');\n return array(\n 'body' => ee()->load->view('storage', $variables, true),\n 'heading' => $this->services['lang']->__($variables['section'].'_bp_settings_menu'),\n 'breadcrumb' => array(\n ee('CP/URL', 'addons/settings/backup_pro')->compile() => lang('backup_pro_module_name'),\n ee('CP/URL', 'addons/settings/backup_pro/settings/general')->compile() => lang('settings'),\n )\n ); \n }", "function acf_get_store($name = '') {}", "public function storage_locations()\n {\n $variables = array();\n $variables['can_remove'] = true;\n if( count($this->settings['storage_details']) <= 1 )\n {\n $variables['can_remove'] = false;\n }\n \n $variables['available_storage_engines'] = $this->services['backup']->getStorage()->getAvailableStorageDrivers();\n $variables['storage_details'] = $this->settings['storage_details'];\n //$variables['menu_data'] = ee()->backup_pro->get_settings_view_menu();\n $variables['section'] = 'storage_locations';\n $variables['pageTitle'] = $this->services['lang']->__('storage_bp_settings_menu'); \n \n if( $this->platform->getPost('storage_updated') == 'yes' ) {\n $variables['success'] = $this->services['lang']->__('storage_location_updated');\n }\n \n if( $this->platform->getPost('storage_added') == 'yes' ) {\n $variables['success'] = $this->services['lang']->__('storage_location_added');\n } \n \n if( $this->platform->getPost('storage_removed') == 'yes' ) {\n $variables['success'] = $this->services['lang']->__('storage_location_removed');\n } \n \n if( $this->platform->getPost('storage_invalid_id') == 'yes' ) {\n $this->error = t( $this->services['lang']->__('invalid_storage_id') );\n }\n \n if( $this->platform->getPost('storage_min_needed_fail') == 'yes' ) {\n $this->error = t( $this->services['lang']->__('min_storage_location_needs') );\n }\n \n $this->prepView('storage', $variables); \n }", "protected function getStorageTypes(): array\n {\n return ['local', 'dropbox', 'amazon'];\n }", "public function storage()\n {\n return $this->hasMany('App\\Storage', 'account_id', 'account_id');\n }", "protected static function getStorage()\n {\n return app('filesystem')->disk(static::$type);\n }", "public function getMediaStorage();", "public function getStorage(){\n return $this->getArrayCopy();\n }", "protected function getIndexStorage() {\n return $this->getEntityManager()->getStorage('search_api_index');\n }", "public static function getStorageTableName() {}", "function get_list() {\n\t\t$query = \"select opsi_volume_id, opsi_volume_name from \".$this->_db_table.\" order by opsi_volume_id ASC\";\n\t\t$opsi_volume_name_array = array();\n\t\t$opsi_volume_name_array = htvcenter_db_get_result_double ($query);\n\t\treturn $opsi_volume_name_array;\n\t}", "protected function storage()\n {\n return $this->storage->disk($this->storageDisk());\n }", "public function list()\n {\n return response()->json(Product::with('storages:storages.storage_id')->get());\n }", "public function storage()\n\t{\n\t\treturn $this->component('storage');\n\t}", "public static function getStorageItemsField() {}", "public function storage(?string $name = null): CacheInterface;", "public function getDiskNamesList(){\n return $this->_get(4);\n }", "public function getExtensionCopyStorage() {}", "public function get_storage()\n {\n return $this->storage;\n }", "public function &getStorage($storage_name): LanguageStorage\n {\n $return = false;\n\n if (isset($storage_name, $this->storage->{$storage_name})) {\n $return = $this->storage->{$storage_name};\n }\n\n return $return;\n }", "public function storage()\n\t{\n\t\t// init storage\n\t\tif ($this->_storage == null)\n\t\t{\n\t\t\t// if source is an URI\n\t\t\tif (strpos($this->get('file'), 'http') === 0) \n\t\t\t{\n\t\t\t\t$this->_storage = new ZLStorage('URI');\n\t\t\t}\n\n\t\t\t// s3\n\t\t\telse if ($this->config->find('files._s3', 0))\n\t\t\t{\n\t\t\t\t$bucket\t = trim($this->config->find('files._s3bucket'));\n\t\t\t\t$accesskey = trim($this->app->zlfw->decryptPassword($this->config->find('files._awsaccesskey')));\n\t\t\t\t$secretkey = trim($this->app->zlfw->decryptPassword($this->config->find('files._awssecretkey')));\n\n\t\t\t\t$this->_storage = new ZLStorage('AmazonS3', array('secretkey' => $secretkey, 'accesskey' => $accesskey, 'bucket' => $bucket));\n\t\t\t} \n\n\t\t\t// local\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_storage = new ZLStorage('Local');\n\t\t\t}\n\t\t}\n\t\treturn $this->_storage;\n\t}", "public function projectStorage($key);", "public function getList()\n {\n return $this->getStorage()->get();\n }", "function getv($name)\n {\n global $DATA;\n\n echo $DATA[$name];\n }", "public function getAll()\n\t{\n\t\tparent::getAll();\n\n\t\t$allinfo = xcache_list(XC_TYPE_VAR, 0);\n\t\t$keys = $allinfo['cache_list'];\n\t\t$secret = $this->_hash;\n\n\t\t$data = array();\n\n\t\tforeach ($keys as $key)\n\t\t{\n\n\t\t\t$namearr = explode('-', $key['name']);\n\n\t\t\tif ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache')\n\t\t\t{\n\t\t\t\t$group = $namearr[2];\n\n\t\t\t\tif (!isset($data[$group]))\n\t\t\t\t{\n\t\t\t\t\t$item = new JCacheStorageHelper($group);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$item = $data[$group];\n\t\t\t\t}\n\n\t\t\t\t$item->updateSize($key['size'] / 1024);\n\n\t\t\t\t$data[$group] = $item;\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getStorage()\n\t{\n return $this->_storage;\n\t}", "public function listLocalStorageMount() {\n\t\t$this->invokingTheCommand('files_external:list --output=json');\n\t}", "public function getStorageGroup()\n {\n return $this->get('storagegroup');\n }", "public function getStorageRecord() {}", "public function getStorage()\n\t{\n\t\treturn $this->storage;\n\t}", "public function getStorage()\n\t{\n\t\treturn $this->storage;\n\t}", "public function getStorage()\n\t{\n\t\treturn $this->storage;\n\t}", "function getStorage ()\r\n {\r\n return $this->storage;\r\n }", "public function getBuckets()\n {\n $buckets = $this->gcStorageClient->buckets();\n foreach ($buckets as $bucket) {\n echo $bucket->name() . PHP_EOL;\n }\n }", "public static function getStorageName()\n {\n return 'nb_site_lang';\n }", "function Units_GetUnitByName($vName, $vAllInfo = false)\n{\n\tif ($vAllInfo)\n\t{\n\t\t$vSQL = 'select * from units where name=\"' . $vName . '\"';\n\t}\n\telse\n\t{\n\t\t$vSQL = \"select * from units where field in ('name','type','code','buyable','className','iconurl','market','cash','cost','subtype','growTime','coinYield','action','limitedEnd','requiredLevel','crop','sizeX','sizeY','plantXp','masterymax','license','realname','desc') and name='$vName'\";\n\t}\n\t$vResult = @$_SESSION['vDataDB']->query($vSQL);\n\twhile ($vRow = $vResult->fetchArray(SQLITE3_ASSOC))\n\t{\n\t\t$vReturn[$vRow['field']] = $vRow['content'];\n\t}\n\treturn(@$vReturn);\n}", "private function fetchAll()\n {\n return $this->data = $this->client->listItems('volumes', ['q' => $this->query]);\n }", "public function getImageStorage()\n { \n return config(\"constant.image.general.storage\");\n }", "public function getStorage()\n {\n return $this->storage;\n }", "public function getStorage()\n {\n return $this->storage;\n }", "public function getStorage()\n {\n return $this->storage;\n }", "public function getStorage()\n {\n return $this->storage;\n }", "public function getStorage()\n {\n return $this->storage;\n }", "public function getAccessibleFormStorageFolders() : array {}", "public function get(string $name): ImageVariant;", "public function __invoke(): StorageInterface;", "public function getStorage()\n {\n return $this->_storage;\n }", "public function index(Request $rq)\n {\n return Storage::listContents($rq->dir);\n }", "abstract protected function createStorage();", "public static function searchNameServbynameServe($nameserv){\n\t\t\t$data=playlistVDOEloquent::where('namevdoServ','LIKE',$nameserv)->get();\n\t\t\t$outputPic=array();\n\t\t\t$size=count($data);\n\t\t\t\t\tfor ($a=0;$a<$size;$a++) {\n\t\t\t\t\t\t$outputPic[$a]=$data[$a]->namevdoServ;\n\t\t\t\t}\n\t\t\t\t/**make array to string*/\n\t\t\t\t$outputPic = implode($outputPic);\n\t\t\t\t//var_dump($outputPic);\n\t\t\treturn $outputPic;\n\t\t\t}", "private function getStorage($elementName)\n {\n if ($this->isProperty($elementName)) {\n return $this->{$elementName};\n }\n\n return ($this->store[$elementName] ?? null);\n }", "public function newStorage()\n {\n $engine = $this->getPost('engine', 'local');\n $variables = array();\n $variables['available_storage_engines'] = $this->services['backup']->getStorage()->getAvailableStorageDrivers();\n \n if( !isset($variables['available_storage_engines'][$engine]) )\n {\n $engine = 'local';\n }\n \n $variables['storage_details'] = $this->settings['storage_details']; \n $variables['storage_engine'] = $variables['available_storage_engines'][$engine];\n $variables['form_data'] = array_merge($this->settings, $variables['storage_engine']['settings'], $this->storage_form_data_defaults);\n $variables['form_errors'] = array_merge($this->returnEmpty($this->settings), $this->returnEmpty($variables['storage_engine']['settings']), $this->storage_form_data_defaults);\n \n if( $_SERVER['REQUEST_METHOD'] == 'POST' )\n {\n $data = array();\n $data = array_map( 'stripslashes_deep', $_POST );\n \n $variables['form_data'] = $data;\n $settings_errors = $this->services['backup']->getStorage()->validateDriver($this->services['validate'], $engine, $data, $this->settings['storage_details']);\n if( $settings_errors )\n {\n $variables['form_errors'] = array_merge($variables['form_errors'], $settings_errors);\n }\n }\n \n $variables['errors'] = $this->errors;\n $variables['_form_template'] = false;\n if( $variables['storage_engine']['obj']->hasSettingsView() )\n {\n $variables['_form_template'] = 'drivers/_'.$engine.'.php';\n }\n\n $variables['menu_data'] = $this->backup_lib->getSettingsViewMenu();\n $variables['section'] = 'storage';\n $variables['engine'] = $engine;\n $variables['view_helper'] = $this->view_helper;\n $variables['url_base'] = $this->url_base;\n $variables['theme_folder_url'] = plugin_dir_url(self::name);\n \n //ee()->view->cp_page_title = $this->services['lang']->__('storage_bp_settings_menu');\n //return ee()->load->view('storage/new', $variables, true);\n $template = 'admin/views/storage/new';\n $this->renderTemplate($template, $variables);\n }", "public function get( $name );", "public function get( $name );", "protected function getServerStorage() {\n return $this->getEntityManager()->getStorage('search_api_server');\n }", "private static function getStorageBucket()\n {\n return self::$config['storage_bucket'];\n }", "function getAccessibleFormStorageFolders() : array ;", "public function getStorage($entityName)\n {\n if (!isset($this->instances[$entityName])) {\n $this->instances[$entityName] = $this->getStorageFactory()->createInstance($entityName);\n }\n\n return $this->instances[$entityName];\n }", "public function storageLoaded()\n {\n return array_keys($this->storages);\n }", "public function getObjectStorage($oid)\n {\n if (in_array($oid, $this->storage_ids)) {\n return $this->api->makeAPICall('GET', $this->api::OBJECT_STORAGE_URL . \"/\" . $oid);\n } else {\n throw new InvalidParameterException(\"That Storage ID isn't associated with your account\");\n }\n }", "public function get($name);", "public function get($name);" ]
[ "0.66182435", "0.65908927", "0.65908927", "0.65908927", "0.65908927", "0.65908927", "0.6447139", "0.6362461", "0.6361765", "0.6361765", "0.613066", "0.6067533", "0.59271395", "0.5864352", "0.58491683", "0.58263034", "0.58048093", "0.57320684", "0.571283", "0.568832", "0.5677131", "0.56506586", "0.56269515", "0.5505439", "0.5475564", "0.5448032", "0.5442879", "0.5398026", "0.53893685", "0.53850573", "0.5371531", "0.53695893", "0.53683543", "0.53588533", "0.53507024", "0.53330153", "0.53320926", "0.5306793", "0.5305934", "0.52995867", "0.5286124", "0.5283919", "0.5283869", "0.52829313", "0.5281704", "0.5277769", "0.52740586", "0.52716434", "0.5270902", "0.5265477", "0.5259231", "0.5250941", "0.5249825", "0.52492136", "0.51788193", "0.5174493", "0.51565444", "0.5152909", "0.514901", "0.51409024", "0.5129077", "0.5096914", "0.50914574", "0.5089784", "0.5083048", "0.50782984", "0.5072815", "0.5070331", "0.5070331", "0.5070331", "0.50681657", "0.50523233", "0.50499654", "0.50459087", "0.50139487", "0.50026476", "0.49929747", "0.49929747", "0.49929747", "0.49929747", "0.49929747", "0.49928674", "0.49903187", "0.49772963", "0.4970969", "0.4963845", "0.49629757", "0.49605763", "0.49535558", "0.49353364", "0.49205112", "0.49205112", "0.49204862", "0.49160177", "0.49046713", "0.48875225", "0.48874405", "0.4885458", "0.4883524", "0.4883524" ]
0.7816096
0
Quests_GetAll get all quests
Quests_GetAll получение всех квестов
function Quests_GetAll() { $vSQL = 'select * from quests'; $vResult = @$_SESSION['vDataDB']->query($vSQL); while ($vRow = @$vResult->fetchArray(SQLITE3_ASSOC)) { $vReturn[$vRow['name']][$vRow['field']] = $vRow['content']; } return($vReturn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function all() : Questions;", "public function getAllQuestions(){\n\t\t$query = $this->db->get('question');\n\t\treturn $query->result();\n\t}", "function get_all_survey_questions(){\n global $db;\n $stmt = $db->prepare(\"SELECT * FROM survey_questions\");\n $stmt->execute();\n return $stmt->fetchAll();\n }", "function get_all_questions() {\n\t\t$questions = get_posts( array(\n\t\t\t'post_type' => 'tix_question',\n\t\t\t'post_status' => 'publish',\n\t\t\t'posts_per_page' => -1,\n\t\t) );\n\n\t\treturn $questions;\n\t}", "public function getQuestItems(): array {\n $inventory = Inventory::where('character_id', $this->character->id)->first();\n\n $slots = InventorySlot::where('inventory_slots.inventory_id', $inventory->id)->join('items', function($join) {\n $join->on('inventory_slots.item_id', '=', 'items.id')\n ->where('items.type', 'quest');\n })->select('inventory_slots.*')->get();\n\n $slots = new LeagueCollection($slots, $this->inventoryTransformer);\n\n return $this->manager->createData($slots)->toArray();\n }", "public function getAllQuestion()\n {\n try {\n $allQestions = $this\n ->get()\n ->take(10)\n ->toArray(); \n return $allQestions;\n\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n }", "public function getQuestions();", "public final function get_all()\n {\n }", "public function getAllQuestions(){\n try {\n $sql = \"SELECT * FROM questions\";\n \n\n $statement = $this->connect()->prepare($sql);\n\n $statement->execute();\n\n $result = $statement->fetchAll();\n\n return $result;\n }\n catch(PDOEXCEPTION $e) {\n print_r(\"Something went wrong: \" . $e->getMessage());\n }\n }", "public static function GetQuestions(){\n $req = \"SELECT id_question, question, id_qcm FROM question\";\n $sql = QcmPdo::GetPdo()->prepare($req);\n $sql -> execute();\n\n return $sql->fetchALL(PDO::FETCH_ASSOC);\n }", "function fn_sd_checkout_questions_get_all()\n{\n $questions = db_get_array('SELECT * FROM ?:checkout_questions ORDER BY position');\n return $questions;\n}", "function getAll()\n {\n }", "public function getAll(){}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM well_test_rpt';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function all()\n {\n return $this->testimonial->all();\n }", "public function index()\n {\n return QuestaoResource::collection(App(Questao::class)->get());\n }", "function getAll() {\r\n\t\treturn SurveyQuery::create()->find();\r\n\t}", "abstract function get_all();", "public static function getAll();", "public static function getAll()\n {\n }", "public function getAllItems() {\n return $this->getItemsByQuery(\"select * from game\");\n }", "public function getAllQuestions() {\n // Connect\n $this->connect();\n\n // Set empty array for results\n $results = [];\n\n // Set empty parameters\n $query_parameters = [];\n\n // get sql query\n $query_string = $this->sql_queries->getAllQuestions();\n\n // Execute query\n $results = $this->db->getMultipleValues($query_parameters, $query_string);\n\n // return results\n return $results;\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM milestones_coursecontentmilestone';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function getAllQuestions(){\n\t\t$stmt = $this->con->prepare(\"SELECT questionid, questionbody, questioncategory, questiontype, datecreated, expirationdate, usefulcount, visible, userid FROM question\");\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($questionid, $questionbody, $questioncategory, $questiontype, $datecreated, $expirationdate, $usefulcount, $visible, $userid);\n\t\t\n\t\t$questions = array(); \n\t\t\n\t\twhile($stmt->fetch()){\n\t\t\t$question = array();\n\t\t\t$question['questionid'] = $questionid; \n\t\t\t$question['questionbody'] = $questionbody;\n\t\t\t$question['questioncategory'] = $questioncategory; \n\t\t\t$question['questiontype'] = $questiontype;\n\t\t\t$question['datecreated'] = $datecreated;\n\t\t\t$question['expirationdate'] = $expirationdate;\n\t\t\t$question['usefulcount'] = $usefulcount; \n\t\t\t$question['visible'] = $visible; \n\t\t\t$question['userid'] = $userid;\n\t\t\t\n\t\t\tarray_push($questions, $question); \n\t\t}\n\t\t\n\t\treturn $questions; \n\t}", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM quizes_has_preguntas';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "public function MyAllQues()\n\t{\n\n\n\n\t\t$data['rs'] = $this->lib_model->Select('question', 'QuestionId,SubjectId,UnitId,TopicId,AuthorId,QTypeId,QMarks,QAnswer,Question,\n\n\t\tQTitle,QTime,QComplexity,', array('AuthorId' => $this->session->EmpId));\n\t\t\n rsort($data['rs']);\n\t\n\t\t\t# code...\n\t\t\n\t\t$this->load->view('f/f_header', $data);\n\t\t$this->load->view('f/myallques');\n\t\t$this->load->view('f/f_footer');\n\t\n}", "public function GetAllQuestions()\n\t{\t$questions = array();\n\t\t$sql = 'SELECT * FROM faq WHERE live=1 ORDER BY listorder, created';\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$questions[$row['faqid']] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $questions;\n\t}", "static function get_all()\n {\n }", "abstract public function getAll();", "abstract public function getAll();", "public function all() {\n\t\t$this->_getAll ();\n\t}", "public abstract function getAll();", "function getQuestoes( $Tid, $Lid ) {\n try {\n $stmt = $this->db->prepare( 'SELECT q.Qid, q.Qtitulo\n FROM listas l\n JOIN listaquestao lq ON lq.Lid=l.Lid\n JOIN questoes q ON q.Qid=lq.Qid\n JOIN turmalista tl ON tl.Lid=l.Lid\n WHERE tl.Tid=:Tid AND l.Lid=:Lid\n ORDER BY lq.pos ASC, q.Qtitulo ASC' );\n $stmt->bindValue( ':Tid', $Tid );\n $stmt->bindValue( ':Lid', $Lid );\n $stmt->execute();\n $result = $stmt->fetchALL( PDO::FETCH_ASSOC );\n\n return $result;\n } catch ( PDOException $e ) {\n die( \"Erro: <code>\" . $e->getMessage() . \"</code>\" );\n }\n }", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM kelas_tugas';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM kelas_tugas';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function retrieveAll ()\n {\n\n $q = Doctrine_Query::create ()\n ->from ( 'Language la' )\n ->orderBy ( 'la.language_name ASC' );\n\n return $q->execute ();\n }", "public function get_questions(){\n\n\t\t/*\n\t\t\tfetch teams in query 2 \n\t\t\tteams should be from table round where round = 3 \n\t\t\twith limit 1 and offset passed as arg\n\t\t*/\n\n\t\t\t\n\t\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM workflow_assessmentworkflow';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function GetAll() {\n \treturn $this->dao_->GetAll();\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM piecejointes';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function getQuestions()\n {\n $this->load->model(\"Questions_model\");\n $result = $this->db->query(\"SELECT `q`.* FROM Questions q JOIN QuestionTopics qt ON q.question_id = qt.question_id AND qt.topic_id = ?\", array($this->topic_id))->result();\n\n $ret = array();\n foreach($result as $r)\n $ret[] = Questions_model::LoadWithData($r);\n return $ret;\n }", "public function all() {\n\t\t// return $rs;\n \treturn TMasterProduk::all();\n\t}", "public function forgetAll(): void;", "function getQuestions() {\n $db = (new Database())->getDB();\n try {\n $stmt = $db->query(\"Select ID_QUESTION,TITLE,TOPIC_ID,RESPONSE_ID,MAP_ID from QUESTIONS\");\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n } catch (PDOException $e){\n return False;\n }\n}", "static public function getAll(){\n \t$pdo = Database::getInstance();\n $stmt = $pdo->prepare('SELECT id,name FROM championship');\n $stmt->execute();\n $result = $stmt->fetchAll();\n return $result;\n }", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll()\n {\n // if ($employee) {\n // $this->employee = $employee;\n // } else {\n // $this->employee = array(['error' => '401']);\n // }\n // return response($this->employee)->header('Content-Type', 'application/json');\n\n $Question = new Question();\n $questions = $Question::with('optionChoice')->get();\n\n if ($questions) return response()->json($questions, 201);\n else return response()->json([], 204);\n }", "function getAll();", "public function getall()\n {\n }", "public function get_all()\n {\n return $this->get_many();\n }", "function getAllQuestionnaire(){\r\n\t\r\n\t\t$query = \"SELECT id,title FROM events WHERE status=0\";\r\n \t$result = mysql_query($query) or trigger_error(mysql_error().\" \".$query);\r\n\r\n \treturn $result;\r\n }", "public function getList(){\n $res=$this->queryGetQA(\"SELECT qa_id FROM e_qa WHERE qa_asm_id=\".$this->asm->getId().\" AND qa_task_xl_level=\".$this->currentLevel().\" ORDER BY qa_queue ASC;\");\n $qaList=[];\n foreach ($res as $r) {\n $qaList[]=new QA($this->connection,$r['qa_id']);\n }\n return $qaList;\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cheque';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function division_get_all_rows( ) {\n\tglobal $g_division_cache, $g_cache_division_project;\n\n\n\t$t_query = 'SELECT * FROM {division} ORDER BY division_id';\n\t$t_result = db_query( $t_query );\n\t$t_rows = array();\n\twhile( $t_row = db_fetch_array( $t_result ) ) {\n\t\t$t_rows[] = $t_row;\n\t}\n\n\treturn $t_rows;\n}", "public function getAll()\n\t{\t\t\n\t\treturn $this->fetch();\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cbt_durasi_siswa';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}" ]
[ "0.6704389", "0.66113037", "0.6357142", "0.6301573", "0.6261651", "0.62592566", "0.6244783", "0.62078065", "0.61907595", "0.61865634", "0.61845464", "0.61588836", "0.611709", "0.61162317", "0.6111462", "0.60845155", "0.6080704", "0.6073822", "0.6069598", "0.6064365", "0.605879", "0.60569733", "0.60567576", "0.60527873", "0.60516274", "0.6051465", "0.60497016", "0.604097", "0.60389316", "0.60389316", "0.6031712", "0.6031349", "0.6016753", "0.60009325", "0.60009325", "0.60009325", "0.5979644", "0.5979644", "0.5978606", "0.5969825", "0.59687066", "0.5944961", "0.5935315", "0.59353024", "0.5931818", "0.59225607", "0.591985", "0.59168357", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.5915099", "0.59099203", "0.59036976", "0.58882004", "0.5888063", "0.58822936", "0.58803636", "0.586397", "0.5852526", "0.5852345", "0.5850838" ]
0.77254695
0
Creates a new Kategorija model. If creation is successful, the browser will be redirected to the 'view' page.
Создает новый объект модели Kategorija. Если создание успешно, браузер будет перенаправлен на страницу просмотра.
public function actionCreate() { $model = new Kategorija(); if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->getSession()->setFlash('success', Yii::t('app', 'Kategorija je kreirana.')); return $this->redirect(['create', 'id' => $model->katID]); } elseif (!\Yii::$app->request->isPost) { $model->load(Yii::$app->request->get()); $model->atributiIDs = ArrayHelper::map($model->atributi, 'nazivAtr', 'nazivAtr'); } return $this->render('create', ['model' => $model]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new Kategori();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Kategori Buku berhasil ditambahkan');\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 if (Yii::$app->user->can('create-artikal')) {\n $model = new Artikal();\n $model->scenario = 'create';\n $kategorija = new Kategorija();\n if ($model->load(Yii::$app->request->post())) {\n $this->uploadSlika($model);\n $kategorijaArtikal = new KategorijaArtikal();\n $nazivKategorije = Yii::$app->request->post('Kategorija')['naziv'];\n //$model->save();\n /*if(!$model->save()){\n $errors = $model->errors;\n\n }*/\n $model->save();\n $kategorijaArtikal->upisiKategorijuArtikla($model->id, $nazivKategorije);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'kategorija' => $kategorija,\n ]);\n }\n } else throw new ForbiddenHttpException;\n }", "public function actionCreate()\n {\n $model = new Category();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create() \n\t{\n\t\t$this->load->helper('form');\n\t\t$this->load->library('form_validation');\n\n\t\t// Form validasi untuk Nama Kategori\n\t\t$this->form_validation->set_rules(\n\t\t\t'nama_kategori',\n\t\t\t'Nama Kategori',\n\t\t\t'required|is_unique[kategori.nama_kategori]',\n\t\t\tarray(\n\t\t\t\t'required' => 'Please fill the %s',\n\t\t\t\t'is_unique' => 'Judul <strong>' . $this->input->post('nama_kategori') . '</strong> sudah ada.'\n\t\t\t)\n\t\t);\n\n\t\tif($this->form_validation->run() === FALSE){\n\t\t\t$this->load->view('Template');\n\t\t\t$this->load->view('kategori/CreateCategory_View');\n\t\t} else {\n\t\t\t$this->Kategori_Model->create_category();\n\t\t\tredirect('Kategori_Controller/');\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new DictCategory();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n //\n return view ('kategori/create');\n }", "public function actionCreate()\n {\n $model = new Tblcategory();\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 Categories();\n $uploadModel = new UploadForm();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $uploadModel->imageFiles = UploadedFile::getInstances($uploadModel, 'imageFiles');\n $uploadModel->upload($this->getCategoryPath($model->id_categories), $model, $this->property);\n\n return $this->redirect(['view', 'id' => $model->id_categories]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'uploadModel' => $uploadModel\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$this->layout=false;\n\t\t$model=new Category();\n\t\t$items = '<div class=\"alert alert-success alert-dismissable\">\n <i class=\"fa fa-check\"></i>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>\n <b>Correcto!</b> Categoria guardada correctamente.\n </div>';\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Category']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Category'];\n\t\t\t$model->createdAt = new CDbExpression('NOW()');\n\t\t\t//if($model->validate())\n\t\t\t//{\n\t\t\t\tif($model->save())\n\t\t\t\t{\n\t\t\t\t\t$this->layout=false;\n\t\t\t\t\theader('Content-type: application/json');\n\t\t\t\t\techo CJavaScript::jsonEncode($items);\n\t\t\t\t\tYii::app()->end(); \n\t\t\t\t\t//$this->redirect(array('view','id'=>$model->id));\n\t\t\t\t}\n\t\t\t//}\t\t\t\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new IDoCategory();\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 CatalogCategory();\n $model->scenario = $model::SCENARIO_CREATE;\n\n if ($model->load(Yii::$app->request->post())) {\n // Создание корневой категории\n if ($model->parent == 0 && $model->makeRoot()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n // Создание подкатегории\n if ($model->parent > 0) {\n $parent = self::findModel($model->parent);\n if ($model->appendTo($parent)) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Categories();\n\n if ($this->request->isPost) {\n if ($model->load($this->request->post()) && $model->save()) {\n $model->image = UploadedFile::getInstance($model, 'image');\n\n if ($model->image) {\n $model->upload();\n }\n \n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->loadDefaultValues();\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new FtsCategory();\n\t$this->layout = '@app/views/layouts/admin_layout.php';\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->fts_category_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Category();\n\n\n $allCategories = Category::getCategoryTree(0);\n\n $albums = WechatAlbum::find()->asArray()->indexBy('album_id')->all();\n $albums = array_column($albums, 'album_name', 'album_id');\n $albums[0] = '请选择';\n\n // 价格分级 grade 不允许为空,给默认值 0\n $model->grade = 0;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->cat_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'allCategories' => $allCategories,\n 'albums' => $albums,\n ]);\n }\n }", "public function create()\n {\n $this->authorize('create', Kategori::class);\n return view('admin.kategoris.create');\n }", "public function create()\n {\n return view('kategori.create');\n }", "public function create()\n {\n return view('kategori.create');\n }", "public function create()\n {\n return view('kategori.create');\n }", "public function create()\n {\n return view ('form.kategori.create');\n }", "public function create()\n {\n //\n $this->data['kategori'] = DB::table('tbl_kategori');\n return view('adminpemda.kategori.create', $this->data);\n }", "public function create()\n {\n return view('admin.kategori.create');\n }", "public function create()\n {\n return view('admin.kategori.create');\n }", "public function create()\n {\n return view('kategoria.create');\n }", "public function actionCreate()\n {\n $model = new Category();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n\n $rows = $this->query_categories();\n $rows = \\common\\components\\Category::unlimitedForLevel1($rows) ;\n\n $rows = $this->build_drop_down_tree($rows);\n\n// MyHelpers::p($rows) ;\n// foreach ($rows as $item)\n// {\n// MyHelpers::p($item ['key'] );\n// MyHelpers::p($item ['val'] );\n// }\n\n\n return $this->render('create', [\n 'model' => $model,'rows'=>$rows\n ]);\n }\n }", "public function actionCrear()\n {\n $model = new CategoriasPremios();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->guardarImagen('');\n if ($model->save()) {\n return $this->redirect(['detalle', 'id' => $model->idCategoria]);\n } else {\n return $this->render('crear', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('crear', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('pages.kategori.create');\n }", "public function actionCreate()\n {\n $model = new Categories();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->slug = self::translit($model->name);\n\n if ($model->save()) {\n // after ad was saved checking if image is set\n // if isset then update ad and store image\n $model->imageFile = UploadedFile::getInstance($model, 'imageFile');\n if ($model->imageFile && $filePath = $model->upload()) {\n $model->image = $filePath;\n $model->update(false);\n }\n Yii::$app->session->setFlash('success', 'Категория успешно создана');\n } else {\n Yii::$app->session->setFlash('error', 'Произошла ошибка');\n }\n return $this->redirect(['index']);\n }\n\n $categories = Categories::getCategoriesAsArray();\n return $this->render('create', [\n 'model' => $model,\n 'categories' => ArrayHelper::map($categories, 'id', 'name'),\n ]);\n }", "public function actionCreate()\n {\n $model = new AlbumCategory();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'aid' => $model->aid, 'cid' => $model->cid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n //\n $data = modelKategori::all();\n return view('crudkatalog.createkatalog', compact('data'));\n }", "public function create()\n {\n $kategoriler= Kategori::all();\n return view('admin.yazilar.create',compact('kategoriler'));\n }", "public function create()\n {\n $data['kategori'] = Kategori::all();\n return view('cabangolahraga.create', compact('data'));\n }", "public function create()\n {\n return view('kategori.form_kategori');\n }", "public function create()\n {\n return view('admin.kategori-create');\n }", "public function create()\n {\n return view('kategorijas.create');\n }", "function create(){\n redirect(admin_url('categories'));\n \n if(!$this->input->post('add_new_cat_btn')) redirect(admin_url('categories'));\n \n $this->form_validation->set_rules('name', 'Category Name', 'trim|strip_tags|alpha_numeric|max_length[30]');\n $this->form_validation->set_rules('slug', 'Category Slug', 'trim|strip_tags|max_length[30]');\n $this->form_validation->set_rules('num', 'Category Order Number', 'trim|strip_tags|max_length[2]|numeric');\n \n if($this->form_validation->run() == false) redirect(admin_url('categories'));\n \n $data = array(\n 'name' => $this->input->post('name'),\n 'slug' => $this->input->post('slug'),\n 'num' => $this->input->post('num')\n );\n \n $this->category_model->create($data);\n \n $this->data['view'] = 'admin/category/create';\n $this->load->view('admin/index', $this->data);\n }", "public function create()\n {\n $data['kategori'] = Kategori::all();\n return view('subkategori.create',compact('data'));\n }", "public function create()\n {\n $Kategori = Kategori::all();\n return view('Artikel.create', compact('Kategori'));\n }", "public function actionCreate()\n {\n /* @var $module \\mgrechanik\\yii2category\\Module */\n $module = $this->module;\n \n $modelClass = $module->categoryModelClass;\n $formClass = $module->categoryFormModelClass;\n $model = new $modelClass;\n\n\n $categoryForm = new $formClass(['model' => $model, 'module' => $module]);\n $categoryForm->scenario = BaseCategoryForm::SCENARIO_CREATE;\n $categoryForm->chooseRoot();\n $categoryForm->operation = BaseCategoryForm::OP_APPEND_TO;\n\n if ($categoryForm->load(Yii::$app->request->post()) && $categoryForm->validate()) {\n try {\n if ($id = $this->service->create($categoryForm, $module->validateCategoryModel)) {\n Yii::$app->session->setFlash('success', Yii::t('yii2category', $module->creatingSuccessMessage));\n return $this->redirect(\n $module->redirectToIndexAfterCreate ? ['index'] : ['view', 'id' => $id]\n );\n }\n } catch (\\Exception $e) {\n Yii::$app->errorHandler->logException($e);\n Yii::$app->session->setFlash('error', $e->getMessage());\n }\n }\n\n return $this->render($module->categoryCreateView, [\n 'categoryForm' => $categoryForm,\n ]);\n }", "public function create()\n {\n $kategori = Kategori::all();\n\n return view('produk.create', compact('kategori'));\n }", "public function create()\n {\n return view(\"admin.categorie.create\");\n }", "public function create()\n {\n $kategori = Kategori::all();\n return view('admin.produk.create', compact('kategori'));\n }", "public function create()\n {\n //ver formulario category\n return view('admin.categories.create');\n }", "public function create()\n {\n $category = Category::all();\n return view('kegiatan.create', compact('category'));\n }", "public function actionCreate()\n {\n if (Yii::$app->user->can('create_category')) {\n $model = new Category();\n\n if ($model->load(Yii::$app->request->post())){\n $model->created_dt = date('Y-m-d H:i:s');\n $model->save();\n \n //$request=Yii:$app->request->post('UserFormModel')['username']\n $myPost = Yii::$app->request->post('Category'); \n Yii::$app->session->setFlash('success', 'Successfully Inserted Category: '.$myPost['category'].'.');\n return $this->redirect(['index']);\n }\n\n return $this->renderAjax('create', ['model' => $model]);\n\n } else {\n throw new ForbiddenHttpException(\"You probably shouldn't be here.\");\n }\n }", "public function create()\n {\n \n\t\t $all_categories = $this->category->getCategories();\n\t\t $data = array('category' => $all_categories);\n\t\t\n return view('products.categories.newcategory', ['data' => $data]);\n }", "public function actionCreate()\n {\n $model = new TranslateCategory();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\n $kategoris = Kategori::all();\n return view('reseps.create', compact('kategoris'));\n }", "public function create()\n {\n return view('kategorijapdf.create');\n }", "public function create()\n\t{\n\t\t//\n\t\t$categoria = new categoria();\n\t\t$form_data = array('route' => 'categorias.store', 'method' => 'POST');\n $action = 'Crear';\n\t\treturn View::make('categorias.nuevo', compact('categoria','form_data', 'action'));\n\t}", "public function create()\n {\n $kat = categoryModel::all();\n return view('barang.tambah', ['kat' => $kat]);\n }", "public function create()\n {\n $kategoris = Kategori::all();\n return view('backend.article.create', ['kategoris' => $kategoris]);\n }", "public function create()\n {\n \treturn view('admin.category.add');\n }", "public function create()\n {\n return view('category_insert');\n }", "public function create()\n {\n return view('BackEnd.categories.add_new_category');\n }", "public function create()\n {\n //\n return view(\"admin.categories.create\");\n }", "public function create()\n {\n //\n return view('admin.addcategory');\n }", "public function actionCreate()\r\n\t{\r\n\t\t$model=new Matkul;\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['Matkul']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['Matkul'];\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_mk));\r\n\t\t}\r\n\r\n\t\t$this->render('create',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}", "public function createCategory(){\n $categories=$this->filesManager->chooseCategory();\n if(isset($_POST['create'])):\n $category= new Category(array(\n 'category_name'=>$_POST['category']\n ));\n $newCategory=$this->filesManager->addCategory($category);\n header('Location:'.$this->rootPath.'createCategory');\n endif;\n require('view/createCategoryView.php');\n }", "public function create()\n {\n //\n return view('admin.Categories.create');\n\n }", "public function create()\n {\n //$this.categories();\n return view('admin.category.create');\n }", "public function create()\r\n\t{\r\n\t\t$this->auth->restrict('Category.Content.Create');\r\n\r\n\t\tif ($this->input->post('submit'))\r\n\t\t{\r\n\t\t\tif ($insert_id = $this->save_category())\r\n\t\t\t{\r\n\t\t\t\t// Log the activity\r\n\t\t\t\t$this->load->model('activities/Activity_model', 'activity_model');\r\n\r\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('category_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'category');\r\n\r\n\t\t\t\tTemplate::set_message(lang('category_create_success'), 'success');\r\n\t\t\t\tTemplate::redirect(SITE_AREA .'/content/category');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tTemplate::set_message(lang('category_create_failure') . $this->category_model->error, 'error');\r\n\t\t\t}\r\n\t\t}\r\n\t\tAssets::add_module_js('category', 'category.js');\r\n\r\n\t\t$categories = $this->category_model->find_all();\r\n\r\n\t\tTemplate::set('toolbar_title', lang('category_create') . ' Category');\r\n\t\tTemplate::set('categories', $categories);\r\n\t\tTemplate::render();\r\n\t}", "public function create()\n {\n return view('backend.category.create');\n \n }", "public function create()\n\t{\n\t\t\n\t\t// Validate the data\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\t$this->blog_categories_m->insert($_POST)\n\t\t\t\t? $this->session->set_flashdata('success', sprintf( lang('cat_add_success'), $this->input->post('title')) )\n\t\t\t\t: $this->session->set_flashdata(array('error'=> lang('cat_add_error')));\n\n\t\t\tredirect('admin/blog/categories');\n\t\t}\n\t\t\n\t\t// Loop through each validation rule\n\t\tforeach($this->validation_rules as $rule)\n\t\t{\n\t\t\t$category->{$rule['field']} = set_value($rule['field']);\n\t\t}\n\t\t\n\t\t// Render the view\t\n\t\t$this->data->category =& $category;\t\n\t\t$this->template->title($this->module_details['name'], lang('cat_create_title'))\n\t\t\t\t\t\t->build('admin/categories/form', $this->data);\t\n\t}", "public function actionCreate()\n {\n $model = new Categories();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n for ($i = 1; $i < 6; $i++) {\n $project = new Projects();\n $project->category_id = $model->id;\n $project->user_id = Yii::$app->user->id;\n $project->title = \"Project {$i}\";\n $project->start_date = date(\"Y-m-d\");\n $project->end_date = date(\"Y-m-d\", strtotime(\"$project->start_date +14 days\"));\n $project->custom_field = \"TBD\";\n $project->save();\n }\n\n $cp_model = new UserCategoryPermissions();\n $cp_model->user_id = Yii::$app->user->id;\n $cp_model->category_id = $model->id;\n $cp_model->is_allowed = 1;\n $cp_model->save();\n }\n return $this->redirect(['clean-view', 'id' => base64_encode($model->id)]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('admin.category.create',[\n 'category'=>new Category()\n ]);\n \n }", "public function create()\n {\n $data['title'] = 'Add New Category';\n return view('admin.category.create',$data);\n }", "function create() {\n\n $data = array();\n $data['category_id'] = $_POST['product_category_id'];\n $data['name'] = $_POST['category_name'];\n\n $this->model->create($data);\n\n header('location: ' . URL . 'productCategories');\n }", "public function create(){ \n \n return view('admin.createCategory');\n }", "public function create()\n {\n //\n return view('product_categories.create');\n }", "public function create()\n {\n //\n return view('category.add');\n }", "public function create()\n {\n //Retorna el formulario\n return view('inzucosoftView.categories.create');\n }", "public function create()\n {\n //Display Add Category Form\n return view('admin.product_category.addProduct_category');\n }", "public function actionCreate()\n {\n $model = new KursComment();\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 create()\n {\n \n return view('admin.categories.create',[\n 'category'=> new category // se envia un proyecto vacio {{ old('xxxx', null)}} = {{ old('xxxx')}}, esta linea es para hacer identicos los formularios y poder reutizar uno para guardar y editar.\n ]);\n }", "public function create()\n {\n $kategori = Kategori::get();\n return view('admin.barang.create', compact('kategori'));\n }", "public function create()\n {\n $data['title'] = \"Admin | Tambah Kategori Laporan\";\n $data['layout'] = \"admin.manage_kategori.form\";\n return view('layouts.main', $data);\n }", "public function actionCreate()\n {\n $model = new SuratCuti();\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 create()\n {\n $category=Category::all();\n return view('backend.category.create',compact('category'));\n }", "public function create()//添加分类\n {\n $tree=new Category;\n $str=$tree->tree();\n\n return view('admin.category.add')->with('data',$str);\n }", "public function create()\n {\n if (!hasPermission('add_product', true)) {\n return redirect('categories');\n }\n return view('categories.create');\n }", "public function create()\n {\n return view('admin.categoreis.create');\n }", "public function create()\n {\n return view ('categories.create');\n }", "public function create()\n {\n //查询出父级分类\n //$rs = Category::all();\n // dump($rs);\n \n //查询出来的分类项进行排序\n $rs = DB::select('select *,concat(path,tid) as paths from goods_type ORDER BY paths asc');\n\n //分类项添加标识\n foreach($rs as $k => $v)\n {\n \t//通过path路径的逗号\n \t$info = count(explode(',',$v->path))-2;\n \t$v->tname = str_repeat('\\__', $info).$v->tname;\n\n \t//dump($v->tname);\n }\n\n //添加分类页面\n return view('category.create',[\n \t'title' => '分类的添加页面',\n \t'rs' => $rs\n ]);\n }", "public function create()\n {\n //\n return view('admin.category.create');\n }", "public function create()\n {\n //\n return view('admin.category.create');\n }", "public function create()\n {\n //\n return view('admin.category.create');\n }", "public function create()\n {\n //\n return view('admin.category.create');\n }", "public function create()\n {\n\t\treturn view('category.create');\n }", "public function actionCreate()\n {\n $model=new News;\n $categories = Categories::model()->findAll();\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['News']))\n {\n\n $model->attributes=$_POST['News'];\n if($model->save())\n $this->redirect($model->url);\n }\n\n $this->render('create',array(\n 'model'=>$model,\n 'categories' => $categories,\n ));\n }", "public function create()\n {\n createLog(Categorie::class);\n return view('backEnd.admin.blog.categorie.create');\n }", "public function create()\n {\n return view(\"admin.categories.create\");\n }", "public function create()\n {\n return view(\"admin.categories.create\");\n }", "public function create()\n {\n return view(\"admin.categories.create\");\n }", "public function create()\r\n {\r\n if(!$this->checkAccess(self::MODULE_NAME, 'C'))\r\n abort(401, 'Unauthorized action.');\r\n\r\n $model = new MstNewsCategory();\r\n\r\n $language = MstLanguage::all();\r\n\r\n return view('master.news_category.create', compact(['model','language']));\r\n }", "public function create()\n {\n $categories = $this->categorieRepository->getAll();\n return view('sousCategorie.add',compact('categories'));\n }", "public function create()\n {\n //\n return view ('Pages.Admin.Category.create');\n }", "public function create()\n {\n $kategori = Kategori::all();\n return view('dashboard.artikel.create', compact('kategori'));\n }", "public function create(){\n// return view('categories.create');\n return view('categories.create');\n }", "public function create()\n {\n\n return view( 'librarian/category/create');\n }", "public function create()\n {\n //\n return view('categories.create');\n }" ]
[ "0.83816445", "0.7921566", "0.7838714", "0.7718355", "0.7633045", "0.75982475", "0.7571439", "0.7544579", "0.75064725", "0.74854636", "0.748333", "0.7467748", "0.7464825", "0.74392676", "0.7429726", "0.74208903", "0.74208903", "0.74208903", "0.7399033", "0.73924136", "0.7378119", "0.7378119", "0.73774254", "0.73671794", "0.73495704", "0.73374975", "0.7322912", "0.72940975", "0.7281624", "0.7277815", "0.7261652", "0.72600377", "0.72508246", "0.72507215", "0.722269", "0.7191876", "0.7189502", "0.7176446", "0.71645886", "0.7140656", "0.713909", "0.71323484", "0.7129853", "0.71185213", "0.71096855", "0.7099606", "0.70973235", "0.708229", "0.70718664", "0.7059355", "0.7037063", "0.7035465", "0.70284474", "0.7027215", "0.70199037", "0.70027757", "0.69996446", "0.6999476", "0.69965214", "0.69939876", "0.69923776", "0.69831485", "0.6976241", "0.69760287", "0.69704956", "0.69665873", "0.69645923", "0.69627434", "0.69611245", "0.69587666", "0.6956362", "0.69521296", "0.6949471", "0.69420624", "0.69412446", "0.6926574", "0.691989", "0.6913974", "0.69123805", "0.6910472", "0.69037324", "0.6901125", "0.68990624", "0.68987983", "0.68987983", "0.68987983", "0.68987983", "0.68943995", "0.68920964", "0.688647", "0.6885895", "0.6885895", "0.6885895", "0.68837076", "0.68824613", "0.68737143", "0.68736804", "0.68701315", "0.68691045", "0.68651843" ]
0.8353612
1
Get Organization Status names array
Получить массив имен статусов организации
public static function getStatusArray() { return [ static::STATUS_DISABLED => Module::t('organization', 'STATUS_DISABLED'), static::STATUS_ACTIVE => Module::t('organization', 'STATUS_ACTIVE'), ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testgetStatusNames()\n {\n $this->assertEquals(Status::getStatusNames()[1], 'Draft');\n $this->assertEquals(Status::getStatusNames()[2], 'Submitted');\n $this->assertEquals(Status::getStatusNames()[3], 'Authorised');\n $this->assertEquals(Status::getStatusNames()[4], 'Paid');\n $this->assertEquals(Status::getStatusNames()[5], 'Void');\n $this->assertEquals(Status::getStatusNames()[6], 'Deleted');\n }", "public function getStatusList()\n {\n $statusArray = [\n self::STATUS_DRAFT => Yii::t('app', 'Draft'),\n self::STATUS_PUBLISHED => Yii::t('app', 'Published'),\n ];\n\n return $statusArray;\n }", "public static function statuses(): array\n {\n return [\n 'pending' => __('Pending'),\n 'on_hold' => __('On Hold'),\n 'in_progress' => __('In Progress'),\n 'completed' => __('Completed'),\n 'cancelled' => __('Cancelled'),\n 'failed' => __('Failed'),\n 'refunded' => __('Refunded'),\n ];\n }", "public static function listStatuses(): array\n {\n global $request_tbl;\n return getEnums($request_tbl, \"status\");\n }", "public static function getStatusList()\n {\n return array(\n self::STATUS_DRAFT => 'Borrador',\n self::STATUS_PRESENTED => 'Presentado',\n self::STATUS_PUBLISHED => 'Publicado',\n self::STATUS_UNPUBLISHED => 'Despublicado',\n self::STATUS_DELETED => 'Eliminado',\n );\n }", "public static function getOrderStatus()\n {\n $arrStatus = array();\n\n if (($objStatus = OrderStatus::findAll(array('order' => 'sorting'))) !== null) {\n\n /** @var OrderStatus $status */\n foreach ($objStatus as $status) {\n $arrStatus[$status->id] = $status->getName();\n }\n }\n\n return $arrStatus;\n }", "public static function statusNames()\n {\n return [\n self::STATUS_PENDING,\n self::STATUS_ACCEPTED,\n self::STATUS_DENIED,\n ];\n }", "public function getStatusArr() {\n\t\treturn array(\n\t\t\t''=>'All Status',\n\t\t\tself::STATUS_WAITING \t\t=> 'Waiting',\n\t\t\tself::STATUS_REQUEST_CANCEL => 'Requested Cancel',\n\t\t\tself::STATUS_CANCEL \t\t=> 'Cancel',\n\t\t\tself::STATUS_DECLINE \t\t=> 'Declined',\n\t\t\tself:: STATUS_IN_PROGRESS \t=> 'In progress',\n\t\t\tself:: STATUS_RESOLVED \t=> 'Resolved',\n\t\t\tself:: STATUS_COLSED \t=> 'Closed',\n\t\t);\n\t}", "function emarking_get_statuses_as_array() {\n $statuses = array();\n $statuses[] = EMARKING_STATUS_MISSING;\n $statuses[] = EMARKING_STATUS_ABSENT;\n $statuses[] = EMARKING_STATUS_SUBMITTED;\n $statuses[] = EMARKING_STATUS_GRADING;\n $statuses[] = EMARKING_STATUS_PUBLISHED;\n $statuses[] = EMARKING_STATUS_REGRADING;\n $statuses[] = EMARKING_STATUS_ACCEPTED;\n return $statuses;\n}", "protected function getStatuses()\n {\n static $statuses = [];\n\n if (empty($statuses)) {\n $statuses = db_get_hash_array('SELECT s.yad_status_id, s.yad_status_code, sd.yad_status_name'\n . ' FROM ?:yad_statuses as s LEFT JOIN ?:yad_status_descriptions as sd USING(yad_status_id)', 'yad_status_code');\n }\n\n return $statuses;\n }", "public static function getStatusArray()\n\t{\n\t\tif(empty(self::$statusArray))\n\t\t{\n\t\t\tself::$statusArray = array\n\t\t\t(\n\t\t\t\tself::STATUS_IN_DESIGN\t=> array('label' => 'In-Design', 'icon-class' => 'button-study-status-indesign'),\n\t\t\t\tself::STATUS_LAUNCHED\t => array('label' => 'Launched', 'icon-class' => 'button-study-status-launched'),\n\t\t\t\tself::STATUS_LIVE\t\t => array('label' => 'Live',\t 'icon-class' => 'button-study-status-live'),\n\t\t\t\tself::STATUS_COMPLETE\t => array('label' => 'Complete', 'icon-class' => 'button-study-status-complete'),\n\t\t\t);\n\t\t}\n\t\treturn self::$statusArray;\n\t}", "public static function getStatusList()\n {\n $droptions = Status::find()->asArray()->all();\n return Arrayhelper::map($droptions, 'status_value', 'status_name');\n }", "public function getStatuses() {\n\n\t$status[CalendarEvent::NOTPUBLISHED] = 'No Publicado';\n\t$status[CalendarEvent::PUBLISHED] = 'Publicado';\n\t$status[CalendarEvent::ARCHIVED] = 'Archivado';\n\n\treturn $status;\n\t}", "public static function getStatusList()\n {\n $list = [];\n foreach (static::$statuses as $status) {\n $list[$status] = l($status, [], 'appmultilang');\n // alternative => $list[$status] = l(static::class.'.'.$status, [], 'appmultilang');\n }\n\n return $list;\n }", "public static function getStatuses() : array\n {\n return [\n self::STATUS_FREE,\n self::STATUS_RESERVED,\n self::STATUS_TAKEN\n ];\n }", "private function getOrderStatuses() {\n $orderStatuses = array();\n\t\t$db = JFactory::getDbo();\n\t\t$query = 'SELECT `order_status_code` AS value, `order_status_name` AS text\n FROM `#__virtuemart_orderstates`\n WHERE `virtuemart_vendor_id` = 1\n ORDER BY `ordering` ASC ';\n\t\t$db->setQuery($query);\n\t\t$values = $db->loadObjectList();\n\t\tforeach ($values as $value) {\n $id = $value->value;\n $name = $value->text;\n $index = strrpos($name, \"_\");\n $name = substr($name, $index + 1, strlen($name));\n $orderStatuses[] = array('id' => $id, 'name' => $name);\n }\n return $orderStatuses;\n }", "public function commonStatuses(): array\n {\n return $this->whereNotIn('name', $this->excludedStatuses)->pluck('description', 'name')->all();\n }", "public function getStatuses():array\n {\n return [\n self::STATUS_ACTIVE => Yii::t('menu', 'Active'),\n self::STATUS_DISABLE => Yii::t('menu', 'Disable'),\n ];\n }", "public static function getStatusList() \n {\n return [\n self::STATUS_ACTIVE => 'Active',\n self::STATUS_RETIRED => 'Retired'\n ];\n }", "public static function getStatusList() \n {\n return [\n self::STATUS_ACTIVE => 'Active',\n self::STATUS_RETIRED => 'Retired'\n ];\n }", "protected function listStatus()\n {\n return [\n [\n 'value' => 'active',\n 'text' => Translator::translate('ACTIVE')\n ],\n [\n 'value' => 'unactivated',\n 'text' => Translator::translate('UNACTIVATED')\n ],\n [\n 'value' => 'disabled',\n 'text' => Translator::translate('DISABLED')\n ]\n ];\n }", "public function get_workorder_statuses() {\n \t$results = DB::query(Database::SELECT, \"SELECT * FROM work_order_statuses\")\n \t ->as_object()\n \t ->execute($this->db);\n\n \t$statuses = array();\n \tforeach($results as $result) {\n \t\t$statuses[$result->id] = $result->name;\n \t}\n\n \treturn $statuses;\n }", "public function getStatuses()\n {\n /** @var Freeform_StatusModel[] $statusModels */\n $statusModels = craft()->freeform_statuses->getAllStatuses();\n $statuses = [];\n\n foreach ($statusModels as $status) {\n $statuses[$status->handle . ' ' . $status->color] = $status->name;\n }\n\n return $statuses;\n }", "public static function listStatus()\n {\n return [\n self::STATUS_ERASER => 'Borrador',\n self::STATUS_ACTIVE => 'Vigente',\n self::STATUS_FINISHED => 'Finalizado',\n self::STATUS_CANCELED => 'Cancelado',\n ];\n }", "public static function getStatusList()\n {\n return [\n self::STATUS_ACTIVE => 'Active',\n self::STATUS_RETIRED => 'Retired'\n ];\n }", "private function getOrderStatuses(): array\n {\n $orderStatuses = [];\n $statusCollection = $this->statusCollectionFactory->create();\n $statuses = $statusCollection->toOptionArray();\n foreach ($statuses as $status) {\n $orderStatuses[] = [\n \"title\" => $status[\"label\"],\n \"code\" => $status[\"value\"],\n ];\n }\n return $orderStatuses;\n }", "public function getStatus() : array {}", "public function getStatus() : array {}", "public function getStatus() : array {}", "public function getStatus() : array {}", "public function getStatus() : array {}", "public function getAllStatus() {\n\t\t$status = Mage::getModel('sales/order_status')->getCollection();\n\t\t$status = $status->getData();\n\t\t$newstatus = array();\n\n\t\tforeach($status as $key => $value) {\n\t\t\t$newstatus[$key+1] = $value;\n\t\t}\n\t\treturn $newstatus;\n\t}", "public static function arrayStatuses() {\n\n $statuses = array(\n 'all' => array(\n 'label' => __( 'All', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n 'publish' => array(\n 'label' => __( 'Publish', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n 'trash' => array(\n 'label' => __( 'Trash', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n )\n );\n return $statuses;\n }", "public static function getArrayStatus() {\n return array(\n self::STATUS_INACTIVE => DomainConst::CONTENT00408,\n self::STATUS_ACTIVE => DomainConst::CONTENT00539,\n self::STATUS_APPROVED => DomainConst::CONTENT00476,\n self::STATUS_CANCEL => DomainConst::CONTENT00477,\n self::STATUS_REQUIRED_UPDATE => DomainConst::CONTENT00478,\n );\n }", "public static function getStatuses()\n {\n if (self::$_statuses === null) {\n self::$_statuses = [\n self::STATUS_PENDING => __('Ordered'),\n self::STATUS_SHIPPED => __('Shipped'),\n self::STATUS_INVOICED => __('Invoiced'),\n self::STATUS_BACKORDERED => __('Backordered'),\n self::STATUS_RETURNED => __('Returned'),\n self::STATUS_REFUNDED => __('Refunded'),\n self::STATUS_CANCELED => __('Canceled'),\n self::STATUS_PARTIAL => __('Partial'),\n self::STATUS_MIXED => __('Mixed'),\n ];\n }\n return self::$_statuses;\n }", "public static function statuses()\n {\n return [\n self::STATUS_ACTIVE => 'Активна',\n self::STATUS_DISABLED => 'Отключена',\n ];\n }", "public static function getAllStatuses()\n\t{\n\t\t$statusList = \\CCrmStatus::GetStatusList('INVOICE_STATUS');\n\t\treturn array_keys($statusList);\n\t}", "public function getPossibleStatusArray()\n {\n $info = $this->getTableDescription();\n return $info['Status']['values'];\n }", "function getOrgTypeArray($orgs)\n{\n $result = [];\n\n foreach ($orgs as $org):\n $result[$org->title] = $org->field_organization_type;\n endforeach;\n\n return $result;\n}", "public function statusCodes(): array\n {\n return array_map(\n function($status)\n {\n return new Status($status->getCode(), $status->getDescription());\n },\n $this->annotations->named('Status')\n );\n }", "public function getOrderStatus()\n {\n $orderStatusUpdatedArray = [];\n $orderStatusArray = $this->_salesStatusCollection\n ->create()->toOptionArray();\n foreach ($orderStatusArray as $key => $orderStatus) {\n // if ($orderStatus['value']!='closed') {\n $orderStatusUpdatedArray[$orderStatus['value']] =\n $orderStatus['label'];\n // }\n }\n return $orderStatusUpdatedArray;\n }", "function getStatus() : array ;", "function commerce_expay_rules_transaction_status_list() {\n $statuses = commerce_payment_transaction_statuses();\n $list = array();\n foreach ($statuses as $status) {\n $list[$status['status']] = $status['title'];\n }\n return $list;\n}", "public static function listStatus()\n {\n return [\n self::STATUS_AVAILABLE => 'Available',\n self::STATUS_NOTAVAILABLE => 'Not Available',\n self::STATUS_INUSE => 'In Use',\n ];\n }", "public static function statuses()\n {\n return [\n self::STATUS_NOT_ACTIVE => Yii::t('common', 'Not Active'),\n self::STATUS_ACTIVE => Yii::t('common', 'Active'),\n self::STATUS_DELETED => Yii::t('common', 'Deleted')\n ];\n }", "public static function statuses()\n {\n return [\n self::STATUS_NOT_ACTIVE => Yii::t('common', 'Not Active'),\n self::STATUS_ACTIVE => Yii::t('common', 'Active'),\n self::STATUS_DELETED => Yii::t('common', 'Deleted')\n ];\n }", "private function getSystemOrderStatuses()\n {\n return array(\n '' => Translator::translate('orderStatusMapping.none'),\n 'open' => 'open',\n 'await' => 'awaiting payment',\n 'paid' => 'paid',\n 'proc' => 'processing',\n 'done' => 'completed',\n );\n }", "public function get_campaign_status() {\n\t\t$arr = array();\n\t\t$result = mysql_query(\"SELECT * FROM tbl_wfStatus\")\n\t\t\t\tor die(\"Could not connect: \" . mysql_error());\n\t\t\n\t\tfor ($i = 0; $i < mysql_num_fields($result); ++$i) {\n \t\t\t$arr[0][$i] = mysql_field_name($result,$i);\n \t\t}\n \t\t\n\t\t$i = 1;\n\t\twhile($row=mysql_fetch_array($result)){\n\t\t\t$j = 0;\n\t\t\tfor ($j = 0; $j < mysql_num_fields($result); ++$j) {\n\t\t\t\t$arr[$i][mysql_field_name($result,$j)] = $row[mysql_field_name($result,$j)];\n\t\t\t\t}\n\t\t\t++$i;\n\t\t}\n\t\treturn $arr;\n \t}", "function getInactiveOrgs()\n{\n $org_url = config('app.orgs_api_domain') . '/rest/organizations?_format=json&org_status=inactive';\n $org_data = file_get_contents($org_url);\n\n // Put the data into JSON format.\n $orgs = json_decode($org_data);\n\n return $orgs;\n}", "public static function getStatuses() {\n return static::$vars['status']['values'];\n }", "public static function showStatus()\n\t{\n\t\t$statuses = self::getStatusDao()->showStatus();\n\t\tforeach ($statuses as $status) {\n\t\t\tself::$statuses[$status->getIdStatus()] = $status->getNomeStatus();\n\t\t}\n\t\treturn self::$statuses;\n\t}", "public function getPublishedStatuses()\n {\n $statuses = [];\n\n foreach ($this->statuses as $config) {\n if (isset($config['elementPublished']) && $config['elementPublished'] == true) {\n $statuses[] = $config['name'];\n }\n }\n\n return $statuses;\n }", "public function getValidStatuses()\n {\n $validStatuses = [];\n foreach ($this->getStatuses() as $status) {\n $validStatuses[] = $status['name'];\n }\n\n return $validStatuses;\n }", "abstract protected function getModulesStatuses(): array;", "public function getCapstoneProjectStatuses() {\n try {\n $sql = 'SELECT * FROM `capstone_project_status`';\n $results = $this->conn->query($sql);\n\n $statuses = array();\n foreach ($results as $row) {\n $statuses[] = self::ExtractCapstoneProjectStatusFromRow($row);\n }\n return $statuses;\n } catch (\\Exception $e) {\n $this->logger->error('Failed to get project statuses: ' . $e->getMessage());\n return false;\n }\n }", "public static function getArrayStatus() {\n return array(\n self::STATUS_INACTIVE => DomainConst::CONTENT00408,\n self::STATUS_ACTIVE => DomainConst::CONTENT00407,\n );\n }", "public function statusList() {\n return [\n self::DEAL_STATUS_UNKNOWN => $this->t('Unknown'),\n self::DEAL_STATUS_AVAILABLE => $this->t('Available'),\n self::DEAL_STATUS_UPCOMING => $this->t('Upcoming'),\n ];\n }", "public static function status(){\n\treturn [\n\t'Deactive','Active'\n\t];\n}", "public function getWorkflowstatusArray() {\r\n $wsList=$this->getWorkflowstatus();\r\n $result=array();\r\n // Initialize\r\n $statusList=SqlList::getList('Status');\r\n $profileList=SqlList::getList('Profile');\r\n foreach($statusList as $idFrom => $valFrom) {\r\n $result[$idFrom]=array();\r\n foreach($statusList as $idTo => $valTo) {\r\n if ($idFrom!=$idTo) {\r\n $result[$idFrom][$idTo]=array();\r\n foreach($profileList as $idProf => $valProf) {\r\n $result[$idFrom][$idTo][$idProf]=0;\r\n }\r\n }\r\n }\r\n }\r\n // Get Data\r\n foreach ($wsList as $ws) {\r\n $result[$ws->idStatusFrom][$ws->idStatusTo][$ws->idProfile]=$ws->allowed;\r\n }\r\n return $result;\r\n }", "function getActiveOrgs()\n{\n $org_url = config('app.orgs_api_domain') . '/rest/organizations?_format=json&org_status=active';\n $org_data = file_get_contents($org_url);\n\n // Put the data into JSON format.\n $orgs = json_decode($org_data);\n\n foreach ($orgs as $org) :\n $groupedOrgs[$org->field_organization_type][] = $org;\n endforeach;\n\n return $groupedOrgs;\n}", "public function statuses()\n {\n $statuses = [];\n\n foreach($this->statuses as $station) {\n $statuses[$station->id()] = $station->status();\n }\n\n return $statuses;\n }", "protected function getStatuslist() {\n $statii = explode(',', $this->status);\n $statuslist = array();\n foreach ($statii as $status) {\n @list($process, $stat) = explode(':', $status);\n $statuslist[$process][$stat] = TRUE;\n }\n return $statuslist;\n }", "public function accountStatus()\n {\n $arr = array();\n $arr['sapi'] = $this->httpRequest(\"v1/account/status\", 'GET', [ 'sapi' => true ], true);\n return $arr;\n }", "public function getStatuses()\r\n {\r\n if ($this->_statuses == null) {\r\n\r\n $statuses = array();\r\n $helper = Mage::helper('CrmTicket');\r\n\r\n //deprecated\r\n //$statuses[MDN_CrmTicket_Model_Ticket::STATUS_NEW] = $helper->__('New');\r\n //$statuses[MDN_CrmTicket_Model_Ticket::STATUS_RESOLVED] = $helper->__('Resolved');\r\n //\r\n //hardcoded status\r\n $statuses[MDN_CrmTicket_Model_Ticket::STATUS_WAITING_FOR_CLIENT] = $helper->__('Waiting for client');\r\n $statuses[MDN_CrmTicket_Model_Ticket::STATUS_WAITING_FOR_ADMIN] = $helper->__('Waiting for admin');\r\n $statuses[MDN_CrmTicket_Model_Ticket::STATUS_CLOSED] = $helper->__('Closed');\r\n\r\n //deprecated\r\n //custom status\r\n //$statuses = $this->getCustomStatus($statuses);\r\n \r\n $this->_statuses = $statuses;\r\n }\r\n return $this->_statuses;\r\n }", "public static function getStatuses()\n {\n return self::$statuses;\n }", "public static function getStatuses()\n {\n return self::$statuses;\n }", "public static function getStatuses()\n {\n return self::$statuses;\n }", "public static function getStatuses()\n {\n return self::$statuses;\n }", "public function getAllStatusJSON() {\n\t\t$status = $this->getAllStatus();\n\t\t$JSONstatus = array();\n\t\t$helper = Mage::helper('nfe4web/data');\n\n\t\tforeach($status as $key => $value) {\n\t\t\t$JSONstatus[] = array('xOrderStatusID' => (string) $key, 'xStatus' => $value['label']);\n\t\t}\n\n\t\treturn Mage::helper('nfe4web/data')->jsonConvert($JSONstatus);\n\t}", "public static function getStatusList() {\n return [\n self::STATUS_INPROCESS, \n self::STATUS_FREEZED, \n self::STATUS_FINISHED\n ];\n }", "public static function getStatusArray()\n {\n return [\n self::DRAFT => trans_safe('post::message.draft'),\n self::FUTURE => trans_safe('post::message.future'),\n self::PENDING => trans_safe('post::message.pending'),\n self::PUBLISHED => trans_safe('post::message.published'),\n ];\n }", "public function getStatuses()\n {\n if (self::$_statuses === null) {\n self::$_statuses = array(\n self::PAYMENT_STATUS_REQUESTED => __('Requested'),\n self::PAYMENT_STATUS_PROCESSED => __('Processed'),\n self::PAYMENT_STATUS_CANCELED => __('Canceled'),\n );\n }\n return self::$_statuses;\n }", "public function get_status() {\n return array(\n 1 => __('Pending', 'clipe'), 2 => __('Cancelled', 'clipe'), 3 => __('In progress', 'clipe'), 4 => __('Completed', 'clipe'), 5 => __('New', 'clipe')\n );\n }", "public function listOrganizations()\n {\n $request = new Request('GET', $this->baseUri->withPath('/api/1.0/organizations'));\n $response = $this->httpClient->send($request, $this->options)->getBody()->getContents();\n $decodedResponse = \\GuzzleHttp\\json_decode($response, true);\n $status = $decodedResponse[\"status\"];\n\n if ($status === \"success\") {\n $organizations = array();\n foreach ($decodedResponse[\"data\"] as $organizationData) {\n array_push($organizations, new Organization($organizationData));\n }\n } else {\n throw new CardServicesClientException('Error getting organization list');\n }\n return $organizations;\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 }", "public static function get_item_statuses() {\n return array(\n self::ITEM_HEADER => get_string('statusitemheader', 'local_evtp'),\n self::ITEM_MANDATORY => get_string('statusitemmandatory', 'local_evtp'),\n self::ITEM_ELECTIVE => get_string('statusitemelective', 'local_evtp')\n );\n }", "public function getStatusCodesActive()\n {\n $codes = array(\n 'AC' => $this->_('Active appointment'),\n 'CO' => $this->_('Completed appointment'),\n );\n\n asort($codes);\n\n return $codes;\n }", "public function getStatusCodesActive()\n {\n $codes = array(\n 'AC' => $this->_('Active appointment'),\n 'CO' => $this->_('Completed appointment'),\n );\n\n asort($codes);\n\n return $codes;\n }", "public static function getPossibleStatuses(){\n $type = DB::select(DB::raw('SHOW COLUMNS FROM payment_clients WHERE Field = \"payments\"'))[0]->Type;\n preg_match('/^enum\\((.*)\\)$/', $type, $matches);\n $values = array();\n foreach(explode(',', $matches[1]) as $value){\n $values[] = trim($value, \"'\");\n }\n return $values;\n }", "public function fetchAvailableStatuses()\n\t{\n\t\t$objStatuses = $this->getStatusesModel()->fetchContactStatuses(array(\n\t\t\t'qp_limit' => 'all',\n\t\t\t'qp_export_fields' => 'id,status',\n\t\t\t'qp_disable_hypermedia' => 1\n\t\t));\n\t\t\n\t\treturn $objStatuses;\n\t}", "public function getValidStatuses() {}", "public static function getAllStatus()\n {\n $statuses = \\App\\TaskStatus::select('id','status')->get()->toArray();\n $result = [];\n foreach ($statuses as $key => $status) {\n $result[$status['status']] = $status['id']; \n }\n return $result;\n }", "public static function getStatusList()\n {\n $list = [];\n foreach (static::$statuses as $status) {\n $list[$status] = l(get_called_class().'.'.$status, [], 'appmultilang');\n // alternative => $list[$status] = l(static::class.'.'.$status, [], 'appmultilang');\n }\n\n return $list;\n }", "public function statuses()\n\t{\n\t\treturn Status::where('group_slug', $this->slug)->get();\n\t}", "public static function get_registraritem_statuses() {\n return array(\n self::REGITEM_NOTAPPLICABLE => get_string('statusregitemnotapplicable', 'local_evtp'),\n self::REGITEM_NOTSTARTED => get_string('statusregitemnotstarted', 'local_evtp'),\n self::REGITEM_INPROGRESS => get_string('statusregiteminprogress', 'local_evtp'),\n self::REGITEM_COMPLETED => get_string('statusregitemcompleted', 'local_evtp')\n );\n }", "public static function getStatuses()\n {\n return array(\n self::PRODUCT_BACKLOG,\n self::SPRINT_BACKLOG,\n self::DOING,\n self::BLOCKED,\n self::TO_VALIDATE,\n self::DONE,\n );\n }", "public static function getAllStatusesNames($lang = null)\n\t{\n\t\treturn \\CCrmStatus::GetStatusList('INVOICE_STATUS');\n\t}", "public static function getStatusOptions()\n\t{\n\t\t// from the database rather than being hardcoded in like this.\n\t\t$stubArray = array();\n\t\t$stubArray[] = \"Opened\";\n\t\t$stubArray[] = \"Waiting on Parts\";\n\t\t$stubArray[] = \"Waiting on Customer\";\n\t\t$stubArray[] = \"Waiting on Labor\";\n\t\t$stubArray[] = \"In Progress\";\n\t\t$stubArray[] = \"Completed\";\n\t\treturn $stubArray;\n\t}", "public function getParcelStatuses(): array\n {\n $data = [];\n $url = \"https://panel.sendcloud.sc/api/v2/parcels/statuses\";\n $method = \"get\";\n $data[\"headers\"] = array(\n \"Accept\" => \"application/json, text/plain, */*\"\n );\n $response = [\n 200 =>\n array(\n '$type' => 'OBJ_ARRAY',\n '$ref' => 'HarmSmits\\\\SendCloudClient\\\\Models\\\\ParcelStatus',\n ),\n ];\n $responseFilter = null;\n return [$method, $url, $data, $response, $responseFilter];\n }", "public static function getStatusMap() : array\n {\n return [\n self::STATUS_NEW => 'Новое',\n self::STATUS_CANCELED => 'Отменено',\n self::STATUS_STARTED => 'В работе',\n self::STATUS_FINISH => 'Выполнено',\n self::STATUS_FAILED => 'Провалено',\n ];\n }", "function bibdk_openuserstatus_agency_names($agencies) {\n $named_agencies = array();\n\n foreach ($agencies as $agency) {\n $named_agencies[$agency] = bibdk_openuserstatus_get_agencyname($agency);\n }\n\n return $named_agencies;\n}", "public function getAuditData(){\n\n\t $audit_list = Audit::get_audit_list();\n\t $status_audit = array();\n\t foreach(array_reverse($audit_list) as $key => $value) {\n\t if($value['field_name'] == 'Status:') {\n\t array_push($status_audit, $value);\n\t }\n\t }\n\n\t return $status_audit;\n\n\t}", "function cs_get_activity_statuses() {\n\t$activity_statuses = array(\n\t\t'cs-pending' => _x( 'Pending', 'Activity status', 'communityservice' ),\n\t\t'cs-approved' => _x( 'Approved', 'Activity status', 'communityservice' ),\n\t\t'cs-cancelled' => _x( 'Declined', 'Activity status', 'communityservice' ),\n\t);\n\treturn apply_filters( 'cs_activity_statuses', $activity_statuses );\n}", "private final function getStatus(){\r\n $sReturn = \"\";\r\n foreach ( $this->asStatus as $vStatus ){\r\n if ( $vStatus !== \"\" ){\r\n $sReturn .= \"<p>$vStatus</p>\";\r\n } // if ( $vStatus !== \"\" ){\r\n } // foreach ( $this->asErrors as $vErrorCode ){\r\n $this->asStatus = [];\r\n return $sReturn;\r\n }", "public function getOrderStatus()\n {\n $statuses = $this->getDoctrine()->getRepository(self::$orderStatusEntityName)->findAll();\n $locale = $this->getUser()->getLocale();\n $statusArray = [];\n\n foreach ($statuses as $statusEntity) {\n $status = new OrderStatus($statusEntity, $locale);\n $statusArray[] = array(\n 'id' => $status->getId(),\n 'status' => $status->getStatus()\n );\n }\n return $statusArray;\n }", "public function getEveryStatus()\n {\n static $status;\n\n if ($status) {\n return $status;\n }\n\n $status = array(\n 'U' => $this->_('Valid from date unknown'),\n 'W' => $this->_('Valid from date in the future'),\n 'O' => $this->_('Open - can be answered now'),\n 'A' => $this->_('Answered'),\n 'M' => $this->_('Missed deadline'),\n 'D' => $this->_('Token does not exist'),\n );\n\n return $status;\n }", "function get_app_status_array()\n {\n return array_unique($this->app_status_array, SORT_REGULAR);\n }", "private function getProjectStatusCodes() {\n\n $codes = DB::table('project_status')->get();\n\n return $codes;\n }", "function get_organizations_list()\n {\n return \\App\\Organization::where('id', '>', 1)->lists('name', 'id')->all();\n\n }", "public static function getStatusCodeNames()\n {\n if (!self::$statusCodeNames) {\n self::initStatusCodeNames();\n }\n return self::$statusCodeNames;\n }" ]
[ "0.66668063", "0.6640496", "0.65331465", "0.649368", "0.6492959", "0.64765644", "0.6454387", "0.644671", "0.64304066", "0.6426488", "0.6417033", "0.6375826", "0.63597935", "0.63423556", "0.6339273", "0.63329816", "0.6276009", "0.6259116", "0.6256161", "0.6256161", "0.6240965", "0.62391895", "0.6238647", "0.62299496", "0.62283015", "0.6223954", "0.6188681", "0.6186628", "0.6186628", "0.6186628", "0.6186628", "0.61772484", "0.61727387", "0.6171569", "0.61656773", "0.61648405", "0.6158406", "0.6147009", "0.61441106", "0.6144063", "0.61421025", "0.6142043", "0.61265326", "0.61222476", "0.6121669", "0.6121669", "0.611958", "0.6101492", "0.6092308", "0.6083299", "0.6071757", "0.60630244", "0.6051363", "0.60268074", "0.6010254", "0.60077846", "0.6005824", "0.6004205", "0.5987596", "0.5964031", "0.5961097", "0.5950318", "0.5943076", "0.59415585", "0.5938094", "0.5938094", "0.5938094", "0.5938094", "0.5936037", "0.59324574", "0.59317183", "0.5916902", "0.59164166", "0.5911956", "0.59033716", "0.5900774", "0.58988774", "0.58988774", "0.58884764", "0.58846974", "0.58846647", "0.5882623", "0.58797705", "0.5876755", "0.5876151", "0.58638144", "0.5857905", "0.5849975", "0.58471996", "0.584589", "0.5841405", "0.583515", "0.58270097", "0.58246976", "0.5814214", "0.58089733", "0.5795104", "0.5791094", "0.57864547", "0.5784795" ]
0.7217468
0
Get Organization status name
Получить имя статуса организации
public function getStatusName() { return ArrayHelper::getValue(static::getStatusArray(), $this->status); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStatusName() {\n\t\t$status = CalendarEvent::getStatus();\n\t\treturn $status[$this->getStatus()];\n\t}", "public function getStatusName(): string\n {\n switch ($this->status) {\n case -1:\n return \"Rejected\";\n case 0:\n return \"Waiting approval\";\n case 1:\n return \"Approved\";\n default:\n return \"Unknown\";\n }\n }", "public function getNomeStatus()\n {\n return AtendimentoService::nomeSituacao($this->getStatus());\n }", "public function getStatusAsString(): string\n {\n return $this->statuses[$this->status];\n }", "public function getStatusAsString()\n {\n $list = self::getStatusList();\n if (isset($list[$this->status]))\n return $list[$this->status];\n \n return 'Unknown';\n }", "public function getStatusAsString()\n {\n $list = self::getStatusList();\n if (isset($list[$this->status]))\n return $list[$this->status];\n\n return 'Unknown';\n }", "public function getStatusStr() {\n\n switch ($this->_status) {\n case self::STATUS_DRAFT: return 'Draft';\n break;\n case self::STATUS_PUBLISHED: return 'Published';\n break;\n default: return 'Unknown';\n break;\n }\n }", "public function statusLabel()\n {\n $list = self::listStatus();\n return isset($list[$this->ubi_estado]) ? $list[$this->ubi_estado] : $this->ubi_estado;\n }", "public function getStatus()\n {\n return 'Keep Up The Good Work, I crown you Associate Evangelist';\n }", "public function getStatusText(){\n switch($this->status){\n case self::STATUS_IN_EDITION:\n return 'In edition';\n break;\n case self::STATUS_READY:\n return 'Ready for development';\n break;\n case self::STATUS_IN_DEVELOPMENT:\n return 'In development';\n break;\n case self::STATUS_DEPLOYED:\n return 'Deployed';\n break;\n default:\n return 'Unknown';\n break;\n }\n return 'Unknown';\n }", "public function getStatusName($status)\n\t{\n\t\t$arr=Vacation::getStatusArr();\n\t\treturn $arr[$status];\t\n\t}", "public function getStatus(): string\n {\n return $this->_data['status'];\n }", "public function getStatus(): string\n {\n return $this->_data['status'];\n }", "public function getStatus(): string\n {\n return $this->toArray()['status'];\n }", "public function getStatusAsString()\n {\n $list = self::getStatusList();\n if (isset($list[$this->active]))\n return $list[$this->active];\n \n return 'Unknown';\n }", "public function getStatusNameAttribute()\n {\n if ($this->attributes['status'] == self::STATUS_WAITING) {\n return 'Waiting';\n }\n if ($this->attributes['status'] == self::STATUS_ON_PROGRESS) {\n return 'On Progress';\n }\n if ($this->attributes['status'] == self::STATUS_COMPLETED) {\n return 'Completed';\n }\n return 'Stopped';\n }", "public function getNomestatus()\n {\n return $this->nomestatus;\n }", "public function getStatusString()\n\t{\n\t\t$repr = self::getStatusMap();\n\t\treturn $repr[$this->status];\n\t}", "public function getStatusText()\n {\n return 'entity.reservation.field.status.' . $this->status;\n }", "public function getStatusStr() {\n\n switch ($this->_status) {\n case self::STATUS_ACTIVE: return 'Active';\n break;\n case self::STATUS_HIDDEN: return 'Hidden';\n break;\n default: return 'Unknown';\n break;\n }\n }", "public function getStatus(): string\n {\n return $this->status;\n }", "public function getStatus(): string\n {\n return $this->status;\n }", "public function getStatus(): string\n {\n return $this->status;\n }", "public function getStatus(): string\n {\n return $this->status;\n }", "public function getStatusNameAttribute()\n {\n $status = $this->menuStatusList();\n\n return $status[$this->status];\n }", "public function statusLabel()\n {\n $list = self::listStatus();\n\n return isset($list[$this->status]) ? $list[$this->status] : $this->status;\n }", "public function get_civil_status()\r\n {\r\n return ucwords($this->mpersistent->get_value(\"Personal_Civil_Status\"));\r\n }", "public function getStatusAsString() {\n $result = '';\n switch ($this->active) {\n case 0: $result = 'Pendiente'; break;\n case 1: $result = 'Activa'; break;\n case 2: $result = 'Completada'; break;\n }\n\n return $result;\n }", "public function get_status():string;", "public function getStatus(): string\n {\n $estado = 'Inactivo';\n if ($this->status == '1') {\n $estado = 'Activo';\n } elseif($this->status == '1') {\n $estado = 'Eliminado';\n }\n return $estado;\n }", "public function getStatusString () {}", "public function get_status():string { return $this->status; }", "public function organizationName(): string\n {\n return $this->organizationName;\n }", "public function organizationName(): string\n {\n return $this->organizationName;\n }", "public function getStatus(): string\n\t{\n\t\treturn $this->status;\n\t}", "public function getStatusNameAttribute()\n\t{\n\t\treturn camel_case(User::$statusList[$this->status]);\n\t}", "public function getStatusName($status = null)\n {\n $status = (empty($status)) ? $this->status : $status ;\n\n if ($status === self::STATUS_DRAFT)\n {\n return Yii::t('app', 'Draft');\n }\n else\n {\n return Yii::t('app', 'Published');\n }\n }", "public function get_status_label() {\n if ($this->status === NULL){\n return NULL;\n }\n return Survey_entity::$statuses[$this->status];\n }", "public function status(): string\n {\n return $this->status;\n }", "function course_status_name($statusId)\n {\n return Course::$userStatuses[$statusId] ?? '';\n }", "public function getStatus()\n {\n return (string)$this->status;\n }", "public function getStatus()\n {\n return isset($this->status) ? $this->status : '';\n }", "public function getStatus()\n {\n return isset($this->status) ? $this->status : '';\n }", "public function presentStatusText() {\n switch($this->status_id){\n case User::STATUS_ACTIVE:\n return \"Active\";\n break;\n default:\n return \"Inactive\";\n break;\n }\n }", "public function getStatus() {\n if (isset(self::getArrayStatus()[$this->status])) {\n return self::getArrayStatus()[$this->status];\n }\n return '';\n }", "public function getStatus() {\n if (isset(self::getArrayStatus()[$this->status])) {\n return self::getArrayStatus()[$this->status];\n }\n return '';\n }", "public function getStatusString() {\n switch($this->status) {\n case self::STATUS_NOT_READY: return \"not ready\";\n case self::STATUS_READY: return \"ready\";\n case self::STATUS_IN_PROGRESS: return \"in progress\";\n case self::STATUS_PAUSED: return \"paused\";\n case self::STATUS_TESTING: return \"testing\";\n case self::STATUS_COMPLETED: return \"completed\";\n case self::STATUS_ABORTED: return \"aborted\";\n }\n }", "public function getAccountStatus() : string\n {\n return $this->accountStatus;\n }", "public function statusInText(){\n\n if($this->trashed()){\n return 'deleted';\n }\n switch($this->status){\n\n case 0:\n return 'draft';\n \n case 1:\n return 'published';\n\n default:\n return 'unknown';\n\n }\n return 'unknown';\n }", "abstract public function getShopOrderStatusName();", "public function getStatus() : string\n {\n return ($this->isCanceled() ? 'canceled' : ($this->isPaid() ? 'done' : 'pending'));\n }", "private function _getDeploymentStatus(): string\n {\n $status = StatusRecord::findOne([]);\n\n if ($status) {\n return $status->status;\n } else {\n $this->resetDeployFlag();\n return 'idle';\n }\n\n return $status->status;\n }", "public function getDisplayStatusAttribute()\n {\n return ucfirst($this->status);\n }", "public function status(): string;", "public function getStatusAsString()\n {\n return self::$statusMap[$this->status]['symbol'];\n }", "public function getStatusName() {\n return self::$_CONDITIONS[$this->status];\n }", "public function getStatus() : string;", "public function getStatusText(): string\n {\n return $this->statusText;\n }", "public function status()\n {\n return ($this->status)? 'Active': 'Pending';\n }", "public function getStatus()\r\n {\r\n $status = $this->need('status');\r\n\r\n if (isset(self::$statusOptions[$status])) {\r\n return self::$statusOptions[$status];\r\n } else {\r\n return 'Unknown';\r\n }\r\n }", "function get_book_status_name($status)\n{\n\t$status_name = array('在库', '借阅中','借出','归还中', '待购', '续借中', '下架');\n\treturn $status_name[$status];\n}", "public function get_order_status_name($status) {\n $statuses = $this->order_statuses;\n \n if (isset($statuses[$status])) {\n $status_name = $statuses[$status];\n } else {\n $status_name = 'N/A';\n }\n \n return $status_name;\n }", "public function getStatusName($status) {\n $status_name = \"\";\n switch($status)\n {\n case \"1\" :\n $status_name = '予約済'; //submit\n break;\n case \"2\" :\n $status_name = 'pending';\n break;\n case \"3\" :\n $status_name = 'confiremd';\n break;\n case \"4\" :\n $status_name = '支払い済'; //paid\n break;\n case \"5\" :\n $status_name = 'paid/check-in ';\n break;\n case \"6\" :\n $status_name = '使用中'; //using\n break;\n case \"7\" :\n $status_name = '遅れ';\n break;\n case \"8\" :\n $status_name = '対応終了';\n break;\n case \"9\" :\n $status_name = 'キャンセル';//cancel\n break;\n case \"10\" :\n $status_name = '連絡なし';\n break;\n }\n return $status_name;\n }", "public static function getBuildStatusName($status) {\n $spec = self::getBuildStatusSpec($status);\n return $spec['name'];\n }", "function get_status($status_id){\n\t\t\tif($status_id == '1'){\n\t\t\t\treturn 'Active';\n\t\t\t}elseif($status_id == '2'){\n\t\t\t\treturn 'InActive';\n\t\t\t}else{\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}", "public function getStatusTextAttribute(): string\n {\n switch ($this->status) {\n case self::STATUS_UNAUTHORIZED:\n $text = __('Belum Otorisasi'); break;\n case self::STATUS_PARTIALLY_AUTHORIZED:\n $text = __('Otorisasi Sebagian'); break;\n case self::STATUS_AUTHORIZED:\n $text = __('Sudah Otorisasi'); break;\n case self::STATUS_PREPARED:\n $text = __('Sudah Siap'); break;\n case self::STATUS_ON_DELIVERY:\n $text = __('Mengirim'); break;\n case self::STATUS_DELIVERED:\n $text = __('Terkirim'); break;\n case self::STATUS_BILL:\n $text = __('Siap Buat Nota'); break;\n }\n\n return $text;\n }", "public function getStringStatus()\n {\n $now = new \\DateTime();\n\t\tif($now <= $this->enddate){\n\t\t\t$sStatus=\"In progress\";\n\t\t}else{\n\t\t\t$sStatus=\"Completed\";\n\t\t}\n\t\treturn $sStatus;\n }", "public function getStatusAttribute()\n {\n return Status::find($this->attributes['status'])->description;\n }", "public function getOrgName(){\n\t\treturn($this->org_name);\n\t}", "public function getStatusLabel()\r\n {\r\n return $this->status ? Yii::t('app', 'Active') : Yii::t('app', 'Inactive');\r\n }", "public function getStatus() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"status\");\n\t}", "public function getStatus() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"status\");\n\t}", "public function printStatus()\n {\n switch ($this->status) {\n case $this::STATUS_INACTIVE:\n return \\Yii::t('app', 'Inactive');\n break;\n case $this::STATUS_ACTIVE_LOCKED:\n return \\Yii::t('app', 'Locked');\n break;\n case $this::STATUS_ACTIVE_UNLOCKED:\n return \\Yii::t('app', 'Unlocked');\n break;\n }\n\n return \\Yii::t('app', 'Unknown status');\n }", "public function getCurrentStatus(): string\n {\n return $this->latestStatus()\n ->value('status');\n }", "function wc_get_order_status_name($status)\n {\n }", "public function status()\n {\n return self::$statuses[$this->status];\n }", "public function getEventStatus() {\n\n $translate = Zend_Registry::get('Zend_Translate');\n if (!empty($this->declined)) {\n return \"<span style='color: red;'>\" . $translate->translate(\"Declined\") . \"</span>\";\n }\n\n if (!empty($this->pending)) {\n return $translate->translate(\"Approval Pending\");\n }\n if (!empty($this->approved)) {\n return $translate->translate(\"Approved\");\n }\n\n\n if (empty($this->approved)) {\n return $translate->translate(\"Dis-Approved\");\n }\n\n return \"Approved\";\n }", "function getStatusText();", "public function getStatus()\n {\n $value = $this->get(self::STATUS);\n return $value === null ? (string)$value : $value;\n }", "public function StatusString()\n\t{\tif (isset($this->details['adminstatus']))\n\t\t{\treturn $this->status_options[(int)$this->details['adminstatus']];\n\t\t}\n\t}", "public function getCurrentStatusName() : ?string\n {\n $statuses = self::getStatusMap();\n return $statuses[$this->currentStatus] ?? null;\n }", "public function getStatusLabel()\n {\n return $this->_statusLabel;\n }", "private function status()\n {\n $identifier = GameIdentifier::fromString($this->id());\n $game = $this->repository()->get($identifier);\n\n echo 'Get game status: ' . $game->id() . PHP_EOL;\n echo (string) $game;\n\n $result = '';\n $status = $game->status();\n foreach ($status as $fireResult) {\n $result .= '- ' . $fireResult . PHP_EOL;\n }\n\n return 'STATUS' . PHP_EOL\n . '- SCORE ' . $game->score() . PHP_EOL\n . $result;\n }", "public function getOrgDisplayName()\n {\n return $this->org_display_name;\n }", "public function statusToText(){\n\n if($this->trashed()){\n return 'deleted';\n }\n switch($this->status){\n\n case 0:\n return 'inactive';\n\n case 1:\n return 'active';\n \n case 2:\n return 'blocked';\n\n default:\n return 'unknown';\n\n }\n return 'unknown';\n }", "public static function getStatusName($status)\n {\n $statuses = self::getStatusesList();\n return isset($statuses[$status]) ? $statuses[$status] : 'Неопределено';\n }", "public function getFormattedStatus()\n {\n if (isset($this->statusOptions[$this->status])) {\n return $this->statusOptions[$this->status];\n }\n return $this->status;\n }", "public function status(){\n return $this->getValue(\"status\");\n }", "public function getStatus()\n {\n return parent::getValue('status');\n }", "public function getVerificationStatusAttribute()\n {\n $name = \"\";\n if ($this->verified_by === null) {\n return \"Need Verified\";\n } else {\n try {\n $verified = Admin::find($this->verified_by);\n $name = $verified->name;\n } catch (ModelNotFoundException $exception) {\n\n }\n return $name;\n }\n }", "public function getTooltipStatus()\n {\n $status = $this->getApplicationStatus();\n\n if (str_contains($status, \"Completed\")) {\n return \"Activity has completed\";\n } else if (str_contains($status, \"Not completed\")) {\n return \"Activity has passed\";\n } else if (str_contains($status, \"Senior\")) {\n return \"Activity is in progress\";\n } else if (str_contains($status, \"Application confirmed\")) {\n return \"Activity has confirmed volunteer\";\n } else if (str_contains($status, \"Application(s) received\")) {\n return \"Activity has volunteer waiting for approval\";\n } else if ($this->datetime_start->isToday()) {\n if ($this->datetime_start->isPast()) {\n return \"Activity has passed\";\n } else {\n return \"Activity is today\";\n }\n }\n\n return \"\";\n }", "public function get_status() {\n $statuses = \\local_evtp\\utils::get_registrarplan_statuses();\n return $statuses[$this->status];\n }", "protected function getStatusName($id) {\n return isset($this->statuses[$id]) ? $this->statuses[$id]['name'] : '';\n }", "private function getStatusName(string $status)\n {\n if ($status == 'p') {\n return \"pendente\";\n }\n\n if ($status == 'r') {\n return \"resolvido\";\n }\n\n if ($status == 'a') {\n return \"acordo\";\n }\n\n if ($status == 'j') {\n return \"justica\";\n }\n\n if ($status == 'cej') {\n return \"cob.ext.jud\";\n }\n\n if ($status == 'c') {\n return \"cancelado\";\n }\n }", "public function getStatus() {\n return $this->getServiceResponse(\"status\");\n }", "public function get_Status()\r\n\t{\r\n\t\tif (($this->status == \"private\") || ($this->status == \"public\"))\r\n\t\t\treturn $this->status;\r\n\t\telse\r\n\t\t\treturn \"draft\";\r\n\t}", "function get_status() {\n return $this->status;\n }", "public static function get_status()\n {\n return \\Causal\\IgLdapSsoAuth\\Library\\Ldap::getInstance()->getStatus();\n }", "public function __toString()\n {\n return strtolower($this->status);\n }", "public function getFormattedStatus() {\n $string = '';\n if (!$this->isOver()) {\n if ($this->ownTurn()) {\n $string = Util::lang('game.status.yourturn');\n } else {\n $string = Util::lang(\n 'game.status.nextturn',\n array('u' => $this->getCurrentPlayer())\n );\n }\n if ($this->isCheck()) {\n $string .= Util::lang('game.status.check');\n }\n } elseif ($this->isDraw()) {\n $string = Util::lang('game.status.draw');\n } else {\n $string = Util::lang(\n 'game.status.won',\n array('u' => $this->getCurrentPlayer())\n );\n }\n return $string;\n }" ]
[ "0.7399071", "0.73245025", "0.71887696", "0.71537614", "0.712692", "0.71184474", "0.69705504", "0.69384223", "0.6907855", "0.68915105", "0.68506926", "0.68500954", "0.68500954", "0.6848861", "0.68476677", "0.6826273", "0.68204135", "0.6816195", "0.6805513", "0.675601", "0.67447907", "0.67447907", "0.67447907", "0.67447907", "0.6744456", "0.6737965", "0.67229414", "0.671578", "0.66938806", "0.6689584", "0.6667862", "0.6660903", "0.665612", "0.665612", "0.6645827", "0.6626069", "0.66110027", "0.6606742", "0.6596858", "0.6592841", "0.65894586", "0.6581546", "0.6581546", "0.65726864", "0.6570663", "0.6570663", "0.65518683", "0.65395486", "0.65347195", "0.65258205", "0.6525013", "0.6513204", "0.6504838", "0.65016353", "0.6482383", "0.64799064", "0.6473913", "0.6471196", "0.6466528", "0.64544547", "0.6439189", "0.6438451", "0.64358264", "0.64291215", "0.6421095", "0.64127374", "0.6392943", "0.6388565", "0.638699", "0.6384044", "0.63709706", "0.63709706", "0.63662845", "0.6359275", "0.6356657", "0.6355975", "0.6350944", "0.6321637", "0.63150376", "0.6306342", "0.63062394", "0.62995976", "0.6290934", "0.6285125", "0.6279208", "0.62652105", "0.62581235", "0.62490666", "0.6246247", "0.6242737", "0.6242096", "0.62329537", "0.6214375", "0.6210413", "0.62018526", "0.6201693", "0.61972123", "0.6193305", "0.6178072", "0.61730915" ]
0.7432776
0
Displays a single Missions model.
Показывает один модель Missions.
public function actionView($id) { $mission = Missions::findOne($id); return $this->render('view', array('mission' => $mission)); // return $this->render('view', [ // 'model' => $this->findModel($id), // ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $missions = Mission::all();\n return view('mission.index', compact('missions'));\n }", "public function show()\n {\n\n $Missions=Mission::all();\n $Organisations=Organisation::all();\n $user=Auth::user();\n $Missions=Mission::all(); \n return view('ListMission',['Missions'=>$Missions,'Organisations'=>$Organisations,'user'=>$user]);\n }", "public function actionCreate()\n {\n $model = new Missions();\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 showAction(Mission $mission)\n {\n $deleteForm = $this->createDeleteForm($mission);\n\n return $this->render('mission/show.html.twig', array(\n 'mission' => $mission,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Mission $mission)\n {\n $equipments = DB::table('equipments')\n ->leftjoin('equipmentlist', function($join){\n $join->on('equipments.mission_id', '=', 'equipmentlist.mission_id');\n })\n ->get();\n\n $equipments = $equipments->where('mission_id', $mission->id);\n\n $volunteers = DB::table('volunteers')\n ->leftjoin('volunteerlist', function($join){\n $join->on('volunteers.id', '=', 'volunteerlist.volunteer_id');\n })\n ->get();\n\n $volunteers = $volunteers->where('mission_id', $mission->id);\n return view('mission.view', compact('mission', 'equipments', 'volunteers'));\n }", "public function model()\n {\n return Mission::class;\n }", "public function index(){\n\t\n\t\tif(!$this->ion_auth->logged_in() AND !$this->ion_auth->is_admin()){\n\t\t\tredirect('auth/login');\n\t\t}\n\t\n\t\t//first lets get all the missions\n\t\t//$missions is returned as an array\n\t\t$missions = $this->Mission_model->get_all_missions();\n\t\t//$missions['parameters'] returns as an array, so we need to export it to be shown\n\t\tif(!empty($missions)){\n\t\t\n\t\t\tforeach($missions as &$mission){\n\t\t\t\n\t\t\t\t$mission['parameters'] = (!empty($mission['parameters'])) ? var_export($mission['parameters'], true) : $mission['parameters'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$this->_view_data += array(\n\t\t\t'page_title'\t=> 'Missions Editor PHP Bounce',\n\t\t\t'missions'\t\t=> $missions,\n\t\t);\n\t\n\t\t$this->_load_views('mission_editor_view');\n\t\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $missions = $em->getRepository('MissionBundle:Mission')->findAll();\n return $this->render('mission/index.html.twig', array(\n 'missions' => $missions,\n ));\n }", "public function viewAction ( )\n {\n $model = $this->getModel($this->_modelName);\n $request = $this->getRequest();\n\n $model->load($request->getParam('id'));\n\n if (! $model->id) {\n $message = sprintf(self::MSG_LOAD_FAILURE, $this->_modelName);\n $this->flashAndRedirect($message, 'error', array(\n 'module' => $request->getModuleName(),\n 'controller' => $request->getControllerName(),\n 'action' => 'index',\n ), 'default', true);\n }\n\n $this->view->model = $model;\n\n }", "public function actionView()\n\t{\n\t\t$this->render('view', [\n\t\t\t'model' => $this->loadModel(),\n\t\t]);\n\t}", "public function show(Mission $mission)\n {\n $mission = Mission::find($mission->id);\n $user =User::all();\n $vehicule = Vehicule::all();\n $depence = Depence::Where([['user_id','=',$mission->user_id],['mission_id','=',$mission->id]])->get();\n $total = Depence::Where([['user_id','=',$mission->user_id],['mission_id','=',$mission->id]])->sum('montant');\n return view('mission.show', ['mission' => $mission,'vehicule'=> $vehicule,'user' =>$user,'depence' => $depence,'total'=>$total]);\n }", "public function actionView($id)\n {\n \n $model = Mainpersendisplay::find()->where(['questid'=>$id])->one();\n \n \n return $this->render('view', [\n 'model' => $model,\n ]);\n }", "public function actionView()\n\t{\n\t\t$this->render('viewnomina',array(\n\t\t\t//'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function show($id)\n {\n $missions = Mission::findOrNew($id);\n return Response::json($missions);\n }", "public function actionView()\n {\n $this->render('view', array('model' => $this->loadModel()));\n }", "public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function show($id)\n {\n return view(\"Under Construction\");\n }", "public function view()\n\t{\n\t\tinclude_once 'Modules/Chatroom/classes/class.ilChatroom.php';\n\n\t\tilChatroom::checkUserPermissions('read', $this->gui->ref_id);\n\n\t\t$this->gui->switchToVisibleMode();\n\n\t\tself::_checkSetup();\n\n\t\t$this->editSmiliesObject();\n\t}", "public function actionView($id)\n {\n\n // $motor = Motor::find()->all();\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $planeModels = $em->getRepository('AppBundle:PlaneModel')->findAll();\n\n return $this->render(\n 'planemodel/index.html.twig', array(\n 'planeModels' => $planeModels,\n )\n );\n }", "public function actionView($id)\n {\n \n \n $this->render('view', array(\n 'model' => Speciality::model()->loadContent($id),\n ));\n }", "public function index() {\n return view('main.missions.list');\n }", "public function show() {\n\t\t$this->loadView();\n\t}", "private function display()\n {\n\n // $queryAmmo = $this->db->query(\"SELECT * FROM Ammo;\");\n\n // $queryAccessories = $this->db->query(\"SELECT * FROM Accessories;\");\n \n // $this->TPL['listing'] = $query->result_array();\n\n // $this->TPL['listingAmmo'] = $queryAmmo->result_array();\n\n // $this->TPL['listingAccessories'] = $queryAccessories->result_array();\n\n $this->template->show('About', $this->TPL);\n\n }", "public function index()\n {\n $missions = Mission::all();\n return Response::json($missions);\n }", "public function display()\n\t{\n\t\t$layout = $this->input->get('layout');\n\t\t$view = $this->getView($layout);\n\n\t\t// Get/Create the model\n\t\tif ($model = $this->getModel()) {\n\t\t\t$this->output->setVars('content', $model);\n\t\t}\n\n\t\t$this->output->setBody('content', $view);\n\t}", "function show(){\n\t\t\t$testModel = M('test'); \n\t\t\t$data = $testModel->get();\n\t\t\t\n\t\t\t$testView = V('test');\n\t\t\t$testView->display($data);\n\t\t}", "public function index()\n\t{\n\t\t$admissions = Admission::all();\n\n\t\treturn View::make('admissions.index', compact('admissions'));\n\t}", "public function viewUStory() {\n\t\t\t\n\t\t\t\t$this->load->helper('form');\n\t\t\t\n\t\t\t$data = array();\n\t\t\t//$this->load->model('load_userStory');\n\t\t\t$data[ 'story' ] = $this->load_userStory->getContent();\n\t\t\t//$this->load->view('admin/ViewUserStories',$data);\n\t\t\t\n\t\t\t$this->load->view('ViewUserStories',$data);\n\t\t\t\n\t\t\t}", "public function actionView($id)\n {\n $movement = ComplaintDepartmentMovement::find()->where('complaint_id=:id', [':id'=>$id]);\n \n\n //print_r($movement);\n //exit;\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $movement\n ]);\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'movement' => $dataProvider\n ]);\n }", "public function actionView($id)\n\t{\n $model = $this->loadModel($id,array('lastServerInfo.playercount','lastServerInfo.playeractiveitems.member','addons','mission'));\n\n $addonIds = array();\n foreach ($model->addons as $addon) {\n $addonIds[] = $addon->id;\n }\n\n\n $addon=new Addon('search');\n $addon->unsetAttributes(); // clear any default values\n if(isset($_GET['Addon']))\n $addon->attributes=$_GET['Addon'];\n\n $addonDataprovider = $addon->search();\n $criteria = $addonDataprovider->getCriteria();\n $criteria->addInCondition('id',$addonIds);\n $addonDataprovider->setCriteria($criteria);\n\n $memberIds = array();\n if (!empty($model->lastServerInfo)) {\n foreach ($model->lastServerInfo[0]->playeractiveitems as $playerActiveItem) {\n if ($playerActiveItem->member_id) {\n $memberIds[] = $playerActiveItem->member_id;\n }\n }\n }\n\n $member=new Member('search');\n $member->unsetAttributes(); // clear any default values\n if(isset($_GET['Member']))\n $member->attributes=$_GET['Member'];\n\n $memberDataprovider = $member->search();\n $criteria = $memberDataprovider->getCriteria();\n $criteria->addInCondition('id',$memberIds);\n $memberDataprovider->setCriteria($criteria);\n\n\t\t$this->render('view',array(\n\t\t\t'model'=> $model,\n 'addon' => $addon,\n 'addonDataprovider' => $addonDataprovider,\n 'member' => $member,\n 'memberDataprovider' => $memberDataprovider,\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$h_id = Yii::app()->request->getParam('h', '');\n\t\tif($h_id == ''){\n\t\t\t$this->redirect(array('list'));\n\t\t}\n\t\t$id = AppHelper::two_way_string_decrypt($h_id);\n\t\tself::check_function_argument($id);\n\n\t\t$this->render('view',array(\n\t\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function actionView()\n {\n echo \"jdjasldjalks\";\n /*return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);*/\n }", "public function index()\n {\n if(Auth::user()->is_admin){\n $user = User::all();\n $mission = Mission::all();\n $vehicules = Vehicule::all();\n }\n else {\n $user = Auth::user()->get();\n $mission = Auth::user()->missions;\n $vehicules = Vehicule::all();\n }\n\n return view('mission.index',['missions' => $mission,'vehicules' =>$vehicules,'user' =>$user]);\n }", "public function actionView($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t 'story'=>$model->story,\n\t\t 'project'=>$model->story->pbacklogs[0]->project\n\t\t));\n\t}", "public function manage_mission() {\n\n $data = array();\n $data['all_mission_info'] = $this->super_admin_model->select_mission();\n// print_r($_POST);\n// print_r($data['all_mission_info'] );\n// exit();\n $data['admin_main_content'] = $this->load->view('admin/manage_mission_content', $data, true);\n $this->load->view('admin/admin_master', $data);\n }", "public function show($id)\n {\n\n $model = Motormodels::find($id);\n return view('Models.show')->with('model', $model);\n }", "public function actionView($id) {\n\t\t$this->render('view', array(\n\t\t\t'model' => $this->loadModel($id),\n\t\t));\n\t}", "public function actionView($id) {\n\t\t$this->render('view', array(\n\t\t\t'model' => $this->loadModel($id),\n\t\t));\n\t}", "public function show($id)\n {\n if (SourceController::objectivesStatusesChecked($id))\n {\n $mission = Mission::find($id);\n $mission->status_id = 5;\n $mission->save();\n }\n\n $result = Mission::with('status', 'staffMembers', 'objectives.status')->where('id', $id)->get();\n\n return Response::json($result, 200);\n }", "public function actionView($id)\n {\n return $this->findModel($id);\n\n }", "public function actionView($id){\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function show(CourseModel $courseModel)\n {\n //\n }", "public function show(){\n $this->init();\n\n switch ($this->model->isAuth()){\n case true:\n $this->serverApi = new MinecraftAPI(\"nobordercraft.fr\", 25565);\n $this->load(self::class, [\n 'api' => $this->serverApi\n ]);\n break;\n default:\n RouterException::notFound();\n break;\n }\n }", "public function detailsAction()\n {\n \t$job_id=\"2\";\n \t$dbhelper = new DbHelper();\n \t$job = $dbhelper->getJobDetailsById($job_id); \t\n \t$jobtranslator = new JobDbTranslator();\n \t$this->view->job = $jobtranslator->JobTranslator($job);\n\n }", "public function show($id)\n\t{\n\t\t$modelName = Session::get('modelName');\t\n\t\t$tableName = $modelName;\t\n\t\t$model = $this->model->findOrFail($id);\n\t\tif (is_null($model))\n\t\t\treturn Redirect::route($modelName. '.index');\n\t\t$organizations = Organization::lists('name', 'id');\n return View::make($modelName. '.show', compact('model', 'modelName', 'tableName', 'organizations'));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModelCompleto($id),\n\t\t));\n\t}", "public function edit(Mission $mission)\n {\n $mission = Mission::find($mission->id);\n $user =User::all();\n $vehicule = Vehicule::where('disponibilite','=','1')->get();\n $this->authorize('update',$mission);\n return view('mission.edit', ['mission' =>$mission,'vehicule'=> $vehicule,'user' =>$user]);\n }", "public function indexAction()\n\t{\n\t\t/** load view early so we can check for flash **/\n\t\t$view = $this->loadLayout();\n $this->_flashCheck();\n\n\t\t/** loads all lesson models **/\n\t\t$allLessonModels = Bootstrap::getModel('lesson/model')->loadAll();\n\n\t\t/**\n * if lesson data is properly retrieved from database and\n * available, bind data to views content block\n **/\n\t\t$view->getContent()->setLesson($allLessonModels);\n\t\t$view->render();\n\t}", "public function actionView()\n {\n Yii::trace(\"In actionView.\", \"application.controllers.ManagementController\");\n \n // Default to HTML output!\n $outputFormat = \"html\";\n \n if(isset($_GET['output']) && ($_GET['output'] == 'xml' || $_GET['output'] == 'json')) {\n $outputFormat = $_GET['output'];\n }\n \n if(!Yii::app()->user->isRestrictedArenaManager()) {\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(403, 'Permission denied. You are not authorized to perform this action.');\n }\n \n $this->sendResponseHeaders(403, 'json');\n echo json_encode(array(\n 'success' => false,\n 'error' => 'Permission denied. You are not authorized to perform this action.'\n )\n );\n Yii::app()->end();\n }\n \n // There is at least two GET required parameter: model & id\n // Depending on the model, there may be more required GET parameters\n // Those will be verified by each model's handler\n if(!isset($_GET['model']) || !is_string($_GET['model']) ||\n !isset($_GET['id']) || !is_numeric($_GET['id']) ||\n (integer)$_GET['id'] <= 0) {\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, 'Invalid parameters');\n }\n \n $this->sendResponseHeaders(400, 'json');\n echo json_encode(\n array(\n 'success' => false,\n 'error' => 'Invalid parameters',\n )\n );\n Yii::app()->end();\n }\n \n $modelName = $_GET['model'];\n $id = $_GET['id'];\n \n switch(strtolower(trim($modelName))) {\n case 'arena':\n $this->handleArenaView($id, $outputFormat);\n break;\n case 'event':\n $this->handleEventView($id, $outputFormat);\n break;\n case 'eventrequest':\n $this->handleEventRequestView($id, $outputFormat);\n break;\n case 'reservation':\n $this->handleReservationView($id, $outputFormat);\n break;\n case 'contact':\n $this->handleContactView($id, $outputFormat);\n break;\n case 'location':\n $this->handleLocationView($id, $outputFormat);\n break;\n case 'manager':\n $this->handleManagerView($id, $outputFormat);\n break;\n case 'arenareservationpolicy':\n $this->handleArenaReservationPolicyView($id, $outputFormat);\n break;\n case 'recurrence':\n $this->handleRecurrenceView($id, $outputFormat);\n break;\n default:\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, 'Unknown model');\n }\n \n $this->sendResponseHeaders(400);\n echo json_encode(\n array(\n 'success' => false,\n 'error' => 'Unknown model',\n )\n );\n Yii::app()->end();\n }\n }", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'multimedia'=>$this->loadModel($id),\n\t\t));\n\t}", "public function actionView($id)\n { \n return $this->findModel($id);\n \n }", "protected function findModel($id)\n {\n if (($model = Missions::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function actionView($id)\n {\n return $this->render('view', [\n 'model' => Name::findOne($id)\n ]);\n }", "public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }", "public function show($id)\n\t{\n\t\t$admission = Admission::findOrFail($id);\n\n\t\treturn View::make('admissions.show', compact('admission'));\n\t}", "public function edit(Mission $mission)\n {\n //\n }", "public function actionView($id)\n\t{\n $model = $this->loadModel($id);\n $courseItems = CourseItems::model();\n $courseItems->course_id = $model->course_id;\n \n //$classSchedule = ClassSchedule::model();\n //$classSchedule->enrollment_id = $id;\n $classSchedule=new ClassSchedule('search');\n\t\t$classSchedule->unsetAttributes(); // clear any default values\n $classSchedule->enrollment_id = $id;\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n //'students'=>$this->loadStudentModel(),\n //'teacher'=> Teacher::model(),\n 'teacher'=> $courseItems,\n 'studio'=> Studio::model(),\n 'classSchedule'=>$classSchedule\n\t\t));\n\t}", "public function actionView($id) {\n $model = $this->loadModel($id);\n $this->render('view', array('model' => $model,));\n }", "public function actionView($id)\n {\n $model = Mun::find()->where([\n 'mun_id' => $id,\n 'user_id' => Yii::$app->user->id,\n 'type' => Mun::TYPE_APPLICATION\n ])->limit(1)->one();\n\n if (!$model) {\n $model = $this->findModel($id);\n }\n\n return $this->render('view', [\n 'model' => $model,\n ]);\n }", "public function actionView($id)\n {\n $this->render('view', ['model' => $this->loadModel($id)]);\n }", "public function actionLoad()\n {\n /* @var $model Article */\n $model = new Article();\n $model->url = Article::makeUrl('load'); // current article\n\n return $this->render('load',['model' => $model]);\n }", "public function actionView($id)\n\t{\n\t\t$this->render('view', array(\n\t\t\t'model' => $this->loadModel($id),\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view', array(\n\t\t\t'model' => $this->loadModel($id),\n\t\t));\n\t}", "public function show(Lesson $lesson)\n {\n //\n }", "public function show(Lesson $lesson)\n {\n //\n }", "public function show(Lesson $lesson)\n {\n //\n }", "public function actionView($id){\n\t\t\n\t\t$model=$this->loadModel($id);\n\t\t$this->_appendInfos($model);\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function display() {\n\t\t\ttry {\n\t\t\t\tif(!is_null($this->id)) {\n\t\t\t\t\t$this->returnView($this->model->display($this->id));\n\t\t\t\t} else {\n\t\t\t\t\t$this->error404();\n\t\t\t\t}\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$this->session->add('error', $e->getMessage());\n\t\t\t\texit(header('Location: '.$_SERVER['HTTP_REFERER']));\n\t\t\t}\n\t\t\t$this->session->sUnset('error');\n\t\t}", "public function mission()\n {\n return $this->belongsTo(Mission::class);\n }", "public function actionView($id) {\n\n if (!empty($id)) {\n $model = $this->loadModel($id);\n }\n $this->render('view', array(\n 'model' => $model,\n ));\n }", "public function show($id) {\n return view('military::show');\n }", "public function actionView($id) {\r\n $this->render('view', array(\r\n 'model' => $this->loadModel($id),\r\n ));\r\n }", "public function actionView($id) {\r\n $this->render('view', array(\r\n 'model' => $this->loadModel($id),\r\n ));\r\n }", "public function actionView($id) {\r\n $this->render('view', array(\r\n 'model' => $this->loadModel($id),\r\n ));\r\n }", "public function actionView($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\t$this->render('view',array(\n\t\t\t\t'model' =>$model,\n\t\t));\n\t}", "public function actionView($id) {\n\t$this->render('view', array(\n\t 'model' => $this->loadModel($id),\n\t));\n }", "public function actionView($id) {\n\t$this->render('view', array(\n\t 'model' => $this->loadModel($id),\n\t));\n }", "public function show($id)\n {\n return view('Plane.edit_plane');\n }", "public function actionView($id)\n {\n $model = $this->loadModel($id);\n self::getTitle($model);\n\n $this->render('view',array(\n 'model'=>$model,\n ));\n }", "public function actionView($id) {\n\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }", "public function displayAction() {\r\n\r\n //GET TEXT AND LISTING ID\r\n $text = $this->_getParam('strr');\r\n $subjectType = $this->_getParam('subjectType');\r\n $subjectId = $this->_getParam('subjectId');\r\n\r\n if ($subjectType == 'sitereview_listing') {\r\n Engine_Api::_()->getDbTable('otherinfo', 'sitereview')->update(array('about' => $text), array('listing_id = ?' => $subjectId));\r\n } else {\r\n Engine_Api::_()->getDbTable('editors', 'sitereview')->update(array('about' => $text), array('user_id = ?' => $subjectId));\r\n }\r\n\r\n exit();\r\n }", "public function actionView($id)\n\t{\n $model = $this->loadModel($id);\n $this->render('view',array(\n 'model'=> $model,\n ));\n\t}", "public function show(OtModel $otModel)\n {\n //\n }", "public function actionView($id)\n {\n $model = $this->loadModel($id);\n $this->experiment = $model;\n $this->render('view',array(\n 'model'=>$model,\n ));\n }", "public function show(admission $admission)\n {\n //\n }", "public function actionView($id) {\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function actionView($id) {\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}" ]
[ "0.7070849", "0.69473004", "0.6859908", "0.6783377", "0.668736", "0.6651577", "0.6603774", "0.6565503", "0.6548924", "0.64352435", "0.6399761", "0.63937616", "0.62277454", "0.6204874", "0.6181815", "0.6139076", "0.6139076", "0.6139076", "0.61205137", "0.61175203", "0.61175203", "0.61175203", "0.61175203", "0.61175203", "0.61175203", "0.61175203", "0.61175203", "0.61175203", "0.60265565", "0.60262793", "0.60019517", "0.59724545", "0.5952474", "0.5936178", "0.5923621", "0.59186125", "0.5912875", "0.59107894", "0.5908016", "0.58909386", "0.58882815", "0.58878076", "0.58869165", "0.5880496", "0.5872878", "0.5861115", "0.5856799", "0.585508", "0.58408684", "0.58343476", "0.58343476", "0.58315283", "0.5831028", "0.58293504", "0.5829201", "0.5826565", "0.5825513", "0.58225435", "0.58224845", "0.58208513", "0.5813148", "0.5813043", "0.5811891", "0.58087826", "0.58059996", "0.5804593", "0.580181", "0.580108", "0.5800807", "0.57840014", "0.5780208", "0.5771015", "0.57703626", "0.5770113", "0.5767323", "0.5767323", "0.5766283", "0.5766283", "0.5766283", "0.576468", "0.57641256", "0.57632065", "0.5760929", "0.5755802", "0.5750861", "0.5750861", "0.5750861", "0.574631", "0.57449114", "0.57449114", "0.5740859", "0.57404315", "0.5739938", "0.57388014", "0.57355773", "0.5734617", "0.5733007", "0.5731204", "0.57239664", "0.57239664" ]
0.76342887
0
Creates a new Missions model. If creation is successful, the browser will be redirected to the 'view' page.
Создает новый объект Missions. Если создание успешно, браузер будет перенаправлен на страницу просмотра.
public function actionCreate() { $model = new Missions(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new VehicleManagement();\n $model->aliyeingiza = Yii::$app->user->identity->username;\n $model->muda = date('Y-m-d H:i:s');\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 Story();\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 Pengampu();\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 Cms();\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 SuratMasuk();\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\n }", "public function actionCreate()\n {\n $model = new $this->modelClass;\n\n if ($model->load($this->_request->post()) && $model->save()) {\n return $this->redirect([$this->viewView, 'id' => $model->$this->primaryKey]);\n } else {\n return $this->render($this->createView, [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n //$model = new DetalleMatricula();\n\t\t/*\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\t\treturn $this->redirect(Yii::$app->request->referrer);\n }", "public function create()\n {\n return view('mission.add');\n }", "public function actionCreate()\n {\n $model = new Room();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['room/open/'. $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->layout = static::FORM_LAYOUT;\n $model = new $this->MainModel;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $this->afterCreate($model);\n if ($this->hasView) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->redirect(['index']);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Apartment();\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 Apartment();\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 return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Patient;\n\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\n if (isset($_POST['Patient'])) {\n $model->attributes = $_POST['Patient'];\n if ($model->save())\n $this->redirect(array('admin', 'id' => $model->cid));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate()\n {\n $model = new Activity();\n\n if ($model->load(Yii::$app->request->post())){ \n\t\t\tif($model->save()) {\n\t\t\t\tYii::$app->getSession()->setFlash('success', 'New data have saved.');\n\t\t\t}\n\t\t\telse{\n\t\t\t\tYii::$app->getSession()->setFlash('error', 'New data is not saved.');\n\t\t\t}\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 Tuman();\n\n if ($model->load(Uni::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_Tuman]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Solicitud();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id_pext' => $model->id_pext, 'tipo_solicitud' => $model->tipo_solicitud, 'fecha_solicitud' => $model->fecha_solicitud]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\t\t\n $model = new Modulset();\n if ($model->load(Yii::$app->request->post())){\n\t\t\t\tif($model->validate()){\n\t\t\t\tif($model->save()) {\n\t\t\t\t\treturn $this->redirect(['view', 'id' => $model->MDL_ID]);\t\n\t\t\t\t} \n\t\t\t}\n\t\t}else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Agent();\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 Unsur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->IdUnsur]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n if(!Yii::$app->user->isAdminGroup){\n return $this->redirect('index');\n }\n\n $model = new Stamps();\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 Room();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return Url::to(['/room/update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Timetable();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Class' => $model->Class, 'Day of Week' => $model->DayofWeek, 'Exam' => $model->Exam, 'Lecture Room' => $model->LectureRoom, 'Period' => $model->Period, 'Programme' => $model->Programme, 'Released' => $model->Released, 'Semester' => $model->Semester, 'Stage' => $model->Stage, 'Unit' => $model->Unit, 'Unit Class' => $model->UnitClass]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\t$this->changeDBPuid();\n $model = new Tracking();\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 QueTracker();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => (string)$model->_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Appointments();\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 ExpoStand();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n print_r($model->getErrors());\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Departments();\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 $model = new Patient();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n \"polyclinics\" => Polyclinics::find()->orderBy(\"name\")->all(),\n 'statuses' => Statuses::find()->orderBy(\"sort desc, id asc\")->all(),\n 'treatments' => Treatments::find()->orderBy(\"sort desc, id asc\")->all(),\n 'formDiseases' => FormDiseases::find()->orderBy(\"sort desc, id asc\")->all(),\n 'patients' => Patient::find()->orderBy(\"name\")->all()\n ]);\n }", "public function actionCreate()\n {\n $model = new SuratCuti();\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 Game();\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 Cvpersonal();\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 Mtm();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'mtm_group_id' => $model->mtm_group_id, 'mtm_subject_id' => $model->mtm_subject_id, 'mtm_class_subject_id' => $model->mtm_class_subject_id, 'mtm_class_assets_id' => $model->mtm_class_assets_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Materia();\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\t{\n\t\t$model=new Courses;\n\n\t\tif(isset($_POST['Courses']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Courses'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('update','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Maestroclipro();\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\t{\n\t\t$model=new Tournament;\n\n\t\t$catCategory = new Category();\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Tournament']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Tournament'];\n\t\t\t\n\t\t\t/**\n\t\t\t * Default values.\n\t\t\t */\n\t\t\t$model->ACTIVE = 1;\n\t\t\t$model->TYPE = 0;\n\t\t\t$model->START_E = 8;\n\t\t\t\n\t\t\t\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\tYii::app()->user->setFlash('success', '<strong>!Listo</strong> Se ha creado el torneo y puede configurarlo.');\n\t\t\t\t\n\t\t\t\t$this->redirect(array('manage','id'=>$model->ID));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'catCategory'=>$catCategory,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Divipola();\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 Trabajador();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new PatientDiag;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['PatientDiag'])) {\n $model->attributes = $_POST['PatientDiag'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\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 if(Yii::$app->user->identity->PrivilegeID != 1)\n {\n $this->goHome();\n }\n $model = new Workspace();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->WorkspaceID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Meeting();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->MM_ID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Coleccion;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Coleccion']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Coleccion'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Herramientas;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Herramientas']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Herramientas'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('create','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Permohonan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->permohonan_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create(){\n $this->form_validation->set_rules('title','Title','required');\n $this->form_validation->set_rules('projObj','Objective','required');\n $this->form_validation->set_rules('projDesc','description','required');\n $this->form_validation->set_rules('projLoc','location','required');\n $this->form_validation->set_rules('projBud','budget','required');\n $this->form_validation->set_rules('projSource','source','required');\n\n if($this->form_validation->run()==false){\n $this->load->view('templates/header');\n $this->load->view('Projects/create');\n $this->load->view('templates/footer');\n }\n else{\n $this->projects_model->create_projects();\n }\n\n \n //return redirect to wherever\n \n }", "public function actionCreate()\n {\n $model = new tarjetacanon();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'nroTarjeta' => $model->nroTarjeta, 'idcanon' => $model->idcanon]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n\t\t$model = new Rol();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect('index');\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Appointment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \n Yii::$app->getSession()->setFlash('alert', [\n 'type' => 'success',\n 'duration' => 5000,\n 'icon' => 'fa fa-users',\n 'message' => 'สำเร็จ',\n 'title' => 'บันทึกข้อมูล',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n return $this->redirect(['view', 'ID' => $model->ID, 'nurse_id' => $model->nurse_id, 'patient_p_pid' => $model->patient_p_pid, 'patient_p_sid' => $model->patient_p_sid, 'doctor_iddoctor' => $model->doctor_iddoctor]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $modelName = $this->getModel();\n\t\t$model = new $modelName;\n\t\t$model->dt_create = date('c');\n\t\t$model->dt_update = date('c');\n\t\t$model->id_user_create = 1;\n\t\t$model->id_user_update = 1;\n\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t \n\t\t\t\t\treturn $this->redirect(['index']);\n\t\t\t\n } else {\n \n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new SystemRecord();\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\t\t$model = new Landing();\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->request_id]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new Pantau();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => (string)$model->_id]);\n echo Json::encode([\n 'status'=>'success',\n 'message'=>'Data berhasil disimpan.',\n 'redirect'=>Yii::$app->urlManager->createUrl('pantau/view/'.(string)$model->_id),\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model = new Dmpaper;\n\t\t$model->save();\n\n\t\treturn $this->redirect(['update', 'id' => $model->id]);\n\n\t\t/*if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}*/\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Juegos;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Juegos']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Juegos'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate() {\n $model = new $this->modelName;\n\n $this->performAjaxValidation($model);\n\n// print_r($_POST);\n// die();\n if (isset($_POST[$this->modelName])) {\n $model->attributes = $_POST[$this->modelName];\n if ($model->save()) {\n $this->redirect(array('update', 'id' => $model->id));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate()\n {\n $model = new Mun(['operator_id' => Yii::$app->operator->identity->id]);\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 Course();\n $model->scenario = 'self_create';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->course_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $us = Yii::$app->user->identity;\n if ($us->rol !== 'C') {\n return $this->goHome();\n }\n $model = new Tutores();\n\n\n\n if ($model->load(Yii::$app->request->post())) {\n $model->colegio_id = $us->colegio_id;\n if ($model->save()) {\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Presupuesto;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Presupuesto']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Presupuesto'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Article();\n $model->type=Article::TYPE_STATION;\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 Story();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n $model->setTags();//标签保存\r\n //return $this->redirect(['view', 'id' => $model->id]);\r\n Yii::$app->session->setFlash('success', '添加成功');\r\n return $this->redirect(['index']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\r\n\t{\r\n\t\t$model=new Matkul;\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['Matkul']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['Matkul'];\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_mk));\r\n\t\t}\r\n\r\n\t\t$this->render('create',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}", "public function actionCreate()\n {\n $model = new AdminCommemts();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Absen;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Absen']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Absen'];\n $is_success=$model->save();\n $this->notice($is_success,'Absen','create');\n\t\t\tif($is_success){\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n }else{\n $this->render('create',array(\n 'model'=>$model\n ));\n }\n\t\t}else{\n if($_GET['ajax'])\n $this->renderModal('create',array(\n 'model'=>$model,\n ));\n else\n $this->render('create',array(\n 'model'=>$model,\n ));\n }\n\t}", "public function actionCreate()\n {\n $model = new Loan();\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 }", "function create()\r\n {\r\n $page = $this->page;\r\n \r\n $this->load->library('form_validation');\r\n $this->load->model('gamemodel');\r\n \r\n // Validate form input\r\n $this->form_validation->set_rules('name', 'Name', 'required|max_length[200]');\r\n if ($this->form_validation->run() == FALSE)\r\n { \r\n // Show the form\r\n $page['content'] = 'game_form';\r\n $this->load->view('template', $page);\r\n }\r\n else\r\n {\r\n // Create the new game\r\n $game = new stdClass();\r\n $game->name = $this->input->post('name');\r\n $this->gamemodel->create($game);\r\n \r\n $this->session->set_flashdata('notice', 'Game created.');\r\n redirect('game/view/'.$this->db->insert_id(), 'refresh');\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Objects();\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 Raschet();\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()\r\n\t{\r\n\t\t$model = new Caja;\r\n\r\n $this->performAjaxValidation($model, 'caja-form');\r\n\r\n if(isset($_POST['Caja']))\r\n\t\t{\r\n\t\t\t$model->attributes = $_POST['Caja'];\r\n\t\t\tif($model->save()) {\r\n $this->redirect(array('view', 'id' => $model->ID));\r\n }\r\n\t\t}\r\n\r\n\t\t$this->render('create',array(\r\n\t\t\t'model' => $model,\r\n\t\t));\r\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Project;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Project']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Project'];\n\t\t\tif($model->save()){\n\t\t\t\t$this->createDefaultPermissions($model->Id_customer,$model->Id);\n\t\t\t\t$this->redirect(array('view','id'=>$model->Id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate() {\n $model = new TbStdTrpChemo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->std_trp_chemo_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new AutoMileage();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n } else {\n return $this->renderAjax('_form', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new TblLocations();\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 Minerhistory();\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\t{\n\t\t$model=new JadwalTugas;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['JadwalTugas']))\n\t\t{\n\t\t\t$model->attributes=$_POST['JadwalTugas'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Admin();\n\n $model->setScenario('create');\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 Visitors();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $model = Visitors::findOne(['id' => $model->id]);\n //发送通知\n $this->sendNotice($model);\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCrear()\n {\n $model = new PrioridadTarea();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['detalle', 'id' => $model->idPrioridadTarea]);\n } else {\n return $this->render('crear', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new AccionCentralizada();\n $model->usuario_creacion=Yii::$app->user->identity->id;\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 House();\n $post = Yii::$app->request->post();\n\n $modelForm = HouseForm::loadFromModel($model);\n if ($modelForm->load($post)) {\n if ($model = $modelForm->process()) {\n $this->saveSections($model);\n $this->saveFloors($model);\n // $this->saveRisers($model);\n $this->saveHouseUserAdmins($model);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'modelForm' => $modelForm,\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n\t\t$admissions = Admission::all();\n\t\t$admission_no = Admission::getAdmissionNumber();\n\t\treturn View::make('admissions.create', compact('admissions','admission_no'));\n\t}", "public function actionCreate()\n {\n $model = new Survey(['scenario'=>'create']);\n\n $date = date_create();\n\n\n $model->user_id = Yii::$app->user->identity->id;\n $model->survey_timestamp = date_timestamp_get($date);\n\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save() ) {\n\n\n\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 Course();\n $post = Yii::$app->request->post();\n if ($model->load($post) && $model->save()) {\n //插入属性\n CourseAttr::insterAttr($model->id, $post['CourseAtts'], true);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $model->loadDefaultValues();\n $model->create_by = Yii::$app->user->id;\n return $this->render('create', [\n 'model' => $model,\n 'templates' => CourseTemplate::getTemplate(), //模板\n 'course_models' => ArrayHelper::map(CourseModel::find()->all(), 'id', 'name'),\n 'teachers' => ArrayHelper::map(Teacher::find()->all(), 'id', 'name'),\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Regalumno();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_alumno]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new AllocationMaster();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => (string)$model->_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Members();\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\t\t$result = $this->result();\n $model = new Course();\n\t\t$department = (new \\yii\\db\\Query())->from('department')->all();\n\t\t$class = (new \\yii\\db\\Query())->from('class')->where('departmentId=1')->all();\n\t\tforeach($class as $v){\n\t\t\t$classs[($v['id'])] = $v['class'];\n\t\t}\n\t\tforeach($department as $v){\n\t\t\t$de[($v['id'])] = $v['department'];\n\t\t}\n if ($model->load(Yii::$app->request->post())){\n\t\t\t\n\t\t\t$qwe = (new \\yii\\db\\Query())->select(['name'])\n\t\t\t->from('course')->where('id='.($model->courseId))->one();\n\t\t\t$model->teacherId = Yii::$app->session['Loginid'];\n\t\t\t$model->courseName = $qwe['name'];\n\t\t\t$model->startTime = strtotime($model->startTime);\n\t\t\t$model->endTime = strtotime($model->endTime);\n\t\t\t$model->save();\n\t\t\t\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'class' => $classs,\n 'de' => $de,\n 'result' => $result,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Enrollment;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Enrollment']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Enrollment'];\n\t\t\tif($model->save()){\n\t\t\t\t//$this->redirect(array('view','id'=>$model->id));\n //exit(json_encode(array('result' => 'success', 'msg' => 'success')));\n $this->renderPartial('classSchedule',array('model'=>$model,'classSchedule'=>ClassSchedule::model()));\n exit();\n }else{\n exit(json_encode(array('result' => 'error', 'msg' => 'Opps error on saving data.')));\n }\n\t\t}else{\n $model->enrollment_type_id = 1;\n }\n \n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n 'students'=>$this->loadStudentModel(),\n 'bands'=>$this->loadBandModel(),\n 'groups'=>$this->loadGroupModel(),\n\t\t));\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Survey;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Survey']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Survey'];\n\t\t\tif($model->save())\n $this->redirect(array('admin'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Participantes();\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 News();\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n\r\n return $this->redirect(['index']);\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 Sched();\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 Campaign();\n $model ->campaignType =1;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->campaignID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"activity\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $activity = new Activity();\n $activity->activityname = $this->request->getPost(\"activityname\");\n $activity->activitydescription = $this->request->getPost(\"activitydescription\");\n $activity->activitydate = $this->request->getPost(\"activitydate\");\n $activity->activityplace = $this->request->getPost(\"activityplace\");\n \n\n if (!$activity->save()) {\n foreach ($activity->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"activity\",\n 'action' => 'new'\n ]);\n\n return;\n }\n\n $this->flash->success(\"activity was created successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"activity\",\n 'action' => 'index'\n ]);\n }", "public function actionCreate()\n {\n $model = new Purchase();\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 $class = $this->modelClass;\n $this->model = new $class();\n $this->setDefaultAttributes();\n if (isset($_POST[$this->modelClass]))\n {\n $this->model->attributes=$_POST[$this->modelClass];\n $this->performAjaxValidation();\n\n if($this->model->save()) {\n $data = $this->afterSave();\n if ($this->do_rendering) {\n Yii::app()->user->setFlash('saveobject',$this->messageObjectSaved);\n if ($this->redirect)\n $this->redirect(\n (isset($_POST['buttonSave']) && $_POST['buttonSave']=='Сохранить') ? '/admin/'.$this->crudalias\n : '/admin/'.$this->crudalias.'/update?id='.$this->model->primaryKey);\n else\n return $data;\n } else return $data;\n } else {\n $this->errorSave();\n Yii::log('AFTER CREATE ERROR:'.var_export($this->model->errors,true));\n if ( ! $this->do_rendering) return false;\n }\n }\n\n if ($this->do_rendering) \n $this->render('_form');\n else return true;\n }", "public function create() {\n $model = new boatramp();\n $model->addBoatRamp($_POST[\"ramp\"]);\n \n /*** Redirect User to BoatRamp/Index ***/\n header(\"location: index.php?rt=boatramp/index\");\n }", "public function actionCreate()\n {\n $model = new PdsTut();\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_pds_tut]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Svision();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }" ]
[ "0.70217514", "0.698438", "0.6876737", "0.6851674", "0.68001634", "0.67756325", "0.6771452", "0.67700434", "0.676512", "0.67505145", "0.67450917", "0.67386794", "0.6721619", "0.6716512", "0.6671333", "0.6644459", "0.66440547", "0.6637867", "0.66190284", "0.66184086", "0.6613594", "0.65829015", "0.65717185", "0.6568234", "0.6551311", "0.6546578", "0.65370613", "0.6535723", "0.65348953", "0.6530148", "0.6526307", "0.6517043", "0.65091777", "0.6501835", "0.65011865", "0.64963406", "0.6481733", "0.6476794", "0.64729", "0.64722663", "0.6466084", "0.64656836", "0.6437228", "0.64345974", "0.64268917", "0.6423235", "0.64213866", "0.64051205", "0.64010304", "0.63937503", "0.6382713", "0.6376748", "0.63761085", "0.63752", "0.6374119", "0.6372135", "0.63692224", "0.63683754", "0.63679016", "0.63583267", "0.6356267", "0.63458973", "0.63430727", "0.6340894", "0.6334923", "0.6334059", "0.63318497", "0.6324306", "0.6320261", "0.6318441", "0.6312759", "0.6305021", "0.6304287", "0.6303073", "0.6302213", "0.6301414", "0.63009334", "0.6300043", "0.62998116", "0.6294226", "0.62935513", "0.628969", "0.6288933", "0.6286648", "0.62796336", "0.62759364", "0.6275079", "0.6274624", "0.62732166", "0.6265864", "0.62635446", "0.6260896", "0.62588626", "0.6257096", "0.6256836", "0.6256829", "0.62552977", "0.6255152", "0.62547415", "0.6254536" ]
0.8884554
0
Finds the Missions model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
Находит модель Missions по значению первичного ключа. Если модель не найдена, будет выброшено исключение HTTP 404.
protected function findModel($id) { if (($model = Missions::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function findModel($id)\n\t{\n\t\tif (($model = Task::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Preadmission::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = ContentSource::findOne($id)) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Resolution::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($pk) {\n\t\t$model = parent::loadModel($pk);\n\t\t$activeContexts = $this->getActiveContexts();\n\t\tforeach ($activeContexts as $activeContext) {\n\t\t\t$foreignKeyName = $activeContext['foreignKeyName'];\n\t\t\tif ($model->$foreignKeyName != $activeContext['model']->getPrimaryKey()) {\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t\t}\n\t\t}\n\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Match::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = Project::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('app', 'Http.404'));\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Tournament::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n {\n $model=ADCampaign::model()->findByPk($id, \"company_id=:company_id\" ,array(':company_id' => Yii::app()->session['user']->company_id));\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id) {\n $model = Mentorship::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, \"The requested page does not exist.\");\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Params::findOne($id)) !== null) {\n return $model;\n }\n\n throw new HttpException(200,Yii::t('base',40001));\n }", "public function loadModel($id )\n\t{\n\t\t$admission= Admission::model()->findByPk($id);\n\t\tif($admission===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $admission;\n\t}", "public function loadModel($id) {\n $model = AppelOffre::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t ('app', 'The requested page does not exist.'));\n return $model;\n }", "public function loadModel($id='')\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(!empty($id))\n\t\t\t{\n\t\t\t\t$this->_model=Contract::find($id);\n\t\t\t}\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new \\yii\\web\\HttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}", "public function loadModel($id) {\n $model = Patient::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n\t\t$model = Campaign::findOne($id);\n\t\t\tif($model == null)\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\tif ($model->clientID == Yii::$app->user->identity->clientID) {\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\n }", "public function loadModel($id)\n {\n $model=GeoNames::model()->findByPk(new MongoID($id));\n\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\r\n {\r\n if (($model = Phase::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = LookupSubBase::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\n $model = Workstation::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = ContactMessage::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id) {\n $model = Project::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id) {\n $model = Alumni::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Ingresopersonal::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Plans::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = Team::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id) {\n\t\t$model=Operations::model()->findByPk($id);\n\t\tif($model===null || $model->to_account->user_id!=Yii::app()->user->id)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Matkul::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Matkul::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id) {\n $model = Companies::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=SubjectMaster::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Issue::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'El item solicitado no existe.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = System::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id) {\n if (($model = Attribution::findOne($id)) !== null) {\n return $model;\n }\n else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\n $model = JobAllocation::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=TimeTables::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function find($key): ?Model;", "protected function findModel($id) {\n if (($model = \\backend\\models\\Journal::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=GestionPresentaciontm::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=SkillDisposition::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Trabajadores::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'El enlace o direccion solicitado no existe');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = Movimiento::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id) {\n $model = PatientDiag::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Prestamo::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Permitintrans::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=ServiceCenter::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Herramientas::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Project::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Cmspage::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = MsEduLevelPhase::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=ContractInformation::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($pk);", "public function loadModel($id)\n\t\t{\n\t\t\t$model=SolicitudesServicio::model()->findByPk($id);\n\t\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t\treturn $model;\n\t\t}", "public function loadModel($id)\n\t{\n\t\t$model=TimeTable::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = VirtualClinicPatient::model()->findByPk((int) $id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id) {\n\t$model = Actuator::model()->findByPk($id);\n\tif ($model === null) {\n\t throw new CHttpException(404, 'The requested page does not exist.');\n\t}\n\treturn $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Cargarespumas::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\r\n\t{\r\n\t\t$model=EntCampanas::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "protected function findModel($id)\n {\n if (($model = ColRequest::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n\t\tif (($model = Gifts::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('Запрошенная Вами страница не найдена.');\n\t\t}\n }", "public function loadModel($id)\n\t{\n\t\t$model=Entreprise::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = Cargos::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id) {\n\t\tif (($model = StudentWorks::findOne($id)) !== NULL) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "function getObject($pk) {\n if (!static::$object) {\n return null;\n }\n $O = static::$object::lookup($pk);\n if (!$O) {\n throw new Http\\Exception\\Http404();\n }\n }", "protected function findModel($id)\r\n {\r\n if (($model = Story::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = Compra::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Compra::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id) {\n\t\tif (($model = Landing::findOne($id)) !== NULL) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Cajachica::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Press::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Pitch::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = ProofOfDelivery::model()->findByAttributes(array('pod_id' => $id, 'company_id' => Yii::app()->user->company_id));\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n\n return $model;\n }", "public function loadModel($id)\n {\n if(is_numeric($id)){\n $model=IngresoEmpleado::model()->findByPk($id);\n if($model===null){\n throw new CHttpException(404,'The requested page does not exist.');\n }\n return $model;\n }\n else{\n return null;\n }\n }", "protected function findModel($id)\n {\n if (($model = InformJob::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Query::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Msc::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Juegos::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function find($id) {\n //findOrFail means laravel will return a 404 error if it does not find the id passed in here\n $result = $this->model->findOrFail($id);\n return $result;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Route::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Discovery::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = ClubTry::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = AllocationMaster::findOne($id)) !== null) {\n\n return $model;\n }\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Guardians::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}", "protected function findModel($id){ \n \n if (($model = TransWh::findOne($id)) !== null) { \n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n \n }", "protected function findModel($id)\n {\n if (($model = Room::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=MatrimonyMembers::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Job::findOne(['_id' => $id, 'author_id' => \\Yii::$app->user->id])) !== null)\n {\n return $model;\n } else\n {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\n $model = Persona::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=ContentStep::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Klant::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($idTipoOrganismo)\n {\n if (($model = TipoOrganismo::findOne($idTipoOrganismo)) !== null)\n {\n return $model;\n } else\n {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Enrollment::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=LessonDoc::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t\t{\n\t\t\t$model=Task::model()->findByPk($id);\n\t\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t\treturn $model;\n\t\t}", "protected function findModel($id)\n {\n if ($model = $this->deployComponent->getProject($id)) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Course::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=SolicitudOc::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'La pagina solicitada no existe.');\n\t\treturn $model;\n\t}", "protected function findModel($id) {\n if (($model = A2Caja::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Multimedia::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}" ]
[ "0.66555995", "0.65655136", "0.6479837", "0.64576024", "0.6399199", "0.6365957", "0.6365868", "0.6347719", "0.6341536", "0.6298436", "0.6291481", "0.6286613", "0.62559956", "0.62495226", "0.62402964", "0.62170166", "0.621627", "0.621212", "0.6210539", "0.6196276", "0.6193125", "0.6184063", "0.617771", "0.6170708", "0.61636597", "0.61628413", "0.6156252", "0.61524117", "0.6146833", "0.6146833", "0.61463916", "0.61448455", "0.61440635", "0.61408883", "0.61392385", "0.61356074", "0.6131451", "0.613029", "0.6127616", "0.6127115", "0.61267984", "0.6116621", "0.6115401", "0.61130685", "0.61122656", "0.6110507", "0.6110276", "0.61079067", "0.61066175", "0.610648", "0.61024123", "0.61016554", "0.6099808", "0.6096468", "0.60958576", "0.60953134", "0.6093799", "0.60882175", "0.6086131", "0.6084518", "0.60828507", "0.6082801", "0.60819346", "0.6080114", "0.6075138", "0.60748595", "0.6074316", "0.6074316", "0.6072889", "0.6071529", "0.6066459", "0.6063384", "0.6060792", "0.6059538", "0.60532284", "0.6053064", "0.60500085", "0.6047034", "0.60412234", "0.60381985", "0.60375625", "0.60344553", "0.6034405", "0.60338867", "0.6033526", "0.6033309", "0.60317284", "0.6029679", "0.60292447", "0.6028644", "0.60276383", "0.60271335", "0.6025386", "0.6024246", "0.602056", "0.6020016", "0.60189044", "0.6018705", "0.60129505", "0.600879" ]
0.7035241
0
gets the noAvatar image
получает изображение noAvatar
public static function noAvatar() { $appl = JFactory::getApplication(); $component = $appl->input->getCmd('component'); $config = ccommentConfig::getConfig($component); $template = $config->get('template.template'); $jTemplate = $appl->getTemplate(); $templateMedia = JPATH_BASE . '/media/com_comment/templates/' . $template . '/images/nophoto.png'; $templateMediaOverride = JPATH_BASE . '/templates/' . $jTemplate . '/html/com_comment/templates/' . $template . '/images/nophoto.png'; if (is_file($templateMediaOverride)) { $noAvatar = JUri::base() . 'templates/' . $jTemplate . '/html/com_comment/templates/' . $template . '/images/nophoto.png'; } elseif (is_file($templateMedia)) { $noAvatar = JUri::base() . 'media/com_comment/templates/' . $template . '/images/nophoto.png'; } else { $noAvatar = JURI::base() . 'media/com_comment/images/noavatar.png'; } return $noAvatar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAvatarImage() {\n \t$avatar = $this->getUid() . \".jpg\";\n \tif ( file_exists($this->getAvatarAbsPath() . \"/\" . $avatar) ) return $this->AVATAR_DIR.\"/\".$avatar;\n else return 'typo3conf/ext/wpj/Resources/Public/img/weimarpedia_platzhalter_logo.gif';\n }", "function getEmptyUserImageUrl() {\n\t\treturn url('images/user.png');\n\t}", "public function avatar(){\n\t\treturn $this->exists() ? 'dance/'.$this->profile_link().'/img/prof/'.$this->data()->avatar_link : false;\n\t}", "function get_noimage($type=null,$image_name=null,$width=null,$height=null,$alt=null,$class_name=null)\n{\n\tif($image_name !=\"\") {\n\t\t return $image_name;\n\t }else{\n\t\t return media_url().\"no-images/no-image.jpg\";\n\t }\n}", "public function presentAvatarLarge() {\n return ($this->avatar != null) ? $this->avatar : '/img/empty_avatar.jpg';\n }", "public function getDefaultAvatar()\n {\n return $this->defaultAvatar ? url($this->defaultAvatar) : null;\n }", "protected function _getDefaultGravatarImage()\n {\n return '';\n }", "public function getAvatarAttribute()\n {\n return url('images/avatar-default.png');\n }", "public function getUserAvatar(){\n if($this->avatar==null)\n return url('images/default/logo.png');\n else\n return url('assets/images/users/'.$this->avatar);\n }", "public function getAvatar(){\n if(!$this->avatar){\n return asset('assets/images/faces/face1.jpg');\n }\n\n return asset('images/avatar/' . $this->avatar);\n }", "public function getAvatar($n = null) {\n if ($n == \"raw\")\n return $this->_get(\"avatar\");\n if ($n == null)\n $p = \"uploads/avatars/50x50/\".$this->_get('avatar');\n else\n $p = \"uploads/avatars/\".$n.\"x\".$n.\"/\".$this->_get('avatar');\n \n // Final step : return correct one if file found\n if (is_file($p))\n return '/'.$p;\n else\n if ($n == 32 || $n == 16)\n return \"/images/avatar_default.png\";\n else\n return \"/images/avatar_default.gif\";\n }", "public function getAvatar($avatar)\n\t{\n\n\t\tif($avatar){\n\t\t\techo ($avatar);\t\n\t\t}else{\n\t\t\techo (\"default.jpg\");\n\t\t}\n\n\t}", "public function getsAvatar()\n {\n return $this->sAvatar;\n }", "public function getAvatar(): ?string\n {\n return $this->avatar;\n }", "public function getAvatar(): ?string\n {\n return $this->avatar;\n }", "public function getAvatarUrl() {\n\t\tif ($this->id && $this->avatarUrl) {\n\t\t\treturn $this->avatarUrl;\n\t\t}\n\n\t\treturn 'https://cdn-resources.forexfactory.net/images/misc/avatar_default_16x16.png';\n\t}", "public function getAvatar(): ?string {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->response['imageUrl'];\n }", "public function getAvatar()\n {\n $path = Yii::getPathOfAlias('webroot'). '/uploads/avatar/' . $this->id.'/profile/'.$this->avatar;\n if(file_exists($path)) {\n $path = Yii::app()->baseUrl. '/uploads/avatar/' . $this->id.'/profile/'.$this->avatar;\n } else {\n $path = Yii::app()->theme->baseUrl.\"/images/photos/profile.png\";\n }\n \n return $path;\n }", "public function getAvatar()\n {\n return $this->_Avatar;\n }", "public static function getNoImage() {\n\t\treturn RouteUtil::getRoute ()->getWebRoot () . '/uploads/no-image.png';\n\t}", "public function presentAvatarSmall() {\n return ($this->avatar != null) ? $this->avatar : '/img/empty_avatar_small.jpg';\n }", "public function getAvatar() {\n // if a custom avatar has been uploaded\n if(!is_null($this->getProfile()->getAvatar())) return sfConfig::get('app_avatar_upload_dir').'/'.$this->getProfile()->getAvatar();\n // if the user's account is synced with facebook \n if(!is_null($this->getProfile()->getFacebookUid())) {\n $avatar = $this->getFacebook()->api(array('method' => 'fql.query', 'query' => \"SELECT pic_square FROM user WHERE uid = \".$this->getProfile()->getFacebookUid()));\n return $avatar[0]['pic_square'];\n }\n // default\n return sfConfig::get('app_avatar_default_img');\n }", "public function getAvatar()\n {\n return $this->Avatar;\n }", "public function getLocalAvatarSrc()\n {\n $user_data = $this->getUserData();\n if (strpos($user_data['avatar'], 'default_') === false) {\n return '/uploads/avatars/' . $user_data['avatar'];\n } else {\n return '/img/avatars/' . $user_data['avatar'];\n }\n }", "public function getAvatarUrl()\n {\n global $APP_CONFIG;\n \n // It's a LEFT JOIN, mind you - it could come up with nothing.\n if($this->getAvatarId() == 0)\n {\n return null;\n }\n \n return \"{$APP_CONFIG['public_dir']}/resources/avatars/{$this->getAvatarImage()}\";\n }", "public function getAvatar()\n\t{\n\t\treturn $this->avatar;\n\t}", "public function getNoCoverPhotoImagePath(){\n\t \treturn 'journal_cover.png';\n\t }", "public function getAvatarAttribute()\n {\n if (!empty($this->images[0])) {\n return $this->images[0]->path;\n } else {\n return '/images/food-default.png';\n }\n }", "private static function getNoItemImage() {\n return URL::base() . \"resources/no_item.png\";\n }", "function no_gravatars( $avatar ) \r\n{\r\n\treturn preg_replace ( \"/http.*?gravatar\\.com[^\\']*/\", DEFAULT_AVATAR_URL, $avatar );\r\n}", "function NO_IMAGE_NAME()\n\t{\n\t\treturn \"no-image.png\";\n\t}", "public function getAvatarUrl() : string\n {\n return empty($this->avatarUrl) ? \"\" : $this->avatarUrl;\n }", "public function avatar_url(): string {\n\t\treturn $this->user->ID ? get_avatar_url( $this->user->ID ) : '';\n\t}", "public function getDefaultAvatarStatus()\n {\n return $this->defaultAvatarStatus;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "function bp_remove_gravatar ($image, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir) {\n $default = home_url().'/wp-includes/images/smilies/icon_cool.gif'; // get_stylesheet_directory_uri() .'/images/avatar.png';\n if( $image && strpos( $image, \"gravatar.com\" ) ){\n return '<img src=\"' . $default . '\" alt=\"avatar\" class=\"avatar\" ' . $html_width . $html_height . ' />';\n } else {\n return $image;\n }\n }", "public function getAvatarAttribute($value)\n {\n // Otherwise return the default avatar placeholder\n return !empty($value) ? $value : '/images/profile_placeholder.png';\n }", "public function get_avatar()\n\t{\n\t\treturn $this->user_loader->get_avatar($this->get_data('closer_id'), false, true);\n\t}", "public function getAvatarUrlAttribute()\n {\n return optional($this->avatar)->url;\n }", "protected function userImage() {\n\t\t\t\n\t\t\tif (isset($this->user[\"user_image\"][0])) {\n\t\t\t\t\n\t\t\t\t$image = \"<img src='\" . BASE_URI . \"images/users/\" . $this->user[\"user_image\"][0] . \"' class='userProfilePicture' />\";\n\t\t\t\treturn $image;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn null;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "public function getImageUrl()\n {\n return ($this->response['has_pic']) ? $this->response['pic'] : '' ;\n }", "public static function getAvatar()\n {\n try {\n $about = resolve(AboutInterface::class);\n $result = $about->getAll(['avatar']);\n\n if ($result['status'] === CoreConstants::STATUS_CODE_SUCCESS) {\n return asset($result['payload']->avatar);\n }\n\n return asset('assets/common/img/avatar/default.png');\n } catch (\\Throwable $th) {\n return asset('assets/common/img/avatar/default.png');\n }\n }", "function get_avatar($avatar)\n {\n $result = array();\n\n // Only match the src-attribute\n preg_match( '/src=\\'(.*?)\\'/i', $avatar, $result ) ;\n // Create and return new image element\n return(\"<img src='\".$result[1].\"'/>\");\n }", "public function getAvatarSrc()\n {\n if ($this->attributeHolder->has('auth_token', 'regSource')) {\n $user_data = $this->getUserData();\n return 'http://graph.facebook.com/' . $user_data['fb_id'] . '/picture';\n } else {\n return $this->getLocalAvatarSrc();\n }\n }", "public function getAvatarUrl()\n {\n if ($this->hasAvatar()) {\n return XOOPS_UPLOAD_URL . '/' . $this->getVar('user_avatar');\n }\n\n return null;\n }", "public function get_avatar_url()\n {\n }", "public function getImage()\n {\n //if the user doesn`t chance the default picture \n if($this->image == null){\n return asset('/images/profile/default.jpg');\n }\n return asset('/images/'. $this->image);//image taken from field of user table\n }", "function fetch_profile_picture() {\n\t\t$image = false;\n\t\t$res = $this->request( $this->userinfo_url, array( 'method' => $this->self_method ) );\n\n\t\tif ( ! Keyring_Util::is_error( $res ) ) {\n\t\t\t$image = str_replace( 's64', 's256', $res->picture );\n\t\t}\n\n\t\treturn empty( $image ) ? null : esc_url_raw( $image );\n\t}", "public function getAvatar() {\n return $this->avatar;\n }", "public function generateDefaultImageUrl()\n {\n return OW::getPluginManager()->getPlugin('ocsfundraising')->getStaticUrl() . 'img/no-picture.png';\n }", "public function getAvatarUrlAttribute()\n {\n return url(is_null($this->avatar) ? '/img/user_default.png' : 'storage/' . $this->avatar);\n }", "public function getMemberpic()\n {\n return $this->memberpic;\n }", "protected function _getAvatarUrl()\n {\n return $this->_getGravatarUrl()\n . '/'\n . md5(strtolower(trim($this->getEmail() ?: '')))\n . '?s='\n . $this->getImgSize()\n . '&d='\n . $this->getDefaultImg()\n . '&r='\n . $this->getRating();\n }", "function cdnBlankAvatar($iWidth, $iHeight, $mSex = '')\n {\n /** @var Cdn $oCdn */\n $oCdn = Factory::service('Cdn', Constants::MODULE_SLUG);\n return $oCdn->urlBlankAvatar($iWidth, $iHeight, $mSex);\n }", "public function get_user_image(){\n return empty($this->user_image) ? $this->img_placeholder : $this->upload_dir . DS . $this->user_image;\n }", "function NO_IMAGE_FOUND_URL()\n\t{\n\t\treturn asset('images').\"/\";\n\t}", "function theme_get_full_avatar($object) {\n\n\tif ($_SERVER['HTTPS'] == \"on\" || (0 == strpos(BASE_URL, \"https://\"))) {\n\t\treturn image_proxy(str_replace('_normal.', '.', $object->profile_image_url_https));\n\t}\n\telse {\n\t\treturn image_proxy(str_replace('_normal.', '.', $object->profile_image_url));\n\t}\n}", "function filter_get_avatar( $avatar, $id_or_email, $size, $default, $alt ) {\n\t\tif ( $post = $this->get_contributor_post() ) {\n\t\t\tif ( ! empty( $post->ID ) ) {\n\t\t\t\tif ( has_post_thumbnail( $post->ID ) ) {\n\t\t\t\t\treturn get_the_post_thumbnail( $post->ID, array( $size, $size ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $avatar;\n\t}", "function beans_comment_avatar() {\n\n\tglobal $comment;\n\n\t// Stop here if no avatar.\n\tif ( !$avatar = get_avatar( $comment, $comment->args['avatar_size'] ) )\n\t\treturn;\n\n\techo beans_open_markup( 'beans_comment_avatar', 'div', array( 'class' => 'uk-comment-avatar' ) );\n\n\t\techo $avatar;\n\n\techo beans_close_markup( 'beans_comment_avatar', 'div' );\n\n}", "public function getProfileImageUrl()\n {\n if ($this->hasProfileImage()){\n return URL::to($this->image_url);\n }\n return URL::to('/img/profiles/default.png');\n }", "public static function get_default_image() {\n\n\t\t// You can put here any url\n\t\treturn CLASSY_THEME_DIR . '/assets/noimage.png';\n\n\t}", "public function getProfileImg()\n {\n return $this->profileImg;\n }", "public function getDefaultImage()\n {\n return null;\n }", "public function getImageUrlAttribute()\n\t{\n\t\treturn User::getAvatarUrl($this->accesslevel);\n\t}", "function getAvatarFull() {\r\n return $this->avatarLarge;\r\n }", "function my_default_avatar_url() {\n\treturn 'http://localhost/~leromt/caldol/wordpress/wp-content/uploads/avatars/1/a68825fe2b2e1fc7467a0c2274c50834-bpthumb.jpg';\n}", "function avatar(){\n global $connection;\n $login_id = \"\";\n if (isset($_SESSION['coupleID'])) {\n $login_id = $_SESSION['coupleID'];\n }\n \n $view_vender_query = \"SELECT * FROM couples WHERE coupleID= $login_id\";\n $select_vender_by_id = mysqli_query($connection, $view_vender_query); \n while($row = mysqli_fetch_assoc($select_vender_by_id)){\n $image1 = $row['image'];\n}\n if($image1 != \" \"){\n echo '<span class=\"user-icon\"> <img src=\"./images/'.$image1.'\" alt=\"\" class=\"rounded-circle mb10\"></span>';\n}\n }", "public static function bamobile_get_default_avatar($id_or_email,$size='thumbnail'){\r\n $id_default = get_option('avatar_default');\r\n $mobiconnector_image = get_avatar($id_or_email, $size, $id_default);\r\n // Takes the img tag, extracts the src\r\n $output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $mobiconnector_image, $matches, PREG_SET_ORDER);\r\n $default = !empty($matches) ? $matches [0] [1] : \"\";\r\n return $default;\r\n }", "public function getAvatarAttribute()\n {\n if ($this->getMedia('photos')->count() > 0) {\n return $this->getFirstMediaUrl('photos', 'avatar');\n }\n return '/img/avatar/default.png';\n }", "public function getAvatar($type = '') {\n\n\t\tif ( $type=='' ) {\n\n\t\t\treturn ( !empty($this->_row['avatar']) )\n\t\t\t\t\t\t? $this->_row['avatar']\n\t\t\t\t\t\t: '/img/dummy/user_photo_square.gif' ;\n\n\t\t} else if ( isset($this->_row['avatar'][$type]) ) {\n\n\t\t\treturn $this->_row['avatar'][$type]['path'];\n\n\t\t} else {\n\n\t\t\treturn '/img/dummy/user_photo_' . $type . '.gif';\n\n\t\t}\n\n\t}", "public function getAvatarAttribute(){\n\t\t$avatar = Media::where('id', $this->attributes['avatar_id'])\n\t\t\t->get(array('id','url','extension'))->first();\n\t\tif ( !empty($avatar->id) ){\n\t\t\t\t$response = $avatar->url.\"_100x100.\".$avatar->extension;\n\t\t}else{\n\t\t\t$response = \"themes/grape/images/default-male-avatar.png\";\n\t\t}\n\t\treturn $this->attributes['avatar'] = $response;\n\t}", "public function getAvatarAttribute(){\n\t\treturn ( ($this->meta) ? $this->meta->avatar : null );\n\t}", "public function getPicture()\n {\n if (empty($this->picture)) return '/img/default-user-image.png';\n\n return $this->picture;\n }", "function getAvatar($userid)\n\t{\n\t\t$isExist\t= getTotRec(\"user_id\",\"picture_profile\",\"user_id='$userid'\");\n\t\t$profileRs\t= getRow(\"picture_profile\",\"thumb_path\",\"user_id='$userid'\");\n\t\tif($profileRs['thumb_path']=='' or !$isExist)\n\t\t\t$userAvatar\t= base_url().'application/images/t_default.jpg';\n\t\telse\n\t\t\t$userAvatar\t= $profileRs['thumb_path'];\n\t\t//echo $userAvatar;\n\t\treturn $userAvatar;\n\t}", "public function getFallbackImage();", "function wct_users_the_user_profile_avatar() {\n\techo wct_users_get_user_profile_avatar();\n}", "public function getImage( $options = array())\n {\n $defaults = array( 'noimage' => 'noimage');\n $options = array_merge( $defaults, $options);\n\n // An avatar is really uploaded. Generate thumbnail if\n // neccessary and return full URL.\n if ( file_exists( $this->getPathOrig())) {\n $this->getOrCreateThumbnail();\n return $this->getSrcFull();\n }\n \n // There is no uploaded avatar. So, we have to return full URL\n // to 'noimage' file. This file different from theme to theme.\n // We also should generate.\n $this->getOrCreateNoimageThumbnail( $options['noimage']);\n return $this->addXYandBorder( self::getAppTheme()->images\n\t\t\t\t . $this->upload_dirname\n\t\t\t\t . $options['noimage']);\n }", "public function get_avatar_html() {\n\t\t// FIXME: configurable\n\t\tglobal $config;\n\t\tif($config->get_string(\"avatar_host\") == \"gravatar\") {\n\t\t\t$hash = md5(strtolower($this->email));\n\t\t\t$s = $config->get_string(\"avatar_gravatar_size\");\n\t\t\t$d = $config->get_string(\"avatar_gravatar_default\");\n\t\t\t$r = $config->get_string(\"avatar_gravatar_rating\");\n\t\t\treturn \"<img class=\\\"avatar gravatar\\\" src=\\\"http://www.gravatar.com/avatar/$hash.jpg?s=$s&d=$d&r=$r\\\">\";\n\t\t}\n\t\treturn \"\";\n\t}", "function GetFotoProfileGuru(){\n\n if(!empty(Auth::user()->ugrFotoProfile)){\n $img = asset('storage/images/guru/original/'.Auth::user()->ugrFotoProfile);\n }\n else{\n $img = asset('image/noimage.png');\n } \n return $img;\n \n}", "function getAvatarSmall() {\r\n return $this->avatarIcon;\r\n }", "public function avatar()\n {\n return $this->get('avatar');\n }", "public function fnGetProfileImage()\n {\n //You can get a blog's avatar in 9 different sizes. The default size is 64x64.\n $strPhotoUrl = 'http://api.tumblr.com/v2/blog/' . $this->strUserBlog . '/avatar/64';\n }", "public function getProfile_img()\n {\n return $this->profile_img;\n }", "public function avatarURL()\n\t{\n\t\tif( strlen($this->avatarURL) > 3 )\n\t\t{\n\t\t\treturn $this->avatarURL;\n\t\t}\n\t\treturn Config::defaultAvatar;\n\t}", "public function _getUserAvatarUrl($id=''){\r\n $avatar_url = $this->userAvatarUrl.'user-blank.png';\r\n if(!empty($id)){\r\n $this->db->table_name = TBL_USER_FILES;\r\n $avatar = $this->db->find(array('UserID'=>$id,'FileType'=>'avatar')); \r\n if($avatar){\r\n if(!empty($avatar->FileImgPath) && !empty($avatar->FileSlug) && !empty($avatar->FileExt)){\r\n $avatar_url = $this->userAvatarUrl.$avatar->FileImgPath.$avatar->FileSlug.'.'.$avatar->FileExt;\r\n }\r\n }\r\n }\r\n return $avatar_url;\r\n }", "public function bamobile_mobiconnector_remove_filter_avatar() {\r\n remove_filter('get_avatar', array($this, 'bamobile_get_avatar_mobiconnector_filter'));\r\n $avatar_list = \"\";\r\n $avatar_defaults = array(\r\n 'mystery' => __('Mystery Man'),\r\n 'blank' => __('Blank'),\r\n 'gravatar_default' => __('Gravatar Logo'),\r\n 'identicon' => __('Identicon (Generated)'),\r\n 'wavatar' => __('Wavatar (Generated)'),\r\n 'monsterid' => __('MonsterID (Generated)'),\r\n 'retro' => __('Retro (Generated)')\r\n );\r\n if(empty($avatar_default)) {\r\n $avatar_default = 'mystery';\r\n }\r\n foreach($avatar_defaults as $default_key => $default_name) {\r\n $avatar = get_avatar('unknown@gravatar.com', 32, $default_key);\r\n $selected = ($avatar_default == $default_key) ? 'checked=\"checked\" ' : \"\";\r\n $avatar_list .= \"\\n\\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='\".esc_attr($default_key).\"' {$selected}/> \";\r\n $avatar_list .= preg_replace(\"/src='(.+?)'/\", \"src='\\$1&amp;forcedefault=1'\", $avatar);\r\n $avatar_list .= ' '.$default_name.'</label>';\r\n $avatar_list .= '<br />';\r\n }\r\n return $avatar_list;\r\n }", "public function getAvatar() {\n\n return $this->avatar;\n }", "public function getAvatarUrl()\n {\n return $this->response['avatarUrl'];\n }", "public function getAvatar($attributes = array())\r\n\t{\r\n\t\t$tmp_attributes = '';\r\n\t\tforeach ($attributes as $key => $value) {\r\n\t\t\t$tmp_attributes .= sprintf(' %s=\"%s\" ', $key, $value);\r\n\t\t}\r\n\r\n\t\treturn sprintf('<img src=\"%s\" %s />', $this->getAvatarUrl(), $tmp_attributes);\r\n\t}", "function sed_build_userimage($image)\n\t{\n\tglobal $cfg;\n\tif (!empty($image))\n\t { $result = \"<img src=\\\"\".$image.\"\\\" alt=\\\"\\\" class=\\\"avatar post-author-avatar\\\" />\"; }\n\telse \n\t\t{ $result = \"<img src=\\\"\".$cfg['defav_dir'].\"default.png\\\" alt=\\\"\\\" class=\\\"avatar post-author-avatar\\\" />\"; }\n\treturn($result);\n\t}", "function wct_users_get_user_profile_avatar() {\n\t\treturn apply_filters( 'wct_users_get_user_profile_avatar', get_avatar( wct_users_displayed_user_id(), '150' ) );\n\t}", "public static function getBotAvatar(): string\n\t{\n\t\treturn Main\\Config\\Option::get(self::MODULE_ID, self::OPTION_BOT_AVATAR, self::AVATAR);\n\t}", "function getMemberPhoto($midx=null,$width=null,$height=null) {\n\t\tif ($midx === null && $this->isLogged() == false) return '<img src=\"'.$this->getModule()->getDir().'/images/nophoto.png\" alt=\"unknown\">';\n\t\t\n\t\t$member = $this->getMember($midx);\n\t\t\n\t\t$photo = '<img data-member-idx=\"'.$member->idx.'\" src=\"'.$member->photo.'\" class=\"ModuleMemberInfoPhoto\" alt=\"'.$member->nickname.'\" style=\"';\n\t\tif ($width !== null) $photo.= 'width:'.$width.';';\n\t\tif ($height !== null) $photo.= 'height:'.$height.';';\n\t\t$photo.= '\">';\n\t\t\n\t\treturn $photo;\n\t}", "public function getImageAttribute()\n {\n return $this->getMedia('user.avatar')->last();\n }" ]
[ "0.7535377", "0.74965096", "0.7325502", "0.71429986", "0.7119305", "0.70921344", "0.7070627", "0.7054856", "0.7007052", "0.69694835", "0.69595504", "0.6958881", "0.6957861", "0.6950765", "0.6950765", "0.6921085", "0.6914031", "0.6905549", "0.6899234", "0.6885025", "0.68798923", "0.68774307", "0.6859304", "0.68540126", "0.68479884", "0.6801784", "0.6789995", "0.6779441", "0.67785823", "0.6777977", "0.6775322", "0.6774024", "0.67680824", "0.67637753", "0.6759468", "0.67253816", "0.67253816", "0.67253816", "0.67253816", "0.67253816", "0.67253816", "0.67153", "0.6712701", "0.67119414", "0.6702703", "0.66940427", "0.6691967", "0.66873163", "0.6679584", "0.6678669", "0.66766196", "0.66732776", "0.6633733", "0.66256607", "0.6624852", "0.6607608", "0.65990496", "0.6597587", "0.65918547", "0.65896016", "0.6582596", "0.65825164", "0.65744174", "0.65601254", "0.65596956", "0.6557612", "0.65535766", "0.65518284", "0.6547798", "0.6547546", "0.6544365", "0.65276796", "0.6519334", "0.6516787", "0.65114856", "0.6501903", "0.65017825", "0.6500341", "0.649709", "0.64910173", "0.64816034", "0.6476286", "0.6474356", "0.64729714", "0.64679044", "0.6466614", "0.6463373", "0.6459747", "0.6453108", "0.6451815", "0.6440407", "0.643724", "0.6432759", "0.642873", "0.6421226", "0.6419322", "0.6416044", "0.64110434", "0.6393782", "0.6382834" ]
0.81701183
0
Checks if $link is a valid URL
Проверяет, является ли $link действительным URL
public function isValid($link) { if ( !(isset($link[0]) && is_string($link) && strpos($link, 'http') === 0 && GeneralUtility::isValidUrl($link)) ) { $this->addError('There was a problem with linkUri', 40750133704); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function is_valid_link($link)\n {\n // swiped from here: http://www.codezuzu.com/2015/03/how-to-validate-linkurl-in-php/\n $ch = curl_init($link);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, true); // Include the headers\n curl_setopt($ch, CURLOPT_NOBODY, true); // Make HEAD request\n $response = curl_exec($ch);\n if ($response === false) {\n // something went wrong, assume not valid\n return false;\n }\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n if (in_array($http_code, array(200, 301, 302, 303, 307)) === false) {\n // not a valid http code to asume success, link is not valid\n return false;\n }\n curl_close($ch);\n return $http_code;\n }", "function validatedLink($link) {\n if($link==NULL || $link==''){\n return '';\n } else if (preg_match('/^(http|https):\\/\\/[a-z0-9_]+([\\-\\.]{1}[a-z0-9_]+)*\\.[_a-z]{2,5}'.'((:[0-9]{1,5})?\\/.*)?$/i', $link)) {\n return $link;\n } else {\n return \"http://\" . $link;\n }\n }", "function chkIsValidURL($value)\r\n\t\t{\r\n\t\t\t$is_ok = (preg_match(\"/^http.+\\..+$/i\", $value));\r\n\t\t\tif (!$is_ok)\r\n\t\t\t\treturn false;\r\n\t\t}", "function ultnofo_valid_url( $href ) {\n\t$start_strs = array( // list of accepted url protocols\n\t\t'/',\n\t\t'http://',\n\t\t'https://',\n\t\t'ftp://',\n\t\t'mailto:',\n\t\t'magnet:',\n\t\t'svn://',\n\t\t'irc:',\n\t\t'gopher://',\n\t\t'telnet://',\n\t\t'nntp://', \n\t\t'worldwind://',\n\t\t'news:',\n\t\t'git://',\n\t\t'mms://'\n\t);\n\t\n\tforeach( $start_strs as $start_str )\n\t\tif( substr( $href, 0, strlen( $start_str ) ) == $start_str ) return TRUE;\n\n\treturn FALSE;\n}", "function validURL($href) {\n\t\t$filter = \"/((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\\+\\$,\\w]+@)[A-Za-z0-9.-]+)((?:\\/[\\+~%\\/.\\w-_]*)?\\??(?:[-\\+=&;%@.\\w_]*)#?(?:[\\w]*))?)/\";\n\t\treturn preg_match($filter, $href);\n\t}", "function is_valid_URL($url) {\n $parsed = @parse_url($url);\n if(!$parsed['host'])\n return false;\n // Could also try to open the URL...\n return true;\n }", "function isValidURL ($url) {\n\t\treturn parse_url($url) !== false;\n\t}", "function valid_url($aUrl)\r\n{\r\n\tif ($aUrl == 'http://')\r\n\t{\r\n\t\treturn false;\r\n\t}\t\t\r\n\treturn preg_match('/^https?:\\/\\/[a-z0-9-]{2,63}(\\.[a-z0-9-]{2,})*(:[0-9]{0,5})?(\\/|$)\\S*$/', $aUrl);\r\n}", "public static function validLink( $real_link ) {\n\t\t\t$output = false;\n\t\t\t\n\t\t\tif (\tstrpos( $real_link, '://twitter.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.twitter.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://instagram.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.instagram.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://twitpic.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.twitpic.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://t.co' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://linkis.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.linkis.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://bit.ly' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://goo.gl' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://twibbon.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://sh.st' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://xtistore.es' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.xtistore.es' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://thr.cm' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.thr.cm' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://ouo.press' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.ouo.press' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://gigst.rs' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.gigst.rs' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://cur.lv' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.cur.lv' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://aggbot.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.aggbot.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://imgurl.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.imgurl.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://imgur.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.imgur.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://facebook.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.facebook.com' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://paper.li' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://www.paper.li' ) === false &&\n\t\t\t\t\tstrpos( $real_link, '://news.google.com' ) === false &&\n\t\t\t\t\tstrlen( $real_link ) > 11\n\t\t\t) {\n\t\t\t\t$output = true;\n\t\t\t}\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "public function validateUrl(Url $url) : bool;", "public function validateLink($attribute,$params)\r\r {\r\r if(trim($this->link) != ''){\r\r $label = $this->getAttributeLabel('link');\r\r $tempUrl = strtolower($this->link);\r\r if(strpos($tempUrl,'http://')!==false || strpos($tempUrl,'https://')!==false)\r\r $a=1;\r\r else\r\r $this->addError(\"link\",\"$label must have http:// OR https://\");\r\r }\r\r }", "function checkLink()\n {\n if (!isset($_POST['link'])) {\n $this->sendError();\n }\n\n $link = strtolower(str_replace([\" \",'\"',\"'\",';','.',','], [\"-\",\"\"], preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities(trim($_POST['link'])))));\n\n $base = new Model\\Base;\n $status = $base->checkLink($link, $_POST['aID']) === false ? 'ok' : 'error';\n\n $this->send(['status'=>$status,'link'=>$link]);\n }", "private function is_url($url) { \n return filter_var($url, FILTER_VALIDATE_URL);\n }", "private function isValidUrl(Uri $url): bool\n {\n return filter_var($url, FILTER_VALIDATE_URL);\n }", "public static function isUrl($url){\n return filter_var($url, FILTER_VALIDATE_URL);\n }", "function isValidURL($url)\n{\n\t return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);\n}", "public function validateUrl($value) {\n\t\treturn filter_var($value, FILTER_VALIDATE_URL) !== false;\n\t}", "function is_valid_url( $url ) {\r\n if (function_exists('FILTER_VALIDATE_URL') ) {\r\n if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) return false;\r\n else return true;\r\n }\r\n else return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);\r\n}", "static public function isUrl($input) {\n\t\tif (filter_var($input, FILTER_VALIDATE_URL)) {\n\t\t\treturn false;\n\t\t}else {\n\t\t\treturn true;\n\t\t}\n\t}", "static function isUrl($url)\n {\n return filter_var($url, FILTER_VALIDATE_URL);\n }", "function ffd_is_valid_url( $url ) {\r\n\r\n\t// Must start with http:// or https://.\r\n\tif ( 0 !== strpos( $url, 'http://' ) && 0 !== strpos( $url, 'https://' ) ) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// Must pass validation.\r\n\tif ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn true;\r\n}", "public static function checkURL($var)\n {\n return filter_var($var, FILTER_VALIDATE_URL);\n }", "public function urlIsValid ($url) {\n\t\t//TODO!\n\t\t$well_formed = filter_var($url, FILTER_VALIDATE_URL);\n\t\tif (!$well_formed) {\n\t\t\techo \"Badly-formed URL!\\n\";\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function validateBasicUrl($url) {\n global $Core;\n if (!filter_var($url, FILTER_VALIDATE_URL))\n throw new Error(\"{$url} \".$Core->language->is_not_a_valid_link);\n \n if (!substr($url, 0, 7) == \"http://\" || !substr($url, 0, 8) == \"https://\") {\n throw new Error(\"{$url} \".$Core->language->is_not_a_valid_link);\n }\n\n return true;\n }", "function checkURL($url) {\n\t\t\tif(!eregi(\"^http:\\/\\/\", $url)) {return false;}\n\t\t\treturn true;\n\t\t}", "public function isValid(Link $item);", "private function validUrl($value) {\r\n\r\n return (filter_var($value, FILTER_VALIDATE_URL) == false) ? false : true;\r\n }", "function validate_slide_link($valid, $value, $field, $input) {\n\t\tif( empty($value) || 0 === strpos($value, '#')) {\n\t\t\treturn $valid;\n\t\t}\n\n\n\t\tif( strpos($value, '://') !== false ) {\n\t\t\t// url\n\t\t} elseif( strpos($value, '//') === 0 ) {\n\t\t\t// relative url\n\t\t} else {\n\t\t\t$value = strpos($value, 'http') !== 0 ? \"http://$value\" : $value;\n\t\t}\n\n\t\t$valid = filter_var($value, FILTER_VALIDATE_URL) ? true : false;\n\n\t\t// return\n\t\treturn $valid;\n\t}", "function validUrl($url)\n {\n $format=\"/^(http|https):\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(([0-9]{1,5})?\\/.*)?$/\";\n $url=strtolower($url);\n if(preg_match($format,$url)) return true; else return false;\n }", "public static function is_valid_url($url) {\r\n\t\t/*$regex = \"((https?|ftp)\\:\\/\\/)?\"; // Scheme\r\n\t\t$regex .= \"([a-z0-9+!*(),;?&=\\$_.-]+(\\:[a-z0-9+!*(),;?&=\\$_.-]+)?@)?\"; // User and Pass\r\n\t\t$regex .= \"([a-z0-9-.]*)\\.([a-z]{2,3})\"; // Host or IP\r\n\t\t$regex .= \"(\\:[0-9]{2,5})?\"; // Port\r\n\t\t$regex .= \"(\\/([a-z0-9+\\$_-]\\.?)+)*\\/?\"; // Path\r\n\t\t$regex .= \"(\\?[a-z+&\\$_.-][a-z0-9;:@&%=+\\/\\$_.-]*)?\"; // GET Query\r\n\t\t$regex .= \"(#[a-z_.-][a-z0-9+\\$_.-]*)?\"; // Anchor \r\n\t\tif(preg_match(\"/^$regex$/\", $url)) {\r\n\t\t\treturn TRUE;\r\n\t\t} else {\r\n\t\t\techo $url . \"<br />isn't valid<br />\";\r\n\t\t\treturn FALSE;\r\n\t\t}*/\r\n\t\t\r\n\t\t\r\n\t\t// I cannot find another good url validator.\r\n\t\t// Therefore, for now, there is no url validation\r\n\t\treturn TRUE;\r\n\t\t\r\n\t}", "public function check(string $link): bool;", "public static function isUrl($file)\n {\n return filter_var($file, FILTER_VALIDATE_URL) !== false;\n }", "function is_url($url) {\n return preg_match('/^(http|https|ftp):\\/\\/(.*)/', $url) == 1;\n }", "public function isValid(){\n\t\treturn filter_var($this->address, FILTER_VALIDATE_URL) !== false;\n\t}", "public static function is_url_valid($url)\n {\n return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);\n }", "private function validateUrl($url) {\n if (!filter_var($url, FILTER_VALIDATE_URL)) {\n return false;\n }\n return true;\n }", "public function testUtilCheckUrl()\n\t{\n\t\t$this->assertTrue(util_check_url('http://fusionforge.org/'), 'http://fusionforge.org/ is a valid URL.');\n\n\t\t$this->assertTrue(util_check_url('https://fusionforge.org/'), 'https://fusionforge.org/ is a valid URL.');\n\n\t\t$this->assertTrue(util_check_url('ftp://fusionforge.org/'), 'ftp://fusionforge.org/ is a valid URL.');\n\n\t\t$this->assertFalse(util_check_url('webdav://toto'), 'webdav://toto is not a valid URL.');\n\n\t\t$this->assertFalse(util_check_url('fusionforge.org'), 'fusionforge.org is not a valid URL');\n\t}", "public function checkLink($link){\n\t\t\t$link = explode(\"/\", $link);\n\t\t\tif (isset($link) && isset($link[0]) && isset($link[1]) && $link[0] == $this->class && $link[1] == $this->template)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "function earcandyinc_social_url_validate($element, &$form_state, $form) {\n if ($element['#value'] && !valid_url($element['#value'], TRUE)) {\n form_set_error($element['#name'], t('The @social_url is not valid URL. Please try to copy/paste it one more time.', array('@social_url' => $element['#title'])));\n }\n}", "public function hasLink()\n {\n return isset($this->attrs['url'])\n && trim($this->attrs['url'])\n && $this->attrs['url'] !== '#'\n && $this->attrs['url'] !== 'http://';\n }", "protected function _validateUrl($input, $value)\n {\n return filter_var($value, FILTER_VALIDATE_URL) !== false;\n }", "function valid_url($str) {\n\treturn ( ! preg_match('/^(http|https|ftp):\\/\\/([A-Z0-9][A-Z0-9_-]*(?:\\.[A-Z0-9][A-Z0-9_-]*)+):?(\\d+)?\\/?/i', $str)) ? FALSE : TRUE;\n}", "private function checkExternalLink($url)\n {\n $valid = true;\n $generator = new RequestGenerator();\n $request = $generator->getRequest();\n $request->setUrl($url)\n ->setMethod('GET');\n try {\n $request->execute();\n } catch (TeknooCurlException $e) {\n $valid = false;\n }\n return $valid;\n }", "public function is_valid_url( $url ) {\n\t\t\t$url = trim( $url );\n\n\t\t\treturn ( ( strpos( $url , 'http://' ) === 0 || strpos( $url , 'https://' ) === 0 ) && filter_var( $url , FILTER_VALIDATE_URL ) !== false );\n\t\t}", "public static function isValidUrl(string $url)\n {\n return filter_var($url, FILTER_VALIDATE_URL) !== false;\n }", "public static function valid_url($url) {\r\n if (!filter_var($url, FILTER_VALIDATE_URL) === false) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function isValidURL( $url ) {\n // URL: http://daringfireball.net/2010/07/improved_regex_for_matching_urls\n return preg_match(\"/(?i)\\b((?:[a-z][\\w-]+:(/>?://>{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\\\".,<>?«»“”‘’]))/\", $url);\n}", "function check_url($uri) {\n return filter_xss_bad_protocol($uri, FALSE);\n}", "private function checkUrl($url) {\r\n if (strlen($url) > 0) {\r\n if (filter_var($url, FILTER_VALIDATE_URL)) {\r\n return true;\r\n }\r\n else\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }", "private function _isUrl($path) {\n return strpos($path, '://') !== false;\n }", "function validURL($url)\r\n\t{\r\n\t\t//$pattren = '/(((http|ftp|https):\\/\\/)|www\\.)[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#!]*[\\w\\-\\@?^=%&/~\\+#])?/g';\r\n\t\tif(empty($url))\r\n\t\t{\r\n\t\t\te(lang(\"tab_url_is_empty\"));\r\n\t\t}\r\n\t}", "function wc_is_valid_url($url)\n {\n }", "public function checkUrl(string $url): bool\n {\n return (filter_var($url, FILTER_VALIDATE_URL) !== false);\n }", "public static function validateURL($url){\n\t\t\tif($url != ''){\n\t\t\t\tif(!preg_match('#^http[s]?:\\/\\/#i', $url)){\n\t\t\t\t\t$url = 'http://' . $url;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tinclude(TOOLKIT . '/util.validators.php');\n\t\t\t\tif(!preg_match($validators['URI'], $url)){\n\t\t\t\t\t$url = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $url;\n\t\t}", "function url_validate($url){\n\t\tif (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) === false) { // Must start with scheme\n\t\t $url_parser = parse_url($url);\n\n\t\t if ($url_parser['scheme'] == \"http\" || $url_parser['scheme'] == \"https\"){ // Scheme must be http or https\n\t\t \treturn true;\n\t\t }\n\t\t} \n\n\t\treturn false;\n\t}", "public static function validURL($_text) {\n\t\treturn is_string(filter_var($_text,FILTER_VALIDATE_URL));\n\t}", "public static function validate_url($url = '') {\n $status = preg_match(\"@^(?:ht|f)tps?://@si\", $url);\n\n return $status;\n }", "private function url()\n {\n if (filter_var($data, FILTER_VALIDATE_URL)) {\n return true;\n }else {\n return $data . 'is not a valid url';\n }\n }", "public static function isURL($string) {\n return filter_var($string, FILTER_VALIDATE_URL);\n }", "private function validar_url($url){\n\t\t$url_valida = array(\"http://\",\"https://\");\n\t\t$url_1 = substr($url,0, 7);\n\t\t$url_2 = substr($url,0, 8);\n\n\t\tif(in_array($url_1, $url_valida) || in_array($url_2, $url_valida)){\n\t\t\treturn TRUE;\n\t\t}else{\n\t\t\treturn FALSE;\n\t\t}\n\n\t}", "function is_url($url){\n\tif(empty($url))\n\t\treturn E_FORM_EMPTY;\n\treturn preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url)===1;\n}", "private function isLink($text)\n\t{\n\t\tif (preg_match(\"/^(http|https|ftp|ftps).*$/\", $text))\n\t\t{\n\t\t\tif (filter_var($text, FILTER_VALIDATE_URL))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "protected function isLink() {}", "function checkURL($text)\n{\n\t$reason = \"None\";\n\n\tif (!preg_match(\"#((http|https|ftp)://(\\S*?\\.\\S*?))(\\s|\\;|\\)|\\]|\\[|\\{|\\}|,|\\\"|'|:|\\<|$|\\.\\s)#ie\", $text))\n\t\t$reason = \"you did not submit a full link (you need to include the http:// part).\";\n\n\tif ($reason !== \"None\")\n\t{\n\t\techo \"<script>alert('Your submission cannot be accepted as it is because \" . $reason . \". Please read the rules again and make the necessary changes. Thank you!')</script><script>history.go(-1)</script>\";\n\t\texit;\n\t}\n\n\treturn false; //continue if everything is okay\n}", "public function urlChecker($url)\n {\n $this->tempUrl = $url;\n // check if the url is valid\n if ($url = parse_url($this->tempUrl, PHP_URL_SCHEME) && parse_url($this->tempUrl, PHP_URL_HOST)) {\n // set url to temp url\n $this->url = $this->tempUrl;\n return true;\n } else {\n // if url is invalid make sure that the url doens't get saved to the db\n $this->url = false;\n\n\n return false;\n }\n }", "function is_url($var)\n{\n return CValidate::url($var);\n}", "function isUrl( $text ) \n{ \n return filter_var( $text, FILTER_VALIDATE_URL ) !== false; \n}", "private function is_valid_url(string $url)\n {\n return (bool)filter_var(trim($url), FILTER_VALIDATE_URL);\n }", "function is_url($url) {\r\n return (preg_match(\",^https*://,\",$url) > 0);\r\n}", "function ValidateURL($url)\r\n{\r\n\tif (eregi(\"^(http|https)+(:\\/\\/)+[a-z0-9_-]+\\.+[a-z0-9_-]\", $url ))\r\n\treturn true;\r\n\treturn false;\r\n}", "function testIfLinkisValid() \n {\n $this->get(\"https://cs361-project-b-technicallyrice.c9.io/employer_statistics.php\");\n $this->assertResponse(200);\n\n $this->setField(\"role\", \"target\");\n $this->setField(\"location\", \" \");\n \n $this->clickSubmit(\"submit\");\n\n $this->assertResponse(200);\n $this->assertLink(\"Visit Target website\");\n }", "public static function validateUrl($value)\n {\n if (filter_var($value, FILTER_VALIDATE_URL) === false) {\n return false;\n }\n return true;\n }", "public function testValidWaybackLink(): void\n {\n $expected = 'https://web.archive.org/web/*/' . $this->link->url;\n\n $link = waybackLink($this->link);\n\n $this->assertEquals($expected, $link);\n }", "private function checkURL($url) {\n\t\t$UrlCheck = @parse_url($url);\n\t\tif($UrlCheck['scheme'] != 'http' || $UrlCheck['host'] == null || $UrlCheck['path'] == null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected function verify_url_format($url) {\n\t\t//formerly \"validateUrlFormat\"\n\n\t\tif (!preg_match(\"~^(?:f|ht)tps?://~i\", $url)) {\n\t $url = \"http://\" . $url;\n\t }\n\t\tif( strpos(parse_url($url, PHP_URL_HOST), 'yip.bz') !== false) { //MAKE INDEPENDENT!!! EVEN IF LOCALHOST IS NOT A GOOD OPTION\n\t\t\treturn false;\n\t\t}\n\t\treturn filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED);\n\t}", "public function isUri($value, $error)\n {\n if (!preg_match(\n '/^(?#Protocol)(?:(?:ht|f)tp(?:s?)\\:\\/\\/|~\\/|\\/)?(?#Username:Password)(?:\\w+:\\w+@)?(?#Subdomains)(?:(?:[-\\w]+\\.)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[\\d]{1,5})?(?#Directories)(?:(?:(?:\\/(?:[-\\w~!$+|.,=]|%[a-f\\d]{2})+)+|\\/)+|\\?|#)?(?#Query)(?:(?:\\?(?:[-\\w~!$+|.,*:]|%[a-f\\d{2}])+=?(?:[-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)(?:&(?:[-\\w~!$+|.,*:]|%[a-f\\d{2}])+=?(?:[-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)*)*(?#Anchor)(?:#(?:[-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)?$/',\n $value\n )\n ) {\n $this->setError($error);\n return false;\n }\n return true;\n }", "public function validate($url)\n {\n if ($url == '') {\n return false;\n }\n\n $urlObj = new \\Net_URL2($url);\n if (!$urlObj->isAbsolute()\n || !in_array(strtolower($urlObj->getScheme()), array('https', 'http'))\n ) {\n return false;\n }\n return true;\n }", "protected function validate_url( $url ) {\n\t\t//Do a little bit of validation\n\t\t$url = esc_url_raw( $url );\n\t\tif ( empty( $url ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( function_exists( 'filter_var' ) ) {\n\t\t\t//Note: filter_var() is no panacea as it accepts many invalid URLs\n\t\t\tif ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t$parts = @parse_url( $url );\n\t\tif ( empty( $parts['host'] ) || ! strpos( $parts['host'], '.' ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $url;\n\t}", "function check_url($url) {\r\n $check = substr($url, 0, 7);\r\n if ($check == 'http://') {\r\n return $url;\r\n } else {\r\n return 'http://'.$url;\r\n }\r\n}", "function is_url($x)\n{\n return filter_var($x, FILTER_VALIDATE_URL) !== false;\n}", "public static function url ($url){\n $p = new Validate();\n \n $schemes = array ('http', 'https');\n if (!@$p->uri($url, array('allowed_schemes' => $schemes))){\n return false;\n }\n return true;\n }", "public function isURL($url = '') {\n\t\tif (strpos($url, 'http') > -1) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function url($url)\n {\n return false !== filter_var($url, FILTER_VALIDATE_URL);\n }", "function is_url($url){\n if (preg_match('/^(http|https|ftp):\\/\\/([A-Z0-9][A-Z0-9_-]*(?:\\.[A-Z0-9][A-Z0-9_-]*)+):?(\\d+)?\\/?/i', $url)) {\n return true;\n } else {\n return false;\n }\n}", "public function valid_url($str) {\n\t\treturn !(preg_match(\"/\\b(?:(?:https?|ftp):\\/\\/|www\\.)[-a-z0-9+&@#\\/%?=~_|!:,.;]*[-a-z0-9+&@#\\/%=~_|]/i\", $str)) ? false : true;\n\t}", "public static function isUrl($string)\n {\n return filter_var($string, FILTER_VALIDATE_URL) !== false;\n }", "public function validateRepositoryURL(string $url);", "function check_is_url( $string ){\n $regex = \"((https?|ftp)\\:\\/\\/)?\"; // SCHEME\n $regex .= \"([a-z0-9+!*(),;?&=\\$_.-]+(\\:[a-z0-9+!*(),;?&=\\$_.-]+)?@)?\"; // User and Pass\n $regex .= \"([a-z0-9-.]*)\\.([a-z]{2,3})\"; // Host or IP\n $regex .= \"(\\:[0-9]{2,5})?\"; // Port\n $regex .= \"(\\/([a-z0-9+\\$_-]\\.?)+)*\\/?\"; // Path\n $regex .= \"(\\?[a-z+&\\$_.-][a-z0-9;:@&%=+\\/\\$_.-]*)?\"; // GET Query\n $regex .= \"(#[a-z_.-][a-z0-9+\\$_.-]*)?\"; // Anchor\n\n if(preg_match(\"/^$regex$/\", $string))\n {\n return true;\n }\n return false;\n}", "function Uptobox__validate($link)\n {\n $rc = new ReflectionClass(Uptobox::class);\n $uptobox = $rc->newInstanceWithoutConstructor();\n\n try {\n $uptobox->validate($link);\n return true;\n } catch (UptoboxLinkIsNotValidException $e) {\n return false;\n }\n }", "function is_link($path)\n{\n\treturn false;\n}", "private function isURL($url)\n {\n return is_string($url) && preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);\n }", "public function is_url( $string ){\n\t\treturn filter_var($string, FILTER_VALIDATE_URL);\n\t}", "private static function is_url( $url ) \n\t{\n\t\treturn ( ( strpos( $url, 'http://' ) === 0 || strpos( $url, 'https://' ) === 0 || strpos( $url, '//' ) === 0 || strpos( $url, '/' ) === 0 ) && strpos( $url, \"\\n\" ) === false );\n\t}", "public function is_youtube_link($link)\n\t{\n\t\t$http = substr($link, 7, -20);\n\t\t$www_http = substr($link, 11, -20);\n\t\t$https = substr($link, 8, -20);\n\t\t$www_https = substr($link, 12, -20);\n\t\tif ((strlen($link) == 38) and ($http == \"youtube.com\")) {\n\t\t\treturn TRUE;\n\t\t}elseif((strlen($link) == 39) and ($https == \"youtube.com\")){\n\t\t\treturn TRUE;\n\t\t}elseif((strlen($link) == 42) and ($www_http == \"youtube.com\")){\n\t\t\treturn TRUE;\n\t\t}elseif((strlen($link) == 43) and ($www_https == \"youtube.com\")){\n\t\t\treturn TRUE;\n\t\t}else{\n\t\t\t$this->form_validation->set_message('is_youtube_link', 'Invalid Youtube URL');\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function isExternalLink($url)\n {\n $baseLink = preg_replace('#^(http)s?://#', '', $this->link->getBaseLink());\n $url = strtolower($url);\n\n if (preg_match('#^(http)s?://#', $url) && !preg_match('#^(http)s?://' . preg_quote(rtrim($baseLink, '/'), '/') . '#', $url)) {\n return true;\n }\n\n return false;\n }", "private function _validateUrl($value)\n {\n $pattern = '/^{schemes}:\\/\\/(([A-Z0-9][A-Z0-9_-]*)(\\.[A-Z0-9][A-Z0-9_-]*)+)(?::\\d{1,5})?(?:$|[?\\/#])/i';\n $validSchemes = ['http', 'https'];\n $pattern = str_replace('{schemes}', '(' . implode('|', $validSchemes) . ')', $pattern);\n if (!preg_match($pattern, $value)) {\n return false;\n }\n return true;\n }", "public function isValidUrl($url) {\n return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);\n }", "function isValidUrl($url){\n\tif(!$url || !is_string($url)){\n\t\treturn false;\n\t}\n // quick check url is roughly a valid http request: ( http://blah/... ) \n\tif( ! preg_match('/^http(s)?:\\/\\/[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(\\/.*)?$/i', $url) ){\n\t\treturn false;\n\t}\n // the next bit could be slow:\n\tif(getHttpResponseCode_using_curl($url) != 200){\n// if(getHttpResponseCode_using_getheaders($url) != 200){ // use this one if you cant use curl\n\t\treturn false;\n\t}\n // all good!\n\treturn true;\n}", "public function validateLongUrl(&$long_url): bool {\n $return = TRUE;\n\n // If the person didn't remove the original http:// from the field,\n // Pull it out.\n $long_url = preg_replace('!^http\\://(http\\://|https\\://)!i', '\\\\1', $long_url);\n $long_parse = parse_url($long_url);\n\n if ($long_parse === FALSE || !isset($long_parse['host'])) {\n // Malformed URL or no host in the URL.\n $return = FALSE;\n }\n elseif ($long_parse['scheme'] !== 'http' && $long_parse['scheme'] !== 'https') {\n $return = FALSE;\n }\n\n return $return;\n }", "public static function is_external_link($domain, $link)\n {\n $is_external_link = false;\n # If domain name is in link -> internal link\n if(strpos($link, $domain)===false)\n { \n if(strpos($link, 'http')>=0)\n {\n $is_external_link = true;\n }\n }\n return $is_external_link;\n }" ]
[ "0.811764", "0.7895477", "0.74336493", "0.7315041", "0.7305665", "0.72269094", "0.71866745", "0.71478754", "0.70995843", "0.7086149", "0.7077987", "0.70605004", "0.70532256", "0.7018311", "0.7013331", "0.7006243", "0.7000711", "0.70001984", "0.6967123", "0.6961635", "0.6959002", "0.6958501", "0.6954526", "0.6953238", "0.69490635", "0.6947603", "0.6913766", "0.6896925", "0.6880761", "0.68745387", "0.6859006", "0.68572944", "0.6837084", "0.6824823", "0.68132377", "0.6812685", "0.6806122", "0.67949754", "0.6792743", "0.6789652", "0.678425", "0.6783678", "0.67764735", "0.6774946", "0.6766822", "0.6750867", "0.67473006", "0.6739168", "0.6722176", "0.6722159", "0.67147446", "0.67075384", "0.67041445", "0.6703075", "0.66992027", "0.6698911", "0.66961443", "0.6693515", "0.6686557", "0.6681697", "0.6680326", "0.66774726", "0.66750354", "0.66738224", "0.6670915", "0.66708255", "0.6665471", "0.6663845", "0.6653493", "0.6644622", "0.66439295", "0.6640736", "0.663068", "0.66168493", "0.66091126", "0.660498", "0.66045266", "0.65899354", "0.6584199", "0.6581976", "0.6565918", "0.6560688", "0.6555443", "0.65456015", "0.6545189", "0.6544251", "0.65436083", "0.65353453", "0.65340424", "0.652857", "0.6526188", "0.652169", "0.65182215", "0.6512621", "0.651133", "0.6503663", "0.64993304", "0.649126", "0.6488109", "0.6483166" ]
0.86849225
0
Get the value of reg_date.
Получите значение reg_date.
public function getReg_date() { return $this->reg_date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRegDate()\n {\n return $this->reg_date;\n }", "public function getRegDate()\n\t{\n\t\treturn $this->reg_date;\n\t}", "public function getUser_Regdate()\n {\n return $this->user_regdate;\n }", "public function getFieldRegisterDate()\n {\n return $this->fieldRegisterDate;\n }", "public function getDateRegistration()\n {\n return $this->date_registration;\n }", "public function getCustomer_registry_date()\n {\n return $this->customer_registry_date;\n }", "public function getDate_Registration()\r\n\t{\r\n\t\treturn $this->date_registration;\r\n\t}", "public function getRegisterDate()\n\t{\n\t\treturn $this->register_date;\n\t}", "public function getRegistrationDate() {\n return $this->registrationDate;\n }", "public function getRegistrationDate()\n {\n return $this->_registrationDate;\n }", "public function getDateRegister();", "public function getReturnDate()\n {\n return parent::getValue('return_date');\n }", "public function getDate() \n {\n return $this->_fields['Date']['FieldValue'];\n }", "public function getFieldValue()\n {\n return $this->getDate();\n }", "public function get()\n {\n //setting default time zone\n date_default_timezone_set(\"Asia/Jakarta\");\n\n // get date value without delimiter\n $date = date('YmdHis');\n\n // return date value\n return $date;\n }", "public function getDate()\n {\n $value = $this->get(self::DATE);\n return $value === null ? (string)$value : $value;\n }", "public function getCr_date() {\n\t\treturn $this->cr_date;\n\t}", "public function getUserRegDate($data, &$errormessage){\n\t\t$regDate = null;\n\t\t\n\t\tif($data['usertype'] == 3){\n\t\t\t$this->db->select(\"submitdate\");\n\t\t\t$this->db->from(\"student\");\n\t\t\t$this->db->where(array('stud_id'=> $data['userid']));\n\t\t\t$query = $this->db->get();\n\t\t $result = $query->row_array();\n\t\t if($result){\n\t\t\t\t$regDate = $result['submitdate'];\n\t\t\t}\n\t\t}\n\t\t\n\t return $regDate;\n\t}", "public function getFechaRegistro()\n {\n return $this->fecha_registro;\n }", "public function get_date()\n {\n return $this->_date;\n }", "public function getValue()\n {\n $value = parent::getValue();\n\n //trimovani kvuli tomu ze by time_format mohl byt prazdny\n return DateFormat::getUserDate($value, arr::get($this->config, 'php_date_format'));\n }", "private function getDate(){\n\n\t\treturn Date::get( $this->date );\n\n\t}", "public function getRegisterDay(): string\n {\n return $this->registerDay;\n }", "public function getRegTime()\n {\n return $this->reg_time;\n }", "public function getRegistrationsVSMonthDate(){\n $report_registrations_vs_date = $this->reportsService->getRegistrationsVSMonthDate();\n return $report_registrations_vs_date;\n }", "public function getDate(){\n\t\treturn $this->_formatedDate;\n\t}", "public function getDate(){\n\t\treturn $this->date;\n\t}", "function getDate() {\r\n\t\treturn $this->date;\r\n\t}", "public static function regenDate( $date ) {\n\t\t$time = strtotime( $date );\n\t\treturn date( 'Y-m-d', $time );\n\t}", "public function getDate() {\n\t\treturn $this->date; \n\t}", "public function getRegistrationDate() {\n if (!$this->exists()) return null;\n return $this->data[\"user_signup\"];\n }", "public function getDate ()\n {\n return $this->date;\n }", "public function getDate()\r\n\t{\r\n\t\treturn $this->date;\r\n\t}", "public function getDate();", "public function getDate();", "public function getDate();", "public function getDate();", "public function getDate();", "public function getDate();", "public function getDate();", "public function getDate();", "public function getDate();", "public function setReg_date($reg_date)\n {\n $this->reg_date = $reg_date;\n\n return $this;\n }", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "function get_date(){\n\t\treturn date('Y-m-d');\n\t}", "public function getValue()\n {\n return $this->format('Y-m-d H:i:s');\n }", "public function getDate()\r\n {\r\n return $this->date;\r\n }", "public function getDate() {\n\t\treturn $this->date;\n\t}", "public function getDate() {\n\t\treturn $this->date;\n\t}", "public function setRegDate($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->reg_date !== $v) {\n\t\t\t$this->reg_date = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::REG_DATE;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function get_reg_dates($year) {\n if (! empty($this->reg[$year])) {\n $reg_dates = $this->reg[$year]->get('field_registration_year')->getValue();\n return [$reg_dates[0]['value'], $reg_dates[0]['end_value']];\n }\n }", "public function getFechaRegistro() {\n return $this->fechaRegistro;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "private function getDateObject()\n {\n return $this->value;\n }", "function getDate() {\n return $this->date;\n }", "public function getDate() {\n return $this->date;\n }", "public function getDate() {\n return $this->date;\n }", "public function getDate() {\n return $this->date;\n }", "public function getDate() {\n return $this->date;\n }", "public function getDate() {\n return $this->date;\n }", "public function getDate() {\n return $this->date;\n }", "public function getDate() {\n return $this->date;\n }", "public function getDate() {\n return $this->date;\n }", "public function getFechaRegistro()\n {\n return $this->fechaRegistro;\n }", "public function export_value() {\n $value = $this->get_value();\n\n if ($this->is_empty($value)) {\n return null;\n }\n\n // Check if time needs to be included.\n if ($this->get_field()->get_configdata_property('includetime')) {\n $format = get_string('strftimedaydatetime', 'langconfig');\n } else {\n $format = get_string('strftimedate', 'langconfig');\n }\n\n return userdate($value, $format);\n }" ]
[ "0.8022665", "0.7988974", "0.73533624", "0.7055104", "0.69662726", "0.6868883", "0.68580407", "0.6820738", "0.6618916", "0.661826", "0.65561175", "0.64531714", "0.63757133", "0.6372249", "0.6308915", "0.6299319", "0.6271917", "0.6263802", "0.6244699", "0.62407535", "0.6220744", "0.620428", "0.61967975", "0.618615", "0.61318237", "0.60710865", "0.6058981", "0.6023867", "0.6023404", "0.6016756", "0.60025126", "0.59991676", "0.5994626", "0.5991671", "0.5991671", "0.5991671", "0.5991671", "0.5991671", "0.5991671", "0.5991671", "0.5991671", "0.5991671", "0.5988667", "0.5980999", "0.5980999", "0.5980999", "0.5980999", "0.5979137", "0.5975303", "0.5973074", "0.5968435", "0.5968435", "0.5951356", "0.5950746", "0.5933911", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5905046", "0.5904134", "0.5896654", "0.5886455", "0.58846706", "0.5880274", "0.5880274", "0.5880274", "0.5880274", "0.5880274", "0.5880274", "0.5880274", "0.587357", "0.5870138" ]
0.8059761
0
anonimizeIp masquerade last digit of IP address. With bad ip argument return 0.0.0.0 Support IPv4, Ipv6 and IPv4 Compatibility.
anonimizeIp маскирует последнюю цифру IP-адреса. При передаче некорректного ip возвращается 0.0.0.0. Поддерживается IPv4, IPv6 и IPv4-совместимые адреса.
function anonimizeIp(string $ip) : string { if (isIPv4($ip)) { return anonimizeIpv4($ip); } elseif (isIPv4Compatibility($ip)) { return anonimizeIpv4Compatibility($ip); } return anonimizeIpv6($ip); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function _anonymizeIp($ip) {\n $strlen = strlen($ip);\n if ( $strlen > 6 ) :\n $divider = (int)floor($strlen / 4) + 1;\n $ip = substr_replace($ip, '…', $divider, $strlen - (2 * $divider));\n endif;\n\n return $ip;\n }", "function anonimizeIpv4(string $ip):string\n{\n if (isIPv4($ip)) {\n return substr($ip, 0, strrpos($ip, \".\") + 1) . '0';\n }\n return '0.0.0.0';\n}", "function anonimizeIpv4Compatibility(string $ip):string\n{\n if (isIPv4Compatibility($ip)) {\n return substr($ip, 0, strrpos($ip, \".\") + 1) . '0';\n }\n return '0.0.0.0';\n}", "function anonimizeIpWithInet(string $ip):string\n{\n if ($ip = @inet_pton($ip)) {\n return inet_ntop(substr($ip, 0, strlen($ip) / 2) . str_repeat(chr(0), strlen($ip) / 2));\n }\n return '0.0.0.0';\n}", "function anonimizeIpv6(string $ip):string\n{\n if (strrpos($ip, \":\") > 0) {\n return substr($ip, 0, strrpos($ip, \":\") + 1) . '0';\n }\n return '0.0.0.0';\n}", "public function ip();", "function wp_privacy_anonymize_ip($ip_addr, $ipv6_fallback = \\false)\n{\n}", "public static function cleanIP($ip) {\r\n return preg_replace('~(^|[.:])0{1,2}(\\d)~','$1$2',$ip);\r\n }", "public function ip() : string;", "function filterinputip($ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP,FILTER_FLAG_IPV4)) {\n $ex = 4;\n }\n elseif (filter_var($ip, FILTER_VALIDATE_IP,FILTER_FLAG_IPV6)) {\n $ex = 6;\n }\n else {\n $ex = 0;\n }\n // whitelisted IPs\n if($ex == 4 && (preg_match_all(IPV4WL, $ip, $matches, PREG_SET_ORDER, 0))) $ex=0;\n if($ex == 6 && (preg_match_all(IPV6WL, $ip, $matches, PREG_SET_ORDER, 0))) $ex=0;\n return($ex);\n}", "function long2ip($proper_address)\n{\n return 0;\n}", "function _reverse_ip() {\r\n if ($this->ip)\r\n {\r\n preg_match(\"/[0-9]{1,4}.[0-9]{1,4}.[0-9]{1,4}.[0-9]{1,4}/\", $this->ip, $matches);\r\n $pieces = explode(\".\", $matches[0]);\r\n if (count($pieces)==4)\r\n {\r\n $this->_rip = $pieces[3] . '.' . $pieces[2] . '.' . $pieces[1] . '.' . $pieces[0];\r\n }\r\n }\r\n }", "public static function validIpDataProvider() {}", "public function anonymizeIpReturnsCorrectValueDataProvider() : array {}", "public static function invalidIpDataProvider() {}", "function long2ip($proper_address)\n{\n\treturn 0;\n}", "function valid_ip_range ($ip_string) {\n\t$ip_temp = trim($ip_string);\n\t$ip_return = 'N';\n\t$test_ipv4 = strcspn($ip_temp, '.');\n\tif ($test_ipv4 > 0) {\n\t\t$ipv4_slash = strcspn($ip_temp, '/');\n\t\tif ( ($ipv4_slash > 0) && ($ipv4_slash < (strlen($ip_temp))) ) {\n\t\t\t$mask_ok = FALSE;\n\t\t\t$front_ok = FALSE;\n\t\t\t$first_part = substr($ip_temp,0,$ipv4_slash);\n\t\t\t$mask_part = substr($ip_temp,($ipv4_slash + 1));\n\t\t\tif ( ($mask_part > 1) && ($mask_part < 32) ) {\n\t\t\t\t$mask_ok = TRUE;\n\t\t\t}\n\t\t\t$quad_arr = explode('.', $first_part);\n\t\t\t$q_count = 0;\n\t\t\tif ( is_array($quad_arr) ) {\n\t\t\t\t$a_count = count($quad_arr);\n\t\t\t\tfor($i=0; $i < $a_count; $i++) {\n\t\t\t\t\t$q_val = $quad_arr[$i];\n\t\t\t\t\tif ( ($q_val > -1) && ($q_val < 256) ) {\n\t\t\t\t\t\t$q_count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( $mask_ok && ($a_count == $q_count) ) {\n\t\t\t\t\t$ip_return = '4';\n\t\t\t\t}\t\n\t\t\t}\n\t\t} else {\n\t\t\t$ipv4_val = filter_var($ip_temp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\n\t\t\tif ($ipv4_val !== FALSE) {\n\t\t\t\t$ip_return = '4';\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$ipv6_val = filter_var($ip_temp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n\t\tif ($ipv6_val !== FALSE) {\n\t\t\t$ip_return = '6';\n\t\t}\n\t}\n\treturn $ip_return;\n}", "function long2ip(int $ip): string\n{\n error_clear_last();\n $safeResult = \\long2ip($ip);\n if ($safeResult === false) {\n throw NetworkException::createFromPhpError();\n }\n return $safeResult;\n}", "public function getIp();", "public function isIp();", "function check_ipv4($ip) {\r\n\tif(preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/',$ip)) {\r\n\t\tif(!ereg('^0.',$ip)) {\r\n\t\t\tforeach(explode(\".\",$dq_host) as $octet ){\r\n \t\t\t\tif($octet > 255){ \r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 1;\r\n\t}\r\n\treturn 0;\r\n}", "function sumo_validate_ip($ip=FALSE)\n{\n\tif($ip)\n\t{\n\t\t$valid = TRUE;\n\t\t$ip = explode(\".\", $ip);\n\n\t\tif(count($ip) != 4) $valid = FALSE;\n\n\t\tforeach($ip as $block)\n\t\t{\n\t\t\tif(ereg(\"^0+.+\", $block) || $block>255 || $block<0 || strlen($block)>3) $valid = FALSE;\n\t\t}\n\n\t\treturn $valid;\n\t}\n\telse return FALSE;\n}", "public function getIp(): string;", "function validate_ip($ip) {\r\n if (strtolower($ip) === 'unknown')\r\n return false;\r\n\r\n // generate ipv4 network address\r\n $ip = ip2long($ip);\r\n\r\n // if the ip is set and not equivalent to 255.255.255.255\r\n if ($ip !== false && $ip !== -1) {\r\n // make sure to get unsigned long representation of ip\r\n // due to discrepancies between 32 and 64 bit OSes and\r\n // signed numbers (ints default to signed in PHP)\r\n $ip = sprintf('%u', $ip);\r\n // do private network range checking\r\n if ($ip >= 0 && $ip <= 50331647) return false;\r\n if ($ip >= 167772160 && $ip <= 184549375) return false;\r\n if ($ip >= 2130706432 && $ip <= 2147483647) return false;\r\n if ($ip >= 2851995648 && $ip <= 2852061183) return false;\r\n if ($ip >= 2886729728 && $ip <= 2887778303) return false;\r\n if ($ip >= 3221225984 && $ip <= 3221226239) return false;\r\n if ($ip >= 3232235520 && $ip <= 3232301055) return false;\r\n if ($ip >= 4294967040) return false;\r\n }\r\n return true;\r\n}", "public function ipAddress($ipAddress = null);", "function get_ip_address($amount=4)\n{\n//\treturn strval(mt_rand(0,255)).'.'.strval(mt_rand(0,255)).'.'.strval(mt_rand(0,255)).'.'.strval(mt_rand(0,255)); // Nice little test for if sessions break\n\n\t$fw=ocp_srv('HTTP_X_FORWARDED_FOR');\n\tif (ocp_srv('HTTP_CLIENT_IP')!='') $fw=ocp_srv('HTTP_CLIENT_IP');\n\tif (($fw!='') && ($fw!='127.0.0.1') && (substr($fw,0,8)!='192.168.') && (substr($fw,0,3)!='10.') && (is_valid_ip($fw)) && ($fw!=ocp_srv('SERVER_ADDR'))) $ip=$fw;\n\telse $ip=ocp_srv('REMOTE_ADDR');\n\n\t// Bizarro-filter (found \"in the wild\")\n\t$pos=strpos($ip,',');\n\tif ($pos!==false) $ip=substr($ip,0,$pos);\n\n\t$ip=preg_replace('#%14$#','',$ip);\n\n\tif (!is_valid_ip($ip)) return '';\n\n\tif (strpos($ip,'.')===false)\n\t{\n\t\tif (substr_count($ip,':')<7)\n\t\t{\n\t\t\t$ip=str_replace('::',str_repeat(':',(7-substr_count($ip,':'))+2),$ip);\n\t\t}\n\t\t$parts=explode(':',$ip);\n\t\tfor ($i=0;$i<$amount*2;$i++)\n\t\t{\n\t\t\t$parts[$i]=isset($parts[$i])?str_pad($parts[$i],4,'0',STR_PAD_LEFT):'0000';\n\t\t}\n\t\tfor ($i=$amount*2;$i<8;$i++)\n\t\t{\n\t\t\t$parts[$i]='*';\n\t\t}\n\t\treturn implode(':',$parts);\n\t} else\n\t{\n\t\t$parts=explode('.',$ip);\n\t\tfor ($i=0;$i<$amount;$i++)\n\t\t{\n\t\t\tif (!array_key_exists($i,$parts)) $parts[$i]='0';\n\t\t}\n\t\tfor ($i=$amount;$i<4;$i++)\n\t\t{\n\t\t\t$parts[$i]='*';\n\t\t}\n\t\treturn implode('.',$parts);\n\t}\n}", "function int_ip($ip = null)\n{\n return CNetwork::int_ip($ip);\n}", "public static function guessIP(){\n\t\t// because fake ips from proxies are bogus. // read up here: http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html\n\t\t//check ip from share internet\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip=$_SERVER['HTTP_CLIENT_IP']; }\n\t\t//to check ip is pass from proxy\n\t\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; }\n\t\t// otherwise, you're probably an average joe or jane\n\t\telse { $ip=$_SERVER['REMOTE_ADDR']; }\n\t\t\n\t\tif($ip == '::1') { return '127.0.0.1'; } // either way this is wrong.\n\t\t\n\t\treturn $ip;\n\t}", "function GetMainAddress($ip){\n\tforeach($ip as $address){\n\t\tif(strlen($address) < 8) continue;\n\t\t$tmp = explode('.',$address);\n\t\tif($tmp[0] == '10') continue;\n\t\tif($tmp[0] == '192' && $tmp[1] == '168') continue;\n\t\tif($tmp[0] == '172' && $tmp[1] > 15 and $tmp[1] < 32) continue;\n\t\treturn $address;\n\t}\n\tif(strlen($ip[0]) < 8) return $ip[1];\n\treturn $ip[0];\n}", "public static function anonymizeIp($address)\n {\n if (uHub('anonymize_ip_addr') == false) {\n return $address;\n }\n\n return IPUtils::anonymize($address);\n }", "public function setBannedIp($ip)\n\t{\n\t\t$ip = preg_replace('#\\.\\*$#', '', $ip);\n\n\t\t// Remove bad chars\n\t\t$ip = preg_replace('#[^0-9\\.]#', '', $ip);\n\n\t\t// Remove trailin dots\n\t\t$ip = trim($ip, '.');\n\n\t\t$parts = explode('.', $ip);\n\t\tif (count($parts) < 1 OR count($parts) > 4) {\n\t\t\tthrow new \\InvalidArgumentException('Invalid IP address: `'.$ip.'`');\n\t\t}\n\n\t\t$start = array();\n\t\t$end = array();\n\n\t\tforeach ($parts as $part) {\n\t\t\t$start[] = $part;\n\t\t\t$end[] = $part;\n\t\t}\n\n\t\t// For wildcarded parts we're missing some octets,\n\t\t// so we'll fill them in automatically\n\t\twhile (count($start) < 4) {\n\t\t\t$start[] = 0;\n\t\t\t$end[] = 255;\n\t\t}\n\n\t\tif (count($parts) < 4) {\n\t\t\t$human = implode('.', $parts) . '.*';\n\t\t} else {\n\t\t\t$human = implode('.', $parts);\n\t\t}\n\n\t\t$this->banned_ip = $human;\n\t\t$this->ip_start = sprintf(\"%u\", ip2long(implode('.', $start)));\n\t\t$this->ip_end = sprintf(\"%u\", ip2long(implode('.', $end)));\n\t}", "function s_inputip($ip) {\n\t $pattern = '/(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/';\n\t $parts = array();\n\t if(preg_match($pattern,$ip,$parts)==1) {\n\t\tif(inet_pton($ip) !== false)\n\t\t return($ip);\n\t }\n\t return(0);\n\t}", "function ip2long($ip_address)\n{\n return 0;\n}", "public static function is_ip_address($maybe_ip)\n {\n }", "public static function ip() {\r\n\t\tstatic $ip = NULL;\r\n\t\tif (is_null($ip)) {\r\n\t\t\tforeach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $n) {\r\n\t\t\t\t$cur2ip = filter_input(INPUT_SERVER, $n);\r\n\t\t\t\tif (!$cur2ip) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$curip = explode('.', $cur2ip);\r\n\t\t\t\tif (count($curip) !== 4) {\r\n\t\t\t\t\t// if they've sent at least one invalid IP, break out\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($curip as $sup) {\r\n\t\t\t\t\tif (($sup = intval($sup)) < 0 or $sup > 255) {\r\n\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$curip_bin = $curip[0] << 24 | $curip[1] << 16 | $curip[2] << 8 | $curip[3];\r\n\t\t\t\tforeach (array(\r\n\t\t\t// hexadecimal ip ip mask\r\n\t\t\tarray(0x7F000001, 0xFFFF0000), // 127.0..\r\n\t\t\tarray(0x0A000000, 0xFFFF0000), // 10.0..\r\n\t\t\tarray(0xC0A80000, 0xFFFF0000), // 192.168..\r\n\t\t\t\t) as $ipmask) {\r\n\t\t\t\t\tif (($curip_bin & $ipmask[1]) === ($ipmask[0] & $ipmask[1])) {\r\n\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn $ip = $cur2ip;\r\n\t\t\t}\r\n\t\t\t$ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR');\r\n\t\t}\r\n\r\n\t\treturn $ip;\r\n\t}", "function checkIP($ip=null){\r\n\t\tif(empty($ip)){$ip=$_SERVER['REMOTE_ADDR'];}\r\n\t\tglobal $auto_restrict;\r\n\r\n\t\tif (isset($auto_restrict[\"banned_ip\"][$ip])){\r\n\t\t\tif ($auto_restrict[\"banned_ip\"][$ip]['nb']<$auto_restrict['max_security_issues_before_ban']){return true;} // below max login fails \r\n\t\t\telse if ($auto_restrict[\"banned_ip\"][$ip]['date']>=@date('U')){return false;} // active banishment \r\n\t\t\telse if ($auto_restrict[\"banned_ip\"][$ip]['date']<@date('U')){remove_banned_ip($ip);return true;} // old banishment \r\n\t\t\treturn false;\r\n\t\t}else{return true;}// ip is ok\r\n\t}", "function ip()\n\t{\n\t\t// No IP found (will be overwritten by for\n\t\t// if any IP is found behind a firewall)\n\t\t$ip = FALSE;\n\t\t\n\t\t// If HTTP_CLIENT_IP is set, then give it priority\n\t\tif (!empty($_SERVER[\"HTTP_CLIENT_IP\"])) {\n\t\t\t$ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n\t\t}\n\t\t\n\t\t// User is behind a proxy and check that we discard RFC1918 IP addresses\n\t\t// if they are behind a proxy then only figure out which IP belongs to the\n\t\t// user. Might not need any more hackin if there is a squid reverse proxy\n\t\t// infront of apache.\n\t\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\n\t\t\t// Put the IP's into an array which we shall work with shortly.\n\t\t\t$ips = explode (\", \", $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\tif ($ip) { array_unshift($ips, $ip); $ip = FALSE; }\n\n\t\t\tfor ($i = 0; $i < count($ips); $i++) {\n\t\t\t\t// Skip RFC 1918 IP's 10.0.0.0/8, 172.16.0.0/12 and\n\t\t\t\t// 192.168.0.0/16\n\t\t\t\tif (!preg_match('/^(?:10|172\\.(?:1[6-9]|2\\d|3[01])|192\\.168)\\./', $ips[$i])) {\n\t\t\t\t\tif (version_compare(phpversion(), \"5.0.0\", \">=\")) {\n\t\t\t\t\t\tif (ip2long($ips[$i]) != false) {\n\t\t\t\t\t\t\t$ip = $ips[$i];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (ip2long($ips[$i]) != -1) {\n\t\t\t\t\t\t\t$ip = $ips[$i];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Return with the found IP or the remote address\n\t\treturn ($ip ? $ip : $_SERVER['REMOTE_ADDR']);\n\t}", "function checkForIP( $input )\n{\n\n // CONTROLLING THE INPUT DATA:\n if ( ! isset($input) )\n die(displayMessage(\"No input set.\"));\n\n $control = explode(\".\", $input);\n if (count($control) != 4)\n die(displayMessage(\"Input format error.\"));\n\n foreach( $control as $byte)\n {\n if( strlen($byte) <= 0 || 3 < strlen($byte) )\n die(displayMessage(\"Input format error.\"));\n }\n\n // TODO: Legg til regex sanitering.\n}", "public static function get_ip_address()\n {\n }", "function test_ip($ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP)) {\n return 1;\n } else {\n return 0;\n }\n}", "private function validate_ip($_ip) {\n if (strtolower($_ip) === 'unknown') {\n return false;\n }\n // generate ipv4 network address\n $ip = ip2long($ip);\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647) { return false; }\n if ($ip >= 167772160 && $ip <= 184549375) { return false; }\n if ($ip >= 2130706432 && $ip <= 2147483647) { return false; }\n if ($ip >= 2851995648 && $ip <= 2852061183) { return false; }\n if ($ip >= 2886729728 && $ip <= 2887778303) { return false; }\n if ($ip >= 3221225984 && $ip <= 3221226239) { return false; }\n if ($ip >= 3232235520 && $ip <= 3232301055) { return false; }\n if ($ip >= 4294967040) { return false; }\n }\n return true;\n }", "private function long2Ip(mixed $ipAddress): string\n {\n $output = '';\n for ($offset = 0; $offset < 4; $offset++) {\n $output = $this->calculator->mod($ipAddress, 256).$output;\n if ($offset < 3) {\n $output = '.'.$output;\n }\n $ipAddress = $this->calculator->div($ipAddress, 256);\n }\n\n return $output;\n }", "function validate_ip($ip) {\n\t\t\tif (preg_match(\"/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/\", $ip))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "public function getActualIpv4()\n\t\t{\n\t\t\t$ip = $this->getIp();\n\t\t\t\n\t\t\tif(\n\t\t\t\t($pos = mb_strripos($ip, '.') )\n\t\t\t)\n\t\t\t{\n\t\t\t\t$ip = mb_substr($ip, 0, $pos).'.0';\n\t\t\t}\n\t\t\t\n\t\t\treturn $ip;\n\t\t}", "function hex2ip($ip_hex)\n{\n $ip = trim($ip_hex, \"\\\"\\t\\n\\r\\0\\x0B\");\n\n // IPv6z, ie: 2a:02:a0:10:80:03:00:00:00:00:00:00:00:00:00:01%503316482\n if (str_contains($ip, '%'))\n {\n list($ip) = explode('%', $ip);\n }\n\n $len = strlen($ip);\n if ($len === 5 && $ip[0] === ' ')\n {\n $ip = substr($ip, 1);\n $len = 4;\n }\n if ($len === 4)\n {\n // IPv4 hex string converted to SNMP string\n $ip = str2hex($ip);\n $len = strlen($ip);\n }\n\n $ip = str_replace(' ', '', $ip);\n\n if ($len > 8)\n {\n // For IPv6\n $ip = str_replace(':', '', $ip);\n $len = strlen($ip);\n }\n\n if (!ctype_xdigit($ip))\n {\n return $ip_hex;\n }\n\n switch ($len)\n {\n case 8:\n // IPv4\n $ip_array = array();\n foreach (str_split($ip, 2) as $entry)\n {\n $ip_array[] = hexdec($entry);\n }\n $separator = '.';\n break;\n\n case 16:\n // Cisco incorrect IPv4 (54 2E 68 02 FF FF FF FF)\n $ip_array = array();\n foreach (str_split($ip, 2) as $i => $entry)\n {\n if ($i == 4) { break; }\n $ip_array[] = hexdec($entry);\n }\n $separator = '.';\n break;\n\n case 32:\n // IPv6\n $ip_array = str_split(strtolower($ip), 4);\n $separator = ':';\n break;\n\n default:\n // Try convert hex string to string\n $ip = snmp_hexstring($ip_hex);\n if (get_ip_version($ip))\n {\n return $ip;\n }\n return $ip_hex;\n }\n $ip = implode($separator, $ip_array);\n\n return $ip;\n}", "function throttle_ip_check()\n \t{\n\t\tif (ee()->config->item('banish_masked_ips') == 'y' AND ee()->input->ip_address() == '0.0.0.0' OR ee()->input->ip_address() == '')\n\t\t{\n\t\t\t$this->banish();\n\t\t}\n \t}", "function formatBinaire($ip, $mask){\n $partIp = explode(\".\", $ip);\n $index = 32 - $mask;\n //On ajoute l'espace au bon endroit suivant l'index trouvé à l'aide du masque\n if($index < 8){\n $partIp[3] = substr($partIp[3], 0, 8-$index%8) . \" \" . substr($partIp[3], 8-$index%8);\n }elseif($index < 16){\n $partIp[2] = substr($partIp[2], 0, 8-$index%8) . \" \" . substr($partIp[2], 8-$index%8);\n }elseif($index < 24){\n $partIp[1] = substr($partIp[1], 0, 8-$index%8) . \" \" . substr($partIp[1], 8-$index%8);\n }elseif($index < 32){\n $partIp[0] = substr($partIp[0], 0, 8-$index%8) . \" \" . substr($partIp[0], 8-$index%8);\n }\n return implode(\".\", $partIp);\n}", "function validate_ip($ip) {\r\n\t\tif (strtolower($ip) === 'unknown')\r\n\t\t\treturn false;\r\n\r\n\t\t// generate ipv4 network address\r\n\t\t$ip = ip2long($ip);\r\n\r\n\t\t// if the ip is set and not equivalent to 255.255.255.255\r\n\t\tif ($ip !== false && $ip !== -1) {\r\n\t\t\t// make sure to get unsigned long representation of ip\r\n\t\t\t// due to discrepancies between 32 and 64 bit OSes and\r\n\t\t\t// signed numbers (ints default to signed in PHP)\r\n\t\t\t$ip = sprintf('%u', $ip);\r\n\t\t\t// do private network range checking\r\n\t\t\tif ($ip >= 0 && $ip <= 50331647) return false;\r\n\t\t\tif ($ip >= 167772160 && $ip <= 184549375) return false;\r\n\t\t\tif ($ip >= 2130706432 && $ip <= 2147483647) return false;\r\n\t\t\tif ($ip >= 2851995648 && $ip <= 2852061183) return false;\r\n\t\t\tif ($ip >= 2886729728 && $ip <= 2887778303) return false;\r\n\t\t\tif ($ip >= 3221225984 && $ip <= 3221226239) return false;\r\n\t\t\tif ($ip >= 3232235520 && $ip <= 3232301055) return false;\r\n\t\t\tif ($ip >= 4294967040) return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function getClasseAdresseIp($ip){\n $part = explode(\".\", $ip);\n if(inRange($part[0], 0, 128)){\n return \"A\";\n }elseif(inRange($part[0], 127, 192)){\n return \"B\";\n }elseif(inRange($part[0], 191, 224)){\n return \"C\";\n }elseif(inRange($part[0], 223, 240)){\n return \"D\";\n }else{\n return \"E\";\n }\n}", "function iPv4To6($ip)\n{\n if(isNullOrEmpty($ip)){\n return '';\n }\n\n static $Mask = '::ffff:'; // This tells IPv6 it has an IPv4 address\n $IPv6 = (strpos($ip, '::') === 0);\n $IPv4 = (strpos($ip, '.') > 0);\n\n if (!$IPv4 && !$IPv6) {\n return false;\n }\n if ($IPv6 && $IPv4) {\n // Strip IPv4 Compatibility notation\n $ip = substr($ip, strrpos($ip, ':') + 1);\n } elseif (!$IPv4) {\n // Seems to be IPv6 already?\n return $ip;\n }\n $ip = array_pad(explode('.', $ip), 4, 0);\n if (count($ip) > 4) {\n return false;\n }\n for ($i = 0; $i < 4; $i++) {\n if ($ip[$i] > 255) {\n return false;\n }\n }\n\n $Part7 = base_convert(($ip[0] * 256) + $ip[1], 10, 16);\n $Part8 = base_convert(($ip[2] * 256) + $ip[3], 10, 16);\n return $Mask . $Part7 . ':' . $Part8;\n}", "function gdk_validate_ip($ip)\n{\n if ('unknown' === strtolower($ip)) {\n return false;\n }\n // generate ipv4 network address\n $ip = ip2long($ip);\n // if the ip is set and not equivalent to 255.255.255.255\n if (false !== $ip && -1 !== $ip) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers ( ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647) {\n return false;\n }\n\n if ($ip >= 167772160 && $ip <= 184549375) {\n return false;\n }\n\n if ($ip >= 2130706432 && $ip <= 2147483647) {\n return false;\n }\n\n if ($ip >= 2851995648 && $ip <= 2852061183) {\n return false;\n }\n\n if ($ip >= 2886729728 && $ip <= 2887778303) {\n return false;\n }\n\n if ($ip >= 3221225984 && $ip <= 3221226239) {\n return false;\n }\n\n if ($ip >= 3232235520 && $ip <= 3232301055) {\n return false;\n }\n\n if ($ip >= 4294967040) {\n return false;\n }\n }\n\n return true;\n}", "function osubs_get_ip() {\n\t\tif ( isset( $_SERVER['HTTP_CLIENT_IP'] ) && ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t} else {\n\t\t\t$ip = ( isset( $_SERVER['REMOTE_ADDR'] ) ) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';\n\t\t}\n\n\t\t$ip = filter_var( $ip, FILTER_VALIDATE_IP );\n\t\t$ip = ( $ip === false ) ? '0.0.0.0' : $ip;\n\n\t\treturn $ip;\n\t}", "public function validate_ipn()\n {\n }", "public static function IP($ip = false)\r\n {\r\n if ($ip) {\r\n $ip = $ip;\r\n } else {\r\n $ip_keys = array(\r\n 'HTTP_CLIENT_IP',\r\n 'HTTP_X_FORWARDED_FOR',\r\n 'HTTP_X_FORWARDED',\r\n 'HTTP_X_CLUSTER_CLIENT_IP',\r\n 'HTTP_FORWARDED_FOR',\r\n 'HTTP_FORWARDED',\r\n 'REMOTE_ADDR',\r\n );\r\n foreach ($ip_keys as $key) {\r\n if (array_key_exists($key, $_SERVER) === true) {\r\n foreach (explode(',', $_SERVER[$key]) as $ip) {\r\n $ip = trim($ip);\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {\r\n return $ip;\r\n } else {\r\n return false;\r\n }\r\n }", "static public function applyIPMask($ip, $maskLength)\n\t{\n\t\t$i = Piwik_Common::strlen($ip);\n\t\tif($maskLength > $i)\n\t\t{\n\t\t\t$maskLength = $i;\n\t\t}\n\n\t\twhile($maskLength-- > 0)\n\t\t{\n\t\t\t$ip[--$i] = chr(0);\n\t\t}\n\n\t\treturn $ip;\n\t}", "public function validateIp()\n {\n if (filter_var($this->ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {\n $this->status = \"IPV4\";\n } else if (filter_var($this->ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n $this->status = \"IPV6\";\n } else {\n $this->status = null;\n }\n\n return $this->status;\n }", "function ipv6_short( $ip ) {\n\tif( ! strpos( $ip, ':' ) ) {\n\t\treturn $ip;\n\t}\n\n\t$ip_short = inet_ntop( inet_pton( $ip ) );\n\n\tif( ! $ip_short ) {\n\t\treturn $ip;\n\t}\n\n\treturn $ip_short;\n}", "public function validate_ip($ip)\n{\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n return false;\n }\n return true;\n}", "public static function getUserIpAlt()\n\t{\n\t\t$alt_ip = null;\n\n\t\tif ($alt_ip === null) {\n\n\t\t\tif (isset($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t\t$alt_ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\t}\n\n\t\t\tif (!$alt_ip AND isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t\t$ip_arr = array();\n\n\t\t\t\tif (preg_match_all('#\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $ip_arr)) {\n\t\t\t\t\tforeach($ip_arr[0] AS $ip) {\n\t\t\t\t\t\tif (!preg_match(\"#^(10|172\\.16|192\\.168)\\.#\", $ip)) {\n\t\t\t\t\t\t\t$alt_ip = $ip;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$alt_ip AND isset($_SERVER['HTTP_FROM'])) {\n\t\t\t\t$alt_ip = $_SERVER['HTTP_FROM'];\n\t\t\t}\n\n\t\t\tif (!$alt_ip AND isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\t\t$alt_ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t}\n\t\t}\n\n\t\treturn $alt_ip;\n\t}", "public function getRandomIP()\n {\n return mt_rand(0,255).'.'.mt_rand(0,255).'.'.mt_rand(0,255).'.'.mt_rand(0,255);\n }", "public static function getIp()\n {\n return self::obterIp();\n }", "public static function pton(string $ip) : string\n {\n // Detect the IP version\n $ipv = self::detectIPVersion($ip);\n\n // Check for IPv4 first since that's most common\n if ($ipv === 4) {\n return current(unpack('a4', inet_pton($ip)));\n }\n\n // Then attempt IPv6\n if ($ipv === 6) {\n return current(unpack('A16', inet_pton($ip)));\n }\n\n // Throw an exception if an invalid IP was supplied\n throw new NetInvalidAddressException();\n }", "public static function isIp($input) {\n\t\treturn preg_match('/^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/', $input);\n\t}", "function valid_ip( $ip, $flags = null ){\n\treturn \\filter_var($ip, \\FILTER_VALIDATE_IP, (\n\t\tempty($flags)\n\t\t? \\FILTER_FLAG_NO_RES_RANGE\n\t\t: $flags\n\t));\n}", "public function getIp()\n {\n return !empty($this->ip) ? $this->ip : \"N/A\";\n }", "protected function randomIpAddress()\n {\n return sprintf(\n '%d.%d.%d.%d:%d',\n mt_rand(0, 255),\n mt_rand(0, 255),\n mt_rand(0, 255),\n mt_rand(0, 255),\n mt_rand(1, 65535)\n );\n }", "public function getIpAddress() { return Various::getIP(); }", "function validate_ip($ip) \n\t{\n\t if (strtolower($ip) === 'unknown')\n\t return false;\n\n\t // generate ipv4 network address\n\t $ip = ip2long($ip);\n\n\t // if the ip is set and not equivalent to 255.255.255.255\n\t if ($ip !== false && $ip !== -1) {\n\t // make sure to get unsigned long representation of ip\n\t // due to discrepancies between 32 and 64 bit OSes and\n\t // signed numbers (ints default to signed in PHP)\n\t $ip = sprintf('%u', $ip);\n\t // do private network range checking\n\t if ($ip >= 0 && $ip <= 50331647) return false;\n\t if ($ip >= 167772160 && $ip <= 184549375) return false;\n\t if ($ip >= 2130706432 && $ip <= 2147483647) return false;\n\t if ($ip >= 2851995648 && $ip <= 2852061183) return false;\n\t if ($ip >= 2886729728 && $ip <= 2887778303) return false;\n\t if ($ip >= 3221225984 && $ip <= 3221226239) return false;\n\t if ($ip >= 3232235520 && $ip <= 3232301055) return false;\n\t if ($ip >= 4294967040) return false;\n\t }\n\t return true;\n\t}", "function ee_inet_ntop($ip)\n{\n\t// unpack the binary\n\t$hex = unpack('H*', $ip);\n\t$hex = current($hex);\n\n\t$len = strlen($hex);\n\n\t// ipv4\n\tif ($len == 8)\n\t{\n\t\t$parts = str_split($hex, 2);\n\t\t$parts = array_map('hexdec', $parts);\n\t\treturn implode('.', $parts);\n\t}\n\n\t// ipv6\n\tif ($len != 32)\n\t{\n\t\tshow_error('Invalid IP address.');\n\t}\n\n\t$parts = str_split($hex, 4);\n\n\t// find the longest run of zeros\n\t$start = -1;\n\t$len = 0;\n\t$best_start = -1;\n\t$best_len = 0;\n\n\tforeach ($parts as $i => &$part)\n\t{\n\t\tif ($part == '0000')\n\t\t{\n\t\t\tif ($start == -1)\n\t\t\t{\n\t\t\t\t$start = $i;\n\t\t\t\t$len = 0;\n\t\t\t}\n\n\t\t\t$len++;\n\t\t}\n\t\telseif ($start != -1 && ($best_start == -1 OR $len > $best_len))\n\t\t{\n\t\t\t$best_start = $start;\n\t\t\t$best_len = $len;\n\t\t\t$start = -1;\n\t\t}\n\t}\n\n\t// didn't move best?\n\tif ($start != -1 && ($best_start == -1 OR $len > $best_len))\n\t{\n\t\t$best_start = $start;\n\t\t$best_len = $len;\n\t}\n\n\t// print out the result\n\t$out = '';\n\n\tforeach ($parts as $i => &$part)\n\t{\n\t\tif ($best_start != -1)\n\t\t{\n\t\t\tif ($i >= $best_start && $i < ($best_start + $best_len))\n\t\t\t{\n\t\t\t\tif ($i == $best_start)\n\t\t\t\t{\n\t\t\t\t\t$out .= ':';\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif ($i)\n\t\t{\n\t\t\t$out .= ':';\n\t\t}\n\n\t\t// ipv4 mapped?\n\t\tif ($i == 6 && $best_start == 0 &&\n\t\t\t($best_len == 6 OR ($best_len == 5 && $parts[5] == 'ffff')))\n\t\t{\n\t\t\t$out .= ee_inet_ntop(pack('H4H4', $parts[6], $parts[7]));\n\t\t\tbreak;\n\t\t}\n\n\t\t// collapse the hex string\n\t\t$out .= sprintf('%x', hexdec($part));\n\t}\n\n\treturn $out;\n}", "private function getVisitorIPAddress()\n\t{\n\t\t// Get our IP address\n\t\t$ip = AtsystemUtilFilter::getIp();\n\n\t\tif ((strpos($ip, '::') === 0) && (strstr($ip, '.') !== false))\n\t\t{\n\t\t\t$ip = substr($ip, strrpos($ip, ':') + 1);\n\t\t}\n\n\t\t// No point continuing if we can't get an address, right?\n\t\tif (empty($ip) || ($ip == '0.0.0.0'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $ip;\n\t}", "abstract function allow_ip($name, array $ip);", "function htz_getzonehostip($arr) {\n // Remove anything until first digit.\n $htz_zoneip=preg_replace('/.*IN A[\\s]+/','',$arr[0]);\n // Remove whitespace(s) if any.\n $htz_zoneip=preg_replace('/[\\s]+/','',$htz_zoneip);\n if (htz_validateip($htz_zoneip)) {\n return $htz_zoneip;\n } else {\n htz_say(__FUNCTION__. \": Validation of IP $arr[0] failed.\",2);\n }\n}", "public function getClientIp();", "function decode_ip($int_ip)\r{\r\t$hexipbang = explode('.', chunk_split($int_ip, 2, '.'));\r\treturn hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);\r}", "function validate_ip($ip)\n{\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n return false;\n }\n return true;\n}", "public static function ip_get() {\n\t\t$ip = '0000:0000:0000:0000:0000:0000:0000:0001';\n\t\tif (php_sapi_name()=='cli') {\n\t\t\tif (isset($_SERVER['SSH_CLIENT'])) {\n\t\t\t\t$ip = explode(' ',$_SERVER['SSH_CLIENT']);\n\t\t\t\t$ip = $ip[0];\n\t\t\t}\n\t\t} else {\n\t\t\tif (isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t}\n\t\t}\n\t\t$ip = inet_pton($ip);\n\t\tif (strlen($ip)<16&&strlen($ip)==4) {\n\t\t\t$ip = str_repeat(chr(0), 10).str_repeat(chr(255), 2).$ip;\n\t\t}\n\t\t$ip = inet_ntop($ip);\n\t\treturn $ip;\n\t}", "function ip2long($ip_address)\n{\n\treturn 0;\n}", "function validate_ip($ip){\n\t if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n\t return false;\n\t }\n\t return true;\n\t}", "function ip2hex ($ip) {\n\t\tif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false) {\n\t\t\t$isIPv4 = true;\n\t\t} elseif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false) {\n\t\t\t$isIPv4 = false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t//IPv4 format\n\t\tif($isIPv4) {\n\t\t\t$parts = explode('.', $ip);\n\t\t\tforeach ($parts as &$part) {\n\t\t\t\t$part = str_pad(dechex($part), 2, '0', STR_PAD_LEFT);\n\t\t\t}\n\t\t\tunset($part);\n\t\t\t$ip\t\t\t= '::'.$parts[0].$parts[1].':'.$parts[2].$parts[3];\n\t\t\t$hex\t\t= implode('', $parts);\n\t\t//IPv6 format\n\t\t} else {\n\t\t\t$parts\t\t= explode(':', $ip);\n\t\t\t$last_part\t= count($parts) - 1;\n\t\t\t//If mixed IPv6/IPv4, convert ending to IPv6\n\t\t\tif(filter_var($parts[$last_part], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false) {\n\t\t\t\t$parts[$last_part] = explode('.', $parts[$last_part]);\n\t\t\t\tforeach ($parts[$last_part] as &$part) {\n\t\t\t\t\t$part = str_pad(dechex($part), 2, '0', STR_PAD_LEFT);\n\t\t\t\t}\n\t\t\t\tunset($part);\n\t\t\t\t$parts[]\t\t\t= $parts[$last_part][2].$parts[$last_part][3];\n\t\t\t\t$parts[$last_part]\t= $parts[$last_part][0].$parts[$last_part][1];\n\t\t\t}\n\t\t\t$numMissing\t\t= 8 - count($parts);\n\t\t\t$expandedParts\t= [];\n\t\t\t$expansionDone\t= false;\n\t\t\tforeach($parts as $part) {\n\t\t\t\tif(!$expansionDone && $part == '') {\n\t\t\t\t\tfor($i = 0; $i <= $numMissing; ++$i) {\n\t\t\t\t\t\t$expandedParts[] = '0000';\n\t\t\t\t\t}\n\t\t\t\t\t$expansionDone = true;\n\t\t\t\t} else {\n\t\t\t\t\t$expandedParts[] = $part;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach($expandedParts as &$part) {\n\t\t\t\t$part = str_pad($part, 4, '0', STR_PAD_LEFT);\n\t\t\t}\n\t\t\t$ip = implode(':', $expandedParts);\n\t\t\t$hex = implode('', $expandedParts);\n\t\t}\n\t\t//Check final IP\n\t\tif(filter_var($ip, FILTER_VALIDATE_IP) === false) {\n\t\t\treturn false;\n\t\t}\n\t\treturn strtolower(str_pad($hex, 32, '0', STR_PAD_LEFT));\n\t}", "public static function ip($ip = '0.0.0.0') {\n if(static::server('http_client_ip')) {\n return static::server('http_client_ip');\n } else if(static::server('http_x_forwarded_for')) {\n return static::server('http_x_forwarded_for');\n } else if(static::server('http_x_forwarded')) {\n return static::server('http_x_forwarded');\n } else if(static::server('http_forwarded_for')) {\n return static::server('http_forwarded_for');\n } else if(static::server('http_forwarded')) {\n return static::server('http_forwarded_for');\n } else if(static::server('remote_addr')) {\n return static::server('remote_addr');\n }\n\n return $ip;\n }", "function testUserIP($user_ip, $restrictedIPs) {\r\n $ipu = explode('.', $user_ip);\r\n foreach ($ipu as &$v)\r\n $v = str_pad(decbin($v), 8, '0', STR_PAD_LEFT);\r\n $ipu = join('', $ipu);\r\n $res = false;\r\n foreach ($restrictedIPs as $cidr) {\r\n $parts = explode('/', $cidr);\r\n $ipc = explode('.', $parts[0]);\r\n foreach ($ipc as &$v) $v = str_pad(decbin($v), 8, '0', STR_PAD_LEFT);\r\n $ipc = substr(join('', $ipc), 0, $parts[1]);\r\n $ipux = substr($ipu, 0, $parts[1]);\r\n $res = ($ipc === $ipux);\r\n if ($res) break;\r\n }\r\n return $res;\r\n}", "private function _get_address_ip() {\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\t$ip = \"[\".$_SERVER['REMOTE_ADDR'].\"]/[$ip]\";\n\t\t} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t$ip = \"[\".$_SERVER['REMOTE_ADDR'].\"]/[$ip]\";\n\t\t} else {\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t$ip = \"[$ip]/[\".$_SERVER['REMOTE_ADDR'].\"]\";\n\t\t}\n\t\treturn $ip;\n\t}", "function add_banned_ip($ip=null){\r\n\t\tif(empty($ip)){$ip=$_SERVER['REMOTE_ADDR'];}\r\n\t\tglobal $auto_restrict;\r\n\t\t\r\n\t\tif (isset($auto_restrict[\"banned_ip\"][$ip])){\r\n\t\t\t$auto_restrict[\"banned_ip\"][$ip]['nb']++;\r\n\t\t}else{\r\n\t\t\t$auto_restrict[\"banned_ip\"][$ip]['nb']=1;\r\n\t\t}\r\n\t\t\r\n\t\t$auto_restrict[\"banned_ip\"][$ip]['date']=@date('U')+$auto_restrict['IP_banned_expiration_delay'];\r\n\t\tfile_put_contents(PATH.$auto_restrict[\"banned_ip_filename\"],'<?php /*Banned IP*/ $auto_restrict[\"banned_ip\"]='.var_export($auto_restrict[\"banned_ip\"],true).' ?>');\r\n\t}", "public static function ip($value, $allow_ipv6 = true) {\n\t\treturn self::ipv4($value) || ($allow_ipv6 && self::ipv6($value));\n\t}", "function rh_framework_user_ip() {\n\tforeach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) {\n\t\tif (array_key_exists($key, $_SERVER) === true) {\n\t\t\t$ip = $_SERVER[$key];\n\t if(strpos($ip, ',') !== false) {\n\t $ip = explode(',', $ip);\n\t $ip = $ip[0];\n\t }\t\n\t if($ip){substr_replace($ip,0,-1);} //GDRP \t\t\n\t\t\treturn ''.$ip;\n\t\t}\n\t}\n\treturn '127.0.0.3';\n}", "protected function ip() {\n return 249.2;\n }", "function varnish_ip_sanitize( $input ) {\n\n\t\t$output = '';\n\t\t$set_message = 'You have entered an invalid IP address.';\n\t\t$set_type = 'error';\t\n\n\t\tif ( empty($input) ) {\n\t\t\treturn; // do nothing\n\t\t} elseif ( filter_var( $input, FILTER_VALIDATE_IP) ) {\n\t\t\t$set_message = 'IP Updated.';\n\t\t\t$set_type = 'updated';\n\t\t\t$output = filter_var( $input, FILTER_VALIDATE_IP);\n\t\t}\n\n\t\tadd_settings_error( 'vhp_varnish_url', 'varnish-url', $set_message, $set_type );\n\t\treturn $output;\n\t}", "public static function valid_ip(): mixed\r\n {\r\n $ip = \"\";\r\n if (isset($_SERVER)) {\r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n } elseif (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\r\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED'];\r\n } elseif (!empty($_SERVER['HTTP_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_FORWARDED_FOR'];\r\n } elseif (!empty($_SERVER['HTTP_FORWARDED'])) {\r\n $ip = $_SERVER['HTTP_FORWARDED'];\r\n } elseif (!empty($_SERVER['REMOTE_ADDR'])) {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n } else {\r\n $ip = $_SERVER['SERVER_ADDR'];\r\n }\r\n }\r\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE))\r\n return $ip;\r\n return \"UNKNOWN\";\r\n\r\n }", "function expandIPv6Notation($ip)\n{\n if (!iPv4To6($ip)) {\n return $ip;\n }\n $hex = unpack(\"H*hex\", inet_pton($ip));\n $ip = substr(preg_replace(\"/([A-f0-9]{4})/\", \"$1:\", $hex['hex']), 0, -1);\n return $ip;\n}", "public function getLastPasswordIp();", "public static function checkipban($ip)\n {\n $db = Database::instance();\n $res = $db->run('SELECT * FROM bans WHERE true');\n while ($row = $res->fetch(PDO::FETCH_ASSOC)) {\n $banned = false;\n if (self::is_ipv6($row[\"first\"]) && self::is_ipv6($row[\"last\"]) && self::is_ipv6($ip)) {\n $row[\"first\"] = self::ip2long6($row[\"first\"]);\n $row[\"last\"] = self::ip2long6($row[\"last\"]);\n $banned = bccomp($row[\"first\"], $nip) != -1 && bccomp($row[\"last\"], $nip) != -1;\n } else {\n $row[\"first\"] = ip2long($row[\"first\"]);\n $row[\"last\"] = ip2long($row[\"last\"]);\n $banned = $nip >= $row[\"first\"] && $nip <= $row[\"last\"];\n }\n if ($banned) {\n header(\"HTTP/1.0 403 Forbidden\");\n echo '<html><head><title>Forbidden</title> </head><body> <h1>Forbidden</h1>Unauthorized IP address.<br> </body></html>';\n die;\n }\n }\n }", "function filterIP($ipstr){\n\t\t$start = strpos($ipstr, \"inet\") + 5;\n\t\t$length = (strpos($ipstr, \"/\", $start)) - $start;\n\t\treturn substr($ipstr, $start, $length);\n\t}", "public function getIpAddress(): string\n\t{\n\t\treturn '';\n\t}", "function get_ip_address()\r\n\t{\r\n\t\t// Suzinom ip adresa\r\n\t\tif(isset($_SERVER['REMOTE_ADDR']) AND isset($_SERVER['HTTP_CLIENT_IP']))\r\n\t\t{\r\n\t\t\t$ip_address = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\t}\r\n\t\telseif(isset($_SERVER['REMOTE_ADDR']))\r\n\t\t{\r\n\t\t\t$ip_address = $_SERVER['REMOTE_ADDR'];\r\n\t\t}\r\n\t\telseif(isset($_SERVER['HTTP_CLIENT_IP']))\r\n\t\t{\r\n\t\t\t$ip_address = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\t}\r\n\t\telseif(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n\t\t{\r\n\t\t\t$ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\t}\r\n\r\n\t\t$core =& core::init();\r\n\t\t$core->load('validation');\r\n\r\n\t\t// Patikrinam ar ip adresas teisingas\r\n\t\tif($core->valid->ip_address($ip_address))\r\n\t\t{\r\n\t\t\treturn $ip_address;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '0.0.0.0';\r\n\t\t}\r\n\t}", "public static function canonicalize( $addr ) {\n\tif ( IP::isValid( $addr ) )\n\t return $addr;\n\n\t// IPv6 loopback address\n\tif ( preg_match( '/^0*' . RE_IPV6_GAP . '1$/', $addr, $m ) )\n\t return '127.0.0.1';\n\n\t// IPv4-mapped and IPv4-compatible IPv6 addresses\n\tif ( preg_match( '/^' . RE_IPV6_V4_PREFIX . '(' . RE_IP_ADD . ')$/i', $addr, $m ) )\n\t return $m[1];\n\tif ( preg_match( '/^' . RE_IPV6_V4_PREFIX . RE_IPV6_WORD . ':' . RE_IPV6_WORD . '$/i', $addr, $m ) )\n\t return long2ip( ( hexdec( $m[1] ) << 16 ) + hexdec( $m[2] ) );\n\n\treturn null; // give up\n }", "public static function is_ip($ip) { \r\n if (preg_match(\"/^[0-9]+(.[0-9]+){3}$/\",$ip)) { \r\n $validip = TRUE;\r\n foreach(explode(\".\", $ip) as $nextblock) {\r\n if( $nextblock<0 || $nextblock>255 )\r\n { \r\n $validip = FALSE;\r\n }\r\n }\r\n }else \r\n $validip = FALSE; \r\n return $validip;\r\n }", "static public function ip()\n {\n $ip_address = $_SERVER['REMOTE_ADDR'];\n\n if ( !User::valid_ip($ip_address))\n {\n $ip_address = '0.0.0.0';\n }\n return $ip_address;\n }", "function clientIP($single = false) {\n /* @var Input $INPUT */\n global $INPUT;\n\n $ip = array();\n $ip[] = $INPUT->server->str('REMOTE_ADDR');\n if($INPUT->server->str('HTTP_X_FORWARDED_FOR')) {\n $ip = array_merge($ip, explode(',', str_replace(' ', '', $INPUT->server->str('HTTP_X_FORWARDED_FOR'))));\n }\n if($INPUT->server->str('HTTP_X_REAL_IP')) {\n $ip = array_merge($ip, explode(',', str_replace(' ', '', $INPUT->server->str('HTTP_X_REAL_IP'))));\n }\n\n // some IPv4/v6 regexps borrowed from Feyd\n // see: http://forums.devnetwork.net/viewtopic.php?f=38&t=53479\n $dec_octet = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|[0-9])';\n $hex_digit = '[A-Fa-f0-9]';\n $h16 = \"{$hex_digit}{1,4}\";\n $IPv4Address = \"$dec_octet\\\\.$dec_octet\\\\.$dec_octet\\\\.$dec_octet\";\n $ls32 = \"(?:$h16:$h16|$IPv4Address)\";\n $IPv6Address =\n \"(?:(?:{$IPv4Address})|(?:\".\n \"(?:$h16:){6}$ls32\".\n \"|::(?:$h16:){5}$ls32\".\n \"|(?:$h16)?::(?:$h16:){4}$ls32\".\n \"|(?:(?:$h16:){0,1}$h16)?::(?:$h16:){3}$ls32\".\n \"|(?:(?:$h16:){0,2}$h16)?::(?:$h16:){2}$ls32\".\n \"|(?:(?:$h16:){0,3}$h16)?::(?:$h16:){1}$ls32\".\n \"|(?:(?:$h16:){0,4}$h16)?::$ls32\".\n \"|(?:(?:$h16:){0,5}$h16)?::$h16\".\n \"|(?:(?:$h16:){0,6}$h16)?::\".\n \")(?:\\\\/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))?)\";\n\n // remove any non-IP stuff\n $cnt = count($ip);\n $match = array();\n for($i = 0; $i < $cnt; $i++) {\n if(preg_match(\"/^$IPv4Address$/\", $ip[$i], $match) || preg_match(\"/^$IPv6Address$/\", $ip[$i], $match)) {\n $ip[$i] = $match[0];\n } else {\n $ip[$i] = '';\n }\n if(empty($ip[$i])) unset($ip[$i]);\n }\n $ip = array_values(array_unique($ip));\n if(!$ip[0]) $ip[0] = '0.0.0.0'; // for some strange reason we don't have a IP\n\n if(!$single) return join(',', $ip);\n\n // decide which IP to use, trying to avoid local addresses\n $ip = array_reverse($ip);\n foreach($ip as $i) {\n if(preg_match('/^(::1|[fF][eE]80:|127\\.|10\\.|192\\.168\\.|172\\.((1[6-9])|(2[0-9])|(3[0-1]))\\.)/', $i)) {\n continue;\n } else {\n return $i;\n }\n }\n // still here? just use the first (last) address\n return $ip[0];\n}", "public static function ipToLong($ip){\n\t\t$ips = explode('.',$ip); // why is this period escaped?\n\t\tif(count($ips)<4) {$long=0; } // was 1111111111. dunno why\n\t\telse { $long=($ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256); }\n\t\treturn $long;\n\t}", "function getIP() : string {\n\tstatic $ip;\n\t\n\tif ( isset( $ip ) ) {\n\t\treturn $ip;\n\t}\n\t\t\n\t$ip\t= $_SERVER['REMOTE_ADDR'];\n\t$skip\t= config( 'skip_local', \\SKIP_LOCAL, 'int' );\n\t$va\t=\n\t( $skip ) ?\n\t\\filter_var( $ip, \\FILTER_VALIDATE_IP ) : \n\t\\filter_var(\n\t\t$ip, \n\t\t\\FILTER_VALIDATE_IP, \n\t\t\\FILTER_FLAG_NO_PRIV_RANGE | \n\t\t\\FILTER_FLAG_NO_RES_RANGE\n\t);\n\t\n\t$ip = ( false === $va ) ? '' : $ip;\n\t\n\treturn $ip;\n}" ]
[ "0.7538132", "0.74731237", "0.7134026", "0.705876", "0.70529443", "0.7049858", "0.6985056", "0.6877558", "0.66881657", "0.66743", "0.66541", "0.6643364", "0.66031706", "0.65627277", "0.6498722", "0.648385", "0.64733464", "0.64723516", "0.64517474", "0.64336747", "0.64294046", "0.6427231", "0.6392405", "0.63831234", "0.6379456", "0.6346469", "0.6340165", "0.63278806", "0.6310924", "0.6276355", "0.6254892", "0.6241586", "0.62397194", "0.6235231", "0.6225132", "0.6207982", "0.61939996", "0.61906457", "0.6189036", "0.61804277", "0.6178206", "0.6177159", "0.6169721", "0.6166986", "0.6164318", "0.6148949", "0.61371946", "0.6132756", "0.6120021", "0.6110233", "0.6105747", "0.6105072", "0.6101012", "0.60965675", "0.60964936", "0.60892224", "0.6085166", "0.6080917", "0.6067253", "0.60549086", "0.6048608", "0.60447186", "0.60428476", "0.604229", "0.60397905", "0.6039361", "0.60390747", "0.6035359", "0.60279894", "0.6026939", "0.6025501", "0.6024667", "0.60242367", "0.6017933", "0.60126066", "0.6010181", "0.6009829", "0.6007409", "0.6006517", "0.5994779", "0.59943616", "0.59923476", "0.5987424", "0.5987268", "0.59862053", "0.59808797", "0.59759164", "0.59685296", "0.5965727", "0.59579265", "0.5956677", "0.5955466", "0.5953707", "0.59480435", "0.59476966", "0.5939363", "0.593761", "0.59373784", "0.5928619", "0.5927928" ]
0.7838928
0
masquerade last digit of IP address. With bad ip argument return 0.0.0.0
Маскировать последнюю цифру IP-адреса. Возвращать 0.0.0.0 при неправильном ip аргументе
function anonimizeIpv4(string $ip):string { if (isIPv4($ip)) { return substr($ip, 0, strrpos($ip, ".") + 1) . '0'; } return '0.0.0.0'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function cleanIP($ip) {\r\n return preg_replace('~(^|[.:])0{1,2}(\\d)~','$1$2',$ip);\r\n }", "function anonimizeIpv6(string $ip):string\n{\n if (strrpos($ip, \":\") > 0) {\n return substr($ip, 0, strrpos($ip, \":\") + 1) . '0';\n }\n return '0.0.0.0';\n}", "function _reverse_ip() {\r\n if ($this->ip)\r\n {\r\n preg_match(\"/[0-9]{1,4}.[0-9]{1,4}.[0-9]{1,4}.[0-9]{1,4}/\", $this->ip, $matches);\r\n $pieces = explode(\".\", $matches[0]);\r\n if (count($pieces)==4)\r\n {\r\n $this->_rip = $pieces[3] . '.' . $pieces[2] . '.' . $pieces[1] . '.' . $pieces[0];\r\n }\r\n }\r\n }", "protected static function _anonymizeIp($ip) {\n $strlen = strlen($ip);\n if ( $strlen > 6 ) :\n $divider = (int)floor($strlen / 4) + 1;\n $ip = substr_replace($ip, '…', $divider, $strlen - (2 * $divider));\n endif;\n\n return $ip;\n }", "function GetMainAddress($ip){\n\tforeach($ip as $address){\n\t\tif(strlen($address) < 8) continue;\n\t\t$tmp = explode('.',$address);\n\t\tif($tmp[0] == '10') continue;\n\t\tif($tmp[0] == '192' && $tmp[1] == '168') continue;\n\t\tif($tmp[0] == '172' && $tmp[1] > 15 and $tmp[1] < 32) continue;\n\t\treturn $address;\n\t}\n\tif(strlen($ip[0]) < 8) return $ip[1];\n\treturn $ip[0];\n}", "function anonimizeIpv4Compatibility(string $ip):string\n{\n if (isIPv4Compatibility($ip)) {\n return substr($ip, 0, strrpos($ip, \".\") + 1) . '0';\n }\n return '0.0.0.0';\n}", "function long2ip($proper_address)\n{\n return 0;\n}", "function decode_ip($int_ip)\r{\r\t$hexipbang = explode('.', chunk_split($int_ip, 2, '.'));\r\treturn hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);\r}", "public function getActualIpv4()\n\t\t{\n\t\t\t$ip = $this->getIp();\n\t\t\t\n\t\t\tif(\n\t\t\t\t($pos = mb_strripos($ip, '.') )\n\t\t\t)\n\t\t\t{\n\t\t\t\t$ip = mb_substr($ip, 0, $pos).'.0';\n\t\t\t}\n\t\t\t\n\t\t\treturn $ip;\n\t\t}", "function ee_inet_ntop($ip)\n{\n\t// unpack the binary\n\t$hex = unpack('H*', $ip);\n\t$hex = current($hex);\n\n\t$len = strlen($hex);\n\n\t// ipv4\n\tif ($len == 8)\n\t{\n\t\t$parts = str_split($hex, 2);\n\t\t$parts = array_map('hexdec', $parts);\n\t\treturn implode('.', $parts);\n\t}\n\n\t// ipv6\n\tif ($len != 32)\n\t{\n\t\tshow_error('Invalid IP address.');\n\t}\n\n\t$parts = str_split($hex, 4);\n\n\t// find the longest run of zeros\n\t$start = -1;\n\t$len = 0;\n\t$best_start = -1;\n\t$best_len = 0;\n\n\tforeach ($parts as $i => &$part)\n\t{\n\t\tif ($part == '0000')\n\t\t{\n\t\t\tif ($start == -1)\n\t\t\t{\n\t\t\t\t$start = $i;\n\t\t\t\t$len = 0;\n\t\t\t}\n\n\t\t\t$len++;\n\t\t}\n\t\telseif ($start != -1 && ($best_start == -1 OR $len > $best_len))\n\t\t{\n\t\t\t$best_start = $start;\n\t\t\t$best_len = $len;\n\t\t\t$start = -1;\n\t\t}\n\t}\n\n\t// didn't move best?\n\tif ($start != -1 && ($best_start == -1 OR $len > $best_len))\n\t{\n\t\t$best_start = $start;\n\t\t$best_len = $len;\n\t}\n\n\t// print out the result\n\t$out = '';\n\n\tforeach ($parts as $i => &$part)\n\t{\n\t\tif ($best_start != -1)\n\t\t{\n\t\t\tif ($i >= $best_start && $i < ($best_start + $best_len))\n\t\t\t{\n\t\t\t\tif ($i == $best_start)\n\t\t\t\t{\n\t\t\t\t\t$out .= ':';\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif ($i)\n\t\t{\n\t\t\t$out .= ':';\n\t\t}\n\n\t\t// ipv4 mapped?\n\t\tif ($i == 6 && $best_start == 0 &&\n\t\t\t($best_len == 6 OR ($best_len == 5 && $parts[5] == 'ffff')))\n\t\t{\n\t\t\t$out .= ee_inet_ntop(pack('H4H4', $parts[6], $parts[7]));\n\t\t\tbreak;\n\t\t}\n\n\t\t// collapse the hex string\n\t\t$out .= sprintf('%x', hexdec($part));\n\t}\n\n\treturn $out;\n}", "function long2ip($proper_address)\n{\n\treturn 0;\n}", "function anonimizeIpWithInet(string $ip):string\n{\n if ($ip = @inet_pton($ip)) {\n return inet_ntop(substr($ip, 0, strlen($ip) / 2) . str_repeat(chr(0), strlen($ip) / 2));\n }\n return '0.0.0.0';\n}", "function get_ip_address($amount=4)\n{\n//\treturn strval(mt_rand(0,255)).'.'.strval(mt_rand(0,255)).'.'.strval(mt_rand(0,255)).'.'.strval(mt_rand(0,255)); // Nice little test for if sessions break\n\n\t$fw=ocp_srv('HTTP_X_FORWARDED_FOR');\n\tif (ocp_srv('HTTP_CLIENT_IP')!='') $fw=ocp_srv('HTTP_CLIENT_IP');\n\tif (($fw!='') && ($fw!='127.0.0.1') && (substr($fw,0,8)!='192.168.') && (substr($fw,0,3)!='10.') && (is_valid_ip($fw)) && ($fw!=ocp_srv('SERVER_ADDR'))) $ip=$fw;\n\telse $ip=ocp_srv('REMOTE_ADDR');\n\n\t// Bizarro-filter (found \"in the wild\")\n\t$pos=strpos($ip,',');\n\tif ($pos!==false) $ip=substr($ip,0,$pos);\n\n\t$ip=preg_replace('#%14$#','',$ip);\n\n\tif (!is_valid_ip($ip)) return '';\n\n\tif (strpos($ip,'.')===false)\n\t{\n\t\tif (substr_count($ip,':')<7)\n\t\t{\n\t\t\t$ip=str_replace('::',str_repeat(':',(7-substr_count($ip,':'))+2),$ip);\n\t\t}\n\t\t$parts=explode(':',$ip);\n\t\tfor ($i=0;$i<$amount*2;$i++)\n\t\t{\n\t\t\t$parts[$i]=isset($parts[$i])?str_pad($parts[$i],4,'0',STR_PAD_LEFT):'0000';\n\t\t}\n\t\tfor ($i=$amount*2;$i<8;$i++)\n\t\t{\n\t\t\t$parts[$i]='*';\n\t\t}\n\t\treturn implode(':',$parts);\n\t} else\n\t{\n\t\t$parts=explode('.',$ip);\n\t\tfor ($i=0;$i<$amount;$i++)\n\t\t{\n\t\t\tif (!array_key_exists($i,$parts)) $parts[$i]='0';\n\t\t}\n\t\tfor ($i=$amount;$i<4;$i++)\n\t\t{\n\t\t\t$parts[$i]='*';\n\t\t}\n\t\treturn implode('.',$parts);\n\t}\n}", "function long2ip(int $ip): string\n{\n error_clear_last();\n $safeResult = \\long2ip($ip);\n if ($safeResult === false) {\n throw NetworkException::createFromPhpError();\n }\n return $safeResult;\n}", "function gethost ($ip)\n{\n //IPs must be in the form x.x.x.x with each x as a number\n \n if( preg_match('/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.]\n(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/', $ip) )\n {\n $host = `host $ip`;\n return (($host ? end ( explode (' ', $host)) : $ip));\n }\n else\n {\n return false;\n }\n}", "function getClasseAdresseIp($ip){\n $part = explode(\".\", $ip);\n if(inRange($part[0], 0, 128)){\n return \"A\";\n }elseif(inRange($part[0], 127, 192)){\n return \"B\";\n }elseif(inRange($part[0], 191, 224)){\n return \"C\";\n }elseif(inRange($part[0], 223, 240)){\n return \"D\";\n }else{\n return \"E\";\n }\n}", "function check_ipv4($ip) {\r\n\tif(preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/',$ip)) {\r\n\t\tif(!ereg('^0.',$ip)) {\r\n\t\t\tforeach(explode(\".\",$dq_host) as $octet ){\r\n \t\t\t\tif($octet > 255){ \r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 1;\r\n\t}\r\n\treturn 0;\r\n}", "public function ip() : string;", "function s_inputip($ip) {\n\t $pattern = '/(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/';\n\t $parts = array();\n\t if(preg_match($pattern,$ip,$parts)==1) {\n\t\tif(inet_pton($ip) !== false)\n\t\t return($ip);\n\t }\n\t return(0);\n\t}", "public static function ip_get() {\n\t\t$ip = '0000:0000:0000:0000:0000:0000:0000:0001';\n\t\tif (php_sapi_name()=='cli') {\n\t\t\tif (isset($_SERVER['SSH_CLIENT'])) {\n\t\t\t\t$ip = explode(' ',$_SERVER['SSH_CLIENT']);\n\t\t\t\t$ip = $ip[0];\n\t\t\t}\n\t\t} else {\n\t\t\tif (isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t}\n\t\t}\n\t\t$ip = inet_pton($ip);\n\t\tif (strlen($ip)<16&&strlen($ip)==4) {\n\t\t\t$ip = str_repeat(chr(0), 10).str_repeat(chr(255), 2).$ip;\n\t\t}\n\t\t$ip = inet_ntop($ip);\n\t\treturn $ip;\n\t}", "public function ip();", "public static function getIP() {\n $envIP = self::getEnvIP();\n\n $ExplodeIP = explode(\":\", $envIP);\n\n\t\tif (isset($ExplodeIP[1])) {\n\t\t\t$v4mapped_prefix_hex = '00000000000000000000ffff';\n\t\t\t$v4mapped_prefix_bin = pack(\"H*\", $v4mapped_prefix_hex);\n\n\t\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\t\t\t$addr_bin = inet_pton($addr);\n\t\t\tif( $addr_bin === FALSE ) {\n return '0.0.0.0';\n\t\t\t}\n\n\t\t\tif( substr($addr_bin, 0, strlen($v4mapped_prefix_bin)) == $v4mapped_prefix_bin) {\n\t\t\t $addr_bin = substr($addr_bin, strlen($v4mapped_prefix_bin));\n\t\t\t}\n\n\t\t\t$addr = inet_ntop($addr_bin);\n\t\t\treturn $addr;\n\t\t} else { \n\t\t\treturn $envIP;\n\t\t}\n }", "public static function ipToLong($ip){\n\t\t$ips = explode('.',$ip); // why is this period escaped?\n\t\tif(count($ips)<4) {$long=0; } // was 1111111111. dunno why\n\t\telse { $long=($ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256); }\n\t\treturn $long;\n\t}", "private function _get_address_ip() {\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\t$ip = \"[\".$_SERVER['REMOTE_ADDR'].\"]/[$ip]\";\n\t\t} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t$ip = \"[\".$_SERVER['REMOTE_ADDR'].\"]/[$ip]\";\n\t\t} else {\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t$ip = \"[$ip]/[\".$_SERVER['REMOTE_ADDR'].\"]\";\n\t\t}\n\t\treturn $ip;\n\t}", "public static function getHost($ip)\n\t{\n\t\t//Make sure the input is not going to do anything unexpected\n\t\t//IPs must be in the form x.x.x.x with each x as a number\n\t\t$testar = explode('.',$ip);\n\t\tif (count($testar)!=4)\n\t\t{\n\t\t\treturn $ip;\n\t\t}\n\t\tfor ($i=0;$i<4;++$i)\n\t\t{\n\t\t\tif (!is_numeric($testar[$i]))\n\t\t\t{\n\t\t\t\treturn $ip;\n\t\t\t}\n\t\t}\n\t\t$host = `host -W 1 $ip`;\n\t\t$host = ($host) ? end(explode(' ', $host)) : $ip;\n\t\t$host = (strpos($host, \"SERVFAIL\") === false) ? $host : $ip;\n\t\treturn $host;\n\t}", "function getIP(){\n if (getenv(\"HTTP_CLIENT_IP\") && strcasecmp(getenv(\"HTTP_CLIENT_IP\"), \"unknown\")){\n $ip = getenv(\"HTTP_CLIENT_IP\");\n }else if (getenv(\"HTTP_X_FORWARDED_FOR\") && strcasecmp(getenv(\"HTTP_X_FORWARDED_FOR\"), \"unknown\")){\n $ip = getenv(\"HTTP_X_FORWARDED_FOR\");\n }else if (getenv(\"REMOTE_ADDR\") && strcasecmp(getenv(\"REMOTE_ADDR\"), \"unknown\")){\n $ip = getenv(\"REMOTE_ADDR\");\n }else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], \"unknown\")){\n $ip = $_SERVER['REMOTE_ADDR'];\n }else{\n $ip = 0;\n }\n $pos = strpos($ip,',');\n if ($pos !== false){\n $tempArr = explode(',',$ip);\n $ip = $tempArr[0];\n }\n if($ip=='::1'){$ip='192.168.1.1';}\n return($ip);\n}", "function formatBinaire($ip, $mask){\n $partIp = explode(\".\", $ip);\n $index = 32 - $mask;\n //On ajoute l'espace au bon endroit suivant l'index trouvé à l'aide du masque\n if($index < 8){\n $partIp[3] = substr($partIp[3], 0, 8-$index%8) . \" \" . substr($partIp[3], 8-$index%8);\n }elseif($index < 16){\n $partIp[2] = substr($partIp[2], 0, 8-$index%8) . \" \" . substr($partIp[2], 8-$index%8);\n }elseif($index < 24){\n $partIp[1] = substr($partIp[1], 0, 8-$index%8) . \" \" . substr($partIp[1], 8-$index%8);\n }elseif($index < 32){\n $partIp[0] = substr($partIp[0], 0, 8-$index%8) . \" \" . substr($partIp[0], 8-$index%8);\n }\n return implode(\".\", $partIp);\n}", "function int_ip($ip = null)\n{\n return CNetwork::int_ip($ip);\n}", "function ip2long($ip_address)\n{\n return 0;\n}", "public function getLastPasswordIp();", "function filterIP($ipstr){\n\t\t$start = strpos($ipstr, \"inet\") + 5;\n\t\t$length = (strpos($ipstr, \"/\", $start)) - $start;\n\t\treturn substr($ipstr, $start, $length);\n\t}", "function iptohex($ip) {\n\t\t\tif (!IPv4::validate_ip($ip))\n\t\t\t\treturn false;\n\n\t\t\t$values = explode(\".\", $ip);\n\n\t\t\tforeach ($values as $index => $value)\n\t\t\t\t$values[$index] = sprintf(\"%02s\", dechex($value));\n\n\t\t\treturn implode(\"\", $values);\n\t\t}", "protected function fetchIp()\n {\n $ip = Request::server('REMOTE_ADDR');\n return implode('.', array_slice(explode('.', $ip), 0, 4 -1));\n }", "function ip2hex ($ip) {\n\t\tif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false) {\n\t\t\t$isIPv4 = true;\n\t\t} elseif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false) {\n\t\t\t$isIPv4 = false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t//IPv4 format\n\t\tif($isIPv4) {\n\t\t\t$parts = explode('.', $ip);\n\t\t\tforeach ($parts as &$part) {\n\t\t\t\t$part = str_pad(dechex($part), 2, '0', STR_PAD_LEFT);\n\t\t\t}\n\t\t\tunset($part);\n\t\t\t$ip\t\t\t= '::'.$parts[0].$parts[1].':'.$parts[2].$parts[3];\n\t\t\t$hex\t\t= implode('', $parts);\n\t\t//IPv6 format\n\t\t} else {\n\t\t\t$parts\t\t= explode(':', $ip);\n\t\t\t$last_part\t= count($parts) - 1;\n\t\t\t//If mixed IPv6/IPv4, convert ending to IPv6\n\t\t\tif(filter_var($parts[$last_part], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false) {\n\t\t\t\t$parts[$last_part] = explode('.', $parts[$last_part]);\n\t\t\t\tforeach ($parts[$last_part] as &$part) {\n\t\t\t\t\t$part = str_pad(dechex($part), 2, '0', STR_PAD_LEFT);\n\t\t\t\t}\n\t\t\t\tunset($part);\n\t\t\t\t$parts[]\t\t\t= $parts[$last_part][2].$parts[$last_part][3];\n\t\t\t\t$parts[$last_part]\t= $parts[$last_part][0].$parts[$last_part][1];\n\t\t\t}\n\t\t\t$numMissing\t\t= 8 - count($parts);\n\t\t\t$expandedParts\t= [];\n\t\t\t$expansionDone\t= false;\n\t\t\tforeach($parts as $part) {\n\t\t\t\tif(!$expansionDone && $part == '') {\n\t\t\t\t\tfor($i = 0; $i <= $numMissing; ++$i) {\n\t\t\t\t\t\t$expandedParts[] = '0000';\n\t\t\t\t\t}\n\t\t\t\t\t$expansionDone = true;\n\t\t\t\t} else {\n\t\t\t\t\t$expandedParts[] = $part;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach($expandedParts as &$part) {\n\t\t\t\t$part = str_pad($part, 4, '0', STR_PAD_LEFT);\n\t\t\t}\n\t\t\t$ip = implode(':', $expandedParts);\n\t\t\t$hex = implode('', $expandedParts);\n\t\t}\n\t\t//Check final IP\n\t\tif(filter_var($ip, FILTER_VALIDATE_IP) === false) {\n\t\t\treturn false;\n\t\t}\n\t\treturn strtolower(str_pad($hex, 32, '0', STR_PAD_LEFT));\n\t}", "public static function guessIP(){\n\t\t// because fake ips from proxies are bogus. // read up here: http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html\n\t\t//check ip from share internet\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip=$_SERVER['HTTP_CLIENT_IP']; }\n\t\t//to check ip is pass from proxy\n\t\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; }\n\t\t// otherwise, you're probably an average joe or jane\n\t\telse { $ip=$_SERVER['REMOTE_ADDR']; }\n\t\t\n\t\tif($ip == '::1') { return '127.0.0.1'; } // either way this is wrong.\n\t\t\n\t\treturn $ip;\n\t}", "function hex2ip($ip)\r\n\t{\r\n\t\treturn long2ip(hexdec($ip));\r\n\t}", "function gethostbyaddr($ip_address)\n{\n return '';\n}", "function getIP()\n {\n $sAdr = $_SERVER[\"REMOTE_ADDR\"];\n if (isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"]))\n {\n $nPos = strpos($sAdr, ',');\n $sAdr .= ' / ';\n if ($nPos===false)\n $sAdr .= $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n else\n $sAdr .= substr($_SERVER[\"HTTP_X_FORWARDED_FOR\"], 0, $nPos);\n }\n return $sAdr;\n }", "public function ip($ip) \n {\n $url = 'http://ip2c.org/' . $ip;\n\n $curl_handle = curl_init();\n curl_setopt($curl_handle, CURLOPT_URL, $url);\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);\n $response_body = curl_exec($curl_handle);\n curl_close($curl_handle);\n\n if(!empty($response_body)) {\n $parts = explode( ';', $response_body );\n return $parts[1] === 'ZZ' ? '' : $parts[1];\n }\n\n return '';\n }", "function flatIP($dotIP)\n{\n\t$dotIP = explode('.',$dotIP);\n\t\n\tforeach ($dotIP as $ip)\n\t{\n\t\twhile (strlen($ip) < 3) { $ip = '0' . $ip; } // 2 > 002\n\t\t$result .= $ip;\n\t}\n\n\treturn $result;\n}", "function valid_ip_range ($ip_string) {\n\t$ip_temp = trim($ip_string);\n\t$ip_return = 'N';\n\t$test_ipv4 = strcspn($ip_temp, '.');\n\tif ($test_ipv4 > 0) {\n\t\t$ipv4_slash = strcspn($ip_temp, '/');\n\t\tif ( ($ipv4_slash > 0) && ($ipv4_slash < (strlen($ip_temp))) ) {\n\t\t\t$mask_ok = FALSE;\n\t\t\t$front_ok = FALSE;\n\t\t\t$first_part = substr($ip_temp,0,$ipv4_slash);\n\t\t\t$mask_part = substr($ip_temp,($ipv4_slash + 1));\n\t\t\tif ( ($mask_part > 1) && ($mask_part < 32) ) {\n\t\t\t\t$mask_ok = TRUE;\n\t\t\t}\n\t\t\t$quad_arr = explode('.', $first_part);\n\t\t\t$q_count = 0;\n\t\t\tif ( is_array($quad_arr) ) {\n\t\t\t\t$a_count = count($quad_arr);\n\t\t\t\tfor($i=0; $i < $a_count; $i++) {\n\t\t\t\t\t$q_val = $quad_arr[$i];\n\t\t\t\t\tif ( ($q_val > -1) && ($q_val < 256) ) {\n\t\t\t\t\t\t$q_count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( $mask_ok && ($a_count == $q_count) ) {\n\t\t\t\t\t$ip_return = '4';\n\t\t\t\t}\t\n\t\t\t}\n\t\t} else {\n\t\t\t$ipv4_val = filter_var($ip_temp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\n\t\t\tif ($ipv4_val !== FALSE) {\n\t\t\t\t$ip_return = '4';\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$ipv6_val = filter_var($ip_temp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n\t\tif ($ipv6_val !== FALSE) {\n\t\t\t$ip_return = '6';\n\t\t}\n\t}\n\treturn $ip_return;\n}", "function int_to_ip($num){\n\t\t$ip = array();\n\t\t$ip[0] = $num & 0xFF;\n\t\t$ip[1] = ($num >> 8) & 0xFF;\n\t\t$ip[2] = ($num >> 16) & 0xFF;\n\t\t$ip[3] = ($num >> 24) & 0xFF;\n\t\t\n\t\tif(!empty($ip)){\n\t\t\t$return_ip = array_shift($ip);\n\t\t}\n\t\twhile(!empty($ip)){\n\t\t\t$return_ip = $return_ip.'.'.array_shift($ip);\n\t\t}\n\t\treturn $return_ip;\n\t}", "public static function canonicalize( $addr ) {\n\tif ( IP::isValid( $addr ) )\n\t return $addr;\n\n\t// IPv6 loopback address\n\tif ( preg_match( '/^0*' . RE_IPV6_GAP . '1$/', $addr, $m ) )\n\t return '127.0.0.1';\n\n\t// IPv4-mapped and IPv4-compatible IPv6 addresses\n\tif ( preg_match( '/^' . RE_IPV6_V4_PREFIX . '(' . RE_IP_ADD . ')$/i', $addr, $m ) )\n\t return $m[1];\n\tif ( preg_match( '/^' . RE_IPV6_V4_PREFIX . RE_IPV6_WORD . ':' . RE_IPV6_WORD . '$/i', $addr, $m ) )\n\t return long2ip( ( hexdec( $m[1] ) << 16 ) + hexdec( $m[2] ) );\n\n\treturn null; // give up\n }", "function adresseDecToBin($ip){\n $retour = \"\";\n //On parcours chaque octets\n foreach(explode(\".\", $ip) as $value){\n //On transforme chaque octet en binaire et on force l'affichage a afficher 8 bits\n $retour .= str_pad(decbin($value), 8, \"0\", STR_PAD_LEFT) . \".\";\n }\n //On supprime le dernier point\n return rtrim($retour, \".\");\n}", "private function getVisitorIPAddress()\n\t{\n\t\t// Get our IP address\n\t\t$ip = AtsystemUtilFilter::getIp();\n\n\t\tif ((strpos($ip, '::') === 0) && (strstr($ip, '.') !== false))\n\t\t{\n\t\t\t$ip = substr($ip, strrpos($ip, ':') + 1);\n\t\t}\n\n\t\t// No point continuing if we can't get an address, right?\n\t\tif (empty($ip) || ($ip == '0.0.0.0'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $ip;\n\t}", "function anonimizeIp(string $ip) : string\n{\n if (isIPv4($ip)) {\n return anonimizeIpv4($ip);\n } elseif (isIPv4Compatibility($ip)) {\n return anonimizeIpv4Compatibility($ip);\n }\n return anonimizeIpv6($ip);\n}", "function expandIPv6Notation($ip)\n{\n if (!iPv4To6($ip)) {\n return $ip;\n }\n $hex = unpack(\"H*hex\", inet_pton($ip));\n $ip = substr(preg_replace(\"/([A-f0-9]{4})/\", \"$1:\", $hex['hex']), 0, -1);\n return $ip;\n}", "public static function pton(string $ip) : string\n {\n // Detect the IP version\n $ipv = self::detectIPVersion($ip);\n\n // Check for IPv4 first since that's most common\n if ($ipv === 4) {\n return current(unpack('a4', inet_pton($ip)));\n }\n\n // Then attempt IPv6\n if ($ipv === 6) {\n return current(unpack('A16', inet_pton($ip)));\n }\n\n // Throw an exception if an invalid IP was supplied\n throw new NetInvalidAddressException();\n }", "function osubs_get_ip() {\n\t\tif ( isset( $_SERVER['HTTP_CLIENT_IP'] ) && ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t} else {\n\t\t\t$ip = ( isset( $_SERVER['REMOTE_ADDR'] ) ) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';\n\t\t}\n\n\t\t$ip = filter_var( $ip, FILTER_VALIDATE_IP );\n\t\t$ip = ( $ip === false ) ? '0.0.0.0' : $ip;\n\n\t\treturn $ip;\n\t}", "public static function ip() {\r\n\t\tstatic $ip = NULL;\r\n\t\tif (is_null($ip)) {\r\n\t\t\tforeach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $n) {\r\n\t\t\t\t$cur2ip = filter_input(INPUT_SERVER, $n);\r\n\t\t\t\tif (!$cur2ip) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$curip = explode('.', $cur2ip);\r\n\t\t\t\tif (count($curip) !== 4) {\r\n\t\t\t\t\t// if they've sent at least one invalid IP, break out\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($curip as $sup) {\r\n\t\t\t\t\tif (($sup = intval($sup)) < 0 or $sup > 255) {\r\n\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$curip_bin = $curip[0] << 24 | $curip[1] << 16 | $curip[2] << 8 | $curip[3];\r\n\t\t\t\tforeach (array(\r\n\t\t\t// hexadecimal ip ip mask\r\n\t\t\tarray(0x7F000001, 0xFFFF0000), // 127.0..\r\n\t\t\tarray(0x0A000000, 0xFFFF0000), // 10.0..\r\n\t\t\tarray(0xC0A80000, 0xFFFF0000), // 192.168..\r\n\t\t\t\t) as $ipmask) {\r\n\t\t\t\t\tif (($curip_bin & $ipmask[1]) === ($ipmask[0] & $ipmask[1])) {\r\n\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn $ip = $cur2ip;\r\n\t\t\t}\r\n\t\t\t$ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR');\r\n\t\t}\r\n\r\n\t\treturn $ip;\r\n\t}", "function htz_getzonehostip($arr) {\n // Remove anything until first digit.\n $htz_zoneip=preg_replace('/.*IN A[\\s]+/','',$arr[0]);\n // Remove whitespace(s) if any.\n $htz_zoneip=preg_replace('/[\\s]+/','',$htz_zoneip);\n if (htz_validateip($htz_zoneip)) {\n return $htz_zoneip;\n } else {\n htz_say(__FUNCTION__. \": Validation of IP $arr[0] failed.\",2);\n }\n}", "function uncompressIPv6($ip, $count=7) {\n\tif (strpos($ip, \"::\") !== FALSE) {\n\t\t$ip = str_replace(\"::\", str_repeat(\":\", $count + 2 - substr_count($ip, \":\")), $ip);\n\t}\n\t$tmp_ip = explode(\":\", $ip);\n\tforeach ($tmp_ip as &$value) {\n\t\t$value = str_pad($value, 4, '0', STR_PAD_LEFT);\t\n\t}\n\treturn implode(\":\", $tmp_ip);\n}", "public function getIpHex()\n {\n $parts = explode('.', $this->getIp());\n\n $this->_ipHex = null;\n for ($i = 0; $i < 4; $i++) {\n $this->_ipHex .= str_pad(dechex($parts[$i]), 2, '0', STR_PAD_LEFT);\n }\n\n return static::SEPARATOR . $this->_ipHex . static::SEPARATOR;\n }", "function getIP(){\r\n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\r\n\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; \r\n\t}else{\r\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t}\r\n\t$ip_array = explode(\",\", $ip);\r\n\t$ip = trim($ip_array[0]);\r\n\treturn $ip;\r\n}", "function ipv6_short( $ip ) {\n\tif( ! strpos( $ip, ':' ) ) {\n\t\treturn $ip;\n\t}\n\n\t$ip_short = inet_ntop( inet_pton( $ip ) );\n\n\tif( ! $ip_short ) {\n\t\treturn $ip;\n\t}\n\n\treturn $ip_short;\n}", "function hex2ip($ip_hex)\n{\n $ip = trim($ip_hex, \"\\\"\\t\\n\\r\\0\\x0B\");\n\n // IPv6z, ie: 2a:02:a0:10:80:03:00:00:00:00:00:00:00:00:00:01%503316482\n if (str_contains($ip, '%'))\n {\n list($ip) = explode('%', $ip);\n }\n\n $len = strlen($ip);\n if ($len === 5 && $ip[0] === ' ')\n {\n $ip = substr($ip, 1);\n $len = 4;\n }\n if ($len === 4)\n {\n // IPv4 hex string converted to SNMP string\n $ip = str2hex($ip);\n $len = strlen($ip);\n }\n\n $ip = str_replace(' ', '', $ip);\n\n if ($len > 8)\n {\n // For IPv6\n $ip = str_replace(':', '', $ip);\n $len = strlen($ip);\n }\n\n if (!ctype_xdigit($ip))\n {\n return $ip_hex;\n }\n\n switch ($len)\n {\n case 8:\n // IPv4\n $ip_array = array();\n foreach (str_split($ip, 2) as $entry)\n {\n $ip_array[] = hexdec($entry);\n }\n $separator = '.';\n break;\n\n case 16:\n // Cisco incorrect IPv4 (54 2E 68 02 FF FF FF FF)\n $ip_array = array();\n foreach (str_split($ip, 2) as $i => $entry)\n {\n if ($i == 4) { break; }\n $ip_array[] = hexdec($entry);\n }\n $separator = '.';\n break;\n\n case 32:\n // IPv6\n $ip_array = str_split(strtolower($ip), 4);\n $separator = ':';\n break;\n\n default:\n // Try convert hex string to string\n $ip = snmp_hexstring($ip_hex);\n if (get_ip_version($ip))\n {\n return $ip;\n }\n return $ip_hex;\n }\n $ip = implode($separator, $ip_array);\n\n return $ip;\n}", "function ip2long($ip_address)\n{\n\treturn 0;\n}", "private static function _getIp()\n {\n $ip = '';\n if (isset($_SERVER['X_FORWARDED_FOR']) === TRUE) {\n $addrs = explode(',',$_SERVER['X_FORWARDED_FOR']);\n $ip = array_pop($addrs);\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return trim($ip);\n }", "function rh_framework_user_ip() {\n\tforeach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) {\n\t\tif (array_key_exists($key, $_SERVER) === true) {\n\t\t\t$ip = $_SERVER[$key];\n\t if(strpos($ip, ',') !== false) {\n\t $ip = explode(',', $ip);\n\t $ip = $ip[0];\n\t }\t\n\t if($ip){substr_replace($ip,0,-1);} //GDRP \t\t\n\t\t\treturn ''.$ip;\n\t\t}\n\t}\n\treturn '127.0.0.3';\n}", "function getIP() : string {\n\tstatic $ip;\n\t\n\tif ( isset( $ip ) ) {\n\t\treturn $ip;\n\t}\n\t\t\n\t$ip\t= $_SERVER['REMOTE_ADDR'];\n\t$skip\t= config( 'skip_local', \\SKIP_LOCAL, 'int' );\n\t$va\t=\n\t( $skip ) ?\n\t\\filter_var( $ip, \\FILTER_VALIDATE_IP ) : \n\t\\filter_var(\n\t\t$ip, \n\t\t\\FILTER_VALIDATE_IP, \n\t\t\\FILTER_FLAG_NO_PRIV_RANGE | \n\t\t\\FILTER_FLAG_NO_RES_RANGE\n\t);\n\t\n\t$ip = ( false === $va ) ? '' : $ip;\n\t\n\treturn $ip;\n}", "function filterinputip($ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP,FILTER_FLAG_IPV4)) {\n $ex = 4;\n }\n elseif (filter_var($ip, FILTER_VALIDATE_IP,FILTER_FLAG_IPV6)) {\n $ex = 6;\n }\n else {\n $ex = 0;\n }\n // whitelisted IPs\n if($ex == 4 && (preg_match_all(IPV4WL, $ip, $matches, PREG_SET_ORDER, 0))) $ex=0;\n if($ex == 6 && (preg_match_all(IPV6WL, $ip, $matches, PREG_SET_ORDER, 0))) $ex=0;\n return($ex);\n}", "public function ip($default = '0.0.0.0')\n\t{\n\t\tif ($this->server('REMOTE_ADDR') !== null)\n\t\t{\n\t\t\treturn $this->server('REMOTE_ADDR');\n\t\t}\n\n\t\t// detection failed, return the default\n\t\treturn __val($default);\n\t}", "public static function ip($ip = '0.0.0.0') {\n if(static::server('http_client_ip')) {\n return static::server('http_client_ip');\n } else if(static::server('http_x_forwarded_for')) {\n return static::server('http_x_forwarded_for');\n } else if(static::server('http_x_forwarded')) {\n return static::server('http_x_forwarded');\n } else if(static::server('http_forwarded_for')) {\n return static::server('http_forwarded_for');\n } else if(static::server('http_forwarded')) {\n return static::server('http_forwarded_for');\n } else if(static::server('remote_addr')) {\n return static::server('remote_addr');\n }\n\n return $ip;\n }", "function dectoip($dec) {\n\t\t\tif (!preg_match(\"/^[0-9]*$/\", $dec))\n\t\t\t\treturn false;\n\t\t\treturn IPv4::hextoip(dechex($dec+0));\n\t\t}", "function getIP() {\n if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {\n $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n $ip = trim($ips[0]);\n }\n\n// return empty($ip) ? $_SERVER['REMOTE_ADDR'] : $ip;\n}", "public function getLastLoginIp();", "private function _parse_ip()\n {\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip_address = $_SERVER['HTTP_CLIENT_IP'];\n }\n else\n {\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n {\n $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n if (isset($_SERVER['HTTP_X_FORWARDED']))\n {\n $ip_address = $_SERVER['HTTP_X_FORWARDED'];\n }\n else\n {\n if (isset($_SERVER['HTTP_FORWARDED_FOR']))\n {\n $ip_address = $_SERVER['HTTP_FORWARDED_FOR'];\n }\n else\n {\n if (isset($_SERVER['HTTP_FORWARDED']))\n {\n $ip_address = $_SERVER['HTTP_FORWARDED'];\n }\n else\n {\n if (isset($_SERVER['REMOTE_ADDR']))\n {\n $ip_address = $_SERVER['REMOTE_ADDR'];\n }\n else\n {\n $ip_address = '0.0.0.0';\n }\n }\n }\n }\n }\n }\n return $ip_address;\n }", "public static function ip()\r\n {\r\n foreach (['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'] as $key){\r\n if (array_key_exists($key, $_SERVER)){\r\n foreach (explode(',', $_SERVER[$key]) as $ip){\r\n $ip = trim($ip);\r\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false){\r\n return $ip;\r\n }\r\n }\r\n }\r\n }\r\n return '';\r\n }", "public static function get_ip_address()\n {\n }", "function gethostbyaddr($ip_address)\n{\n\treturn '';\n}", "function sumo_validate_ip($ip=FALSE)\n{\n\tif($ip)\n\t{\n\t\t$valid = TRUE;\n\t\t$ip = explode(\".\", $ip);\n\n\t\tif(count($ip) != 4) $valid = FALSE;\n\n\t\tforeach($ip as $block)\n\t\t{\n\t\t\tif(ereg(\"^0+.+\", $block) || $block>255 || $block<0 || strlen($block)>3) $valid = FALSE;\n\t\t}\n\n\t\treturn $valid;\n\t}\n\telse return FALSE;\n}", "public final function getIp() {\n\t\t$unknown = 'unknown';\n\t\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']\n && strcasecmp($_SERVER['HTTP_X_FORWARDED_FOR'], $unknown)) {\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] \n && strcasecmp($_SERVER['REMOTE_ADDR'], $unknown)) {\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t}\t\n\t\tif (false !== strpos($ip, ',')) {\n\t\t\t$ip = reset(explode(',', $ip));\n\t\t}\n\t\treturn $ip;\n\t}", "function clientIP($single = false) {\n /* @var Input $INPUT */\n global $INPUT;\n\n $ip = array();\n $ip[] = $INPUT->server->str('REMOTE_ADDR');\n if($INPUT->server->str('HTTP_X_FORWARDED_FOR')) {\n $ip = array_merge($ip, explode(',', str_replace(' ', '', $INPUT->server->str('HTTP_X_FORWARDED_FOR'))));\n }\n if($INPUT->server->str('HTTP_X_REAL_IP')) {\n $ip = array_merge($ip, explode(',', str_replace(' ', '', $INPUT->server->str('HTTP_X_REAL_IP'))));\n }\n\n // some IPv4/v6 regexps borrowed from Feyd\n // see: http://forums.devnetwork.net/viewtopic.php?f=38&t=53479\n $dec_octet = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|[0-9])';\n $hex_digit = '[A-Fa-f0-9]';\n $h16 = \"{$hex_digit}{1,4}\";\n $IPv4Address = \"$dec_octet\\\\.$dec_octet\\\\.$dec_octet\\\\.$dec_octet\";\n $ls32 = \"(?:$h16:$h16|$IPv4Address)\";\n $IPv6Address =\n \"(?:(?:{$IPv4Address})|(?:\".\n \"(?:$h16:){6}$ls32\".\n \"|::(?:$h16:){5}$ls32\".\n \"|(?:$h16)?::(?:$h16:){4}$ls32\".\n \"|(?:(?:$h16:){0,1}$h16)?::(?:$h16:){3}$ls32\".\n \"|(?:(?:$h16:){0,2}$h16)?::(?:$h16:){2}$ls32\".\n \"|(?:(?:$h16:){0,3}$h16)?::(?:$h16:){1}$ls32\".\n \"|(?:(?:$h16:){0,4}$h16)?::$ls32\".\n \"|(?:(?:$h16:){0,5}$h16)?::$h16\".\n \"|(?:(?:$h16:){0,6}$h16)?::\".\n \")(?:\\\\/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))?)\";\n\n // remove any non-IP stuff\n $cnt = count($ip);\n $match = array();\n for($i = 0; $i < $cnt; $i++) {\n if(preg_match(\"/^$IPv4Address$/\", $ip[$i], $match) || preg_match(\"/^$IPv6Address$/\", $ip[$i], $match)) {\n $ip[$i] = $match[0];\n } else {\n $ip[$i] = '';\n }\n if(empty($ip[$i])) unset($ip[$i]);\n }\n $ip = array_values(array_unique($ip));\n if(!$ip[0]) $ip[0] = '0.0.0.0'; // for some strange reason we don't have a IP\n\n if(!$single) return join(',', $ip);\n\n // decide which IP to use, trying to avoid local addresses\n $ip = array_reverse($ip);\n foreach($ip as $i) {\n if(preg_match('/^(::1|[fF][eE]80:|127\\.|10\\.|192\\.168\\.|172\\.((1[6-9])|(2[0-9])|(3[0-1]))\\.)/', $i)) {\n continue;\n } else {\n return $i;\n }\n }\n // still here? just use the first (last) address\n return $ip[0];\n}", "function mrclo_get_ip() {\r\n $ip = mrclo_combine($_SERVER, array( 'HTTP_CF_CONNECTING_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_REAL_IP', ));\r\n\r\n if ($ip !== '') { return strtok($ip, ','); }\r\n\r\n if (array_key_exists('HTTP_FORWARDED', $_SERVER)) {\r\n $forwarded = $_SERVER['HTTP_FORWARDED'];\r\n $forwarded = strtok($forwarded, ',');\r\n $forwarded = explode(';', $forwarded);\r\n foreach ($forwarded as $for) {\r\n if (!strncasecmp($for, 'for=', 4)) { $for = explode('=', $for, 2); return mrclo_combine($for, 1); }\r\n }\r\n }\r\n return mrclo_combine($_SERVER, 'REMOTE_ADDR');\r\n }", "private function long2Ip(mixed $ipAddress): string\n {\n $output = '';\n for ($offset = 0; $offset < 4; $offset++) {\n $output = $this->calculator->mod($ipAddress, 256).$output;\n if ($offset < 3) {\n $output = '.'.$output;\n }\n $ipAddress = $this->calculator->div($ipAddress, 256);\n }\n\n return $output;\n }", "function getRealIP() {\n $headers = array ('HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'HTTP_VIA', 'HTTP_X_COMING_FROM', 'HTTP_COMING_FROM', 'HTTP_CLIENT_IP' );\n \n foreach ( $headers as $header ) {\n if (isset ( $_SERVER [$header] )) {\n \n if (($pos = strpos ( $_SERVER [$header], ',' )) != false) {\n $ip = substr ( $_SERVER [$header], 0, $pos );\n } else {\n $ip = $_SERVER [$header];\n }\n $ipnum = ip2long ( $ip );\n if ($ipnum !== - 1 && $ipnum !== false && (long2ip ( $ipnum ) === $ip)) {\n if (($ipnum - 184549375) && // Not in 10.0.0.0/8\n ($ipnum - 1407188993) && // Not in 172.16.0.0/12\n ($ipnum - 1062666241)) // Not in 192.168.0.0/16\n if (($pos = strpos ( $_SERVER [$header], ',' )) != false) {\n $ip = substr ( $_SERVER [$header], 0, $pos );\n } else {\n $ip = $_SERVER [$header];\n }\n return $ip;\n }\n }\n \n }\n return $_SERVER ['REMOTE_ADDR'];\n}", "protected function randomIpAddress()\n {\n return sprintf(\n '%d.%d.%d.%d:%d',\n mt_rand(0, 255),\n mt_rand(0, 255),\n mt_rand(0, 255),\n mt_rand(0, 255),\n mt_rand(1, 65535)\n );\n }", "public static function ip() : string\n {\n return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '::1';\n }", "function make_ip2long($ip)\n{\n\t$ipa=explode('.',$ip);\n\treturn (16777216*$ipa[0]) + (65536*$ipa[1]) + (256*$ipa[2]) + $ipa[3];\n}", "function validate_ip($ip) {\n\t\t\tif (preg_match(\"/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/\", $ip))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "private function gethost( $ip )\n\t{\n\t\t//Make sure the input is not going to do anything unexpected\n\t\t//IPs must be in the form x.x.x.x with each x as a number\n\n\t\tif( preg_match( '/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/', $ip ) )\n\t\t{\n\t\t\t$host = `host -s -W 1 $ip`;\n\t\t\t$host = ( $host ? end( explode( ' ', trim( trim( $host ), '.' ) ) ) : $ip );\n\t\t\tif( in_array( $host, array( 'reached', 'record', '2(SERVFAIL)', '3(NXDOMAIN)' ) ) )\n\t\t\t{\n\t\t\t\treturn sprintf( __( '(error fetching domain name for %s)', COUNTERIZE_PLUGIN_IP_TD ), $ip );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $host;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn __( '(invalid IP address)', COUNTERIZE_PLUGIN_IP_TD );\n\t\t}\n\t}", "public static function ip() {\n\t\t$headers = array ('HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'HTTP_VIA', 'HTTP_X_COMING_FROM', 'HTTP_COMING_FROM', 'HTTP_CLIENT_IP' );\n \n\t\tforeach ( $headers as $header ) {\n\t\t\tif (isset ( $_SERVER [$header] )) {\n\t\t\t\n\t\t\t\tif (($pos = strpos ( $_SERVER [$header], ',' )) != false) {\n\t\t\t\t\t$ip = substr ( $_SERVER [$header], 0, $pos );\n\t\t\t\t} else {\n\t\t\t\t\t$ip = $_SERVER [$header];\n\t\t\t\t}\n\t\t\t\t$ipnum = ip2long ( $ip );\n\t\t\t\tif ($ipnum !== - 1 && $ipnum !== false && (long2ip ( $ipnum ) === $ip)) {\n\t\t\t\t\tif (($ipnum - 184549375) && // Not in 10.0.0.0/8\n\t\t\t\t\t($ipnum - 1407188993) && // Not in 172.16.0.0/12\n\t\t\t\t\t($ipnum - 1062666241)) // Not in 192.168.0.0/16\n\t\t\t\t\tif (($pos = strpos ( $_SERVER [$header], ',' )) != false) {\n\t\t\t\t\t\t$ip = substr ( $_SERVER [$header], 0, $pos );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ip = $_SERVER [$header];\n\t\t\t\t\t}\n\t\t\t\t\treturn $ip;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn $_SERVER ['REMOTE_ADDR'];\n\t}", "function isIP($value){\n return preg_match(\"/^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$/\", $value);\n}", "function ip_get() {\n$ret = '';\n if(defined('_DEBUG_IP') && _DEBUG_IP === true) {\n if(defined('_DEBUG_IP_REP') && _DEBUG_IP_REP === 'good') {\n if(defined('_DEBUG_IP_WHT') && _DEBUG_IP_WHT === true) {\n $ret = '66.249.79.158'; \n } else {\n $ret = '73.176.4.88'; \n }\n } else {\n if(defined('_DEBUG_IP_CC') && _DEBUG_IP_CC === true) {\n $ret = '23.11.160.10';\n } else {\n $ret = '107.6.169.250';\n }\n }\n } else {\n $ret = REMADDR;\n }\n return $ret;\n}", "function get_ip_address()\r\n\t{\r\n\t\t// Suzinom ip adresa\r\n\t\tif(isset($_SERVER['REMOTE_ADDR']) AND isset($_SERVER['HTTP_CLIENT_IP']))\r\n\t\t{\r\n\t\t\t$ip_address = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\t}\r\n\t\telseif(isset($_SERVER['REMOTE_ADDR']))\r\n\t\t{\r\n\t\t\t$ip_address = $_SERVER['REMOTE_ADDR'];\r\n\t\t}\r\n\t\telseif(isset($_SERVER['HTTP_CLIENT_IP']))\r\n\t\t{\r\n\t\t\t$ip_address = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\t}\r\n\t\telseif(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n\t\t{\r\n\t\t\t$ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\t}\r\n\r\n\t\t$core =& core::init();\r\n\t\t$core->load('validation');\r\n\r\n\t\t// Patikrinam ar ip adresas teisingas\r\n\t\tif($core->valid->ip_address($ip_address))\r\n\t\t{\r\n\t\t\treturn $ip_address;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '0.0.0.0';\r\n\t\t}\r\n\t}", "public function getIp(): string;", "public function getRandomIP()\n {\n return mt_rand(0,255).'.'.mt_rand(0,255).'.'.mt_rand(0,255).'.'.mt_rand(0,255);\n }", "public function hostToIp($ip)\n {\n if (is_string($ip) && starts_with($ip, $string = 'host:')) {\n return gethostbyname(str_replace($string, '', $ip));\n }\n\n return $ip;\n }", "function user_ip2hex()\r\n\t{\r\n\t\treturn dechex(ip2long(get_ip_address()));\r\n\t}", "public static function expandIP ($IP = NULL)\n\t{\n\t\tif (preg_match('/([0-9]{1,3}\\.){3}[0-9]{1,3}/', $IP) && ! preg_match('/\\.{15}/', $IP)) {\n\t\t\t$IP = explode('.', $IP);\n\t\t\tforeach ($IP as $ipSubPart) {\n\t\t\t\t$ipExpanded[] = str_pad($ipSubPart, 3, '0', STR_PAD_LEFT);\n\t\t\t}\n\t\t\treturn implode('.', $ipExpanded);\n\t\t}\n\t\treturn NULL;\n\t}", "function checkForIP( $input )\n{\n\n // CONTROLLING THE INPUT DATA:\n if ( ! isset($input) )\n die(displayMessage(\"No input set.\"));\n\n $control = explode(\".\", $input);\n if (count($control) != 4)\n die(displayMessage(\"Input format error.\"));\n\n foreach( $control as $byte)\n {\n if( strlen($byte) <= 0 || 3 < strlen($byte) )\n die(displayMessage(\"Input format error.\"));\n }\n\n // TODO: Legg til regex sanitering.\n}", "function PMA_transformation_text_plain__longToIpv4($buffer, $options = array(), $meta = '')\n{\n if ($buffer < 0 || $buffer > 4294967295) {\n return $buffer;\n }\n\n return long2ip($buffer);\n}", "function get_ip_address() {\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\r\n\t\t\treturn $_SERVER['HTTP_CLIENT_IP'];\r\n\t\t}\r\n\r\n\t\t// check for IPs passing through proxies\r\n\t\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n\t\t\t// check if multiple ips exist in var\r\n\t\t\tif (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\r\n\t\t\t\t$iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\r\n\t\t\t\tforeach ($iplist as $ip) {\r\n\t\t\t\t\tif (validate_ip($ip))\r\n\t\t\t\t\t\treturn $ip;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n\t\t\t\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!empty($_SERVER['HTTP_X_FORWARDED']) && validate_ip($_SERVER['HTTP_X_FORWARDED']))\r\n\t\t\treturn $_SERVER['HTTP_X_FORWARDED'];\r\n\t\tif (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\r\n\t\t\treturn $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\r\n\t\tif (!empty($_SERVER['HTTP_FORWARDED_FOR']) && validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\r\n\t\t\treturn $_SERVER['HTTP_FORWARDED_FOR'];\r\n\t\tif (!empty($_SERVER['HTTP_FORWARDED']) && validate_ip($_SERVER['HTTP_FORWARDED']))\r\n\t\t\treturn $_SERVER['HTTP_FORWARDED'];\r\n\r\n\t\t// return unreliable ip since all else failed\r\n\t\treturn $_SERVER['REMOTE_ADDR'];\r\n\t}", "public function ip()\n\t{\n\t\t$ip = '';\n\n\t\tforeach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR') as $k) {\n\t\t\tif (!empty($_SERVER[$k])) {\n\t\t\t\t$ip = $_SERVER[$k];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($ip && preg_match('/[\\d\\.]{7,15}/', $ip, $ips)) {\n\t\t\t$ip = $ips[0];\n\t\t}\n\n\t\treturn $ip;\n\t}", "protected function ip() {\n return 249.2;\n }", "function adrotate_get_remote_ip(){\n\tif(empty($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\n\t\t$remote_ip = $_SERVER[\"REMOTE_ADDR\"];\n\t} else {\n\t\t$remote_ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\t}\n\t$buffer = explode(',', $remote_ip, 2);\n\n\treturn $buffer[0];\n}", "public function get_ip() {\n $ip_keys = array( 'REMOTE_ADDR', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED');\n foreach ($ip_keys as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n // trim for safety measures\n $ip = trim($ip);\n // attempt to validate IP\n if ($this->validate_ip($ip)) {\n return $ip;\n }\n }\n }\n }\n $toReturn = '';\n $toReturn = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : false;\n return $toReturn;\n}", "function get_ip_address() \n\t{\n\t if (!empty($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n\t return $_SERVER['HTTP_CLIENT_IP'];\n\t }\n\n\t // check for IPs passing through proxies\n\t if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t // check if multiple ips exist in var\n\t if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n\t $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t foreach ($iplist as $ip) {\n\t if (validate_ip($ip))\n\t return $ip;\n\t }\n\t } else {\n\t if (validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t return $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t }\n\t }\n\t if (!empty($_SERVER['HTTP_X_FORWARDED']) && validate_ip($_SERVER['HTTP_X_FORWARDED']))\n\t return $_SERVER['HTTP_X_FORWARDED'];\n\t if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n\t return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n\t if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n\t return $_SERVER['HTTP_FORWARDED_FOR'];\n\t if (!empty($_SERVER['HTTP_FORWARDED']) && validate_ip($_SERVER['HTTP_FORWARDED']))\n\t return $_SERVER['HTTP_FORWARDED'];\n\n\t // return unreliable ip since all else failed\n\t return $_SERVER['REMOTE_ADDR'];\n\t}", "public static function getClientIP()\n {\n if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {\n $ip = trim($_SERVER['HTTP_CLIENT_IP']);\n if (Validation::isIPv4($ip)) {\n return $ip;\n }\n }\n if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {\n $ip = trim($_SERVER['HTTP_X_FORWARDED_FOR']);\n if (Validation::isIPv4($ip)) {\n return $ip;\n } elseif (mb_strpos($ip, ',') !== false) {\n $ips = explode(',', $ip);\n foreach ($ips as $ip) {\n $ip = trim($ip);\n if (Validation::isIPv4($ip)) {\n return $ip;\n }\n }\n } elseif (mb_strpos($ip, ';') !== false) {\n $ips = explode(';', $ip);\n foreach ($ips as $ip) {\n $ip = trim($ip);\n if (Validation::isIPv4($ip)) {\n return $ip;\n }\n }\n }\n }\n if (array_key_exists('REMOTE_ADDR', $_SERVER)) {\n $ip = trim($_SERVER['REMOTE_ADDR']);\n if (Validation::isIPv4($ip)) {\n return $ip;\n }\n }\n \n return '0.0.0.0';\n }", "function get_ip_address() {\n\t if (!empty($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n\t return $_SERVER['HTTP_CLIENT_IP'];\n\t }\n\n\t // check for IPs passing through proxies\n\t if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t // check if multiple ips exist in var\n\t if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n\t $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t foreach ($iplist as $ip) {\n\t if (validate_ip($ip))\n\t return $ip;\n\t }\n\t } else {\n\t if (validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t return $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t }\n\t }\n\t if (!empty($_SERVER['HTTP_X_FORWARDED']) && validate_ip($_SERVER['HTTP_X_FORWARDED']))\n\t return $_SERVER['HTTP_X_FORWARDED'];\n\t if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n\t return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n\t if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n\t return $_SERVER['HTTP_FORWARDED_FOR'];\n\t if (!empty($_SERVER['HTTP_FORWARDED']) && validate_ip($_SERVER['HTTP_FORWARDED']))\n\t return $_SERVER['HTTP_FORWARDED'];\n\n\t // return unreliable ip since all else failed\n\t return $_SERVER['REMOTE_ADDR'];\n\t}" ]
[ "0.73727363", "0.69045293", "0.6872364", "0.6842937", "0.68256783", "0.6819117", "0.67457676", "0.6705287", "0.6681553", "0.6597325", "0.6540084", "0.64716583", "0.64399546", "0.6439004", "0.6434028", "0.64149415", "0.64113456", "0.6411018", "0.6398337", "0.63896435", "0.63854074", "0.6384633", "0.6328738", "0.63180256", "0.63176155", "0.62843686", "0.6279895", "0.6266462", "0.62604606", "0.62323654", "0.6224294", "0.62142855", "0.62045467", "0.6183845", "0.6179713", "0.61677164", "0.615223", "0.61440957", "0.6142367", "0.61414266", "0.6134436", "0.6125", "0.6124195", "0.6112933", "0.61122525", "0.61099523", "0.610315", "0.6098879", "0.60767066", "0.607442", "0.6069892", "0.60586625", "0.605249", "0.60487324", "0.6048054", "0.60415", "0.6038628", "0.6031546", "0.60275126", "0.60254973", "0.6017249", "0.6008756", "0.60078645", "0.59953415", "0.5992558", "0.59800303", "0.59694755", "0.5968133", "0.59538984", "0.5937635", "0.5931014", "0.59283626", "0.59272707", "0.5925984", "0.59146124", "0.5909148", "0.5907683", "0.59042025", "0.58996034", "0.58819485", "0.58786494", "0.5874931", "0.5874467", "0.5867083", "0.5866797", "0.5857656", "0.5854288", "0.5847225", "0.5844652", "0.58438003", "0.58376384", "0.58347166", "0.5817947", "0.5814183", "0.5813504", "0.5810081", "0.5809423", "0.58093864", "0.5788094", "0.5787779" ]
0.7153183
1
getHost Get the Internet host name corresponding to a given IP address
getHost Получает имя интернет-хоста, соответствующее заданному IP-адресу
function getHostEx($ip) { return gethostbyaddr($ip); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHostname()\n\t{\n\t\t$ip = $this->getIpAddress();\n\t\t$host = gethostbyaddr($ip);\n\t\treturn $host;\n\t}", "private function gethost( $ip )\n\t{\n\t\t//Make sure the input is not going to do anything unexpected\n\t\t//IPs must be in the form x.x.x.x with each x as a number\n\n\t\tif( preg_match( '/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/', $ip ) )\n\t\t{\n\t\t\t$host = `host -s -W 1 $ip`;\n\t\t\t$host = ( $host ? end( explode( ' ', trim( trim( $host ), '.' ) ) ) : $ip );\n\t\t\tif( in_array( $host, array( 'reached', 'record', '2(SERVFAIL)', '3(NXDOMAIN)' ) ) )\n\t\t\t{\n\t\t\t\treturn sprintf( __( '(error fetching domain name for %s)', COUNTERIZE_PLUGIN_IP_TD ), $ip );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $host;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn __( '(invalid IP address)', COUNTERIZE_PLUGIN_IP_TD );\n\t\t}\n\t}", "public static function getHost($ip)\n\t{\n\t\t//Make sure the input is not going to do anything unexpected\n\t\t//IPs must be in the form x.x.x.x with each x as a number\n\t\t$testar = explode('.',$ip);\n\t\tif (count($testar)!=4)\n\t\t{\n\t\t\treturn $ip;\n\t\t}\n\t\tfor ($i=0;$i<4;++$i)\n\t\t{\n\t\t\tif (!is_numeric($testar[$i]))\n\t\t\t{\n\t\t\t\treturn $ip;\n\t\t\t}\n\t\t}\n\t\t$host = `host -W 1 $ip`;\n\t\t$host = ($host) ? end(explode(' ', $host)) : $ip;\n\t\t$host = (strpos($host, \"SERVFAIL\") === false) ? $host : $ip;\n\t\treturn $host;\n\t}", "function getHost();", "function getHost();", "function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "function getHostNameByIP($ip){\n\t$conn = getDBConnection();\n\n\t// query the interface table\n\t$sql = \"SELECT host FROM interface where ip='\".$ip->ip.\"'\";\n\t$result = $conn->query($sql);\n\n\tif ($result->num_rows > 0) {\n\t\t$r = $result->fetch_assoc();\n//\t\tvar_dump($r[\"host\"]);\n\t\treturn $r[\"host\"];\n\t} else {\n\t\treturn false;\n\t}\n\tcloseDBConnection($conn);\n\treturn $hosts;\n}", "public function getHost(bool $encode = false): string {\n if (!$this->contains(self::HOST)) {\n return '';\n }\n $host = $this->parts[self::HOST];\n if (preg_match('!^[\\da-f]*:[\\da-f.:]+$!ui', $host)) {\n $host = '[' . $host . ']'; // IPv6\n } else if ($encode) {\n $host = rawurlencode($host); // IPv4 or name\n }\n return $host;\n }", "function gethost ($ip)\n{\n //IPs must be in the form x.x.x.x with each x as a number\n \n if( preg_match('/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.]\n(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/', $ip) )\n {\n $host = `host $ip`;\n return (($host ? end ( explode (' ', $host)) : $ip));\n }\n else\n {\n return false;\n }\n}", "function gethostbyaddr($ip_address)\n{\n return '';\n}", "function gethostbyaddr($ip_address)\n{\n\treturn '';\n}", "public function getHost() : string;", "public function getHostname();", "public function getHost(): string;", "public function getHost(): string;", "public function getHost(): string;", "public function getHost() {}", "public function getHost() {}", "public function getFullHost();", "public function getHost() :string;", "public function getHostName(): string;", "public static function getHost(): string\n {\n // Check for proxy first\n if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {\n $forwaredHostNames = explode(',', (string) $_SERVER['HTTP_X_FORWARDED_HOST']);\n $host = end($forwaredHostNames);\n } else {\n $host = \n $_SERVER['HTTP_HOST'] ??\n $_SERVER['HTTP_SERVER_NAME'] ??\n $_SERVER['HTTP_SERVER_ADDR'];\n }\n\n // trim and remove port number from host\n // host is lowercase as per RFC 952/2181\n return strtolower(preg_replace('/:\\d+$/', '', trim((string) $host)));\n }", "function _spanelhs_gethostname($serverip) {\n\t$cli = new HTTP_Client();\n\n # assume spanel is in http://IP/\n $respcode = $cli->get(\"http://$serverip/?info=1\");\n\tif ($respcode == 200) {\n $resp = $cli->currentResponse();\n if (preg_match('#SPANEL_URL=https?://(.+?)/#', $resp['body'], $m)) return $m[1];\n }\n\n\t# try getting hostname from IP/spanel/spanel.cgi script\n\t$respcode = $cli->get(\"http://$serverip/spanel/spanel.cgi?info=1\");\n\tif ($respcode != 200) return -$respcode;\n\t$resp = $cli->currentResponse();\n\tif (preg_match('#<FRAME SRC=\"https?://(.+?)/\">#', $resp['body'], $m)) return $m[1];\n\tif (preg_match('#SPANEL_URL=https?://(.+?)/#', $resp['body'], $m)) return $m[1];\n return -1;\n}", "public function getHost()\n {\n // default ports\n static $map = array(\n 'http' => 80,\n 'https' => 443,\n );\n\n if ($hostname = $this->parseUrl('host')) {\n $host = $scheme = $this->parseUrl('scheme', 'http');\n $host .= '://';\n $host .= $hostname;\n\n $port = $this->parseUrl('port');\n if ($port && (!isset($map[$scheme]) || $map[$scheme] != $port)) {\n $host .= ':'.$port;\n }\n\n return $host;\n }\n }", "abstract protected function getHost();", "private function getHost(): string\n {\n return isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : $_SERVER['SERVER_ADDR'];\n }", "abstract protected function getHostName();", "function plugin_gethost()\n{\n if (OnEmptyArg('gethost <ip>')) {\n } else {\n $host = @gethostbyaddr(trim(msgAsArguments()));\n if (!empty($host) &&\n $host != msgAsArguments() &&\n substr(msgAsArguments(), 0, 3) != '127' &&\n substr(msgAsArguments(), 0, 3) != '192' &&\n substr(msgAsArguments(), 0, 1) != '0') {\n\n response(\"hostname: $host\");\n } elseif ($host == msgAsArguments()) {\n response(\"Cannot resolve \".msgAsArguments());\n } elseif (empty($host)) {\n response('Address is not a valid IPv4/IPv6 address');\n }\n }\n}", "function getHttpHost()\n {\n\n }", "function getHostByAddr( $remoteIP )\n {\n $remoteHostName =& gethostbyaddr( $remoteIP );\n return $remoteHostName;\n }", "public function getHttpHost()\n\t{\n\t\t$port = (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 80) ? (':' . ((int) $_SERVER['SERVER_PORT'])) : '';\n\t\t$host = '';\n\t\tif(isset($_SERVER['SERVER_NAME']) && $host = $_SERVER['SERVER_NAME']) {\n\t\t\t// no whitelist available, so defer to server_name\n\t\t\t$host .= $port;\n\t\t} else if(isset($_SERVER['HTTP_HOST']) && $host = $_SERVER['HTTP_HOST']) {\n\t\t\t// fallback to sanitized http_host if server_name not available\n\t\t\t// note that http_host already includes port if not 80\n\t\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t}\n\t\t// sanitize since it did not come from a whitelist\n\t\tif(!preg_match('/^[-a-zA-Z0-9.:]+$/D', $host)) $host = '';\n\n\t\treturn $host;\n\t}", "public static function getHost()\n {\n $cfg = static::getCfg();\n\n if (isset($cfg['server_name'])) {\n $sourceUrl = parse_url($cfg['server_name']);\n $host = $sourceUrl['host'];\n\n return $host;\n } else {\n trigger_error('cant read cfg for server_name', E_USER_WARNING);\n }\n }", "function get_host()\n {\n if(isset($this->uri[\"host\"]))\n $host = $this->uri[\"host\"].\":\".$this->uri[\"port\"];\n else\n $host = $this->get_header(\"host\");\n return $host;\n }", "public function getHostName(): string\n {\n return $this->hostName;\n }", "public function getHostNameIdentifier();", "function gethostbyname($hostname)\n{\n return '';\n}", "final public function get_host()\n {\n try\n {\n return $this->host;\n }\n catch (Exception $e)\n {\n throw $e;\n }\n }", "public function getHttpHost()\n {\n $scheme = $this->getScheme();\n $port = $this->getPort();\n if (('http' == $scheme && $port == 80) || ('https' == $scheme && $port == 443)) {\n return $this->getHost();\n }\n\n return $this->getHost() . ':' . $port;\n }", "public static function host_get() {\n\t\t$host = '::1';\n\t\tif (php_sapi_name()=='cli') {\n\t\t\tif (isset($_SERVER['HOSTNAME'])) {\n\t\t\t\t$host = $_SERVER['HOSTNAME'];\n\t\t\t} elseif (isset($_SERVER['SSH_CONNECTION'])) {\n\t\t\t\t$host = explode(' ',$_SERVER['SSH_CONNECTION']);\n\t\t\t\tif (count($host)>2) {\n\t\t\t\t\t$host = $host[2];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (isset($_SERVER['HTTP_HOST'])) {\n\t\t\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t\t} elseif (isset($_SERVER['SERVER_NAME'])) {\n\t\t\t\t$host = $_SERVER['SERVER_NAME'];\n\t\t\t} elseif (isset($_SERVER['SERVER_ADDR'])) {\n\t\t\t\t$host = $_SERVER['SERVER_ADDR'];\n\t\t\t}\n\t\t}\n\t\treturn $host;\n\t}", "public static function getHttpHost(): string\n {\n $scheme = self::getScheme();\n $port = self::getPort();\n\n if (('http' == $scheme && 80 == $port) || ('https' == $scheme && 443 == $port)) {\n return self::getHost();\n }\n\n return self::getHost() . \":{$port}\";\n }", "public static function getHttpHost(): string\n {\n $scheme = self::getScheme();\n $port = self::getPort();\n\n if (('http' == $scheme && 80 == $port) || ('https' == $scheme && 443 == $port)) {\n return self::getHost();\n }\n\n return self::getHost() . \":{$port}\";\n }", "public function getHttpHost()\n {\n $host = $this->getServer('HTTP_HOST');\n if (!empty($host)) {\n return $host;\n }\n\n $scheme = $this->getScheme();\n $name = $this->getServer('SERVER_NAME');\n $port = $this->getServer('SERVER_PORT');\n\n if(null === $name) {\n return '';\n }\n elseif (($scheme == self::SCHEME_HTTP && $port == 80) || ($scheme == self::SCHEME_HTTPS && $port == 443)) {\n return $name;\n } else {\n return $name . ':' . $port;\n }\n }", "public function ip_address()\n {\n if ($this->is_cli_request()) {\n\n $hostname = gethostname();\n return gethostbyname($hostname);\n\n } else {\n\n return parent::ip_address();\n }\n }", "function ipaddr_to_hostname($ipaddr)\n{\n // return argument, if it already contains a hostname\n if (preg_match(\"/^.*[a-zA-Z]$/\", $ipaddr))\n return $ipaddr;\n\n // convert ip address to reverse IN-ADDR entry\n $reverse_ipaddr = implode('.', array_reverse(explode('.', $ipaddr))) . '.in-addr.arpa';\n // lookup PTR-record, but faster than gethostbyaddr()\n $record = dns_get_record($reverse_ipaddr, DNS_PTR);\n // check if ip address resolved to hostname\n if (isset($record[0]['target']))\n $hostname = $record[0]['target'];\n // if not, return ip address\n else\n $hostname = $ipaddr;\n\n ### echo \"\\n======================= <DEBUG: \\$ipaddr> =======================\\n\";\n ### echo \"ipaddr: $ipaddr | hostname: $hostname\\n\";\n ### echo \"======================= </DEBUG: \\$ipaddr> ======================\\n\";\n\n return $hostname;\n}", "public function getDomain($ip)\n {\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n $host = gethostbyaddr(\"$ip\");\n return $host;\n } elseif (filter_var($ip, FILTER_VALIDATE_IP)) {\n $host = gethostbyaddr(\"$ip\");\n return $host;\n } else {\n $host = \"No valid domain\";\n return $host;\n }\n }", "public function getHostname()\n {\n return $this->getPart('host');\n }", "public function getHost()\n {\n return $this->_getValue('Host');\n }", "public function getHostname()\n {\n return gethostname();\n }", "public function getHost()\n {\n if (($host = $this->getHeader(\"HTTP_HOST\"))) {\n $pos = strpos($host, \":\");\n return ($pos !== false ? substr($host, 0, $pos) : $host);\n }\n\n return $this->serverName;\n }", "public static function getHost(): string\n {\n return self::proxy()->getHost();\n }", "public function getHostName()\n {\n $url = $this->getScheme() . '://' . $this->getHost();\n\n if ($this->getPort()) {\n $url .= ':' . $this->getPort();\n }\n\n return $url;\n }", "function gethostbyname($hostname)\n{\n\treturn '';\n}", "public static function getHost(): string\n {\n $host = server('HTTP_X_FORWARDED_HOST');\n\n if (empty($host)) {\n if (!$host = headers('HOST')) {\n if (!$host = server('SERVER_NAME')) {\n $host = server('SERVER_ADDR', '');\n }\n }\n }\n\n // trim and remove port number from host\n // host is lowercase as per RFC 952/2181\n $host = strtolower(preg_replace('/:\\d+$/', '', trim($host)));\n\n // as the host can come from the user (HTTP_HOST and depending on the configuration, SERVER_NAME too can come from the user)\n // check that it does not contain forbidden characters (see RFC 952 and RFC 2181)\n // use preg_replace() instead of preg_match() to prevent DoS attacks with long host names\n if ($host && '' !== preg_replace('/(?:^\\[)?[a-zA-Z0-9-:\\]_]+\\.?/', '', $host)) {\n throw new QueRuntimeException(sprintf('Invalid Host \"%s\".', $host), \"HTTP Request Error\",\n E_USER_ERROR, HTTP::BAD_REQUEST, PreviousException::getInstance(1));\n }\n\n return $host;\n }", "public function GetHostName($id)\n {\n $h = null;\n\n if (is_int($id))\n {\n foreach ($this->GetHosts() as $item)\n {\n if ($item->ID == $id)\n {\n return $item->Name;\n }\n }\n }\n\n return \"\";\n }", "public function getHost()\n {\n $hostname = null;\n\n if (!empty($this->server['HTTP_HOST'])) {\n $hostname = $this->server['HTTP_HOST'];\n } else if (!empty($this->server['SERVER_NAME'])) {\n $hostname = $this->server['SERVER_NAME'];\n }\n\n if (strpos($hostname, ':') !== false) {\n $hostname = substr($hostname, 0, strpos($hostname, ':'));\n }\n\n return $hostname;\n }", "public function getHttpHost()\n {\n $scheme = $this->getScheme();\n $port = $this->getPort();\n\n if (('http' === $scheme && 80 === (int) $port)\n || ('https' === $scheme && 443 === (int) $port)\n ) {\n return $this->getHost();\n }\n\n return $this->getHost() . ':' . $port;\n }", "public function getHost()\n {\n return $this->wrapped->getHost();\n }", "public static function getHost(): string\n {\n $host = server('X-Forwarded-Host');\n\n if (empty($host)) {\n if (!$host = headers('HOST')) {\n if (!$host = server('SERVER_NAME')) {\n $host = server('SERVER_ADDR', '');\n }\n }\n }\n\n // trim and remove port number from host\n // host is lowercase as per RFC 952/2181\n $host = strtolower(preg_replace('/:\\d+$/', '', trim($host)));\n\n // as the host can come from the user (HTTP_HOST and depending on the configuration, SERVER_NAME too can come from the user)\n // check that it does not contain forbidden characters (see RFC 952 and RFC 2181)\n // use preg_replace() instead of preg_match() to prevent DoS attacks with long host names\n if ($host && '' !== preg_replace('/(?:^\\[)?[a-zA-Z0-9-:\\]_]+\\.?/', '', $host)) {\n throw new QueRuntimeException(sprintf('Invalid Host \"%s\".', $host), \"HTTP Request Error\",\n E_USER_ERROR, HTTP::BAD_REQUEST, PreviousException::getInstance(1));\n }\n\n return $host;\n }", "public function getHostName(){\n return $this->hostname;\n }", "public function GetHost() {\n\t\treturn $this->host;\n\t}", "public function gethostname()\n\t{\n\t\t// Classic PHP!\n\t\t// -> On OpenSUSE, gethostname returns only the name of the host\n\t\t// -> On Fedora, gethostname returns the host name and domain\n\t\treturn \\trim($this->shell_exec('hostname -f'));\n\t}", "private function get_host() {\n\t\tif (preg_match('/(http[s]?:)?([\\/]{0,2})([^\\/\\?\\#]+)/', $this->url, $match)) {\n\t\t\tif (empty($match[1])) $match[1] = 'http:';\n\t\t\tif (empty($match[2])) $match[2] = '//';\n\t\t\treturn $match[1] . $match[2] . $match[3];\n\t\t} else {\n\t\t\treturn $this->url;\n\t\t}\n\t}", "private static function webhost() {\n\n\t\t$response = self::$client->get( self::$hostname_url );\n\n\t\t$data = json_decode((string) $response->getBody(), true);\n\n\t\treturn $data['host'] ?: false;\n\n\t}", "public function host()\n {\n if(!isset($this->cache['host']))\n {\n $this->cache['host'] = $this->resolveHost();\n }\n \n return $this->cache['host'];\n }", "public function getHost(): string\n {\n return $this->host;\n }", "public function getHost(): string\n {\n return $this->host;\n }", "public function getHost(): string\n {\n return $this->host;\n }", "public function getHost(): string\n {\n return $this->host;\n }", "public function getHost(): string\n {\n return $this->host;\n }", "public function getHost()\n {\n return $this->getHttp()->getHttpHost();\n }", "private function getHostname(): string\n {\n $host = parse_url($this->config->get('psx_url'), PHP_URL_HOST);\n if (empty($host)) {\n $host = $_SERVER['SERVER_NAME'] ?? 'unknown';\n }\n\n return $host;\n }", "public function getHostName()\n {\n if (array_key_exists(\"hostName\", $this->_propDict)) {\n return $this->_propDict[\"hostName\"];\n } else {\n return null;\n }\n }", "public static function getHostName() {\n\t\treturn function_exists('gethostname') ? gethostname() : false;\n\t}", "private function get_remote_hostname()\n {\n $hostname = NULL;\n\n if(!is_null($this->ip))\n {\n $hostname = gethostbyaddr($this->ip); \n }\n \n return $hostname;\n }", "public function getHost()\n {\n return $this->params['host'];\n }", "public static function atkHost()\n {\n $atkHost = $_SERVER['HTTP_HOST'] != '' ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\n\n // if we're running on our cluster environment\n // we seem to have a specific portid within the HTTP_HOST\n // If so, remove it from the hostname\n\n $dummy = explode(':', $atkHost);\n\n return $dummy[0];\n }", "private static function getHost($ipAddress = ''): string\n {\n return ($ipAddress !== '') ? @\\gethostbyaddr($ipAddress) : 'unknown';\n }", "protected function getHostName() {\n if (isset($_SERVER['HTTP_HOST'])) {\n $host = $_SERVER['HTTP_HOST'];\n } else {\n $host = $_SERVER['SERVER_NAME'];\n }\n return $host;\n }", "public static function getHost()\n {\n return self::$_host;\n }", "public static function getHttpHost(){\n if(isset($_SERVER['SERVER_PORT']) and ($_SERVER['SERVER_PORT']!='80' and $_SERVER['SERVER_PORT']!='443') ){\n $host = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'];\n } else {\n $host = $_SERVER['SERVER_NAME'];\n }\n return $host;\n }", "public function getHost()\n {\n return isset($this->host) ? $this->host : '';\n }", "public function get_host() {\r\n return $this->host;\r\n }", "public function getHttpHost(){ }", "public static function getUserHostname()\n\t{\n\t\treturn @gethostbyaddr(self::getUserIp());\n\t}" ]
[ "0.75835353", "0.750206", "0.7375358", "0.73210347", "0.73210347", "0.73210347", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7199682", "0.7190721", "0.7151732", "0.712828", "0.7029391", "0.6966702", "0.69294256", "0.6908496", "0.6882699", "0.6882699", "0.6882699", "0.68506664", "0.68502986", "0.6847442", "0.68273544", "0.68140006", "0.6811371", "0.680577", "0.6798274", "0.679284", "0.67899805", "0.67864996", "0.6765052", "0.67430073", "0.66579324", "0.66547817", "0.66483074", "0.66168493", "0.66115636", "0.6586443", "0.657165", "0.65695345", "0.6567", "0.65609235", "0.65573853", "0.65573853", "0.65533686", "0.65515727", "0.65461576", "0.65058464", "0.6502427", "0.6499813", "0.6499729", "0.64967847", "0.6490211", "0.64869463", "0.6481093", "0.647529", "0.64662063", "0.6435823", "0.64287776", "0.64241254", "0.64045584", "0.6400885", "0.6396775", "0.63900983", "0.63745856", "0.6358947", "0.6356967", "0.6356782", "0.6356782", "0.6356782", "0.6356782", "0.6356782", "0.63559586", "0.6344221", "0.6337472", "0.63321286", "0.6327062", "0.6318892", "0.6300242", "0.6287697", "0.6274677", "0.6273934", "0.62629074", "0.6246636", "0.6244863", "0.6234626", "0.62293184" ]
0.76850426
0
Returns the client IP addresses. In the returned array the most trusted IP address is first, and the least trusted one last. The "real" client IP address is the last one, but this is also the least trusted one. Trusted proxies are stripped if passed. Use this method carefully; you should use getClientIp() instead.
Возвращает IP-адреса клиента. В возвращаемом массиве сначала идет наиболее доверенный IP-адрес, а последним — наименее доверенный. "Правдивый" IP-адрес клиента — последний, но это также наименее доверенный. Доверенные прокси-серверы, если они переданы, удаляются. Используйте этот метод с осторожностью; лучше использовать getClientIp().
function getClientIps(array $server, array $trustedProxies = []) : array { if (empty($server)) { return ['']; } $clientIps = array(); $ip = $server['REMOTE_ADDR']; if (!isFromTrustedProxy($trustedProxies, $ip)) { return array($ip); } if (array_key_exists('FORWARDED', $server) && trim($server['FORWARDED']) != '') { $forwardedHeader = $server['FORWARDED']; preg_match_all('{(for)=("?\[?)([a-z0-9\.:_\-/]*)}', $forwardedHeader, $matches); $clientIps = $matches[3]; } elseif (array_key_exists('X_FORWARDED_FOR', $server) && trim($server['X_FORWARDED_FOR']) != '') { $clientIps = array_map('trim', explode(',', $server['X_FORWARDED_FOR'])); } $clientIps[] = $ip; // Complete the IP chain with the IP the request actually came from $ip = $clientIps[0]; // Fallback to this when the client IP falls into the range of trusted proxies foreach ($clientIps as $key => $clientIp) { // Remove port (unfortunately, it does happen) if (preg_match('{((?:\d+\.){3}\d+)\:\d+}', $clientIp, $match)) { $clientIps[$key] = $clientIp = $match[1]; } if (checkIp($clientIp, $trustedProxies)) { unset($clientIps[$key]); } } // Now the IP chain contains only untrusted proxies and the client IP return $clientIps ? array_reverse($clientIps) : array($ip); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClientIp()\n {\n $ip = $this->server->get('REMOTE_ADDR');\n\n if (!self::$trustProxy) {\n return $ip;\n }\n\n if (!self::$trustedHeaders[self::HEADER_CLIENT_IP] || !$this->headers->has(self::$trustedHeaders[self::HEADER_CLIENT_IP])) {\n return $ip;\n }\n\n $clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP])));\n $clientIps[] = $ip;\n\n $trustedProxies = self::$trustProxy && !self::$trustedProxies ? array($ip) : self::$trustedProxies;\n $ip = $clientIps[0];\n\n foreach ($clientIps as $key => $clientIp) {\n foreach ($trustedProxies as $trustedProxy) {\n if (IpUtils::checkIp($clientIp, $trustedProxy)) {\n unset($clientIps[$key]);\n\n continue 2;\n }\n }\n }\n\n return $clientIps ? array_pop($clientIps) : $ip;\n }", "private function setClientIPs()\n {\n if ($this->isUsingTrustedProxy()) {\n $this->clientIps = [$this->server->get('REMOTE_ADDR')];\n }\n $clientIps = [];\n\n if ($this->header->has(self::$trustedHeaderNames[RequestHeaderConstants::FORWARDED])) {\n $header = $this->header->get(self::$trustedHeaderNames[RequestHeaderConstants::FORWARDED]);\n preg_match_all(\"/for=(?:\\\"?\\[?)([a-z0-9:\\.\\-\\/_]*)/\", $header, $matches);\n $clientIps = $matches[1];\n } elseif ($this->header->has(self::$trustedHeaderNames[RequestHeaderConstants::CLIENT_IP])) {\n $clientIps = explode(',', $this->header->get(self::$trustedHeaderNames[RequestHeaderConstants::CLIENT_IP]));\n $clientIps = array_map('trim', $clientIps);\n }\n\n $clientIps[] = $this->server->get('REMOTE_ADDR');\n $fallbackClientIps = [$clientIps[0]];\n\n foreach ($clientIps as $index => $clientIp) {\n // Check for valid IPs\n if (!filter_var($clientIp, FILTER_VALIDATE_IP)) {\n unset($clientIps[$index]);\n\n continue;\n }\n\n // Don't allow trusted proxies\n if (in_array($clientIp, self::$trustedProxies)) {\n unset($clientIps[$index]);\n }\n }\n\n $this->clientIps = (count($clientIps) == 0) ? $fallbackClientIps : array_reverse($clientIps);\n }", "public function getClientsIp()\n {\n $ip = $this->server->get('REMOTE_ADDR', \"999.999.999.999\");\n return array($ip);\n }", "public function clientIps()\n {\n if(!isset($this->cache['client_ips']))\n {\n $this->cache['client_ips'] = $this->resolveClientIps();\n }\n \n return $this->cache['client_ips'];\n }", "public static function getTrustedProxies(): array\n {\n return self::proxy()->getTrustedProxies();\n }", "public static function getClientIpsProvider()\n {\n return [\n // simple IPv4\n [['88.88.88.88'], '88.88.88.88', null, null],\n // trust the IPv4 remote addr\n [['88.88.88.88'], '88.88.88.88', null, ['88.88.88.88']],\n\n // simple IPv6\n [['::1'], '::1', null, null],\n // trust the IPv6 remote addr\n [['::1'], '::1', null, ['::1']],\n\n // forwarded for with remote IPv4 addr not trusted\n [['127.0.0.1'], '127.0.0.1', '88.88.88.88', null],\n // forwarded for with remote IPv4 addr trusted + comma\n [['88.88.88.88'], '127.0.0.1', '88.88.88.88,', ['127.0.0.1']],\n // forwarded for with remote IPv4 and all FF addrs trusted\n [['88.88.88.88'], '127.0.0.1', '88.88.88.88', ['127.0.0.1', '88.88.88.88']],\n // forwarded for with remote IPv4 range trusted\n [['88.88.88.88'], '123.45.67.89', '88.88.88.88', ['123.45.67.0/24']],\n\n // forwarded for with remote IPv6 addr not trusted\n [['1620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', null],\n // forwarded for with remote IPv6 addr trusted\n [['2620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', ['1620:0:1cfe:face:b00c::3']],\n // forwarded for with remote IPv6 range trusted\n [['88.88.88.88'], '2a01:198:603:0:396e:4789:8e99:890f', '88.88.88.88', ['2a01:198:603:0::/65']],\n\n // multiple forwarded for with remote IPv4 addr trusted\n [['88.88.88.88', '87.65.43.21', '127.0.0.1'], '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', ['123.45.67.89']],\n // multiple forwarded for with remote IPv4 addr and some reverse proxies trusted\n [['87.65.43.21', '127.0.0.1'], '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', ['123.45.67.89', '88.88.88.88']],\n // multiple forwarded for with remote IPv4 addr and some reverse proxies trusted but in the middle\n [['88.88.88.88', '127.0.0.1'], '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', ['123.45.67.89', '87.65.43.21']],\n // multiple forwarded for with remote IPv4 addr and all reverse proxies trusted\n [['127.0.0.1'], '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', ['123.45.67.89', '87.65.43.21', '88.88.88.88', '127.0.0.1']],\n\n // multiple forwarded for with remote IPv6 addr trusted\n [['2620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', ['1620:0:1cfe:face:b00c::3']],\n // multiple forwarded for with remote IPv6 addr and some reverse proxies trusted\n [['3620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', ['1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3']],\n // multiple forwarded for with remote IPv4 addr and some reverse proxies trusted but in the middle\n [['2620:0:1cfe:face:b00c::3', '4620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '4620:0:1cfe:face:b00c::3,3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', ['1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3']],\n\n // client IP with port\n [['88.88.88.88'], '127.0.0.1', '88.88.88.88:12345, 127.0.0.1', ['127.0.0.1']],\n\n // invalid forwarded IP is ignored\n [['88.88.88.88'], '127.0.0.1', 'unknown,88.88.88.88', ['127.0.0.1']],\n [['88.88.88.88'], '127.0.0.1', '}__test|O:21:&quot;JDatabaseDriverMysqli&quot;:3:{s:2,88.88.88.88', ['127.0.0.1']],\n ];\n }", "public static function getTrustedHosts(): array\n {\n return self::proxy()->getTrustedHosts();\n }", "public static function getClientIpAddress()\n {\n $trustedProxies = env('TRUSTED_PROXIES');\n $trustedProxiesArr = explode(',', $trustedProxies);\n\n // Set the trusted proxies so that it does not get returned on $request->getClientIp()\n Request::setTrustedProxies($trustedProxiesArr);\n\n return Request::getClientIp();\n }", "function getClientIp(array $server, array $trustedProxies = []) : string\n{\n $ipAddresses = getClientIps($server, $trustedProxies);\n return $ipAddresses[0];\n}", "public static function getClientIps(): array\n {\n return self::proxy()->getClientIps();\n }", "public function getClientIp()\n {\n if (is_null($this->clientIp)) {\n $this->setClientIp($this->detectClientIp());\n }\n\n return $this->clientIp;\n }", "public static function getClientIpsForwardedProvider()\n {\n return [\n [['127.0.0.1'], '127.0.0.1', 'for=\"_gazonk\"', null],\n [['127.0.0.1'], '127.0.0.1', 'for=\"_gazonk\"', ['127.0.0.1']],\n [['88.88.88.88'], '127.0.0.1', 'for=\"88.88.88.88:80\"', ['127.0.0.1']],\n [['192.0.2.60'], '::1', 'for=192.0.2.60;proto=http;by=203.0.113.43', ['::1']],\n [['2620:0:1cfe:face:b00c::3', '192.0.2.43'], '::1', 'for=192.0.2.43, for=\"[2620:0:1cfe:face:b00c::3]\"', ['::1']],\n [['2001:db8:cafe::17'], '::1', 'for=\"[2001:db8:cafe::17]:4711', ['::1']],\n ];\n }", "public static function getClientIpImp() {\n $ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR');\n foreach ($ip_keys as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n // trim for safety measures\n $ip = trim($ip);\n // attempt to validate IP\n if (self::validateIp($ip)) {\n return $ip;\n }\n }\n }\n }\n return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : false;\n }", "public function ips(): array\n {\n return $this->message->getClientIps();\n }", "public function providerIpAddress()\n {\n return [\n [\"\"],\n [\"192.96.76.1\"],\n [\"145.38.5.6\"],\n // [\"35.158.84.49\"],\n // [\"23.34\"],\n // [\"35.158.84.49, 23.34\"],\n ];\n }", "public function getClientIp()\n {\n return $this->clientIP;\n }", "function _get_client_ip() {\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\tif (isset($_SERVER['HTTP_CLIENT_IP']) && preg_match('/^([0-9]{1,3}\\.){3}[0-9]{1,3}$/', $_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t} elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) {\n\t\t\tforeach ($matches[0] AS $xip) {\n\t\t\t\tif (!preg_match('#^(10|172\\.16|192\\.168)\\.#', $xip)) {\n\t\t\t\t\t$ip = $xip;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ip;\n\t}", "public function getServerIPs() {\n\t\treturn json_decode(self::getClient()->getServerIPs($this->getDomain()));\n\n\t}", "public function testTrustAnyProxyClientIp()\n {\n $this->request->expects($this->any())->method('getHeaderLine')\n ->willReturnMap([['Client-Ip', '192.168.0.1']]);\n \n $clientIp = new ClientIp(['trusted_proxy' => true]);\n \n $this->assertEquals('192.168.0.1', $clientIp($this->request));\n }", "public function ips() {\n\t\treturn $this->getClientIps();\n\t}", "public static function clientIP() {\n $ip = getenv(\"REMOTE_ADDR\");\n if (isset($_SERVER)) {\n if (isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\n $ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n } else if (isset($_SERVER[\"HTTP_CLIENT_IP\"])) {\n $ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n } else {\n $ip = $_SERVER[\"REMOTE_ADDR\"];\n }\n } else {\n if (getenv(\"HTTP_X_FORWARDED_FOR\")) {\n $ip = getenv(\"HTTP_X_FORWARDED_FOR\");\n } else if (getenv(\"HTTP_CLIENT_IP\")) {\n $ip = getenv(\"HTTP_CLIENT_IP\");\n }\n// else {\n// $ip = getenv(\"REMOTE_ADDR\");\n// }\n }\n return current(explode(',', $ip));\n }", "public function getClientIp()\n {\n if (!empty($_SERVER['REMOTE_ADDR'])) {\n $step = 1;\n $direct_ip = $_SERVER['REMOTE_ADDR'];\n }\n\n // Gets the proxy ip sent by the user\n $proxy_ip = '';\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $step = 2;\n $proxy_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else\n if (!empty($_SERVER['HTTP_X_FORWARDED'])) {\n $step = 3;\n $proxy_ip = $_SERVER['HTTP_X_FORWARDED'];\n } else\n if (!empty($_SERVER['HTTP_FORWARDED_FOR'])) {\n $step = 4;\n $proxy_ip = $_SERVER['HTTP_FORWARDED_FOR'];\n } else\n if (!empty($_SERVER['HTTP_FORWARDED'])) {\n $step = 5;\n $proxy_ip = $_SERVER['HTTP_FORWARDED'];\n } else\n if (!empty($_SERVER['HTTP_VIA'])) {\n $step = 6;\n $proxy_ip = $_SERVER['HTTP_VIA'];\n } else\n if (!empty($_SERVER['HTTP_X_COMING_FROM'])) {\n $step = 7;\n $proxy_ip = $_SERVER['HTTP_X_COMING_FROM'];\n } else\n if (!empty($_SERVER['HTTP_COMING_FROM'])) {\n $step = 8;\n $proxy_ip = $_SERVER['HTTP_COMING_FROM'];\n }\n\n // Returns the true IP if it has been found, else FALSE\n if (empty($proxy_ip)) {\n // True IP without proxy\n $ip = $direct_ip;\n } else {\n $is_ip = preg_match('|^([0-9]{1,3}\\.){3,3}[0-9]{1,3}|', $proxy_ip, $regs);\n if ($is_ip && (count($regs) > 0)) {\n // True IP behind a proxy\n $ip = $regs[0];\n } else {\n // Can't define IP: there is a proxy but we don't have\n // information about the true IP\n $ip = $direct_ip;\n }\n }\n return $ip;\n }", "public static function getClientIp() {\n\t\t$remote = new RemoteAddress();\n\t\treturn $remote->getIpAddress();\n\t}", "public function getIpAddresses()\n {\n return $this->ipaddresses;\n }", "function getClientIP() {\n\t\t\tforeach ( array( 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR' ) as $key ) {\n\t\t\t\tif ( array_key_exists( $key, $_SERVER ) === true ) {\n\t\t\t\t\tforeach ( array_map( 'trim', explode( ',', $_SERVER[ $key ] ) ) as $ip ) {\n\t\t\t\t\t\tif ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) !== false ) {\n\t\t\t\t\t\t\tif ( $_SERVER['SERVER_ADDR'] != $ip ) {\n\t\t\t\t\t\t\t\treturn $ip;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn '';\n\t\t}", "public static function get_unsafe_client_ip()\n {\n }", "function getClientIP()\n {\n $http_client_ip = filter_var($_SERVER['HTTP_CLIENT_IP'] ?? \"\", FILTER_VALIDATE_IP);\n $http_forwarded = filter_var($_SERVER['HTTP_X_FORWARDED_FOR'] ?? \"\", FILTER_VALIDATE_IP);\n\n if (!empty($http_client_ip)) {\n return $http_client_ip;\n }\n\n if (!empty($http_forwarded)) {\n return $http_forwarded;\n }\n\n return $_SERVER['REMOTE_ADDR'];\n }", "public static function getClientIp(): mixed\n {\n return IP::real();\n }", "public static function getClientIp(): mixed\n {\n return IP::real();\n }", "function getTrustedClientIP($dbip, $dbproxyip)\n{\n\tglobal $xffTrustProvider;\n \n\t$clientIpAddr = $dbip;\n\tif ($dbproxyip) {\n\t\t$ipList = explode(\",\", $dbproxyip);\n\t\t$ipList[] = $clientIpAddr;\n\t\t$ipList = array_reverse($ipList);\n\t\t\n\t\tforeach ($ipList as $ipnumber => $ip) {\n\t\t\tif ($xffTrustProvider->isTrusted(trim($ip)) && $ipnumber < (count($ipList) - 1)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$clientIpAddr = $ip;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treturn $clientIpAddr;\n}", "public function ips()\n {\n return $this->getClientIps();\n }", "public static function getClientIP()\n {\n if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {\n $ip = trim($_SERVER['HTTP_CLIENT_IP']);\n if (Validation::isIPv4($ip)) {\n return $ip;\n }\n }\n if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {\n $ip = trim($_SERVER['HTTP_X_FORWARDED_FOR']);\n if (Validation::isIPv4($ip)) {\n return $ip;\n } elseif (mb_strpos($ip, ',') !== false) {\n $ips = explode(',', $ip);\n foreach ($ips as $ip) {\n $ip = trim($ip);\n if (Validation::isIPv4($ip)) {\n return $ip;\n }\n }\n } elseif (mb_strpos($ip, ';') !== false) {\n $ips = explode(';', $ip);\n foreach ($ips as $ip) {\n $ip = trim($ip);\n if (Validation::isIPv4($ip)) {\n return $ip;\n }\n }\n }\n }\n if (array_key_exists('REMOTE_ADDR', $_SERVER)) {\n $ip = trim($_SERVER['REMOTE_ADDR']);\n if (Validation::isIPv4($ip)) {\n return $ip;\n }\n }\n \n return '0.0.0.0';\n }", "public static function getClientIP() {\n\t\tif (isset ( $_SERVER ['HTTP_X_FORWARDED_FOR'] ) && $_SERVER ['HTTP_X_FORWARDED_FOR'] != '127.0.0.1') {\n\t\t\t$ips = explode ( ',', $_SERVER ['HTTP_X_FORWARDED_FOR'] );\n\t\t\t$ip = $ips [0];\n\t\t} elseif (isset ( $_SERVER ['HTTP_X_REAL_IP'] )) {\n\t\t\t$ip = $_SERVER ['HTTP_X_REAL_IP'];\n\t\t} elseif (isset ( $_SERVER ['HTTP_CLIENTIP'] )) {\n\t\t\t$ip = $_SERVER ['HTTP_CLIENTIP'];\n\t\t} elseif (isset ( $_SERVER ['REMOTE_ADDR'] )) {\n\t\t\t$ip = $_SERVER ['REMOTE_ADDR'];\n\t\t} else {\n\t\t\t$ip = '127.0.0.1';\n\t\t}\n\t\t\n\t\t$pos = strpos ( $ip, ',' );\n\t\tif ($pos > 0) {\n\t\t\t$ip = substr ( $ip, 0, $pos );\n\t\t}\n\t\t\n\t\t$pos = strpos($ip, ':');\n\t if($pos > 0){\n\t $ip = substr ($ip, 0, $pos);\n\t }\n\t\t\n\t\treturn trim ( $ip );\n\t}", "public static function getRealIP() {\n\n if ($_SERVER['HTTP_X_FORWARDED_FOR'] != '') {\n $client_ip =\n (!empty($_SERVER['REMOTE_ADDR']) ) ?\n $_SERVER['REMOTE_ADDR'] :\n ( (!empty($_ENV['REMOTE_ADDR']) ) ?\n $_ENV['REMOTE_ADDR'] :\n 'unknown' );\n\n // los proxys van añadiendo al final de esta cabecera\n // las direcciones ip que van 'ocultando'. Para localizar la ip real\n // del usuario se comienza a mirar por el principio hasta encontrar \n // una dirección ip que no sea del rango privado. En caso de no \n // encontrarse ninguna se toma como valor el REMOTE_ADDR\n\n $entries = split('[, ]', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\n reset($entries);\n while (list(, $entry) = each($entries)) {\n $entry = trim($entry);\n if (preg_match('/^([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/', $entry, $ip_list)) {\n // http://www.faqs.org/rfcs/rfc1918.html\n $private_ip = array(\n '/^0\\./',\n '/^127\\.0\\.0\\.1/',\n '/^192\\.168\\..*/',\n '/^172\\.((1[6-9])|(2[0-9])|(3[0-1]))\\..*/',\n '/^10\\..*/');\n\n $found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);\n\n if ($client_ip != $found_ip) {\n $client_ip = $found_ip;\n break;\n }\n }\n }\n } else {\n $client_ip =\n (!empty($_SERVER['REMOTE_ADDR']) ) ?\n $_SERVER['REMOTE_ADDR'] :\n ( (!empty($_ENV['REMOTE_ADDR']) ) ?\n $_ENV['REMOTE_ADDR'] :\n 'unknown' );\n }\n\n return $client_ip;\n }", "public function getClientIpAddress()\n {\n return $this->getAttribute(self::ATTRIBUTE_CLIENT_IP);\n }", "public function getClientIp();", "public function getClientIp()\n {\n return $_SERVER[$this->options['clientIpKey']];\n }", "public function getClientIP() {\r\n return $this->clientIP;\r\n }", "public function getProxyAddresses()\n {\n return $this->getAttribute($this->schema->proxyAddresses()) ?? [];\n }", "function getIgnoreIpList()\n{\n return [];\n}", "public function getClientIp($proxy = true)\n {\n if ($proxy)\n {\n $pathInfo = $this->getPathInfoArray();\n\n if (isset($pathInfo[\"HTTP_CLIENT_IP\"]) && ($ip = $pathInfo[\"HTTP_CLIENT_IP\"]))\n {\n return $ip;\n }\n\n if ($this->getOption('trust_proxy') && ($ip = $this->getForwardedFor()))\n {\n return isset($ip[0]) ? trim($ip[0]) : '';\n }\n }\n\n return $this->getRemoteAddress();\n }", "public static function getClientIPAddress()\n {\n // Test if it is a shared client\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n //Is it a proxy address\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n\n return $ip;\n }", "private function getClientIp() {\n if (!empty($_SERVER [\"HTTP_X_FORWARDED_FOR\"])) {\n $source_ips = explode(',', $_SERVER [\"HTTP_X_FORWARDED_FOR\"]);\n $source_ip = $source_ips [0];\n } else {\n $source_ip = $_SERVER ['REMOTE_ADDR'];\n }\n\n return $source_ip;\n }", "public function ip($trust_proxy_headers = false) {\n if (!$trust_proxy_headers) {\n return $_SERVER['REMOTE_ADDR'];\n }\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n }", "public function getIPAddresses()\n\t{\n\t\t$response = $this->sendRequest(\n\t\t\t'/security/ip-address-whitelist',\n\t\t\t[ ],\n\t\t\ttrue,\n\t\t\t'get',\n\t\t\t[ ],\n\t\t\ttrue\n\t\t);\n\n\t\t$return = new IterableResponse();\n\n\t\tforeach( $response as $address )\n\t\t{\n\t\t\t$return->addItem(\n\t\t\t\tnew Entity\\IPAddress($address->value, $address->id)\n\t\t\t);\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getIP()\n {\n foreach (['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'] as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n\n return request()->ip(); // it will return server ip when no client ip found\n }", "public function get_ip_addresses() \r\n\t{\r\n\t\t$this->execute();\r\n\t\treturn $this->_ip_addresses;\r\n\t}", "public function returnApplicationIPAddresses(): array\n {\n return $this->options\n ->getSync()\n ->setPath($this->options->getClientId())\n ->setHeaderParams($this->options->getAuthorizationHeader(false))\n ->get(API::LIST['ipAddresses']);\n }", "public function testNoTrustedProxyClientIp()\n {\n $this->request->expects($this->any())->method('getHeaderLine')\n ->willReturnMap([['Client-Ip', '192.168.0.1']]);\n \n $clientIp = new ClientIp();\n \n $this->assertEquals('10.0.0.1', $clientIp($this->request));\n }", "public static function getClientIP()\n {\n $_http_x_forwarded_for = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? null;\n\n // Sometimes the HTTP_X_FORWARDED_FOR variable returns internal or local IP \n // addresses, and another times, it also return more than one IP address in a \n // comma separated list if it was forwarded from multiple IP addresses.\n if (strpos($_http_x_forwarded_for, \",\") !== false) {\n list($_http_x_forwarded_for) = explode(',', $_http_x_forwarded_for);\n }\n\n return $_SERVER['HTTP_CLIENT_IP'] \n ?? $_SERVER[\"HTTP_CF_CONNECTING_IP\"] # when behind cloudflare\n ?? $_SERVER['HTTP_X_FORWARDED'] \n ?? $_http_x_forwarded_for \n ?? $_SERVER['HTTP_FORWARDED'] \n ?? $_SERVER['HTTP_FORWARDED_FOR'] \n ?? $_SERVER['REMOTE_ADDR'] \n ?? '0.0.0.0'\n ;\n }", "public static function getClientIP() {\n if (isset($_SERVER['HTTP_CLIENTIP'])) {\n $ip = $_SERVER['HTTP_CLIENTIP'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&\n $_SERVER['HTTP_X_FORWARDED_FOR'] != '127.0.0.1') {\n $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n $ip = $ips[0];\n } elseif (isset($_SERVER['REMOTE_ADDR'])) {\n $ip = $_SERVER['REMOTE_ADDR'];\n } else {\n $ip = '127.0.0.1';\n }\n\n $pos = strpos($ip, ',');\n if ($pos > 0) {\n $ip = substr($ip, 0, $pos);\n }\n\n return trim($ip);\n }", "public function getTrustedIP()\n {\n return $this->trustedIP;\n }", "public function testTrustIrrelevantClientIp()\n {\n $this->request->expects($this->any())->method('getHeaderLine')\n ->willReturnMap([['Client-Ip', '192.168.0.1']]);\n \n $clientIp = new ClientIp(['trusted_proxy' => '172.0.0.0/24']);\n \n $this->assertEquals('10.0.0.1', $clientIp($this->request));\n }", "public function getClientIp(bool $proxy = true): string\n {\n if ($proxy) {\n $pathInfo = $this->getPathInfoArray();\n\n if (isset($pathInfo[\"HTTP_CLIENT_IP\"]) && ($ip = $pathInfo[\"HTTP_CLIENT_IP\"])) {\n return $ip;\n }\n\n if ($this->getOption('trust_proxy') && ($ip = $this->getForwardedFor())) {\n return isset($ip[0]) ? trim($ip[0]) : '';\n }\n }\n\n return $this->getRemoteAddress();\n }", "function fw_getProxyChain() : array {\n\tstatic $chain;\n\t\n\tif ( isset( $chain ) ) {\n\t\treturn $chain;\n\t}\n\t\n\t$chain = \n\t\\array_map( 'trim', \n\t\texplode( ',', \n\t\t\t$_SERVER['HTTP_X_FORWARDED_FOR'] ?? \n\t\t\t$_SERVER['HTTP_CLIENT_IP'] ?? \n\t\t\t$_SERVER['REMOTE_ADDR'] ?? '' \n\t\t) \n\t);\n\t\n\treturn $chain;\n}", "function cr_get_client_ip($allow_ipv6 = true)\n{\n\t$ip = $_SERVER['REMOTE_ADDR'];\n\t// REMOTE_ADDR may not be real ip in case server is behind proxy (nginx, docker etc.)\n\tif (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t} else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t$ips = explode(', ', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\tfor ($i = 0; $i < count($ips); $i++) {\n\t\t\t\tif (!preg_match('/^(10│172.16│192.168)./i', $ips[$i])) {\n\t\t\t\t\t$ip = $ips[$i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (!$allow_ipv6 && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n\t\t$ip = '0.0.0.0';\n\t}\n\treturn $ip;\n}", "public function testTrustIrrelevant()\n {\n $clientIp = new ClientIp(['trusted_proxy' => '172.0.0.0/24']);\n \n $this->assertEquals('10.0.0.1', $clientIp($this->request));\n }", "public function get_ip_address() {\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n\n // check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // check if multiple ips exist in var\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if (validate_ip($ip))\n return $ip;\n }\n } else {\n if (validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && validate_ip($_SERVER['HTTP_X_FORWARDED']))\n return $_SERVER['HTTP_X_FORWARDED'];\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n return $_SERVER['HTTP_FORWARDED_FOR'];\n if (!empty($_SERVER['HTTP_FORWARDED']) && validate_ip($_SERVER['HTTP_FORWARDED']))\n return $_SERVER['HTTP_FORWARDED'];\n\n // return unreliable ip since all else failed\n return $_SERVER['REMOTE_ADDR'];\n }", "public function testTrustConnectedCidrClientIp()\n {\n $this->request->expects($this->any())->method('getHeaderLine')\n ->willReturnMap([['Client-Ip', '192.168.0.1']]);\n \n $clientIp = new ClientIp(['trusted_proxy' => '10.0.0.0/24']);\n \n $this->assertEquals('192.168.0.1', $clientIp($this->request));\n }", "public function getIpFromServer()\n {\n $ip = '';\n $ipHolders = [\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ];\n\n foreach ($ipHolders as $key) {\n if (!empty($_SERVER[$key])) {\n $ip = $_SERVER[$key];\n if (strpos($ip, ',') !== false) {\n // Multiple IPs are present so use the last IP which should be\n // the most reliable IP that last connected to the proxy\n $ips = explode(',', $ip);\n array_walk($ips, create_function('&$val', '$val = trim($val);'));\n $ip = end($ips);\n }\n $ip = trim($ip);\n break;\n }\n }\n\n return $ip;\n }", "function get_client_ip() {\r\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != null) {\r\n $ipaddr = preg_replace('/,.*/', '', $_SERVER['HTTP_X_FORWARDED_FOR']);\r\n }\r\n else {\r\n if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != null) {\r\n $ipaddr = $_SERVER['HTTP_CLIENT_IP'];\r\n }\r\n else {\r\n $ipaddr = $_SERVER['REMOTE_ADDR'];\r\n }\r\n }\r\n if (isset($_SERVER['HTTP_CLIENTADDRESS']) && $_SERVER['HTTP_CLIENTADDRESS'] != null) {\r\n $tmpipaddr = $_SERVER['HTTP_CLIENTADDRESS'];\r\n if (!empty($tmpipaddr)) {\r\n $ipaddr = preg_replace('/,.*/', '', $tmpipaddr);\r\n }\r\n }\r\n return trim($ipaddr);\r\n}", "public function getClientIp(){\n\t\t\treturn $this->getParameter('clientIP');\n\t\t}", "function _get_client_ip()\n{\n $vars = array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'REMOTE_ADDR');\n $client_ip = false;\n\n foreach ($vars as $var) {\n if (isset($_SERVER[$var])) {\n $client_ip = $_SERVER[$var];\n break;\n }\n }\n\n return $client_ip;\n}", "public static function real_ip() {\r\r\n foreach (array(\r\r\n 'HTTP_CLIENT_IP',\r\r\n 'HTTP_X_FORWARDED_FOR',\r\r\n 'HTTP_X_FORWARDED',\r\r\n 'HTTP_X_CLUSTER_CLIENT_IP',\r\r\n 'HTTP_FORWARDED_FOR',\r\r\n 'HTTP_FORWARDED',\r\r\n 'REMOTE_ADDR'\r\r\n ) as $key) {\r\r\n if (array_key_exists($key, $_SERVER) === true) {\r\r\n foreach (explode(',', $_SERVER[$key]) as $ip) {\r\r\n $ip = trim($ip); // just to be safe\r\r\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\r\r\n return $ip;\r\r\n }\r\r\n }\r\r\n }\r\r\n }\r\r\n }", "public function getIpFromServer()\n {\n $ip = '';\n $ipHolders = [\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ];\n\n foreach ($ipHolders as $key) {\n if (!empty($_SERVER[$key])) {\n $ip = $_SERVER[$key];\n if (strpos($ip, ',') !== false) {\n // Multiple IPs are present so use the last IP which should be\n // the most reliable IP that last connected to the proxy\n $ips = explode(',', $ip);\n $ips = array_map('trim', $ips);\n $ip = end($ips);\n }\n $ip = trim($ip);\n break;\n }\n }\n\n return $ip;\n }", "public function testTrustAnyProxy()\n {\n $clientIp = new ClientIp(['trusted_proxy' => true]);\n \n $this->assertEquals('10.0.0.1', $clientIp($this->request));\n }", "public static function check(): array\n {\n $remoteAddr = \\getenv('REMOTE_ADDR') ?: null;\n $httpVia = \\getenv('HTTP_VIA') ?: null;\n $proxyString = static::getProxyString();\n $ipData = static::$ipData;\n\n if ($remoteAddr !== null) {\n if ($proxyString !== null) {\n $clientIP = static::getFirstIP($proxyString);\n $proxyIP = $remoteAddr;\n $proxyHost = static::getHost($proxyIP);\n\n if ($clientIP !== null) {\n $clientHost = static::getHost($clientIP);\n $ipData['CLIENT_IP'] = $clientIP;\n $ipData['CLIENT_HOST'] = $clientHost;\n $ipData['CLIENT_IP_HOST'] = \\sprintf('%s (%s)', $clientIP, $clientHost);\n }\n $ipData['PROXY_IP'] = $proxyIP;\n $ipData['PROXY_HOST'] = $proxyHost;\n $ipData['PROXY_IP_HOST'] = \\sprintf('%s (%s)', $proxyIP, $proxyHost);\n $ipData['PROXY_STRING'] = $proxyString;\n } elseif ($httpVia !== null) {\n $proxyHost = static::getHost($remoteAddr);\n\n $ipData['PROXY_IP'] = $remoteAddr;\n $ipData['PROXY_HOST'] = $proxyHost;\n $ipData['PROXY_IP_HOST'] = \\sprintf('%s (%s)', $remoteAddr, $proxyHost);\n $ipData['HTTP_VIA'] = $httpVia;\n } else {\n $clientHost = static::getHost($remoteAddr);\n\n $ipData['CLIENT_IP'] = $remoteAddr;\n $ipData['CLIENT_HOST'] = $clientHost;\n $ipData['CLIENT_IP_HOST'] = \\sprintf('%s (%s)', $remoteAddr, $clientHost);\n }\n\n $ipData['FULL_IP_HOST'] = static::getFullIpHost($ipData['CLIENT_IP_HOST'], $ipData['PROXY_IP_HOST']);\n }\n\n return $ipData;\n }", "private function get_ip_address()\n {\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n\n // check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // check if multiple ips exist in var\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if ($this->validate_ip($ip))\n return $ip;\n }\n } else {\n if ($this->validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_X_FORWARDED']))\n return $_SERVER['HTTP_X_FORWARDED'];\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && $this->validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n return $_SERVER['HTTP_FORWARDED_FOR'];\n if (!empty($_SERVER['HTTP_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_FORWARDED']))\n return $_SERVER['HTTP_FORWARDED'];\n\n // return unreliable ip since all else failed\n return $_SERVER['REMOTE_ADDR'];\n }", "public function client_ip(){\n\t\tif(array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)){\n\t\t\treturn $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\t\t}\n\t\telse if(array_key_exists('HTTP_X_CLUSTER_CLIENT_IP', $_SERVER)){\n\t\t\treturn $_SERVER[\"HTTP_X_CLUSTER_CLIENT_IP\"];\n\t\t}\n\t\telse if(array_key_exists('REMOTE_ADDR', $_SERVER)){\n\t\t\treturn $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\n\t\telse if(array_key_exists('HTTP_CLIENT_IP', $_SERVER)){\n\t\t\treturn $_SERVER[\"HTTP_CLIENT_IP\"];\n\t\t}\n\t\treturn '';\n }", "public function getIpAddress()\r\n { \r\n global $config;\r\n static $ipAddress = '';\r\n\r\n if ($ipAddress != '')\r\n {\r\n return $ipAddress;\r\n }\r\n\r\n $proxy_ips = $config['proxy_ips'];\r\n\r\n if ( ! empty($proxy_ips))\r\n {\r\n $proxy_ips = explode(',', str_replace(' ', '', $proxy_ips));\r\n\r\n foreach (array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP') as $header)\r\n {\r\n $spoof = (isset($_SERVER[$header])) ? $_SERVER[$header] : false;\r\n\r\n if ($spoof !== FALSE)\r\n {\r\n // Some proxies typically list the whole chain of IP\r\n // addresses through which the client has reached us.\r\n // e.g. client_ip, proxy_ip1, proxy_ip2, etc.\r\n if (strpos($spoof, ',') !== FALSE)\r\n {\r\n $spoof = explode(',', $spoof, 2);\r\n $spoof = $spoof[0];\r\n }\r\n\r\n if ( ! $this->isValidIp($spoof))\r\n {\r\n $spoof = FALSE;\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n $ipAddress = ($spoof !== FALSE AND in_array($_SERVER['REMOTE_ADDR'], $proxy_ips, true)) ? $spoof : $_SERVER['REMOTE_ADDR'];\r\n }\r\n else\r\n {\r\n $ipAddress = $_SERVER['REMOTE_ADDR'];\r\n }\r\n\r\n if ( ! $this->isValidIp($ipAddress))\r\n {\r\n $ipAddress = '0.0.0.0';\r\n }\r\n\r\n return $ipAddress;\r\n }", "protected function getClientIp()\n {\n return $this->request->getClientIp();\n }", "function get_client_ip()\n\t{\n\t if(!empty($_SERVER['HTTP_CLIENT_IP'])){\n\t //ip from share internet\n\t $ip = $_SERVER['HTTP_CLIENT_IP'];\n\t $device_name = $_SERVER['HTTP_USER_AGENT'];\n\t $hostname = gethostbyaddr($_SERVER[\"REMOTE_ADDR\"]);\n\t }elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n\t //ip pass from proxy\n\t $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t $device_name = $_SERVER['HTTP_USER_AGENT'];\n\t $hostname = gethostbyaddr($_SERVER[\"REMOTE_ADDR\"]);\n\t }else{\n\t $ip = $_SERVER['REMOTE_ADDR'];\n\t $device_name = $_SERVER['HTTP_USER_AGENT'];\n\t $hostname = gethostbyaddr($_SERVER[\"REMOTE_ADDR\"]);\n\t }\n\n\t $data = array('ip' => $ip, 'device_name' => $device_name, 'hostname' => $hostname);\n\t return $data;\n\t}", "public function getClientIp()\n {\n return $this->getParameter('clientIp');\n }", "public function getProxies(): array\n {\n return $this->proxies;\n }", "protected static function getIPAddress()\n {\n if (count(self::$ips) > 0) {\n return self::$ips;\n }\n $output = array();\n exec(\n \"/sbin/ip -4 addr | awk -F'[ /]+' '/global/ {print $3}'\",\n $IPs,\n $retVal\n );\n if (!count($IPs)) {\n exec(\n \"/sbin/ifconfig -a | awk -F'[ /:]+' '/(cast)/ {print $4}'\",\n $IPs,\n $retVal\n );\n }\n $test = self::$FOGURLRequests->isAvailable('http://ipinfo.io/ip');\n $test = array_shift($test);\n if (false !== $test) {\n $res = self::$FOGURLRequests->process('http://ipinfo.io/ip');\n $IPs[] = $res[0];\n }\n natcasesort($IPs);\n $retIPs = function (&$IP) {\n $IP = trim($IP);\n if (!filter_var($IP, FILTER_VALIDATE_IP)) {\n $IP = gethostbyname($IP);\n }\n if (filter_var($IP, FILTER_VALIDATE_IP)) {\n return $IP;\n }\n };\n $retNames = function (&$IP) {\n $IP = trim($IP);\n if (filter_var($IP, FILTER_VALIDATE_IP)) {\n return gethostbyaddr($IP);\n }\n\n return $IP;\n };\n $IPs = array_map($retIPs, (array) $IPs);\n $Names = array_map($retNames, (array) $IPs);\n $output = self::fastmerge(\n $IPs,\n $Names,\n array('127.0.0.1', '127.0.1.1')\n );\n unset($IPs, $Names);\n natcasesort($output);\n self::$ips = array_values(array_filter(array_unique((array) $output)));\n\n return self::$ips;\n }", "public static function getClientIP() {\n return self::$ClientIP;\n }", "function get_ip_address() {\r\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\r\n return $_SERVER['HTTP_CLIENT_IP'];\r\n }\r\n\r\n // check for IPs passing through proxies\r\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n // check if multiple ips exist in var\r\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\r\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\r\n foreach ($iplist as $ip) {\r\n if (validate_ip($ip))\r\n return $ip;\r\n }\r\n } else {\r\n if (validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }\r\n }\r\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && validate_ip($_SERVER['HTTP_X_FORWARDED']))\r\n return $_SERVER['HTTP_X_FORWARDED'];\r\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\r\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\r\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\r\n return $_SERVER['HTTP_FORWARDED_FOR'];\r\n if (!empty($_SERVER['HTTP_FORWARDED']) && validate_ip($_SERVER['HTTP_FORWARDED']))\r\n return $_SERVER['HTTP_FORWARDED'];\r\n\r\n // return unreliable ip since all else failed\r\n return $_SERVER['REMOTE_ADDR'];\r\n}", "public function testTrustAnyProxyForwardedFor()\n {\n $this->request->expects($this->any())->method('getHeaderLine')\n ->willReturnMap([['X-Forwarded-For', '192.168.0.1, 192.168.1.100']]);\n \n $clientIp = new ClientIp(['trusted_proxy' => true]);\n \n $this->assertEquals('192.168.1.100', $clientIp($this->request));\n }", "public static function getProxyIpAddress() {\n $proxyIp = (string)Functions::item($_SERVER, 'HTTP_CLIENT_IP');\n $remoteAddr = filter_input(INPUT_SERVER, 'REMOTE_ADDR');\n \n if (!$proxyIp) {\n $proxyIp = (string)Functions::item($_SERVER, 'HTTP_X_FORWARDED_FOR');\n }\n \n if (!$proxyIp) {\n $proxyIp = (string)Functions::item($_SERVER, 'HTTP_VIA');\n }\n\n return (($proxyIp == $remoteAddr) ? '' : $proxyIp);\n }", "public function testTrustConnectedIp()\n {\n $clientIp = new ClientIp(['trusted_proxy' => '10.0.0.1']);\n \n $this->assertEquals('10.0.0.1', $clientIp($this->request));\n }", "public static function atkGetClientIp()\n {\n static $s_ip = null;\n\n if ($s_ip === null) {\n if (getenv('HTTP_CLIENT_IP')) {\n $s_ip = getenv('HTTP_CLIENT_IP');\n } elseif (getenv('HTTP_X_FORWARDED_FOR')) {\n $ipArray = explode(',', getenv('HTTP_X_FORWARDED_FOR'));\n $s_ip = $ipArray[0];\n } elseif (getenv('REMOTE_ADDR')) {\n $s_ip = getenv('REMOTE_ADDR');\n } else {\n $s_ip = 'x.x.x.x';\n }\n }\n\n return $s_ip;\n }", "private function Obtener_IP_Cliente()\n {\n \tif (!empty($_SERVER['HTTP_CLIENT_IP']))\n return $_SERVER['HTTP_CLIENT_IP'];\n \n \tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n \n \treturn $_SERVER['REMOTE_ADDR'];\n\t}", "private function getClientIp()\n {\n $ipaddress = '';\n\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n } elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n } elseif (isset($_SERVER['REMOTE_ADDR'])) {\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n } else {\n $ipaddress = 'UNKNOWN';\n }\n return $ipaddress;\n }", "function get_client_ip() {\n\t if(isset($_SERVER[\"REMOTE_ADDR\"]) ) {\n\t \t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t } elseif(isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"]) ) {\n\t $ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\t } elseif(isset($_SERVER[\"HTTP_CLIENT_IP\"]) ) {\n\t $ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n\t } else {\n\t \t$ip = \"10.0.0.1\";\n\t }\n\t return $ip;\n\t}", "function get_ip_address() {\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\r\n\t\t\treturn $_SERVER['HTTP_CLIENT_IP'];\r\n\t\t}\r\n\r\n\t\t// check for IPs passing through proxies\r\n\t\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n\t\t\t// check if multiple ips exist in var\r\n\t\t\tif (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\r\n\t\t\t\t$iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\r\n\t\t\t\tforeach ($iplist as $ip) {\r\n\t\t\t\t\tif (validate_ip($ip))\r\n\t\t\t\t\t\treturn $ip;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n\t\t\t\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!empty($_SERVER['HTTP_X_FORWARDED']) && validate_ip($_SERVER['HTTP_X_FORWARDED']))\r\n\t\t\treturn $_SERVER['HTTP_X_FORWARDED'];\r\n\t\tif (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\r\n\t\t\treturn $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\r\n\t\tif (!empty($_SERVER['HTTP_FORWARDED_FOR']) && validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\r\n\t\t\treturn $_SERVER['HTTP_FORWARDED_FOR'];\r\n\t\tif (!empty($_SERVER['HTTP_FORWARDED']) && validate_ip($_SERVER['HTTP_FORWARDED']))\r\n\t\t\treturn $_SERVER['HTTP_FORWARDED'];\r\n\r\n\t\t// return unreliable ip since all else failed\r\n\t\treturn $_SERVER['REMOTE_ADDR'];\r\n\t}", "function ClientIP() {\r\n\treturn getenv('HTTP_CLIENT_IP') ? : getenv('HTTP_X_FORWARDED_FOR') ? :\r\n\t\t getenv('HTTP_X_FORWARDED') ? : getenv('HTTP_FORWARDED_FOR') ? :\r\n\t\t getenv('HTTP_FORWARDED') ? : getenv('REMOTE_ADDR');\r\n}", "function getIP()\n{\n\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t{\n\t\tif (preg_match('/[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(\\.[0-9]{1,3})?(\\.[0-9]{1,3})?/',\n\t\t\t$_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t{\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t$host = gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\t$proxy = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\t}\n\telse\n\t{\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);\n\t\t$proxy = null;\n\t}\n\n\treturn array(\n\t\t'IP' => $ip,\n\t\t'Host' => $host,\n\t\t'Proxy' => $proxy\n\t);\n}", "public static function getClientIP()\n\t{\n\t\tif (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {\n\t\t\treturn $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\t\t} else if (array_key_exists('REMOTE_ADDR', $_SERVER)) {\n\t\t\treturn $_SERVER[\"REMOTE_ADDR\"];\n\t\t} else if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {\n\t\t\treturn $_SERVER[\"HTTP_CLIENT_IP\"];\n\t\t}\n\t\treturn '';\n\t}", "function GetClientIP(){ \n\n\t\t\t\tif ($_SERVER['HTTP_X_FORWARDED_FOR']) { \n\t\t\t\t\t$clientip = $_SERVER['HTTP_X_FORWARDED_FOR']; \n\t\t\t\t} \n\t\t\t\telse { \n\t\t\t\t $clientip = $_SERVER['REMOTE_ADDR']; \n\t\t\t\t} \n\n\t\t\t\treturn $clientip; \n\t\t\t\t}", "public function getClientIp($checkProxy = true)\n {\n if ($checkProxy && $this->getServer('HTTP_CLIENT_IP') != null) {\n $ip = $this->getServer('HTTP_CLIENT_IP');\n } else if ($checkProxy && $this->getServer('HTTP_X_FORWARDED_FOR') != null) {\n $ip = $this->getServer('HTTP_X_FORWARDED_FOR');\n } else {\n $ip = $this->getServer('REMOTE_ADDR');\n }\n return $ip;\n }", "public static function getRealIP()\n {\n $_server = [\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR',\n ];\n foreach ($_server as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP) !== false) {\n return $ip;\n }\n }\n }\n }\n }", "protected function getIpAddress() {\n // check for shared internet/ISP IP\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && $this->validateIp($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n\n // check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // check if multiple ips exist in var\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== FALSE) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if ($this->validateIp($ip)) {\n return $ip;\n }\n }\n }\n else {\n if ($this->validateIp($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && $this->validateIp($_SERVER['HTTP_X_FORWARDED'])) {\n return $_SERVER['HTTP_X_FORWARDED'];\n }\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && $this->validateIp($_SERVER['HTTP_X_CLUSTER_CLIENT_IP'])) {\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n }\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && $this->validateIp($_SERVER['HTTP_FORWARDED_FOR'])) {\n return $_SERVER['HTTP_FORWARDED_FOR'];\n }\n if (!empty($_SERVER['HTTP_FORWARDED']) && $this->validateIp($_SERVER['HTTP_FORWARDED'])) {\n return $_SERVER['HTTP_FORWARDED'];\n }\n\n return $_SERVER['REMOTE_ADDR'];\n }", "public function testTrustConnectedIpClientIp()\n {\n $this->request->expects($this->any())->method('getHeaderLine')\n ->willReturnMap([['Client-Ip', '192.168.0.1']]);\n \n $clientIp = new ClientIp(['trusted_proxy' => '10.0.0.1']);\n \n $this->assertEquals('192.168.0.1', $clientIp($this->request));\n }", "public function getClientIp() \n {\n //PHP获取当前用户IP地址方法\n if (!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n //check ip from share internet\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n {\n //to check ip is pass from proxy\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n }", "function getLocationList($client){\n global $server;\n \n $ret = $this->getLocation($client);\n \n return (!is_array($ret[0])) ? array(0 => $ret) : $ret; \n }", "function get_ip_address() {\n\t if (!empty($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n\t return $_SERVER['HTTP_CLIENT_IP'];\n\t }\n\n\t // check for IPs passing through proxies\n\t if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t // check if multiple ips exist in var\n\t if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n\t $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t foreach ($iplist as $ip) {\n\t if (validate_ip($ip))\n\t return $ip;\n\t }\n\t } else {\n\t if (validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t return $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t }\n\t }\n\t if (!empty($_SERVER['HTTP_X_FORWARDED']) && validate_ip($_SERVER['HTTP_X_FORWARDED']))\n\t return $_SERVER['HTTP_X_FORWARDED'];\n\t if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n\t return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n\t if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n\t return $_SERVER['HTTP_FORWARDED_FOR'];\n\t if (!empty($_SERVER['HTTP_FORWARDED']) && validate_ip($_SERVER['HTTP_FORWARDED']))\n\t return $_SERVER['HTTP_FORWARDED'];\n\n\t // return unreliable ip since all else failed\n\t return $_SERVER['REMOTE_ADDR'];\n\t}", "function get_client_ip() {\n if (!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip_address = $_SERVER['HTTP_CLIENT_IP'];\n }\n //whether ip is from proxy\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n {\n $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n //whether ip is from remote address\n else\n {\n $ip_address = $_SERVER['REMOTE_ADDR'];\n }\n return $ip_address;\n}", "public function getIP()\n {\n\t\t$headerOverrideIP = null;\n\n\t\tif (defined('TRUSTED_PROXY')) {\n\t\t\t$headers = (defined('SS_TRUSTED_PROXY_IP_HEADER')) ?\n array(SS_TRUSTED_PROXY_IP_HEADER) :\n null;\n\n\t\t\tif(!$headers) {\n\t\t\t\t// Backwards compatible defaults\n\t\t\t\t$headers = ['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR'];\n\t\t\t}\n\n\t\t\tforeach($headers as $header) {\n\t\t\t\tif(!empty($_SERVER[$header])) {\n\t\t\t\t\t$headerOverrideIP = $_SERVER[$header];\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n $proxy = Injector::inst()->create(TrustedProxyMiddleware::class);\n\n\t\tif ($headerOverrideIP) {\n\t\t\treturn $proxy->getIPFromHeaderValue($headerOverrideIP);\n\t\t}\n\n if (isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\treturn $_SERVER['REMOTE_ADDR'];\n\t\t}\n\n return '';\n\t}", "public function ipGetAll()\n {\n $url = $this->baseUrl . '/ip';\n\n return $this->get($url);\n }", "function query_client_ip()\n{\n\tglobal $_SERVER;\n\t$clientIP = false;\n\tif(!empty($GLOBALS['sugar_config']['ip_variable']) && !empty($_SERVER[$GLOBALS['sugar_config']['ip_variable']])){\n\t\t$clientIP = $_SERVER[$GLOBALS['sugar_config']['ip_variable']];\n\t}else if(isset($_SERVER['HTTP_CLIENT_IP']))\n\t{\n\t\t$clientIP = $_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telseif(isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches))\n\t{\n\t\t// check for internal ips by looking at the first octet\n\t\tforeach($matches[0] AS $ip)\n\t\t{\n\t\t\tif(!preg_match(\"#^(10|172\\.16|192\\.168)\\.#\", $ip))\n\t\t\t{\n\t\t\t\t$clientIP = $ip;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}\n\telseif(isset($_SERVER['HTTP_FROM']))\n\t{\n\t\t$clientIP = $_SERVER['HTTP_FROM'];\n\t}\n\telse\n\t{\n\t\t$clientIP = $_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $clientIP;\n}" ]
[ "0.82374287", "0.7893105", "0.78603244", "0.73115474", "0.6958128", "0.69097567", "0.69004786", "0.6890746", "0.6748509", "0.67318374", "0.67020684", "0.6700292", "0.6694586", "0.6649395", "0.6552976", "0.65497804", "0.65493196", "0.6547168", "0.65412486", "0.6520425", "0.6510509", "0.65046686", "0.6495691", "0.6485114", "0.64418125", "0.6432326", "0.6432077", "0.64315593", "0.64315593", "0.6430322", "0.6418535", "0.64170986", "0.64079905", "0.6393002", "0.6383333", "0.6377288", "0.6365387", "0.6357911", "0.63511866", "0.6320391", "0.63026285", "0.6300306", "0.6294926", "0.62906057", "0.6288449", "0.6276138", "0.6275293", "0.626726", "0.6243139", "0.6242477", "0.62395364", "0.6230185", "0.6228478", "0.62225294", "0.6222113", "0.62165606", "0.6211644", "0.6178466", "0.61709946", "0.6170206", "0.6169708", "0.6168542", "0.6156168", "0.6155053", "0.61495775", "0.6135082", "0.6134408", "0.6130917", "0.6128636", "0.61239713", "0.6118921", "0.61148435", "0.6101089", "0.6100995", "0.6100755", "0.60928637", "0.6091282", "0.60907555", "0.6087351", "0.60863304", "0.6084896", "0.60681075", "0.6067582", "0.6056607", "0.60528874", "0.6049367", "0.6048977", "0.6047891", "0.604223", "0.6040538", "0.6038797", "0.60382825", "0.60367554", "0.60363555", "0.6033091", "0.6033003", "0.6028585", "0.60257375", "0.60255945", "0.6023566" ]
0.79458004
1
Compares two IPv6 addresses. In case a subnet is given, it checks if it contains the request IP.
Сравнивает два IPv6-адреса. В случае указания подсети проверяет, содержится ли запрашиваемый IP-адрес в ней.
function checkIp6($requestIp, $ip) : bool { if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1'))) { throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".'); } if (false !== strpos($ip, '/')) { list($address, $netmask) = explode('/', $ip, 2); if ($netmask < 1 || $netmask > 128) { return false; } } else { $address = $ip; $netmask = 128; } $bytesAddr = unpack('n*', @inet_pton($address)); $bytesTest = unpack('n*', @inet_pton($requestIp)); if (empty($bytesAddr) || empty($bytesTest)) { return false; } for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) { $left = $netmask - 16 * ($i - 1); $left = ($left <= 16) ? $left : 16; $mask = ~(0xffff >> $left) & 0xffff; if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function cmpIPv6DataProviderMatching() {}", "public static function checkIp6($requestIp, $ip) {}", "private static function checkIp6($requestIp, $ip)\r\n {\r\n if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1'))) {\r\n throw new \\RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option \"disable-ipv6\".');\r\n }\r\n if (false !== strpos($ip, '/')) {\r\n list($address, $netmask) = explode('/', $ip, 2);\r\n if ($netmask < 1 || $netmask > 128) {\r\n return false;\r\n }\r\n } else {\r\n $address = $ip;\r\n $netmask = 128;\r\n }\r\n $bytesAddr = unpack('n*', @inet_pton($address));\r\n $bytesTest = unpack('n*', @inet_pton($requestIp));\r\n if (!$bytesAddr || !$bytesTest) {\r\n return false;\r\n }\r\n for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) {\r\n $left = $netmask - 16 * ($i - 1);\r\n $left = ($left <= 16) ? $left : 16;\r\n $mask = ~(0xffff >> $left) & 0xffff;\r\n if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "function compare_ip_address_ip6($wild,$full_parts)\n{\n\t$wild_parts=explode(':',$wild);\n\tforeach ($wild_parts as $i=>$wild_part)\n\t{\n\t\tif (($wild_part!='*') && ($wild_part!=$full_parts[$i])) return false;\n\t}\n\treturn true;\n}", "public static function cmpIPv6DataProviderNotMatching() {}", "function fw_inIPv6Range( $ip, $subnet ) {\n\t// Set default subnet to 64\n\tif ( !fw_has( $subnet, '/' ) ) {\n\t\t$subnet .= '/64';\n\t}\n\t\n\tlist( $range, $mask ) = \\explode( '/', $subnet, 2 );\n\t$sbit\t= \\inet_pton( $ip );\n\t\n\treturn \n\t( $sbit & fw_IPv6Array( $mask ) ) == \\inet_pton( $range );\n}", "public function ip6test()\n {\n if (filter_var($this->ipinput, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n return true;\n }\n return false;\n }", "static public function IsIPv6AddressWithinSubnet($ipOnly, $ipAndCidrSuper)\n {\n\n return static::IsIPv6SubnetWithinSupernet(\"{$ipOnly}/128\", $ipAndCidrSuper);\n\n }", "function is_ipv6_valid($ipv6_address, $ipv6_prefixlen = NULL)\n{\n if (str_contains($ipv6_address, '/'))\n {\n list($ipv6_address, $ipv6_prefixlen) = explode('/', $ipv6_address);\n }\n $ip_full = $ipv6_address . '/' . $ipv6_prefixlen;\n\n // False if invalid IPv6 syntax\n if (strlen($ipv6_prefixlen) &&\n !preg_match('%^'.OBS_PATTERN_IPV6_NET.'$%i', $ip_full))\n {\n // Address with prefix\n return FALSE;\n }\n else if (!preg_match('%^'.OBS_PATTERN_IPV6.'$%i', $ipv6_address))\n {\n // Address withot prefix\n return FALSE;\n }\n\n $ipv6_type = get_ip_type($ip_full);\n\n // False if link-local, unspecified or any used defined\n if (in_array($ipv6_type, $GLOBALS['config']['ip-address']['ignore_type']))\n {\n return FALSE;\n }\n\n return TRUE;\n}", "public function isIp6()\r\n {\r\n return strlen($this->binIp) == 16;\r\n }", "static public function IsIPv6SubnetWithinSupernet($ipAndCidrSub, $ipAndCidrSuper)\n {\n\n $ipAndCidrSubMin = static::ConvertIPv6ToBinary(\n static::GetIPv6NetworkAddress($ipAndCidrSub)\n );\n\n $ipAndCidrSubMax = static::ConvertIPv6ToBinary(\n static::GetIPv6BroadcastAddress($ipAndCidrSub)\n );\n\n $ipAndCidrSuperMin = static::ConvertIPv6ToBinary(\n static::GetIPv6NetworkAddress($ipAndCidrSuper)\n );\n\n $ipAndCidrSuperMax = static::ConvertIPv6ToBinary(\n static::GetIPv6BroadcastAddress($ipAndCidrSuper)\n );\n\n if ($ipAndCidrSuperMin <= $ipAndCidrSubMin && $ipAndCidrSuperMax >= $ipAndCidrSubMax) {\n\n return true;\n\n }\n\n return false;\n\n }", "public static function check_ipv6($ip)\n {\n }", "public static function check_ipv6($ip)\n {\n }", "private static function matchCIDRv6(string $ip, string $net, int $mask) : bool\n {\n // Pack the IP and Net addresses\n $ip = inet_pton($ip);\n $net = inet_pton($net);\n\n // Convert the mask to a byte array\n $mask = self::maskToByteArray($mask);\n\n // Compare them\n return ($ip & $mask) === $net;\n }", "public function testSupportsIpv6()\n {\n if (!defined('AF_INET6')) {\n $this->markTestSkipped('This system does not seem to support IPv6 sockets / addressing');\n }\n }", "function fw_inSubnet( $ip, $subnet ) {\n\t\n\t// If this is an IPv6 address\n\tif ( \\filter_var( \n\t\t$ip, \\FILTER_VALIDATE_IP, \\FILTER_FLAG_IPV6 \n\t) ) {\n\t\tforeach ( $subnet as $net ) {\n\t\t\t// Skip searching IPv4 addresses\n\t\t\tif ( !fw_has( $net, ':' ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( fw_inIPv6Range( $ip, $net ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t// This is an IPv4 address\n\t} else {\n\t\tforeach ( $subnet as $net ) {\n\t\t\t// Skip searching IPv6 addresses\n\t\t\tif ( fw_has( $net, ':' ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif ( fw_inIPv4Range( $ip, $net ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn false;\n}", "public static function ipv6($value) {\n\t\treturn (bool) filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n\t}", "public function isIpv6($value)\n {\n return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false;\n }", "public function inSubnet($subnet) {\n $net= $subnet instanceof Network ? $subnet : new Network($subnet);\n if (!$net->getAddress() instanceof self) return false;\n\n $addr= $net->getAddress();\n $mask= $net->getNetmask();\n $position= 0;\n while ($mask > 8) {\n if ($addr->addr[$position] !== $this->addr[$position]) return false;\n $position++;\n $mask-= 8;\n }\n\n return $mask > 0\n ? ord($addr->addr[$position]) >> (8 - $mask) === ord($this->addr[$position]) >> (8 - $mask)\n : true\n ;\n }", "function generaripv6($mysql_conn, $dominiointroducido, $ipintroducida, $usernameipv6){\n\t$a_Prefix = $ipintroducida;\n\t// Validate input superficially with a RegExp and split accordingly\n if(!preg_match('~^([0-9a-f:]+)[[:punct:]]([0-9]+)$~i', trim($a_Prefix), $v_Slices)){\n\t\treturn false;\n }\n // Make sure we have a valid ipv6 address\n if(!filter_var($v_FirstAddress = $v_Slices[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){\n return false;\n }\n // The /## end of the range\n $v_PrefixLength = intval($v_Slices[2]);\n if($v_PrefixLength > 128){\n return false; // kind'a stupid :)\n }\n $v_SuffixLength = 128 - $v_PrefixLength;\n\n // Convert the binary string to a hexadecimal string\n $v_FirstAddressBin = inet_pton($v_FirstAddress);\n $v_FirstAddressHex = bin2hex($v_FirstAddressBin);\n\n // Build the hexadecimal string of the network mask\n // (if the manually formed binary is too large, base_convert() chokes on it... so we split it up)\n $v_NetworkMaskHex = str_repeat('1', $v_PrefixLength) . str_repeat('0', $v_SuffixLength);\n $v_NetworkMaskHex_parts = str_split($v_NetworkMaskHex, 8);\n foreach($v_NetworkMaskHex_parts as &$v_NetworkMaskHex_part){\n $v_NetworkMaskHex_part = base_convert($v_NetworkMaskHex_part, 2, 16);\n $v_NetworkMaskHex_part = str_pad($v_NetworkMaskHex_part, 2, '0', STR_PAD_LEFT);\n }\n $v_NetworkMaskHex = implode(null, $v_NetworkMaskHex_parts);\n unset($v_NetworkMaskHex_part, $v_NetworkMaskHex_parts);\n $v_NetworkMaskBin = inet_pton(implode(':', str_split($v_NetworkMaskHex, 4)));\n\n // We have the network mask so we also apply it to First Address\n $v_FirstAddressBin &= $v_NetworkMaskBin;\n $v_FirstAddressHex = bin2hex($v_FirstAddressBin);\n\n // Convert the last address in hexadecimal\n $v_LastAddressBin = $v_FirstAddressBin | ~$v_NetworkMaskBin;\n $v_LastAddressHex = bin2hex($v_LastAddressBin);\n\n // Return a neat object with information\n $v_Return = array(\n 'Prefix' => \"{$v_FirstAddress}/{$v_PrefixLength}\",\n 'FirstHex' => $v_FirstAddressHex,\n 'LastHex' => $v_LastAddressHex,\n 'MaskHex' => $v_NetworkMaskHex,\n );\n //return (object)$v_Return;\n\t\n\t$primeraipv6 = implode(':', str_split($v_FirstAddressHex, 4));\n\t$ultimaipv6 = implode(':', str_split($v_LastAddressHex, 4));\n\n\t$IpStart_v6_FromDb = $primeraipv6;\n\t$IpEnd_v6_FromDb = $ultimaipv6;\n\n\t$ip1 = $IpStart_v6_FromDb;\n\t$ip2 = $IpEnd_v6_FromDb;\n\tif ($ip1 === null || $ip2 === null) {\n\t\tdie;\n\t}\n\t// length is 39 to account for 7 colons\n\tfor ($i = 0; $i < 39 && $ip1[$i] === $ip2[$i]; $i++);\n\n\t$ipv6_prefix = substr($ip1, 0, $i);\n\t$ipv6_start = hexdec(substr($ip1, $i));\n\t$ipv6_end = hexdec(substr($ip2, $i));\n\n\tif (strlen($ipv6_prefix) < 26) {\n\t\t// adjust this to requirements to prevent too large ranges\n\t\tdie;\n\t}\n\tfor ($a = $ipv6_start; $a <= $ipv6_end; $a++) {\n $hex = dechex($a);\n\t$ipv6shell = $ipv6_prefix.$hex;\n\t\n\t$ipv6sinpuntos = bin2hex(inet_pton($ipv6shell));\n\t$ipv6extconpuntos = implode(':', str_split($ipv6sinpuntos, 4));\n\t\n\t//Consultamos si esta o no en la base de datos, si no esta se añade al dominio y se para la consulta\n\t$consultasihayipv6domain= mysqli_query($mysql_conn,\"SELECT * FROM ipv6_domain WHERE ipv6='$ipv6extconpuntos'\"); \n\tif(mysqli_num_rows($consultasihayipv6domain)!=0) \n\t{\n\t\t//\"Hay\";\n\t}else{\n\t\t//\"No hay\";\n\t\t\n\t\t//Insertar en la base de datos, dominio + ipv6 asignada\n\t\t//Todo parece correcto procedemos con la inserccion de la ipv6\n\t\t$query = \"INSERT INTO ipv6_domain (username, domain, ipv6) VALUES('\".mysqli_real_escape_string($mysql_conn,$usernameipv6).\"','\".mysqli_real_escape_string($mysql_conn,$dominiointroducido).\"','\".mysqli_real_escape_string($mysql_conn,$ipv6extconpuntos).\"')\"; \n\t\t$registro=mysqli_query($mysql_conn,$query) or die(mysqli_error());\n\t\t\n\t\t//Insertamos linea en archivo de configuracion Sn SSL\n\t\tescribirconf($dominiointroducido, $ipv6extconpuntos, \"no\");\n\t\tescribirconf($dominiointroducido, $ipv6extconpuntos, \"ssl\");\n\t\t\n\t\t//Insertamos comando en SSH.\n\t\tshell_exec(\"/sbin/ip -6 addr add \".$ipv6extconpuntos.\" dev eth0\");\n\t\t\n\t\t//Agregamos registro DNS al archivo\n\t\tescribirdns($dominiointroducido, $ipv6extconpuntos);\n\t\t\n\t\t//Reiniciamos NGINX\n\t\tshell_exec(\"service nginx restart\");\n\n\t\tbreak;\n\t}\n\t}\n}", "function is_ipv6($ip) {\n\tif (!preg_match(\"/^([0-9a-f\\.\\/:]+)$/\",strtolower($ip))) { return false; }\n\tif (substr_count($ip,\":\") < 2) { return false; }\n\t$part = preg_split(\"/[:\\/]/\",$ip);\n\tforeach ($part as $i) { if (strlen($i) > 4) { return false; } }\n\treturn true;\n}", "function validateIPv6($IP) \n{\n if (strlen($IP) < 3) \n return $IP == '::'; \n\n // Check if part is in IPv4 format \n if (strpos($IP, '.')) \n { \n $lastcolon = strrpos($IP, ':'); \n if (!($lastcolon && validateIPv4(substr($IP, $lastcolon + 1)))) \n return false; \n\n // replace IPv4 part with dummy \n $IP = substr($IP, 0, $lastcolon) . ':0:0'; \n } \n\n // check uncompressed \n if (strpos($IP, '::') === false) \n { \n return preg_match('/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i', $IP); \n } \n\n // check colon-count for compressed format \n if (substr_count($IP, ':') < 8) \n { \n return preg_match('/^(?::|(?:[a-f0-9]{1,4}:)+):(?:(?:[a-f0-9]{1,4}:)*[a-f0-9]{1,4})?$/i', $IP); \n } \n\n return false; \n}", "public function v6networkAddresses($expected, $cidr)\n {\n $ip = new IP('2001:db8::a60:8a2e:370:7334');\n $this->assertSame($expected, $ip->getNetworkIp($cidr)->getShortAddress());\n }", "public static function IPv6Hex2BinDataProviderCorrect() {}", "private function ipv6(string $value): bool\n {\n return $this->ip($value, FILTER_FLAG_IPV6);\n }", "public static function normalizeCompressIPv6DataProviderCorrect() {}", "function rr_validate_ip6(&$errors, &$ip)\n{\n\t/* List of valid characters for an IPv6 address */\n\t$valid_chars = \"ABCDEFabcdef1234567890:\";\n\n\t/* Make sure all characters are valid */\n\tif (strspn($ip, $valid_chars) != strlen($ip))\n\t{\n\t\t$errors[] = \"Format of IPv6 address (in resource record data) is invalid.\";\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "public static function IPv6Bin2HexDataProviderCorrect() {}", "protected function isIpv6Host(string $ipv6): bool\n {\n if ('][' !== substr($ipv6.$ipv6, strlen($ipv6) - 1, 2)) {\n return false;\n }\n\n $ipv6 = substr($ipv6, 1, -1);\n if (false === ($pos = strpos($ipv6, '%'))) {\n return (bool) filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n }\n\n $scope = rawurldecode(substr($ipv6, $pos));\n if (strlen($scope) !== strcspn($scope, '?#@[]')) {\n return false;\n }\n\n $ipv6 = substr($ipv6, 0, $pos);\n if (!filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n return false;\n }\n\n $reducer = function (string $carry, string $char): string {\n return $carry.str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);\n };\n\n $res = array_reduce(str_split(unpack('A16', inet_pton($ipv6))[1]), $reducer, '');\n\n return substr($res, 0, 10) === self::LOCAL_LINK_PREFIX;\n }", "static public function ipv6_cidr2network($ip, $cidr)\n {\n #list($addr_given_str, $prefixlen) = explode('/', $prefix);\n\n // Parse the address into a binary string\n $addr_given_bin = inet_pton($ip);\n\n // Convert the binary string to a string with hexadecimal characters\n $addr_given_hex = bin2hex($addr_given_bin);\n\n // Overwriting first address string to make sure notation is optimal\n $ip = inet_ntop($addr_given_bin);\n\n // Calculate the number of 'flexible' bits\n $flexbits = 128 - $cidr;\n\n // Build the hexadecimal strings of the first and last addresses\n $addr_hex_first = $addr_given_hex;\n $addr_hex_last = $addr_given_hex;\n\n // We start at the end of the string (which is always 32 characters long)\n $pos = 31;\n while ($flexbits > 0) {\n // Get the characters at this position\n $orig_first = substr($addr_hex_first, $pos, 1);\n $orig_last = substr($addr_hex_last, $pos, 1);\n\n // Convert them to an integer\n $origval_first = hexdec($orig_first);\n $origval_last = hexdec($orig_last);\n\n // First address: calculate the subnet mask. min() prevents the comparison from being negative\n $mask = 0xf << (min(4, $flexbits));\n\n // AND the original against its mask\n $new_val_first = $origval_first & $mask;\n\n // Last address: OR it with (2^flexbits)-1, with flexbits limited to 4 at a time\n $new_val_last = $origval_last | (pow(2, min(4, $flexbits)) - 1);\n\n // Convert them back to hexadecimal characters\n $new_first = dechex($new_val_first);\n $new_last = dechex($new_val_last);\n\n // And put those character back in their strings\n $addr_hex_first = substr_replace($addr_hex_first, $new_first, $pos, 1);\n $addr_hex_last = substr_replace($addr_hex_last, $new_last, $pos, 1);\n\n // We processed one nibble, move to previous position\n $flexbits -= 4;\n $pos -= 1;\n }\n\n // Convert the hexadecimal strings to a binary string\n $addr_bin_first = hex2bin($addr_hex_first);\n $addr_bin_last = hex2bin($addr_hex_last);\n\n // And create an IPv6 address from the binary string\n $addr_str_first = inet_ntop($addr_bin_first);\n $addr_str_last = inet_ntop($addr_bin_last);\n\n return $addr_str_first;\n }", "private function __validate_subnet() {\n if (isset($this->initial_data['subnet'])) {\n // If a single IPv4 or IPv6, append the subnet mask for one address\n if (is_ipaddrv4($this->initial_data['subnet'])) {\n $this->initial_data['subnet'] = $this->initial_data['subnet'].\"/32\";\n } elseif (is_ipaddrv6($this->initial_data['subnet'])) {\n $this->initial_data['subnet'] = $this->initial_data['subnet'].\"/128\";\n }\n # Check that we now have a valid subnet CIDR\n if (is_subnet($this->initial_data['subnet'])) {\n $subnet_split = explode(\"/\", $this->initial_data['subnet']);\n # Check that our subnet is not used elsewhere\n if (APITools\\is_ip_in_use($subnet_split[0])) {\n $this->errors[] = APIResponse\\get(4026);\n } else {\n $this->validated_data[\"subnet\"] = $subnet_split[0];\n $this->validated_data[\"subnet_bits\"] = $subnet_split[1];\n\n # Set virtual IP type to network/single based on subnet and subnet_bits\n if (is_ipaddrv4($this->validated_data[\"subnet\"]) && $this->validated_data[\"subnet_bits\"] == 32) {\n $this->validated_data[\"type\"] = \"single\";\n } elseif (is_ipaddrv6($this->validated_data[\"subnet\"]) && $this->validated_data[\"subnet_bits\"] == 128) {\n $this->validated_data[\"type\"] = \"single\";\n } else {\n $this->validated_data[\"type\"] = \"network\";\n }\n }\n } else {\n $this->errors[] = APIResponse\\get(4025);\n }\n } else {\n $this->errors[] = APIResponse\\get(4021);\n }\n }", "public function v6broadcastAddresses($expected, $cidr)\n {\n $ip = new IP('2001:db8::a60:8a2e:370:7334');\n $this->assertSame($expected, $ip->getBroadcastIp($cidr)->getShortAddress());\n }", "public function test($input)\n\t{\n\t\tif(!$input)\n\t\t{\n\t\t\t$this->error = \"No valid IPv4 address supplied.\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(filter_var($input, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false)\n\t\t{\n\t\t\t$this->error = \"The IPv4 address supplied is invalid.\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function ipv6_addr() {\n\t\treturn false;\n\t}", "static public function GetIPv6NetworkAddress($ipAndCidr)\n {\n\n $ipAndCidr = static::ConvertIPv6CIDRToBinary($ipAndCidr);\n\n return static::ConvertBinaryToIPv6($ipAndCidr['ip'] & $ipAndCidr['subnetMask']);\n\n }", "protected function validateIpv6($field, $value)\n {\n return filter_var($value, \\FILTER_VALIDATE_IP, \\FILTER_FLAG_IPV6) !== false;\n }", "function anonimizeIpv6(string $ip):string\n{\n if (strrpos($ip, \":\") > 0) {\n return substr($ip, 0, strrpos($ip, \":\") + 1) . '0';\n }\n return '0.0.0.0';\n}", "function generarprimeraipv6delrango ($mysql_conn,$ipv6, $rango){\n\t//Generamos la primera ipv6 del rango y la añadimos a la bd\n$a_Prefix = $ipv6.\"/\".$rango;\n // Validate input superficially with a RegExp and split accordingly\n if(!preg_match('~^([0-9a-f:]+)[[:punct:]]([0-9]+)$~i', trim($a_Prefix), $v_Slices)){\n\t\treturn false;\n }\n // Make sure we have a valid ipv6 address\n if(!filter_var($v_FirstAddress = $v_Slices[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){\n return false;\n }\n // The /## end of the range\n $v_PrefixLength = intval($v_Slices[2]);\n if($v_PrefixLength > 128){\n return false; // kind'a stupid :)\n }\n $v_SuffixLength = 128 - $v_PrefixLength;\n\n // Convert the binary string to a hexadecimal string\n $v_FirstAddressBin = inet_pton($v_FirstAddress);\n $v_FirstAddressHex = bin2hex($v_FirstAddressBin);\n\n // Build the hexadecimal string of the network mask\n // (if the manually formed binary is too large, base_convert() chokes on it... so we split it up)\n $v_NetworkMaskHex = str_repeat('1', $v_PrefixLength) . str_repeat('0', $v_SuffixLength);\n $v_NetworkMaskHex_parts = str_split($v_NetworkMaskHex, 8);\n foreach($v_NetworkMaskHex_parts as &$v_NetworkMaskHex_part){\n $v_NetworkMaskHex_part = base_convert($v_NetworkMaskHex_part, 2, 16);\n $v_NetworkMaskHex_part = str_pad($v_NetworkMaskHex_part, 2, '0', STR_PAD_LEFT);\n }\n $v_NetworkMaskHex = implode(null, $v_NetworkMaskHex_parts);\n unset($v_NetworkMaskHex_part, $v_NetworkMaskHex_parts);\n $v_NetworkMaskBin = inet_pton(implode(':', str_split($v_NetworkMaskHex, 4)));\n\n // We have the network mask so we also apply it to First Address\n $v_FirstAddressBin &= $v_NetworkMaskBin;\n $v_FirstAddressHex = bin2hex($v_FirstAddressBin);\n\n // Convert the last address in hexadecimal\n $v_LastAddressBin = $v_FirstAddressBin | ~$v_NetworkMaskBin;\n $v_LastAddressHex = bin2hex($v_LastAddressBin);\n\n // Return a neat object with information\n $v_Return = array(\n 'Prefix' => \"{$v_FirstAddress}/{$v_PrefixLength}\",\n 'FirstHex' => $v_FirstAddressHex,\n 'LastHex' => $v_LastAddressHex,\n 'MaskHex' => $v_NetworkMaskHex,\n );\n //return (object)$v_Return;*/\n\n//echo \"v_FirstAddressHex: \".implode(':', str_split($v_FirstAddressHex, 4)).\"</br>\";\n$primeraipv6 = implode(':', str_split($v_FirstAddressHex, 4));\n//echo \"v_LastAddressHex: \".implode(':', str_split($v_LastAddressHex, 4)).\"</br>\";\n//var_dump($v_Return);\n\n$IpStart_v6_FromDb = $primeraipv6;\n\t\n\t//echo \"Primera ip del rango es: \".$IpStart_v6_FromDb.\"</br>\";\n////****** FIN Codigo para generar las IPv6 *******/////\n\t\n//Todo parece correcto procedemos con la inserccion de la ipv6\n$query = \"INSERT INTO ipv6 (ipv6, ipv6range) VALUES('\".mysqli_real_escape_string($mysql_conn,$IpStart_v6_FromDb).\"','\".mysqli_real_escape_string($mysql_conn,$rango).\"')\"; \n$registro=mysqli_query($mysql_conn,$query) or die(mysqli_error());\n \necho \"<b> Se ha agregado la IP \".$IpStart_v6_FromDb.\"/\".$rango.\" correctamente.</b></br>\";\n}", "static public function IsIPv4SubnetWithinSupernet($ipAndCidrSub, $ipAndCidrSuper)\n {\n\n $ipAndCidrSubMin = static::ConvertIPv4ToDecimal(\n static::GetIPv4NetworkAddress($ipAndCidrSub)\n );\n\n $ipAndCidrSubMax = static::ConvertIPv4ToDecimal(\n static::GetIPv4BroadcastAddress($ipAndCidrSub)\n );\n\n $ipAndCidrSuperMin = static::ConvertIPv4ToDecimal(\n static::GetIPv4NetworkAddress($ipAndCidrSuper)\n );\n\n $ipAndCidrSuperMax = static::ConvertIPv4ToDecimal(\n static::GetIPv4BroadcastAddress($ipAndCidrSuper)\n );\n\n if ($ipAndCidrSuperMin <= $ipAndCidrSubMin && $ipAndCidrSuperMax >= $ipAndCidrSubMax) {\n return true;\n }\n\n return false;\n\n }", "public static function is_ipv6($s)\n {\n return is_int(strpos($s, \":\"));\n }", "static public function GetIPv6BroadcastAddress($ipAndCidr)\n {\n\n $ipAndCidr = static::ConvertIPv6CIDRToBinary($ipAndCidr);\n\n return static::ConvertBinaryToIPv6($ipAndCidr['ip'] | ~$ipAndCidr['subnetMask']);\n\n }", "function checkIp($requestIp, $ips) : bool\n{\n if (empty($ips)) {\n return false;\n }\n if (!is_array($ips)) {\n $ips = array($ips);\n }\n $method = substr_count($requestIp, ':') > 1 ? 'checkIp6' : 'checkIp4';\n foreach ($ips as $ip) {\n if ($method($requestIp, $ip)) {\n return true;\n }\n }\n return false;\n}", "public static function isIpV6Address($value): void\n {\n assert(\n Validate::isIpV6Address($value),\n static::error('isIpV6Address', ['value' => $value])\n );\n }", "protected static function _populateIp() {\n if (!isset(self::$_pattern['IPv6'])) {\n $pattern = '((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}';\n $pattern .= '(:|((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})';\n $pattern .= '|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})';\n $pattern .= '(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)';\n $pattern .= '{4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2}))';\n $pattern .= '{3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}';\n $pattern .= '((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|';\n $pattern .= '((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}';\n $pattern .= '((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2}))';\n $pattern .= '{3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4})';\n $pattern .= '{0,4}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)';\n $pattern .= '|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]';\n $pattern .= '\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4})';\n $pattern .= '{1,2})))|(((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})))(%.+)?';\n\n self::$_pattern['IPv6'] = $pattern;\n }\n if (!isset(self::$_pattern['IPv4'])) {\n $pattern = '(?:(?:25[0-5]|2[0-4][0-9]|(?:(?:1[0-9])?|[1-9]?)[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|(?:(?:1[0-9])?|[1-9]?)[0-9])';\n self::$_pattern['IPv4'] = $pattern;\n }\n }", "protected function isValidV6($value)\n {\n if (!preg_match('/^[0-9a-fA-F]{0,4}(:[0-9a-fA-F]{0,4}){1,5}((:[0-9a-fA-F]{0,4}){1,2}|:([\\d\\.]+))$/', $value, $matches)) {\n return false;\n }\n\n // allow V4 addresses mapped to V6\n if (isset($matches[4]) && !$this->isValidV4($matches[4])) {\n return false;\n }\n\n // \"::\" is only allowed once per address\n if (($offset = strpos($value, '::')) !== false) {\n if (strpos($value, '::', $offset + 1) !== false) {\n return false;\n }\n }\n\n return true;\n }", "function match_ip($network, $ip)\n{\n $iplong = ip2long($ip);\n $cidr = explode(\"/\", $network);\n $netiplong = ip2long($cidr[0]);\n if ( count($cidr) == 2 ) {\n $iplong = $iplong & ( 0xffffffff << 32 - $cidr[1] );\n $netiplong = $netiplong & ( 0xffffffff << 32 - $cidr[1] );\n }\n if ($iplong == $netiplong) {\n return true;\n } \n return false;\n}", "function iPv4To6($ip)\n{\n if(isNullOrEmpty($ip)){\n return '';\n }\n\n static $Mask = '::ffff:'; // This tells IPv6 it has an IPv4 address\n $IPv6 = (strpos($ip, '::') === 0);\n $IPv4 = (strpos($ip, '.') > 0);\n\n if (!$IPv4 && !$IPv6) {\n return false;\n }\n if ($IPv6 && $IPv4) {\n // Strip IPv4 Compatibility notation\n $ip = substr($ip, strrpos($ip, ':') + 1);\n } elseif (!$IPv4) {\n // Seems to be IPv6 already?\n return $ip;\n }\n $ip = array_pad(explode('.', $ip), 4, 0);\n if (count($ip) > 4) {\n return false;\n }\n for ($i = 0; $i < 4; $i++) {\n if ($ip[$i] > 255) {\n return false;\n }\n }\n\n $Part7 = base_convert(($ip[0] * 256) + $ip[1], 10, 16);\n $Part8 = base_convert(($ip[2] * 256) + $ip[3], 10, 16);\n return $Mask . $Part7 . ':' . $Part8;\n}", "function ip2long6($ipv6) {\r $ip_n = inet_pton($ipv6);\r $bits = 15; // 16 x 8 bit = 128bit\r while ($bits >= 0) {\r $bin = sprintf(\"%08b\",(ord($ip_n[$bits])));\r $ipv6long = $bin.$ipv6long;\r $bits--;\r }\r return gmp_strval(gmp_init($ipv6long,2),10);\r}", "function validate_subnet($subnet) {\n\t\t\tif (preg_match(\"/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}\\/(?:3[0-2]|[1-2]\\d|\\d)$/\", $subnet))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "function allowedipscmp($a, $b) {\n\treturn strcmp($a['ip'], $b['ip']);\n}", "public function testGetSubnet() {\n\t\t$this->assertFalse ( $this->_ipv4->getSubnet ( null, null ) );\n\t\t$ip = \"192.168.0.1\";\n\t\t$netmask = \"255.255.255.255\";\n\t\t$this->assertEquals ( \"192.168.0.1\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t\t$this->_ipv4 = new Company_Net_IPv4 ();\n\t\t$ip = \"192.168.0.43\";\n\t\t$netmask = \"255.255.255.0\";\n\t\t$this->assertEquals ( \"192.168.0.0\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t\t$this->_ipv4 = new Company_Net_IPv4 ();\n\t\t$ip = \"192.168.0.43\";\n\t\t$netmask = \"255.255.255.128\";\n\t\t$this->assertEquals ( \"192.168.0.0\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t\t$this->_ipv4 = new Company_Net_IPv4 ();\n\t\t$ip = \"192.168.0.43\";\n\t\t$netmask = \"255.255.255.192\";\n\t\t$this->assertEquals ( \"192.168.0.0\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t\t$this->_ipv4 = new Company_Net_IPv4 ();\n\t\t$ip = \"192.168.0.43\";\n\t\t$netmask = \"255.255.255.224\";\n\t\t$this->assertEquals ( \"192.168.0.32\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t\t$this->_ipv4 = new Company_Net_IPv4 ();\n\t\t$ip = \"192.168.0.43\";\n\t\t$netmask = \"255.255.255.240\";\n\t\t$this->assertEquals ( \"192.168.0.32\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t\t$this->_ipv4 = new Company_Net_IPv4 ();\n\t\t$ip = \"192.168.0.43\";\n\t\t$netmask = \"255.255.255.248\";\n\t\t$this->assertEquals ( \"192.168.0.40\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t\t$this->_ipv4 = new Company_Net_IPv4 ();\n\t\t$ip = \"192.168.0.43\";\n\t\t$netmask = \"255.255.255.252\";\n\t\t$this->assertEquals ( \"192.168.0.40\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t\t$this->_ipv4 = new Company_Net_IPv4 ();\n\t\t$ip = \"192.168.0.43\";\n\t\t$netmask = \"255.255.255.254\";\n\t\t$this->assertEquals ( \"192.168.0.42\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t\t$this->_ipv4 = new Company_Net_IPv4 ();\n\t\t$ip = \"192.168.0.43\";\n\t\t$netmask = \"255.255.255.255\";\n\t\t$this->assertEquals ( \"192.168.0.43\", $this->_ipv4->getSubnet ( $ip, $netmask ) );\n\t}", "private function __validate_maskbitsv6() {\n if (in_array($this->validated_data[\"mask\"], [\"srcaddress\", \"dstaddress\"])) {\n # Check for our optional `maskbitsv6` payload value\n if (isset($this->initial_data[\"maskbitsv6\"])) {\n # Require input to be numeric\n if (is_numeric($this->initial_data[\"maskbitsv6\"])) {\n $bitmask = intval($this->initial_data[\"maskbitsv6\"]);\n\n # Require input to be between 1 and 128\n if ($bitmask >= 1 and $bitmask <= 128) {\n $this->validated_data[\"maskbitsv6\"] = $bitmask;\n } else {\n $this->errors[] = APIResponse\\get(4173);\n }\n } else {\n $this->errors[] = APIResponse\\get(4173);\n }\n } else {\n $this->validated_data[\"maskbitsv6\"] = 128;\n }\n }\n }", "protected function _ipv6(Result $result): bool\n {\n return $result->filterValue(FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n }", "public static function applyNetmask($netmask) {\n // We do not support IPv6 yet\n if (self::$IsIPv6) return false;\n \n // Determine mask length\n $netmask_parts = explode('/', $netmask);\n if (count($netmask_parts) > 2) return false;\n if (count($netmask_parts) < 1) return false;\n // Only one part, so we are dealing with a host here\n if (count($netmask_parts) == 1) $netmask_parts[1] = 32;\n \n // Now we detect the length of the netmask\n if (strpos($netmask_parts[1],'.') === true) {\n // Dot notation\n $netmask_parts[1] = strspn(sprintf(\"%032b\", ip2long($netmask_parts[1])),\"1\");\n }\n \n if ($netmask_parts[1] > 0 && $netmask_parts[1] < 33) {\n // Thanks to jwadhams1 @ php.net ip2long documentation\n $client_ip_bin = sprintf(\"%032b\",ip2long(self::$ClientIP));\n $net_ip_bin = sprintf(\"%032b\",ip2long($netmask_parts[0])); \n return (substr_compare($client_ip_bin,$net_ip_bin,0,$netmask_parts[1]) === 0); \n } else {\n return false;\n }\n }", "static public function NormalizeIPv6Address($ipv6)\n {\n\n if (strpos($ipv6, \"::\") === false && substr_count($ipv6, \":\") !== 7) {\n throw new \\Exception(\"Invalid IPv6 address\");\n }\n\n if (strpos($ipv6, \"::\") !== false) {\n\n $padding = \":\";\n\n $paddingRequired = 9 - substr_count($ipv6, \":\");\n\n while (substr_count($padding, \":\") < $paddingRequired) {\n\n $padding .= \"0000:\";\n\n }\n\n $ipv6 = str_replace(\"::\", $padding, $ipv6);\n }\n\n $ipv6 = explode(\":\", $ipv6);\n\n foreach ($ipv6 as &$field) {\n\n while (strlen($field) < 4) {\n\n $field = \"0{$field}\";\n\n }\n\n }\n\n return implode(\":\", $ipv6);\n\n }", "function match_network($ip, $nets, $first = FALSE)\n{\n $return = FALSE;\n $ip_version = get_ip_version($ip);\n if ($ip_version)\n {\n if (!is_array($nets)) { $nets = array($nets); }\n foreach ($nets as $net)\n {\n $ip_in_net = FALSE;\n\n $revert = (preg_match('/^\\!/', $net) ? TRUE : FALSE); // NOT match network\n if ($revert)\n {\n $net = preg_replace('/^\\!/', '', $net);\n }\n\n if ($ip_version == 4)\n {\n if (strpos($net, '.') === FALSE) { continue; } // NOT IPv4 net, skip\n if (strpos($net, '/') === FALSE) { $net .= '/32'; } // NET without mask as single IP\n $ip_in_net = Net_IPv4::ipInNetwork($ip, $net);\n } else {\n //print_vars($ip); echo(' '); print_vars($net); echo(PHP_EOL);\n if (strpos($net, ':') === FALSE) { continue; } // NOT IPv6 net, skip\n if (strpos($net, '/') === FALSE) { $net .= '/128'; } // NET without mask as single IP\n $ip_in_net = Net_IPv6::isInNetmask($ip, $net);\n }\n\n if ($revert && $ip_in_net) { return FALSE; } // Return FALSE if IP found in network where should NOT match\n if ($first && $ip_in_net) { return TRUE; } // Return TRUE if IP found in first match\n $return = $return || $ip_in_net;\n }\n }\n\n return $return;\n}", "public function validNetworkAddresses6()\n {\n return array(\n array('2000::', 12),\n array('2001:db8::', 59),\n array('2001:db8:0:0:800::', 70),\n array('2001:db8::a60:8a2e:0:0', 99),\n array('2001:db8::a60:8a2e:370:7334', 128),\n );\n }", "static public function netMatch($sub, $ref)\n {\n if( is_array($sub) )\n {\n $subNetwork = $sub['start'];\n $subBroadcast = $sub['end'];\n }\n else\n {\n $res = cidr::stringToStartEnd($sub);\n $subNetwork = $res['start'];\n $subBroadcast = $res['end'];\n }\n\n if( is_array($ref) )\n {\n $refNetwork = $ref['start'];\n $refBroadcast = $ref['end'];\n }\n else\n {\n $res = cidr::stringToStartEnd($ref);\n $refNetwork = $res['start'];\n $refBroadcast = $res['end'];\n }\n\n if( $subNetwork >= $refNetwork && $subBroadcast <= $refBroadcast )\n {\n //print \"sub $sub is included in $ref\\n\";\n return 1;\n }\n if( $subNetwork >= $refNetwork && $subNetwork <= $refBroadcast ||\n $subBroadcast >= $refNetwork && $subBroadcast <= $refBroadcast ||\n $subNetwork <= $refNetwork && $subBroadcast >= $refBroadcast )\n {\n //print \"sub $sub is included in $ref\\n\";\n return 2;\n }\n\n return 0;\n }", "function testUserIP($user_ip, $restrictedIPs) {\r\n $ipu = explode('.', $user_ip);\r\n foreach ($ipu as &$v)\r\n $v = str_pad(decbin($v), 8, '0', STR_PAD_LEFT);\r\n $ipu = join('', $ipu);\r\n $res = false;\r\n foreach ($restrictedIPs as $cidr) {\r\n $parts = explode('/', $cidr);\r\n $ipc = explode('.', $parts[0]);\r\n foreach ($ipc as &$v) $v = str_pad(decbin($v), 8, '0', STR_PAD_LEFT);\r\n $ipc = substr(join('', $ipc), 0, $parts[1]);\r\n $ipux = substr($ipu, 0, $parts[1]);\r\n $res = ($ipc === $ipux);\r\n if ($res) break;\r\n }\r\n return $res;\r\n}", "public function isVersion6($ip, $version)\n {\n $ip = new IP($ip);\n $this->assertSame($version, $ip->getVersion());\n $this->assertTrue($ip->isVersion6());\n }", "public function compareIp(){\r\n\t \t$query = $this->db->db_query(\"SELECT user_ip FROM users WHERE id=\".$this->user);\r\n\t $var = mysql_fetch_object($query);\r\n\t\t\r\n\t\tif($var == $this->get_client_ip()){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t return false; \r\n }", "function calc($subnet) {\n\t\t\tif (!IPv4::validate_subnet($subnet))\n\t\t\t\treturn false;\n\n\t\t\tlist($ip, $cidr) = explode(\"/\", $subnet);\n\t\t\t\n\t\t\t$ipcount = IPv4::cidrips($cidr);\n\t\t\t$minip = IPv4::minip($subnet);\n\n\t\t\treturn array(\t\"address\"\t=> $ip\n\t\t\t\t,\t\"netmask\"\t=> IPv4::cidrtomask($cidr)\n\t\t\t\t,\t\"wildcard\"\t=> IPv4::cidrtowildcard($cidr)\n\t\t\t\t,\t\"network\"\t=> $minip .\"/\" .$cidr\n\t\t\t\t,\t\"minip\"\t\t=> $minip\n\t\t\t\t,\t\"maxip\"\t\t=> IPv4::maxip($subnet)\n\t\t\t\t,\t\"minhost\"\t=> IPv4::minhost($subnet)\n\t\t\t\t,\t\"maxhost\"\t=> IPv4::maxhost($subnet)\n\t\t\t\t,\t\"ipcount\"\t=> $ipcount\n\t\t\t\t,\t\"hostcount\"\t=> ($ipcount > 2 ? ($ipcount-2) : $ipcount)\n\t\t\t\t);\n\t\t}", "function ip_address_in_net ($ip_address, $prefix) {\n // http://pgregg.com/blog/2009/04/php-algorithms-determining-if-an-ip-is-within-a-specific-range/\n $ip_address_dec = ip2long($ip_address);\n \n // Since we use nfdump subnet notation, we need to make the subnet address complete\n $full_prefix = substr($prefix, 0, strpos($prefix, \"/\"));\n for ($i = 3 - substr_count($prefix, \".\"); $i > 0; $i--) {\n $full_prefix .= \".0\";\n }\n $full_prefix_dec = ip2long($full_prefix);\n \n $net_mask = intval(substr($prefix, strpos($prefix, \"/\") + 1));\n $net_mask_dec = bindec(str_pad('', $net_mask, '1').str_pad('', 32 - $net_mask, '0'));\n \n return (($ip_address_dec & $net_mask_dec) == ($full_prefix_dec & $net_mask_dec));\n }", "public function createIcmp6()\n {\n return $this->create(AF_INET6, SOCK_RAW, 58 /*getprotobyname('icmp')*/);\n }", "function _compareIp($address, $iprange)\n\t{\n\t\tforeach ($iprange as $value) {\n\t\t\tif (! $value || $value[0] === '#') continue;\n\t\t\tlist($network, $mask) = explode('/', $value);\n\t\t\tif (! $mask) {\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$network = $this->_dumpAddress($network);\n\t\t\t$mask = $this->_dumpNetmask($mask);\n\t\t\tif (($address & $mask) == ($network & $mask)) {\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function isValid () : bool {\n return IP::isIPv6($this->ip);\n }", "static public function ConvertIPv6CIDRToBinary($ipAndCidr)\n {\n\n list($ip, $subnetMask) = explode(\"/\", $ipAndCidr);\n\n $ip = static::ConvertIPv6ToBinary($ip);\n\n $subnetMask = static::ConvertIPv6ToBinary(\n static::ConvertIPv6CIDRToMask($subnetMask)\n );\n\n return compact('ip', 'subnetMask');\n\n }", "public function setIpv6CidrRange($var)\n {\n GPBUtil::checkString($var, True);\n $this->ipv6_cidr_range = $var;\n\n return $this;\n }", "public static function binToHexa(string $ipv6InBinaryFormat): string\n {\n $localString = \"\";\n $localArrayBinary = str_split($ipv6InBinaryFormat, Ipv6address::HEXTET_BIN_LEN);\n\n foreach ($localArrayBinary as $item) {\n $localString .= base_convert($item, 2, 16) . \":\";\n }\n // remove last colon\n return rtrim($localString, \":\");\n }", "private function getIp( $ipv6 = true ) {\n\t\tif( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t $ip = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );\n\t\t if( is_array( $ip ) ) {\n\t\t \t$ip = end( $ip );\n\t\t }else{\n\t\t \t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t }\n \t\t}elseif( isset( $_SERVER['HTTP_CLIENT_IP'] ) ){\n \t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t\t}else{\n\t\t $ip = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\n\t\tif( $ipv6 ) {\n\t\t\t// simple check: ipv6 does not contain a .\n\t\t\tif( strpos( $ip, '.' ) !== false ) {\n\t\t\t\t$ip = '::ffff:' . $ip;\n\t\t\t}\n\t\t}\n\n\t\treturn $ip;\n\t}", "public function validBroadcastAddresses6()\n {\n return array(\n array('200f:ffff:ffff:ffff:ffff:ffff:ffff:ffff', 12),\n array('2001:db8:0:1f:ffff:ffff:ffff:ffff', 59),\n array('2001:db8::bff:ffff:ffff:ffff', 70),\n array('2001:db8::a60:8a2e:1fff:ffff', 99),\n array('2001:db8::a60:8a2e:370:7334', 128),\n );\n }", "private function getIPv6RegexElement()\n : string\n {\n\n return '([a-f\\d]{1,4})(?>:(?3)){7}|(?!(?:.*[a-f\\d][:\\]]){8,})((?3)(?>:(?3)){0,6})?::(?4)?';\n\n }", "function clientInSameSubnet($client_ip=false,$server_ip=false) {\n if (!$client_ip)\n $client_ip = $_SERVER['REMOTE_ADDR'];\n if (!$server_ip)\n $server_ip = $_SERVER['SERVER_ADDR'];\n // Extract broadcast and netmask from ifconfig\n if (!($p = popen(\"ifconfig\",\"r\"))) return false;\n $out = \"\";\n while(!feof($p))\n $out .= fread($p,1024);\n fclose($p);\n // This is because the php.net comment function does not\n // allow long lines.\n $match = \"/^.*\".$server_ip;\n $match .= \".*Bcast:(\\d{1,3}\\.\\d{1,3}i\\.\\d{1,3}\\.\\d{1,3}).*\";\n $match .= \"Mask:(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})$/im\";\n if (!preg_match($match,$out,$regs))\n return false;\n $bcast = ip2long($regs[1]);\n $smask = ip2long($regs[2]);\n $ipadr = ip2long($client_ip);\n $nmask = $bcast & $smask;\n return (($ipadr & $smask) == ($nmask & $smask));\n }", "function get_ip_version($address)\n{\n $address_version = FALSE;\n if (strpos($address, '/') !== FALSE)\n {\n // Dump condition,\n // IPs with CIDR not correct for us here\n }\n //else if (strpos($address, '.') !== FALSE && Net_IPv4::validateIP($address))\n else if (preg_match('%^'.OBS_PATTERN_IPV4.'$%', $address))\n {\n $address_version = 4;\n }\n //else if (strpos($address, ':') !== FALSE && Net_IPv6::checkIPv6($address))\n else if (preg_match('%^'.OBS_PATTERN_IPV6.'$%i', $address))\n {\n $address_version = 6;\n }\n return $address_version;\n}", "function net_match($network, $ip)\r\n{\r\n\t// 127.0.0.1/255.255.255.255 or 10.0.0.1 matches a given ip\r\n\r\n\t$network = trim($network);\r\n\t$ip = trim($ip);\r\n\t$d = strpos($network,\"-\");\r\n\r\n\tif( $d === false )\r\n\t{\r\n\t\t$ip_arr = explode('/', $network);\r\n\t\t\r\n\t\tif( !preg_match(\"@\\d*\\.\\d*\\.\\d*\\.\\d*@\",$ip_arr[0],$matches) )\r\n\t\t{\r\n\t\t\t$ip_arr[0] .= \".0\"; // Alternate form õ.õ.õ/24\r\n\t\t}\r\n\r\n\t $network_long = ip2long($ip_arr[0]);\r\n\t $x = ip2long($ip_arr[1]);\r\n\r\n\t $mask = long2ip($x) == $ip_arr[1] ? $x : (0xffffffff << (32 - $ip_arr[1]));\r\n\t $ip_long = ip2long($ip);\r\n\r\n\t return ($ip_long & $mask) == ($network_long & $mask);\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$from = ip2long(trim(substr($network,0,$d)));\r\n\t $to = ip2long(trim(substr($network,$d+1)));\r\n\r\n\t $ip = ip2long($ip);\r\n\r\n\t return ($ip >= $from AND $ip <= $to);\r\n\t}\r\n}", "function minip($subnet) {\n\t\t\tif (!IPv4::validate_subnet($subnet))\n\t\t\t\treturn false;\n\n\t\t\tlist($ip, $cidr) = explode(\"/\", $subnet);\n\t\t\t$ipcount = IPv4::cidrips($cidr);\n\n\t\t\treturn IPv4::dectoip(IPv4::iptodec($ip)-(IPv4::iptodec($ip)%$ipcount));\n\t\t}", "public static function ip2long6($ipv6)\n {\n $ip_n = inet_pton($ipv6);\n $bits = 15; // 16 x 8 bit = 128bit\n while ($bits >= 0) {\n $bin = sprintf(\"%08b\", (ord($ip_n[$bits])));\n $ipv6long = $bin . $ipv6long;\n $bits--;\n }\n // Causes error on xampp\n return gmp_strval(gmp_init($ipv6long, 2), 10);\n }", "function maxip($subnet) {\n\t\t\tif (!IPv4::validate_subnet($subnet))\n\t\t\t\treturn false;\n\n\t\t\tlist($ip, $cidr) = explode(\"/\", $subnet);\n\t\t\t$ipcount = IPv4::cidrips($cidr);\n\n\t\t\t$minip = IPv4::minip($subnet);\n\t\t\treturn IPv4::dectoip(IPv4::iptodec($minip)+$ipcount-1);\n\t\t}", "function cidr_match($ip, $cidr)\n{\n list($subnet, $mask) = explode('/', $cidr);\n\n if ((ip2long($ip) & ~((1 << (32 - $mask)) - 1) ) == ip2long($subnet))\n {\n return true;\n }\n\n return false;\n}", "static public function ConvertBinaryToIPv6($bin)\n {\n\n return static::ConvertIPv6PackedToAddress($bin);\n\n }", "public function getIpV6()\n {\n return $this->ip_v6;\n }", "function minhost($subnet) {\n\t\t\tif (!IPv4::validate_subnet($subnet))\n\t\t\t\treturn false;\n\n\t\t\tlist($ip, $cidr) = explode(\"/\", $subnet);\n\n\t\t\t$minip = IPv4::minip($subnet);\n\t\t\t\n\t\t\treturn IPv4::dectoip(IPv4::iptodec($minip)+($cidr < 31 ? 1 : 0));\n\t\t}", "public function testCheckActionPostIP6Happy()\n {\n global $di;\n\n // Setup di\n $di = new DIFactoryConfig();\n $di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n\n // Use a different cache dir for unit test\n $di->get(\"cache\")->setPath(ANAX_INSTALL_PATH . \"/test/cache\");\n\n // View helpers uses the global $di so it needs its value\n // $di = $this->di;\n\n // Setup the controller\n $controller = new \\Hab\\MeModule\\ValidateIPController();\n $controller->setDI($this->di);\n $controller->initialize();\n $session = $di->get(\"session\");\n\n // Setup post request\n $this->di->get(\"request\")->setPost(\"ip\", \"2607:f0d0:1002:51::4\");\n // $_POST[\"ip\"] = \"2607:f0d0:1002:51::4\";\n\n // Get response\n $controller->checkActionPost();\n $res = $session->get(\"res\");\n // var_dump($res);\n $exp = \"2607:f0d0:1002:51::4 is a valid ipv6 adress\";\n\n $this->assertContains($exp, $res[\"data\"][\"text\"]);\n }", "public function setIpV6($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->ip_v6 = $arr;\n\n return $this;\n }", "function interface_has_gatewayv6($friendly) {\n\t$ifname = config_get_path(\"interfaces/{$friendly}\");\n\tif (!empty($ifname)) {\n\t\tswitch ($ifname['ipaddrv6']) {\n\t\t\tcase \"slaac\":\n\t\t\tcase \"dhcp6\":\n\t\t\tcase \"6to4\":\n\t\t\tcase \"6rd\":\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ((substr($ifname['if'], 0, 4) == \"ovpn\") ||\n\t\t\t\t (substr($ifname['if'], 0, 5) == \"ipsec\")) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t$tunnelif = substr($ifname['if'], 0, 3);\n\t\t\t\tif ($tunnelif == \"gif\" || $tunnelif == \"gre\") {\n\t\t\t\t\tif (find_interface_ipv6($ifname['if'])) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!empty($ifname['gatewayv6'])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn false;\n}", "static public function ConvertIPv6CIDRToMask($cidr)\n {\n\n $subnetMask = str_pad(\"\", $cidr, \"1\");\n\n $subnetMask = str_pad($subnetMask, 128, \"0\");\n\n $subnetMask = array_map(\n function($x) {\n return dechex(bindec($x));\n },\n str_split($subnetMask, 16)\n );\n\n return implode(\":\", $subnetMask);\n\n }", "function isIpInRange(string $inputIp, string $startIp, string $endIp): bool {\n \n function transformIpToDecimal(string $ip) {\n $ipOctets = explode(\".\", $ip);\n \n foreach ($ipOctets as $octet) {\n while (strlen($octet) < 3) {\n $octet = 0 . $octet; \n }\n \n $result = $octet . $result;\n }\n return $result;\n }\n \n return (transformIpToDecimal($inputIp) >= transformIpToDecimal($startIp) && transformIpToDecimal($inputIp) <= transformIpToDecimal($endIp));\n}", "function _matches_ip($client_ip, $ip)\n{\n $ip = ip2long($ip);\n\n if (false === $ip) {\n return false;\n }\n\n return ($ip === $client_ip);\n}", "function fw_IPv6Array( $net ) {\n\t$ip\t= \\str_repeat( 'f', $net / 4 );\n\tswitch( $net % 4 ) {\n\t\tcase 1:\n\t\t\t$ip .= '8';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$ip .= 'c';\n\t\t\tbreak;\n\t\t\t\n\t\tcase 3:\n\t\t\t$ip .= 'e';\n\t\t\tbreak;\n\t}\n\t// Fill out mask\n\treturn \\pack( 'H*', \\str_pad( $ip, 32, '0' ) );\n}", "private static function ipMatch(string $ip1, string $ip2) : bool\n {\n if (!filter_var($ip1, FILTER_VALIDATE_IP))\n {\n throw new GodException('invalid argument: ip1 in IPMatch() function is not an IP address.');\n }\n\n if ($ip1 === $ip2)\n {\n return true;\n }\n\n if (strpos($ip2, '/' ) === false)\n {\n $ip2 .= '/32';\n }\n\n // $ip2 is in IP/CIDR format eg 127.0.0.1/24\n list($ip2, $netmask) = explode( '/', $ip2, 2 );\n\n $ipDecimal = ip2long($ip1);\n $rangeDecimal = ip2long($ip2);\n\n $wildcardDecimal = pow( 2, ( 32 - $netmask ) ) - 1;\n $netmaskDecimal = ~ $wildcardDecimal;\n\n return ( ($ipDecimal & $netmaskDecimal) == ($rangeDecimal & $netmaskDecimal) );\n }", "static public function IsIPv4AddressWithinSubnet($ipOnly, $ipAndCidrSuper)\n {\n\n return static::IsIPv4SubnetWithinSupernet(\"{$ipOnly}/32\", $ipAndCidrSuper);\n\n }", "function is_class_B_IP($ip){\n\n\tif (preg_match('/^(172\\.1[6-9]|2[0-9]|3[0-1|\\.[0-9]|[1-9][0-9]|[1-2][0-5][0-5]\\.[0-9]|[1-9][0-9]|[1-2][0-5][0-5])$/', $ip) ){\n\t\t\n\t\treturn true;\t\n\t}\n\telse{\n\t\n\t\treturn false;\n\t}\n}", "public function ipsVersion6()\n {\n return array(\n array('2001:4860:4860::8844', IP::VERSION_6),\n array('fd0a:238b:4a96::', IP::VERSION_6),\n );\n }", "function ipInRange($ip, $range) : bool\n{\n if(!is_string($ip) || !is_string($range)){\n return false;\n }\n\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n return false;\n }\n}", "public function checkMask() {\n\t\t// No subnet means all clients are accepted.\n\t\tif ($this->subnet === NULL)\n\t\t\treturn TRUE;\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\tforeach ($this->subnet as $cidr) {\n\t\t\t$ret = SimpleSAML_Utilities::ipCIDRcheck($cidr);\n\t\t\tif ($ret) {\n\t\t\t\tSimpleSAML_Logger::debug('Negotiate: Client \"'.$ip.'\" matched subnet.');\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\tSimpleSAML_Logger::debug('Negotiate: Client \"'.$ip.'\" did not match subnet.');\n\t\treturn FALSE;\n\t}", "public static function long2ip6($ipv6long)\n {\n $bin = gmp_strval(gmp_init($ipv6long, 10), 2);\n if (strlen($bin) < 128) {\n $pad = 128 - strlen($bin);\n for ($i = 1; $i <= $pad; $i++) {\n $bin = \"0\" . $bin;\n }\n }\n $bits = 0;\n while ($bits <= 7) {\n $bin_part = substr($bin, ($bits * 16), 16);\n $ipv6 .= dechex(bindec($bin_part)) . \":\";\n $bits++;\n }\n // compress\n\n return inet_ntop(inet_pton(substr($ipv6, 0, -1)));\n }", "function match_network ($nets, $ip, $first=false) {\n $return = false;\n if (!is_array ($nets)) $nets = array ($nets);\n\n foreach ($nets as $net) {\n $rev = (preg_match (\"/^\\!/\", $net)) ? true : false;\n $net = preg_replace (\"/^\\!/\", \"\", $net);\n\n $ip_arr = explode('/', $net);\n $net_long = ip2long($ip_arr[0]);\n $x = ip2long($ip_arr[1]);\n $mask = long2ip($x) == $ip_arr[1] ? $x : 0xffffffff << (32 - $ip_arr[1]);\n $ip_long = ip2long($ip);\n\n if ($rev) {\n if (($ip_long & $mask) == ($net_long & $mask)) return false;\n } else {\n if (($ip_long & $mask) == ($net_long & $mask)) $return = true;\n if ($first && $return) return true;\n }\n }\n return $return;\n}", "private function ip_in_range($ip, $range) {\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n\n\n if($ip == $range){ // Single ip address\n return true;\n }\n\n // TODO: Validate\n //echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\n return false;\n }\n\n }", "public function getDestinationAddress(): IPv6Address\n {\n return $this->destination_address;\n }", "function _check_ip($chkAgainst, $chkAddr) {\r\n\r\n $addrMatch = false; /* Assume no match */\r\n\r\n\r\n /* If the \"check against\" value contains a \"/\", it'll be an IP\r\n address (range) in CIDR notation. */\r\n\r\n if(preg_match('#/[0-9]#', $chkAgainst)) {\r\n\r\n /* Break down dot.ted.qu.ad/bits of address to check against */\r\n list($addrBase, $hostBits) = explode('/', $chkAgainst);\r\n list($w, $x, $y, $z) = explode('.', $addrBase);\r\n\r\n /* Convert to high and low address ints */\r\n $chkAgainst = ($w << 24) + ($x << 16) + ($y << 8) + $z;\r\n $mask = $hostBits == 0? 0 : (~0 << (32 - $hostBits));\r\n $lowLimit = $chkAgainst & $mask;\r\n $highLimit = $chkAgainst | (~$mask & 0xffffffff);\r\n\r\n /* Convert addr to check to int */\r\n list($w, $x, $y, $z) = explode('.', $chkAddr);\r\n $chkAddr = ($w << 24) + ($x << 16) + ($y << 8) + $z;\r\n\r\n $addrMatch = (($chkAddr >= $lowLimit) && ($chkAddr <= $highLimit));\r\n\r\n } else {\r\n $addrMatch = preg_match('#^' . $chkAgainst . '#', $chkAddr);\r\n if ($addrMatch) {\r\n\r\n }\r\n\r\n }\r\n\r\n return $addrMatch;\r\n }" ]
[ "0.6987864", "0.69856113", "0.6925253", "0.66301405", "0.6571787", "0.65443337", "0.6543107", "0.6474734", "0.64418536", "0.6378642", "0.6366299", "0.6251428", "0.6251428", "0.62127805", "0.62059236", "0.6183578", "0.61319935", "0.59922117", "0.5984217", "0.5983117", "0.59636986", "0.5956269", "0.595037", "0.58773893", "0.585997", "0.58584267", "0.5850469", "0.5820755", "0.5818739", "0.5660712", "0.5616255", "0.5616115", "0.5600265", "0.5594393", "0.5579102", "0.5569255", "0.5561408", "0.5556166", "0.5473488", "0.54644567", "0.5456112", "0.54542094", "0.5439324", "0.54202455", "0.5405311", "0.539461", "0.5382353", "0.53690696", "0.53575534", "0.53472006", "0.5329107", "0.5308814", "0.529165", "0.5291354", "0.527477", "0.5252769", "0.5242064", "0.5238226", "0.52361655", "0.5207027", "0.5192673", "0.5188665", "0.5187381", "0.51722085", "0.51636136", "0.51477635", "0.51264656", "0.51184624", "0.51001686", "0.5097238", "0.5082737", "0.50694025", "0.5054131", "0.50350356", "0.5034385", "0.5033328", "0.50265", "0.501561", "0.50117755", "0.5009527", "0.49985036", "0.4997999", "0.49934456", "0.49907446", "0.49835837", "0.49830827", "0.49765593", "0.49758363", "0.49735904", "0.4966106", "0.4965739", "0.49574435", "0.49485934", "0.49432683", "0.49420047", "0.4932757", "0.49291736", "0.49241337", "0.49211147", "0.49197662" ]
0.7256021
0
Check if $ip is contained in $trustedProxies array.
Проверьте, содержится ли $ip в массиве $trustedProxies.
function isFromTrustedProxy(array $trustedProxies, $ip) { return !empty($trustedProxies) && checkIp($ip, $trustedProxies); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function _checkIpAllowed()\n {\n $ipAllowed = false;\n\n if (Mage::getStoreConfig('dev/restrict/allow_ips') && Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/limit_by_ip'))\n {\n $allowedIp = explode(',', mage::getStoreConfig('dev/restrict/allow_ips'));\n if (in_array(Mage::helper('core/http')->getRemoteAddr(), $allowedIp))\n {\n $ipAllowed = true;\n }\n } else {\n $ipAllowed = true;\n }\n\n return $ipAllowed;\n }", "public function checkIp($ip)\n {\n return (in_array($ip, $this->systemIPs));\n }", "public static function address_is_trusted($ip_address = null)\n\t{\n\t\tif (is_null($ip_address))\n\t\t\t$ip_address = $_SERVER['REMOTE_ADDR'];\n\n\t\t$results = self::db_query('SELECT a.\"ip_address\", a.\"timestamp\" FROM \"address_history\" AS a INNER JOIN \"tracked_locations\" AS l ON l.\"id\" = a.\"location_id\" WHERE a.\"ip_address\" = ? AND l.\"trusted\" != 0 AND a.\"timestamp\" >= ? ORDER BY a.\"timestamp\" DESC;', [$ip_address, time() - self::ADDRESS_MAX_AGE]);\n\t\treturn (count($results) > 0);\n\t}", "private function isUsingTrustedProxy()\n {\n return in_array($this->server->get('REMOTE_ADDR'), self::$trustedProxies);\n }", "function bl_check_ip()\n{\n // get ips from _BL_ALLOW_IP\n $allow_ip = trim(_BL_ALLOW_IP);\n if (empty($allow_ip)) {\n return true;\n }\n\n $extract_ips = explode(',', _BL_ALLOW_IP);\n $extract_ips = array_map('trim', $extract_ips);\n if (in_array(bl_get_ip(), $extract_ips)) {\n return true;\n }\n\n return false;\n}", "public function validateIfIncomingIPAllowed($username, $ip);", "private function validateIp() {\n if(filter_var($this->ip, FILTER_VALIDATE_IP) === false) {\n return false;\n }\n\n // Check if the user his/her ip address is a proxy.\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL,\"http://check.getipintel.net/check.php?ip=$this->ip&contact=mike@mike.mike\");\n $content = curl_exec($ch);\n\n if($content >= 0.90)\n return false;\n\n return true;\n\n }", "private function canProxy() {\n // grab the comma-delimited set of trusted proxies if they exist\n $trustedProxies = Config::get('proxypass.trusted_proxies');\n if(empty($trustedProxies)) {\n // no proxies have been whitelisted so allow all proxy servers\n return true;\n }\n\n // form an array and kill any whitespace in each element\n $proxyArr = explode(\",\", $trustedProxies);\n array_walk($proxyArr, 'trim');\n\n // first we need to check the REMOTE_ADDR value to see if the IP\n // address being reported matches one of the trusted proxies\n if(!empty($_SERVER['REMOTE_ADDR'])) {\n if(in_array($_SERVER['REMOTE_ADDR'], $proxyArr)) {\n // the machine that made the request is a trusted proxy so\n // everything is fine\n return true;\n }\n }\n\n // now we need to check the X-Forwarded-Server header if it exists\n // since that's one of the three standard request headers that a\n // proxy would pass along with a request\n if(!empty($_SERVER['HTTP_X_FORWARDED_SERVER'])) {\n if(in_array(trim($_SERVER['HTTP_X_FORWARDED_SERVER']), $proxyArr)) {\n // the hostname of the proxy matches a trusted proxy so\n // everything is fine\n return true;\n }\n }\n\n // we are either not behind a proxy or the proxy forwarding the request\n // is not in the set of trusted proxies\n return false;\n }", "private function isWhitelistedDomain($ip)\n\t{\n\t\tstatic $whitelist_domains = null;\n\n\t\tif (is_null($whitelist_domains))\n\t\t{\n\t\t\t$whitelist_domains = $this->cparams->getValue('whitelist_domains', '.googlebot.com,.search.msn.com');\n\t\t\t$whitelist_domains = explode(',', $whitelist_domains);\n\t\t}\n\n\t\tif (!empty($whitelist_domains))\n\t\t{\n\t\t\t$remote_domain = @gethostbyaddr($ip);\n\n\t\t\tif (!empty($remote_domain))\n\t\t\t{\n\t\t\t\tforeach ($whitelist_domains as $domain)\n\t\t\t\t{\n\t\t\t\t\t$domain = trim($domain);\n\n\t\t\t\t\tif (strrpos($remote_domain, $domain) !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "private function check_allowed_ip() {\n if (!$this->login_user->is_admin) {\n $ip = get_real_ip();\n $allowed_ips = $this->Settings_model->get_setting(\"allowed_ip_addresses\");\n if ($allowed_ips) {\n $allowed_ip_array = array_map('trim', preg_split('/\\R/', $allowed_ips));\n if (!in_array($ip, $allowed_ip_array)) {\n redirect(\"forbidden\");\n }\n }\n }\n }", "public function checkBlockedIp()\n {\n $remoteIp = $_SERVER['REMOTE_ADDR'];\n $blockedIp = Tools::jsonDecode(LengowConfiguration::get('LENGOW_ACCESS_BLOCK_IP_3'));\n if (is_array($blockedIp) && in_array($remoteIp, $blockedIp)) {\n return true;\n }\n return false;\n }", "private function allowIp()\n\t{\n\t\t$remoteIp = $_SERVER['REMOTE_ADDR'];\n\n\t\t// Include IP-addresses\n\t\t$include_ip = trim($this->params->get('include_ip'));\n\n\t\tif (!empty($include_ip))\n\t\t{\n\t\t\t$include_ips = explode(',', $include_ip);\n\t\t\t$match = false;\n\n\t\t\tforeach ($include_ips as $include_ip)\n\t\t\t{\n\t\t\t\tif ($remoteIp == trim($include_ip))\n\t\t\t\t{\n\t\t\t\t\t$match = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// There is no match, so skip authentication\n\t\t\tif ($match == false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Exclude IP-addresses\n\t\t$exclude_ip = trim($this->params->get('exclude_ip'));\n\n\t\tif (!empty($exclude_ip))\n\t\t{\n\t\t\t$exclude_ips = explode(',', $exclude_ip);\n\n\t\t\tforeach ($exclude_ips as $exclude_ip)\n\t\t\t{\n\t\t\t\tif ($remoteIp == trim($exclude_ip))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "private function _checkIPLimits(){\n $local = array(\n '60.216.3.163', // Jinan Office\n '123.168.0.82', // Howe's offic\n '216.48.124.18', // STG.recipe4living.com\n '216.48.124.61', // JM nibbles server\n '216.48.124.50', // JM nibbles server\n '216.48.124.62', // JM nibbles server\n '216.48.124.41', // JM nibbles server\n '104.130.175.114', // JM new rackspace server\n '162.242.248.108', // niblets server\n '66.54.186.254' // JM Chicago office\n );\n if (isset($_SERVER['REMOTE_ADDR']) && array_search($_SERVER['REMOTE_ADDR'], $local) !== false) {\n return true;\n }\n else {\n return false;\n }\n }", "abstract function has_ip_list($name);", "private function isIpInWhitelist(array $whitelist, $ipAddress)\n {\n foreach ($whitelist as $ipRange) {\n if ($ipRange->containsIp($ipAddress)) {\n return true;\n }\n }\n return false;\n }", "private function isSafeIP()\n\t{\n\t\t$safeIPs = $this->cparams->getValue('neverblockips', '');\n\n\t\tif (!empty($safeIPs))\n\t\t{\n\t\t\t$safeIPs = explode(',', $safeIPs);\n\n\t\t\tif (!empty($safeIPs))\n\t\t\t{\n\t\t\t\tif (AtsystemUtilFilter::IPinList($safeIPs))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "private function isIpAllowed($ip) : bool\n {\n if (empty($this->allowed)) {\n return true;\n }\n return $this->isIpInRange($ip, $this->allowed);\n }", "private function _checkIP($ips) {\n\t\tif (empty($ips)) return true;\n\t\telse {\n\t\t\tif (eregi(valid::getUserIp(), $ips)) return true;\n\t\t\telse return false;\n\t\t}\n\t}", "function check_allowed_ip($line_user, $line_allowed_ip){\n\tglobal $db;\n\t\t\t\n\t// IF LINE ALLOWED IPS NOT EMPTY\n\tif($line_allowed_ip != ''){\n\t\t\t\n\t\t// MAKE IPS AS ARRAY\n\t\t$allowed_ips = json_decode($line_allowed_ip, true);\t\n\t\tif(in_array($_SERVER['REMOTE_ADDR'], $allowed_ips)){\n\t\t\t$return = true;\n\t\t} else {\n\t\t\t$return = false;\n\t\t}\n\n\t} else {\n\t\t$return = true;\n\t}\n\t\n\treturn $return;\n}", "public function checkProxyList()\n {\n $proxyString = file_get_contents(__DIR__ .'/data/proxy-list.txt', FILE_USE_INCLUDE_PATH);\n\n if(strpos($proxyString, $this->getIpHex())) {\n $this->_setMessage(static::CODE_PROXYLIST, 'Proxy founded in proxy list: '. $this->getIp());\n }\n }", "static function CheckIP($ip){\n\t\t\tforeach (self::_getCFIpRanges() as $range){\n\t\t\t\tif (self::_cidr_match($_SERVER['REMOTE_ADDR'], $range))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "private function pfValidIP(): bool\n {\n if(!isset($_SERVER['HTTP_REFERER'])) {\n PayFastPayment::$errorMsg[] = \"This notification does not come from a valid PayFast domain\";\n return false;\n }\n\n // Variable initialization\n $validHosts = [\n 'www.payfast.co.za',\n 'sandbox.payfast.co.za',\n 'w1w.payfast.co.za',\n 'w2w.payfast.co.za'\n ];\n\n $validIps = [];\n\n foreach ($validHosts as $pfHostname) {\n $ips = gethostbynamel($pfHostname);\n\n if ($ips !== false && is_array($ips)) {\n array_push($validIps, ...$ips);\n }\n }\n\n // Remove duplicates\n $validIps = array_unique($validIps);\n $referrerIp = gethostbyname(parse_url($_SERVER['HTTP_REFERER'])['host']);\n if (in_array($referrerIp, $validIps, true)) {\n return true;\n }\n PayFastPayment::$errorMsg[] = \"This notification does not come from a valid PayFast domain\";\n return false;\n }", "private function isIPInAdminWhitelist()\n\t{\n\t\tif ($this->cparams->getValue('ipwl', 0) == 1)\n\t\t{\n\t\t\t$db = $this->container->db;\n\t\t\t$sql = $db->getQuery(true)\n\t\t\t ->select($db->qn('ip'))\n\t\t\t ->from($db->qn('#__admintools_adminiplist'))\n\t\t\t;\n\n\t\t\t$db->setQuery($sql);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$ipTable = $db->loadColumn();\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$ipTable = null;\n\t\t\t}\n\n\t\t\tif (!empty($ipTable))\n\t\t\t{\n\t\t\t\tif (AtsystemUtilFilter::IPinList($ipTable))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function inWhitelist($ip) {\n return $this->inList($ip,'white');\n }", "function checkIp($requestIp, $ips) : bool\n{\n if (empty($ips)) {\n return false;\n }\n if (!is_array($ips)) {\n $ips = array($ips);\n }\n $method = substr_count($requestIp, ':') > 1 ? 'checkIp6' : 'checkIp4';\n foreach ($ips as $ip) {\n if ($method($requestIp, $ip)) {\n return true;\n }\n }\n return false;\n}", "public function contains(Address $ip)\n {\n for ($i = 0; $i < 4; $i++) {\n if (($this->ip[$i] & $this->netmask[$i]) != ($ip[$i] & $this->netmask[$i])) {\n return false;\n }\n }\n return true;\n }", "public static function checkIp($requestIp, $ips) {}", "function safe_ip(){\n\tglobal $_config;\n\tif(count($_config['site']['debug_ips'])){\n\t\treturn in_array($_SERVER['REMOTE_ADDR'], $_config['site']['debug_ips']);\n\t}else{\n\t\treturn true;\n\t}\n}", "protected function validateIPAddress() {\n\t\t$sql = \"SELECT COUNT(`ip`) FROM `ip_blockade` WHERE `ip` = '\".f_get_ip_address().\"';\";\n\t\treturn (bool) !(Db::Instance()->FetchRecord($sql, DB_FETCH_ARRAY_FIELD) > 0);\n\t}", "function checkIpAllowed()\n {\n $ip_list = explode(',', config('bogpayment.allowed_ips'));\n\n if ($ip_list) {\n $client_ip = request()->getClientIp();\n\n if (!in_array($client_ip, $ip_list)) {\n abort(403, 'Access denied for IP: ' . $client_ip);\n }\n }\n }", "protected function skipByIp(): bool\n {\n if (empty($this->whitelistedIpAddresses)) {\n return false;\n }\n\n return IpUtils::checkIp(request()->ip(), $this->whitelistedIpAddresses);\n }", "public static function is_ip_banned( $ip = '' ) {\n\t\tif ( ! $ip ) {\n\t\t\t$ip = ITSEC_Lib::get_ip();\n\t\t}\n\n\t\trequire_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-ip-tools.php' );\n\n\t\tif ( ! ITSEC_Lib_IP_Tools::validate( $ip ) || ITSEC_Lib::is_ip_whitelisted( $ip ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn self::get_server_response( 'check-ip', $ip );\n\t}", "public function _ip_not_in_blacklist()\n\t{\n\t return !in_array($_SERVER['REMOTE_ADDR'],array_map('trim',explode(\"\\n\",@$this->settings_model['ip_blacklist'])));\n\t}", "function isAllowed($ip){\r\n $whitelist = array('127.0.0.1', '::1', '10.0.0.*', '192.168.1.*');\r\n\r\n // If the ip is matched, return true\r\n if(in_array($ip, $whitelist))\r\n return true;\r\n else{\r\n foreach($whitelist as $i){\r\n $wildcardPos = strpos($i, \"*\");\r\n // Check if the ip has a wildcard\r\n if($wildcardPos !== false && substr($_SERVER['REMOTE_ADDR'], 0, $wildcardPos) . \"*\" == $i)\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}", "private function validate_ip($ip) {\r\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\r\n return false;\r\n }\r\n return true;\r\n }", "abstract function allow_ip($name, array $ip);", "function checkIp($ip) {\n\tif (filter_var($ip, FILTER_VALIDATE_IP)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "protected function authorizeIp()\n {\n //In unit test REMOTE_ADDR is not available and will return null\n $request = $this->getRequest();\n\n // E.g. command line user\n if (! $request instanceof \\Zend_Controller_Request_Http) {\n return true;\n }\n\n $remoteIp = $request->getServer('REMOTE_ADDR');\n if ($this->util->isAllowedIP($remoteIp, $this->getAllowedIPRanges())) {\n return true;\n }\n\n return $this->_('You are not allowed to login from this location.');\n }", "private function is_IP($ip)\n { //basic test, maybe a pcre will be more appropriate...\n $tmp=explode('.', $ip);\n if(count($tmp)!=4)\n { return (false); }\n\n for($i=0;$i<4;$i++)\n {\n if(!is_numeric($tmp[$i])) {return (false);}\n }\n return (true);\n }", "public function isIp();", "private function validateIP($ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n return false;\n }\n return true;\n }", "protected function verify_ip_ban()\n {\n $ips=file_get_contents(dirname(__FILE__).DIRECTORY_SEPARATOR.'IPBlocker.txt');\n $user_ipaddress = $this->userIP . '.';\n\n $addresses = preg_split('#\\s+#', $ips, -1, PREG_SPLIT_NO_EMPTY);\n foreach ($addresses AS $banned_ip)\n {\n if (strpos($banned_ip, '*') === false AND $banned_ip{strlen($banned_ip) - 1} != '.')\n {\n $banned_ip .= '.';\n }\n\n $banned_ip_regex = str_replace('\\*', '(.*)', preg_quote($banned_ip, '#'));\n if (preg_match('#^' . $banned_ip_regex . '#U', $user_ipaddress))\n {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function checkIP($ip)\n {\n return $this->check(Types::IP, $ip);\n }", "protected static function isInWhitelistForGeolocation() {\n\n static $allowed = null;\n\n if ($allowed !== null) {\n return $allowed;\n }\n\n $allowed = false;\n $userIp = Tools::getRemoteAddr();\n $ips = [];\n\n // retrocompatibility\n $ipsOld = explode(';', Configuration::get('EPH_GEOLOCATION_WHITELIST'));\n\n if (is_array($ipsOld) && count($ipsOld)) {\n\n foreach ($ipsOld as $ip) {\n $ips = array_merge($ips, explode(\"\\n\", $ip));\n }\n\n }\n\n $ips = array_map('trim', $ips);\n\n if (is_array($ips) && count($ips)) {\n\n foreach ($ips as $ip) {\n\n if (!empty($ip) && preg_match('/^' . $ip . '.*/', $userIp)) {\n $allowed = true;\n }\n\n }\n\n }\n\n return $allowed;\n }", "function isip($ip) {\n\n $v = filter_var($ip, FILTER_VALIDATE_IP);\n\n return $v;\n\n }", "private function validate_ip($_ip) {\n if (strtolower($_ip) === 'unknown') {\n return false;\n }\n // generate ipv4 network address\n $ip = ip2long($ip);\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647) { return false; }\n if ($ip >= 167772160 && $ip <= 184549375) { return false; }\n if ($ip >= 2130706432 && $ip <= 2147483647) { return false; }\n if ($ip >= 2851995648 && $ip <= 2852061183) { return false; }\n if ($ip >= 2886729728 && $ip <= 2887778303) { return false; }\n if ($ip >= 3221225984 && $ip <= 3221226239) { return false; }\n if ($ip >= 3232235520 && $ip <= 3232301055) { return false; }\n if ($ip >= 4294967040) { return false; }\n }\n return true;\n }", "function validate_ip() {\r\n // clear errors/debug-messages, in case this object is verifying multiple email addresses in a single page load\r\n $this->errors = array();\r\n $this->debug_messages = array();\r\n\r\n $this->_reverse_ip(); // reset `$_rip`, in case this function is called more than once\r\n\r\n if ($this->ip) {\r\n if (!$this->_in_verified_ips($this->ip)) {\r\n $this->__ez_debug(\"IP address `{$this->ip}` not already verified. Checking DNSBLs.\");\r\n $this->_check_dnsbls();\r\n if (!$this->_bad_ip) { $this->_check_http_bl(); }\r\n\r\n if (!$this->_bad_ip) {\r\n $this->_verified_ips[] = $this->ip;\r\n }\r\n else {\r\n $this->errors[(string) microtime(true)] = array('failed-dnsbl-checks' => \"The IP address `{$this->ip}` has failed DNSBL blacklists verification.\");\r\n }\r\n }\r\n else {\r\n $this->__ez_debug(\"IP address `{$this->ip}` already verified. Not checking DNSBLs.\");\r\n }\r\n }\r\n else {\r\n $this->errors[(string) microtime(true)] = array('dnsbl-missing-ip' => \"No IP address has been passed to \".__function__);\r\n }\r\n\r\n return ($this->_bad_ip)?false:true;\r\n }", "function isBlacklistedIP($ip) {\n\t//\tCheck to be sure their IP is not on the blacklist before submitting it\n\t$blackIPs = array();\n\t$blacklistJSON = json_decode(file_get_contents('http://jeremymoritz.com/support/ip_blacklist.json'));\n\t$ipIsBlacklisted = false;\t//\tinnocent until proven guilty\n\tforeach($blacklistJSON->blacklist as $bIP) {\n\t\tif ($ip === $bIP) {\n\t\t\t$ipIsBlacklisted = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\t// $ipParts = explode('.', $ip);\n\t// foreach($blackIPs as $blackIP) {\n\t// \t$blackIPParts = explode('.', $blackIP);\n\t// \tif ($ipParts[0] === $blackIPParts[0] && $ipParts[1] === $blackIPParts[1]) {\n\t// \t\t$ipIsBlacklisted = true;\t//\tif the first 2 parts of IP address are the on the blacklist, then kick this guy out!\n\t// \t}\n\t// }\n\n\treturn $ipIsBlacklisted;\t//\tfunction returns true if blacklisted, else false\n}", "public function is_ip_valid( $ip ) {\n return preg_match( '/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/', $ip );\n }", "protected function _validateIp($input, $value)\n {\n return filter_var($value, FILTER_VALIDATE_IP) !== false;\n }", "function _matches_ip($client_ip, $ip)\n{\n $ip = ip2long($ip);\n\n if (false === $ip) {\n return false;\n }\n\n return ($ip === $client_ip);\n}", "protected function _check_whitelist_auth()\n {\n $whitelist = explode(',', $this->config->item('rest_ip_whitelist'));\n\n array_push($whitelist, '127.0.0.1', '0.0.0.0');\n\n foreach ($whitelist as &$ip) {\n // As $ip is a reference, trim leading and trailing whitespace, then store the new value\n // using the reference\n $ip = trim($ip);\n }\n\n if (in_array($this->input->ip_address(), $whitelist) === false) {\n $this->response([\n $this->config->item('rest_status_field_name') => false,\n $this->config->item('rest_message_field_name') => $this->lang->line('text_rest_ip_unauthorized'),\n ], self::HTTP_UNAUTHORIZED);\n }\n }", "public function checkGateway($ip)\r\n {\r\n return $this->rangeIntersect($ip) === [$ip,$ip];\r\n }", "public function check_allowed_servers() {\n\n // Determine the hostname of the server making this request\n $server_remote_addr = $_SERVER['REMOTE_ADDR'];\n\n // allow IPv6 local host (::1)\n if ('::1' === $server_remote_addr) {\n return true;\n }\n\n // filter_var() is only avaialbe for PHP >= 5.2, so ip2long is used here\n // and will need to be changed if IPV6 addresses are to be processed.\n // #if(filter_var($server_remote_addr,FILTER_VALIDATE_IP,FILTER_FLAG_IPV4))\n\n // If not a valid IP address\n if (!ip2long($server_remote_addr)) {\n $error = \"Invalid server remote address: \".$_SERVER['REMOTE_ADDR'].\"\\n\";\n $this->notifier->notify($error);\n exit(1);\n }\n\n // Check to see if the requesting server is allowed\n $hostname = gethostbyaddr($server_remote_addr);\n if(($hostname === null) || ($hostname === \"\") ||\n ! in_array($hostname,$this->allowed_servers )) {\n\n $error = \n\t\"Server remote address not allowed: \".$_SERVER['REMOTE_ADDR'].\"\\n\";\n\n $this->notifier->notify($error);\n\n exit(1);\n }\n\n return true;\n }", "function _in_verified_ips($ip_string='') {\r\n $in_verified = false;\r\n\r\n if ($ip_string) {\r\n $passed_pieces = explode('.', $ip_string);\r\n\r\n foreach ($this->_verified_ips as $verified_ip) {\r\n $verified_pieces = explode('.', $verified_ip);\r\n\r\n $found_mismatch = false;\r\n foreach (range(0,3) as $i) {\r\n if ($verified_pieces[$i] != $passed_pieces[$i] && $verified_pieces[$i] != '*')\r\n {\r\n $found_mismatch = true;\r\n }\r\n\r\n }\r\n if ($found_mismatch) {\r\n $this->__ez_debug(\"Found a mismatch of IP address {$ip_string} with the verified IP address {$verified_ip}\");\r\n }\r\n else {\r\n $this->__ez_debug(\"Not found a mismatch of IP address {$ip_string} with the verified IP address {$verified_ip}\");\r\n $in_verified = true;\r\n break;\r\n }\r\n }\r\n\r\n }\r\n\r\n return $in_verified;\r\n }", "protected static function ip_acl_check()\n\t{\n\t\t$account_data = \\V1\\Model\\Account::get_account();\n\t\t\n\t\t// No data\n\t\tif (empty($account_data)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// IPs listed on the account for the white or black list\n\t\tif (empty($account_data['listed_ips']) || !is_array($ip_list = json_decode($account_data['listed_ips'], true))) {\n\t\t\t$ip_list = array();\n\t\t}\n\t\t\n\t\t// Track the server IPs contacting the account, but don't track client IPs from JS calls.\n\t\tif (\\Session::get('public', true) === false) {\n\t\t\tstatic::set_used_ip();\n\t\t}\n\t\t\n\t\t$internal_whitelist = \\Config::get('engine.whitelisted_ips', array());\n\t\t\n\t\t// White list\n\t\tif ($account_data['acl_type'] === 1) {\n\t\t\t\n\t\t\t// Add the IP lists together\n\t\t\t$ip_list += $internal_whitelist;\n\t\t\t\n\t\t\t// No data = no one can use the account since it's a white list\n\t\t\tif (empty($ip_list) || !is_array($ip_list)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// The connected IP is white listed, so we allow access.\n\t\t\tif (in_array(\\Input::real_ip(), $ip_list)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t// No access\n\t\t\treturn false;\n\t\t\t\n\t\t// Black list\n\t\t} else {\n\t\t\t\n\t\t\t// Remove the Bit API Hub whitelisted IPs from the blacklist.\n\t\t\t$ip_list = array_diff($ip_list, $internal_whitelist);\n\t\t\t\n\t\t\t// Something messed up, so we bail on the call to ensure system integrity.\n\t\t\tif (!is_array($ip_list)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// The connected IP is black listed, so we don't allow access.\n\t\t\tif (isset($ip_list) && in_array(\\Input::real_ip(), $ip_list)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\t}", "public function validateIp($value) {\n\t\treturn filter_var($value, FILTER_VALIDATE_IP) !== false;\n\t}", "public function ip_in(array $compare)\n {\n if (in_array('local', $compare, true)) {\n if ($this->ip('is', 'local') === true) {\n return true;\n }\n }\n\n return in_array(\n $this->ip(), $compare, true\n );\n }", "public function validate_ip($ip)\n{\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n return false;\n }\n return true;\n}", "function isBanned( $ip ) {\n\t\t// no need to check the same ip 2 times in a row\n\t\tif(count($this->checked_ips) && in_array($ip, array_keys($this->checked_ips)))\n\t\t\treturn $this->checked_ips[$ip];\n\n\t\t$this->checked_ips[$ip] = $ip;\n\n\n\t\tif(mysqli_num_rows(mysqli_query($this->link, \"SELECT * FROM `\".$this->settings['banned_table'].\"` \n\t\t\tWHERE `ip` = '\".mysqli_real_escape_string($this->link, $ip).\"'\"))) {\n\t\t\t$this->checked_ips[$ip] = true;\n\t\t\treturn true;\n\t\t}\n\t\t$this->checked_ips[$ip] = false;\n\n\n\t\treturn false;\n\t}", "public static function isValid( $ip ) {\n\t\treturn preg_match( '/^' . RE_IP_ADD . '$/', $ip) ;\n\t}", "public static function is_ip($ip) { \r\n if (preg_match(\"/^[0-9]+(.[0-9]+){3}$/\",$ip)) { \r\n $validip = TRUE;\r\n foreach(explode(\".\", $ip) as $nextblock) {\r\n if( $nextblock<0 || $nextblock>255 )\r\n { \r\n $validip = FALSE;\r\n }\r\n }\r\n }else \r\n $validip = FALSE; \r\n return $validip;\r\n }", "function whitelistGetIP($asString = true){\n\t\t// Gets the proxy ip sent by the user\n\t\tstatic $the_IPs = array();\n\t\tif (!isset($the_IPs[$_SERVER['REMOTE_ADDR']]) || empty($the_IPs[$_SERVER['REMOTE_ADDR']]))\n\t\t{\n\t\t\t$proxy_ip = '';\n\t\t\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t\t$proxy_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t} else\n\t\t\t\tif (!empty($_SERVER['HTTP_X_FORWARDED'])) {\n\t\t\t\t\t$proxy_ip = $_SERVER['HTTP_X_FORWARDED'];\n\t\t\t\t} else\n\t\t\t\t\tif (! empty($_SERVER['HTTP_FORWARDED_FOR'])) {\n\t\t\t\t\t\t$proxy_ip = $_SERVER['HTTP_FORWARDED_FOR'];\n\t\t\t\t\t} else\n\t\t\t\t\t\tif (!empty($_SERVER['HTTP_FORWARDED'])) {\n\t\t\t\t\t\t\t$proxy_ip = $_SERVER['HTTP_FORWARDED'];\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tif (!empty($_SERVER['HTTP_VIA'])) {\n\t\t\t\t\t\t\t\t$proxy_ip = $_SERVER['HTTP_VIA'];\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\tif (!empty($_SERVER['HTTP_X_COMING_FROM'])) {\n\t\t\t\t\t\t\t\t\t$proxy_ip = $_SERVER['HTTP_X_COMING_FROM'];\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\tif (!empty($_SERVER['HTTP_COMING_FROM'])) {\n\t\t\t\t\t\t\t\t\t\t$proxy_ip = $_SERVER['HTTP_COMING_FROM'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\tif (!empty($proxy_ip) && $is_ip = preg_match('/^([0-9]{1,3}.){3,3}[0-9]{1,3}/', $proxy_ip, $regs) && count($regs) > 0) {\n\t\t\t\t$the_IPs[$_SERVER['REMOTE_ADDR']] = $regs[0];\n\t\t\t} elseif(substr($_SERVER['REMOTE_ADDR'], 0, 3)=='::1'||substr($_SERVER['REMOTE_ADDR'], 0, 3)=='10.'||substr($_SERVER['REMOTE_ADDR'], 0, 4)=='192.'||substr($_SERVER['REMOTE_ADDR'], 0, 4)=='127.')\n\t\t\t{\n\t\t\t\t$externalContent = getURIData('http://checkip.dyndns.com/',25, 45);\n\t\t\t\tpreg_match('/Current IP Address: \\[?([:.0-9a-fA-F]+)\\]?/', $externalContent, $m);\n\t\t\t\t$the_IPs[$_SERVER['REMOTE_ADDR']] = $m[1];\n\t\t\t} else {\n\t\t\t\t$the_IPs[$_SERVER['REMOTE_ADDR']] = $_SERVER['REMOTE_ADDR'];\n\t\t\t}\n\t\t}\n\t\t$the_IP = ($asString) ? $the_IPs[$_SERVER['REMOTE_ADDR']] : ip2long($the_IPs[$_SERVER['REMOTE_ADDR']]);\n\t\treturn $the_IP;\n\t}", "public function validate_user_ip( $ip ) {\r\n\t\tif ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) === false )\r\n\t\t\treturn false;\r\n\r\n\t\treturn true;\r\n\t}", "public static function isFromTrustedProxy(): bool\n {\n return self::proxy()->isFromTrustedProxy();\n }", "public function validateIP()\n {\n $user = $this->getUser();\n\n if ($user AND $user->bind_to_ip) {\n $ips = explode(',', $user->bind_to_ip);\n $ips = array_map('trim', $ips);\n\n if (!in_array(CoreHelper::getRealIp(), $ips)) {\n \t//todo, check this method call for addError\n $this->addError('password', Yii::t('core/auth', \"You could not login from this IP\"));\n }\n }\n }", "function checkIP($ip=null){\r\n\t\tif(empty($ip)){$ip=$_SERVER['REMOTE_ADDR'];}\r\n\t\tglobal $auto_restrict;\r\n\r\n\t\tif (isset($auto_restrict[\"banned_ip\"][$ip])){\r\n\t\t\tif ($auto_restrict[\"banned_ip\"][$ip]['nb']<$auto_restrict['max_security_issues_before_ban']){return true;} // below max login fails \r\n\t\t\telse if ($auto_restrict[\"banned_ip\"][$ip]['date']>=@date('U')){return false;} // active banishment \r\n\t\t\telse if ($auto_restrict[\"banned_ip\"][$ip]['date']<@date('U')){remove_banned_ip($ip);return true;} // old banishment \r\n\t\t\treturn false;\r\n\t\t}else{return true;}// ip is ok\r\n\t}", "static function CheckUserIP(){\n\t\t\treturn self::CheckIP($_SERVER['REMOTE_ADDR']);\n\t\t}", "public function hasIpAddress(): bool\n {\n return is_string($this->ipAddress);\n }", "protected function validate_ip($ip)\n\t{\n\t\tif (strtolower($ip) === 'unknown')\n\t\t\treturn false;\n\n\t\t$ip = ip2long($ip);\n\n \t// if the ip is set and not equivalent to 255.255.255.255\n\t\tif ($ip !== false && $ip !== -1) {\n\t /** make sure to get unsigned long representation of ip\n\t * due to discrepancies between 32 and 64 bit OSes and\n\t * signed numbers (ints default to signed in PHP) \n\t */\n\t $ip = sprintf('%u', $ip);\n \t// do private network range checking\n\t if ($ip >= 0 && $ip <= 50331647) return false;\n\t if ($ip >= 167772160 && $ip <= 184549375) return false;\n\t if ($ip >= 2130706432 && $ip <= 2147483647) return false;\n\t if ($ip >= 2851995648 && $ip <= 2852061183) return false;\n\t if ($ip >= 2886729728 && $ip <= 2887778303) return false;\n\t if ($ip >= 3221225984 && $ip <= 3221226239) return false;\n\t if ($ip >= 3232235520 && $ip <= 3232301055) return false;\n\t if ($ip >= 4294967040) return false;\n\t }\n\t return true;\n\t}", "private function validate_ip($ip)\n {\n if (strtolower($ip) === 'unknown')\n return false;\n\n // generate ipv4 network address\n $ip = ip2long($ip);\n\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647) return false;\n if ($ip >= 167772160 && $ip <= 184549375) return false;\n if ($ip >= 2130706432 && $ip <= 2147483647) return false;\n if ($ip >= 2851995648 && $ip <= 2852061183) return false;\n if ($ip >= 2886729728 && $ip <= 2887778303) return false;\n if ($ip >= 3221225984 && $ip <= 3221226239) return false;\n if ($ip >= 3232235520 && $ip <= 3232301055) return false;\n if ($ip >= 4294967040) return false;\n }\n return true;\n }", "public function inList($ip,$bw) {\n $attr = 'ip'.ucfirst($bw).'list';\n return in_array($ip,array_map('trim',explode(',',$this->$attr)));\n }", "public function matches( $ip );", "public function isIPInRange() : bool\n {\n $IPfrom = $this->config->getParam('params')['IPRange']['from'];\n $IPto = $this->config->getParam('params')['IPRange']['to'];\n $IP = $this->getClientIP();\n \n if (ip2long($IP) >= ip2long($IPfrom) && ip2long($IP) <= ip2long($IPto)) {\n $this->eventDispatcher->dispatch(new EventIPInRange($IP));\n return true;\n }\n \n return false;\n }", "protected function _isAllowed()\n {\n $allowedIps = Mage::helper('stub')->getAllowedIps();\n return Mage::helper('stub')->checkAllowedIp($allowedIps);\n }", "private function validIp($ip)\n {\n return preg_match(\"/\\\\b(?:\\\\d{1,3}\\\\.){3}\\\\d{1,3}\\\\b/ui\", $ip) === 1;\n }", "public function validateIp($ipaddress){\n if($this->dec2ip($ipaddress)){\n return true;\n }else{\n return false;\n }\n }", "public function ip($input)\n\t{\n\t\treturn (bool) filter_var($input, FILTER_VALIDATE_IP);\n\t}", "function getTrustedClientIP($dbip, $dbproxyip)\n{\n\tglobal $xffTrustProvider;\n \n\t$clientIpAddr = $dbip;\n\tif ($dbproxyip) {\n\t\t$ipList = explode(\",\", $dbproxyip);\n\t\t$ipList[] = $clientIpAddr;\n\t\t$ipList = array_reverse($ipList);\n\t\t\n\t\tforeach ($ipList as $ipnumber => $ip) {\n\t\t\tif ($xffTrustProvider->isTrusted(trim($ip)) && $ipnumber < (count($ipList) - 1)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$clientIpAddr = $ip;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treturn $clientIpAddr;\n}", "function validate_ip($ip)\n{\n\tif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "public function check_ip($ips)\n\t{\n\t\t$this->_reset_block_status();\n\t\t\n\t\t$this->_set_target_ip($ips);\n\t\t\n\t\t$ip_address = implode(\" \", $this->target_ip);\n\n\t\tforeach ($this->_ip_addresses as $ip) \n\t\t{\n\t\t\t$regex = str_replace(array('*', '.'), array('\\d{1,3}', '\\.'), $ip);\n\t\t\t\n\t\t\tif (preg_match(\"/$regex/\", $ip_address)) {\n\t\t\t\t\n\t\t\t\t$this->_blocked = TRUE;\n\t\t\t\t\n\t\t\t\tlog_message('debug', \"Found IP address in the blacklist: '$ip'\");\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function isIp($ip = null)\n {\n if (!$ip or strlen(trim($ip)) == 0) {\n return false;\n }\n\n $ip = trim($ip);\n if (preg_match(\"/^[0-9]{1,3}(.[0-9]{1,3}){3}$/\", $ip)) {\n foreach (explode(\".\", $ip) as $block) {\n if ($block < 0 || $block > 255) {\n return false;\n }\n }\n if($ip == '0.0.0.0') {\n return false;\n }\n return true;\n }\n return false;\n }", "function validate_ip($ip){\n\t if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n\t return false;\n\t }\n\t return true;\n\t}", "function authenticate($users, $u, $p, $ip) {\n if ((!isset($users[$u]))\n || (!isset($users[$u]['tk']))\n || ($users[$u]['tk'] != '*' && $users[$u]['tk'] !== $p)) {\n return false;\n }\n if (isset($users[$u]['ip'])) {\n if (is_array($users[$u]['ip'])) {\n foreach ($users[$u]['ip'] as $range) {\n if (is_ip_in_range($ip, $range)) {\n return true;\n }\n }\n return false;\n } else {\n return is_ip_in_range($ip, $users[$u]['ip']);\n }\n }\n return true;\n}", "public function hasSameIPAs($ip)\n {\n return (intval($this->userIP) === static::encodeIpForDatabase($ip));\n }", "protected function isIpAddressBanned()\n {\n $banned_ip_addresses = Cache::remember('firewall-banned-ips', 60 * 24 * 7, function () {\n return FireWallBannedIp::where('unban_at', '>=', Carbon::now())->pluck('ip_address');\n });\n\n return $banned_ip_addresses->contains(getRequestIpAddress());\n }", "protected function clientNotAllowed()\n {\n $isAllowedIP = in_array(request()->ip(), $this->ipWhitelist);\n\n return !$isAllowedIP ;\n }", "function rest_is_ip_address($ip)\n{\n}", "public function bruteforceExempt($ip) {\n return $this->exemptWhitelist && $this->inWhitelist($ip);\n\n }", "private function isWhitelisted()\n {\n if (Redis::sismember($this->options->whitelist_key, $this->client->ip)) {\n return true;\n }\n\n //Lets verify if its on our whitelist\n if (in_array($this->client->ip, $this->options->whitelist_ips)) {\n //Add this to the redis list as it is faster\n Redis::sadd($this->options->whitelist_key, $this->client->ip);\n if ($this->options->log) {\n ProcessLogWithIpInfo::dispatch($this->client, 'WHITELISTED', $this->options);\n }\n return true;\n }\n\n return false;\n }", "public function CurrentIpIsWhiteListed()\n {\n $request = \\ChameleonSystem\\CoreBundle\\ServiceLocator::get('request_stack')->getCurrentRequest();\n $sUserIpAddress = $request->getClientIp();\n\n $bUserIsWhiteListed = true;\n\n $oIpWhiteList = $this->GetFieldCmsIpWhitelistList();\n $oIpWhiteList->AddFilterString(\"`cms_ip_whitelist`.`ip` != ''\");\n\n if ($oIpWhiteList->Length() > 0) {\n $bUserIsWhiteListed = false;\n //first check the white list configured in the backend (cms settings)\n while ($oIP = $oIpWhiteList->Next() && false === $bUserIsWhiteListed) {\n $bUserIsWhiteListed = $this->CheckIP($oIP->fieldIp, $sUserIpAddress);\n }\n\n if (!$bUserIsWhiteListed) {\n trigger_error('Non WhiteListed user with IP '.$sUserIpAddress.' tried to pass', E_USER_ERROR);\n }\n }\n\n //user is still not allowed? check config constant\n if (defined('CMS_ALLOWED_IP') && CMS_ALLOWED_IP != '') {\n if (!$this->CheckIP(CMS_ALLOWED_IP, $sUserIpAddress)) {\n trigger_error('Non WhiteListed user with IP '.$sUserIpAddress.' tried to pass', E_USER_ERROR);\n }\n }\n\n return $bUserIsWhiteListed;\n }", "protected static function isValidIp($ip)\n {\n return static::getVersionFromIp($ip) !== false;\n }", "public function inBlacklist($ip) {\n return $this->inList($ip,'black');\n }", "public function isIp($value)\n {\n return filter_var($value, FILTER_VALIDATE_IP) !== false;\n }", "public function ipaddress_exist()\n\t{\n\t\t$ip_user = $this->getRealIP();\n\t\t$conection = $this->ConnectDB();\n\t\t$statement = $conection->prepare(\"SELECT * FROM visitas where ip_address = :ip_address LIMIT 1\");\n\t\t$statement->execute(array(':ip_address' => $ip_user));\n\t\tif (!empty($statement->fetch()))\n\t\t{\n\t\t\treturn true;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "function validate_ip($ip) {\n\t\t\tif (preg_match(\"/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/\", $ip))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "static public function IsIp($ip)\n {\n return ((false === ip2long($ip)) || (long2ip(ip2long($ip)) !== $ip)) ? false : true;\n }", "protected static function checkIp($ip)\n {\n $reserved_ips = \\Config::get('locate.reserved_ips', []);\n\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {\n $longip = ip2long($ip);\n\n if (!empty($ip)) {\n foreach ($reserved_ips as $r) {\n $min = ip2long($r[0]);\n $max = ip2long($r[1]);\n\n if ($longip >= $min && $longip <= $max) {\n return false;\n }\n }\n\n return true;\n }\n } else if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n return true;\n }\n\n return false;\n }", "protected function validateIp($field, $value)\n {\n return filter_var($value, \\FILTER_VALIDATE_IP) !== false;\n }", "protected function isValidIpAddress($ip)\n {\n $flags = FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6;\n if (filter_var($ip, FILTER_VALIDATE_IP, $flags) === false) {\n return false;\n }\n return true;\n }" ]
[ "0.6686304", "0.66817045", "0.6649753", "0.6647452", "0.66176367", "0.6556792", "0.655332", "0.65287906", "0.6524876", "0.65178156", "0.65095913", "0.63962615", "0.63892037", "0.6296225", "0.62898856", "0.6286581", "0.6241579", "0.622788", "0.621663", "0.62118447", "0.62003726", "0.618907", "0.6183585", "0.61666054", "0.61527306", "0.61486906", "0.6145453", "0.61453706", "0.6095184", "0.60873187", "0.6080198", "0.6064649", "0.60629296", "0.60394156", "0.60140055", "0.6003952", "0.5994614", "0.59668547", "0.59331405", "0.59331095", "0.5916711", "0.5916558", "0.59160864", "0.590165", "0.5901181", "0.58927506", "0.58902144", "0.5885579", "0.5862105", "0.58597684", "0.5845836", "0.5836708", "0.58341897", "0.5827492", "0.5826986", "0.5824149", "0.5817886", "0.5814429", "0.58131146", "0.5802658", "0.5795933", "0.5793081", "0.5790831", "0.5787071", "0.5780941", "0.5775079", "0.5769258", "0.5762493", "0.57621634", "0.5759749", "0.5754724", "0.57531345", "0.57462835", "0.57374185", "0.5734809", "0.57314205", "0.5730666", "0.57278687", "0.5718453", "0.57090336", "0.5705688", "0.570021", "0.56993604", "0.56970865", "0.56907284", "0.569058", "0.5682391", "0.5671901", "0.5663286", "0.56514513", "0.5646508", "0.5645822", "0.56320333", "0.5630007", "0.5629157", "0.562167", "0.5620863", "0.56149054", "0.5604222", "0.56024665" ]
0.8307751
0
Convert an IPv4 address to IPv6
Преобразование адреса IPv4 в IPv6
function iPv4To6($ip) { if(isNullOrEmpty($ip)){ return ''; } static $Mask = '::ffff:'; // This tells IPv6 it has an IPv4 address $IPv6 = (strpos($ip, '::') === 0); $IPv4 = (strpos($ip, '.') > 0); if (!$IPv4 && !$IPv6) { return false; } if ($IPv6 && $IPv4) { // Strip IPv4 Compatibility notation $ip = substr($ip, strrpos($ip, ':') + 1); } elseif (!$IPv4) { // Seems to be IPv6 already? return $ip; } $ip = array_pad(explode('.', $ip), 4, 0); if (count($ip) > 4) { return false; } for ($i = 0; $i < 4; $i++) { if ($ip[$i] > 255) { return false; } } $Part7 = base_convert(($ip[0] * 256) + $ip[1], 10, 16); $Part8 = base_convert(($ip[2] * 256) + $ip[3], 10, 16); return $Mask . $Part7 . ':' . $Part8; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expandIPv6Notation($ip)\n{\n if (!iPv4To6($ip)) {\n return $ip;\n }\n $hex = unpack(\"H*hex\", inet_pton($ip));\n $ip = substr(preg_replace(\"/([A-f0-9]{4})/\", \"$1:\", $hex['hex']), 0, -1);\n return $ip;\n}", "function ip2hex ($ip) {\n\t\tif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false) {\n\t\t\t$isIPv4 = true;\n\t\t} elseif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false) {\n\t\t\t$isIPv4 = false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t//IPv4 format\n\t\tif($isIPv4) {\n\t\t\t$parts = explode('.', $ip);\n\t\t\tforeach ($parts as &$part) {\n\t\t\t\t$part = str_pad(dechex($part), 2, '0', STR_PAD_LEFT);\n\t\t\t}\n\t\t\tunset($part);\n\t\t\t$ip\t\t\t= '::'.$parts[0].$parts[1].':'.$parts[2].$parts[3];\n\t\t\t$hex\t\t= implode('', $parts);\n\t\t//IPv6 format\n\t\t} else {\n\t\t\t$parts\t\t= explode(':', $ip);\n\t\t\t$last_part\t= count($parts) - 1;\n\t\t\t//If mixed IPv6/IPv4, convert ending to IPv6\n\t\t\tif(filter_var($parts[$last_part], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false) {\n\t\t\t\t$parts[$last_part] = explode('.', $parts[$last_part]);\n\t\t\t\tforeach ($parts[$last_part] as &$part) {\n\t\t\t\t\t$part = str_pad(dechex($part), 2, '0', STR_PAD_LEFT);\n\t\t\t\t}\n\t\t\t\tunset($part);\n\t\t\t\t$parts[]\t\t\t= $parts[$last_part][2].$parts[$last_part][3];\n\t\t\t\t$parts[$last_part]\t= $parts[$last_part][0].$parts[$last_part][1];\n\t\t\t}\n\t\t\t$numMissing\t\t= 8 - count($parts);\n\t\t\t$expandedParts\t= [];\n\t\t\t$expansionDone\t= false;\n\t\t\tforeach($parts as $part) {\n\t\t\t\tif(!$expansionDone && $part == '') {\n\t\t\t\t\tfor($i = 0; $i <= $numMissing; ++$i) {\n\t\t\t\t\t\t$expandedParts[] = '0000';\n\t\t\t\t\t}\n\t\t\t\t\t$expansionDone = true;\n\t\t\t\t} else {\n\t\t\t\t\t$expandedParts[] = $part;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach($expandedParts as &$part) {\n\t\t\t\t$part = str_pad($part, 4, '0', STR_PAD_LEFT);\n\t\t\t}\n\t\t\t$ip = implode(':', $expandedParts);\n\t\t\t$hex = implode('', $expandedParts);\n\t\t}\n\t\t//Check final IP\n\t\tif(filter_var($ip, FILTER_VALIDATE_IP) === false) {\n\t\t\treturn false;\n\t\t}\n\t\treturn strtolower(str_pad($hex, 32, '0', STR_PAD_LEFT));\n\t}", "function uncompressIPv6($ip, $count=7) {\n\tif (strpos($ip, \"::\") !== FALSE) {\n\t\t$ip = str_replace(\"::\", str_repeat(\":\", $count + 2 - substr_count($ip, \":\")), $ip);\n\t}\n\t$tmp_ip = explode(\":\", $ip);\n\tforeach ($tmp_ip as &$value) {\n\t\t$value = str_pad($value, 4, '0', STR_PAD_LEFT);\t\n\t}\n\treturn implode(\":\", $tmp_ip);\n}", "static public function NormalizeIPv6Address($ipv6)\n {\n\n if (strpos($ipv6, \"::\") === false && substr_count($ipv6, \":\") !== 7) {\n throw new \\Exception(\"Invalid IPv6 address\");\n }\n\n if (strpos($ipv6, \"::\") !== false) {\n\n $padding = \":\";\n\n $paddingRequired = 9 - substr_count($ipv6, \":\");\n\n while (substr_count($padding, \":\") < $paddingRequired) {\n\n $padding .= \"0000:\";\n\n }\n\n $ipv6 = str_replace(\"::\", $padding, $ipv6);\n }\n\n $ipv6 = explode(\":\", $ipv6);\n\n foreach ($ipv6 as &$field) {\n\n while (strlen($field) < 4) {\n\n $field = \"0{$field}\";\n\n }\n\n }\n\n return implode(\":\", $ipv6);\n\n }", "function anonimizeIpv6(string $ip):string\n{\n if (strrpos($ip, \":\") > 0) {\n return substr($ip, 0, strrpos($ip, \":\") + 1) . '0';\n }\n return '0.0.0.0';\n}", "private function getIPv4MappedIPv6RegexElement()\n : string\n {\n\n return '(?3)(?>:(?3)){5}:|(?!(?:.*[a-f\\d]:){6,})(?5)?::(?>((?3)(?>:(?3)){0,4}):)?';\n\n }", "public static function ipv6($value) {\n\t\treturn (bool) filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n\t}", "function ip2long6($ipv6) {\r $ip_n = inet_pton($ipv6);\r $bits = 15; // 16 x 8 bit = 128bit\r while ($bits >= 0) {\r $bin = sprintf(\"%08b\",(ord($ip_n[$bits])));\r $ipv6long = $bin.$ipv6long;\r $bits--;\r }\r return gmp_strval(gmp_init($ipv6long,2),10);\r}", "static public function ipv6_cidr2network($ip, $cidr)\n {\n #list($addr_given_str, $prefixlen) = explode('/', $prefix);\n\n // Parse the address into a binary string\n $addr_given_bin = inet_pton($ip);\n\n // Convert the binary string to a string with hexadecimal characters\n $addr_given_hex = bin2hex($addr_given_bin);\n\n // Overwriting first address string to make sure notation is optimal\n $ip = inet_ntop($addr_given_bin);\n\n // Calculate the number of 'flexible' bits\n $flexbits = 128 - $cidr;\n\n // Build the hexadecimal strings of the first and last addresses\n $addr_hex_first = $addr_given_hex;\n $addr_hex_last = $addr_given_hex;\n\n // We start at the end of the string (which is always 32 characters long)\n $pos = 31;\n while ($flexbits > 0) {\n // Get the characters at this position\n $orig_first = substr($addr_hex_first, $pos, 1);\n $orig_last = substr($addr_hex_last, $pos, 1);\n\n // Convert them to an integer\n $origval_first = hexdec($orig_first);\n $origval_last = hexdec($orig_last);\n\n // First address: calculate the subnet mask. min() prevents the comparison from being negative\n $mask = 0xf << (min(4, $flexbits));\n\n // AND the original against its mask\n $new_val_first = $origval_first & $mask;\n\n // Last address: OR it with (2^flexbits)-1, with flexbits limited to 4 at a time\n $new_val_last = $origval_last | (pow(2, min(4, $flexbits)) - 1);\n\n // Convert them back to hexadecimal characters\n $new_first = dechex($new_val_first);\n $new_last = dechex($new_val_last);\n\n // And put those character back in their strings\n $addr_hex_first = substr_replace($addr_hex_first, $new_first, $pos, 1);\n $addr_hex_last = substr_replace($addr_hex_last, $new_last, $pos, 1);\n\n // We processed one nibble, move to previous position\n $flexbits -= 4;\n $pos -= 1;\n }\n\n // Convert the hexadecimal strings to a binary string\n $addr_bin_first = hex2bin($addr_hex_first);\n $addr_bin_last = hex2bin($addr_hex_last);\n\n // And create an IPv6 address from the binary string\n $addr_str_first = inet_ntop($addr_bin_first);\n $addr_str_last = inet_ntop($addr_bin_last);\n\n return $addr_str_first;\n }", "function snmp2ipv6($ipv6_snmp)\n{\n $ipv6 = explode('.',$ipv6_snmp);\n\n // Workaround stupid Microsoft bug in Windows 2008 -- this is fixed length!\n // < fenestro> \"because whoever implemented this mib for Microsoft was ignorant of RFC 2578 section 7.7 (2)\"\n if (count($ipv6) == 17 && $ipv6[0] == 16)\n {\n array_shift($ipv6);\n }\n\n for ($i = 0;$i <= 15;$i++) { $ipv6[$i] = zeropad(dechex($ipv6[$i])); }\n for ($i = 0;$i <= 15;$i+=2) { $ipv6_2[] = $ipv6[$i] . $ipv6[$i+1]; }\n\n return implode(':',$ipv6_2);\n}", "static public function ConvertBinaryToIPv6($bin)\n {\n\n return static::ConvertIPv6PackedToAddress($bin);\n\n }", "protected static function _populateIp() {\n if (!isset(self::$_pattern['IPv6'])) {\n $pattern = '((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}';\n $pattern .= '(:|((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})';\n $pattern .= '|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})';\n $pattern .= '(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)';\n $pattern .= '{4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2}))';\n $pattern .= '{3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}';\n $pattern .= '((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|';\n $pattern .= '((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}';\n $pattern .= '((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2}))';\n $pattern .= '{3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4})';\n $pattern .= '{0,4}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)';\n $pattern .= '|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]';\n $pattern .= '\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4})';\n $pattern .= '{1,2})))|(((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})))(%.+)?';\n\n self::$_pattern['IPv6'] = $pattern;\n }\n if (!isset(self::$_pattern['IPv4'])) {\n $pattern = '(?:(?:25[0-5]|2[0-4][0-9]|(?:(?:1[0-9])?|[1-9]?)[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|(?:(?:1[0-9])?|[1-9]?)[0-9])';\n self::$_pattern['IPv4'] = $pattern;\n }\n }", "function hex2ip ($hex, $mode = 6) {\n\t\tif (!$hex || strlen($hex) != 32) {\n\t\t\treturn false;\n\t\t}\n\t\t$IPv4_range = false;\n\t\tif (preg_match('/^0{24}[0-9a-f]{8}$/', $hex)) {\n\t\t\t$IPv4_range = true;\n\t\t}\n\t\tif ($IPv4_range) {\n\t\t\t$hex = substr($hex, 24, 8);\n\t\t\tswitch ($mode) {\n\t\t\t\tcase 4:\n\t\t\t\t\treturn\thexdec(substr($hex, 0, 2)).'.'.\n\t\t\t\t\t\t\thexdec(substr($hex, 2, 2)).'.'.\n\t\t\t\t\t\t\thexdec(substr($hex, 4, 2)).'.'.\n\t\t\t\t\t\t\thexdec(substr($hex, 6, 2));\n\t\t\t\tcase 10:\n\t\t\t\t\t$result = [];\n\t\t\t\t\t//IPv6\n\t\t\t\t\t$result[] = '0000:0000:0000:0000:0000:0000:'.substr($hex, 0, 4).':'.substr($hex, 4, 4);\n\t\t\t\t\t//IPv4\n\t\t\t\t\t$result[] =\thexdec(substr($hex, 0, 2)).'.'.\n\t\t\t\t\t\t\t\thexdec(substr($hex, 2, 2)).'.'.\n\t\t\t\t\t\t\t\thexdec(substr($hex, 4, 2)).'.'.\n\t\t\t\t\t\t\t\thexdec(substr($hex, 6, 2));\n\t\t\t\t\treturn $result;\n\t\t\t\tdefault:\n\t\t\t\t\treturn '0000:0000:0000:0000:0000:0000:'.substr($hex, 0, 4).':'.substr($hex, 4, 4);\n\t\t\t}\n\t\t} else {\n\t\t\t$result =\tsubstr($hex, 0, 4).':'.\n\t\t\t\t\t\tsubstr($hex, 4, 4).':'.\n\t\t\t\t\t\tsubstr($hex, 8, 4).':'.\n\t\t\t\t\t\tsubstr($hex, 12, 4).':'.\n\t\t\t\t\t\tsubstr($hex, 16, 4).':'.\n\t\t\t\t\t\tsubstr($hex, 20, 4).':'.\n\t\t\t\t\t\tsubstr($hex, 24, 4).':'.\n\t\t\t\t\t\tsubstr($hex, 28, 4);\n\t\t\tif ($mode == 10) {\n\t\t\t\treturn [$result, false];\n\t\t\t} else {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}", "public static function anonymizeIPv4(string $address) :string {\n return inet_ntop(inet_pton($address) & inet_pton(\"255.255.255.0\"));\n }", "private function getIPv6RegexElement()\n : string\n {\n\n return '([a-f\\d]{1,4})(?>:(?3)){7}|(?!(?:.*[a-f\\d][:\\]]){8,})((?3)(?>:(?3)){0,6})?::(?4)?';\n\n }", "static public function GetIPv6NetworkAddress($ipAndCidr)\n {\n\n $ipAndCidr = static::ConvertIPv6CIDRToBinary($ipAndCidr);\n\n return static::ConvertBinaryToIPv6($ipAndCidr['ip'] & $ipAndCidr['subnetMask']);\n\n }", "function validateIPv6($IP) \n{\n if (strlen($IP) < 3) \n return $IP == '::'; \n\n // Check if part is in IPv4 format \n if (strpos($IP, '.')) \n { \n $lastcolon = strrpos($IP, ':'); \n if (!($lastcolon && validateIPv4(substr($IP, $lastcolon + 1)))) \n return false; \n\n // replace IPv4 part with dummy \n $IP = substr($IP, 0, $lastcolon) . ':0:0'; \n } \n\n // check uncompressed \n if (strpos($IP, '::') === false) \n { \n return preg_match('/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i', $IP); \n } \n\n // check colon-count for compressed format \n if (substr_count($IP, ':') < 8) \n { \n return preg_match('/^(?::|(?:[a-f0-9]{1,4}:)+):(?:(?:[a-f0-9]{1,4}:)*[a-f0-9]{1,4})?$/i', $IP); \n } \n\n return false; \n}", "public static function IPv6Bin2HexDataProviderCorrect() {}", "private function ipv6(string $value): bool\n {\n return $this->ip($value, FILTER_FLAG_IPV6);\n }", "public static function long2ip6($ipv6long)\n {\n $bin = gmp_strval(gmp_init($ipv6long, 10), 2);\n if (strlen($bin) < 128) {\n $pad = 128 - strlen($bin);\n for ($i = 1; $i <= $pad; $i++) {\n $bin = \"0\" . $bin;\n }\n }\n $bits = 0;\n while ($bits <= 7) {\n $bin_part = substr($bin, ($bits * 16), 16);\n $ipv6 .= dechex(bindec($bin_part)) . \":\";\n $bits++;\n }\n // compress\n\n return inet_ntop(inet_pton(substr($ipv6, 0, -1)));\n }", "function generaripv6($mysql_conn, $dominiointroducido, $ipintroducida, $usernameipv6){\n\t$a_Prefix = $ipintroducida;\n\t// Validate input superficially with a RegExp and split accordingly\n if(!preg_match('~^([0-9a-f:]+)[[:punct:]]([0-9]+)$~i', trim($a_Prefix), $v_Slices)){\n\t\treturn false;\n }\n // Make sure we have a valid ipv6 address\n if(!filter_var($v_FirstAddress = $v_Slices[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){\n return false;\n }\n // The /## end of the range\n $v_PrefixLength = intval($v_Slices[2]);\n if($v_PrefixLength > 128){\n return false; // kind'a stupid :)\n }\n $v_SuffixLength = 128 - $v_PrefixLength;\n\n // Convert the binary string to a hexadecimal string\n $v_FirstAddressBin = inet_pton($v_FirstAddress);\n $v_FirstAddressHex = bin2hex($v_FirstAddressBin);\n\n // Build the hexadecimal string of the network mask\n // (if the manually formed binary is too large, base_convert() chokes on it... so we split it up)\n $v_NetworkMaskHex = str_repeat('1', $v_PrefixLength) . str_repeat('0', $v_SuffixLength);\n $v_NetworkMaskHex_parts = str_split($v_NetworkMaskHex, 8);\n foreach($v_NetworkMaskHex_parts as &$v_NetworkMaskHex_part){\n $v_NetworkMaskHex_part = base_convert($v_NetworkMaskHex_part, 2, 16);\n $v_NetworkMaskHex_part = str_pad($v_NetworkMaskHex_part, 2, '0', STR_PAD_LEFT);\n }\n $v_NetworkMaskHex = implode(null, $v_NetworkMaskHex_parts);\n unset($v_NetworkMaskHex_part, $v_NetworkMaskHex_parts);\n $v_NetworkMaskBin = inet_pton(implode(':', str_split($v_NetworkMaskHex, 4)));\n\n // We have the network mask so we also apply it to First Address\n $v_FirstAddressBin &= $v_NetworkMaskBin;\n $v_FirstAddressHex = bin2hex($v_FirstAddressBin);\n\n // Convert the last address in hexadecimal\n $v_LastAddressBin = $v_FirstAddressBin | ~$v_NetworkMaskBin;\n $v_LastAddressHex = bin2hex($v_LastAddressBin);\n\n // Return a neat object with information\n $v_Return = array(\n 'Prefix' => \"{$v_FirstAddress}/{$v_PrefixLength}\",\n 'FirstHex' => $v_FirstAddressHex,\n 'LastHex' => $v_LastAddressHex,\n 'MaskHex' => $v_NetworkMaskHex,\n );\n //return (object)$v_Return;\n\t\n\t$primeraipv6 = implode(':', str_split($v_FirstAddressHex, 4));\n\t$ultimaipv6 = implode(':', str_split($v_LastAddressHex, 4));\n\n\t$IpStart_v6_FromDb = $primeraipv6;\n\t$IpEnd_v6_FromDb = $ultimaipv6;\n\n\t$ip1 = $IpStart_v6_FromDb;\n\t$ip2 = $IpEnd_v6_FromDb;\n\tif ($ip1 === null || $ip2 === null) {\n\t\tdie;\n\t}\n\t// length is 39 to account for 7 colons\n\tfor ($i = 0; $i < 39 && $ip1[$i] === $ip2[$i]; $i++);\n\n\t$ipv6_prefix = substr($ip1, 0, $i);\n\t$ipv6_start = hexdec(substr($ip1, $i));\n\t$ipv6_end = hexdec(substr($ip2, $i));\n\n\tif (strlen($ipv6_prefix) < 26) {\n\t\t// adjust this to requirements to prevent too large ranges\n\t\tdie;\n\t}\n\tfor ($a = $ipv6_start; $a <= $ipv6_end; $a++) {\n $hex = dechex($a);\n\t$ipv6shell = $ipv6_prefix.$hex;\n\t\n\t$ipv6sinpuntos = bin2hex(inet_pton($ipv6shell));\n\t$ipv6extconpuntos = implode(':', str_split($ipv6sinpuntos, 4));\n\t\n\t//Consultamos si esta o no en la base de datos, si no esta se añade al dominio y se para la consulta\n\t$consultasihayipv6domain= mysqli_query($mysql_conn,\"SELECT * FROM ipv6_domain WHERE ipv6='$ipv6extconpuntos'\"); \n\tif(mysqli_num_rows($consultasihayipv6domain)!=0) \n\t{\n\t\t//\"Hay\";\n\t}else{\n\t\t//\"No hay\";\n\t\t\n\t\t//Insertar en la base de datos, dominio + ipv6 asignada\n\t\t//Todo parece correcto procedemos con la inserccion de la ipv6\n\t\t$query = \"INSERT INTO ipv6_domain (username, domain, ipv6) VALUES('\".mysqli_real_escape_string($mysql_conn,$usernameipv6).\"','\".mysqli_real_escape_string($mysql_conn,$dominiointroducido).\"','\".mysqli_real_escape_string($mysql_conn,$ipv6extconpuntos).\"')\"; \n\t\t$registro=mysqli_query($mysql_conn,$query) or die(mysqli_error());\n\t\t\n\t\t//Insertamos linea en archivo de configuracion Sn SSL\n\t\tescribirconf($dominiointroducido, $ipv6extconpuntos, \"no\");\n\t\tescribirconf($dominiointroducido, $ipv6extconpuntos, \"ssl\");\n\t\t\n\t\t//Insertamos comando en SSH.\n\t\tshell_exec(\"/sbin/ip -6 addr add \".$ipv6extconpuntos.\" dev eth0\");\n\t\t\n\t\t//Agregamos registro DNS al archivo\n\t\tescribirdns($dominiointroducido, $ipv6extconpuntos);\n\t\t\n\t\t//Reiniciamos NGINX\n\t\tshell_exec(\"service nginx restart\");\n\n\t\tbreak;\n\t}\n\t}\n}", "public static function IPv6Hex2BinDataProviderCorrect() {}", "public static function normalizeCompressIPv6DataProviderCorrect() {}", "static public function ConvertIPv6PackedToAddress($packed)\n {\n\n return inet_ntop($packed);\n\n }", "public function isIpv6($value)\n {\n return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false;\n }", "function ipv6_short( $ip ) {\n\tif( ! strpos( $ip, ':' ) ) {\n\t\treturn $ip;\n\t}\n\n\t$ip_short = inet_ntop( inet_pton( $ip ) );\n\n\tif( ! $ip_short ) {\n\t\treturn $ip;\n\t}\n\n\treturn $ip_short;\n}", "function php_compat_inet_ntop($in_addr)\n{\n switch (strlen($in_addr)) {\n case 4:\n list(,$r) = unpack('N', $in_addr);\n return long2ip($r);\n\n case 16:\n $r = substr(chunk_split(bin2hex($in_addr), 4, ':'), 0, -1);\n $r = preg_replace(\n array('/(?::?\\b0+\\b:?){2,}/', '/\\b0+([^0])/e'),\n array('::', '(int)\"$1\"?\"$1\":\"0$1\"'),\n $r);\n return $r;\n }\n\n return false;\n}", "function ee_inet_pton($str)\n{\n\t$pad_off = -1;\n\n\tif (strpos($str, ':') !== FALSE)\n\t{\n\t\t$parts = explode(':', $str);\n\n\t\tforeach ($parts as $i => &$part)\n\t\t{\n\t\t\tif ($part === '' && $pad_off == -1)\n\t\t\t{\n\t\t\t\t$pad_off = $i;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ipv4 mapped?\n\t\t\tif (strpos($part, '.'))\n\t\t\t{\n\t\t\t\tif ($i + 1 != count($parts))\n\t\t\t\t{\n\t\t\t\t\tshow_error('Invalid IP address.');\n\t\t\t\t}\n\n\t\t\t\t// convert the ipv4 one, unpack as hex, pad, and add\n\t\t\t\t// I'm sure there is a way to just concatenate the binary\n\t\t\t\t// but I can't figure it out right now\n\t\t\t\t$ipv4 = unpack('H*', ee_inet_pton($part));\n\t\t\t\tlist($cur, $next) = str_split(current($ipv4), 4);\n\n\t\t\t\t$part = str_pad($cur, 4, '0', STR_PAD_LEFT);\n\t\t\t\t$parts[$i + 1] = str_pad($next, 4, '0', STR_PAD_LEFT);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$part = str_pad($part, 4, '0', STR_PAD_LEFT);\n\t\t}\n\n\t\tif ($pad_off != -1)\n\t\t{\n\t\t\t$pad_len = 9 - count($parts);\n\t\t\t$zeros = array_fill(0, $pad_len, '0000');\n\t\t\tarray_splice($parts, $pad_off, 1, $zeros);\n\t\t}\n\n\t\t$args = $parts;\n\t\tarray_unshift($args, str_repeat('H4', 8));\n\t\treturn call_user_func_array('pack', $args);\n\t}\n\n\tif (strpos($str, '.'))\n\t{\n\t\treturn pack('N', ip2long($str));\n\t}\n\n\tshow_error('Invalid IP address.');\n}", "public static function ip2long6($ipv6)\n {\n $ip_n = inet_pton($ipv6);\n $bits = 15; // 16 x 8 bit = 128bit\n while ($bits >= 0) {\n $bin = sprintf(\"%08b\", (ord($ip_n[$bits])));\n $ipv6long = $bin . $ipv6long;\n $bits--;\n }\n // Causes error on xampp\n return gmp_strval(gmp_init($ipv6long, 2), 10);\n }", "public function getDestinationAddress(): IPv6Address\n {\n return $this->destination_address;\n }", "private function getIPv4RegexElement()\n : string\n {\n\n return '(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)(?>\\.(?6)){3}';\n\n }", "public static function isIpV6Address($value): void\n {\n assert(\n Validate::isIpV6Address($value),\n static::error('isIpV6Address', ['value' => $value])\n );\n }", "protected function _convertToIPv6($db, $table, $column, $isNull = false)\n {\n // IPv6-compatibly representation\n // ip = UNHEX(CONV(ip, 10, 16))\n\n // Detect if this is a 32bit system\n $is32bit = ( ip2long('200.200.200.200') < 0 );\n $offset = ( $is32bit ? '4294967296' : '0' );\n\n // Describe\n $cols = $db->describeTable($table);\n\n // Update\n if( isset($cols[$column]) && $cols[$column]['DATA_TYPE'] != 'varbinary(16)' ) {\n $temporaryColumn = $column . '_tmp6';\n // Drop temporary column if it already exists\n if( isset($cols[$temporaryColumn]) ) {\n $db->query(sprintf('ALTER TABLE `%s` DROP COLUMN `%s`', $table, $temporaryColumn));\n }\n // Create temporary column\n $db->query(sprintf('ALTER TABLE `%s` ADD COLUMN `%s` varbinary(16) default NULL', $table, $temporaryColumn));\n // Copy and convert data\n $db->query(sprintf('UPDATE `%s` SET `%s` = UNHEX(CONV(%s + %u, 10, 16)) WHERE `%s` IS NOT NULL', $table, $temporaryColumn, $column, $offset, $column));\n // Drop old column\n $db->query(sprintf('ALTER TABLE `%s` DROP COLUMN `%s`', $table, $column));\n // Rename new column\n $db->query(sprintf('ALTER TABLE `%s` CHANGE COLUMN `%s` `%s` varbinary(16) %s', $table, $temporaryColumn, $column, ($isNull ? 'default NULL' : 'NOT NULL')));\n }\n }", "function is_ipv6($ip) {\n\tif (!preg_match(\"/^([0-9a-f\\.\\/:]+)$/\",strtolower($ip))) { return false; }\n\tif (substr_count($ip,\":\") < 2) { return false; }\n\t$part = preg_split(\"/[:\\/]/\",$ip);\n\tforeach ($part as $i) { if (strlen($i) > 4) { return false; } }\n\treturn true;\n}", "function anonimizeIpv4(string $ip):string\n{\n if (isIPv4($ip)) {\n return substr($ip, 0, strrpos($ip, \".\") + 1) . '0';\n }\n return '0.0.0.0';\n}", "function hex2ip($ip_hex)\n{\n $ip = trim($ip_hex, \"\\\"\\t\\n\\r\\0\\x0B\");\n\n // IPv6z, ie: 2a:02:a0:10:80:03:00:00:00:00:00:00:00:00:00:01%503316482\n if (str_contains($ip, '%'))\n {\n list($ip) = explode('%', $ip);\n }\n\n $len = strlen($ip);\n if ($len === 5 && $ip[0] === ' ')\n {\n $ip = substr($ip, 1);\n $len = 4;\n }\n if ($len === 4)\n {\n // IPv4 hex string converted to SNMP string\n $ip = str2hex($ip);\n $len = strlen($ip);\n }\n\n $ip = str_replace(' ', '', $ip);\n\n if ($len > 8)\n {\n // For IPv6\n $ip = str_replace(':', '', $ip);\n $len = strlen($ip);\n }\n\n if (!ctype_xdigit($ip))\n {\n return $ip_hex;\n }\n\n switch ($len)\n {\n case 8:\n // IPv4\n $ip_array = array();\n foreach (str_split($ip, 2) as $entry)\n {\n $ip_array[] = hexdec($entry);\n }\n $separator = '.';\n break;\n\n case 16:\n // Cisco incorrect IPv4 (54 2E 68 02 FF FF FF FF)\n $ip_array = array();\n foreach (str_split($ip, 2) as $i => $entry)\n {\n if ($i == 4) { break; }\n $ip_array[] = hexdec($entry);\n }\n $separator = '.';\n break;\n\n case 32:\n // IPv6\n $ip_array = str_split(strtolower($ip), 4);\n $separator = ':';\n break;\n\n default:\n // Try convert hex string to string\n $ip = snmp_hexstring($ip_hex);\n if (get_ip_version($ip))\n {\n return $ip;\n }\n return $ip_hex;\n }\n $ip = implode($separator, $ip_array);\n\n return $ip;\n}", "static public function GetIPv6BroadcastAddress($ipAndCidr)\n {\n\n $ipAndCidr = static::ConvertIPv6CIDRToBinary($ipAndCidr);\n\n return static::ConvertBinaryToIPv6($ipAndCidr['ip'] | ~$ipAndCidr['subnetMask']);\n\n }", "public function geoip_country_id_by_addr_v6($addr)\n {\n }", "public function ipv6_addr() {\n\t\treturn false;\n\t}", "protected function validateIpv6($field, $value)\n {\n return filter_var($value, \\FILTER_VALIDATE_IP, \\FILTER_FLAG_IPV6) !== false;\n }", "public function ipsVersion6()\n {\n return array(\n array('2001:4860:4860::8844', IP::VERSION_6),\n array('fd0a:238b:4a96::', IP::VERSION_6),\n );\n }", "function ee_inet_ntop($ip)\n{\n\t// unpack the binary\n\t$hex = unpack('H*', $ip);\n\t$hex = current($hex);\n\n\t$len = strlen($hex);\n\n\t// ipv4\n\tif ($len == 8)\n\t{\n\t\t$parts = str_split($hex, 2);\n\t\t$parts = array_map('hexdec', $parts);\n\t\treturn implode('.', $parts);\n\t}\n\n\t// ipv6\n\tif ($len != 32)\n\t{\n\t\tshow_error('Invalid IP address.');\n\t}\n\n\t$parts = str_split($hex, 4);\n\n\t// find the longest run of zeros\n\t$start = -1;\n\t$len = 0;\n\t$best_start = -1;\n\t$best_len = 0;\n\n\tforeach ($parts as $i => &$part)\n\t{\n\t\tif ($part == '0000')\n\t\t{\n\t\t\tif ($start == -1)\n\t\t\t{\n\t\t\t\t$start = $i;\n\t\t\t\t$len = 0;\n\t\t\t}\n\n\t\t\t$len++;\n\t\t}\n\t\telseif ($start != -1 && ($best_start == -1 OR $len > $best_len))\n\t\t{\n\t\t\t$best_start = $start;\n\t\t\t$best_len = $len;\n\t\t\t$start = -1;\n\t\t}\n\t}\n\n\t// didn't move best?\n\tif ($start != -1 && ($best_start == -1 OR $len > $best_len))\n\t{\n\t\t$best_start = $start;\n\t\t$best_len = $len;\n\t}\n\n\t// print out the result\n\t$out = '';\n\n\tforeach ($parts as $i => &$part)\n\t{\n\t\tif ($best_start != -1)\n\t\t{\n\t\t\tif ($i >= $best_start && $i < ($best_start + $best_len))\n\t\t\t{\n\t\t\t\tif ($i == $best_start)\n\t\t\t\t{\n\t\t\t\t\t$out .= ':';\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif ($i)\n\t\t{\n\t\t\t$out .= ':';\n\t\t}\n\n\t\t// ipv4 mapped?\n\t\tif ($i == 6 && $best_start == 0 &&\n\t\t\t($best_len == 6 OR ($best_len == 5 && $parts[5] == 'ffff')))\n\t\t{\n\t\t\t$out .= ee_inet_ntop(pack('H4H4', $parts[6], $parts[7]));\n\t\t\tbreak;\n\t\t}\n\n\t\t// collapse the hex string\n\t\t$out .= sprintf('%x', hexdec($part));\n\t}\n\n\treturn $out;\n}", "public function geoip_country_code_by_addr_v6($addr)\n {\n }", "public function getSourceAddress(): IPv6Address\n {\n return $this->source_address;\n }", "private function _to_binary($addr)\n {\n // all IPv4 go to IPv6 mapped\n if (strpos($addr, ':') === FALSE && strpos($addr, '.') !== FALSE) {\n $addr = '::' . $addr;\n }\n return inet_pton($addr);\n }", "protected function _ipv6(Result $result): bool\n {\n return $result->filterValue(FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n }", "function rebuildipv6 ($mysql_conn){\n\t// Consulta para pedir información de la tabla\n$resultados = mysqli_query($mysql_conn, \"SELECT * FROM ipv6_domain\");\n\n// Ejecuta el ciclo de acuerdo a la consulta SQL $resultados\nwhile ($fila = mysqli_fetch_array($resultados)){\n\t//echo $fila[\"ipv6\"].\" - \".$fila[\"domain\"].\"<br>\";\n\tescribirconf($fila[\"domain\"], $fila[\"ipv6\"], \"no\");\n\tescribirconf($fila[\"domain\"], $fila[\"ipv6\"], \"ssl\");\n\t\n\t//Insertamos comando en SSH.\n\t\tshell_exec(\"/sbin/ip -6 addr add \".$fila[\"ipv6\"].\" dev eth0\");\n}\t\n\t//Reiniciamos NGINX\n\t\tshell_exec(\"service nginx restart\");\n\techo \"<b>Reconstruido correctamente.</b></br>\";\n}", "public static function ipv4($value) {\n\t\treturn (bool) filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\n\t}", "function is_ipv6_valid($ipv6_address, $ipv6_prefixlen = NULL)\n{\n if (str_contains($ipv6_address, '/'))\n {\n list($ipv6_address, $ipv6_prefixlen) = explode('/', $ipv6_address);\n }\n $ip_full = $ipv6_address . '/' . $ipv6_prefixlen;\n\n // False if invalid IPv6 syntax\n if (strlen($ipv6_prefixlen) &&\n !preg_match('%^'.OBS_PATTERN_IPV6_NET.'$%i', $ip_full))\n {\n // Address with prefix\n return FALSE;\n }\n else if (!preg_match('%^'.OBS_PATTERN_IPV6.'$%i', $ipv6_address))\n {\n // Address withot prefix\n return FALSE;\n }\n\n $ipv6_type = get_ip_type($ip_full);\n\n // False if link-local, unspecified or any used defined\n if (in_array($ipv6_type, $GLOBALS['config']['ip-address']['ignore_type']))\n {\n return FALSE;\n }\n\n return TRUE;\n}", "function fw_IPv6Array( $net ) {\n\t$ip\t= \\str_repeat( 'f', $net / 4 );\n\tswitch( $net % 4 ) {\n\t\tcase 1:\n\t\t\t$ip .= '8';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$ip .= 'c';\n\t\t\tbreak;\n\t\t\t\n\t\tcase 3:\n\t\t\t$ip .= 'e';\n\t\t\tbreak;\n\t}\n\t// Fill out mask\n\treturn \\pack( 'H*', \\str_pad( $ip, 32, '0' ) );\n}", "function inet_pton($address)\n{\n return '';\n}", "public static function canonicalize( $addr ) {\n\tif ( IP::isValid( $addr ) )\n\t return $addr;\n\n\t// IPv6 loopback address\n\tif ( preg_match( '/^0*' . RE_IPV6_GAP . '1$/', $addr, $m ) )\n\t return '127.0.0.1';\n\n\t// IPv4-mapped and IPv4-compatible IPv6 addresses\n\tif ( preg_match( '/^' . RE_IPV6_V4_PREFIX . '(' . RE_IP_ADD . ')$/i', $addr, $m ) )\n\t return $m[1];\n\tif ( preg_match( '/^' . RE_IPV6_V4_PREFIX . RE_IPV6_WORD . ':' . RE_IPV6_WORD . '$/i', $addr, $m ) )\n\t return long2ip( ( hexdec( $m[1] ) << 16 ) + hexdec( $m[2] ) );\n\n\treturn null; // give up\n }", "public function validNetworkAddresses6()\n {\n return array(\n array('2000::', 12),\n array('2001:db8::', 59),\n array('2001:db8:0:0:800::', 70),\n array('2001:db8::a60:8a2e:0:0', 99),\n array('2001:db8::a60:8a2e:370:7334', 128),\n );\n }", "public static function check_ipv6($ip)\n {\n }", "public static function check_ipv6($ip)\n {\n }", "function parse_ip4_address($s) {\n\t$octets_s = split(\"\\.\", $s);\n\t$octets = Array();\n\n\t// More than four octets?\n\tif (sizeof($octets_s) != 4) {\n\t\treturn false;\n\t}\n\n\t// Validate each octet.\n\t$i = 0;\n\tforeach ($octets_s as $octet_s) {\n\n\t\t// Validate it's actually an integer\n\t\tif (!preg_match(\"/^[0-9]([0-9]([0-9])?)?$/\", $octet_s)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Convert to integer\n\t\t$int = intval($octet_s);\n\n\t\t// Validate it's an octet\n\t\tif ($int < 0 || $int > 255) {\n\t\t\treturn false;\n\t\t}\n\t\t$octets[$i++] = $int;\n\t}\n\n\t// Valid\n\treturn $octets;\n}", "function ipv62snmp($ipv6)\n{\n $ipv6_ex = explode(':',Net_IPv6::uncompress($ipv6));\n for ($i = 0;$i < 8;$i++) { $ipv6_ex[$i] = zeropad($ipv6_ex[$i],4); }\n $ipv6_ip = implode('',$ipv6_ex);\n for ($i = 0;$i < 32;$i+=2) $ipv6_split[] = hexdec(substr($ipv6_ip,$i,2));\n\n return implode('.',$ipv6_split);\n}", "function hextoip($hex) {\n\t\t\tif (!preg_match(\"/^[0-9a-fA-F]{0,8}$/\", $hex))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\t$revhex = strrev($hex);\n\t\t\t$revchunks = str_split($revhex, 2);\n\t\t\t\n\t\t\tforeach ($revchunks as $index => $value)\n\t\t\t\t$revchunks[$index] = hexdec(strrev($value));\n\n\t\t\twhile (count($revchunks) < 4)\n\t\t\t\t$revchunks[] = \"0\";\n\n\t\t\t$chunks = array_reverse($revchunks);\n\n\t\t\treturn implode(\".\", array_reverse($revchunks));\n\t\t}", "function inet_ntop($in_addr)\n{\n}", "public static function binToHexa(string $ipv6InBinaryFormat): string\n {\n $localString = \"\";\n $localArrayBinary = str_split($ipv6InBinaryFormat, Ipv6address::HEXTET_BIN_LEN);\n\n foreach ($localArrayBinary as $item) {\n $localString .= base_convert($item, 2, 16) . \":\";\n }\n // remove last colon\n return rtrim($localString, \":\");\n }", "function anonimizeIpv4Compatibility(string $ip):string\n{\n if (isIPv4Compatibility($ip)) {\n return substr($ip, 0, strrpos($ip, \".\") + 1) . '0';\n }\n return '0.0.0.0';\n}", "public static function checkIp6($requestIp, $ip) {}", "static public function ConvertIPv6CIDRToMask($cidr)\n {\n\n $subnetMask = str_pad(\"\", $cidr, \"1\");\n\n $subnetMask = str_pad($subnetMask, 128, \"0\");\n\n $subnetMask = array_map(\n function($x) {\n return dechex(bindec($x));\n },\n str_split($subnetMask, 16)\n );\n\n return implode(\":\", $subnetMask);\n\n }", "public function ip6test()\n {\n if (filter_var($this->ipinput, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n return true;\n }\n return false;\n }", "public function testSupportsIpv6()\n {\n if (!defined('AF_INET6')) {\n $this->markTestSkipped('This system does not seem to support IPv6 sockets / addressing');\n }\n }", "public function ipv4_addr() {\n\n\t}", "public static function calculateNetworkAddress(Ipv4subnet $ipv4subnet): Ipv4address\n {\n return Ipv4addressFactory::calculateNetworkOrBroadcastAddress($ipv4subnet,\"0\");\n }", "function generarprimeraipv6delrango ($mysql_conn,$ipv6, $rango){\n\t//Generamos la primera ipv6 del rango y la añadimos a la bd\n$a_Prefix = $ipv6.\"/\".$rango;\n // Validate input superficially with a RegExp and split accordingly\n if(!preg_match('~^([0-9a-f:]+)[[:punct:]]([0-9]+)$~i', trim($a_Prefix), $v_Slices)){\n\t\treturn false;\n }\n // Make sure we have a valid ipv6 address\n if(!filter_var($v_FirstAddress = $v_Slices[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){\n return false;\n }\n // The /## end of the range\n $v_PrefixLength = intval($v_Slices[2]);\n if($v_PrefixLength > 128){\n return false; // kind'a stupid :)\n }\n $v_SuffixLength = 128 - $v_PrefixLength;\n\n // Convert the binary string to a hexadecimal string\n $v_FirstAddressBin = inet_pton($v_FirstAddress);\n $v_FirstAddressHex = bin2hex($v_FirstAddressBin);\n\n // Build the hexadecimal string of the network mask\n // (if the manually formed binary is too large, base_convert() chokes on it... so we split it up)\n $v_NetworkMaskHex = str_repeat('1', $v_PrefixLength) . str_repeat('0', $v_SuffixLength);\n $v_NetworkMaskHex_parts = str_split($v_NetworkMaskHex, 8);\n foreach($v_NetworkMaskHex_parts as &$v_NetworkMaskHex_part){\n $v_NetworkMaskHex_part = base_convert($v_NetworkMaskHex_part, 2, 16);\n $v_NetworkMaskHex_part = str_pad($v_NetworkMaskHex_part, 2, '0', STR_PAD_LEFT);\n }\n $v_NetworkMaskHex = implode(null, $v_NetworkMaskHex_parts);\n unset($v_NetworkMaskHex_part, $v_NetworkMaskHex_parts);\n $v_NetworkMaskBin = inet_pton(implode(':', str_split($v_NetworkMaskHex, 4)));\n\n // We have the network mask so we also apply it to First Address\n $v_FirstAddressBin &= $v_NetworkMaskBin;\n $v_FirstAddressHex = bin2hex($v_FirstAddressBin);\n\n // Convert the last address in hexadecimal\n $v_LastAddressBin = $v_FirstAddressBin | ~$v_NetworkMaskBin;\n $v_LastAddressHex = bin2hex($v_LastAddressBin);\n\n // Return a neat object with information\n $v_Return = array(\n 'Prefix' => \"{$v_FirstAddress}/{$v_PrefixLength}\",\n 'FirstHex' => $v_FirstAddressHex,\n 'LastHex' => $v_LastAddressHex,\n 'MaskHex' => $v_NetworkMaskHex,\n );\n //return (object)$v_Return;*/\n\n//echo \"v_FirstAddressHex: \".implode(':', str_split($v_FirstAddressHex, 4)).\"</br>\";\n$primeraipv6 = implode(':', str_split($v_FirstAddressHex, 4));\n//echo \"v_LastAddressHex: \".implode(':', str_split($v_LastAddressHex, 4)).\"</br>\";\n//var_dump($v_Return);\n\n$IpStart_v6_FromDb = $primeraipv6;\n\t\n\t//echo \"Primera ip del rango es: \".$IpStart_v6_FromDb.\"</br>\";\n////****** FIN Codigo para generar las IPv6 *******/////\n\t\n//Todo parece correcto procedemos con la inserccion de la ipv6\n$query = \"INSERT INTO ipv6 (ipv6, ipv6range) VALUES('\".mysqli_real_escape_string($mysql_conn,$IpStart_v6_FromDb).\"','\".mysqli_real_escape_string($mysql_conn,$rango).\"')\"; \n$registro=mysqli_query($mysql_conn,$query) or die(mysqli_error());\n \necho \"<b> Se ha agregado la IP \".$IpStart_v6_FromDb.\"/\".$rango.\" correctamente.</b></br>\";\n}", "function long2ip($proper_address)\n{\n return 0;\n}", "static public function ConvertIPv6ToBinary($ip)\n {\n\n return inet_pton($ip);\n\n }", "private static function split_v6_v4($ip)\n {\n }", "function ip2hex($ip, $separator = ' ')\n{\n $ip_hex = trim($ip, \" \\\"\\t\\n\\r\\0\\x0B\");\n $ip_version = get_ip_version($ip_hex);\n\n if ($ip_version === 4)\n {\n // IPv4\n $ip_array = array();\n foreach (explode('.', $ip_hex) as $entry)\n {\n $ip_array[] = zeropad(dechex($entry));\n }\n }\n else if ($ip_version === 6)\n {\n // IPv6\n $ip_hex = str_replace(':', '', Net_IPv6::uncompress($ip_hex, TRUE));\n $ip_array = str_split($ip_hex, 2);\n } else {\n return $ip;\n }\n $ip_hex = implode($separator, $ip_array);\n\n return $ip_hex;\n}", "protected static function split_v6_v4($ip)\n {\n }", "function checkIp6($requestIp, $ip) : bool\n{\n if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1'))) {\n throw new \\RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option \"disable-ipv6\".');\n }\n if (false !== strpos($ip, '/')) {\n list($address, $netmask) = explode('/', $ip, 2);\n if ($netmask < 1 || $netmask > 128) {\n return false;\n }\n } else {\n $address = $ip;\n $netmask = 128;\n }\n $bytesAddr = unpack('n*', @inet_pton($address));\n $bytesTest = unpack('n*', @inet_pton($requestIp));\n if (empty($bytesAddr) || empty($bytesTest)) {\n return false;\n }\n for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) {\n $left = $netmask - 16 * ($i - 1);\n $left = ($left <= 16) ? $left : 16;\n $mask = ~(0xffff >> $left) & 0xffff;\n if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) {\n return false;\n }\n }\n return true;\n}", "protected function isValidV6($value)\n {\n if (!preg_match('/^[0-9a-fA-F]{0,4}(:[0-9a-fA-F]{0,4}){1,5}((:[0-9a-fA-F]{0,4}){1,2}|:([\\d\\.]+))$/', $value, $matches)) {\n return false;\n }\n\n // allow V4 addresses mapped to V6\n if (isset($matches[4]) && !$this->isValidV4($matches[4])) {\n return false;\n }\n\n // \"::\" is only allowed once per address\n if (($offset = strpos($value, '::')) !== false) {\n if (strpos($value, '::', $offset + 1) !== false) {\n return false;\n }\n }\n\n return true;\n }", "function hex2ip($ip)\r\n\t{\r\n\t\treturn long2ip(hexdec($ip));\r\n\t}", "function bbc_hex2ip($str) {\n if (!preg_match(\":[a-fA-F0-9]{8}:\", $str)) return $str;\n\n $arr = explode(\".\", wordwrap($str, 2, \".\", 2));\n\n for ($i = 0, $k = count($arr); $i < $k; $i++) $arr[$i] = trim(hexdec($arr[$i]));\n return ($arr[0].\".\".$arr[1].\".\".$arr[2].\".\".$arr[3]);\n }", "function inet_ntop($in_addr)\n{\n return '';\n}", "public function address($ip4 = null);", "function long2ip($proper_address)\n{\n\treturn 0;\n}", "static public function GetIPv4NetworkAddress($ipAndCidr)\n {\n\n $ipAndCidr = static::ConvertIPv4CIDRToDecimal($ipAndCidr);\n\n return static::ConvertDecimalToIPv4($ipAndCidr['ip'] & $ipAndCidr['subnetMask']);\n\n }", "public static function ip($value, $allow_ipv6 = true) {\n\t\treturn self::ipv4($value) || ($allow_ipv6 && self::ipv6($value));\n\t}", "protected function isIpv6Host(string $ipv6): bool\n {\n if ('][' !== substr($ipv6.$ipv6, strlen($ipv6) - 1, 2)) {\n return false;\n }\n\n $ipv6 = substr($ipv6, 1, -1);\n if (false === ($pos = strpos($ipv6, '%'))) {\n return (bool) filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n }\n\n $scope = rawurldecode(substr($ipv6, $pos));\n if (strlen($scope) !== strcspn($scope, '?#@[]')) {\n return false;\n }\n\n $ipv6 = substr($ipv6, 0, $pos);\n if (!filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n return false;\n }\n\n $reducer = function (string $carry, string $char): string {\n return $carry.str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);\n };\n\n $res = array_reduce(str_split(unpack('A16', inet_pton($ipv6))[1]), $reducer, '');\n\n return substr($res, 0, 10) === self::LOCAL_LINK_PREFIX;\n }", "public function isIp6()\r\n {\r\n return strlen($this->binIp) == 16;\r\n }", "public static function binaryToHexa(string $binaryV6Address): Ipv6address\n {\n // input must be only in binary format and length must be 128 bits\n if (filter_var($binaryV6Address, FILTER_VALIDATE_REGEXP,\n array(\n \"options\" => array(\n \"regexp\" => '/[0,1]/'\n )))\n and\n filter_var(strlen($binaryV6Address), FILTER_VALIDATE_INT, array(\n 'options' => array(\n 'min_range' => Ipv6address::IPV6_BIN_LEN,\n 'max_range' => Ipv6address::IPV6_BIN_LEN\n )))) {\n\n $inputIpArray = str_split($binaryV6Address, Ipv6address::HEXTET_BIN_LEN);\n $ipOutput = \"\";\n foreach ($inputIpArray as $hextet) {\n $ipOutput .= base_convert($hextet, 2, 16) . \":\";\n }\n return new Ipv6address(substr($ipOutput, 0, -1));\n } else {\n throw new InvalidArgumentException(\"Input is not in valid format\");\n }\n }", "function user_hex2ip()\r\n\t{\r\n\t\treturn long2ip(hexdec(user_ip2hex()));\r\n\t}", "public function createIcmp6()\n {\n return $this->create(AF_INET6, SOCK_RAW, 58 /*getprotobyname('icmp')*/);\n }", "public function validBroadcastAddresses6()\n {\n return array(\n array('200f:ffff:ffff:ffff:ffff:ffff:ffff:ffff', 12),\n array('2001:db8:0:1f:ffff:ffff:ffff:ffff', 59),\n array('2001:db8::bff:ffff:ffff:ffff', 70),\n array('2001:db8::a60:8a2e:1fff:ffff', 99),\n array('2001:db8::a60:8a2e:370:7334', 128),\n );\n }", "public static function is_ipv6($s)\n {\n return is_int(strpos($s, \":\"));\n }", "public function createUdp6()\n {\n return $this->create(AF_INET6, SOCK_DGRAM, SOL_UDP);\n }", "public static function ipv6ToNum($ip) {\n\t\t$binaryNum = '';\n\t\tforeach (unpack('C*', inet_pton($ip)) as $byte) {\n\t\t\t$binaryNum .= str_pad(decbin($byte), 8, \"0\", STR_PAD_LEFT);\n\t\t}\n\t\t$binToInt = base_convert(ltrim($binaryNum, '0'), 2, 10);\n\n\t\treturn $binToInt;\n\t}", "public function getIpV6()\n {\n return $this->ip_v6;\n }", "function rr_validate_ip6(&$errors, &$ip)\n{\n\t/* List of valid characters for an IPv6 address */\n\t$valid_chars = \"ABCDEFabcdef1234567890:\";\n\n\t/* Make sure all characters are valid */\n\tif (strspn($ip, $valid_chars) != strlen($ip))\n\t{\n\t\t$errors[] = \"Format of IPv6 address (in resource record data) is invalid.\";\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "function fw_inIPv6Range( $ip, $subnet ) {\n\t// Set default subnet to 64\n\tif ( !fw_has( $subnet, '/' ) ) {\n\t\t$subnet .= '/64';\n\t}\n\t\n\tlist( $range, $mask ) = \\explode( '/', $subnet, 2 );\n\t$sbit\t= \\inet_pton( $ip );\n\t\n\treturn \n\t( $sbit & fw_IPv6Array( $mask ) ) == \\inet_pton( $range );\n}", "public function isIpv4($value)\n {\n return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;\n }", "static function getIPFromInterface(string $dev) : IPv4Address\r\n {\r\n $output = shell_exec('/sbin/ifconfig '.$dev.' | grep \\'inet addr:\\' | cut -d: -f2 | awk \\'{ print $1}\\'');\r\n\r\n // remove the last char (since its a new line)\r\n $output = substr($output,0,-1);\r\n\r\n // Get the ip\r\n $ip = (new IPv4Address())->setIpFromString($output);\r\n\r\n // is it a ipv4 respons (should be)\r\n if (!$ip instanceof IPv4Address) {\r\n throw new InvalidIpAddress('on '.$dev.' '.$output);\r\n }\r\n\r\n // Return the ipv4 address\r\n return $ip;\r\n }", "public function ip2ulong(string $ipv4)\n {\n return sprintf('%u', ip2long($ipv4));\n }", "static public function hex2ip($hex)\r\n\t{\r\n\t\t$aHex = explode('.', chunk_split($hex, 2, '.'));\r\n\r\n\t\t$aReturn = array ();\r\n\r\n\t\tif (count($aHex) > 0)\r\n\t\t{\r\n\t\t\tforeach ($aHex as $field)\r\n\t\t\t{\r\n\t\t\t\tif (!empty($field))\r\n\t\t\t\t{\r\n\t\t\t\t\t$aReturn[] = hexdec($field);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn implode('.', $aReturn);\r\n\t}", "public function getActualIpv4()\n\t\t{\n\t\t\t$ip = $this->getIp();\n\t\t\t\n\t\t\tif(\n\t\t\t\t($pos = mb_strripos($ip, '.') )\n\t\t\t)\n\t\t\t{\n\t\t\t\t$ip = mb_substr($ip, 0, $pos).'.0';\n\t\t\t}\n\t\t\t\n\t\t\treturn $ip;\n\t\t}", "public function v6networkAddresses($expected, $cidr)\n {\n $ip = new IP('2001:db8::a60:8a2e:370:7334');\n $this->assertSame($expected, $ip->getNetworkIp($cidr)->getShortAddress());\n }" ]
[ "0.7253605", "0.67608315", "0.67470074", "0.66777277", "0.6631157", "0.64598155", "0.6455496", "0.6398096", "0.6361286", "0.6187016", "0.61747956", "0.61261535", "0.6124681", "0.61190546", "0.609671", "0.6062921", "0.6050617", "0.60449106", "0.6041844", "0.6026315", "0.5940286", "0.593319", "0.5930369", "0.59286845", "0.5919743", "0.58909935", "0.5874366", "0.5815823", "0.578793", "0.57822824", "0.5746249", "0.574594", "0.56824017", "0.5675796", "0.56682837", "0.5668135", "0.56653917", "0.5647132", "0.56390053", "0.56340504", "0.5631622", "0.5627605", "0.56191593", "0.5588706", "0.55876285", "0.5569119", "0.55607986", "0.55406415", "0.5537695", "0.55350155", "0.55103654", "0.55042315", "0.54941994", "0.54938585", "0.54938585", "0.5467773", "0.54638565", "0.5461583", "0.54555094", "0.5441009", "0.54282445", "0.54034275", "0.53920716", "0.5375213", "0.5364276", "0.53301", "0.5323262", "0.5322338", "0.5319722", "0.5305276", "0.52855504", "0.5274077", "0.5273668", "0.5272346", "0.52587503", "0.52545273", "0.5240845", "0.52119726", "0.5210326", "0.5199567", "0.519772", "0.5193459", "0.5184672", "0.517772", "0.5168661", "0.51674414", "0.5153394", "0.51454365", "0.51225066", "0.51152456", "0.5114859", "0.5105249", "0.50848544", "0.5068341", "0.5062701", "0.5060221", "0.50489736", "0.50471425", "0.50285476", "0.50272816" ]
0.76246476
0
Get Parent This field type is based on EntityType
Получить родителя. Тип этого поля основан на EntityType
public function getParent() { return 'entity'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParentType()\n\t{\n\t\treturn $this->_parentType;\n\t}", "public function getParentType() : string\n {\n return $this->parentType;\n }", "public function parentEntity();", "public function getParentField()\r\n\t{\r\n\t\treturn $this->parentField;\r\n\t}", "public function getRelatedEntityType();", "public function getParent($post_type)\n {\n $fieldname = \"\";\n if(is_a($post_type, 'Sweetapple_Posttype')){\n $fieldname = $post_type->getPostname();\n }else{\n $fieldname = $post_type;\n }\n //Check if we already have a parent set...\n $parent = $this->{$fieldname};\n if($parent) return $parent;\n //Otherwise load it...\n if( function_exists('wpcf_pr_post_get_belongs')){\n if(is_a($post_type, 'Sweetapple_Posttype')){\n $parent_id = wpcf_pr_post_get_belongs($this->ID, $post_type->getPostname());\n $post = get_post($parent_id);\n $post_type->setValues( (array)$post );\n $parent = $post_type;\n }else{\n $parent_id = wpcf_pr_post_get_belongs($this->ID, $post_type);\n $parent = get_post($parent_id);\n\n }\n\n if($parent){\n $this->{$fieldname} = $parent;\n return $parent;\n }\n }\n\n return false;\n }", "function getParentEntity() {\n\t\tif ($this->parent_guid)\n\t\t\treturn get_entity($this->parent_guid);\n\t}", "public function parent()\n {\n if ($this->parent_id !== null) return ComponentType::find($this->parent_id);\n return null;\n }", "public function getParentType(): ?string;", "public function get_parent() {\n\t\treturn apply_filters( 'socialchef_entity_parent', absint( $this->post->post_parent ), $this );\n\t}", "private function _parent()\n {\n $class = static::extendsFrom();\n return $this->hasOne($class::className(), [$this->parentPrimaryKey() => $this->parentAttribute()]);\n }", "public function getParent()\n {\n return $this->hasOne(SpaceType::className(), ['id' => 'parent_id']);\n }", "public function getLogParentEntity();", "public function getParentEditableFormField() {\n\t\t$submission = $this->owner->Parent();\n\t\t$form = $submission->Parent();\n\t\t$field = $form->Fields()->filter('Name', $this->owner->Name)->First();\t\n\n\t\treturn $field;\n\t}", "public function getParent() {\n return HiddenType::class;\n }", "protected abstract function getEntityType();", "function get_parent() {\n\t\treturn $this->get_mapped_property( 'parent' );\n\t}", "abstract public function getEntityType();", "public function getParentClass() {\n\t\treturn $this->dataQuery->getQueryParam('Parent.Class');\n\t}", "public function getParentIdFieldName()\n {\n return $this->prototype->getParentIdFieldName();\n }", "public function getType() {\n return $this->entity->getEntityTypeId();\n }", "public function getParentAttribute() {\n\n\t\tif ( !$this->parentObject && $this->post_parent ) {\n\n\t\t\t// Query database for fields\n\t\t\t$this->parentObject = get_post( $this->post_parent );\n\n\t\t\tif ( $this->parentObject ) {\n\t\t\t\t$this->parentObject = new self( $this->parentObject );\n\t\t\t}\n\n\t\t}\n\n\t\treturn $this->parentObject;\n\t}", "private function create_parent_entity($parententitytype = null, $parentrecord = null, $parentreffield = null) {\n global $CFG;\n require_once($CFG->dirroot.'/elis/program/lib/setup.php');\n\n if ($parententitytype !== null && $parentrecord !== null && $parentreffield !== null) {\n require_once(elispm::lib('data/'.$parententitytype.'.class.php'));\n\n $parent = new $parententitytype($parentrecord);\n $parent->save();\n return $parent->id;\n }\n\n return null;\n }", "function entity_toolbox_entity_parent_properties_get_info($entity_type = NULL) {\n $CACHEKEY = ENTITY_TOOLBOX__PARENT_PROPERTY_INFO;\n /**\n * Cached since used very often.\n */\n static $drupal_static_fast;\n if (!isset($drupal_static_fast)) {\n $drupal_static_fast['parent_property_info'] = &drupal_static(__FUNCTION__);\n }\n\n $parent_property_info = &$drupal_static_fast['parent_property_info'];\n if (empty($parent_property_info)) {\n if ($cache = entity_toolbox_cache_get($CACHEKEY)) {\n $parent_property_info = $cache->data;\n }\n else {\n $parents = array();\n foreach (entity_toolbox_get_info() as $type => $info) {\n foreach ($info['properties'] as $prop_name => $prop_info) {\n if (is_property_parent($type, $prop_name)) {\n $parents[$type][$prop_name] = $prop_info['reference'];\n }\n }\n }\n $parent_property_info = $parents;\n entity_toolbox_cache_set($CACHEKEY, $parent_property_info);\n }\n }\n\n return isset($entity_type) ? !empty($parent_property_info[$entity_type]) ? $parent_property_info[$entity_type] : array() : $parent_property_info;\n}", "public function getParent() {\n return $this->record->getParent();\n }", "public function getEntityType() {\n return $this->entityType;\n }", "public function getEntityType() {\n return $this->entityType;\n }", "public function get_entity_type() {\n\t\treturn $this->entity_type;\n\t}", "protected function get_parent_column() {\n\t\treturn ( 'user' === $this->parent_type ) ? 'user_id' : 'post_id';\n\t}", "public function entityType() {\n return $this->decorated->entityType();\n }", "public function getAncestorField()\n {\n return $this->ancestor_field;\n }", "public function getEntityParentModel(){\n return 'Mage_Core_Model_Abstract';\n }", "public function getParent() {\n if ($this->getDecorator())\n return \"DataExtension\";\n return $this->get('Parent') ? $this->get('Parent') : \"DataObject\";\n }", "public function getParent()\n {\n return RestChoiceType::class;\n }", "public function parent()\n {\n return $this->belongsTo(static::class, $this->getParentColumn());\n }", "public function getType()\n {\n $this->loadManyToOne('type');\n return $this->type;\n }", "public static function getTypeParent(): string\n {\n return static::CAP_TYPE_PARENT;\n }", "public function baseEntityType(): ?IEntityType;", "public function getParent()\n {\n return $this->hasOne(self::className(), ['id' => 'parent_id']);\n }", "public function getEntityType()\n {\n return $this->entityType;\n }", "public function getEntityType()\n {\n return $this->entityType;\n }", "public function getDataWithTypeParentRecordNumber() {}", "public function getParent() : ?ContentType\n {\n $key = $this->getParentId();\n\n if (empty($key)) {\n return null;\n }\n\n return ContentType::Store()->getById($key);\n }", "public function getParent() {\n\t\treturn $this->getAsModel('parent');\n\t}", "function getParentId() {\n return $this->getFieldValue('parent_id');\n }", "function get_parent_class_name() {\n\t\treturn get_parent_class($this);\n\t\t\n\t}", "public function entityType() {}", "public function entityType() {}", "public function field_type()\n {\n return $this->belongsTo('Shagyt\\lvcrud\\Models\\FieldType');\n }", "public function getParentEntityId()\n {\n $value = $this->get(self::PARENTENTITYID);\n return $value === null ? (string)$value : $value;\n }", "protected function getEntityTypeId() {\n if (is_callable([$this->view, 'getBaseEntityType'])) {\n $entity_type = $this->view->getBaseEntityType();\n if ($entity_type && is_callable([$entity_type, 'id'])) {\n return $entity_type->id();\n }\n }\n if (isset($this->configuration['target_type'])) {\n return $this->configuration['target_type'];\n }\n return NULL;\n }", "function rebuildParentType() {\n \t$rows = $this->utility->db->execute_all('SELECT DISTINCT parent_id FROM ' . TABLE_PREFIX . 'project_objects WHERE parent_id IS NOT NULL');\n \tif(is_foreachable($rows)) {\n \t foreach($rows as $row) {\n \t $type = array_var($this->utility->db->execute_one('SELECT type FROM ' . TABLE_PREFIX . 'project_objects WHERE id = ?', array($row['parent_id']), 'type'));\n \t if($type) {\n \t $this->utility->db->execute('UPDATE ' . TABLE_PREFIX . 'project_objects SET parent_type = ? WHERE parent_id = ?', array($type, $row['parent_id']));\n \t } // if\n \t } // foreach\n \t} // if\n \t\n \treturn true;\n }", "public function parent()\n {\n return $this->belongsTo(\n $this->parent_is_group ? Group::class : Table::class,\n 'parent_id'\n );\n }", "public function parent()\n {\n $parent = $this->getRealClass()->getParentClass();\n if ($parent) return $parent->name;\n \n return null;\n }", "public function get_parent()\n {\n }", "public function getParentClass() {}", "public function getParentClass() {}", "public function get_class_name()\n {\n if (isset($this->_id)) \n {\n return $this->_id;\n }\n //if there is no model\n if ($this->is_core())\n {\n $model = Supermodlr::get_name_case(self::scfg('core_prefix')).'_';\n }\n //if this field is for a specific model, get the model name from its class name\n else\n {\n $model = Supermodlr::get_name_case($this->model->name).'_'; \n }\n $field = '';\n //@todo convet below code to use submodels\n //if this is a field on a field (keyed array) example: field_company_address_line1\n /*if ($this->parentfield !== NULL)\n {\n $parentfield = $this->parentfield['_id'];\n $parents = array();\n while ($parentfield !== NULL) \n {\n $Parent_Field = new model_field($parentfield);\n if ($Parent_Field->loaded()) \n {\n //add this parent to the list of parents\n $parents[] = $Parent_Field->name;\n\n //if this parent also has a parent\n if ($Parent_Field->parentfield !== NULL)\n {\n //populate same variable for next time through loop\n $parentfield = $Parent_Field->parentfield['_id'];\n unset($Parent_Field);\n }\n //this parent does not have a parent. we have found all parents\n else\n {\n $parentfield = NULL;\n } \n }\n //if parent field wasn't loaded for some reason\n else\n {\n $parentfield = NULL;\n }\n\n }\n\n //if we have at least 1 parent\n if (count($parents) > 0)\n {\n $field = implode('_',$parents).'_'; \n }\n //no valid parents found\n else\n {\n $field = '';\n }\n }\n //if this is a root field, and not a field on a field\n else\n {\n $field = '';\n }*/ \n\n return 'Field_'.$model.Supermodlr::get_name_case($this->name);\n }", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParentModel()\n {\n return $this->parent_model;\n }", "public function getEntityTypeId() {\n return $this->entity->getEntityTypeId();\n }", "public function getParentClass()\n {\n return $this->_parentClass;\n }", "public function getParentId() {\n return $this->record->getParentId();\n }", "protected function ParentID() {\n\treturn $this->GetFieldValue('ID_Parent');\n }", "public function get_parent()\n {\n return parent::get_parent();\n }", "protected function ParentRecord() {\n\treturn $this->Table()->GetItem($this->ParentID());\n }", "public function getParentContentObject() {}", "public function getType(): EntityType\n {\n return $this->type;\n }", "public function getInnerType();", "public function getEntityTypeId()\n {\n return $this->getAttribute('entity_id');\n }", "public function getDrupalEntityType() {\n return $this->cdf->getDrupalEntityType();\n }", "public function getParent()\n {\n }", "public function getParentId() {}", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "protected function getNameFromParent()\n {\n $base = $this->gridField;\n $name = [];\n\n do {\n array_unshift($name, $base->getName());\n $base = $base->getForm();\n } while ($base && !($base instanceof Form));\n\n return implode('.', $name);\n }", "public function getRefEntityType();", "public function getSourceEntityType()\n {\n return $this->_sourceEntityType;\n }", "public function entity()\n {\n if ($this->entity_type === '') {\n $this->entity_type = null;\n }\n return $this->morphTo('entity');\n }", "public function parent()\n {\n return $this->belongsTo('Modules\\Configuration\\Entities\\Module', 'parent_id');\n }", "public function getEntityTypeId()\n {\n return $this->_entityTypeId;\n }", "protected function getParent()\r\n\t{\r\n\t\tif(is_int($this->parent)){\r\n\t\t\treturn $this->parent = new self(get_comment($this->parent));\r\n\t\t}else{\r\n\t\t\treturn $this->parent;\r\n\t\t}\r\n\t}", "function getParentClass() {\n return $this->extends->getParentClass();\n }", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();" ]
[ "0.72384286", "0.695221", "0.6924217", "0.69008815", "0.68063927", "0.67479074", "0.6738022", "0.6728672", "0.66585475", "0.66564125", "0.6545297", "0.65173423", "0.65106696", "0.64827955", "0.6432073", "0.6427356", "0.64234704", "0.63716424", "0.634737", "0.63140976", "0.62642026", "0.62498915", "0.6238875", "0.620142", "0.61673397", "0.6165459", "0.6165459", "0.6151326", "0.6132332", "0.61189634", "0.6114855", "0.60804534", "0.6075049", "0.6056814", "0.6037246", "0.6031215", "0.60308754", "0.601131", "0.60086524", "0.6006454", "0.6006454", "0.6003226", "0.6001661", "0.6001544", "0.5998897", "0.599508", "0.5990142", "0.5990142", "0.59812963", "0.5980668", "0.597317", "0.5964947", "0.59640443", "0.5954766", "0.59518814", "0.5948358", "0.5948358", "0.5942949", "0.5942632", "0.5942632", "0.5942632", "0.5942632", "0.5942632", "0.59245694", "0.589821", "0.58927727", "0.58926725", "0.5877618", "0.586648", "0.5858044", "0.5853659", "0.585337", "0.5843062", "0.5835378", "0.5831909", "0.5831486", "0.5828669", "0.5827655", "0.5811276", "0.58101183", "0.58095396", "0.5802957", "0.5802707", "0.5792743", "0.57908666", "0.57802016", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032", "0.5778032" ]
0.75318795
0